fix: print the posted discount and tax amounts
ERPNext takes an Additional Discount off the items' net amounts and, for a discount on Grand Total, splits it between net and taxes: each charge is booked at tax_amount_after_discount_amount and Total Taxes and Charges sums those. The print showed the discount as entered and the pre-discount tax_amount, so on a Grand Total discount the VAT line disagreed with the invoice. The totals includes now print the discount's net share (sum of item.distributed_discount_amount), Net Total, and each charge after discount, so the lines add up to Grand Total whichever total the discount applies on and with inclusive or exclusive tax. A discount that is not distributed (cash / non-trade) stays after the charges.
This commit is contained in:
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user