{#- ERPNext's templates/print_formats/includes/taxes.html, printing the amounts that are posted. ERPNext takes an Additional Discount off the items' net amounts (item.distributed_discount_amount; a discount on Grand Total is split between net and taxes) and books each charge at tax_amount_after_discount_amount, while upstream prints the discount as entered and the pre-discount tax_amount, so the lines do not add up to Grand Total. Inclusive tax with a discount on Grand Total: the Total line is the tax-inclusive item total and the discount is printed as entered; Total After Discount is then broken down into Net Total and the charges. Otherwise the Total line is the net before the discount, so the discount is its net share, followed by Net Total and the charges. A discount that is not distributed (cash / non-trade) comes off the grand total only and stays after the charges, as upstream. -#} {%- macro amount_row(label, value) -%}