@ -1,4 +1,5 @@
<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html SYSTEM
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head>
<style type="text/css">
<style type="text/css">
@ -19,11 +20,12 @@
</style>
</style>
</head>
</head>
<body>
<body>
<%!
def amount(text):
return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers)
%>
<% import addons %>
<% template1 = helper.get_mako_template('account_financial_report_webkit','report', 'templates', 'open_invoices_inclusion.mako.html') %>
<% context.lookup.put_template('open_invoices_inclusion.mako.html', template1) %>
<% template2 = helper.get_mako_template('account_financial_report_webkit','report', 'templates', 'grouped_by_curr_open_invoices_inclusion.mako.html') %>
<% context.lookup.put_template('grouped_by_curr_open_invoices_inclusion.mako.html', template2) %>
<%setLang(user.context_lang)%>
<%setLang(user.context_lang)%>
<div class="act_as_table data_table">
<div class="act_as_table data_table">
@ -70,181 +72,13 @@
<div class="act_as_cell">${ display_target_move(data) }</div>
<div class="act_as_cell">${ display_target_move(data) }</div>
</div>
</div>
</div>
</div>
%for account in objects:
%if account.ledger_lines:
<%
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
%>
<div class="account_title bg" style="width: 1080px; margin-top: 20px; font-size: 12px;">${account.code} - ${account.name}</div>
%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
%>
<div class="act_as_table list_table" style="margin-top: 5px;">
<div class="act_as_caption account_title">
${partner_name or _('No Partner')}
</div>
<div class="act_as_thead">
<div class="act_as_row labels">
## date
<div class="act_as_cell first_column" style="width: 60px;">${_('Date')}</div>
## period
<div class="act_as_cell" style="width: 70px;">${_('Period')}</div>
## move
<div class="act_as_cell" style="width: 70px;">${_('Entry')}</div>
## journal
<div class="act_as_cell" style="width: 70px;">${_('Journal')}</div>
## partner
<div class="act_as_cell" style="width: 60px;">${_('Partner')}</div>
## label
<div class="act_as_cell" style="width: 255px;">${_('Label')}</div>
## reconcile
<div class="act_as_cell" style="width: 80px;">${_('Rec.')}</div>
## maturity
<div class="act_as_cell" style="width: 60px;">${_('Due Date')}</div>
## debit
<div class="act_as_cell amount" style="width: 80px;">${_('Debit')}</div>
## credit
<div class="act_as_cell amount" style="width: 80px;">${_('Credit')}</div>
## balance cumulated
<div class="act_as_cell amount" style="width: 80px;">${_('Cumul. Bal.')}</div>
%if amount_currency(data):
## currency balance
<div class="act_as_cell amount sep_left" style="width: 80px;">${_('Curr. Balance')}</div>
## curency code
<div class="act_as_cell amount" style="width: 30px; text-align: right;">${_('Curr.')}</div>
%endif
</div>
</div>
<div class="act_as_tbody">
<%
total_debit = 0.0
total_credit = 0.0
%>
%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)
%>
<div class="act_as_row lines ${line.get('is_from_previous_periods') and 'open_invoice_previous_line' or ''} ${line.get('is_clearance_line') and 'clearance_line' or ''}">
## date
<div class="act_as_cell first_column">${formatLang(line.get('ldate') or '', date=True)}</div>
## period
<div class="act_as_cell">${line.get('period_code') or ''}</div>
## move
<div class="act_as_cell">${line.get('move_name') or ''}</div>
## journal
<div class="act_as_cell">${line.get('jcode') or ''}</div>
## partner
<div class="act_as_cell overflow_ellipsis">${line.get('partner_name') or ''}</div>
## label
<div class="act_as_cell">${label}</div>
## reconcile
<div class="act_as_cell">${line.get('rec_name') or ''}</div>
## maturity date
<div class="act_as_cell">${formatLang(line.get('date_maturity') or '', date=True)}</div>
## debit
<div class="act_as_cell amount">${formatLang(line.get('debit') or 0.0) | amount }</div>
## credit
<div class="act_as_cell amount">${formatLang(line.get('credit') or 0.0) | amount }</div>
## balance cumulated
<% cumul_balance += line.get('balance') or 0.0 %>
<div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(cumul_balance) | amount }</div>
%if amount_currency(data):
## currency balance
<div class="act_as_cell sep_left amount">${formatLang(line.get('amount_currency') or 0.0) | amount }</div>
## curency code
<div class="act_as_cell" style="text-align: right; ">${line.get('currency_code') or ''}</div>
%endif
</div>
%endfor
<div class="act_as_row lines labels">
## date
<div class="act_as_cell first_column"></div>
## period
<div class="act_as_cell"></div>
## move
<div class="act_as_cell"></div>
## journal
<div class="act_as_cell"></div>
## partner
<div class="act_as_cell"></div>
## label
<div class="act_as_cell">${_('Cumulated Balance on Partner')}</div>
## reconcile
<div class="act_as_cell"></div>
## maturity date
<div class="act_as_cell"></div>
## debit
<div class="act_as_cell amount">${formatLang(total_debit) | amount }</div>
## credit
<div class="act_as_cell amount">${formatLang(total_credit) | amount }</div>
## balance cumulated
<div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(cumul_balance) | amount }</div>
%if amount_currency(data):
%if account.currency_id:
## currency balance
<div class="act_as_cell sep_left amount" style="padding-right: 1px;">${formatLang(cumul_balance_curr) | amount }</div>
%else:
<div class="act_as_cell sep_left amount" style="padding-right: 1px;">${ u'-' }</div>
%endif
## curency code
<div class="act_as_cell" style="text-align: right; ">${ account.currency_id.name if account.currency_id else u'' }</div>
%endif
</div>
</div>
</div>
<%
account_total_debit += total_debit
account_total_credit += total_credit
account_balance_cumul += cumul_balance
account_balance_cumul_curr += cumul_balance_curr
%>
%endfor
<div class="act_as_table list_table" style="margin-top:5px;">
<div class="act_as_row labels" style="font-weight: bold; font-size: 12px;">
<div class="act_as_cell first_column" style="width: 330px;">${account.code} - ${account.name}</div>
## label
<div class="act_as_cell" style="width: 395px;">${_("Cumulated Balance on Account")}</div>
## debit
<div class="act_as_cell amount" style="width: 80px;">${ formatLang(account_total_debit) | amount }</div>
## credit
<div class="act_as_cell amount" style="width: 80px;">${ formatLang(account_total_credit) | amount }</div>
## balance cumulated
<div class="act_as_cell amount" style="width: 80px; ">${ formatLang(account_balance_cumul) | amount }</div>
%if amount_currency(data):
## currency balance cumulated
%if account.currency_id:
<div class="act_as_cell amount sep_left" style="width: 80px;">${ formatLang(account_balance_cumul_curr) | amount }</div>
%else:
<div class="act_as_cell amount sep_left" style="width: 80px; padding-right: 1px;">${ u'-' }</div>
%endif
## curency code
<div class="act_as_cell amount" style="width: 30px; text-align: right;">${ account.currency_id.name if account.currency_id else u'' }</div>
%endif
</div>
</div>
</div>
%for acc in objects:
%if hasattr(acc, 'grouped_ledger_lines'):
<% fl = formatLang %>
<%include file="grouped_by_curr_open_invoices_inclusion.mako.html" args="account=acc,formatLang=fl"/>
%else:
<% fl = formatLang %>
<%include file="open_invoices_inclusion.mako.html" args="account=acc,formatLang=fl"/>
%endif
%endif
%endfor
%endfor
</body>
</body>