{#- ERPNext's templates/print_formats/includes/total.html, except that with inclusive tax the "Total (Without Tax)" line is the total before an Additional Discount on Net Total: net_total already has that discount taken off, so the print would show the same figure before and after the discount line. -#}
{% if doc.flags.show_inclusive_tax_in_print %} {%- set before_discount = doc.net_total + (doc.discount_amount if doc.apply_discount_on == "Net Total" else 0) -%}
{{ frappe.format_value(before_discount, {"fieldtype": "Currency", "options": "currency"}, doc) }}
{% else %}
{{ doc.get_formatted("total", doc) }}
{% endif %}