From 314e9ea442183dff4f1f51912ef691a2c58bc8ce Mon Sep 17 00:00:00 2001 From: Thibaud Guillaume-Gentil Date: Sun, 26 Jan 2025 19:15:32 +0100 Subject: [PATCH] Member billing, improve invoice display title This patch improves how membership invoice title are displayed to include the membership fiscal year and the number of the billing year division. The shop order invoice title are also made shorter. --- app/helpers/invoices_helper.rb | 6 ++++++ config/locales/billing.yml | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/app/helpers/invoices_helper.rb b/app/helpers/invoices_helper.rb index 257188b3..ea8d7120 100644 --- a/app/helpers/invoices_helper.rb +++ b/app/helpers/invoices_helper.rb @@ -10,6 +10,12 @@ def entity_type_collection def display_entity(invoice, link: true) if link && invoice.entity auto_link invoice.entity + elsif invoice.entity_type == "Membership" + t("billing.membership_entity", + fiscal_year: invoice.entity.fiscal_year, + number: invoice.memberships_amount_description[/#\d+\z/]) + elsif invoice.entity_type == "Shop::Order" + t("shop.title") else t_invoice_entity_type(invoice.entity_type) end diff --git a/config/locales/billing.yml b/config/locales/billing.yml index cdf4c22b..d146ec5e 100644 --- a/config/locales/billing.yml +++ b/config/locales/billing.yml @@ -56,6 +56,11 @@ _: _en: 'Quarterly billing #%{number}' _fr: 'Facturation trimestrielle #%{number}' _it: 'Fatturazione trimestrale #%{number}' + membership_entity: + _de: Abo. %{fiscal_year} %{number} + _en: Membership %{fiscal_year} %{number} + _fr: Abo. %{fiscal_year} %{number} + _it: Abbo. %{fiscal_year} %{number} memberships_total: _de: Abonnements gesamt _en: Total memberships