mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Simplify Order#total_tax to cover all taxes from all sources
This commit is contained in:
@@ -662,9 +662,7 @@ module Spree
|
||||
end
|
||||
|
||||
def total_tax
|
||||
adjustments.sum(:included_tax) +
|
||||
shipment_adjustments.sum(:included_tax) +
|
||||
line_item_adjustments.tax.sum(:amount)
|
||||
additional_tax_total + included_tax_total
|
||||
end
|
||||
|
||||
def has_taxes_included
|
||||
|
||||
@@ -699,7 +699,7 @@ describe Spree::Order do
|
||||
amount: 123,
|
||||
included_tax: 2
|
||||
)
|
||||
order.reload
|
||||
order.update!
|
||||
end
|
||||
|
||||
it "returns a sum of all tax on the order" do
|
||||
|
||||
Reference in New Issue
Block a user