{#- 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. Here: the net share of the discount, Net Total, then the charges as booked. A discount that is not distributed (cash / non-trade) comes off the grand total only, so it stays after the charges, as upstream. -#} {%- macro amount_row(label, value) -%}