Merge lp:~camptocamp/account-invoice-report/7.0-fix-1231329 into lp:~account-core-editors/account-invoice-report/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
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
To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM. I have not tested, but sintactically seems correct.

Thank you.

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
=== modified file 'invoice_webkit/report/account_invoice.mako'
--- invoice_webkit/report/account_invoice.mako 2013-08-24 08:11:45 +0000
+++ invoice_webkit/report/account_invoice.mako 2013-10-17 09:31:03 +0000
@@ -3,42 +3,97 @@
3 <style type="text/css">3 <style type="text/css">
4 ${css}4 ${css}
55
6.list_invoice_table {6.list_main_table {
7 border:thin solid #E3E4EA;7 border:thin solid #E3E4EA;
8 text-align:center;8 text-align:center;
9 border-collapse: collapse;9 border-collapse: collapse;
10}10}
11.list_invoice_table th {11table.list_main_table {
12 margin-top: 20px;
13}
14.list_main_headers {
15 padding: 0;
16}
17.list_main_headers th {
18 border: thin solid #000000;
19 padding-right:3px;
20 padding-left:3px;
12 background-color: #EEEEEE;21 background-color: #EEEEEE;
13 border: thin solid #000000;
14 text-align:center;22 text-align:center;
15 font-size:12;23 font-size:12;
16 font-weight:bold;24 font-weight:bold;
17 padding-right:3px;
18 padding-left:3px;
19}25}
20.list_invoice_table td {26.list_main_table td {
21 border-top : thin solid #EEEEEE;
22 text-align:left;
23 font-size:12;
24 padding-right:3px;27 padding-right:3px;
25 padding-left:3px;28 padding-left:3px;
26 padding-top:3px;29 padding-top:3px;
27 padding-bottom:3px;30 padding-bottom:3px;
28}31}
29.list_invoice_table thead {32.list_main_lines,
30 display:table-header-group;33.list_main_footers {
31}34 padding: 0;
3235}
33td.formatted_note {36.list_main_footers {
37 padding-top: 15px;
38}
39.list_main_lines td,
40.list_main_footers td,
41.list_main_footers th {
42 border-style: none;
43 text-align:left;
44 font-size:12;
45 padding:0;
46}
47.list_main_footers th {
48 text-align:right;
49}
50
51td .total_empty_cell {
52 width: 77%;
53}
54td .total_sum_cell {
55 width: 13%;
56}
57
58.nobreak {
59 page-break-inside: avoid;
60}
61caption.formatted_note {
34 text-align:left;62 text-align:left;
35 border-right:thin solid #EEEEEE;63 border-right:thin solid #EEEEEE;
36 border-left:thin solid #EEEEEE;64 border-left:thin solid #EEEEEE;
37 border-top:thin solid #EEEEEE;65 border-top:thin solid #EEEEEE;
38 padding-left:10px;66 padding-left:10px;
39 font-size:11;67 font-size:11;
68 caption-side: bottom;
69}
70caption.formatted_note p {
71 margin: 0;
40}72}
4173
74.main_col1 {
75 width: 40%;
76}
77td.main_col1 {
78 text-align:left;
79}
80.main_col2,
81.main_col3,
82.main_col4,
83.main_col6 {
84 width: 10%;
85}
86.main_col5 {
87 width: 7%;
88}
89td.main_col5 {
90 text-align: center;
91 font-style:italic;
92 font-size: 10;
93}
94.main_col7 {
95 width: 13%;
96}
4297
43.list_bank_table {98.list_bank_table {
44 text-align:center;99 text-align:center;
@@ -113,11 +168,6 @@
113 display:table-header-group;168 display:table-header-group;
114}169}
115170
116
117.no_bloc {
118 border-top: thin solid #ffffff ;
119}
120
121.right_table {171.right_table {
122 right: 4cm;172 right: 4cm;
123 width:"100%";173 width:"100%";
@@ -127,10 +177,6 @@
127 font-size:12;177 font-size:12;
128}178}
129179
130tfoot.totals tr:first-child td{
131 padding-top: 15px;
132}
133
134th.date {180th.date {
135 width: 90px;181 width: 90px;
136}182}
@@ -139,19 +185,6 @@
139 text-align: right;185 text-align: right;
140 white-space: nowrap;186 white-space: nowrap;
141}187}
142.header_table {
143 text-align: center;
144 border: 1px solid lightGrey;
145 border-collapse: collapse;
146}
147.header_table th {
148 font-size: 12px;
149 border: 1px solid lightGrey;
150}
151.header_table td {
152 font-size: 12px;
153 border: 1px solid lightGrey;
154}
155188
156td.date {189td.date {
157 white-space: nowrap;190 white-space: nowrap;
@@ -163,6 +196,9 @@
163}196}
164.address .recipient {197.address .recipient {
165 font-size: 12px;198 font-size: 12px;
199 margin-left: 350px;
200 margin-right: 120px;
201 float: right;
166}202}
167203
168 </style>204 </style>
@@ -174,45 +210,44 @@
174 return text.replace('\n', '<br />')210 return text.replace('\n', '<br />')
175 %>211 %>
176212
213 <%def name="address(partner, commercial_partner=None)">
214 <%doc>
215 XXX add a helper for address in report_webkit module as this won't be suported in v8.0
216 </%doc>
217 <% company_partner = False %>
218 %if commercial_partner:
219 %if commercial_partner.id != partner.id:
220 <% company_partner = commercial_partner %>
221 %endif
222 %elif partner.parent_id:
223 <% company_partner = partner.parent_id %>
224 %endif
225
226 %if company_partner:
227 <tr><td class="name">${company_partner.name or ''}</td></tr>
228 <tr><td>${partner.title and partner.title.name or ''} ${partner.name}</td></tr>
229 <% address_lines = partner.contact_address.split("\n")[1:] %>
230 %else:
231 <tr><td class="name">${partner.title and partner.title.name or ''} ${partner.name}</td></tr>
232 <% address_lines = partner.contact_address.split("\n") %>
233 %endif
234 %for part in address_lines:
235 % if part:
236 <tr><td>${part}</td></tr>
237 % endif
238 %endfor
239 </%def>
240
177 %for inv in objects:241 %for inv in objects:
178 <% setLang(inv.partner_id.lang) %>242 <% setLang(inv.partner_id.lang) %>
179 <div class="address">243 <div class="address">
180 %if hasattr(inv, 'commercial_partner_id'):244 <table class="recipient">
181 <table class="recipient">245 %if hasattr(inv, 'commercial_partner_id'):
182 %if inv.partner_id.id != inv.commercial_partner_id.id:246 ${address(partner=inv.partner_id, commercial_partner=inv.commercial_partner_id)}
183 <tr><td class="name">${inv.commercial_partner_id.name or ''}</td></tr>247 %else:
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)}
185 %else:249 %endif
186 <tr><td class="name">${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr>250 </table>
187 %endif
188 %if inv.partner_id.parent_id:
189 <% address_lines = inv.partner_id.contact_address.split("\n")[1:] %>
190 %else:
191 <% address_lines = inv.partner_id.contact_address.split("\n") %>
192 %endif
193 %for part in address_lines:
194 %if part:
195 <tr><td>${part}</td></tr>
196 %endif
197 %endfor
198 </table>
199 %else:
200 <table class="recipient">
201 %if inv.partner_id.parent_id:
202 <tr><td class="name">${inv.partner_id.parent_id.name or ''}</td></tr>
203 <tr><td>${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr>
204 <% address_lines = inv.partner_id.contact_address.split("\n")[1:] %>
205 %else:
206 <tr><td class="name">${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr>
207 <% address_lines = inv.partner_id.contact_address.split("\n") %>
208 %endif
209 %for part in address_lines:
210 %if part:
211 <tr><td>${part}</td></tr>
212 %endif
213 %endfor
214 </table>
215 %endif
216 </div>251 </div>
217 <h1 style="clear: both; padding-top: 20px;">252 <h1 style="clear: both; padding-top: 20px;">
218 %if inv.type == 'out_invoice' and inv.state == 'proforma2':253 %if inv.type == 'out_invoice' and inv.state == 'proforma2':
@@ -253,69 +288,92 @@
253 </table>288 </table>
254289
255 <div>290 <div>
256 %if inv.note1 :291 %if inv.note1:
257 <p class="std_text"> ${inv.note1 | n} </p>292 <p class="std_text"> ${inv.note1 | n} </p>
258 %endif293 %endif
259 </div>294 </div>
260295
261 <table class="list_invoice_table" width="100%" style="margin-top: 20px;">296 <table class="list_main_table" width="100%">
262 <thead>297 <thead>
263 <tr>298 <tr>
264 <th>${_("Description")}</th>299 <th class="list_main_headers" style="width: 100%">
265 <th>${_("Qty")}</th>300 <table style="width:100%">
266 <th>${_("UoM")}</th>301 <tr>
267 <th>${_("Unit Price")}</th>302 <th class="main_col1">${_("Description")}</th>
268 <th>${_("Taxes")}</th>303 <th class="amount main_col2">${_("Qty")}</th>
269 <th>${_("Disc.(%)")}</th>304 <th class="amount main_col3">${_("UoM")}</th>
270 <th>${_("Net Sub Total")}</th>305 <th class="amount main_col4">${_("Unit Price")}</th>
271 </tr>306 <th class="main_col5">${_("Taxes")}</th>
272 </thead>307 <th class="amount main_col6">${_("Disc.(%)")}</th>
273 <tbody>308 <th class="amount main_col7">${_("Net Sub Total")}</th>
274 %for line in inv.invoice_line :309 </tr>
275 <tr >310 </table>
276 <td>${line.name or ''}</td>311 </th>
277 <td class="amount">${formatLang(line.quantity or 0.0,digits=get_digits(dp='Account'))}</td>312 </tr>
278 <td class="amount">${line.uos_id and line.uos_id.name or ''}</td>313 </thead>
279 <td class="amount">${formatLang(line.price_unit)}</td>314 <tbody>
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:
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>
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%">
283 </tr>318 <div class="nobreak">
284 %if line.formatted_note:319 <table style="width:100%">
285 <tr>320 <tr>
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>
287 ${line.formatted_note| n}322 <td class="amount main_col2">${formatLang(line.quantity or 0.0,digits=get_digits(dp='Account'))}</td>
288 </td>323 <td class="amount main_col3">${line.uos_id and line.uos_id.name or ''}</td>
289 </tr>324 <td class="amount main_col4">${formatLang(line.price_unit)}</td>
290 %endif325 <td class="main_col5">${ ', '.join([tax.description or tax.name for tax in line.invoice_line_tax_id])}</td>
326 <td class="amount main_col6">${line.discount and formatLang(line.discount, digits=get_digits(dp='Account')) or ''} ${line.discount and '%' or ''}</td>
327 <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</td>
328 </tr>
329 %if line.formatted_note:
330 <caption class="formatted_note">
331 ${line.formatted_note| n}
332 </caption>
333 %endif
334 </table>
335 </div>
336 </td>
337 </tr>
291 %endfor338 %endfor
292 </tbody>339 </tbody>
293 <tfoot class="totals">340 <tfoot class="totals">
294 <tr>341 <tr>
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%">
296 <b>${_("Net :")}</b>343 <div class="nobreak">
297 </td>344 <table style="width:100%">
298 <td class="amount" style="border-right: thin solid #ffffff ;border-left: thin solid #ffffff ;">345 <tr>
346 <td class="total_empty_cell"/>
347 <th>
348 ${_("Net :")}
349 </th>
350 <td class="amount total_sum_cell">
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}
300 </td>352 </td>
301 </tr>353 </tr>
302 <tr class="no_bloc">354 <tr>
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"/>
304 <b>${_("Taxes:")}</b>356 <th>
305 </td>357 ${_("Taxes:")}
306 <td class="amount" style="border-right: thin solid #ffffff ;border-top: thin solid #ffffff ;border-left: thin solid #ffffff ;">358 </th>
307 ${formatLang(inv.amount_tax, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}359 <td class="amount total_sum_cell">
308 </td>360 ${formatLang(inv.amount_tax, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}
309 </tr>361 </td>
310 <tr>362 </tr>
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>
312 <b>${_("Total:")}</b>364 <td class="total_empty_cell"/>
313 </td>365 <th>
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:")}
315 <b>${formatLang(inv.amount_total, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</b>367 </th>
316 </td>368 <td class="amount total_sum_cell">
317 </tr>369 <b>${formatLang(inv.amount_total, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</b>
318 </tfoot>370 </td>
371 </tr>
372 </table>
373 </div>
374 </td>
375 </tr>
376 </tfoot>
319 </table>377 </table>
320 <br/>378 <br/>
321 <table class="list_total_table" width="60%" >379 <table class="list_total_table" width="60%" >
@@ -375,13 +433,13 @@
375 %if inv.note2 :433 %if inv.note2 :
376 <p class="std_text">${inv.note2 | n}</p>434 <p class="std_text">${inv.note2 | n}</p>
377 %endif435 %endif
378 %if inv.fiscal_position and inv.fiscal_position.note :436 %if inv.fiscal_position and inv.fiscal_position.note:
379 <br/>437 <br/>
380 <p class="std_text">438 <p class="std_text">
381 ${inv.fiscal_position.note | n}439 ${inv.fiscal_position.note | n}
382 </p>440 </p>
383 %endif441 %endif
384 <p style="page-break-after:always"></p>442 <p style="page-break-after:always"/>
385 %endfor443 %endfor
386</body>444</body>
387</html>445</html>

Subscribers

People subscribed via source and target branches