Use VoucherAdjustmentsService to retrieve tax part of the voucher

This commit is contained in:
Gaetan Craig-Riou
2023-09-18 14:45:13 +02:00
parent 7c34145ed7
commit bec5ad55dd
2 changed files with 2 additions and 5 deletions

View File

@@ -159,10 +159,8 @@ module Reporting
end
def voucher_tax_adjustment(order)
included_tax_voucher_adjustment = order.voucher_adjustments.first&.included_tax || 0
excluded_tax_voucher_adjustment = order.all_adjustments.voucher_tax.first&.amount || 0
included_tax_voucher_adjustment + excluded_tax_voucher_adjustment
VoucherAdjustmentsService.new(order).voucher_included_tax +
VoucherAdjustmentsService.new(order).voucher_excluded_tax
end
def first_name(query_result_row)