11768: fix the amount with voucher

This commit is contained in:
Ahmed Ejaz
2024-01-19 01:40:25 +05:00
parent 3a8e4d203a
commit ff48825241

View File

@@ -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)