%if display_initial_balance:
<%
cumul_debit = account.init_balance.get('debit') or 0.0
cumul_credit = account.init_balance.get('credit') or 0.0
cumul_balance = account.init_balance.get('init_balance') or 0.0
cumul_balance_curr = account.init_balance.get('init_balance_currency') or 0.0
%>
## date
## period
## move
## journal
## account code
## partner
## label
${_('Initial Balance')}
## counterpart
## debit
${formatLang(account.init_balance.get('debit')) | amount}
## credit
${formatLang(account.init_balance.get('credit')) | amount}
## balance cumulated
${formatLang(cumul_balance) | amount }
%if amount_currency(data):
## currency balance
${formatLang(cumul_balance_curr) | amount }
## curency code
%endif
%endif
%for line in account.ledger_lines:
<%
cumul_debit += line.get('debit') or 0.0
cumul_credit += line.get('credit') or 0.0
cumul_balance_curr += line.get('amount_currency') or 0.0
cumul_balance += line.get('balance') or 0.0
label_elements = [line.get('lname') or '']
if line.get('invoice_number'):
label_elements.append("(%s)" % (line['invoice_number'],))
label = ' '.join(label_elements)
%>
## date
${formatLang(line.get('ldate') or '', date=True)}
## period
${line.get('period_code') or ''}
## move
${line.get('move_name') or ''}
## journal
${line.get('jcode') or ''}
## account code
${account.code}
## partner
${line.get('partner_name') or ''}
## label
${label}
## counterpart
${line.get('counterparts') or ''}
## debit
${ formatLang(line.get('debit', 0.0)) | amount }
## credit
${ formatLang(line.get('credit', 0.0)) | amount }
## balance cumulated
${ formatLang(cumul_balance) | amount }
%if amount_currency(data):
## currency balance
${formatLang(line.get('amount_currency') or 0.0) | amount }
## curency code
${line.get('currency_code') or ''}
%endif
%endfor
## date
${account.code} - ${account.name}
${_("Cumulated Balance on Account")}
## debit
${ formatLang(cumul_debit) | amount }
## credit
${ formatLang(cumul_credit) | amount }
## balance cumulated
${ formatLang(cumul_balance) | amount }
%if amount_currency(data):
%if account.currency_id:
## currency balance
${formatLang(cumul_balance_curr) | amount }
%else:
-
%endif
## curency code
%endif