From ff488252414ca4ba41c9808701cdce7d75de6226 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Fri, 19 Jan 2024 01:40:25 +0500 Subject: [PATCH] 11768: fix the amount with voucher --- .../enterprise_fees_with_tax_report_by_order.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb index a250dce9c6..e035a2d469 100644 --- a/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb +++ b/lib/reporting/reports/enterprise_fee_summary/enterprise_fees_with_tax_report_by_order.rb @@ -228,8 +228,7 @@ module Reporting .where(order:) .where(originator_id: enterprise_fee_id(query_result_row)) .pick("sum(amount)") || 0 - total_excl_tax_amount = amount - tax(query_result_row, all: true, included: true) - apply_voucher_on_amount(order, total_excl_tax_amount) + apply_voucher_on_amount(order, amount) - tax(query_result_row, all: true, included: true) end def tax(query_result_row, all: false, included: nil)