Merge lp:~camptocamp/account-invoice-report/7.0-fix-1231329 into lp:~account-core-editors/account-invoice-report/7.0
- 7.0-fix-1231329
- Merge into 7.0
Proposed by
Yannick Vaucher @ Camptocamp
Status: | Merged |
---|---|
Merged at revision: | 42 |
Proposed branch: | lp:~camptocamp/account-invoice-report/7.0-fix-1231329 |
Merge into: | lp:~account-core-editors/account-invoice-report/7.0 |
Diff against target: |
415 lines (+189/-131) 1 file modified
invoice_webkit/report/account_invoice.mako (+189/-131) |
To merge this branch: | bzr merge lp:~camptocamp/account-invoice-report/7.0-fix-1231329 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Joël Grand-Guillaume @ camptocamp | code review, no tests | Approve | |
Pedro Manuel Baeza | code review, no test | Approve | |
Review via email: mp+187697@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote : | # |
review:
Approve
(code review, no test)
- 42. By Yannick Vaucher @ Camptocamp
-
[FIX] remove extra endif
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : | # |
Added a little fix
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote : | # |
LGTM
review:
Approve
(code review, no tests)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'invoice_webkit/report/account_invoice.mako' | |||
2 | --- invoice_webkit/report/account_invoice.mako 2013-08-24 08:11:45 +0000 | |||
3 | +++ invoice_webkit/report/account_invoice.mako 2013-10-17 09:31:03 +0000 | |||
4 | @@ -3,42 +3,97 @@ | |||
5 | 3 | <style type="text/css"> | 3 | <style type="text/css"> |
6 | 4 | ${css} | 4 | ${css} |
7 | 5 | 5 | ||
9 | 6 | .list_invoice_table { | 6 | .list_main_table { |
10 | 7 | border:thin solid #E3E4EA; | 7 | border:thin solid #E3E4EA; |
11 | 8 | text-align:center; | 8 | text-align:center; |
12 | 9 | border-collapse: collapse; | 9 | border-collapse: collapse; |
13 | 10 | } | 10 | } |
15 | 11 | .list_invoice_table th { | 11 | table.list_main_table { |
16 | 12 | margin-top: 20px; | ||
17 | 13 | } | ||
18 | 14 | .list_main_headers { | ||
19 | 15 | padding: 0; | ||
20 | 16 | } | ||
21 | 17 | .list_main_headers th { | ||
22 | 18 | border: thin solid #000000; | ||
23 | 19 | padding-right:3px; | ||
24 | 20 | padding-left:3px; | ||
25 | 12 | background-color: #EEEEEE; | 21 | background-color: #EEEEEE; |
26 | 13 | border: thin solid #000000; | ||
27 | 14 | text-align:center; | 22 | text-align:center; |
28 | 15 | font-size:12; | 23 | font-size:12; |
29 | 16 | font-weight:bold; | 24 | font-weight:bold; |
30 | 17 | padding-right:3px; | ||
31 | 18 | padding-left:3px; | ||
32 | 19 | } | 25 | } |
37 | 20 | .list_invoice_table td { | 26 | .list_main_table td { |
34 | 21 | border-top : thin solid #EEEEEE; | ||
35 | 22 | text-align:left; | ||
36 | 23 | font-size:12; | ||
38 | 24 | padding-right:3px; | 27 | padding-right:3px; |
39 | 25 | padding-left:3px; | 28 | padding-left:3px; |
40 | 26 | padding-top:3px; | 29 | padding-top:3px; |
41 | 27 | padding-bottom:3px; | 30 | padding-bottom:3px; |
42 | 28 | } | 31 | } |
48 | 29 | .list_invoice_table thead { | 32 | .list_main_lines, |
49 | 30 | display:table-header-group; | 33 | .list_main_footers { |
50 | 31 | } | 34 | padding: 0; |
51 | 32 | 35 | } | |
52 | 33 | td.formatted_note { | 36 | .list_main_footers { |
53 | 37 | padding-top: 15px; | ||
54 | 38 | } | ||
55 | 39 | .list_main_lines td, | ||
56 | 40 | .list_main_footers td, | ||
57 | 41 | .list_main_footers th { | ||
58 | 42 | border-style: none; | ||
59 | 43 | text-align:left; | ||
60 | 44 | font-size:12; | ||
61 | 45 | padding:0; | ||
62 | 46 | } | ||
63 | 47 | .list_main_footers th { | ||
64 | 48 | text-align:right; | ||
65 | 49 | } | ||
66 | 50 | |||
67 | 51 | td .total_empty_cell { | ||
68 | 52 | width: 77%; | ||
69 | 53 | } | ||
70 | 54 | td .total_sum_cell { | ||
71 | 55 | width: 13%; | ||
72 | 56 | } | ||
73 | 57 | |||
74 | 58 | .nobreak { | ||
75 | 59 | page-break-inside: avoid; | ||
76 | 60 | } | ||
77 | 61 | caption.formatted_note { | ||
78 | 34 | text-align:left; | 62 | text-align:left; |
79 | 35 | border-right:thin solid #EEEEEE; | 63 | border-right:thin solid #EEEEEE; |
80 | 36 | border-left:thin solid #EEEEEE; | 64 | border-left:thin solid #EEEEEE; |
81 | 37 | border-top:thin solid #EEEEEE; | 65 | border-top:thin solid #EEEEEE; |
82 | 38 | padding-left:10px; | 66 | padding-left:10px; |
83 | 39 | font-size:11; | 67 | font-size:11; |
84 | 68 | caption-side: bottom; | ||
85 | 69 | } | ||
86 | 70 | caption.formatted_note p { | ||
87 | 71 | margin: 0; | ||
88 | 40 | } | 72 | } |
89 | 41 | 73 | ||
90 | 74 | .main_col1 { | ||
91 | 75 | width: 40%; | ||
92 | 76 | } | ||
93 | 77 | td.main_col1 { | ||
94 | 78 | text-align:left; | ||
95 | 79 | } | ||
96 | 80 | .main_col2, | ||
97 | 81 | .main_col3, | ||
98 | 82 | .main_col4, | ||
99 | 83 | .main_col6 { | ||
100 | 84 | width: 10%; | ||
101 | 85 | } | ||
102 | 86 | .main_col5 { | ||
103 | 87 | width: 7%; | ||
104 | 88 | } | ||
105 | 89 | td.main_col5 { | ||
106 | 90 | text-align: center; | ||
107 | 91 | font-style:italic; | ||
108 | 92 | font-size: 10; | ||
109 | 93 | } | ||
110 | 94 | .main_col7 { | ||
111 | 95 | width: 13%; | ||
112 | 96 | } | ||
113 | 42 | 97 | ||
114 | 43 | .list_bank_table { | 98 | .list_bank_table { |
115 | 44 | text-align:center; | 99 | text-align:center; |
116 | @@ -113,11 +168,6 @@ | |||
117 | 113 | display:table-header-group; | 168 | display:table-header-group; |
118 | 114 | } | 169 | } |
119 | 115 | 170 | ||
120 | 116 | |||
121 | 117 | .no_bloc { | ||
122 | 118 | border-top: thin solid #ffffff ; | ||
123 | 119 | } | ||
124 | 120 | |||
125 | 121 | .right_table { | 171 | .right_table { |
126 | 122 | right: 4cm; | 172 | right: 4cm; |
127 | 123 | width:"100%"; | 173 | width:"100%"; |
128 | @@ -127,10 +177,6 @@ | |||
129 | 127 | font-size:12; | 177 | font-size:12; |
130 | 128 | } | 178 | } |
131 | 129 | 179 | ||
132 | 130 | tfoot.totals tr:first-child td{ | ||
133 | 131 | padding-top: 15px; | ||
134 | 132 | } | ||
135 | 133 | |||
136 | 134 | th.date { | 180 | th.date { |
137 | 135 | width: 90px; | 181 | width: 90px; |
138 | 136 | } | 182 | } |
139 | @@ -139,19 +185,6 @@ | |||
140 | 139 | text-align: right; | 185 | text-align: right; |
141 | 140 | white-space: nowrap; | 186 | white-space: nowrap; |
142 | 141 | } | 187 | } |
143 | 142 | .header_table { | ||
144 | 143 | text-align: center; | ||
145 | 144 | border: 1px solid lightGrey; | ||
146 | 145 | border-collapse: collapse; | ||
147 | 146 | } | ||
148 | 147 | .header_table th { | ||
149 | 148 | font-size: 12px; | ||
150 | 149 | border: 1px solid lightGrey; | ||
151 | 150 | } | ||
152 | 151 | .header_table td { | ||
153 | 152 | font-size: 12px; | ||
154 | 153 | border: 1px solid lightGrey; | ||
155 | 154 | } | ||
156 | 155 | 188 | ||
157 | 156 | td.date { | 189 | td.date { |
158 | 157 | white-space: nowrap; | 190 | white-space: nowrap; |
159 | @@ -163,6 +196,9 @@ | |||
160 | 163 | } | 196 | } |
161 | 164 | .address .recipient { | 197 | .address .recipient { |
162 | 165 | font-size: 12px; | 198 | font-size: 12px; |
163 | 199 | margin-left: 350px; | ||
164 | 200 | margin-right: 120px; | ||
165 | 201 | float: right; | ||
166 | 166 | } | 202 | } |
167 | 167 | 203 | ||
168 | 168 | </style> | 204 | </style> |
169 | @@ -174,45 +210,44 @@ | |||
170 | 174 | return text.replace('\n', '<br />') | 210 | return text.replace('\n', '<br />') |
171 | 175 | %> | 211 | %> |
172 | 176 | 212 | ||
173 | 213 | <%def name="address(partner, commercial_partner=None)"> | ||
174 | 214 | <%doc> | ||
175 | 215 | XXX add a helper for address in report_webkit module as this won't be suported in v8.0 | ||
176 | 216 | </%doc> | ||
177 | 217 | <% company_partner = False %> | ||
178 | 218 | %if commercial_partner: | ||
179 | 219 | %if commercial_partner.id != partner.id: | ||
180 | 220 | <% company_partner = commercial_partner %> | ||
181 | 221 | %endif | ||
182 | 222 | %elif partner.parent_id: | ||
183 | 223 | <% company_partner = partner.parent_id %> | ||
184 | 224 | %endif | ||
185 | 225 | |||
186 | 226 | %if company_partner: | ||
187 | 227 | <tr><td class="name">${company_partner.name or ''}</td></tr> | ||
188 | 228 | <tr><td>${partner.title and partner.title.name or ''} ${partner.name}</td></tr> | ||
189 | 229 | <% address_lines = partner.contact_address.split("\n")[1:] %> | ||
190 | 230 | %else: | ||
191 | 231 | <tr><td class="name">${partner.title and partner.title.name or ''} ${partner.name}</td></tr> | ||
192 | 232 | <% address_lines = partner.contact_address.split("\n") %> | ||
193 | 233 | %endif | ||
194 | 234 | %for part in address_lines: | ||
195 | 235 | % if part: | ||
196 | 236 | <tr><td>${part}</td></tr> | ||
197 | 237 | % endif | ||
198 | 238 | %endfor | ||
199 | 239 | </%def> | ||
200 | 240 | |||
201 | 177 | %for inv in objects: | 241 | %for inv in objects: |
202 | 178 | <% setLang(inv.partner_id.lang) %> | 242 | <% setLang(inv.partner_id.lang) %> |
203 | 179 | <div class="address"> | 243 | <div class="address"> |
240 | 180 | %if hasattr(inv, 'commercial_partner_id'): | 244 | <table class="recipient"> |
241 | 181 | <table class="recipient"> | 245 | %if hasattr(inv, 'commercial_partner_id'): |
242 | 182 | %if inv.partner_id.id != inv.commercial_partner_id.id: | 246 | ${address(partner=inv.partner_id, commercial_partner=inv.commercial_partner_id)} |
243 | 183 | <tr><td class="name">${inv.commercial_partner_id.name or ''}</td></tr> | 247 | %else: |
244 | 184 | <tr><td>${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr> | 248 | ${address(partner=inv.partner_id)} |
245 | 185 | %else: | 249 | %endif |
246 | 186 | <tr><td class="name">${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr> | 250 | </table> |
211 | 187 | %endif | ||
212 | 188 | %if inv.partner_id.parent_id: | ||
213 | 189 | <% address_lines = inv.partner_id.contact_address.split("\n")[1:] %> | ||
214 | 190 | %else: | ||
215 | 191 | <% address_lines = inv.partner_id.contact_address.split("\n") %> | ||
216 | 192 | %endif | ||
217 | 193 | %for part in address_lines: | ||
218 | 194 | %if part: | ||
219 | 195 | <tr><td>${part}</td></tr> | ||
220 | 196 | %endif | ||
221 | 197 | %endfor | ||
222 | 198 | </table> | ||
223 | 199 | %else: | ||
224 | 200 | <table class="recipient"> | ||
225 | 201 | %if inv.partner_id.parent_id: | ||
226 | 202 | <tr><td class="name">${inv.partner_id.parent_id.name or ''}</td></tr> | ||
227 | 203 | <tr><td>${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr> | ||
228 | 204 | <% address_lines = inv.partner_id.contact_address.split("\n")[1:] %> | ||
229 | 205 | %else: | ||
230 | 206 | <tr><td class="name">${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr> | ||
231 | 207 | <% address_lines = inv.partner_id.contact_address.split("\n") %> | ||
232 | 208 | %endif | ||
233 | 209 | %for part in address_lines: | ||
234 | 210 | %if part: | ||
235 | 211 | <tr><td>${part}</td></tr> | ||
236 | 212 | %endif | ||
237 | 213 | %endfor | ||
238 | 214 | </table> | ||
239 | 215 | %endif | ||
247 | 216 | </div> | 251 | </div> |
248 | 217 | <h1 style="clear: both; padding-top: 20px;"> | 252 | <h1 style="clear: both; padding-top: 20px;"> |
249 | 218 | %if inv.type == 'out_invoice' and inv.state == 'proforma2': | 253 | %if inv.type == 'out_invoice' and inv.state == 'proforma2': |
250 | @@ -253,69 +288,92 @@ | |||
251 | 253 | </table> | 288 | </table> |
252 | 254 | 289 | ||
253 | 255 | <div> | 290 | <div> |
255 | 256 | %if inv.note1 : | 291 | %if inv.note1: |
256 | 257 | <p class="std_text"> ${inv.note1 | n} </p> | 292 | <p class="std_text"> ${inv.note1 | n} </p> |
257 | 258 | %endif | 293 | %endif |
258 | 259 | </div> | 294 | </div> |
259 | 260 | 295 | ||
290 | 261 | <table class="list_invoice_table" width="100%" style="margin-top: 20px;"> | 296 | <table class="list_main_table" width="100%"> |
291 | 262 | <thead> | 297 | <thead> |
292 | 263 | <tr> | 298 | <tr> |
293 | 264 | <th>${_("Description")}</th> | 299 | <th class="list_main_headers" style="width: 100%"> |
294 | 265 | <th>${_("Qty")}</th> | 300 | <table style="width:100%"> |
295 | 266 | <th>${_("UoM")}</th> | 301 | <tr> |
296 | 267 | <th>${_("Unit Price")}</th> | 302 | <th class="main_col1">${_("Description")}</th> |
297 | 268 | <th>${_("Taxes")}</th> | 303 | <th class="amount main_col2">${_("Qty")}</th> |
298 | 269 | <th>${_("Disc.(%)")}</th> | 304 | <th class="amount main_col3">${_("UoM")}</th> |
299 | 270 | <th>${_("Net Sub Total")}</th> | 305 | <th class="amount main_col4">${_("Unit Price")}</th> |
300 | 271 | </tr> | 306 | <th class="main_col5">${_("Taxes")}</th> |
301 | 272 | </thead> | 307 | <th class="amount main_col6">${_("Disc.(%)")}</th> |
302 | 273 | <tbody> | 308 | <th class="amount main_col7">${_("Net Sub Total")}</th> |
303 | 274 | %for line in inv.invoice_line : | 309 | </tr> |
304 | 275 | <tr > | 310 | </table> |
305 | 276 | <td>${line.name or ''}</td> | 311 | </th> |
306 | 277 | <td class="amount">${formatLang(line.quantity or 0.0,digits=get_digits(dp='Account'))}</td> | 312 | </tr> |
307 | 278 | <td class="amount">${line.uos_id and line.uos_id.name or ''}</td> | 313 | </thead> |
308 | 279 | <td class="amount">${formatLang(line.price_unit)}</td> | 314 | <tbody> |
309 | 280 | <td style="font-style:italic; font-size: 10;text-align:center;" >${ ', '.join([ tax.description or tax.name for tax in line.invoice_line_tax_id ])}</td> | 315 | %for line in inv.invoice_line: |
310 | 281 | <td class="amount" width="10%">${line.discount and formatLang(line.discount, digits=get_digits(dp='Account')) or ''} ${line.discount and '%' or ''}</td> | 316 | <tr> |
311 | 282 | <td class="amount" width="13%">${formatLang(line.price_subtotal, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</td> | 317 | <td class="list_main_lines" style="width: 100%"> |
312 | 283 | </tr> | 318 | <div class="nobreak"> |
313 | 284 | %if line.formatted_note: | 319 | <table style="width:100%"> |
314 | 285 | <tr> | 320 | <tr> |
315 | 286 | <td class="formatted_note" colspan="7"> | 321 | <td class="main_col1">${line.product_id and line.product_id.code or ''} ${line.product_id and line.product_id.name or ''}</td> |
316 | 287 | ${line.formatted_note| n} | 322 | <td class="amount main_col2">${formatLang(line.quantity or 0.0,digits=get_digits(dp='Account'))}</td> |
317 | 288 | </td> | 323 | <td class="amount main_col3">${line.uos_id and line.uos_id.name or ''}</td> |
318 | 289 | </tr> | 324 | <td class="amount main_col4">${formatLang(line.price_unit)}</td> |
319 | 290 | %endif | 325 | <td class="main_col5">${ ', '.join([tax.description or tax.name for tax in line.invoice_line_tax_id])}</td> |
320 | 326 | <td class="amount main_col6">${line.discount and formatLang(line.discount, digits=get_digits(dp='Account')) or ''} ${line.discount and '%' or ''}</td> | ||
321 | 327 | <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</td> | ||
322 | 328 | </tr> | ||
323 | 329 | %if line.formatted_note: | ||
324 | 330 | <caption class="formatted_note"> | ||
325 | 331 | ${line.formatted_note| n} | ||
326 | 332 | </caption> | ||
327 | 333 | %endif | ||
328 | 334 | </table> | ||
329 | 335 | </div> | ||
330 | 336 | </td> | ||
331 | 337 | </tr> | ||
332 | 291 | %endfor | 338 | %endfor |
340 | 292 | </tbody> | 339 | </tbody> |
341 | 293 | <tfoot class="totals"> | 340 | <tfoot class="totals"> |
342 | 294 | <tr> | 341 | <tr> |
343 | 295 | <td colspan="6" style="text-align:right;border-right: thin solid #ffffff ;border-left: thin solid #ffffff ;"> | 342 | <td class="list_main_footers" style="width: 100%"> |
344 | 296 | <b>${_("Net :")}</b> | 343 | <div class="nobreak"> |
345 | 297 | </td> | 344 | <table style="width:100%"> |
346 | 298 | <td class="amount" style="border-right: thin solid #ffffff ;border-left: thin solid #ffffff ;"> | 345 | <tr> |
347 | 346 | <td class="total_empty_cell"/> | ||
348 | 347 | <th> | ||
349 | 348 | ${_("Net :")} | ||
350 | 349 | </th> | ||
351 | 350 | <td class="amount total_sum_cell"> | ||
352 | 299 | ${formatLang(inv.amount_untaxed, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol} | 351 | ${formatLang(inv.amount_untaxed, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol} |
372 | 300 | </td> | 352 | </td> |
373 | 301 | </tr> | 353 | </tr> |
374 | 302 | <tr class="no_bloc"> | 354 | <tr> |
375 | 303 | <td colspan="6" style="text-align:right; border-top: thin solid #ffffff ; border-right: thin solid #ffffff ;border-left: thin solid #ffffff ;"> | 355 | <td class="total_empty_cell"/> |
376 | 304 | <b>${_("Taxes:")}</b> | 356 | <th> |
377 | 305 | </td> | 357 | ${_("Taxes:")} |
378 | 306 | <td class="amount" style="border-right: thin solid #ffffff ;border-top: thin solid #ffffff ;border-left: thin solid #ffffff ;"> | 358 | </th> |
379 | 307 | ${formatLang(inv.amount_tax, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol} | 359 | <td class="amount total_sum_cell"> |
380 | 308 | </td> | 360 | ${formatLang(inv.amount_tax, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol} |
381 | 309 | </tr> | 361 | </td> |
382 | 310 | <tr> | 362 | </tr> |
383 | 311 | <td colspan="6" style="border-right: thin solid #ffffff ;border-top: thin solid #ffffff ;border-left: thin solid #ffffff ;border-bottom: thin solid #ffffff ;text-align:right;"> | 363 | <tr> |
384 | 312 | <b>${_("Total:")}</b> | 364 | <td class="total_empty_cell"/> |
385 | 313 | </td> | 365 | <th> |
386 | 314 | <td class="amount" style="border-right: thin solid #ffffff ;border-top: thin solid #ffffff ;border-left: thin solid #ffffff ;border-bottom: thin solid #ffffff ;"> | 366 | ${_("Total:")} |
387 | 315 | <b>${formatLang(inv.amount_total, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</b> | 367 | </th> |
388 | 316 | </td> | 368 | <td class="amount total_sum_cell"> |
389 | 317 | </tr> | 369 | <b>${formatLang(inv.amount_total, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</b> |
390 | 318 | </tfoot> | 370 | </td> |
391 | 371 | </tr> | ||
392 | 372 | </table> | ||
393 | 373 | </div> | ||
394 | 374 | </td> | ||
395 | 375 | </tr> | ||
396 | 376 | </tfoot> | ||
397 | 319 | </table> | 377 | </table> |
398 | 320 | <br/> | 378 | <br/> |
399 | 321 | <table class="list_total_table" width="60%" > | 379 | <table class="list_total_table" width="60%" > |
400 | @@ -375,13 +433,13 @@ | |||
401 | 375 | %if inv.note2 : | 433 | %if inv.note2 : |
402 | 376 | <p class="std_text">${inv.note2 | n}</p> | 434 | <p class="std_text">${inv.note2 | n}</p> |
403 | 377 | %endif | 435 | %endif |
405 | 378 | %if inv.fiscal_position and inv.fiscal_position.note : | 436 | %if inv.fiscal_position and inv.fiscal_position.note: |
406 | 379 | <br/> | 437 | <br/> |
407 | 380 | <p class="std_text"> | 438 | <p class="std_text"> |
408 | 381 | ${inv.fiscal_position.note | n} | 439 | ${inv.fiscal_position.note | n} |
409 | 382 | </p> | 440 | </p> |
410 | 383 | %endif | 441 | %endif |
412 | 384 | <p style="page-break-after:always"></p> | 442 | <p style="page-break-after:always"/> |
413 | 385 | %endfor | 443 | %endfor |
414 | 386 | </body> | 444 | </body> |
415 | 387 | </html> | 445 | </html> |
LGTM. I have not tested, but sintactically seems correct.
Thank you.