diff --git a/app/models/invoice/data_presenter.rb b/app/models/invoice/data_presenter.rb index 708235968cd..d318d62fdf1 100644 --- a/app/models/invoice/data_presenter.rb +++ b/app/models/invoice/data_presenter.rb @@ -105,6 +105,10 @@ def display_date I18n.l(invoice_date.to_date, format: :long) end + def display_tax_adjustment_total + Spree::Money.new(all_tax_adjustments.map(&:amount).sum, currency:) + end + def tax_adjustment_totals all_tax_adjustments.each_with_object(Hash.new(0)) do |adjustment, totals| totals[adjustment.originator.id] += adjustment.amount diff --git a/app/views/spree/admin/orders/_invoice_table4.html.haml b/app/views/spree/admin/orders/_invoice_table4.html.haml index 0a3a234d34f..ffd413a4c94 100644 --- a/app/views/spree/admin/orders/_invoice_table4.html.haml +++ b/app/views/spree/admin/orders/_invoice_table4.html.haml @@ -73,6 +73,12 @@ = t(:tax_total, rate: tax[:percentage]) %td{:align => "right", :colspan => "2"} = tax[:amount] + %tr + %td{:align => "right", :colspan => "5"} + = t(:total_all_tax) + %td{:align => "right", :colspan => "2"} + = @order.display_tax_adjustment_total + %tr %td{:align => "right", :colspan => "5"} %strong= t(:total_incl_tax) diff --git a/config/locales/en.yml b/config/locales/en.yml index 382bc7ab2e6..467a7684dcd 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1888,6 +1888,7 @@ en: invoice_shipping_type: "Type:" total_excl_tax: "Total (Excl. tax):" total_incl_tax: "Total (Incl. tax):" + total_all_tax: "Total tax:" abn: "ABN:" acn: "ACN:" invoice_issued_on: "Invoice issued on:"