I'm modifying OpenERP Employee Payslip RML Report, I want to Split the line by Earnings or Deductions. This is what I expect as the final result:
_____________________________ _____________________________
| Earnings | Deductions |
| | |
| Description Amount | Description Amount |
| BASIC 7000.00 | Provident Fund 300.0 |
| House Rent 500.00 | Professional Tax 200.0 |
| Conveyance 200.00 | |
| Other Allowance 300.00 | |
|_____________________________|_____________________________|
But this is what I get when the length for deductions and earnings line are not the same:
_____________________________ _____________________________
| Earnings | Deductions |
| | |
| Description Amount | |
| BASIC 7000.00 | |
| House Rent 500.00 | Description Amount |
| Conveyance 200.00 | Provident Fund 300.0 |
| Other Allowance 300.00 | Professional Tax 200.0 |
|_____________________________|_____________________________|
This is my RML:
<blockTable colWidths="270, 270">
<tr>
<td><para style="P15">Earnings</para></td>
<td><para style="P15">Deductions</para></td>
</tr>
<tr>
<td>
<blockTable colWidths="200.0, 70.0">
<tr>
<td>Description</td>
<td>Amount</td>
</tr>
</blockTable>
<section>
<blockTable colWidths="200.0, 70.0">
<para style="P4">[[repeatIn(get_payslip_lines(o.line_ids, 'earnings'),'p') ]]</para>
<tr>
<td>[[ p['name'] ]]</td>
<td>[[ p['amount'] ]]</td>
</tr>
</blockTable>
</section>
</td>
<td>
<blockTable colWidths="200.0, 70.0">
<tr>
<td>Description</td>
<td>Amount</td>
</tr>
</blockTable>
<section>
<para style="P4">[[repeatIn(get_payslip_lines(o.line_ids, 'deductions'),'d') ]]</para>
<blockTable colWidths="200.0, 70.0">
<tr>
<td>[[ d['name'] ]]</td>
<td>[[ abs(d['amount']) ]]</td>
</tr>
</blockTable>
</section>
</td>
</tr>
</blockTable>
Please advise me for the correct markup.
'earnings'
and'deductions'
? For example'Gross'
or'Net
fall in neither'earnings'
nor'deductions'
. – Ravinder Reddy'earnings'
obj is as returned from'get_earnings'
method? – Ravinder Reddy