X-Git-Url: https://git.cyclocoop.org/?p=burette%2Faccount_financial_report_webkit.git;a=blobdiff_plain;f=report%2Ftemplates%2Faccount_report_general_ledger.mako;fp=report%2Ftemplates%2Faccount_report_general_ledger.mako;h=f99f72830141adde6b916e2e6aa5455104eef195;hp=0000000000000000000000000000000000000000;hb=cddef38e342c880228694525c45df3f7dd8c2148;hpb=bffd331c220385010fe9abad9e228fc2004a293a diff --git a/report/templates/account_report_general_ledger.mako b/report/templates/account_report_general_ledger.mako new file mode 100644 index 0000000..f99f728 --- /dev/null +++ b/report/templates/account_report_general_ledger.mako @@ -0,0 +1,243 @@ +## -*- 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')} + %> + + %if amount_currency(data): +
+ %else: +
+ %endif +
+
${_('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 account in objects: + <% + display_initial_balance = account.init_balance and (account.init_balance.get('debit', 0.0) != 0.0 or account.init_balance.get('credit', 0.0) != 0.0) + display_ledger_lines = account.ledger_lines + %> + %if display_account_raw(data) == 'all' or (display_ledger_lines or display_initial_balance): + <% + cumul_debit = 0.0 + cumul_credit = 0.0 + cumul_balance = 0.0 + cumul_balance_curr = 0.0 + %> +
+ + +
+
+ ## date +
${_('Date')}
+ ## period +
${_('Period')}
+ ## move +
${_('Entry')}
+ ## journal +
${_('Journal')}
+ ## account code +
${_('Account')}
+ ## partner +
${_('Partner')}
+ ## move reference +
${_('Reference')}
+ ## label +
${_('Label')}
+ ## counterpart +
${_('Counter part')}
+ ## debit +
${_('Debit')}
+ ## credit +
${_('Credit')}
+ ## balance cumulated +
${_('Cumul. Bal.')}
+ %if amount_currency(data): + ## currency balance +
${_('Curr. Balance')}
+ ## curency code +
${_('Curr.')}
+ %endif +
+
+ +
+ %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 +
+ ## move reference +
+ ## 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 ''}
+ ## move reference +
${line.get('lref') 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 +
+
+
+ %endif + %endfor + +