From 3cfa7e29d1504c2130dcb7a6e1494417b2e2de99 Mon Sep 17 00:00:00 2001 From: Gaetan Craig-Riou Date: Mon, 22 Jan 2024 12:58:54 +1100 Subject: [PATCH] Add the enterprise fee tax to amount with taxes --- app/models/invoice/data_presenter/line_item.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/invoice/data_presenter/line_item.rb b/app/models/invoice/data_presenter/line_item.rb index 2e46936c7e..a364bf2d61 100644 --- a/app/models/invoice/data_presenter/line_item.rb +++ b/app/models/invoice/data_presenter/line_item.rb @@ -4,7 +4,7 @@ class Invoice class DataPresenter class LineItem < Invoice::DataPresenter::Base attributes :added_tax, :currency, :included_tax, :price_with_adjustments, :quantity, - :variant_id, :unit_price_price_and_unit, :unit_presentation + :variant_id, :unit_price_price_and_unit, :unit_presentation, :enterprise_fee_tax attributes_with_presenter :variant array_attribute :tax_rates, class_name: 'TaxRate' invoice_generation_attributes :added_tax, :included_tax, :price_with_adjustments, @@ -17,7 +17,8 @@ class Invoice end def amount_with_adjustments_and_with_taxes - ( price_with_adjustments * quantity) + added_tax + fee_tax = enterprise_fee_tax || 0.00 + ( price_with_adjustments * quantity) + added_tax + fee_tax end def display_amount_with_adjustments_without_taxes