forked from csrocha/odoo_fpoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaged_trial_webkit.mako
More file actions
175 lines (159 loc) · 7.3 KB
/
aged_trial_webkit.mako
File metadata and controls
175 lines (159 loc) · 7.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
## -*- coding: utf-8 -*-
<!DOCTYPE html SYSTEM
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
.overflow_ellipsis {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.open_invoice_previous_line {
font-style: italic;
}
.percent_line {
font-style: italic;
}
.amount {
text-align:right;
}
.classif_title {
text-align:right;
}
.classif{
width: ${700/len(ranges)}px;
}
.total{
font-weight:bold;
}
${css}
</style>
</head>
<%!
def amount(text):
# replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers)
return text.replace('-', '‑')
%>
<body>
<%setLang(user.lang)%>
<div class="act_as_table data_table">
<div class="act_as_row labels">
<div class="act_as_cell">${_('Chart of Account')}</div>
<div class="act_as_cell">${_('Fiscal Year')}</div>
<div class="act_as_cell">
%if filter_form(data) == 'filter_date':
${_('Dates Filter')}
%else:
${_('Periods Filter')}
%endif
</div>
<div class="act_as_cell">${_('Clearance Date')}</div>
<div class="act_as_cell">${_('Accounts Filter')}</div>
<div class="act_as_cell">${_('Target Moves')}</div>
</div>
<div class="act_as_row">
<div class="act_as_cell">${ chart_account.name }</div>
<div class="act_as_cell">${ fiscalyear.name if fiscalyear else '-' }</div>
<div class="act_as_cell">
${_('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
</div>
<div class="act_as_cell">${ formatLang(date_until, date=True) }</div>
<div class="act_as_cell">
%if partner_ids:
${_('Custom Filter')}
%else:
${ display_partner_account(data) }
%endif
</div>
<div class="act_as_cell">${ display_target_move(data) }</div>
</div>
</div>
<% gbalance = 0.0 %>
<% granges = {} %>
%for i in ranges:
<% granges[i] = 0.0 %>
%endfor
%for event_id in get_event(data):
%for acc in objects:
%if agged_lines_accounts[event_id.id][acc.id]:
<div class="account_title bg" style="width: 1080px; margin-top: 20px; font-size: 12px;">${event_id.name}</div>
<div class="account_title bg" style="width: 1080px; margin-top: 20px; font-size: 12px;">${acc.code} - ${acc.name}</div>
<div class="act_as_table list_table" style="margin-top: 5px;">
<div class="act_as_thead">
<div class="act_as_row labels">
## partner
<div class="act_as_cell first_column" style="width: 60px;">${_('Partner')}</div>
## code
<div class="act_as_cell" style="width: 70px;">${_('code')}</div>
## balance
<div class="act_as_cell classif_title" style="width: 70px;">${_('balance')}</div>
## Classifications
%for title in ranges_titles:
<div class="act_as_cell classif classif_title">${title}</div>
%endfor
</div>
</div>
<div class="act_as_tbody">
%for partner_name, p_id, p_ref, p_name in partners_order[event_id.id][acc.id]:
%if agged_lines_accounts[event_id.id][acc.id].get(p_id):
<div class="act_as_row lines">
<%line = agged_lines_accounts[event_id.id][acc.id][p_id]%>
<%percents = agged_percents_accounts[event_id.id][acc.id]%>
<%totals = agged_totals_accounts[event_id.id][acc.id]%>
<div class="act_as_cell first_column">${partner_name}</div>
<div class="act_as_cell">${p_ref or ''}</div>
<div class="act_as_cell amount">${formatLang(line.get('balance') or 0.0) | amount}</div>
%for classif in ranges:
<div class="act_as_cell classif amount">
${formatLang(line['aged_lines'][classif] or 0.0) | amount}
</div>
%endfor
</div>
%endif
%endfor
<div class="act_as_row labels">
<div class="act_as_cell total">${_('Total')}</div>
<div class="act_as_cell"></div>
<div class="act_as_cell amount classif total">${formatLang(totals['balance']) | amount}</div>
<% gbalance += totals['balance'] %>
%for classif in ranges:
<div class="act_as_cell amount classif total">${formatLang(totals[classif]) | amount}</div>
<% granges[classif] +=totals[classif] %>
%endfor
</div>
<div class="act_as_row">
<div class="act_as_cell"><b>${_('Percents')}</b></div>
<div class="act_as_cell"></div>
<div class="act_as_cell"></div>
%for classif in ranges:
<div class="act_as_cell amount percent_line classif">${formatLang(percents[classif]) | amount}%</div>
%endfor
</div>
</div>
<br/>
%endif
%endfor
%endfor
<div class="act_as_row">
<div class="act_as_cell" style="width: 1080px; margin-top: 20px; font-size: 12px;"><b>${_('Grand Total')}</b></div>
<div class="act_as_cell"></div>
<div class="act_as_cell amount classif total">${formatLang(gbalance) | amount}</div>
%for classif in ranges:
<div class="act_as_cell amount classif total">${formatLang(granges[classif]) | amount}</div>
%endfor
</div>
</div>
</body>
</html>