From 7b641ace23ec3811023dcad6a238690a9da07cf9 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Fri, 4 Jun 2021 20:35:31 +0100 Subject: [PATCH] Update Xero Invoices scopes for taxable fees Taxable enterprise fee adjustments now have a tax_category --- lib/open_food_network/xero_invoices_report.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/open_food_network/xero_invoices_report.rb b/lib/open_food_network/xero_invoices_report.rb index 93b7dbb4e2..a92c133607 100644 --- a/lib/open_food_network/xero_invoices_report.rb +++ b/lib/open_food_network/xero_invoices_report.rb @@ -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)