Update Xero Invoices scopes for taxable fees

Taxable enterprise fee adjustments now have a tax_category
This commit is contained in:
Matt-Yorkley
2021-06-04 20:35:31 +01:00
parent 7bcb0bcaa8
commit 7b641ace23

View File

@@ -188,11 +188,11 @@ module OpenFoodNetwork
end
def total_untaxable_fees(order)
order.all_adjustments.enterprise_fee.without_tax.sum(:amount)
order.all_adjustments.enterprise_fee.where(tax_category: nil).sum(:amount)
end
def total_taxable_fees(order)
order.all_adjustments.enterprise_fee.with_tax.sum(:amount)
order.all_adjustments.enterprise_fee.where.not(tax_category: nil).sum(:amount)
end
def total_shipping(order)