1 ## -*- coding: utf-8 -*-
2 <!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <style type="text/css">
7 text-overflow: ellipsis;
18 return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers)
21 <%setLang(user.lang)%>
24 initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')}
27 <div class="act_as_table data_table">
28 <div class="act_as_row labels">
29 <div class="act_as_cell">${_('Chart of Account')}</div>
30 <div class="act_as_cell">${_('Fiscal Year')}</div>
31 <div class="act_as_cell">
32 %if filter_form(data) == 'filter_date':
35 ${_('Periods Filter')}
38 <div class="act_as_cell">${_('Accounts Filter')}</div>
39 <div class="act_as_cell">${_('Target Moves')}</div>
40 <div class="act_as_cell">${_('Initial Balance')}</div>
42 <div class="act_as_row">
43 <div class="act_as_cell">${ chart_account.name }</div>
44 <div class="act_as_cell">${ fiscalyear.name if fiscalyear else '-' }</div>
45 <div class="act_as_cell">
47 %if filter_form(data) == 'filter_date':
48 ${formatLang(start_date, date=True) if start_date else u'' }
50 ${start_period.name if start_period else u''}
53 %if filter_form(data) == 'filter_date':
54 ${ formatLang(stop_date, date=True) if stop_date else u'' }
56 ${stop_period.name if stop_period else u'' }
59 <div class="act_as_cell">
63 ${ display_partner_account(data) }
66 <div class="act_as_cell">${ display_target_move(data) }</div>
67 <div class="act_as_cell">${ initial_balance_text[initial_balance_mode] }</div>
71 %for account in objects:
72 %if account.ledger_lines or account.init_balance:
74 if not account.partners_order:
76 account_total_debit = 0.0
77 account_total_credit = 0.0
78 account_balance_cumul = 0.0
79 account_balance_cumul_curr = 0.0
82 <div class="account_title bg" style="width: 1080px; margin-top: 20px; font-size: 12px;">${account.code} - ${account.name}</div>
84 %for partner_name, p_id, p_ref, p_name in account.partners_order:
89 cumul_balance_curr = 0.0
91 part_cumul_balance = 0.0
92 part_cumul_balance_curr = 0.0
94 <div class="act_as_table list_table" style="margin-top: 5px;">
95 <div class="act_as_caption account_title">
96 ${partner_name or _('No Partner')}
98 <div class="act_as_thead">
99 <div class="act_as_row labels">
101 <div class="act_as_cell first_column" style="width: 50px;">${_('Date')}</div>
103 <div class="act_as_cell" style="width: 70px;">${_('Period')}</div>
105 <div class="act_as_cell" style="width: 100px;">${_('Entry')}</div>
107 <div class="act_as_cell" style="width: 70px;">${_('Journal')}</div>
109 <div class="act_as_cell" style="width: 100px;">${_('Partner')}</div>
111 <div class="act_as_cell" style="width: 60px;">${_('Reference')}</div>
113 <div class="act_as_cell" style="width: 280px;">${_('Label')}</div>
115 <div class="act_as_cell" style="width: 80px;">${_('Rec.')}</div>
117 <div class="act_as_cell amount" style="width: 80px;">${_('Debit')}</div>
119 <div class="act_as_cell amount" style="width: 80px;">${_('Credit')}</div>
121 <div class="act_as_cell amount" style="width: 80px;">${_('Cumul. Bal.')}</div>
122 %if amount_currency(data):
124 <div class="act_as_cell amount sep_left" style="width: 80px;">${_('Curr. Balance')}</div>
126 <div class="act_as_cell amount" style="width: 30px; text-align: right;">${_('Curr.')}</div>
130 <div class="act_as_tbody">
132 total_debit = account.init_balance.get(p_id, {}).get('debit') or 0.0
133 total_credit = account.init_balance.get(p_id, {}).get('credit') or 0.0
135 %if initial_balance_mode and (total_debit or total_credit):
137 part_cumul_balance = account.init_balance.get(p_id, {}).get('init_balance') or 0.0
138 part_cumul_balance_curr = account.init_balance.get(p_id, {}).get('init_balance_currency') or 0.0
139 balance_forward_currency = account.init_balance.get(p_id, {}).get('currency_name') or ''
141 cumul_balance += part_cumul_balance
142 cumul_balance_curr += part_cumul_balance_curr
144 <div class="act_as_row initial_balance">
146 <div class="act_as_cell first_column"></div>
148 <div class="act_as_cell"></div>
150 <div class="act_as_cell"></div>
152 <div class="act_as_cell"></div>
154 <div class="act_as_cell"></div>
156 <div class="act_as_cell"></div>
158 <div class="act_as_cell" >${_('Initial Balance')}</div>
160 <div class="act_as_cell"></div>
162 <div class="act_as_cell amount">${formatLang(total_debit) | amount }</div>
164 <div class="act_as_cell amount">${formatLang(total_credit) | amount }</div>
166 <div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(part_cumul_balance) | amount }</div>
167 %if amount_currency(data):
169 <div class="act_as_cell sep_left amount">${formatLang(part_cumul_balance_curr) | amount }</div>
171 <div class="act_as_cell">${balance_forward_currency}</div>
177 %for line in account.ledger_lines.get(p_id, []):
179 total_debit += line.get('debit') or 0.0
180 total_credit += line.get('credit') or 0.0
182 label_elements = [line.get('lname') or '']
183 if line.get('invoice_number'):
184 label_elements.append("(%s)" % (line['invoice_number'],))
185 label = ' '.join(label_elements)
187 <div class="act_as_row lines">
189 <div class="act_as_cell first_column">${formatLang(line.get('ldate') or '', date=True)}</div>
191 <div class="act_as_cell">${line.get('period_code') or ''}</div>
193 <div class="act_as_cell">${line.get('move_name') or ''}</div>
195 <div class="act_as_cell">${line.get('jcode') or ''}</div>
197 <div class="act_as_cell overflow_ellipsis">${line.get('partner_name') or ''}</div>
199 <div class="act_as_cell">${line.get('lref') or ''}</div>
201 <div class="act_as_cell">${label}</div>
203 <div class="act_as_cell">${line.get('rec_name') or ''}</div>
205 <div class="act_as_cell amount">${formatLang(line.get('debit') or 0.0) | amount }</div>
207 <div class="act_as_cell amount">${formatLang(line.get('credit') or 0.0) | amount }</div>
209 <% cumul_balance += line.get('balance') or 0.0 %>
210 <div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(cumul_balance) | amount }</div>
211 %if amount_currency(data):
213 <div class="act_as_cell sep_left amount">${formatLang(line.get('amount_currency') or 0.0) | amount }</div>
215 <div class="act_as_cell" style="text-align: right; ">${line.get('currency_code') or ''}</div>
219 <div class="act_as_row lines labels">
221 <div class="act_as_cell first_column"></div>
223 <div class="act_as_cell"></div>
225 <div class="act_as_cell"></div>
227 <div class="act_as_cell"></div>
229 <div class="act_as_cell"></div>
231 <div class="act_as_cell"></div>
233 <div class="act_as_cell">${_('Cumulated Balance on Partner')}</div>
235 <div class="act_as_cell"></div>
237 <div class="act_as_cell amount">${formatLang(total_debit) | amount }</div>
239 <div class="act_as_cell amount">${formatLang(total_credit) | amount }</div>
241 <div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(cumul_balance) | amount }</div>
242 %if amount_currency(data):
244 %if account.currency_id:
245 <div class="act_as_cell amount sep_left">${formatLang(cumul_balance_curr) | amount }</div>
247 <div class="act_as_cell sep_left amount">${ u'-' }</div>
250 <div class="act_as_cell" style="text-align: right; padding-right: 1px;">${ account.currency_id.name if account.currency_id else u'' }</div>
256 account_total_debit += total_debit
257 account_total_credit += total_credit
258 account_balance_cumul += cumul_balance
259 account_balance_cumul_curr += cumul_balance_curr
263 <div class="act_as_table list_table" style="margin-top:5px;">
264 <div class="act_as_row labels" style="font-weight: bold; font-size: 12px;">
265 <div class="act_as_cell first_column" style="width: 450px;">${account.code} - ${account.name}</div>
267 <div class="act_as_cell" style="width: 360px;">${_("Cumulated Balance on Account")}</div>
269 <div class="act_as_cell amount" style="width: 80px;">${ formatLang(account_total_debit) | amount }</div>
271 <div class="act_as_cell amount" style="width: 80px;">${ formatLang(account_total_credit) | amount }</div>
273 <div class="act_as_cell amount" style="width: 80px; padding-right: 1px;">${ formatLang(account_balance_cumul) | amount }</div>
274 %if amount_currency(data):
276 %if account.currency_id:
277 <div class="act_as_cell amount sep_left" style="width: 80px;">${ formatLang(account_balance_cumul_curr) | amount }</div>
279 <div class="act_as_cell amount sep_left" style="width: 80px;">${ u'-' }</div>
282 <div class="act_as_cell amount" style="width: 30px; text-align: right; padding-right: 1px;">${ account.currency_id.name if account.currency_id else u'' }</div>