X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=report%2Ftemplates%2Faccount_report_trial_balance.mako;fp=report%2Ftemplates%2Faccount_report_trial_balance.mako;h=cc833226de97b91be8d765d506f1ed14546bb8a0;hb=cddef38e342c880228694525c45df3f7dd8c2148;hp=0000000000000000000000000000000000000000;hpb=bffd331c220385010fe9abad9e228fc2004a293a;p=burette%2Faccount_financial_report_webkit.git diff --git a/report/templates/account_report_trial_balance.mako b/report/templates/account_report_trial_balance.mako new file mode 100644 index 0000000..cc83322 --- /dev/null +++ b/report/templates/account_report_trial_balance.mako @@ -0,0 +1,218 @@ +## -*- 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 accounts(data): + ${', '.join([account.code for account in accounts(data)])} + %else: + ${_('All')} + %endif +
+
${ display_target_move(data) }
+
${ initial_balance_text[initial_balance_mode] }
+
+
+ + %for index, params in enumerate(comp_params): +
+
+
${_('Comparison %s') % (index + 1,)} (${"C%s" % (index + 1,)})
+
+ %if params['comparison_filter'] == 'filter_date': + ${_('Dates Filter:')} ${formatLang(params['start'], date=True) } - ${formatLang(params['stop'], date=True) } + %elif params['comparison_filter'] == 'filter_period': + ${_('Periods Filter:')} ${params['start'].name} - ${params['stop'].name} + %else: + ${_('Fiscal Year :')} ${params['fiscalyear'].name} + %endif +
+
${_('Initial Balance:')} ${ initial_balance_text[params['initial_balance_mode']] }
+
+
+ %endfor + +
+ +
+
+ ## code +
${_('Code')}
+ ## account name +
${_('Account')}
+ %if comparison_mode == 'no_comparison': + %if initial_balance_mode: + ## initial balance +
${_('Initial Balance')}
+ %endif + ## debit +
${_('Debit')}
+ ## credit +
${_('Credit')}
+ %endif + ## balance +
+ %if comparison_mode == 'no_comparison' or not fiscalyear: + ${_('Balance')} + %else: + ${_('Balance %s') % (fiscalyear.name,)} + %endif +
+ %if comparison_mode in ('single', 'multiple'): + %for index in range(nb_comparison): +
+ %if comp_params[index]['comparison_filter'] == 'filter_year' and comp_params[index].get('fiscalyear', False): + ${_('Balance %s') % (comp_params[index]['fiscalyear'].name,)} + %else: + ${_('Balance C%s') % (index + 1,)} + %endif +
+ %if comparison_mode == 'single': ## no diff in multiple comparisons because it shows too data +
${_('Difference')}
+
${_('% Difference')}
+ %endif + %endfor + %endif +
+
+ +
+ <% + last_child_consol_ids = [] + last_level = False + %> + %for current_account in objects: + <% + if not current_account.to_display: + continue + + comparisons = current_account.comparisons + + if current_account.id in last_child_consol_ids: + # current account is a consolidation child of the last account: use the level of last account + level = last_level + level_class = "account_level_consol" + else: + # current account is a not a consolidation child: use its own level + level = current_account.level or 0 + level_class = "account_level_%s" % (level,) + last_child_consol_ids = [child_consol_id.id for child_consol_id in current_account.child_consol_ids] + last_level = current_account.level + %> +
+ ## code +
${current_account.code}
+ ## account name +
${current_account.name}
+ %if comparison_mode == 'no_comparison': + %if initial_balance_mode: + ## opening balance +
${formatLang(current_account.init_balance) | amount}
+ %endif + ## debit +
${formatLang(current_account.debit) | amount}
+ ## credit +
${formatLang(current_account.credit) | amount}
+ %endif + ## balance +
${formatLang(current_account.balance) | amount}
+ + %if comparison_mode in ('single', 'multiple'): + %for comp_account in comparisons: +
${formatLang(comp_account['balance']) | amount}
+ %if comparison_mode == 'single': ## no diff in multiple comparisons because it shows too data +
${formatLang(comp_account['diff']) | amount}
+
+ %if comp_account['percent_diff'] is False: + ${ '-' } + %else: + ${int(round(comp_account['percent_diff'])) | amount} % + %endif +
+ %endif + %endfor + %endif +
+ %endfor +
+
+ +