How to hide all Salary component tagged as "Do not include in total" Salary slip print

Hi erveryone,

I would like to know how to hide all salary component tagged as “Do not include in total” in the salary slip print.

Can someone help me?

Thank you!

Hi, You can use below code in custom HTML to achieve the same.


<table class="table table-hover">
    <thead>
    <tr>
<th style="width: 30px" class="table-sr">Sr</th>

<th style="width: 100px;" class="
" data-fieldname="earnings" data-fieldtype="Table">
Component</th>

<th style="width: 130px;" class="
text-right" data-fieldname="earnings" data-fieldtype="Table">
Amount</th>

</tr>
</thead>
<tbody>
{% for earning in doc. earnings %}
{% if earning.do_not_include_in_total == 0 %}
<tr>
<td class="table-sr">{{loop.index}}</td>

<td class="
" data-fieldname="earnings" data-fieldtype="Table">

<div class="value">{{earning.salary_component}}
</div></td>


<td class="
text-right" data-fieldname="earnings" data-fieldtype="Table">

<div class="value">
{{earning.get_formatted('amount', earning)}}
</div></td>


</tr>
{% endif %}
{% endfor %}


</tbody>
</table>

Above example is only for earnings table. Same way you can do for deduction table also.

where do we use this code

In the Salary Slip Print Format.

alright