## -*- coding: utf-8 -*- <%! def amount(text): return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers) %> <%setLang(user.lang)%> <% initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')} %>
${_('Chart of Account')}
${_('Fiscal Year')}
%if filter_form(data) == 'filter_date': ${_('Dates Filter')} %else: ${_('Periods Filter')} %endif
${_('Accounts Filter')}
${_('Target Moves')}
${_('Initial Balance')}
${ chart_account.name }
${ fiscalyear.name if fiscalyear else '-' }
${_('From:')} %if filter_form(data) == 'filter_date': ${formatLang(start_date, date=True) if start_date else u'' } %else: ${start_period.name if start_period else u''} %endif ${_('To:')} %if filter_form(data) == 'filter_date': ${ formatLang(stop_date, date=True) if stop_date else u'' } %else: ${stop_period.name if stop_period else u'' } %endif
%if partner_ids: ${_('Custom Filter')} %else: ${ display_partner_account(data) } %endif
${ display_target_move(data) }
${ initial_balance_text[initial_balance_mode] }
%for account in objects: %if account.ledger_lines or account.init_balance: <% if not account.partners_order: continue account_total_debit = 0.0 account_total_credit = 0.0 account_balance_cumul = 0.0 account_balance_cumul_curr = 0.0 %>
${account.code} - ${account.name}
%for partner_name, p_id, p_ref, p_name in account.partners_order: <% total_debit = 0.0 total_credit = 0.0 cumul_balance = 0.0 cumul_balance_curr = 0.0 part_cumul_balance = 0.0 part_cumul_balance_curr = 0.0 %>
${partner_name or _('No Partner')}
## date
${_('Date')}
## period
${_('Period')}
## move
${_('Entry')}
## journal
${_('Journal')}
## partner
${_('Partner')}
## move reference
${_('Reference')}
## label
${_('Label')}
## reconcile
${_('Rec.')}
## debit
${_('Debit')}
## credit
${_('Credit')}
## balance cumulated
${_('Cumul. Bal.')}
%if amount_currency(data): ## currency balance
${_('Curr. Balance')}
## curency code
${_('Curr.')}
%endif
<% total_debit = account.init_balance.get(p_id, {}).get('debit') or 0.0 total_credit = account.init_balance.get(p_id, {}).get('credit') or 0.0 %> %if initial_balance_mode and (total_debit or total_credit): <% part_cumul_balance = account.init_balance.get(p_id, {}).get('init_balance') or 0.0 part_cumul_balance_curr = account.init_balance.get(p_id, {}).get('init_balance_currency') or 0.0 balance_forward_currency = account.init_balance.get(p_id, {}).get('currency_name') or '' cumul_balance += part_cumul_balance cumul_balance_curr += part_cumul_balance_curr %>
## date
## period
## move
## journal
## partner
## move reference
## label
${_('Initial Balance')}
## reconcile
## debit
${formatLang(total_debit) | amount }
## credit
${formatLang(total_credit) | amount }
## balance cumulated
${formatLang(part_cumul_balance) | amount }
%if amount_currency(data): ## currency balance
${formatLang(part_cumul_balance_curr) | amount }
## curency code
${balance_forward_currency}
%endif
%endif %for line in account.ledger_lines.get(p_id, []): <% total_debit += line.get('debit') or 0.0 total_credit += line.get('credit') 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 ''}
## partner
${line.get('partner_name') or ''}
## move reference
${line.get('lref') or ''}
## label
${label}
## reconcile
${line.get('rec_name') or ''}
## debit
${formatLang(line.get('debit') or 0.0) | amount }
## credit
${formatLang(line.get('credit') or 0.0) | amount }
## balance cumulated <% cumul_balance += line.get('balance') or 0.0 %>
${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
## period
## move
## journal
## partner
## move reference
## label
${_('Cumulated Balance on Partner')}
## reconcile
## debit
${formatLang(total_debit) | amount }
## credit
${formatLang(total_credit) | amount }
## balance cumulated
${formatLang(cumul_balance) | amount }
%if amount_currency(data): ## currency balance %if account.currency_id:
${formatLang(cumul_balance_curr) | amount }
%else:
${ u'-' }
%endif ## currency code
${ account.currency_id.name if account.currency_id else u'' }
%endif
<% account_total_debit += total_debit account_total_credit += total_credit account_balance_cumul += cumul_balance account_balance_cumul_curr += cumul_balance_curr %> %endfor
${account.code} - ${account.name}
## label
${_("Cumulated Balance on Account")}
## debit
${ formatLang(account_total_debit) | amount }
## credit
${ formatLang(account_total_credit) | amount }
## balance cumulated
${ formatLang(account_balance_cumul) | amount }
%if amount_currency(data): ## currency balance %if account.currency_id:
${ formatLang(account_balance_cumul_curr) | amount }
%else:
${ u'-' }
%endif ## curency code
${ account.currency_id.name if account.currency_id else u'' }
%endif
%endif %endfor