[MODULE] +v1.1.0 from https://www.odoo.com/apps/7.0/account_financial_report_webkit/
[burette/account_financial_report_webkit.git] / report / templates / account_report_trial_balance.mako
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">
4 <head>
5 <style type="text/css">
6 .account_level_1 {
7 text-transform: uppercase;
8 font-size: 15px;
9 background-color:#F0F0F0;
10 }
11
12 .account_level_2 {
13 font-size: 12px;
14 background-color:#F0F0F0;
15 }
16
17 .regular_account_type {
18 font-weight: normal;
19 }
20
21 .view_account_type {
22 font-weight: bold;
23 }
24
25 .account_level_consol {
26 font-weight: normal;
27 font-style: italic;
28 }
29
30 ${css}
31
32 .list_table .act_as_row {
33 margin-top: 10px;
34 margin-bottom: 10px;
35 font-size:10px;
36 }
37 </style>
38 </head>
39 <body>
40 <%!
41 def amount(text):
42 return text.replace('-', '&#8209;') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers)
43 %>
44
45 <%setLang(user.lang)%>
46
47 <%
48 initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')}
49 %>
50
51 <div class="act_as_table data_table">
52 <div class="act_as_row labels">
53 <div class="act_as_cell">${_('Chart of Account')}</div>
54 <div class="act_as_cell">${_('Fiscal Year')}</div>
55 <div class="act_as_cell">
56 %if filter_form(data) == 'filter_date':
57 ${_('Dates Filter')}
58 %else:
59 ${_('Periods Filter')}
60 %endif
61 </div>
62 <div class="act_as_cell">${_('Accounts Filter')}</div>
63 <div class="act_as_cell">${_('Target Moves')}</div>
64 <div class="act_as_cell">${_('Initial Balance')}</div>
65 </div>
66 <div class="act_as_row">
67 <div class="act_as_cell">${ chart_account.name }</div>
68 <div class="act_as_cell">${ fiscalyear.name if fiscalyear else '-' }</div>
69 <div class="act_as_cell">
70 ${_('From:')}
71 %if filter_form(data) == 'filter_date':
72 ${formatLang(start_date, date=True) if start_date else u'' }
73 %else:
74 ${start_period.name if start_period else u''}
75 %endif
76 ${_('To:')}
77 %if filter_form(data) == 'filter_date':
78 ${ formatLang(stop_date, date=True) if stop_date else u'' }
79 %else:
80 ${stop_period.name if stop_period else u'' }
81 %endif
82 </div>
83 <div class="act_as_cell">
84 %if accounts(data):
85 ${', '.join([account.code for account in accounts(data)])}
86 %else:
87 ${_('All')}
88 %endif
89 </div>
90 <div class="act_as_cell">${ display_target_move(data) }</div>
91 <div class="act_as_cell">${ initial_balance_text[initial_balance_mode] }</div>
92 </div>
93 </div>
94
95 %for index, params in enumerate(comp_params):
96 <div class="act_as_table data_table">
97 <div class="act_as_row">
98 <div class="act_as_cell">${_('Comparison %s') % (index + 1,)} (${"C%s" % (index + 1,)})</div>
99 <div class="act_as_cell">
100 %if params['comparison_filter'] == 'filter_date':
101 ${_('Dates Filter:')}&nbsp;${formatLang(params['start'], date=True) }&nbsp;-&nbsp;${formatLang(params['stop'], date=True) }
102 %elif params['comparison_filter'] == 'filter_period':
103 ${_('Periods Filter:')}&nbsp;${params['start'].name}&nbsp;-&nbsp;${params['stop'].name}
104 %else:
105 ${_('Fiscal Year :')}&nbsp;${params['fiscalyear'].name}
106 %endif
107 </div>
108 <div class="act_as_cell">${_('Initial Balance:')} ${ initial_balance_text[params['initial_balance_mode']] }</div>
109 </div>
110 </div>
111 %endfor
112
113 <div class="act_as_table list_table" style="margin-top: 20px;">
114
115 <div class="act_as_thead">
116 <div class="act_as_row labels">
117 ## code
118 <div class="act_as_cell first_column" style="width: 20px;">${_('Code')}</div>
119 ## account name
120 <div class="act_as_cell" style="width: 80px;">${_('Account')}</div>
121 %if comparison_mode == 'no_comparison':
122 %if initial_balance_mode:
123 ## initial balance
124 <div class="act_as_cell amount" style="width: 30px;">${_('Initial Balance')}</div>
125 %endif
126 ## debit
127 <div class="act_as_cell amount" style="width: 30px;">${_('Debit')}</div>
128 ## credit
129 <div class="act_as_cell amount" style="width: 30px;">${_('Credit')}</div>
130 %endif
131 ## balance
132 <div class="act_as_cell amount" style="width: 30px;">
133 %if comparison_mode == 'no_comparison' or not fiscalyear:
134 ${_('Balance')}
135 %else:
136 ${_('Balance %s') % (fiscalyear.name,)}
137 %endif
138 </div>
139 %if comparison_mode in ('single', 'multiple'):
140 %for index in range(nb_comparison):
141 <div class="act_as_cell amount" style="width: 30px;">
142 %if comp_params[index]['comparison_filter'] == 'filter_year' and comp_params[index].get('fiscalyear', False):
143 ${_('Balance %s') % (comp_params[index]['fiscalyear'].name,)}
144 %else:
145 ${_('Balance C%s') % (index + 1,)}
146 %endif
147 </div>
148 %if comparison_mode == 'single': ## no diff in multiple comparisons because it shows too data
149 <div class="act_as_cell amount" style="width: 30px;">${_('Difference')}</div>
150 <div class="act_as_cell amount" style="width: 30px;">${_('% Difference')}</div>
151 %endif
152 %endfor
153 %endif
154 </div>
155 </div>
156
157 <div class="act_as_tbody">
158 <%
159 last_child_consol_ids = []
160 last_level = False
161 %>
162 %for current_account in objects:
163 <%
164 if not current_account.to_display:
165 continue
166
167 comparisons = current_account.comparisons
168
169 if current_account.id in last_child_consol_ids:
170 # current account is a consolidation child of the last account: use the level of last account
171 level = last_level
172 level_class = "account_level_consol"
173 else:
174 # current account is a not a consolidation child: use its own level
175 level = current_account.level or 0
176 level_class = "account_level_%s" % (level,)
177 last_child_consol_ids = [child_consol_id.id for child_consol_id in current_account.child_consol_ids]
178 last_level = current_account.level
179 %>
180 <div class="act_as_row lines ${level_class} ${"%s_account_type" % (current_account.type,)}">
181 ## code
182 <div class="act_as_cell first_column">${current_account.code}</div>
183 ## account name
184 <div class="act_as_cell" style="padding-left: ${level * 5}px;">${current_account.name}</div>
185 %if comparison_mode == 'no_comparison':
186 %if initial_balance_mode:
187 ## opening balance
188 <div class="act_as_cell amount">${formatLang(current_account.init_balance) | amount}</div>
189 %endif
190 ## debit
191 <div class="act_as_cell amount">${formatLang(current_account.debit) | amount}</div>
192 ## credit
193 <div class="act_as_cell amount">${formatLang(current_account.credit) | amount}</div>
194 %endif
195 ## balance
196 <div class="act_as_cell amount">${formatLang(current_account.balance) | amount}</div>
197
198 %if comparison_mode in ('single', 'multiple'):
199 %for comp_account in comparisons:
200 <div class="act_as_cell amount">${formatLang(comp_account['balance']) | amount}</div>
201 %if comparison_mode == 'single': ## no diff in multiple comparisons because it shows too data
202 <div class="act_as_cell amount">${formatLang(comp_account['diff']) | amount}</div>
203 <div class="act_as_cell amount">
204 %if comp_account['percent_diff'] is False:
205 ${ '-' }
206 %else:
207 ${int(round(comp_account['percent_diff'])) | amount} &#37;
208 %endif
209 </div>
210 %endif
211 %endfor
212 %endif
213 </div>
214 %endfor
215 </div>
216 </div>
217 </body>
218 </html>