I want to create a print format for the salary slip and for that I’ve added a html code. I’m able to print few fields in the custom print format but salary components are not printing. I’m adding the html code snippet and screenshot of the salary slip.
<br>Salary Slip for {{ doc.month }}
</td>
</tr>
<tr height="20px"></tr>
<tr>
<th>Personnel No</th>
<td>{{ doc.employee }}</td>
<th>Days Payable</th>
<td>{{ doc.payment_days }}</td>
</tr>
<tr>
<th>Name</th>
<td>{{ frappe.db.get_value("Employee", doc.employee, "employee_name") or "" }}</td>
<tr height="20px"></tr>
<tr>
<th >Earnings</th>
<th>Amount in Rs.</th>
<th >Deductions</th>
<th>Amount in Rs.</th>
</tr>
<tr>
<td>Basic</td>
<td style="text-align:right;">{{ doc.Basic }}</td>
<td>PF Employee Contribution</td>
<td style="text-align:right;">{{ doc.pf }}</td>
</tr>
<tr>
<td>HRA</td>
<td style="text-align:right;">{{ doc.hra }}</td>
<td>ESI Employee Contribution</td>
<td style="text-align:right;">{{ doc.esi }}</td>
</tr>
<tr>
<td>Bonus</td>
<td style="text-align:right;">{{ doc.bonus }}</td>
<td>Professional Tax</td>
<td style="text-align:right;">{{ doc.professional_tax }}</td>
</tr>
<tr>
<td>Special Allowance</td>
<td style="text-align:right;">{{ doc.other_allowance }}</td>
<td></td>
<td></td>
</tr>
<tr>
<th>Gross Earnings</th>
<td style="text-align:right;">{{ doc.gross_pay }}</td>
<th >Gross Deductions</th>
<td style="text-align:right;">{{ doc.total_deduction }}</td>
</tr>
<tr height="20px"></tr>
<tr>
<td></td>
<td><strong>NET PAY</strong></td>
<td style="text-align:right;">{{ doc.net_pay }}</td>
<td></td>
</tr>
So, how can I print the Month name salary components values like Basic, HRA, etc. in this by using HTML code?