Skip to content

Commit

Permalink
Member billing, improve invoice display title
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thibaudgg committed Jan 26, 2025
1 parent b41f430 commit 314e9ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/helpers/invoices_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions config/locales/billing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 314e9ea

Please sign in to comment.