{%- macro render_discount_amount(doc) -%} {%- if doc.discount_amount -%}
- {{ doc.get_formatted("discount_amount", doc) }}
{%- endif -%} {%- endmacro -%}
{%- if doc.apply_discount_on == "Net Total" -%} {{ render_discount_amount(doc) }} {%- endif -%} {%- for charge in data -%} {%- if (charge.tax_amount or doc.flags.print_taxes_with_zero_amount) and (not charge.included_in_print_rate or doc.flags.show_inclusive_tax_in_print) -%}
{{ frappe.format_value(frappe.utils.flt(charge.tax_amount), table_meta.get_field("tax_amount"), doc, currency=doc.currency) }}
{%- endif -%} {%- endfor -%} {%- if doc.apply_discount_on == "Grand Total" -%} {{ render_discount_amount(doc) }} {%- endif -%}