if ‘Discount Amount’ and Discount (%) on price have 0 value then this filds are not show on print format and if ‘Discount Amount’ and Discount (%) on price have value greater than 0 then this fields show on print format how to achieve this one
i am not used custom print format
This is how I use it in my print format
<div class="col-xs-6 text-right">
<b>Grand Total: </b> $ {{ "{:,}".format(doc.grand_total|int) }}<br>
{% if doc.discount_amount != 0 %}
<b>You save {{ doc.get_formatted("additional_discount_percentage") }}% :</b> $ {{ "{:,}". format(doc.discount_amount|int) }}
{% endif %}
</div>
It will display
Grand total: $ 1,000
You save 10%: $ -100