10 <h2>[% 'Balance accounts' | $T8 %]</h2>
11 <table cellpadding="3px">
12 <tr class="listheading">
13 <th >[%- 'Account' | $T8 %]</th>
14 <th >[%- 'Description' | $T8 %]</th>
15 <th colspan="2">[%- 'Starting Balance' | $T8 %]</th>
16 <th colspan="2">[%- 'Balance with CB' | $T8 %]</th>
17 <th colspan="2">[%- 'Closing Balance' | $T8 %]</th>
19 <tr class="listheading">
22 <th>[%- 'Debit' | $T8 %]</th>
23 <th>[%- 'Credit' | $T8 %]</th>
24 <th>[%- 'Debit' | $T8 %]</th>
25 <th>[%- 'Credit' | $T8 %]</th>
26 <th>[%- 'Debit' | $T8 %]</th>
27 <th>[%- 'Credit' | $T8 %]</th>
29 [% FOREACH chart = charts %]
30 [%- NEXT UNLESS chart.account_type == 'asset_account' -%]
31 <tr id="tr_[% loop.count %]" class="listrow[% loop.count % 2 %]">
32 <td> [% chart.accno | html %]</td>
33 <td> [% chart.description | html %]</td>
34 <td class="numeric"> [% IF chart.ob_amount < 0 %] [% LxERP.format_amount(chart.ob_amount * -1, dec) %] [% END %]</td>
35 <td class="numeric"> [% IF chart.ob_amount > 0 %] [% LxERP.format_amount(chart.ob_amount, dec) %] [% END %]</td>
36 <td class="numeric"> [% IF chart.amount_with_cb < 0 %] [% LxERP.format_amount(chart.amount_with_cb * -1, dec) %] [% END %]</td>
37 <td class="numeric"> [% IF chart.amount_with_cb > 0 %] [% LxERP.format_amount(chart.amount_with_cb, dec) %] [% END %]</td>
38 [% # cb amounts: >/< are switched and cb_amounts are multiplied with -1. The closing balance as calculated by cb_amount negates the actual balance, but when displaying it as the closing balance we want to display it in the same form as the actual balance %]
39 <td class="numeric"> [% IF chart.cb_amount > 0 %] [% LxERP.format_amount(chart.cb_amount * 1, dec) %] [% END %]</td>
40 <td class="numeric"> [% IF chart.cb_amount < 0 %] [% LxERP.format_amount(chart.cb_amount * -1, dec) %] [% END %]</td>
45 <h2>[% 'Profit and loss accounts' | $T8 %]</h2>
48 [% IF profit_loss_sum < 0 %] [% THEN %][% 'Loss' | $T8 %] [% ELSE %] [% 'Profit' | $T8 %] [% END %]:
49 [% LxERP.format_amount(profit_loss_sum, dec) %]
52 <table cellpadding="3px">
53 <tr class="listheading">
54 <th >[%- 'Account' | $T8 %]</th>
55 <th >[%- 'Description' | $T8 %]</th>
56 <th colspan=2>[%- 'Balance with CB' | $T8 %]</th>
57 <th colspan=2>[%- 'Closing Balance' | $T8 %]</th>
59 <tr class="listheading">
62 <th>[%- 'Debit' | $T8 %]</th>
63 <th>[%- 'Credit' | $T8 %]</th>
64 <th>[%- 'Debit' | $T8 %]</th>
65 <th>[%- 'Credit' | $T8 %]</th>
67 [% FOREACH chart = charts %]
68 [%- NEXT UNLESS chart.account_type == 'profit_loss_account' -%]
69 <tr id="tr_[% loop.count %]" class="listrow[% loop.count % 2 %]">
70 <td >[% chart.accno | html %]</td>
71 <td >[% chart.description | html %]</td>
72 <td class="numeric">[% IF chart.amount_with_cb < 0 %] [% LxERP.format_amount(chart.amount_with_cb * -1, dec) %] [% END %]</td>
73 <td class="numeric">[% IF chart.amount_with_cb > 0 %] [% LxERP.format_amount(chart.amount_with_cb, dec) %] [% END %]</td>
74 <td class="numeric">[% IF chart.cb_amount > 0 %] [% LxERP.format_amount(chart.cb_amount * 1, dec) %] [% END %]</td>
75 <td class="numeric">[% IF chart.cb_amount < 0 %] [% LxERP.format_amount(chart.cb_amount * -1, dec) %] [% END %]</td>
79 [% # L.dump(charts) %]