Skip to content

Commit

Permalink
Add the enterprise fee tax to amount with taxes
Browse files Browse the repository at this point in the history
  • Loading branch information
rioug committed Jan 22, 2024
1 parent ba841d9 commit 3cfa7e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/invoice/data_presenter/line_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -17,7 +17,8 @@ def amount_with_adjustments_without_taxes
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
Expand Down

0 comments on commit 3cfa7e2

Please sign in to comment.