Show / Hide Print Fields Based on Discount

Is there some way that in print the net rate and net amount fields only show if there is a discount applied and if there is not discount applied these do not show?

TIA & Regards,

{% if doc.discount_amount %}

{% else %}

{% endif %}

@sanjay Thanks - could you also kindly advise where to put this code?

@sanjay, Thanks a lot.



Could someone plz advise where to put this code :frowning:

{% if doc.discount_amount %}
		<th width="25%" class="text-right">{{ _("Disc") }}</th>
		{% endif %}

{%- if doc.discount_amount -%}
		<td class="text-right" style="width: 65%">
			{{ _("Discount") }}
		<td class="text-right">
			{{ doc.get_formatted("discount_amount") }}
	{%- endif -%}

@Suresh_Thakor where do i post this code? in which file? or in custom CSS? or create a HTML field with this?

You need put this in your custom print format.