Status: | Merged |
---|---|
Merged at revision: | 2524 |
Proposed branch: | lp:~os-1/unifield-wm/US-266 |
Merge into: | lp:unifield-wm |
Diff against target: |
679 lines (+630/-11) 6 files modified
account_override/account_invoice_report.xml (+29/-10) account_override/report/__init__.py (+3/-1) account_override/report/allocation_invoices_report.rml (+264/-0) account_override/report/allocation_synthesis_invoices_xls.mako (+166/-0) account_override/report/report_allocation_invoices.py (+81/-0) account_override/report/report_allocation_synthesis_invoices.py (+87/-0) |
To merge this branch: | bzr merge lp:~os-1/unifield-wm/US-266 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'account_override/account_invoice_report.xml' | |||
2 | --- account_override/account_invoice_report.xml 2013-11-28 20:42:06 +0000 | |||
3 | +++ account_override/account_invoice_report.xml 2015-05-29 09:19:39 +0000 | |||
4 | @@ -3,16 +3,35 @@ | |||
5 | 3 | <data> | 3 | <data> |
6 | 4 | 4 | ||
7 | 5 | <report id="open_invoices_2" | 5 | <report id="open_invoices_2" |
18 | 6 | string="Open Invoices" | 6 | string="Open Invoices" |
19 | 7 | model="account.invoice" | 7 | model="account.invoice" |
20 | 8 | name="open.invoices.2" | 8 | name="open.invoices.2" |
21 | 9 | target_filename="Open Invoices_${company_id.instance_id.code}_%(year)s%(month)s%(day)s" | 9 | target_filename="Open Invoices_${company_id.instance_id.code}_%(year)s%(month)s%(day)s" |
22 | 10 | file="account_override/report/open_invoices_xls.mako" | 10 | file="account_override/report/open_invoices_xls.mako" |
23 | 11 | report_type="webkit" | 11 | report_type="webkit" |
24 | 12 | header="False" | 12 | header="False" |
25 | 13 | auto="False" | 13 | auto="False" |
26 | 14 | menu="True"/> | 14 | menu="True"/> |
27 | 15 | 15 | ||
28 | 16 | <report id="synthesis_invoices_report" | ||
29 | 17 | string="Allocation synthesis" | ||
30 | 18 | model="account.invoice" | ||
31 | 19 | name="allocation.synthesis.invoices" | ||
32 | 20 | target_filename="Allocation_synthesis_${company_id.instance_id.code}_%(year)s%(month)s%(day)s" | ||
33 | 21 | file="account_override/report/allocation_synthesis_invoices_xls.mako" | ||
34 | 22 | report_type="webkit" | ||
35 | 23 | header="False" | ||
36 | 24 | auto="False" | ||
37 | 25 | menu="True"/> | ||
38 | 26 | |||
39 | 27 | <report id="allocation_invoices_report" | ||
40 | 28 | model="account.invoice" | ||
41 | 29 | name="allocation.invoices.report" | ||
42 | 30 | target_filename="Allocation_report_${company_id.instance_id.code}_%(year)s%(month)s%(day)s" | ||
43 | 31 | rml="account_override/report/allocation_invoices_report.rml" | ||
44 | 32 | header="False" | ||
45 | 33 | auto="False" | ||
46 | 34 | string="Invoice allocation"/> | ||
47 | 16 | </data> | 35 | </data> |
48 | 17 | </openerp> | 36 | </openerp> |
49 | 18 | 37 | ||
50 | 19 | 38 | ||
51 | === modified file 'account_override/report/__init__.py' | |||
52 | --- account_override/report/__init__.py 2014-03-19 13:40:41 +0000 | |||
53 | +++ account_override/report/__init__.py 2015-05-29 09:19:39 +0000 | |||
54 | @@ -1,3 +1,5 @@ | |||
55 | 1 | import account_chart_export | 1 | import account_chart_export |
56 | 2 | import account_print_invoice | 2 | import account_print_invoice |
57 | 3 | import report_open_invoices | ||
58 | 4 | \ No newline at end of file | 3 | \ No newline at end of file |
59 | 4 | import report_open_invoices | ||
60 | 5 | import report_allocation_synthesis_invoices | ||
61 | 6 | import report_allocation_invoices | ||
62 | 5 | 7 | ||
63 | === added file 'account_override/report/allocation_invoices_report.rml' | |||
64 | --- account_override/report/allocation_invoices_report.rml 1970-01-01 00:00:00 +0000 | |||
65 | +++ account_override/report/allocation_invoices_report.rml 2015-05-29 09:19:39 +0000 | |||
66 | @@ -0,0 +1,264 @@ | |||
67 | 1 | <?xml version="1.0"?> | ||
68 | 2 | <document filename="allocation_invoice_report.pdf"> | ||
69 | 3 | <template pageSize="(842.0,595.0)" title="Test" author="Medecins Sans Frontieres" allowSplitting="20"> | ||
70 | 4 | <pageTemplate id="first"> | ||
71 | 5 | <frame id="first" x1="42.0" y1="57.0" width="750" height="530"/> | ||
72 | 6 | </pageTemplate> | ||
73 | 7 | </template> | ||
74 | 8 | <stylesheet> | ||
75 | 9 | |||
76 | 10 | <!-- TABLE STYLES --> | ||
77 | 11 | <blockTableStyle id="HeaderTable"> | ||
78 | 12 | <blockAlignment value="CENTER" /> | ||
79 | 13 | <blockValign value="MIDDLE" /> | ||
80 | 14 | <lineStyle kind="OUTLINE" colorName="#000000" /> | ||
81 | 15 | </blockTableStyle> | ||
82 | 16 | |||
83 | 17 | <blockTableStyle id="InformationTable"> | ||
84 | 18 | <blockAlignment value="CENTER" /> | ||
85 | 19 | <blockValign value="MIDDLE" /> | ||
86 | 20 | <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" /> | ||
87 | 21 | <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="-1,0" /> | ||
88 | 22 | <lineStyle kind="LINEBEFORE" colorName="#000000" /> | ||
89 | 23 | <lineStyle kind="LINEAFTER" colorName="#000000" /> | ||
90 | 24 | </blockTableStyle> | ||
91 | 25 | |||
92 | 26 | <blockTableStyle id="ProductList"> | ||
93 | 27 | <blockValign value="MIDDLE" /> | ||
94 | 28 | <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" /> | ||
95 | 29 | <lineStyle kind="LINEABOVE" colorName="#000000" start="0,0" stop="-1,0" /> | ||
96 | 30 | <lineStyle kind="LINEBEFORE" colorName="#0b0b0b" /> | ||
97 | 31 | <lineStyle kind="LINEAFTER" colorName="#000000" /> | ||
98 | 32 | </blockTableStyle> | ||
99 | 33 | |||
100 | 34 | <initialize> | ||
101 | 35 | <paraStyle name="all" alignment="justify"/> | ||
102 | 36 | </initialize> | ||
103 | 37 | |||
104 | 38 | <!-- PARAGRAPH STYLES --> | ||
105 | 39 | <paraStyle name="Standard" fontName="Helvetica"/> | ||
106 | 40 | <paraStyle name="Header" fontName="Helvetica-Bold" fontSize="15.0" leading="20" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0" /> | ||
107 | 41 | <paraStyle name="InformationHeader" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" /> | ||
108 | 42 | <paraStyle name="Information" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" /> | ||
109 | 43 | |||
110 | 44 | </stylesheet> | ||
111 | 45 | <story> | ||
112 | 46 | <pto> | ||
113 | 47 | <para style="Standard">[[repeatIn(objects,'o')]]</para> | ||
114 | 48 | <!--<para style="Standard">[[ setLang(o.partner_id.lang) ]]</para>--> | ||
115 | 49 | |||
116 | 50 | <!-- HEADER TABLE OF THE PRINTED FILE --> | ||
117 | 51 | <blockTable colWidths="565" style="HeaderTable"> | ||
118 | 52 | <tr> | ||
119 | 53 | <td> | ||
120 | 54 | <para style="Header">INVOICE LINES ALLOCATION REPORT</para> | ||
121 | 55 | </td> | ||
122 | 56 | </tr> | ||
123 | 57 | </blockTable> | ||
124 | 58 | |||
125 | 59 | |||
126 | 60 | <para style="Standard"> | ||
127 | 61 | <font color="white"> </font> | ||
128 | 62 | </para> | ||
129 | 63 | |||
130 | 64 | |||
131 | 65 | <!-- GENERAL INFORMATION --> | ||
132 | 66 | |||
133 | 67 | <blockTable colWidths="162.0,162.0,162.0,162.0" style="InformationTable"> | ||
134 | 68 | <tr> | ||
135 | 69 | <td> | ||
136 | 70 | <para style="InformationHeader">Invoice</para> | ||
137 | 71 | </td> | ||
138 | 72 | <td> | ||
139 | 73 | <para style="InformationHeader">Supplier</para> | ||
140 | 74 | </td> | ||
141 | 75 | <td> | ||
142 | 76 | <para style="InformationHeader">Type</para> | ||
143 | 77 | </td> | ||
144 | 78 | <td> | ||
145 | 79 | <para style="InformationHeader"></para> | ||
146 | 80 | </td> | ||
147 | 81 | </tr> | ||
148 | 82 | |||
149 | 83 | <tr> | ||
150 | 84 | <td> | ||
151 | 85 | <para style="Information">[[ o.number ]]</para> | ||
152 | 86 | </td> | ||
153 | 87 | <td> | ||
154 | 88 | <para style="Information">[[ o.partner_id.name ]]</para> | ||
155 | 89 | </td> | ||
156 | 90 | <td> | ||
157 | 91 | <para style="Information">[[ getSel(o, 'type') ]]</para> | ||
158 | 92 | </td> | ||
159 | 93 | <td> | ||
160 | 94 | <para style="Information"></para> | ||
161 | 95 | </td> | ||
162 | 96 | </tr> | ||
163 | 97 | </blockTable> | ||
164 | 98 | |||
165 | 99 | <blockTable colWidths="162.0,162.0,162.0,162.0" style="InformationTable"> | ||
166 | 100 | <tr> | ||
167 | 101 | <td> | ||
168 | 102 | <para style="InformationHeader">Creation date</para> | ||
169 | 103 | </td> | ||
170 | 104 | <td> | ||
171 | 105 | <para style="InformationHeader">Creator</para> | ||
172 | 106 | </td> | ||
173 | 107 | <td> | ||
174 | 108 | <para style="InformationHeader">State</para> | ||
175 | 109 | </td> | ||
176 | 110 | <td> | ||
177 | 111 | <para style="InformationHeader">Currency</para> | ||
178 | 112 | </td> | ||
179 | 113 | </tr> | ||
180 | 114 | |||
181 | 115 | <tr> | ||
182 | 116 | <td> | ||
183 | 117 | <para style="Information">[[ formatLang(o.date_invoice, date=True) ]]</para> | ||
184 | 118 | </td> | ||
185 | 119 | <td> | ||
186 | 120 | <para style="Information">[[ o.user_id.name ]]</para> | ||
187 | 121 | </td> | ||
188 | 122 | <td> | ||
189 | 123 | <para style="Information">[[ getSel(o, 'state') ]]</para> | ||
190 | 124 | </td> | ||
191 | 125 | <td> | ||
192 | 126 | <para style="Information">[[ o.currency_id.name ]]</para> | ||
193 | 127 | </td> | ||
194 | 128 | </tr> | ||
195 | 129 | </blockTable> | ||
196 | 130 | |||
197 | 131 | |||
198 | 132 | <para style="Standard"> | ||
199 | 133 | <font color="white"> </font> | ||
200 | 134 | </para> | ||
201 | 135 | |||
202 | 136 | |||
203 | 137 | <!-- LINES LIST --> | ||
204 | 138 | <blockTable colWidths="33.0,100.0,100.0,80.0,50.0,50.0,50.0,50.0,60.0,60.0,60.0" style="ProductList"> | ||
205 | 139 | <tr> | ||
206 | 140 | <td> | ||
207 | 141 | <para style="InformationHeader">Line</para> | ||
208 | 142 | </td> | ||
209 | 143 | <td> | ||
210 | 144 | <para style="InformationHeader">Product</para> | ||
211 | 145 | </td> | ||
212 | 146 | <td> | ||
213 | 147 | <para style="InformationHeader">Description</para> | ||
214 | 148 | </td> | ||
215 | 149 | <td> | ||
216 | 150 | <para style="InformationHeader">Account</para> | ||
217 | 151 | </td> | ||
218 | 152 | <td> | ||
219 | 153 | <para style="InformationHeader">Qty</para> | ||
220 | 154 | </td> | ||
221 | 155 | <td> | ||
222 | 156 | <para style="InformationHeader">Unit Price</para> | ||
223 | 157 | </td> | ||
224 | 158 | <td> | ||
225 | 159 | <para style="InformationHeader">%</para> | ||
226 | 160 | </td> | ||
227 | 161 | <td> | ||
228 | 162 | <para style="InformationHeader">Subtotal</para> | ||
229 | 163 | </td> | ||
230 | 164 | <td> | ||
231 | 165 | <para style="InformationHeader">Destination</para> | ||
232 | 166 | </td> | ||
233 | 167 | |||
234 | 168 | <td> | ||
235 | 169 | <para style="InformationHeader">Cost Center</para> | ||
236 | 170 | </td> | ||
237 | 171 | <td> | ||
238 | 172 | <para style="InformationHeader">Funding Pool</para> | ||
239 | 173 | </td> | ||
240 | 174 | </tr> | ||
241 | 175 | </blockTable> | ||
242 | 176 | <pto_header> | ||
243 | 177 | <blockTable colWidths="33.0,100.0,100.0,80.0,50.0,50.0,50.0,50.0,60.0,60.0,60.0" style="ProductList"> | ||
244 | 178 | <tr> | ||
245 | 179 | <td> | ||
246 | 180 | <para style="InformationHeader">Line</para> | ||
247 | 181 | </td> | ||
248 | 182 | <td> | ||
249 | 183 | <para style="InformationHeader">Product</para> | ||
250 | 184 | </td> | ||
251 | 185 | <td> | ||
252 | 186 | <para style="InformationHeader">Description</para> | ||
253 | 187 | </td> | ||
254 | 188 | <td> | ||
255 | 189 | <para style="InformationHeader">Account</para> | ||
256 | 190 | </td> | ||
257 | 191 | <td> | ||
258 | 192 | <para style="InformationHeader">Qty</para> | ||
259 | 193 | </td> | ||
260 | 194 | <td> | ||
261 | 195 | <para style="InformationHeader">Unit Price</para> | ||
262 | 196 | </td> | ||
263 | 197 | <td> | ||
264 | 198 | <para style="InformationHeader">%</para> | ||
265 | 199 | </td> | ||
266 | 200 | <td> | ||
267 | 201 | <para style="InformationHeader">Subtotal</para> | ||
268 | 202 | </td> | ||
269 | 203 | |||
270 | 204 | <td> | ||
271 | 205 | <para style="InformationHeader">Destination</para> | ||
272 | 206 | </td> | ||
273 | 207 | |||
274 | 208 | <td> | ||
275 | 209 | <para style="InformationHeader">Cost Center</para> | ||
276 | 210 | </td> | ||
277 | 211 | <td> | ||
278 | 212 | <para style="InformationHeader">Funding Pool</para> | ||
279 | 213 | </td> | ||
280 | 214 | </tr> | ||
281 | 215 | </blockTable> | ||
282 | 216 | </pto_header> | ||
283 | 217 | |||
284 | 218 | <section> | ||
285 | 219 | [[ repeatIn(get_data(o.id), 'line') ]] | ||
286 | 220 | <blockTable colWidths="33.0,100.0,100.0,80.0,50.0,50.0,50.0,50.0,60.0,60.0,60.0" style="ProductList"> | ||
287 | 221 | <tr> | ||
288 | 222 | <td> | ||
289 | 223 | <para style="Information">[[ line[0] ]]</para> | ||
290 | 224 | </td> | ||
291 | 225 | <td> | ||
292 | 226 | <para style="Information">[[ line[1] ]]</para> | ||
293 | 227 | </td> | ||
294 | 228 | <td> | ||
295 | 229 | <para style="Information">[[ line[2] ]]</para> | ||
296 | 230 | </td> | ||
297 | 231 | <td> | ||
298 | 232 | <para style="Information">[[ line[3] ]]</para> | ||
299 | 233 | </td> | ||
300 | 234 | <td> | ||
301 | 235 | <para style="Information">[[ formatLang(line[4]) ]]</para> | ||
302 | 236 | </td> | ||
303 | 237 | <td> | ||
304 | 238 | <para style="Information">[[ formatLang(line[5]) ]]</para> | ||
305 | 239 | </td> | ||
306 | 240 | <td> | ||
307 | 241 | <para style="Information">[[ formatLang(line[6]) ]]</para> | ||
308 | 242 | </td> | ||
309 | 243 | <td> | ||
310 | 244 | <para style="Information">[[ formatLang(line[7]) ]]</para> | ||
311 | 245 | </td> | ||
312 | 246 | <td> | ||
313 | 247 | <para style="Information">[[ line[9] ]]</para> | ||
314 | 248 | </td> | ||
315 | 249 | <td> | ||
316 | 250 | <para style="Information">[[ line[10] ]]</para> | ||
317 | 251 | </td> | ||
318 | 252 | <td> | ||
319 | 253 | <para style="Information">[[ line[11] ]]</para> | ||
320 | 254 | </td> | ||
321 | 255 | </tr> | ||
322 | 256 | </blockTable> | ||
323 | 257 | </section> | ||
324 | 258 | |||
325 | 259 | <para style="Standard"> | ||
326 | 260 | <font color="white"> </font> | ||
327 | 261 | </para> | ||
328 | 262 | </pto> | ||
329 | 263 | </story> | ||
330 | 264 | </document> | ||
331 | 0 | 265 | ||
332 | === added file 'account_override/report/allocation_synthesis_invoices_xls.mako' | |||
333 | --- account_override/report/allocation_synthesis_invoices_xls.mako 1970-01-01 00:00:00 +0000 | |||
334 | +++ account_override/report/allocation_synthesis_invoices_xls.mako 2015-05-29 09:19:39 +0000 | |||
335 | @@ -0,0 +1,166 @@ | |||
336 | 1 | <?xml version="1.0"?> | ||
337 | 2 | <?mso-application progid="Excel.Sheet"?> | ||
338 | 3 | <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" | ||
339 | 4 | xmlns:o="urn:schemas-microsoft-com:office:office" | ||
340 | 5 | xmlns:x="urn:schemas-microsoft-com:office:excel" | ||
341 | 6 | xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" | ||
342 | 7 | xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" | ||
343 | 8 | xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" | ||
344 | 9 | xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" | ||
345 | 10 | xmlns:html="http://www.w3.org/TR/REC-html40"> | ||
346 | 11 | <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> | ||
347 | 12 | <Author>Tempo Consulting</Author> | ||
348 | 13 | <LastAuthor>Tempo Consulting</LastAuthor> | ||
349 | 14 | <Created>2015-05-19T15:32:58Z</Created> | ||
350 | 15 | <Version>14.00</Version> | ||
351 | 16 | </DocumentProperties> | ||
352 | 17 | <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"> | ||
353 | 18 | <AllowPNG/> | ||
354 | 19 | </OfficeDocumentSettings> | ||
355 | 20 | <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> | ||
356 | 21 | <WindowHeight>7995</WindowHeight> | ||
357 | 22 | <WindowWidth>20115</WindowWidth> | ||
358 | 23 | <WindowTopX>240</WindowTopX> | ||
359 | 24 | <WindowTopY>75</WindowTopY> | ||
360 | 25 | <ProtectStructure>False</ProtectStructure> | ||
361 | 26 | <ProtectWindows>False</ProtectWindows> | ||
362 | 27 | </ExcelWorkbook> | ||
363 | 28 | <Styles> | ||
364 | 29 | <Style ss:ID="Default" ss:Name="Normal"> | ||
365 | 30 | <Alignment ss:Vertical="Bottom"/> | ||
366 | 31 | <Borders/> | ||
367 | 32 | <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/> | ||
368 | 33 | <Interior/> | ||
369 | 34 | <NumberFormat/> | ||
370 | 35 | <Protection/> | ||
371 | 36 | </Style> | ||
372 | 37 | <Style ss:ID="s63"> | ||
373 | 38 | <NumberFormat ss:Format="Standard"/> | ||
374 | 39 | </Style> | ||
375 | 40 | <Style ss:ID="s66"> | ||
376 | 41 | <Alignment ss:Horizontal="Left" ss:Vertical="Bottom" ss:Indent="1"/> | ||
377 | 42 | </Style> | ||
378 | 43 | <Style ss:ID="s67"> | ||
379 | 44 | <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" | ||
380 | 45 | ss:Bold="1"/> | ||
381 | 46 | <NumberFormat ss:Format="Standard"/> | ||
382 | 47 | </Style> | ||
383 | 48 | <Style ss:ID="s69"> | ||
384 | 49 | <Alignment ss:Horizontal="Left" ss:Vertical="Bottom" ss:Indent="1"/> | ||
385 | 50 | <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" | ||
386 | 51 | ss:Bold="1"/> | ||
387 | 52 | </Style> | ||
388 | 53 | <Style ss:ID="s74"> | ||
389 | 54 | <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" | ||
390 | 55 | ss:Bold="1"/> | ||
391 | 56 | <Interior ss:Color="#DCE6F1" ss:Pattern="Solid"/> | ||
392 | 57 | </Style> | ||
393 | 58 | <Style ss:ID="s75"> | ||
394 | 59 | <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> | ||
395 | 60 | <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" | ||
396 | 61 | ss:Bold="1"/> | ||
397 | 62 | <Interior ss:Color="#DCE6F1" ss:Pattern="Solid"/> | ||
398 | 63 | </Style> | ||
399 | 64 | <Style ss:ID="s76"> | ||
400 | 65 | <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" | ||
401 | 66 | ss:Bold="1"/> | ||
402 | 67 | <Interior ss:Color="#DCE6F1" ss:Pattern="Solid"/> | ||
403 | 68 | <NumberFormat ss:Format="Standard"/> | ||
404 | 69 | </Style> | ||
405 | 70 | <Style ss:ID="s98"> | ||
406 | 71 | <Borders/> | ||
407 | 72 | </Style> | ||
408 | 73 | <Style ss:ID="s99"> | ||
409 | 74 | <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/> | ||
410 | 75 | <Borders> | ||
411 | 76 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2" | ||
412 | 77 | ss:Color="#8DB4E2"/> | ||
413 | 78 | </Borders> | ||
414 | 79 | <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" | ||
415 | 80 | ss:Bold="1"/> | ||
416 | 81 | </Style> | ||
417 | 82 | <Style ss:ID="s100"> | ||
418 | 83 | <Borders> | ||
419 | 84 | <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="2" | ||
420 | 85 | ss:Color="#8DB4E2"/> | ||
421 | 86 | </Borders> | ||
422 | 87 | <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000" | ||
423 | 88 | ss:Bold="1"/> | ||
424 | 89 | <NumberFormat ss:Format="Standard"/> | ||
425 | 90 | </Style> | ||
426 | 91 | </Styles> | ||
427 | 92 | % for o in objects: | ||
428 | 93 | <Worksheet ss:Name="${(o.number or title(o)+' '+str(o.id))|x}"> | ||
429 | 94 | <Table x:FullColumns="1" | ||
430 | 95 | x:FullRows="1" ss:DefaultColumnWidth="90" ss:DefaultRowHeight="15"> | ||
431 | 96 | <Column ss:AutoFitWidth="0" ss:Width="110.25"/> | ||
432 | 97 | <Column ss:AutoFitWidth="0" ss:Width="95.25"/> | ||
433 | 98 | <Column ss:AutoFitWidth="0" ss:Width="69.75"/> | ||
434 | 99 | <Column ss:Width="121.5"/> | ||
435 | 100 | <Column ss:Width="96"/> | ||
436 | 101 | <Row ss:AutoFitHeight="0"> | ||
437 | 102 | <Cell><Data ss:Type="String">Invoice :</Data></Cell> | ||
438 | 103 | <Cell><Data ss:Type="String">${(o.number or ' ')|x}</Data></Cell> | ||
439 | 104 | </Row> | ||
440 | 105 | <Row ss:AutoFitHeight="0"> | ||
441 | 106 | <Cell><Data ss:Type="String">Type :</Data></Cell> | ||
442 | 107 | <Cell><Data ss:Type="String">${(title(o))|x}</Data></Cell> | ||
443 | 108 | </Row> | ||
444 | 109 | <Row ss:AutoFitHeight="0"> | ||
445 | 110 | <Cell><Data ss:Type="String">Supplier :</Data></Cell> | ||
446 | 111 | <Cell><Data ss:Type="String">${(o.partner_id.name)|x}</Data></Cell> | ||
447 | 112 | </Row> | ||
448 | 113 | <Row ss:AutoFitHeight="0"> | ||
449 | 114 | <Cell><Data ss:Type="String">Posting date :</Data></Cell> | ||
450 | 115 | <Cell><Data ss:Type="String">${(o.date_invoice or ' ')|x}</Data></Cell> | ||
451 | 116 | </Row> | ||
452 | 117 | <Row ss:AutoFitHeight="0"> | ||
453 | 118 | <Cell><Data ss:Type="String">Currency :</Data></Cell> | ||
454 | 119 | <Cell><Data ss:Type="String">${(o.currency_id.name)|x}</Data></Cell> | ||
455 | 120 | </Row> | ||
456 | 121 | <Row ss:AutoFitHeight="0"/> | ||
457 | 122 | <Row ss:AutoFitHeight="0"> | ||
458 | 123 | <Cell ss:StyleID="s74"><Data ss:Type="String">Row labels</Data></Cell> | ||
459 | 124 | <Cell ss:StyleID="s74"><Data ss:Type="String">Sum of Amount</Data></Cell> | ||
460 | 125 | </Row> | ||
461 | 126 | % for row in get_data(o.id): | ||
462 | 127 | % if level(row) == 1: | ||
463 | 128 | <Row ss:AutoFitHeight="0"> | ||
464 | 129 | <Cell ss:StyleID="s99"><Data ss:Type="String">${(row[0])|x}</Data></Cell> | ||
465 | 130 | <Cell ss:StyleID="s100"><Data ss:Type="Number">${(row[2])|x}</Data></Cell> | ||
466 | 131 | </Row> | ||
467 | 132 | % endif | ||
468 | 133 | % if level(row) == 2: | ||
469 | 134 | <Row ss:AutoFitHeight="0"> | ||
470 | 135 | <Cell ss:StyleID="s66"><Data ss:Type="String">${(row[1])|x}</Data></Cell> | ||
471 | 136 | <Cell ss:StyleID="s63"><Data ss:Type="Number">${(row[2])|x}</Data></Cell> | ||
472 | 137 | </Row> | ||
473 | 138 | % endif | ||
474 | 139 | % if level(row) == -1: | ||
475 | 140 | <Row ss:AutoFitHeight="0"> | ||
476 | 141 | <Cell ss:StyleID="s75"><Data ss:Type="String">Grand Total</Data></Cell> | ||
477 | 142 | <Cell ss:StyleID="s76"><Data ss:Type="Number">${(row[2])|x}</Data></Cell> | ||
478 | 143 | </Row> | ||
479 | 144 | % endif | ||
480 | 145 | % endfor | ||
481 | 146 | </Table> | ||
482 | 147 | <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"> | ||
483 | 148 | <PageSetup> | ||
484 | 149 | <Header x:Margin="0.3"/> | ||
485 | 150 | <Footer x:Margin="0.3"/> | ||
486 | 151 | <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/> | ||
487 | 152 | </PageSetup> | ||
488 | 153 | <Unsynced/> | ||
489 | 154 | <Print> | ||
490 | 155 | <ValidPrinterInfo/> | ||
491 | 156 | <PaperSizeIndex>9</PaperSizeIndex> | ||
492 | 157 | <HorizontalResolution>600</HorizontalResolution> | ||
493 | 158 | <VerticalResolution>600</VerticalResolution> | ||
494 | 159 | </Print> | ||
495 | 160 | <Selected/> | ||
496 | 161 | <ProtectObjects>False</ProtectObjects> | ||
497 | 162 | <ProtectScenarios>False</ProtectScenarios> | ||
498 | 163 | </WorksheetOptions> | ||
499 | 164 | </Worksheet> | ||
500 | 165 | % endfor | ||
501 | 166 | </Workbook> | ||
502 | 0 | 167 | ||
503 | === added file 'account_override/report/report_allocation_invoices.py' | |||
504 | --- account_override/report/report_allocation_invoices.py 1970-01-01 00:00:00 +0000 | |||
505 | +++ account_override/report/report_allocation_invoices.py 2015-05-29 09:19:39 +0000 | |||
506 | @@ -0,0 +1,81 @@ | |||
507 | 1 | # -*- coding: utf-8 -*- | ||
508 | 2 | ############################################################################## | ||
509 | 3 | # | ||
510 | 4 | # OpenERP, Open Source Management Solution | ||
511 | 5 | # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). | ||
512 | 6 | # | ||
513 | 7 | # This program is free software: you can redistribute it and/or modify | ||
514 | 8 | # it under the terms of the GNU Affero General Public License as | ||
515 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
516 | 10 | # License, or (at your option) any later version. | ||
517 | 11 | # | ||
518 | 12 | # This program is distributed in the hope that it will be useful, | ||
519 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
520 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
521 | 15 | # GNU Affero General Public License for more details. | ||
522 | 16 | # | ||
523 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
524 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
525 | 19 | # | ||
526 | 20 | ############################################################################## | ||
527 | 21 | |||
528 | 22 | import time | ||
529 | 23 | |||
530 | 24 | from report import report_sxw | ||
531 | 25 | |||
532 | 26 | |||
533 | 27 | class allocation_invoice_report(report_sxw.rml_parse): | ||
534 | 28 | def __init__(self, cr, uid, name, context=None): | ||
535 | 29 | super(allocation_invoice_report, self).__init__(cr, uid, name, context=context) | ||
536 | 30 | |||
537 | 31 | self._cr = cr | ||
538 | 32 | |||
539 | 33 | self.localcontext.update({ | ||
540 | 34 | 'time': time, | ||
541 | 35 | 'get_data': self.get_data, | ||
542 | 36 | }) | ||
543 | 37 | |||
544 | 38 | def get_data(self, invoice_id): | ||
545 | 39 | self._cr.execute("""SELECT line_number,NULLIF('[' || default_code || '] ' || name_template, '[] ') as product,i.name as description, ac.code || ' ' || ac.name as account, quantity, ROUND(price_unit, 2) as price_unit, ROUND(percentage, 2) as percentage, ROUND(price_subtotal*percentage/100, 2) as sub_total, y.name as currency, n1.code as destination, n2.code as cost_center, n3.code as funding_pool | ||
546 | 40 | FROM funding_pool_distribution_line a | ||
547 | 41 | INNER JOIN account_invoice_line i ON a.distribution_id = i.analytic_distribution_id | ||
548 | 42 | INNER JOIN account_invoice s ON s.id = i.invoice_id | ||
549 | 43 | INNER JOIN account_analytic_account n1 ON n1.id = a.destination_id | ||
550 | 44 | INNER JOIN account_analytic_account n2 ON n2.id = a.cost_center_id | ||
551 | 45 | INNER JOIN account_analytic_account n3 ON n3.id = a.analytic_id | ||
552 | 46 | INNER JOIN account_account ac ON ac.id = i.account_id | ||
553 | 47 | LEFT JOIN product_product p ON p.id = i.product_id | ||
554 | 48 | LEFT JOIN res_currency y ON y.id = s.currency_id | ||
555 | 49 | WHERE i.invoice_id=%s | ||
556 | 50 | UNION ALL | ||
557 | 51 | SELECT line_number,NULLIF('[' || default_code || '] ' || name_template, '[] ') as product,i.name as description, ac.code || ' ' || ac.name as account, quantity, ROUND(price_unit, 2) as price_unit, ROUND(percentage, 2) as percentage, ROUND(price_subtotal*percentage/100, 2) as sub_total, y.name as currency, n1.code as destination, n2.code as cost_center, n3.code as funding_pool | ||
558 | 52 | FROM funding_pool_distribution_line a | ||
559 | 53 | INNER JOIN account_invoice s ON s.analytic_distribution_id = a.distribution_id | ||
560 | 54 | LEFT JOIN account_invoice_line i ON i.invoice_id = s.id AND i.analytic_distribution_id IS NULL | ||
561 | 55 | INNER JOIN account_account ac ON ac.id = i.account_id | ||
562 | 56 | INNER JOIN account_analytic_account n1 ON n1.id = a.destination_id | ||
563 | 57 | INNER JOIN account_analytic_account n2 ON n2.id = a.cost_center_id | ||
564 | 58 | INNER JOIN account_analytic_account n3 ON n3.id = a.analytic_id | ||
565 | 59 | INNER JOIN res_currency y ON y.id = s.currency_id | ||
566 | 60 | LEFT JOIN product_product p ON p.id = i.product_id | ||
567 | 61 | WHERE s.id=%s | ||
568 | 62 | UNION ALL | ||
569 | 63 | SELECT line_number,NULLIF('[' || default_code || '] ' || name_template, '[] ') as product,i.name as description, ac.code || ac.name as account, quantity, ROUND(price_unit, 2) as price_unit, NULL, ROUND(price_subtotal, 2) as sub_total, y.name as currency, NULL, NULL, NULL | ||
570 | 64 | FROM account_invoice_line i | ||
571 | 65 | INNER JOIN account_invoice s ON s.id = i.invoice_id | ||
572 | 66 | INNER JOIN account_account ac ON ac.id = i.account_id | ||
573 | 67 | INNER JOIN res_currency y ON y.id = s.currency_id | ||
574 | 68 | LEFT JOIN product_product p ON p.id = i.product_id | ||
575 | 69 | WHERE s.id=%s and is_analytic_addicted = False | ||
576 | 70 | ORDER BY line_number, destination, cost_center, funding_pool | ||
577 | 71 | """, (invoice_id, invoice_id, invoice_id)) | ||
578 | 72 | |||
579 | 73 | return self._cr.fetchall() | ||
580 | 74 | |||
581 | 75 | |||
582 | 76 | report_sxw.report_sxw('report.allocation.invoices.report', | ||
583 | 77 | 'account.invoice', | ||
584 | 78 | 'addons/account_override/report/allocation_invoices_report.rml', | ||
585 | 79 | parser=allocation_invoice_report, header="landscape") | ||
586 | 80 | |||
587 | 81 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
588 | 0 | 82 | ||
589 | === added file 'account_override/report/report_allocation_synthesis_invoices.py' | |||
590 | --- account_override/report/report_allocation_synthesis_invoices.py 1970-01-01 00:00:00 +0000 | |||
591 | +++ account_override/report/report_allocation_synthesis_invoices.py 2015-05-29 09:19:39 +0000 | |||
592 | @@ -0,0 +1,87 @@ | |||
593 | 1 | # -*- coding: utf-8 -*- | ||
594 | 2 | ############################################################################## | ||
595 | 3 | # | ||
596 | 4 | # Copyright (C) 2015 MSF, TeMPO Consulting | ||
597 | 5 | # | ||
598 | 6 | # This program is free software: you can redistribute it and/or modify | ||
599 | 7 | # it under the terms of the GNU Affero General Public License as | ||
600 | 8 | # published by the Free Software Foundation, either version 3 of the | ||
601 | 9 | # License, or (at your option) any later version. | ||
602 | 10 | # | ||
603 | 11 | # This program is distributed in the hope that it will be useful, | ||
604 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
605 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
606 | 14 | # GNU Affero General Public License for more details. | ||
607 | 15 | # | ||
608 | 16 | # You should have received a copy of the GNU Affero General Public License | ||
609 | 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
610 | 18 | # | ||
611 | 19 | ############################################################################## | ||
612 | 20 | |||
613 | 21 | from spreadsheet_xml.spreadsheet_xml_write import SpreadsheetReport | ||
614 | 22 | from report import report_sxw | ||
615 | 23 | |||
616 | 24 | |||
617 | 25 | class report_allocation_synthesis_invoices(report_sxw.rml_parse): | ||
618 | 26 | def __init__(self, cr, uid, name, context=None): | ||
619 | 27 | super(report_allocation_synthesis_invoices, self).__init__(cr, uid, name, context=context) | ||
620 | 28 | |||
621 | 29 | self._cr = cr | ||
622 | 30 | |||
623 | 31 | self.localcontext.update({ | ||
624 | 32 | 'title': self.get_title, | ||
625 | 33 | 'get_data': self.get_data, | ||
626 | 34 | 'level': self.get_level, | ||
627 | 35 | }) | ||
628 | 36 | |||
629 | 37 | def get_data(self, invoice_id): | ||
630 | 38 | self._cr.execute(""" WITH t as ( | ||
631 | 39 | SELECT ac.code as L1, n2.code as L2, | ||
632 | 40 | ROUND(SUM(price_subtotal*percentage/100), 2) as amount | ||
633 | 41 | FROM funding_pool_distribution_line a | ||
634 | 42 | INNER JOIN account_invoice_line i ON a.distribution_id = i.analytic_distribution_id | ||
635 | 43 | INNER JOIN account_analytic_account n2 ON n2.id = a.cost_center_id | ||
636 | 44 | INNER JOIN account_account ac ON ac.id = i.account_id | ||
637 | 45 | WHERE i.invoice_id=%s | ||
638 | 46 | GROUP BY ac.code, n2.code | ||
639 | 47 | UNION ALL | ||
640 | 48 | SELECT ac.code, n2.code, ROUND(SUM(price_subtotal*percentage/100), 2) | ||
641 | 49 | FROM funding_pool_distribution_line a | ||
642 | 50 | INNER JOIN account_invoice s ON s.analytic_distribution_id = a.distribution_id | ||
643 | 51 | LEFT JOIN account_invoice_line i ON i.invoice_id = s.id AND i.analytic_distribution_id IS NULL | ||
644 | 52 | INNER JOIN account_account ac ON ac.id = i.account_id | ||
645 | 53 | INNER JOIN account_analytic_account n2 ON n2.id = a.cost_center_id | ||
646 | 54 | WHERE s.id=%s | ||
647 | 55 | GROUP BY ac.code, n2.code) | ||
648 | 56 | SELECT L1, L2, SUM(amount) as amount FROM t | ||
649 | 57 | GROUP BY L1, L2 | ||
650 | 58 | UNION ALL | ||
651 | 59 | SELECT L1, '', SUM(amount) FROM t | ||
652 | 60 | GROUP BY L1 | ||
653 | 61 | UNION ALL | ||
654 | 62 | SELECT NULL, '', SUM(amount) FROM t | ||
655 | 63 | ORDER BY L1, L2""", (invoice_id, invoice_id)) | ||
656 | 64 | |||
657 | 65 | return self._cr.fetchall() | ||
658 | 66 | |||
659 | 67 | def get_level(self, row): | ||
660 | 68 | if row[0] is None: | ||
661 | 69 | return -1 | ||
662 | 70 | elif row[1] == '': | ||
663 | 71 | return 1 | ||
664 | 72 | else: | ||
665 | 73 | return 2 | ||
666 | 74 | |||
667 | 75 | def get_title(self, invoice): | ||
668 | 76 | |||
669 | 77 | invoice_types = { | ||
670 | 78 | 'out_invoice': 'Customer Invoice', | ||
671 | 79 | 'in_invoice': 'Supplier Invoice', | ||
672 | 80 | 'out_refund': 'Customer Refund', | ||
673 | 81 | 'in_refund': 'Supplier Refund' | ||
674 | 82 | } | ||
675 | 83 | |||
676 | 84 | return invoice_types[invoice.type] | ||
677 | 85 | |||
678 | 86 | |||
679 | 87 | SpreadsheetReport('report.allocation.synthesis.invoices', 'account.invoice', 'addons/account_override/report/allocation_synthesis_invoices_xls.mako', parser=report_allocation_synthesis_invoices) |