Merge lp:~serpentcs/account-financial-report/account-serpentcs into lp:~account-report-core-editor/account-financial-report/7.0
- account-serpentcs
- Merge into 7.0
Proposed by
Nishant Jogi (Serpent Consulting Services)
Status: | Work in progress |
---|---|
Proposed branch: | lp:~serpentcs/account-financial-report/account-serpentcs |
Merge into: | lp:~account-report-core-editor/account-financial-report/7.0 |
Diff against target: |
10347 lines (+9879/-0) 86 files modified
account_analytic_plans_webkit/__init__.py (+26/-0) account_analytic_plans_webkit/__openerp__.py (+42/-0) account_analytic_plans_webkit/account_analytic_plans_report.xml (+147/-0) account_analytic_plans_webkit/report/__init__.py (+25/-0) account_analytic_plans_webkit/report/crossovered_analytic.mako (+114/-0) account_analytic_plans_webkit/report/crossovered_analytic.py (+182/-0) account_analytic_plans_webkit/wizard/__init__.py (+26/-0) account_analytic_plans_webkit/wizard/account_crossovered_analytic.py (+70/-0) account_bank_statement_extensions_webkit/__init__.py (+24/-0) account_bank_statement_extensions_webkit/__openerp__.py (+41/-0) account_bank_statement_extensions_webkit/account_bank_statement_report.xml (+113/-0) account_bank_statement_extensions_webkit/report/__init__.py (+25/-0) account_bank_statement_extensions_webkit/report/bank_statement_balance_report.mako (+56/-0) account_bank_statement_extensions_webkit/report/bank_statement_balance_report.py (+70/-0) account_budget_webkit/__init__.py (+26/-0) account_budget_webkit/__openerp__.py (+42/-0) account_budget_webkit/account_budget_report.xml (+234/-0) account_budget_webkit/report/__init__.py (+27/-0) account_budget_webkit/report/analytic_account_budget_report.mako (+119/-0) account_budget_webkit/report/analytic_account_budget_report.py (+173/-0) account_budget_webkit/report/budget_report.mako (+131/-0) account_budget_webkit/report/budget_report.py (+192/-0) account_budget_webkit/report/crossovered_budget_report.mako (+128/-0) account_budget_webkit/report/crossovered_budget_report.py (+197/-0) account_budget_webkit/wizard/__init__.py (+27/-0) account_budget_webkit/wizard/account_budget_analytic.py (+37/-0) account_budget_webkit/wizard/account_budget_crossovered_report.py (+37/-0) account_budget_webkit/wizard/account_budget_crossovered_summary_report.py (+40/-0) account_budget_webkit/wizard/account_budget_report.py (+38/-0) account_test_webkit/__init__.py (+22/-0) account_test_webkit/__openerp__.py (+41/-0) account_test_webkit/account_test_report.xml (+26/-0) account_test_webkit/report/__init__.py (+24/-0) account_test_webkit/report/account_test.mako (+53/-0) account_test_webkit/report/account_test_report.py (+88/-0) account_voucher_webkit/__init__.py (+25/-0) account_voucher_webkit/__openerp__.py (+45/-0) account_voucher_webkit/account_voucher_report.xml (+159/-0) account_voucher_webkit/report/.~lock.account_voucher_print.sxw# (+1/-0) account_voucher_webkit/report/__init__.py (+26/-0) account_voucher_webkit/report/account_voucher.mako (+160/-0) account_voucher_webkit/report/account_voucher.py (+77/-0) account_voucher_webkit/report/account_voucher_print.mako (+140/-0) account_voucher_webkit/report/account_voucher_print.py (+98/-0) account_webkit/__init__.py (+24/-0) account_webkit/__openerp__.py (+44/-0) account_webkit/account_report.xml (+658/-0) account_webkit/report/__init__.py (+40/-0) account_webkit/report/account_aged_partner_balance.mako (+220/-0) account_webkit/report/account_aged_partner_balance.py (+383/-0) account_webkit/report/account_balance.mako (+132/-0) account_webkit/report/account_balance.py (+136/-0) account_webkit/report/account_central_journal.mako (+240/-0) account_webkit/report/account_central_journal.py (+111/-0) account_webkit/report/account_financial_report.mako (+181/-0) account_webkit/report/account_financial_report.py (+113/-0) account_webkit/report/account_general_journal.mako (+348/-0) account_webkit/report/account_general_journal.py (+164/-0) account_webkit/report/account_general_ledger.mako (+150/-0) account_webkit/report/account_general_ledger.py (+304/-0) account_webkit/report/account_general_ledger_landscape.mako (+178/-0) account_webkit/report/account_journal.mako (+292/-0) account_webkit/report/account_journal.py (+204/-0) account_webkit/report/account_journal_sale_purchase.mako (+306/-0) account_webkit/report/account_partner_balance.mako (+119/-0) account_webkit/report/account_partner_balance.py (+309/-0) account_webkit/report/account_partner_ledger.mako (+172/-0) account_webkit/report/account_partner_ledger.py (+311/-0) account_webkit/report/account_partner_ledger_other.mako (+175/-0) account_webkit/report/account_print_invoice.mako (+164/-0) account_webkit/report/account_print_invoice.py (+39/-0) account_webkit/report/account_print_overdue.mako (+126/-0) account_webkit/report/account_print_overdue.py (+72/-0) account_webkit/report/account_tax_report.mako (+111/-0) account_webkit/report/account_tax_report.py (+240/-0) account_webkit/wizard/__init__.py (+33/-0) account_webkit/wizard/account_financial_report.py (+34/-0) account_webkit/wizard/account_report_account_balance.py (+33/-0) account_webkit/wizard/account_report_aged_partner_balance.py (+39/-0) account_webkit/wizard/account_report_central_journal.py (+40/-0) account_webkit/wizard/account_report_general_journal.py (+34/-0) account_webkit/wizard/account_report_general_ledger.py (+35/-0) account_webkit/wizard/account_report_partner_balance.py (+38/-0) account_webkit/wizard/account_report_partner_ledger.py (+52/-0) account_webkit/wizard/account_report_print_journal.py (+44/-0) account_webkit/wizard/account_vat.py (+37/-0) |
To merge this branch: | bzr merge lp:~serpentcs/account-financial-report/account-serpentcs |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Pedro Manuel Baeza | Needs Resubmitting | ||
Omar (Pexego) | code review | Needs Fixing | |
Review via email: mp+190320@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Omar (Pexego) (omar7r) wrote : | # |
review:
Needs Fixing
(code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote : | # |
This project is now hosted on https:/
review:
Needs Resubmitting
Unmerged revisions
- 54. By Nishant Jogi (Serpent Consulting Services)
-
[ADD] Added Accounting report modules with conversion from rml to webkit.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'account_analytic_plans_webkit' | |||
2 | === added file 'account_analytic_plans_webkit/__init__.py' | |||
3 | --- account_analytic_plans_webkit/__init__.py 1970-01-01 00:00:00 +0000 | |||
4 | +++ account_analytic_plans_webkit/__init__.py 2013-10-10 09:47:29 +0000 | |||
5 | @@ -0,0 +1,26 @@ | |||
6 | 1 | # -*- coding: utf-8 -*- | ||
7 | 2 | ############################################################################## | ||
8 | 3 | # | ||
9 | 4 | # OpenERP, Open Source Management Solution | ||
10 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
11 | 6 | # | ||
12 | 7 | # This program is free software: you can redistribute it and/or modify | ||
13 | 8 | # it under the terms of the GNU Affero General Public License as | ||
14 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
15 | 10 | # License, or (at your option) any later version. | ||
16 | 11 | # | ||
17 | 12 | # This program is distributed in the hope that it will be useful, | ||
18 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | 15 | # GNU Affero General Public License for more details. | ||
21 | 16 | # | ||
22 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
23 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
24 | 19 | # | ||
25 | 20 | ############################################################################ | ||
26 | 21 | |||
27 | 22 | import wizard | ||
28 | 23 | import report | ||
29 | 24 | |||
30 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
31 | 26 | |||
32 | 0 | 27 | ||
33 | === added file 'account_analytic_plans_webkit/__openerp__.py' | |||
34 | --- account_analytic_plans_webkit/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
35 | +++ account_analytic_plans_webkit/__openerp__.py 2013-10-10 09:47:29 +0000 | |||
36 | @@ -0,0 +1,42 @@ | |||
37 | 1 | # -*- coding: utf-8 -*- | ||
38 | 2 | ############################################################################## | ||
39 | 3 | # | ||
40 | 4 | # OpenERP, Open Source Management Solution | ||
41 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
42 | 6 | # | ||
43 | 7 | # This program is free software: you can redistribute it and/or modify | ||
44 | 8 | # it under the terms of the GNU Affero General Public License as | ||
45 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
46 | 10 | # License, or (at your option) any later version. | ||
47 | 11 | # | ||
48 | 12 | # This program is distributed in the hope that it will be useful, | ||
49 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
50 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
51 | 15 | # GNU Affero General Public License for more details. | ||
52 | 16 | # | ||
53 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
54 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
55 | 19 | # | ||
56 | 20 | ############################################################################ | ||
57 | 21 | |||
58 | 22 | { | ||
59 | 23 | 'name': 'Multiple Analytic Plans Webkit', | ||
60 | 24 | 'version': '1.0', | ||
61 | 25 | 'category': 'Accounting & Finance', | ||
62 | 26 | 'description': """ | ||
63 | 27 | This module allows to use several analytic plans according to the general journal. | ||
64 | 28 | ================================================================================== | ||
65 | 29 | It is conversion of rml report to Webkit Report. | ||
66 | 30 | |||
67 | 31 | """, | ||
68 | 32 | 'author': 'Serpent Consulting Services', | ||
69 | 33 | 'website': 'http://www.serpentcs.com', | ||
70 | 34 | 'depends': ['report_webkit', 'account_analytic_plans'], | ||
71 | 35 | 'data': [ | ||
72 | 36 | 'account_analytic_plans_report.xml', | ||
73 | 37 | ], | ||
74 | 38 | 'installable': True, | ||
75 | 39 | 'auto_install': False, | ||
76 | 40 | } | ||
77 | 41 | |||
78 | 42 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
79 | 0 | 43 | ||
80 | === added file 'account_analytic_plans_webkit/account_analytic_plans_report.xml' | |||
81 | --- account_analytic_plans_webkit/account_analytic_plans_report.xml 1970-01-01 00:00:00 +0000 | |||
82 | +++ account_analytic_plans_webkit/account_analytic_plans_report.xml 2013-10-10 09:47:29 +0000 | |||
83 | @@ -0,0 +1,147 @@ | |||
84 | 1 | <?xml version="1.0"?> | ||
85 | 2 | <openerp> | ||
86 | 3 | <data> | ||
87 | 4 | <record id="account_webkit_header" model="ir.header_webkit"> | ||
88 | 5 | <field name="footer_html"><![CDATA[]]></field> | ||
89 | 6 | <field name="orientation">Portrait</field> | ||
90 | 7 | <field name="format">A4</field> | ||
91 | 8 | <field name="html"><![CDATA[ | ||
92 | 9 | <html> | ||
93 | 10 | <head> | ||
94 | 11 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
95 | 12 | <script> | ||
96 | 13 | function subst() { | ||
97 | 14 | var vars={}; | ||
98 | 15 | var x=document.location.search.substring(1).split('&'); | ||
99 | 16 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
100 | 17 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
101 | 18 | for(var i in x) { | ||
102 | 19 | var y = document.getElementsByClassName(x[i]); | ||
103 | 20 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
104 | 21 | } | ||
105 | 22 | } | ||
106 | 23 | </script> | ||
107 | 24 | <style type="text/css"> | ||
108 | 25 | |||
109 | 26 | ${css} | ||
110 | 27 | </style> | ||
111 | 28 | </head> | ||
112 | 29 | |||
113 | 30 | ${_debug or ''|n} </body> | ||
114 | 31 | </html>]]> | ||
115 | 32 | </field> | ||
116 | 33 | <field name="orientation">Portrait</field> | ||
117 | 34 | <field name="format">A4</field> | ||
118 | 35 | <field name="html"><![CDATA[ | ||
119 | 36 | <html> | ||
120 | 37 | <head> | ||
121 | 38 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
122 | 39 | <script> | ||
123 | 40 | function subst() { | ||
124 | 41 | var vars={}; | ||
125 | 42 | var x=document.location.search.substring(1).split('&'); | ||
126 | 43 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
127 | 44 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
128 | 45 | for(var i in x) { | ||
129 | 46 | var y = document.getElementsByClassName(x[i]); | ||
130 | 47 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
131 | 48 | } | ||
132 | 49 | } | ||
133 | 50 | </script> | ||
134 | 51 | <style type="text/css"> | ||
135 | 52 | ${css} | ||
136 | 53 | </style> | ||
137 | 54 | </head> | ||
138 | 55 | <body style="border:0;" onload="subst()"> | ||
139 | 56 | <table style="border-bottom: 1px solid black; width: 100%"> | ||
140 | 57 | <tr > | ||
141 | 58 | <td style="text-align:right;font-size:12;" width="15%">${time.strftime('%m/%d/%Y %I:%M')}</td> | ||
142 | 59 | <td style="text-align:center;font-size:16;" width="78%">${company.partner_id.name |entity}</td> | ||
143 | 60 | <td style="text-align:left;font-size:12;" width="3%"><span class="page"/> </td> | ||
144 | 61 | <td style="text-align:left;font-size:12;" width="1%"> /</td> | ||
145 | 62 | <td style="text-align:right;font-size:12;" width="3%"><span class="topage"/></td> | ||
146 | 63 | </tr> | ||
147 | 64 | </table> ${_debug or ''|n} </body> | ||
148 | 65 | |||
149 | 66 | </html>]]> | ||
150 | 67 | </field> | ||
151 | 68 | <field eval="15.0" name="margin_top"/> | ||
152 | 69 | <field eval="5.0" name="margin_bottom"/> | ||
153 | 70 | <field name="css"><![CDATA[ | ||
154 | 71 | |||
155 | 72 | .cell_extended{ | ||
156 | 73 | border-spacing: 0; | ||
157 | 74 | border-collapse: collapse; | ||
158 | 75 | border-style:solid; | ||
159 | 76 | border: 1px; | ||
160 | 77 | border-style:solid; | ||
161 | 78 | border-color:#C0C0C0; | ||
162 | 79 | font-size:10px; | ||
163 | 80 | } | ||
164 | 81 | |||
165 | 82 | tr.table_parent_data{ | ||
166 | 83 | font-family: Helvetica-Bold; | ||
167 | 84 | font-size: 10px; | ||
168 | 85 | caption-side: top; | ||
169 | 86 | font-weight: bold; | ||
170 | 87 | } | ||
171 | 88 | tr.table_child_data{ | ||
172 | 89 | font-family: Helvetica; | ||
173 | 90 | font-size: 8px; | ||
174 | 91 | caption-side: top; | ||
175 | 92 | } | ||
176 | 93 | |||
177 | 94 | .under_line1{ | ||
178 | 95 | border-bottom:2px solid black; | ||
179 | 96 | font-size:10px; | ||
180 | 97 | } | ||
181 | 98 | |||
182 | 99 | td.under_line{ | ||
183 | 100 | border-bottom:2px solid black; | ||
184 | 101 | font-size:10px; | ||
185 | 102 | } | ||
186 | 103 | .under_line_gray{ | ||
187 | 104 | border-bottom:2px; | ||
188 | 105 | border-style:solid; | ||
189 | 106 | border-color:#C0C0C0; | ||
190 | 107 | font-size:10px; | ||
191 | 108 | } | ||
192 | 109 | .list_table1 { | ||
193 | 110 | border-color:#C0C0C0; | ||
194 | 111 | text-align:center; | ||
195 | 112 | font-size:8px; | ||
196 | 113 | margin-top:2px; | ||
197 | 114 | margin-bottom:2px; | ||
198 | 115 | border-collapse: collapse; | ||
199 | 116 | } | ||
200 | 117 | .list_table1 td { | ||
201 | 118 | border-color:gray; | ||
202 | 119 | border-bottom:1px solid gray; | ||
203 | 120 | text-align:left; | ||
204 | 121 | font-size:10; | ||
205 | 122 | padding-left:3px | ||
206 | 123 | padding-right:3px | ||
207 | 124 | padding-top:3px | ||
208 | 125 | padding-bottom:3px | ||
209 | 126 | } | ||
210 | 127 | |||
211 | 128 | ]]> | ||
212 | 129 | </field> | ||
213 | 130 | <field name="name">Account webkit Header</field> | ||
214 | 131 | </record> | ||
215 | 132 | <report | ||
216 | 133 | id="account_analytic_account_crossovered_analytic" | ||
217 | 134 | string="Crossovered Analytic" | ||
218 | 135 | model="account.analytic.account" | ||
219 | 136 | name="account.analytic.account.crossovered.analytic.webkit" | ||
220 | 137 | file="account_analytic_plans_webkit/report/crossovered_analytic.mako" | ||
221 | 138 | auto="False" | ||
222 | 139 | menu="False" | ||
223 | 140 | report_type="webkit" | ||
224 | 141 | header="True" | ||
225 | 142 | webkit_header="account_webkit_header" | ||
226 | 143 | /> | ||
227 | 144 | |||
228 | 145 | </data> | ||
229 | 146 | </openerp> | ||
230 | 147 | |||
231 | 0 | 148 | ||
232 | === added directory 'account_analytic_plans_webkit/report' | |||
233 | === added file 'account_analytic_plans_webkit/report/__init__.py' | |||
234 | --- account_analytic_plans_webkit/report/__init__.py 1970-01-01 00:00:00 +0000 | |||
235 | +++ account_analytic_plans_webkit/report/__init__.py 2013-10-10 09:47:29 +0000 | |||
236 | @@ -0,0 +1,25 @@ | |||
237 | 1 | # -*- coding: utf-8 -*- | ||
238 | 2 | ############################################################################## | ||
239 | 3 | # | ||
240 | 4 | # OpenERP, Open Source Management Solution | ||
241 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
242 | 6 | # | ||
243 | 7 | # This program is free software: you can redistribute it and/or modify | ||
244 | 8 | # it under the terms of the GNU Affero General Public License as | ||
245 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
246 | 10 | # License, or (at your option) any later version. | ||
247 | 11 | # | ||
248 | 12 | # This program is distributed in the hope that it will be useful, | ||
249 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
250 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
251 | 15 | # GNU Affero General Public License for more details. | ||
252 | 16 | # | ||
253 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
254 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
255 | 19 | # | ||
256 | 20 | ############################################################################ | ||
257 | 21 | |||
258 | 22 | import crossovered_analytic | ||
259 | 23 | |||
260 | 24 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
261 | 25 | |||
262 | 0 | 26 | ||
263 | === added file 'account_analytic_plans_webkit/report/crossovered_analytic.mako' | |||
264 | --- account_analytic_plans_webkit/report/crossovered_analytic.mako 1970-01-01 00:00:00 +0000 | |||
265 | +++ account_analytic_plans_webkit/report/crossovered_analytic.mako 2013-10-10 09:47:29 +0000 | |||
266 | @@ -0,0 +1,114 @@ | |||
267 | 1 | <html> | ||
268 | 2 | <head> | ||
269 | 3 | <style type="text/css"> | ||
270 | 4 | ${css} | ||
271 | 5 | </style> | ||
272 | 6 | <title>Crossoverred Analytic.pdf</title> | ||
273 | 7 | |||
274 | 8 | </head> | ||
275 | 9 | <body> | ||
276 | 10 | <table width="100%"> | ||
277 | 11 | <tr> | ||
278 | 12 | <td style="text-align:center;"> | ||
279 | 13 | <h3><b> Crossovered Analytic</b></h3> | ||
280 | 14 | </td> | ||
281 | 15 | </tr> | ||
282 | 16 | </table> | ||
283 | 17 | <table width="100%" class="cell_extended"> | ||
284 | 18 | <tr> | ||
285 | 19 | <td style="text-align:center;" class="cell_extended"><b>${ _('From Date') }</b></td> | ||
286 | 20 | <td style="text-align:center;" class="cell_extended"><b>${ _('To Date') }</b></td> | ||
287 | 21 | <td style="text-align:center;" class="cell_extended"><b>${ _('Company') }</b></td> | ||
288 | 22 | <td style="text-align:center;" class="cell_extended"><b>${ _('Currency') }</b></td> | ||
289 | 23 | <td style="text-align:center;" class="cell_extended"><b>${ _('Printing date') }</b></td> | ||
290 | 24 | </tr> | ||
291 | 25 | <tr> | ||
292 | 26 | <td style="text-align:center;" class="cell_extended">${ data['form']['date1'] }</td> | ||
293 | 27 | <td style="text-align:center;" class="cell_extended">${ data['form']['date2'] } </td> | ||
294 | 28 | <td style="text-align:center;" class="cell_extended">${ company.name }</td> | ||
295 | 29 | <td style="text-align:center;" class="cell_extended">${ company.currency_id.name }</td> | ||
296 | 30 | <td style="text-align:center;" class="cell_extended">${ time.strftime('%Y-%m-%d')} at ${ time.strftime('%H:%M:%S') }</td> | ||
297 | 31 | </tr> | ||
298 | 32 | </table> | ||
299 | 33 | <br/> | ||
300 | 34 | |||
301 | 35 | <table width="100%" > | ||
302 | 36 | <tr> | ||
303 | 37 | <td> | ||
304 | 38 | <h4><b>Analytic Account Reference:</b></h4> | ||
305 | 39 | </td> | ||
306 | 40 | </tr> | ||
307 | 41 | </table> | ||
308 | 42 | <table width="100%" style="font-weight: bold ;font-size: 12px ;border-bottom:1px solid black;"> | ||
309 | 43 | <tr> | ||
310 | 44 | <td width="60%"> | ||
311 | 45 | ${_('Account Name') } | ||
312 | 46 | </td> | ||
313 | 47 | <td width="10%"> | ||
314 | 48 | ${_('Code') } | ||
315 | 49 | </td> | ||
316 | 50 | <td width="10%"> | ||
317 | 51 | ${_('Quantity') } | ||
318 | 52 | </td> | ||
319 | 53 | <td width="10%"> | ||
320 | 54 | ${_('Amount') } | ||
321 | 55 | </td> | ||
322 | 56 | <td width="10%"> | ||
323 | 57 | ${_('Perc(%)') } | ||
324 | 58 | </td> | ||
325 | 59 | </tr> | ||
326 | 60 | </table> | ||
327 | 61 | %for k in ref_lines(data['form']): | ||
328 | 62 | <table width="100%" class="list_table1"> | ||
329 | 63 | <tr> | ||
330 | 64 | <td width="60%">${k['ref_name']}</td> | ||
331 | 65 | <td width="10%" >${k['ref_code']}</td> | ||
332 | 66 | <td width="10%" style="text-align:right;">${k['ref_qty']}</td> | ||
333 | 67 | <td width="10%" style="text-align:right;">${k['ref_amt']}</td> | ||
334 | 68 | <td width="10%" style="text-align:right;">100.00%</td> | ||
335 | 69 | </tr> | ||
336 | 70 | </table> | ||
337 | 71 | %endfor | ||
338 | 72 | |||
339 | 73 | <br/> | ||
340 | 74 | <table width="100%" > | ||
341 | 75 | <tr> | ||
342 | 76 | <td> | ||
343 | 77 | <h4><b>Analytic Account :</b></h4> | ||
344 | 78 | </td> | ||
345 | 79 | </tr> | ||
346 | 80 | </table> | ||
347 | 81 | <table width="100%" style="font-weight: bold ;font-size: 12px ;border-bottom:1px solid black;"> | ||
348 | 82 | <tr> | ||
349 | 83 | <td width="60%"> | ||
350 | 84 | ${_('Account Name') } | ||
351 | 85 | </td> | ||
352 | 86 | <td width="10%"> | ||
353 | 87 | ${_('Code') } | ||
354 | 88 | </td> | ||
355 | 89 | <td width="10%"> | ||
356 | 90 | ${_('Quantity') } | ||
357 | 91 | </td> | ||
358 | 92 | <td width="10%" > | ||
359 | 93 | ${_('Amount') } | ||
360 | 94 | </td> | ||
361 | 95 | <td width="10%"> | ||
362 | 96 | ${_('Percentage') } | ||
363 | 97 | </td> | ||
364 | 98 | </tr> | ||
365 | 99 | </table> | ||
366 | 100 | %for account in lines(data['form']): | ||
367 | 101 | <table width="100%" class="list_table1"> | ||
368 | 102 | <tr> | ||
369 | 103 | <td width="60%" >${account['acc_name']}</td> | ||
370 | 104 | <td width="10%" >${account['code']}</td> | ||
371 | 105 | <td width="10%" style="text-align:right;">${account['qty']}</td> | ||
372 | 106 | <td width="10%" style="text-align:right;">${account['amt']}</td> | ||
373 | 107 | <td width="10%" style="text-align:right;">${account['perc']}%</td> | ||
374 | 108 | </tr> | ||
375 | 109 | </table> | ||
376 | 110 | <p style="page-break-after:always"> | ||
377 | 111 | </p> | ||
378 | 112 | %endfor | ||
379 | 113 | </body> | ||
380 | 114 | </html> | ||
381 | 0 | \ No newline at end of file | 115 | \ No newline at end of file |
382 | 1 | 116 | ||
383 | === added file 'account_analytic_plans_webkit/report/crossovered_analytic.py' | |||
384 | --- account_analytic_plans_webkit/report/crossovered_analytic.py 1970-01-01 00:00:00 +0000 | |||
385 | +++ account_analytic_plans_webkit/report/crossovered_analytic.py 2013-10-10 09:47:29 +0000 | |||
386 | @@ -0,0 +1,182 @@ | |||
387 | 1 | # -*- coding: utf-8 -*- | ||
388 | 2 | ############################################################################## | ||
389 | 3 | # | ||
390 | 4 | # OpenERP, Open Source Management Solution | ||
391 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
392 | 6 | # | ||
393 | 7 | # This program is free software: you can redistribute it and/or modify | ||
394 | 8 | # it under the terms of the GNU Affero General Public License as | ||
395 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
396 | 10 | # License, or (at your option) any later version. | ||
397 | 11 | # | ||
398 | 12 | # This program is distributed in the hope that it will be useful, | ||
399 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
400 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
401 | 15 | # GNU Affero General Public License for more details. | ||
402 | 16 | # | ||
403 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
404 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
405 | 19 | # | ||
406 | 20 | ############################################################################ | ||
407 | 21 | |||
408 | 22 | |||
409 | 23 | import time | ||
410 | 24 | |||
411 | 25 | from openerp.report import report_sxw | ||
412 | 26 | |||
413 | 27 | class crossovered_analytic(report_sxw.rml_parse): | ||
414 | 28 | def __init__(self, cr, uid, name, context): | ||
415 | 29 | super(crossovered_analytic, self).__init__(cr, uid, name, context = context) | ||
416 | 30 | self.localcontext.update( { | ||
417 | 31 | 'time': time, | ||
418 | 32 | 'lines': self._lines, | ||
419 | 33 | 'ref_lines': self._ref_lines, | ||
420 | 34 | 'find_children': self.find_children, | ||
421 | 35 | }) | ||
422 | 36 | self.base_amount = 0.00 | ||
423 | 37 | |||
424 | 38 | def find_children(self, ref_ids): | ||
425 | 39 | if not ref_ids: return [] | ||
426 | 40 | to_return_ids = [] | ||
427 | 41 | final_list = [] | ||
428 | 42 | parent_list = [] | ||
429 | 43 | set_list = [] | ||
430 | 44 | analytic_obj = self.pool.get('account.analytic.account') | ||
431 | 45 | for id in ref_ids: | ||
432 | 46 | # to avoid duplicate entries | ||
433 | 47 | if id not in to_return_ids: | ||
434 | 48 | to_return_ids.append(analytic_obj.search(self.cr,self.uid,[('parent_id','child_of',[id])])) | ||
435 | 49 | data_accnt = analytic_obj.browse(self.cr,self.uid,to_return_ids[0]) | ||
436 | 50 | for data in data_accnt: | ||
437 | 51 | if data.parent_id and data.parent_id.id == ref_ids[0]: | ||
438 | 52 | parent_list.append(data.id) | ||
439 | 53 | final_list.append(ref_ids[0]) | ||
440 | 54 | set_list = self.set_account(parent_list) | ||
441 | 55 | final_list.extend(set_list) | ||
442 | 56 | return final_list #to_return_ids[0] | ||
443 | 57 | |||
444 | 58 | def set_account(self, cats): | ||
445 | 59 | lst = [] | ||
446 | 60 | category = self.pool.get('account.analytic.account').read(self.cr, self.uid, cats) | ||
447 | 61 | for cat in category: | ||
448 | 62 | lst.append(cat['id']) | ||
449 | 63 | if cat['child_ids']: | ||
450 | 64 | lst.extend(self.set_account(cat['child_ids'])) | ||
451 | 65 | return lst | ||
452 | 66 | |||
453 | 67 | def _ref_lines(self, form): | ||
454 | 68 | result = [] | ||
455 | 69 | res = {} | ||
456 | 70 | acc_pool = self.pool.get('account.analytic.account') | ||
457 | 71 | line_pool = self.pool.get('account.analytic.line') | ||
458 | 72 | |||
459 | 73 | self.dict_acc_ref = {} | ||
460 | 74 | if form['journal_ids']: | ||
461 | 75 | journal = " in (" + ','.join(map(lambda x: str(x), form['journal_ids'])) + ")" | ||
462 | 76 | else: | ||
463 | 77 | journal = 'is not null' | ||
464 | 78 | |||
465 | 79 | query_general = "SELECT id FROM account_analytic_line WHERE (journal_id " + journal +") AND date>='"+ str(form['date1']) +"'"" AND date<='" + str(form['date2']) + "'" | ||
466 | 80 | |||
467 | 81 | self.cr.execute(query_general) | ||
468 | 82 | l_ids = self.cr.fetchall() | ||
469 | 83 | line_ids = [x[0] for x in l_ids] | ||
470 | 84 | |||
471 | 85 | obj_line = line_pool.browse(self.cr,self.uid,line_ids) | ||
472 | 86 | |||
473 | 87 | #this structure will be usefull for easily knowing the account_analytic_line that are related to the reference account. At this purpose, we save the move_id of analytic lines. | ||
474 | 88 | self.dict_acc_ref[form['ref']] = [] | ||
475 | 89 | children_list = acc_pool.search(self.cr, self.uid, [('parent_id', 'child_of', [form['ref']])]) | ||
476 | 90 | for obj in obj_line: | ||
477 | 91 | if obj.account_id.id in children_list: | ||
478 | 92 | if obj.move_id and obj.move_id.id not in self.dict_acc_ref[form['ref']]: | ||
479 | 93 | self.dict_acc_ref[form['ref']].append(obj.move_id.id) | ||
480 | 94 | |||
481 | 95 | res['ref_name'] = acc_pool.name_get(self.cr, self.uid, [form['ref']])[0][1] | ||
482 | 96 | res['ref_code'] = acc_pool.browse(self.cr, self.uid, form['ref']).code | ||
483 | 97 | |||
484 | 98 | self.final_list = children_list | ||
485 | 99 | selected_ids = line_pool.search(self.cr, self.uid, [('account_id', 'in' ,self.final_list)]) | ||
486 | 100 | |||
487 | 101 | res['ref_qty'] = 0.0 | ||
488 | 102 | res['ref_amt'] = 0.0 | ||
489 | 103 | self.base_amount = 0.0 | ||
490 | 104 | |||
491 | 105 | if selected_ids: | ||
492 | 106 | query = "SELECT SUM(aal.amount) AS amt, SUM(aal.unit_amount) AS qty FROM account_analytic_line AS aal, account_analytic_account AS aaa \ | ||
493 | 107 | WHERE aal.account_id = aaa.id AND aal.id IN ("+','.join(map(str,selected_ids))+") AND (aal.journal_id " + journal +") AND aal.date>='"+ str(form['date1']) +"'"" AND aal.date<='" + str(form['date2']) + "'" | ||
494 | 108 | |||
495 | 109 | self.cr.execute(query) | ||
496 | 110 | info=self.cr.dictfetchall() | ||
497 | 111 | res['ref_qty'] = info[0]['qty'] | ||
498 | 112 | res['ref_amt'] = info[0]['amt'] | ||
499 | 113 | self.base_amount = info[0]['amt'] | ||
500 | 114 | result.append(res) | ||
501 | 115 | return result | ||
502 | 116 | |||
503 | 117 | def _lines(self, form, ids=None): | ||
504 | 118 | print "\n\n :::::::lines",form | ||
505 | 119 | if ids is None: | ||
506 | 120 | ids = {} | ||
507 | 121 | if not ids: | ||
508 | 122 | ids = self.ids | ||
509 | 123 | |||
510 | 124 | if form['journal_ids']: | ||
511 | 125 | journal=" in (" + ','.join(map(lambda x: str(x), form['journal_ids'])) + ")" | ||
512 | 126 | else: | ||
513 | 127 | journal= 'is not null' | ||
514 | 128 | |||
515 | 129 | acc_pool = self.pool.get('account.analytic.account') | ||
516 | 130 | line_pool = self.pool.get('account.analytic.line') | ||
517 | 131 | acc_id = [] | ||
518 | 132 | final = [] | ||
519 | 133 | self.list_ids = [] | ||
520 | 134 | |||
521 | 135 | self.final_list = self.find_children(ids) | ||
522 | 136 | |||
523 | 137 | for acc_id in self.final_list: | ||
524 | 138 | selected_ids = line_pool.search(self.cr, self.uid, [('account_id','=',acc_id), ('move_id', 'in', self.dict_acc_ref[form['ref']])]) | ||
525 | 139 | if selected_ids: | ||
526 | 140 | query="SELECT aaa.code AS code, SUM(aal.amount) AS amt, SUM(aal.unit_amount) AS qty, aaa.name AS acc_name, aal.account_id AS id FROM account_analytic_line AS aal, account_analytic_account AS aaa \ | ||
527 | 141 | WHERE aal.account_id=aaa.id AND aal.id IN ("+','.join(map(str,selected_ids))+") AND (aal.journal_id " + journal +") AND aal.date>='"+ str(form['date1']) +"'"" AND aal.date<='" + str(form['date2']) + "'"" GROUP BY aal.account_id,aaa.name,aaa.code ORDER BY aal.account_id" | ||
528 | 142 | |||
529 | 143 | self.cr.execute(query) | ||
530 | 144 | res = self.cr.dictfetchall() | ||
531 | 145 | if res: | ||
532 | 146 | for element in res: | ||
533 | 147 | if self.base_amount <> 0.00: | ||
534 | 148 | element['perc'] = (element['amt'] / self.base_amount) * 100.00 | ||
535 | 149 | else: | ||
536 | 150 | element['perc'] = 0.00 | ||
537 | 151 | else: | ||
538 | 152 | result = {} | ||
539 | 153 | res = [] | ||
540 | 154 | result['id'] = acc_id | ||
541 | 155 | data_account = acc_pool.browse(self.cr, self.uid, acc_id) | ||
542 | 156 | result['acc_name'] = data_account.name | ||
543 | 157 | result['code'] = data_account.code | ||
544 | 158 | result['amt'] = result['qty'] = result['perc'] = 0.00 | ||
545 | 159 | if not form['empty_line']: | ||
546 | 160 | res.append(result) | ||
547 | 161 | else: | ||
548 | 162 | result = {} | ||
549 | 163 | res = [] | ||
550 | 164 | result['id'] = acc_id | ||
551 | 165 | data_account = acc_pool.browse(self.cr, self.uid, acc_id) | ||
552 | 166 | result['acc_name'] = data_account.name | ||
553 | 167 | result['code'] = data_account.code | ||
554 | 168 | result['amt'] = result['qty'] = result['perc'] = 0.00 | ||
555 | 169 | if not form['empty_line']: | ||
556 | 170 | res.append(result) | ||
557 | 171 | |||
558 | 172 | for item in res: | ||
559 | 173 | obj_acc = acc_pool.name_get(self.cr,self.uid,[item['id']]) | ||
560 | 174 | item['acc_name'] = obj_acc[0][1] | ||
561 | 175 | final.append(item) | ||
562 | 176 | print final | ||
563 | 177 | return final | ||
564 | 178 | |||
565 | 179 | report_sxw.report_sxw('report.account.analytic.account.crossovered.analytic.webkit', 'account.analytic.account', 'addons/account_analytic_plans_webkit/report/crossovered_analytic.rml',parser = crossovered_analytic, header='internal') | ||
566 | 180 | |||
567 | 181 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
568 | 182 | |||
569 | 0 | 183 | ||
570 | === added directory 'account_analytic_plans_webkit/wizard' | |||
571 | === added file 'account_analytic_plans_webkit/wizard/__init__.py' | |||
572 | --- account_analytic_plans_webkit/wizard/__init__.py 1970-01-01 00:00:00 +0000 | |||
573 | +++ account_analytic_plans_webkit/wizard/__init__.py 2013-10-10 09:47:29 +0000 | |||
574 | @@ -0,0 +1,26 @@ | |||
575 | 1 | # -*- coding: utf-8 -*- | ||
576 | 2 | ############################################################################## | ||
577 | 3 | # | ||
578 | 4 | # OpenERP, Open Source Management Solution | ||
579 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
580 | 6 | # | ||
581 | 7 | # This program is free software: you can redistribute it and/or modify | ||
582 | 8 | # it under the terms of the GNU Affero General Public License as | ||
583 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
584 | 10 | # License, or (at your option) any later version. | ||
585 | 11 | # | ||
586 | 12 | # This program is distributed in the hope that it will be useful, | ||
587 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
588 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
589 | 15 | # GNU Affero General Public License for more details. | ||
590 | 16 | # | ||
591 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
592 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
593 | 19 | # | ||
594 | 20 | ############################################################################ | ||
595 | 21 | |||
596 | 22 | |||
597 | 23 | import account_crossovered_analytic | ||
598 | 24 | |||
599 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
600 | 26 | |||
601 | 0 | 27 | ||
602 | === added file 'account_analytic_plans_webkit/wizard/account_crossovered_analytic.py' | |||
603 | --- account_analytic_plans_webkit/wizard/account_crossovered_analytic.py 1970-01-01 00:00:00 +0000 | |||
604 | +++ account_analytic_plans_webkit/wizard/account_crossovered_analytic.py 2013-10-10 09:47:29 +0000 | |||
605 | @@ -0,0 +1,70 @@ | |||
606 | 1 | # -*- coding: utf-8 -*- | ||
607 | 2 | ############################################################################## | ||
608 | 3 | # | ||
609 | 4 | # OpenERP, Open Source Management Solution | ||
610 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
611 | 6 | # | ||
612 | 7 | # This program is free software: you can redistribute it and/or modify | ||
613 | 8 | # it under the terms of the GNU Affero General Public License as | ||
614 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
615 | 10 | # License, or (at your option) any later version. | ||
616 | 11 | # | ||
617 | 12 | # This program is distributed in the hope that it will be useful, | ||
618 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
619 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
620 | 15 | # GNU Affero General Public License for more details. | ||
621 | 16 | # | ||
622 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
623 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
624 | 19 | # | ||
625 | 20 | ############################################################################ | ||
626 | 21 | |||
627 | 22 | import time | ||
628 | 23 | |||
629 | 24 | from openerp.osv import fields, osv | ||
630 | 25 | from openerp.tools.translate import _ | ||
631 | 26 | |||
632 | 27 | class account_crossovered_analytic(osv.osv_memory): | ||
633 | 28 | _inherit = "account.crossovered.analytic" | ||
634 | 29 | |||
635 | 30 | |||
636 | 31 | |||
637 | 32 | def print_report(self, cr, uid, ids, context=None): | ||
638 | 33 | |||
639 | 34 | res = super(account_crossovered_analytic,self).print_report( cr, uid, ids, context=context) | ||
640 | 35 | res['report_name']= 'account.analytic.account.crossovered.analytic.webkit' | ||
641 | 36 | return res | ||
642 | 37 | # cr.execute('SELECT account_id FROM account_analytic_line') | ||
643 | 38 | # res = cr.fetchall() | ||
644 | 39 | # acc_ids = [x[0] for x in res] | ||
645 | 40 | # | ||
646 | 41 | # data = self.read(cr, uid, ids, [], context=context)[0] | ||
647 | 42 | # data['ref'] = data['ref'][0] | ||
648 | 43 | # | ||
649 | 44 | # obj_acc = self.pool.get('account.analytic.account').browse(cr, uid, data['ref'], context=context) | ||
650 | 45 | # name = obj_acc.name | ||
651 | 46 | # | ||
652 | 47 | # account_ids = self.pool.get('account.analytic.account').search(cr, uid, [('parent_id', 'child_of', [data['ref']])], context=context) | ||
653 | 48 | # | ||
654 | 49 | # flag = True | ||
655 | 50 | # for acc in account_ids: | ||
656 | 51 | # if acc in acc_ids: | ||
657 | 52 | # flag = False | ||
658 | 53 | # break | ||
659 | 54 | # if flag: | ||
660 | 55 | # raise osv.except_osv(_('User Error!'),_('There are no analytic lines related to account %s.' % name)) | ||
661 | 56 | # | ||
662 | 57 | # datas = { | ||
663 | 58 | # 'ids': [], | ||
664 | 59 | # 'model': 'account.analytic.account', | ||
665 | 60 | # 'form': data | ||
666 | 61 | # } | ||
667 | 62 | # return { | ||
668 | 63 | # 'type': 'ir.actions.report.xml', | ||
669 | 64 | # 'report_name': 'account.analytic.account.crossovered.analytic', | ||
670 | 65 | # 'datas': datas, | ||
671 | 66 | # } | ||
672 | 67 | |||
673 | 68 | account_crossovered_analytic() | ||
674 | 69 | |||
675 | 70 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
676 | 0 | 71 | ||
677 | === added directory 'account_bank_statement_extensions_webkit' | |||
678 | === added file 'account_bank_statement_extensions_webkit/__init__.py' | |||
679 | --- account_bank_statement_extensions_webkit/__init__.py 1970-01-01 00:00:00 +0000 | |||
680 | +++ account_bank_statement_extensions_webkit/__init__.py 2013-10-10 09:47:29 +0000 | |||
681 | @@ -0,0 +1,24 @@ | |||
682 | 1 | # -*- coding: utf-8 -*- | ||
683 | 2 | ############################################################################## | ||
684 | 3 | # | ||
685 | 4 | # OpenERP, Open Source Management Solution | ||
686 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
687 | 6 | # | ||
688 | 7 | # This program is free software: you can redistribute it and/or modify | ||
689 | 8 | # it under the terms of the GNU Affero General Public License as | ||
690 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
691 | 10 | # License, or (at your option) any later version. | ||
692 | 11 | # | ||
693 | 12 | # This program is distributed in the hope that it will be useful, | ||
694 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
695 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
696 | 15 | # GNU Affero General Public License for more details. | ||
697 | 16 | # | ||
698 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
699 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
700 | 19 | # | ||
701 | 20 | ############################################################################ | ||
702 | 21 | |||
703 | 22 | import report | ||
704 | 23 | |||
705 | 24 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
706 | 0 | 25 | ||
707 | === added file 'account_bank_statement_extensions_webkit/__openerp__.py' | |||
708 | --- account_bank_statement_extensions_webkit/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
709 | +++ account_bank_statement_extensions_webkit/__openerp__.py 2013-10-10 09:47:29 +0000 | |||
710 | @@ -0,0 +1,41 @@ | |||
711 | 1 | # -*- coding: utf-8 -*- | ||
712 | 2 | ############################################################################## | ||
713 | 3 | # | ||
714 | 4 | # OpenERP, Open Source Management Solution | ||
715 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
716 | 6 | # | ||
717 | 7 | # This program is free software: you can redistribute it and/or modify | ||
718 | 8 | # it under the terms of the GNU Affero General Public License as | ||
719 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
720 | 10 | # License, or (at your option) any later version. | ||
721 | 11 | # | ||
722 | 12 | # This program is distributed in the hope that it will be useful, | ||
723 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
724 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
725 | 15 | # GNU Affero General Public License for more details. | ||
726 | 16 | # | ||
727 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
728 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
729 | 19 | # | ||
730 | 20 | ############################################################################ | ||
731 | 21 | { | ||
732 | 22 | 'name': 'Bank Statement Extensions to Support e-banking Webkit', | ||
733 | 23 | 'version': '1.1', | ||
734 | 24 | 'author': 'Serpent Consulting Services', | ||
735 | 25 | 'category': 'Generic Modules/Accounting', | ||
736 | 26 | 'description': ''' | ||
737 | 27 | Module that extends the standard account_bank_statement_line object for improved e-banking support. | ||
738 | 28 | =================================================================================================== | ||
739 | 29 | |||
740 | 30 | It is conversion of rml report to Webkit Report. | ||
741 | 31 | |||
742 | 32 | ''', | ||
743 | 33 | 'depends': ['account_bank_statement_extensions','report_webkit'], | ||
744 | 34 | 'data' : [ | ||
745 | 35 | 'account_bank_statement_report.xml', | ||
746 | 36 | ], | ||
747 | 37 | 'auto_install': False, | ||
748 | 38 | 'installable': True, | ||
749 | 39 | } | ||
750 | 40 | |||
751 | 41 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
752 | 0 | 42 | ||
753 | === added file 'account_bank_statement_extensions_webkit/account_bank_statement_report.xml' | |||
754 | --- account_bank_statement_extensions_webkit/account_bank_statement_report.xml 1970-01-01 00:00:00 +0000 | |||
755 | +++ account_bank_statement_extensions_webkit/account_bank_statement_report.xml 2013-10-10 09:47:29 +0000 | |||
756 | @@ -0,0 +1,113 @@ | |||
757 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
758 | 2 | <openerp> | ||
759 | 3 | <data> | ||
760 | 4 | <record id="account_bank_statement_webkit_header" model="ir.header_webkit"> | ||
761 | 5 | <field name="footer_html"><![CDATA[]]></field> | ||
762 | 6 | <field name="orientation">Portrait</field> | ||
763 | 7 | <field name="format">A4</field> | ||
764 | 8 | <field name="html"><![CDATA[ | ||
765 | 9 | <html> | ||
766 | 10 | <head> | ||
767 | 11 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
768 | 12 | <script> | ||
769 | 13 | function subst() { | ||
770 | 14 | var vars={}; | ||
771 | 15 | var x=document.location.search.substring(1).split('&'); | ||
772 | 16 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
773 | 17 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
774 | 18 | for(var i in x) { | ||
775 | 19 | var y = document.getElementsByClassName(x[i]); | ||
776 | 20 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
777 | 21 | } | ||
778 | 22 | } | ||
779 | 23 | </script> | ||
780 | 24 | <style type="text/css"> | ||
781 | 25 | |||
782 | 26 | ${css} | ||
783 | 27 | </style> | ||
784 | 28 | </head> | ||
785 | 29 | <body style="border:0; margin: 0;" onload="subst()"> | ||
786 | 30 | <table class="header" style="border-bottom: 1px solid black; width: 100%"> | ||
787 | 31 | <tr > | ||
788 | 32 | <td style="text-align:right;font-size:12;" width="15%">${time.strftime('%m/%d/%Y %I:%M')}</td> | ||
789 | 33 | <td style="text-align:center;font-size:16;" width="78%">${company.partner_id.name |entity}</td> | ||
790 | 34 | <td style="text-align:left;font-size:12;" width="3%"><span class="page"/> </td> | ||
791 | 35 | <td style="text-align:left;font-size:12;" width="1%"> /</td> | ||
792 | 36 | <td style="text-align:right;font-size:12;" width="3%"><span class="topage"/></td> | ||
793 | 37 | </tr> | ||
794 | 38 | </table> ${_debug or ''|n} </body> | ||
795 | 39 | </html>]]> | ||
796 | 40 | </field> | ||
797 | 41 | <field eval="15.0" name="margin_top"/> | ||
798 | 42 | <field eval="5.0" name="margin_bottom"/> | ||
799 | 43 | <field name="css"><![CDATA[ | ||
800 | 44 | |||
801 | 45 | body, table, td, span, div { | ||
802 | 46 | font-family: Helvetica, Arial; | ||
803 | 47 | } | ||
804 | 48 | |||
805 | 49 | body { | ||
806 | 50 | font-family:Arial; | ||
807 | 51 | font-size:12px; | ||
808 | 52 | |||
809 | 53 | } | ||
810 | 54 | |||
811 | 55 | .tr_bottom_line_dark_grey{ | ||
812 | 56 | border-bottom: thin solid grey; | ||
813 | 57 | width:100%; | ||
814 | 58 | font-size:12px; | ||
815 | 59 | |||
816 | 60 | } | ||
817 | 61 | .tr_bottom_line_dark_black{ | ||
818 | 62 | border-bottom: thin solid black; | ||
819 | 63 | width:100%; | ||
820 | 64 | font-size:12px; | ||
821 | 65 | font-weight:bold; | ||
822 | 66 | } | ||
823 | 67 | tr.report_header{ | ||
824 | 68 | |||
825 | 69 | caption-side: top; | ||
826 | 70 | font-family: Helvetica-Bold | ||
827 | 71 | padding: 5px; | ||
828 | 72 | border-bottom: 15px solid black; | ||
829 | 73 | align: center; | ||
830 | 74 | } | ||
831 | 75 | |||
832 | 76 | |||
833 | 77 | .header { | ||
834 | 78 | margin-left:0; | ||
835 | 79 | text-align:left; | ||
836 | 80 | width:300px; | ||
837 | 81 | font-size:12; | ||
838 | 82 | } | ||
839 | 83 | .title { | ||
840 | 84 | font-size:16; | ||
841 | 85 | font-weight: bold; | ||
842 | 86 | |||
843 | 87 | } | ||
844 | 88 | |||
845 | 89 | .list_table { | ||
846 | 90 | border-bottom:black; | ||
847 | 91 | text-align:center; | ||
848 | 92 | border-collapse: collapse; | ||
849 | 93 | |||
850 | 94 | } | ||
851 | 95 | |||
852 | 96 | ]]> | ||
853 | 97 | </field> | ||
854 | 98 | <field name="name">Account Bank Statment Webkit Header</field> | ||
855 | 99 | </record> | ||
856 | 100 | |||
857 | 101 | <report | ||
858 | 102 | auto="False" | ||
859 | 103 | id="bank_statement_balance_report" | ||
860 | 104 | model="account.bank.statement" | ||
861 | 105 | name="bank.statement.balance.report.webkit" | ||
862 | 106 | file="account_bank_statement_extensions_webkit/report/bank_statement_balance_report.mako" | ||
863 | 107 | report_type="webkit" | ||
864 | 108 | webkit_header="account_bank_statement_webkit_header" | ||
865 | 109 | string="Bank Statement Balances Report" | ||
866 | 110 | multi="True"/> | ||
867 | 111 | |||
868 | 112 | </data> | ||
869 | 113 | </openerp> | ||
870 | 0 | 114 | ||
871 | === added directory 'account_bank_statement_extensions_webkit/report' | |||
872 | === added file 'account_bank_statement_extensions_webkit/report/__init__.py' | |||
873 | --- account_bank_statement_extensions_webkit/report/__init__.py 1970-01-01 00:00:00 +0000 | |||
874 | +++ account_bank_statement_extensions_webkit/report/__init__.py 2013-10-10 09:47:29 +0000 | |||
875 | @@ -0,0 +1,25 @@ | |||
876 | 1 | # -*- coding: utf-8 -*- | ||
877 | 2 | ############################################################################## | ||
878 | 3 | # | ||
879 | 4 | # OpenERP, Open Source Management Solution | ||
880 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
881 | 6 | # | ||
882 | 7 | # This program is free software: you can redistribute it and/or modify | ||
883 | 8 | # it under the terms of the GNU Affero General Public License as | ||
884 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
885 | 10 | # License, or (at your option) any later version. | ||
886 | 11 | # | ||
887 | 12 | # This program is distributed in the hope that it will be useful, | ||
888 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
889 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
890 | 15 | # GNU Affero General Public License for more details. | ||
891 | 16 | # | ||
892 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
893 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
894 | 19 | # | ||
895 | 20 | ############################################################################ | ||
896 | 21 | |||
897 | 22 | |||
898 | 23 | import bank_statement_balance_report | ||
899 | 24 | |||
900 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
901 | 0 | 26 | ||
902 | === added file 'account_bank_statement_extensions_webkit/report/bank_statement_balance_report.mako' | |||
903 | --- account_bank_statement_extensions_webkit/report/bank_statement_balance_report.mako 1970-01-01 00:00:00 +0000 | |||
904 | +++ account_bank_statement_extensions_webkit/report/bank_statement_balance_report.mako 2013-10-10 09:47:29 +0000 | |||
905 | @@ -0,0 +1,56 @@ | |||
906 | 1 | <html> | ||
907 | 2 | <head> | ||
908 | 3 | <style type="text/css"> | ||
909 | 4 | ${css} | ||
910 | 5 | </style> | ||
911 | 6 | </head> | ||
912 | 7 | <body> | ||
913 | 8 | <br/> | ||
914 | 9 | <table width="100%"> | ||
915 | 10 | <tr class ="report_header"> | ||
916 | 11 | <td align="center"> | ||
917 | 12 | <h4><b> | ||
918 | 13 | Bank Statement Balances Report | ||
919 | 14 | </b></h4> | ||
920 | 15 | </td> | ||
921 | 16 | </tr> | ||
922 | 17 | </table> | ||
923 | 18 | <br/> <br/> | ||
924 | 19 | |||
925 | 20 | <table border="0" class="tr_bottom_line_dark_black" > | ||
926 | 21 | <tr> | ||
927 | 22 | <td width="30%"> | ||
928 | 23 | ${_('Name')} | ||
929 | 24 | </td> | ||
930 | 25 | <td width="30%"> | ||
931 | 26 | ${_('Date')} | ||
932 | 27 | </td> | ||
933 | 28 | <td width="20%"> | ||
934 | 29 | ${_('Journal')} | ||
935 | 30 | </td> | ||
936 | 31 | <td width="20%" align="right"> | ||
937 | 32 | ${_('Closing Balance')} | ||
938 | 33 | </td> | ||
939 | 34 | </tr> | ||
940 | 35 | </table> | ||
941 | 36 | %for l in lines: | ||
942 | 37 | <table border="0" class="tr_bottom_line_dark_grey"> | ||
943 | 38 | <tr > | ||
944 | 39 | <td width="30%"> | ||
945 | 40 | ${ l['s_name'] } | ||
946 | 41 | </td> | ||
947 | 42 | <td width="30%"> | ||
948 | 43 | ${ l['s_date'] } | ||
949 | 44 | </td> | ||
950 | 45 | <td width="20%"> | ||
951 | 46 | ${ l['j_code'] } | ||
952 | 47 | </td> | ||
953 | 48 | <td width="20%" align="right"> | ||
954 | 49 | ${ (l['s_balance']) } | ||
955 | 50 | </td> | ||
956 | 51 | </tr> | ||
957 | 52 | %endfor | ||
958 | 53 | </table> | ||
959 | 54 | <p style="page-break-after:always"></p> | ||
960 | 55 | </body> | ||
961 | 56 | </html> | ||
962 | 0 | \ No newline at end of file | 57 | \ No newline at end of file |
963 | 1 | 58 | ||
964 | === added file 'account_bank_statement_extensions_webkit/report/bank_statement_balance_report.py' | |||
965 | --- account_bank_statement_extensions_webkit/report/bank_statement_balance_report.py 1970-01-01 00:00:00 +0000 | |||
966 | +++ account_bank_statement_extensions_webkit/report/bank_statement_balance_report.py 2013-10-10 09:47:29 +0000 | |||
967 | @@ -0,0 +1,70 @@ | |||
968 | 1 | # -*- coding: utf-8 -*- | ||
969 | 2 | ############################################################################## | ||
970 | 3 | # | ||
971 | 4 | # OpenERP, Open Source Management Solution | ||
972 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
973 | 6 | # | ||
974 | 7 | # This program is free software: you can redistribute it and/or modify | ||
975 | 8 | # it under the terms of the GNU Affero General Public License as | ||
976 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
977 | 10 | # License, or (at your option) any later version. | ||
978 | 11 | # | ||
979 | 12 | # This program is distributed in the hope that it will be useful, | ||
980 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
981 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
982 | 15 | # GNU Affero General Public License for more details. | ||
983 | 16 | # | ||
984 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
985 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
986 | 19 | # | ||
987 | 20 | ############################################################################ | ||
988 | 21 | |||
989 | 22 | |||
990 | 23 | import time | ||
991 | 24 | from openerp.report import report_sxw | ||
992 | 25 | from openerp import pooler | ||
993 | 26 | import logging | ||
994 | 27 | _logger = logging.getLogger(__name__) | ||
995 | 28 | |||
996 | 29 | class bank_statement_balance_report(report_sxw.rml_parse): | ||
997 | 30 | |||
998 | 31 | def set_context(self, objects, data, ids, report_type=None): | ||
999 | 32 | #_logger.warning('addons.'+__name__, 'set_context, objects = %s, data = %s, ids = %s' % (objects, data, ids)) | ||
1000 | 33 | cr = self.cr | ||
1001 | 34 | uid = self.uid | ||
1002 | 35 | context = self.context | ||
1003 | 36 | |||
1004 | 37 | cr.execute('SELECT s.name as s_name, s.date AS s_date, j.code as j_code, s.balance_end_real as s_balance ' \ | ||
1005 | 38 | 'FROM account_bank_statement s ' \ | ||
1006 | 39 | 'INNER JOIN account_journal j on s.journal_id = j.id ' \ | ||
1007 | 40 | 'INNER JOIN ' \ | ||
1008 | 41 | '(SELECT journal_id, max(date) as max_date FROM account_bank_statement ' \ | ||
1009 | 42 | 'GROUP BY journal_id) d ' \ | ||
1010 | 43 | 'ON (s.journal_id = d.journal_id AND s.date = d.max_date) ' \ | ||
1011 | 44 | 'ORDER BY j.code') | ||
1012 | 45 | lines = cr.dictfetchall() | ||
1013 | 46 | |||
1014 | 47 | self.localcontext.update( { | ||
1015 | 48 | 'lines': lines, | ||
1016 | 49 | }) | ||
1017 | 50 | super(bank_statement_balance_report, self).set_context(objects, data, ids, report_type=report_type) | ||
1018 | 51 | |||
1019 | 52 | |||
1020 | 53 | def __init__(self, cr, uid, name, context): | ||
1021 | 54 | if context is None: | ||
1022 | 55 | context = {} | ||
1023 | 56 | super(bank_statement_balance_report, self).__init__(cr, uid, name, context=context) | ||
1024 | 57 | self.localcontext.update( { | ||
1025 | 58 | 'time': time, | ||
1026 | 59 | }) | ||
1027 | 60 | self.context = context | ||
1028 | 61 | |||
1029 | 62 | report_sxw.report_sxw( | ||
1030 | 63 | 'report.bank.statement.balance.report.webkit', | ||
1031 | 64 | 'account.bank.statement', | ||
1032 | 65 | 'addons/account_bank_statement_extensions_webkit/report/bank_statement_balance_report.mako', | ||
1033 | 66 | parser=bank_statement_balance_report, | ||
1034 | 67 | header='internal' | ||
1035 | 68 | ) | ||
1036 | 69 | |||
1037 | 70 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
1038 | 0 | 71 | ||
1039 | === added directory 'account_budget_webkit' | |||
1040 | === added file 'account_budget_webkit/__init__.py' | |||
1041 | --- account_budget_webkit/__init__.py 1970-01-01 00:00:00 +0000 | |||
1042 | +++ account_budget_webkit/__init__.py 2013-10-10 09:47:29 +0000 | |||
1043 | @@ -0,0 +1,26 @@ | |||
1044 | 1 | # -*- coding: utf-8 -*- | ||
1045 | 2 | ############################################################################## | ||
1046 | 3 | # | ||
1047 | 4 | # OpenERP, Open Source Management Solution | ||
1048 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
1049 | 6 | # | ||
1050 | 7 | # This program is free software: you can redistribute it and/or modify | ||
1051 | 8 | # it under the terms of the GNU Affero General Public License as | ||
1052 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
1053 | 10 | # License, or (at your option) any later version. | ||
1054 | 11 | # | ||
1055 | 12 | # This program is distributed in the hope that it will be useful, | ||
1056 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1057 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1058 | 15 | # GNU Affero General Public License for more details. | ||
1059 | 16 | # | ||
1060 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
1061 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1062 | 19 | # | ||
1063 | 20 | ############################################################################ | ||
1064 | 21 | |||
1065 | 22 | import report | ||
1066 | 23 | import wizard | ||
1067 | 24 | |||
1068 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
1069 | 26 | |||
1070 | 0 | 27 | ||
1071 | === added file 'account_budget_webkit/__openerp__.py' | |||
1072 | --- account_budget_webkit/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
1073 | +++ account_budget_webkit/__openerp__.py 2013-10-10 09:47:29 +0000 | |||
1074 | @@ -0,0 +1,42 @@ | |||
1075 | 1 | # -*- coding: utf-8 -*- | ||
1076 | 2 | ############################################################################## | ||
1077 | 3 | # | ||
1078 | 4 | # OpenERP, Open Source Management Solution | ||
1079 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
1080 | 6 | # | ||
1081 | 7 | # This program is free software: you can redistribute it and/or modify | ||
1082 | 8 | # it under the terms of the GNU Affero General Public License as | ||
1083 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
1084 | 10 | # License, or (at your option) any later version. | ||
1085 | 11 | # | ||
1086 | 12 | # This program is distributed in the hope that it will be useful, | ||
1087 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1088 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1089 | 15 | # GNU Affero General Public License for more details. | ||
1090 | 16 | # | ||
1091 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
1092 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1093 | 19 | # | ||
1094 | 20 | ############################################################################ | ||
1095 | 21 | |||
1096 | 22 | { | ||
1097 | 23 | 'name': 'Budgets Management', | ||
1098 | 24 | 'version': '1.0', | ||
1099 | 25 | 'category': 'Accounting & Finance', | ||
1100 | 26 | 'description': """ | ||
1101 | 27 | This module allows accountants to manage analytic and crossovered budgets. | ||
1102 | 28 | ========================================================================== | ||
1103 | 29 | |||
1104 | 30 | It is conversion of rml report to Webkit Report. | ||
1105 | 31 | |||
1106 | 32 | """, | ||
1107 | 33 | 'author': 'Serpent Consulting Services', | ||
1108 | 34 | 'website': 'http://www.serpentcs.com', | ||
1109 | 35 | 'depends': ['account_budget','report_webkit'], | ||
1110 | 36 | 'data': [ | ||
1111 | 37 | 'account_budget_report.xml', | ||
1112 | 38 | ], | ||
1113 | 39 | 'installable': True, | ||
1114 | 40 | 'auto_install': False, | ||
1115 | 41 | } | ||
1116 | 42 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
1117 | 0 | 43 | ||
1118 | === added file 'account_budget_webkit/account_budget_report.xml' | |||
1119 | --- account_budget_webkit/account_budget_report.xml 1970-01-01 00:00:00 +0000 | |||
1120 | +++ account_budget_webkit/account_budget_report.xml 2013-10-10 09:47:29 +0000 | |||
1121 | @@ -0,0 +1,234 @@ | |||
1122 | 1 | <?xml version="1.0"?> | ||
1123 | 2 | <openerp> | ||
1124 | 3 | <data> | ||
1125 | 4 | <record id="account_budget_webkit_header" model="ir.header_webkit"> | ||
1126 | 5 | <field name="footer_html"><![CDATA[]]></field> | ||
1127 | 6 | <field name="orientation">Portrait</field> | ||
1128 | 7 | <field name="format">A4</field> | ||
1129 | 8 | <field name="html"><![CDATA[ | ||
1130 | 9 | <html> | ||
1131 | 10 | <head> | ||
1132 | 11 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
1133 | 12 | <script> | ||
1134 | 13 | function subst() { | ||
1135 | 14 | var vars={}; | ||
1136 | 15 | var x=document.location.search.substring(1).split('&'); | ||
1137 | 16 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
1138 | 17 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
1139 | 18 | for(var i in x) { | ||
1140 | 19 | var y = document.getElementsByClassName(x[i]); | ||
1141 | 20 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
1142 | 21 | } | ||
1143 | 22 | } | ||
1144 | 23 | </script> | ||
1145 | 24 | <style type="text/css"> | ||
1146 | 25 | |||
1147 | 26 | ${css} | ||
1148 | 27 | </style> | ||
1149 | 28 | </head> | ||
1150 | 29 | <body style="border:0; margin: 0;" onload="subst()"> | ||
1151 | 30 | <table class="header" style="border-bottom: 1px solid black; width: 100%"> | ||
1152 | 31 | <tr > | ||
1153 | 32 | <td style="text-align:right;font-size:12;" width="15%">${time.strftime('%m/%d/%Y %I:%M')}</td> | ||
1154 | 33 | <td style="text-align:center;font-size:16;" width="78%">${company.partner_id.name |entity}</td> | ||
1155 | 34 | <td style="text-align:left;font-size:12;" width="3%"><span class="page"/> </td> | ||
1156 | 35 | <td style="text-align:left;font-size:12;" width="1%"> /</td> | ||
1157 | 36 | <td style="text-align:right;font-size:12;" width="3%"><span class="topage"/></td> | ||
1158 | 37 | </tr> | ||
1159 | 38 | </table> ${_debug or ''|n} </body> | ||
1160 | 39 | </html>]]> | ||
1161 | 40 | </field> | ||
1162 | 41 | <field eval="15.0" name="margin_top"/> | ||
1163 | 42 | <field eval="5.0" name="margin_bottom"/> | ||
1164 | 43 | <field name="css"><![CDATA[ | ||
1165 | 44 | |||
1166 | 45 | body, table, td, span, div { | ||
1167 | 46 | font-family: Helvetica, Arial; | ||
1168 | 47 | } | ||
1169 | 48 | |||
1170 | 49 | body { | ||
1171 | 50 | font-family:Arial; | ||
1172 | 51 | font-size:12; | ||
1173 | 52 | |||
1174 | 53 | } | ||
1175 | 54 | |||
1176 | 55 | |||
1177 | 56 | .header { | ||
1178 | 57 | margin-left:0; | ||
1179 | 58 | text-align:left; | ||
1180 | 59 | width:300px; | ||
1181 | 60 | font-size:12; | ||
1182 | 61 | } | ||
1183 | 62 | .title { | ||
1184 | 63 | font-size:16; | ||
1185 | 64 | font-weight: bold; | ||
1186 | 65 | |||
1187 | 66 | } | ||
1188 | 67 | |||
1189 | 68 | .basic_table td | ||
1190 | 69 | { | ||
1191 | 70 | border:1px solid lightGrey; | ||
1192 | 71 | font-size:12; | ||
1193 | 72 | |||
1194 | 73 | } | ||
1195 | 74 | |||
1196 | 75 | .list_table { | ||
1197 | 76 | border-bottom:1px solid black; | ||
1198 | 77 | border-right:border-bottom:1px solid #E5E4E2" | ||
1199 | 78 | text-align:left; | ||
1200 | 79 | font-size:12; | ||
1201 | 80 | } | ||
1202 | 81 | .list_table_grey{ | ||
1203 | 82 | font-size:12; | ||
1204 | 83 | } | ||
1205 | 84 | .list_table_grey tr{ | ||
1206 | 85 | border-bottom:1px solid #E5E4E2"; | ||
1207 | 86 | |||
1208 | 87 | text-align:left; | ||
1209 | 88 | font-size:12; | ||
1210 | 89 | } | ||
1211 | 90 | .basic_table{ | ||
1212 | 91 | text-align:center; | ||
1213 | 92 | border:1px solid lightGrey; | ||
1214 | 93 | border-collapse: collapse; | ||
1215 | 94 | } | ||
1216 | 95 | |||
1217 | 96 | .list_tabe thead { | ||
1218 | 97 | display:table-header-group; | ||
1219 | 98 | } | ||
1220 | 99 | |||
1221 | 100 | .line{ | ||
1222 | 101 | font-size:12px; | ||
1223 | 102 | border-top: 1px solid grey; | ||
1224 | 103 | border-bottom: 1px solid #E5E4E2; | ||
1225 | 104 | |||
1226 | 105 | } | ||
1227 | 106 | |||
1228 | 107 | .tbl_header{ | ||
1229 | 108 | width:100%; | ||
1230 | 109 | font-size:10px; | ||
1231 | 110 | } | ||
1232 | 111 | .tr_bottom_line{ | ||
1233 | 112 | border-bottom: thin solid black; | ||
1234 | 113 | width:100%; | ||
1235 | 114 | } | ||
1236 | 115 | .tr_bottom_line_dark_grey{ | ||
1237 | 116 | border-bottom: thin solid grey; | ||
1238 | 117 | width:100%; | ||
1239 | 118 | } | ||
1240 | 119 | .tr_bottom_line_light_grey{ | ||
1241 | 120 | border-bottom: thin solid #CCCCCC; | ||
1242 | 121 | width:100%; | ||
1243 | 122 | } | ||
1244 | 123 | .td_f12{ | ||
1245 | 124 | font-size:12px; | ||
1246 | 125 | } | ||
1247 | 126 | .td_f10{ | ||
1248 | 127 | font-size:10px; | ||
1249 | 128 | } | ||
1250 | 129 | .td_f10_right{ | ||
1251 | 130 | font-size:10px; | ||
1252 | 131 | text-align:right; | ||
1253 | 132 | } | ||
1254 | 133 | .td_f12{ | ||
1255 | 134 | font-size:12px; | ||
1256 | 135 | } | ||
1257 | 136 | .td_f12_right{ | ||
1258 | 137 | font-size:12px; | ||
1259 | 138 | text-align:right; | ||
1260 | 139 | } | ||
1261 | 140 | table.head_border_style{ | ||
1262 | 141 | border:1px solid; | ||
1263 | 142 | color: #cccccc; | ||
1264 | 143 | } | ||
1265 | 144 | tr.head_border_style{ | ||
1266 | 145 | border:1px solid; | ||
1267 | 146 | color: #cccccc; | ||
1268 | 147 | } | ||
1269 | 148 | tr.table_header{ | ||
1270 | 149 | font-weight: bold; | ||
1271 | 150 | font-family: sans-serif, serif; | ||
1272 | 151 | font-size: 14px; | ||
1273 | 152 | caption-side: top; | ||
1274 | 153 | padding: 5px; | ||
1275 | 154 | } | ||
1276 | 155 | tr.table_parent_data{ | ||
1277 | 156 | font-family: Helvetica-Bold; | ||
1278 | 157 | font-size: 12px; | ||
1279 | 158 | caption-side: top; | ||
1280 | 159 | font-weight: bold; | ||
1281 | 160 | } | ||
1282 | 161 | tr.table_child_data{ | ||
1283 | 162 | font-family: Helvetica; | ||
1284 | 163 | font-size: 12px; | ||
1285 | 164 | caption-side: top; | ||
1286 | 165 | } | ||
1287 | 166 | tr.report_header{ | ||
1288 | 167 | font-size: 30px; | ||
1289 | 168 | caption-side: top; | ||
1290 | 169 | font-family: Helvetica-Bold | ||
1291 | 170 | padding: 5px; | ||
1292 | 171 | border-bottom: 15px solid black; | ||
1293 | 172 | align: center | ||
1294 | 173 | } | ||
1295 | 174 | |||
1296 | 175 | .top{ | ||
1297 | 176 | border-top: thin solid black; | ||
1298 | 177 | |||
1299 | 178 | } | ||
1300 | 179 | .bottom { | ||
1301 | 180 | border-bottom:thin solid; | ||
1302 | 181 | border-color:#cccccc; | ||
1303 | 182 | } | ||
1304 | 183 | .head_bottom_border{ | ||
1305 | 184 | border-bottom:thin solid; | ||
1306 | 185 | border-color:black; | ||
1307 | 186 | } | ||
1308 | 187 | .left { | ||
1309 | 188 | border-left:thin solid; | ||
1310 | 189 | border-color:#cccccc; | ||
1311 | 190 | } | ||
1312 | 191 | .right { | ||
1313 | 192 | border-right:thin solid; | ||
1314 | 193 | border-color:#cccccc; | ||
1315 | 194 | } | ||
1316 | 195 | |||
1317 | 196 | ]]> | ||
1318 | 197 | </field> | ||
1319 | 198 | <field name="name">Account Tax Webkit Header</field> | ||
1320 | 199 | </record> | ||
1321 | 200 | |||
1322 | 201 | <!-- Reports on crossovered.budget --> | ||
1323 | 202 | <report id="report_crossovered_budget" | ||
1324 | 203 | string="Budgets" | ||
1325 | 204 | model="crossovered.budget" | ||
1326 | 205 | name="crossovered.budget.report.webkit" | ||
1327 | 206 | file="account_budget_webkit/report/crossovered_budget_report.mako" | ||
1328 | 207 | auto="False" | ||
1329 | 208 | menu="False" | ||
1330 | 209 | report_type="webkit" | ||
1331 | 210 | webkit_header="account_budget_webkit_header"/> | ||
1332 | 211 | |||
1333 | 212 | <!-- moved from account module --> | ||
1334 | 213 | <report auto="False" | ||
1335 | 214 | id="account_budget" | ||
1336 | 215 | menu="False" | ||
1337 | 216 | model="account.budget.post" | ||
1338 | 217 | name="account.budget.webkit" | ||
1339 | 218 | file="account_budget_webkit/report/budget_report.mako" | ||
1340 | 219 | string="Budget" | ||
1341 | 220 | report_type="webkit" | ||
1342 | 221 | webkit_header="account_budget_webkit_header"/> | ||
1343 | 222 | |||
1344 | 223 | <report | ||
1345 | 224 | auto="False" | ||
1346 | 225 | id="account_analytic_budget" | ||
1347 | 226 | menu="False" | ||
1348 | 227 | model="account.analytic.account" | ||
1349 | 228 | name="account.analytic.account.budget.webkit" | ||
1350 | 229 | file="account_budget_webkit/report/analytic_account_budget_report.mako" | ||
1351 | 230 | string="Print Budget" | ||
1352 | 231 | report_type="webkit" | ||
1353 | 232 | webkit_header="account_budget_webkit_header" /> | ||
1354 | 233 | </data> | ||
1355 | 234 | </openerp> | ||
1356 | 0 | \ No newline at end of file | 235 | \ No newline at end of file |
1357 | 1 | 236 | ||
1358 | === added directory 'account_budget_webkit/report' | |||
1359 | === added file 'account_budget_webkit/report/__init__.py' | |||
1360 | --- account_budget_webkit/report/__init__.py 1970-01-01 00:00:00 +0000 | |||
1361 | +++ account_budget_webkit/report/__init__.py 2013-10-10 09:47:29 +0000 | |||
1362 | @@ -0,0 +1,27 @@ | |||
1363 | 1 | # -*- coding: utf-8 -*- | ||
1364 | 2 | ############################################################################## | ||
1365 | 3 | # | ||
1366 | 4 | # OpenERP, Open Source Management Solution | ||
1367 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
1368 | 6 | # | ||
1369 | 7 | # This program is free software: you can redistribute it and/or modify | ||
1370 | 8 | # it under the terms of the GNU Affero General Public License as | ||
1371 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
1372 | 10 | # License, or (at your option) any later version. | ||
1373 | 11 | # | ||
1374 | 12 | # This program is distributed in the hope that it will be useful, | ||
1375 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1376 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1377 | 15 | # GNU Affero General Public License for more details. | ||
1378 | 16 | # | ||
1379 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
1380 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1381 | 19 | # | ||
1382 | 20 | ############################################################################ | ||
1383 | 21 | |||
1384 | 22 | import crossovered_budget_report | ||
1385 | 23 | import analytic_account_budget_report | ||
1386 | 24 | import budget_report | ||
1387 | 25 | |||
1388 | 26 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
1389 | 27 | |||
1390 | 0 | 28 | ||
1391 | === added file 'account_budget_webkit/report/analytic_account_budget_report.mako' | |||
1392 | --- account_budget_webkit/report/analytic_account_budget_report.mako 1970-01-01 00:00:00 +0000 | |||
1393 | +++ account_budget_webkit/report/analytic_account_budget_report.mako 2013-10-10 09:47:29 +0000 | |||
1394 | @@ -0,0 +1,119 @@ | |||
1395 | 1 | <html> | ||
1396 | 2 | <head> | ||
1397 | 3 | <style type="text/css"> | ||
1398 | 4 | ${css} | ||
1399 | 5 | .basic_table{ | ||
1400 | 6 | text-align:center; | ||
1401 | 7 | border:1px solid lightGrey; | ||
1402 | 8 | border-collapse: collapse; | ||
1403 | 9 | } | ||
1404 | 10 | </style> | ||
1405 | 11 | </head> | ||
1406 | 12 | <body> | ||
1407 | 13 | </br> | ||
1408 | 14 | </br> | ||
1409 | 15 | </br> | ||
1410 | 16 | %for o in objects: | ||
1411 | 17 | </br> | ||
1412 | 18 | <table width="100%"> | ||
1413 | 19 | <tr> | ||
1414 | 20 | <td align="center"> | ||
1415 | 21 | <h4> | ||
1416 | 22 | <b>Analytic Budget </b></h4> | ||
1417 | 23 | </td> | ||
1418 | 24 | </tr> | ||
1419 | 25 | </table> | ||
1420 | 26 | <br/> | ||
1421 | 27 | <table width="100%" class="basic_table"> | ||
1422 | 28 | <tr > | ||
1423 | 29 | <td width="40%"><b> | ||
1424 | 30 | ${_('Analysis from')} | ||
1425 | 31 | </td></b> | ||
1426 | 32 | <td width="40%"><b> | ||
1427 | 33 | ${_('Analytic Account')}</b> | ||
1428 | 34 | </td> | ||
1429 | 35 | <td width="20%"> | ||
1430 | 36 | <b> | ||
1431 | 37 | ${_('Currency')} </b> | ||
1432 | 38 | </td></b> | ||
1433 | 39 | </tr> | ||
1434 | 40 | |||
1435 | 41 | <tr> | ||
1436 | 42 | <td> | ||
1437 | 43 | ${formatLang(data['form']['date_from'],date=True)} to ${formatLang(data['form']['date_to'],date=True)} | ||
1438 | 44 | </td> | ||
1439 | 45 | <td> | ||
1440 | 46 | ${o.name} | ||
1441 | 47 | </td> | ||
1442 | 48 | <td> | ||
1443 | 49 | ${company.currency_id.name} | ||
1444 | 50 | </td> | ||
1445 | 51 | </tr> | ||
1446 | 52 | |||
1447 | 53 | </table> | ||
1448 | 54 | <br/> | ||
1449 | 55 | <table width="100%" class="list_table"> | ||
1450 | 56 | <tr > | ||
1451 | 57 | <td width="40%"><b> | ||
1452 | 58 | ${_('Description')}</b> | ||
1453 | 59 | </td> | ||
1454 | 60 | <td width="15%"><b> | ||
1455 | 61 | ${_('Theoretical Amt')}</b> | ||
1456 | 62 | </td> | ||
1457 | 63 | <td width="12%"><b> | ||
1458 | 64 | ${_('Planned Amt')}</b> | ||
1459 | 65 | </td> | ||
1460 | 66 | <td width="13%"><b> | ||
1461 | 67 | ${_('Practical Amt')}</b> | ||
1462 | 68 | </td> | ||
1463 | 69 | <td width="10%" align="right"><b> | ||
1464 | 70 | ${_('Perc(%)')}</b> | ||
1465 | 71 | </td> | ||
1466 | 72 | </tr> | ||
1467 | 73 | %for a in funct(o,data['form']): | ||
1468 | 74 | <tr> | ||
1469 | 75 | <td> | ||
1470 | 76 | ${a['name']} | ||
1471 | 77 | </td> | ||
1472 | 78 | <td> | ||
1473 | 79 | ${formatLang(a['theo'], currency_obj=company.currency_id) } | ||
1474 | 80 | </td> | ||
1475 | 81 | <td> | ||
1476 | 82 | ${ formatLang(a['pln'], currency_obj=company.currency_id) } | ||
1477 | 83 | </td> | ||
1478 | 84 | <td> | ||
1479 | 85 | ${ formatLang(a['prac'], currency_obj=company.currency_id) } | ||
1480 | 86 | </td> | ||
1481 | 87 | <td> | ||
1482 | 88 | ${ formatLang(a['perc']) }% | ||
1483 | 89 | </td> | ||
1484 | 90 | </tr> | ||
1485 | 91 | %endfor | ||
1486 | 92 | </table> | ||
1487 | 93 | %for b in funct_total(data['form']): | ||
1488 | 94 | <table width="100%"> | ||
1489 | 95 | |||
1490 | 96 | <tr> | ||
1491 | 97 | <td width="40%"><b><h5> | ||
1492 | 98 | ${ } Total:</h5></b> | ||
1493 | 99 | </td> | ||
1494 | 100 | <td width="15%" align="right"><h5> | ||
1495 | 101 | <b>${ formatLang(b['tot_theo'], currency_obj=company.currency_id) }</b></h5> | ||
1496 | 102 | </td> | ||
1497 | 103 | <td width="12%" align="right"><b><h5> | ||
1498 | 104 | ${ formatLang(b['tot_pln'], currency_obj=company.currency_id) }</b></h5> | ||
1499 | 105 | </td> | ||
1500 | 106 | <td width="13%" align="right"><b><h5> | ||
1501 | 107 | ${ formatLang(b['tot_prac'], currency_obj=company.currency_id) }</h5></b> | ||
1502 | 108 | <td width="10%" align="right"><b><h5> | ||
1503 | 109 | ${ formatLang(b['tot_perc']) }%</h5></b> | ||
1504 | 110 | </td> | ||
1505 | 111 | </tr></h5> | ||
1506 | 112 | %endfor | ||
1507 | 113 | </table> | ||
1508 | 114 | <p style="page-break-after:always"> | ||
1509 | 115 | </p> | ||
1510 | 116 | |||
1511 | 117 | %endfor | ||
1512 | 118 | </body> | ||
1513 | 119 | </html> | ||
1514 | 0 | \ No newline at end of file | 120 | \ No newline at end of file |
1515 | 1 | 121 | ||
1516 | === added file 'account_budget_webkit/report/analytic_account_budget_report.py' | |||
1517 | --- account_budget_webkit/report/analytic_account_budget_report.py 1970-01-01 00:00:00 +0000 | |||
1518 | +++ account_budget_webkit/report/analytic_account_budget_report.py 2013-10-10 09:47:29 +0000 | |||
1519 | @@ -0,0 +1,173 @@ | |||
1520 | 1 | # -*- coding: utf-8 -*- | ||
1521 | 2 | ############################################################################## | ||
1522 | 3 | # | ||
1523 | 4 | # OpenERP, Open Source Management Solution | ||
1524 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
1525 | 6 | # | ||
1526 | 7 | # This program is free software: you can redistribute it and/or modify | ||
1527 | 8 | # it under the terms of the GNU Affero General Public License as | ||
1528 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
1529 | 10 | # License, or (at your option) any later version. | ||
1530 | 11 | # | ||
1531 | 12 | # This program is distributed in the hope that it will be useful, | ||
1532 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1533 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1534 | 15 | # GNU Affero General Public License for more details. | ||
1535 | 16 | # | ||
1536 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
1537 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1538 | 19 | # | ||
1539 | 20 | ############################################################################ | ||
1540 | 21 | |||
1541 | 22 | import time | ||
1542 | 23 | import datetime | ||
1543 | 24 | |||
1544 | 25 | from openerp import pooler | ||
1545 | 26 | from openerp.report import report_sxw | ||
1546 | 27 | |||
1547 | 28 | class analytic_account_budget_report(report_sxw.rml_parse): | ||
1548 | 29 | def __init__(self, cr, uid, name, context): | ||
1549 | 30 | super(analytic_account_budget_report, self).__init__(cr, uid, name, context=context) | ||
1550 | 31 | self.localcontext.update( { | ||
1551 | 32 | 'funct': self.funct, | ||
1552 | 33 | 'funct_total': self.funct_total, | ||
1553 | 34 | 'time': time, | ||
1554 | 35 | }) | ||
1555 | 36 | self.context = context | ||
1556 | 37 | |||
1557 | 38 | def funct(self, object, form, ids=None, done=None, level=1): | ||
1558 | 39 | if ids is None: | ||
1559 | 40 | ids = {} | ||
1560 | 41 | if not ids: | ||
1561 | 42 | ids = self.ids | ||
1562 | 43 | if not done: | ||
1563 | 44 | done = {} | ||
1564 | 45 | |||
1565 | 46 | global tot | ||
1566 | 47 | tot = { | ||
1567 | 48 | 'theo':0.00, | ||
1568 | 49 | 'pln':0.00, | ||
1569 | 50 | 'prac':0.00, | ||
1570 | 51 | 'perc':0.00 | ||
1571 | 52 | } | ||
1572 | 53 | result = [] | ||
1573 | 54 | accounts = self.pool.get('account.analytic.account').browse(self.cr, self.uid, [object.id], self.context.copy()) | ||
1574 | 55 | c_b_lines_obj = self.pool.get('crossovered.budget.lines') | ||
1575 | 56 | obj_c_budget = self.pool.get('crossovered.budget') | ||
1576 | 57 | |||
1577 | 58 | for account_id in accounts: | ||
1578 | 59 | res = {} | ||
1579 | 60 | b_line_ids = [] | ||
1580 | 61 | for line in account_id.crossovered_budget_line: | ||
1581 | 62 | b_line_ids.append(line.id) | ||
1582 | 63 | if not b_line_ids: | ||
1583 | 64 | return [] | ||
1584 | 65 | d_from = form['date_from'] | ||
1585 | 66 | d_to = form['date_to'] | ||
1586 | 67 | |||
1587 | 68 | self.cr.execute('SELECT DISTINCT(crossovered_budget_id) FROM crossovered_budget_lines WHERE id =ANY(%s)',(b_line_ids,)) | ||
1588 | 69 | budget_ids = self.cr.fetchall() | ||
1589 | 70 | |||
1590 | 71 | context = {'wizard_date_from':d_from,'wizard_date_to':d_to} | ||
1591 | 72 | for i in range(0, len(budget_ids)): | ||
1592 | 73 | budget_name = obj_c_budget.browse(self.cr, self.uid, [budget_ids[i][0]]) | ||
1593 | 74 | res= { | ||
1594 | 75 | 'b_id':'-1', | ||
1595 | 76 | 'a_id':'-1', | ||
1596 | 77 | 'name':budget_name[0].name, | ||
1597 | 78 | 'status':1, | ||
1598 | 79 | 'theo':0.00, | ||
1599 | 80 | 'pln':0.00, | ||
1600 | 81 | 'prac':0.00, | ||
1601 | 82 | 'perc':0.00 | ||
1602 | 83 | } | ||
1603 | 84 | result.append(res) | ||
1604 | 85 | |||
1605 | 86 | line_ids = c_b_lines_obj.search(self.cr, self.uid, [('id', 'in', b_line_ids), ('crossovered_budget_id','=',budget_ids[i][0])]) | ||
1606 | 87 | line_id = c_b_lines_obj.browse(self.cr, self.uid, line_ids) | ||
1607 | 88 | tot_theo = tot_pln = tot_prac = tot_perc = 0 | ||
1608 | 89 | |||
1609 | 90 | done_budget = [] | ||
1610 | 91 | for line in line_id: | ||
1611 | 92 | if line.id in b_line_ids: | ||
1612 | 93 | theo = pract = 0.00 | ||
1613 | 94 | theo = c_b_lines_obj._theo_amt(self.cr, self.uid, [line.id], context)[line.id] | ||
1614 | 95 | pract = c_b_lines_obj._prac_amt(self.cr, self.uid, [line.id], context)[line.id] | ||
1615 | 96 | if line.general_budget_id.id in done_budget: | ||
1616 | 97 | for record in result: | ||
1617 | 98 | if record['b_id'] == line.general_budget_id.id and record['a_id'] == line.analytic_account_id.id: | ||
1618 | 99 | record['theo'] += theo | ||
1619 | 100 | record['pln'] += line.planned_amount | ||
1620 | 101 | record['prac'] += pract | ||
1621 | 102 | record['perc'] += line.percentage | ||
1622 | 103 | tot_theo += theo | ||
1623 | 104 | tot_pln += line.planned_amount | ||
1624 | 105 | tot_prac += pract | ||
1625 | 106 | tot_perc += line.percentage | ||
1626 | 107 | else: | ||
1627 | 108 | res1 = { | ||
1628 | 109 | 'b_id': line.general_budget_id.id, | ||
1629 | 110 | 'a_id': line.analytic_account_id.id, | ||
1630 | 111 | 'name': line.general_budget_id.name, | ||
1631 | 112 | 'status': 2, | ||
1632 | 113 | 'theo': theo, | ||
1633 | 114 | 'pln': line.planned_amount, | ||
1634 | 115 | 'prac': pract, | ||
1635 | 116 | 'perc': line.percentage | ||
1636 | 117 | } | ||
1637 | 118 | tot_theo += theo | ||
1638 | 119 | tot_pln += line.planned_amount | ||
1639 | 120 | tot_prac += pract | ||
1640 | 121 | tot_perc += line.percentage | ||
1641 | 122 | result.append(res1) | ||
1642 | 123 | done_budget.append(line.general_budget_id.id) | ||
1643 | 124 | else: | ||
1644 | 125 | if line.general_budget_id.id in done_budget: | ||
1645 | 126 | continue | ||
1646 | 127 | else: | ||
1647 | 128 | res1={ | ||
1648 | 129 | 'b_id': line.general_budget_id.id, | ||
1649 | 130 | 'a_id': line.analytic_account_id.id, | ||
1650 | 131 | 'name': line.general_budget_id.name, | ||
1651 | 132 | 'status': 2, | ||
1652 | 133 | 'theo': 0.00, | ||
1653 | 134 | 'pln': 0.00, | ||
1654 | 135 | 'prac': 0.00, | ||
1655 | 136 | 'perc': 0.00 | ||
1656 | 137 | } | ||
1657 | 138 | result.append(res1) | ||
1658 | 139 | done_budget.append(line.general_budget_id.id) | ||
1659 | 140 | if tot_theo == 0.00: | ||
1660 | 141 | tot_perc = 0.00 | ||
1661 | 142 | else: | ||
1662 | 143 | tot_perc = float(tot_prac / tot_theo) * 100 | ||
1663 | 144 | |||
1664 | 145 | result[-(len(done_budget) +1)]['theo'] = tot_theo | ||
1665 | 146 | tot['theo'] +=tot_theo | ||
1666 | 147 | result[-(len(done_budget) +1)]['pln'] = tot_pln | ||
1667 | 148 | tot['pln'] +=tot_pln | ||
1668 | 149 | result[-(len(done_budget) +1)]['prac'] = tot_prac | ||
1669 | 150 | tot['prac'] +=tot_prac | ||
1670 | 151 | result[-(len(done_budget) +1)]['perc'] = tot_perc | ||
1671 | 152 | if tot['theo'] == 0.00: | ||
1672 | 153 | tot['perc'] = 0.00 | ||
1673 | 154 | else: | ||
1674 | 155 | tot['perc'] = float(tot['prac'] / tot['theo']) * 100 | ||
1675 | 156 | return result | ||
1676 | 157 | |||
1677 | 158 | def funct_total(self, form): | ||
1678 | 159 | result = [] | ||
1679 | 160 | res = {} | ||
1680 | 161 | res = { | ||
1681 | 162 | 'tot_theo': tot['theo'], | ||
1682 | 163 | 'tot_pln': tot['pln'], | ||
1683 | 164 | 'tot_prac': tot['prac'], | ||
1684 | 165 | 'tot_perc': tot['perc'] | ||
1685 | 166 | } | ||
1686 | 167 | result.append(res) | ||
1687 | 168 | return result | ||
1688 | 169 | |||
1689 | 170 | report_sxw.report_sxw('report.account.analytic.account.budget.webkit', 'account.analytic.account', 'account_budget_webkit/report/analytic_account_budget_report.mako',parser=analytic_account_budget_report,header='internal') | ||
1690 | 171 | |||
1691 | 172 | |||
1692 | 173 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
1693 | 0 | 174 | ||
1694 | === added file 'account_budget_webkit/report/budget_report.mako' | |||
1695 | --- account_budget_webkit/report/budget_report.mako 1970-01-01 00:00:00 +0000 | |||
1696 | +++ account_budget_webkit/report/budget_report.mako 2013-10-10 09:47:29 +0000 | |||
1697 | @@ -0,0 +1,131 @@ | |||
1698 | 1 | <html> | ||
1699 | 2 | <head> | ||
1700 | 3 | <style type="text/css"> | ||
1701 | 4 | ${css} | ||
1702 | 5 | </style> | ||
1703 | 6 | </head> | ||
1704 | 7 | <body> | ||
1705 | 8 | </br> | ||
1706 | 9 | </br> | ||
1707 | 10 | </br> | ||
1708 | 11 | %for o in objects: | ||
1709 | 12 | <br/> | ||
1710 | 13 | <table width="100%"> | ||
1711 | 14 | <tr> | ||
1712 | 15 | <td align="center"> | ||
1713 | 16 | <h4> | ||
1714 | 17 | <b> Budget </b></h4> | ||
1715 | 18 | </td> | ||
1716 | 19 | </tr> | ||
1717 | 20 | </table> | ||
1718 | 21 | <table width="100%" class="line"> | ||
1719 | 22 | <tr> | ||
1720 | 23 | <td width="1%"></td> | ||
1721 | 24 | <td width="49%"> | ||
1722 | 25 | <b>Currency:</b>${ company.currency_id.name } | ||
1723 | 26 | </td> | ||
1724 | 27 | <td width="49%" align="right"> | ||
1725 | 28 | Printed at: ${ formatLang(time.strftime('%Y-%m-%d'),date=True) } at ${ time.strftime('%H:%M:%S') } | ||
1726 | 29 | </td> | ||
1727 | 30 | <td width="1%"></td> | ||
1728 | 31 | </tr> | ||
1729 | 32 | <tr> | ||
1730 | 33 | <td></td> | ||
1731 | 34 | <td> | ||
1732 | 35 | <b>Analysis from</b> ${ formatLang(data['form']['date_from'],date=True) } to ${ formatLang(data['form']['date_to'],date=True) } | ||
1733 | 36 | </td> | ||
1734 | 37 | <td align="right"> | ||
1735 | 38 | <b>Budget :</b> <font color="Blue">${ o.name }</font> | ||
1736 | 39 | |||
1737 | 40 | </td> | ||
1738 | 41 | <td></td> | ||
1739 | 42 | </tr> | ||
1740 | 43 | </table> | ||
1741 | 44 | <br/> | ||
1742 | 45 | <br/> | ||
1743 | 46 | <table width="100%" class="list_table"> | ||
1744 | 47 | |||
1745 | 48 | <tr > | ||
1746 | 49 | <td width="40%" > | ||
1747 | 50 | <b> | ||
1748 | 51 | ${_('Description')} | ||
1749 | 52 | </b> | ||
1750 | 53 | </td> | ||
1751 | 54 | <td width="15%" align="right"> | ||
1752 | 55 | <b> | ||
1753 | 56 | ${_('Theoretical Amt')} | ||
1754 | 57 | </b> | ||
1755 | 58 | </td> | ||
1756 | 59 | <td width="12%" align="right"> | ||
1757 | 60 | <b> | ||
1758 | 61 | ${_('Planned Amt')} | ||
1759 | 62 | </b> | ||
1760 | 63 | </td> | ||
1761 | 64 | <td width="13%" align="right"> | ||
1762 | 65 | <b> | ||
1763 | 66 | ${_('Practical Amt')} | ||
1764 | 67 | </b> | ||
1765 | 68 | </td> | ||
1766 | 69 | <td width="10%" align="right"> | ||
1767 | 70 | <b> | ||
1768 | 71 | ${_('Perc(%)')} | ||
1769 | 72 | </b> | ||
1770 | 73 | </td> | ||
1771 | 74 | </tr> | ||
1772 | 75 | </table> | ||
1773 | 76 | |||
1774 | 77 | %for a in funct(o,data['form']): | ||
1775 | 78 | <table width="100%" style="border-bottom: 1px solid #ccc !important;text-align:left;font-size:12;"> | ||
1776 | 79 | <tr> | ||
1777 | 80 | <td width="40%"> | ||
1778 | 81 | %if a['status'] == 1 : | ||
1779 | 82 | ${a['name']} | ||
1780 | 83 | %endif | ||
1781 | 84 | %if a['status'] == 2: | ||
1782 | 85 | <p style="padding-left:12px;">${a['name']} </p> | ||
1783 | 86 | %endif | ||
1784 | 87 | </td> | ||
1785 | 88 | <td align="right" width="15%"> | ||
1786 | 89 | ${formatLang(a['theo'], digits=get_digits(dp='Account'), currency_obj=company.currency_id)} | ||
1787 | 90 | </td> | ||
1788 | 91 | <td align="right" width="12%"> | ||
1789 | 92 | ${formatLang(a['pln'], digits=get_digits(dp='Account'), currency_obj=company.currency_id)} | ||
1790 | 93 | </td> | ||
1791 | 94 | <td align="right" width="13%"> | ||
1792 | 95 | ${formatLang(a['prac'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) } | ||
1793 | 96 | </td> | ||
1794 | 97 | <td width="10%" align="right"> | ||
1795 | 98 | ${formatLang(a['perc'], digits=2) } | ||
1796 | 99 | </td> | ||
1797 | 100 | |||
1798 | 101 | </tr> | ||
1799 | 102 | |||
1800 | 103 | </table> | ||
1801 | 104 | %endfor | ||
1802 | 105 | %for b in funct_total(data['form']): | ||
1803 | 106 | <table width="100%" class="top"> | ||
1804 | 107 | <tr> | ||
1805 | 108 | <td width="40%"> | ||
1806 | 109 | Total: | ||
1807 | 110 | </td> | ||
1808 | 111 | <td width="15%" align="right"> | ||
1809 | 112 | ${ formatLang(b['tot_theo'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) } | ||
1810 | 113 | </td> | ||
1811 | 114 | <td width="12%" align="right"> | ||
1812 | 115 | ${ formatLang(b['tot_pln'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) } | ||
1813 | 116 | </td> | ||
1814 | 117 | <td width="13%" align="right"> | ||
1815 | 118 | ${ formatLang(b['tot_prac'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) } | ||
1816 | 119 | </td> | ||
1817 | 120 | <td width="10%" align="right"> | ||
1818 | 121 | ${ formatLang(b['tot_perc'], digits=2) }% | ||
1819 | 122 | </td> | ||
1820 | 123 | </tr> | ||
1821 | 124 | </table> | ||
1822 | 125 | %endfor | ||
1823 | 126 | <p style="page-break-after:always"> | ||
1824 | 127 | </p> | ||
1825 | 128 | |||
1826 | 129 | %endfor | ||
1827 | 130 | </body> | ||
1828 | 131 | </html> | ||
1829 | 0 | \ No newline at end of file | 132 | \ No newline at end of file |
1830 | 1 | 133 | ||
1831 | === added file 'account_budget_webkit/report/budget_report.py' | |||
1832 | --- account_budget_webkit/report/budget_report.py 1970-01-01 00:00:00 +0000 | |||
1833 | +++ account_budget_webkit/report/budget_report.py 2013-10-10 09:47:29 +0000 | |||
1834 | @@ -0,0 +1,192 @@ | |||
1835 | 1 | # -*- coding: utf-8 -*- | ||
1836 | 2 | ############################################################################## | ||
1837 | 3 | # | ||
1838 | 4 | # OpenERP, Open Source Management Solution | ||
1839 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
1840 | 6 | # | ||
1841 | 7 | # This program is free software: you can redistribute it and/or modify | ||
1842 | 8 | # it under the terms of the GNU Affero General Public License as | ||
1843 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
1844 | 10 | # License, or (at your option) any later version. | ||
1845 | 11 | # | ||
1846 | 12 | # This program is distributed in the hope that it will be useful, | ||
1847 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1848 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1849 | 15 | # GNU Affero General Public License for more details. | ||
1850 | 16 | # | ||
1851 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
1852 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1853 | 19 | # | ||
1854 | 20 | ############################################################################ | ||
1855 | 21 | |||
1856 | 22 | import time | ||
1857 | 23 | from openerp.report import report_sxw | ||
1858 | 24 | |||
1859 | 25 | tot = {} | ||
1860 | 26 | |||
1861 | 27 | class budget_report(report_sxw.rml_parse): | ||
1862 | 28 | def __init__(self, cr, uid, name, context): | ||
1863 | 29 | super(budget_report, self).__init__(cr, uid, name, context=context) | ||
1864 | 30 | self.localcontext.update({ | ||
1865 | 31 | 'funct': self.funct, | ||
1866 | 32 | 'funct_total': self.funct_total, | ||
1867 | 33 | 'time': time, | ||
1868 | 34 | }) | ||
1869 | 35 | self.context = context | ||
1870 | 36 | |||
1871 | 37 | def funct(self, object, form, ids=None, done=None, level=1): | ||
1872 | 38 | if ids is None: | ||
1873 | 39 | ids = {} | ||
1874 | 40 | if not ids: | ||
1875 | 41 | ids = self.ids | ||
1876 | 42 | if not done: | ||
1877 | 43 | done = {} | ||
1878 | 44 | global tot | ||
1879 | 45 | tot = { | ||
1880 | 46 | 'theo':0.00, | ||
1881 | 47 | 'pln':0.00, | ||
1882 | 48 | 'prac':0.00, | ||
1883 | 49 | 'perc':0.00 | ||
1884 | 50 | } | ||
1885 | 51 | result = [] | ||
1886 | 52 | |||
1887 | 53 | budgets = self.pool.get('account.budget.post').browse(self.cr, self.uid, [object.id], self.context.copy()) | ||
1888 | 54 | c_b_lines_obj = self.pool.get('crossovered.budget.lines') | ||
1889 | 55 | acc_analytic_obj = self.pool.get('account.analytic.account') | ||
1890 | 56 | for budget_id in budgets: | ||
1891 | 57 | res = {} | ||
1892 | 58 | budget_ids = [] | ||
1893 | 59 | d_from = form['date_from'] | ||
1894 | 60 | d_to = form['date_to'] | ||
1895 | 61 | |||
1896 | 62 | for line in budget_id.crossovered_budget_line: | ||
1897 | 63 | budget_ids.append(line.id) | ||
1898 | 64 | |||
1899 | 65 | if not budget_ids: | ||
1900 | 66 | return [] | ||
1901 | 67 | self.cr.execute('SELECT DISTINCT(analytic_account_id) FROM crossovered_budget_lines WHERE id = ANY(%s)',(budget_ids,)) | ||
1902 | 68 | an_ids = self.cr.fetchall() | ||
1903 | 69 | |||
1904 | 70 | context = {'wizard_date_from': d_from, 'wizard_date_to': d_to} | ||
1905 | 71 | for i in range(0, len(an_ids)): | ||
1906 | 72 | if not an_ids[i][0]: | ||
1907 | 73 | continue | ||
1908 | 74 | analytic_name = acc_analytic_obj.browse(self.cr, self.uid, [an_ids[i][0]]) | ||
1909 | 75 | res={ | ||
1910 | 76 | 'b_id': '-1', | ||
1911 | 77 | 'a_id': '-1', | ||
1912 | 78 | 'name': analytic_name[0].name, | ||
1913 | 79 | 'status': 1, | ||
1914 | 80 | 'theo': 0.00, | ||
1915 | 81 | 'pln': 0.00, | ||
1916 | 82 | 'prac': 0.00, | ||
1917 | 83 | 'perc': 0.00 | ||
1918 | 84 | } | ||
1919 | 85 | result.append(res) | ||
1920 | 86 | |||
1921 | 87 | line_ids = c_b_lines_obj.search(self.cr, self.uid, [('id', 'in', budget_ids), ('analytic_account_id','=',an_ids[i][0])]) | ||
1922 | 88 | line_id = c_b_lines_obj.browse(self.cr, self.uid, line_ids) | ||
1923 | 89 | tot_theo = tot_pln = tot_prac = tot_perc = 0.00 | ||
1924 | 90 | |||
1925 | 91 | done_budget = [] | ||
1926 | 92 | for line in line_id: | ||
1927 | 93 | if line.id in budget_ids: | ||
1928 | 94 | theo = pract = 0.00 | ||
1929 | 95 | theo = c_b_lines_obj._theo_amt(self.cr, self.uid, [line.id], context)[line.id] | ||
1930 | 96 | pract = c_b_lines_obj._prac_amt(self.cr, self.uid, [line.id], context)[line.id] | ||
1931 | 97 | if line.general_budget_id.id in done_budget: | ||
1932 | 98 | for record in result: | ||
1933 | 99 | if record['b_id'] == line.general_budget_id.id and record['a_id'] == line.analytic_account_id.id: | ||
1934 | 100 | record['theo'] += theo | ||
1935 | 101 | record['pln'] += line.planned_amount | ||
1936 | 102 | record['prac'] += pract | ||
1937 | 103 | if record['theo'] <> 0.00: | ||
1938 | 104 | perc = (record['prac'] / record['theo']) * 100 | ||
1939 | 105 | else: | ||
1940 | 106 | perc = 0.00 | ||
1941 | 107 | record['perc'] = perc | ||
1942 | 108 | tot_theo += theo | ||
1943 | 109 | tot_pln += line.planned_amount | ||
1944 | 110 | tot_prac += pract | ||
1945 | 111 | tot_perc += perc | ||
1946 | 112 | else: | ||
1947 | 113 | if theo <> 0.00: | ||
1948 | 114 | perc = (pract / theo) * 100 | ||
1949 | 115 | else: | ||
1950 | 116 | perc = 0.00 | ||
1951 | 117 | res1 = { | ||
1952 | 118 | 'a_id': line.analytic_account_id.id, | ||
1953 | 119 | 'b_id': line.general_budget_id.id, | ||
1954 | 120 | 'name': line.general_budget_id.name, | ||
1955 | 121 | 'status': 2, | ||
1956 | 122 | 'theo': theo, | ||
1957 | 123 | 'pln': line.planned_amount, | ||
1958 | 124 | 'prac': pract, | ||
1959 | 125 | 'perc': perc, | ||
1960 | 126 | } | ||
1961 | 127 | tot_theo += theo | ||
1962 | 128 | tot_pln += line.planned_amount | ||
1963 | 129 | tot_prac += pract | ||
1964 | 130 | tot_perc += perc | ||
1965 | 131 | if form['report'] == 'analytic-full': | ||
1966 | 132 | result.append(res1) | ||
1967 | 133 | done_budget.append(line.general_budget_id.id) | ||
1968 | 134 | else: | ||
1969 | 135 | |||
1970 | 136 | if line.general_budget_id.id in done_budget: | ||
1971 | 137 | continue | ||
1972 | 138 | else: | ||
1973 | 139 | res1={ | ||
1974 | 140 | 'a_id': line.analytic_account_id.id, | ||
1975 | 141 | 'b_id': line.general_budget_id.id, | ||
1976 | 142 | 'name': line.general_budget_id.name, | ||
1977 | 143 | 'status': 2, | ||
1978 | 144 | 'theo': 0.00, | ||
1979 | 145 | 'pln': 0.00, | ||
1980 | 146 | 'prac': 0.00, | ||
1981 | 147 | 'perc': 0.00 | ||
1982 | 148 | } | ||
1983 | 149 | if form['report'] == 'analytic-full': | ||
1984 | 150 | result.append(res1) | ||
1985 | 151 | done_budget.append(line.general_budget_id.id) | ||
1986 | 152 | if tot_theo == 0.00: | ||
1987 | 153 | tot_perc = 0.00 | ||
1988 | 154 | else: | ||
1989 | 155 | tot_perc = float(tot_prac / tot_theo) * 100 | ||
1990 | 156 | if form['report'] == 'analytic-full': | ||
1991 | 157 | result[-(len(done_budget) +1)]['theo'] = tot_theo | ||
1992 | 158 | tot['theo'] += tot_theo | ||
1993 | 159 | result[-(len(done_budget) +1)]['pln'] = tot_pln | ||
1994 | 160 | tot['pln'] += tot_pln | ||
1995 | 161 | result[-(len(done_budget) +1)]['prac'] = tot_prac | ||
1996 | 162 | tot['prac'] += tot_prac | ||
1997 | 163 | result[-(len(done_budget) +1)]['perc'] = tot_perc | ||
1998 | 164 | else: | ||
1999 | 165 | result[-1]['theo'] = tot_theo | ||
2000 | 166 | tot['theo'] += tot_theo | ||
2001 | 167 | result[-1]['pln'] = tot_pln | ||
2002 | 168 | tot['pln'] += tot_pln | ||
2003 | 169 | result[-1]['prac'] = tot_prac | ||
2004 | 170 | tot['prac'] += tot_prac | ||
2005 | 171 | result[-1]['perc'] = tot_perc | ||
2006 | 172 | if tot['theo'] == 0.00: | ||
2007 | 173 | tot['perc'] = 0.00 | ||
2008 | 174 | else: | ||
2009 | 175 | tot['perc'] = float(tot['prac'] / tot['theo']) * 100 | ||
2010 | 176 | return result | ||
2011 | 177 | |||
2012 | 178 | def funct_total(self, form): | ||
2013 | 179 | result = [] | ||
2014 | 180 | res = {} | ||
2015 | 181 | res = { | ||
2016 | 182 | 'tot_theo': tot['theo'], | ||
2017 | 183 | 'tot_pln': tot['pln'], | ||
2018 | 184 | 'tot_prac': tot['prac'], | ||
2019 | 185 | 'tot_perc': tot['perc'] | ||
2020 | 186 | } | ||
2021 | 187 | result.append(res) | ||
2022 | 188 | return result | ||
2023 | 189 | |||
2024 | 190 | report_sxw.report_sxw('report.account.budget.webkit', 'account.budget.post', 'account_budget_webkit/report/budget_report.mako', parser=budget_report, header='internal') | ||
2025 | 191 | |||
2026 | 192 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2027 | 0 | 193 | ||
2028 | === added file 'account_budget_webkit/report/crossovered_budget_report.mako' | |||
2029 | --- account_budget_webkit/report/crossovered_budget_report.mako 1970-01-01 00:00:00 +0000 | |||
2030 | +++ account_budget_webkit/report/crossovered_budget_report.mako 2013-10-10 09:47:29 +0000 | |||
2031 | @@ -0,0 +1,128 @@ | |||
2032 | 1 | <html> | ||
2033 | 2 | <head> | ||
2034 | 3 | <style type="text/css"> | ||
2035 | 4 | ${css} | ||
2036 | 5 | </style> | ||
2037 | 6 | </head> | ||
2038 | 7 | <body> | ||
2039 | 8 | </br> | ||
2040 | 9 | </br> | ||
2041 | 10 | </br> | ||
2042 | 11 | %for o in objects: | ||
2043 | 12 | <br/> | ||
2044 | 13 | <table width="100%"> | ||
2045 | 14 | <tr> | ||
2046 | 15 | <td align="center"> | ||
2047 | 16 | <h4> | ||
2048 | 17 | <b> Budget </b></h4> | ||
2049 | 18 | </td> | ||
2050 | 19 | </tr> | ||
2051 | 20 | </table> | ||
2052 | 21 | <br/> | ||
2053 | 22 | <table width="100%" class="basic_table"> | ||
2054 | 23 | <tr> | ||
2055 | 24 | <td> | ||
2056 | 25 | ${_('Analysis from')} | ||
2057 | 26 | </td> | ||
2058 | 27 | <td> | ||
2059 | 28 | ${_('Budget')} | ||
2060 | 29 | </td> | ||
2061 | 30 | <td> | ||
2062 | 31 | ${_('Currency')} | ||
2063 | 32 | </td> | ||
2064 | 33 | </tr> | ||
2065 | 34 | <tr> | ||
2066 | 35 | <td> | ||
2067 | 36 | ${ formatLang(data['form']['date_from'],date=True) } to ${ formatLang(data['form']['date_to'],date=True) } | ||
2068 | 37 | </td> | ||
2069 | 38 | <td> | ||
2070 | 39 | ${ o.name } | ||
2071 | 40 | </td> | ||
2072 | 41 | <td> | ||
2073 | 42 | ${ company.currency_id.name } | ||
2074 | 43 | </td> | ||
2075 | 44 | </tr> | ||
2076 | 45 | </table> | ||
2077 | 46 | <br/> | ||
2078 | 47 | <br/> | ||
2079 | 48 | <table width="100%" class="list_table"> | ||
2080 | 49 | |||
2081 | 50 | <tr > | ||
2082 | 51 | <td width="40%" > | ||
2083 | 52 | <b> | ||
2084 | 53 | ${_('Description')} | ||
2085 | 54 | </b> | ||
2086 | 55 | </td> | ||
2087 | 56 | <td width="15%" align="right"> | ||
2088 | 57 | <b> | ||
2089 | 58 | ${_('Theoretical Amt')} | ||
2090 | 59 | </b> | ||
2091 | 60 | </td> | ||
2092 | 61 | <td width="12%" align="right"> | ||
2093 | 62 | <b> | ||
2094 | 63 | ${_('Planned Amt')} | ||
2095 | 64 | </b> | ||
2096 | 65 | </td> | ||
2097 | 66 | <td width="13%" align="right"> | ||
2098 | 67 | <b> | ||
2099 | 68 | ${_('Practical Amt')} | ||
2100 | 69 | </b> | ||
2101 | 70 | </td> | ||
2102 | 71 | <td width="10%" align="right"> | ||
2103 | 72 | <b> | ||
2104 | 73 | ${_('Perc(%)')} | ||
2105 | 74 | </b> | ||
2106 | 75 | </td> | ||
2107 | 76 | </tr> | ||
2108 | 77 | </table> | ||
2109 | 78 | %for a in funct(o,data['form']): | ||
2110 | 79 | <table width="100%" style="border-bottom: 1px solid #ccc !important;text-align:left;font-size:12;"> | ||
2111 | 80 | <tr> | ||
2112 | 81 | <td width="40%"> | ||
2113 | 82 | %if a['status'] == 1 : | ||
2114 | 83 | ${a['name']} | ||
2115 | 84 | %endif | ||
2116 | 85 | %if a['status'] == 2: | ||
2117 | 86 | <p style="padding-left:12px;">${a['name']} </p> | ||
2118 | 87 | %endif | ||
2119 | 88 | </td> | ||
2120 | 89 | <td align="right" width="15%"> | ||
2121 | 90 | ${formatLang(a['theo'], digits=get_digits(dp='Account'), currency_obj=company.currency_id)} | ||
2122 | 91 | </td> | ||
2123 | 92 | <td align="right" width="12%"> | ||
2124 | 93 | ${formatLang(a['pln'], digits=get_digits(dp='Account'), currency_obj=company.currency_id)} | ||
2125 | 94 | </td> | ||
2126 | 95 | <td align="right" width="13%"> | ||
2127 | 96 | ${formatLang(a['prac'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) } | ||
2128 | 97 | </td> | ||
2129 | 98 | <td width="10%" align="right"> | ||
2130 | 99 | ${formatLang(a['perc'], digits=2) } | ||
2131 | 100 | </td> | ||
2132 | 101 | </tr> | ||
2133 | 102 | </table> | ||
2134 | 103 | %endfor | ||
2135 | 104 | %for b in funct_total(data['form']): | ||
2136 | 105 | <table width="100%" class="top"> | ||
2137 | 106 | <tr> | ||
2138 | 107 | <td width="40%"> | ||
2139 | 108 | Total: | ||
2140 | 109 | </td> | ||
2141 | 110 | <td width="15%" align="right"> | ||
2142 | 111 | ${ formatLang(b['tot_theo'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) } | ||
2143 | 112 | </td> | ||
2144 | 113 | <td width="12%" align="right"> | ||
2145 | 114 | ${ formatLang(b['tot_pln'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) } | ||
2146 | 115 | </td> | ||
2147 | 116 | <td width="13%" align="right"> | ||
2148 | 117 | ${ formatLang(b['tot_prac'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) } | ||
2149 | 118 | </td> | ||
2150 | 119 | <td width="10%" align="right"> | ||
2151 | 120 | ${ formatLang(b['tot_perc'], digits=2) }% | ||
2152 | 121 | </td> | ||
2153 | 122 | </tr> | ||
2154 | 123 | </table> | ||
2155 | 124 | %endfor | ||
2156 | 125 | <p style="page-break-after:always"> | ||
2157 | 126 | </p> | ||
2158 | 127 | %endfor | ||
2159 | 128 | </body> | ||
2160 | 0 | \ No newline at end of file | 129 | \ No newline at end of file |
2161 | 1 | 130 | ||
2162 | === added file 'account_budget_webkit/report/crossovered_budget_report.py' | |||
2163 | --- account_budget_webkit/report/crossovered_budget_report.py 1970-01-01 00:00:00 +0000 | |||
2164 | +++ account_budget_webkit/report/crossovered_budget_report.py 2013-10-10 09:47:29 +0000 | |||
2165 | @@ -0,0 +1,197 @@ | |||
2166 | 1 | # -*- coding: utf-8 -*- | ||
2167 | 2 | ############################################################################## | ||
2168 | 3 | # | ||
2169 | 4 | # OpenERP, Open Source Management Solution | ||
2170 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2171 | 6 | # | ||
2172 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2173 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2174 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2175 | 10 | # License, or (at your option) any later version. | ||
2176 | 11 | # | ||
2177 | 12 | # This program is distributed in the hope that it will be useful, | ||
2178 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2179 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2180 | 15 | # GNU Affero General Public License for more details. | ||
2181 | 16 | # | ||
2182 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2183 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2184 | 19 | # | ||
2185 | 20 | ############################################################################ | ||
2186 | 21 | import time | ||
2187 | 22 | import datetime | ||
2188 | 23 | |||
2189 | 24 | from openerp import pooler | ||
2190 | 25 | from openerp.report import report_sxw | ||
2191 | 26 | import operator | ||
2192 | 27 | from openerp import osv | ||
2193 | 28 | |||
2194 | 29 | class budget_report(report_sxw.rml_parse): | ||
2195 | 30 | def __init__(self, cr, uid, name, context): | ||
2196 | 31 | super(budget_report, self).__init__(cr, uid, name, context=context) | ||
2197 | 32 | self.localcontext.update({ | ||
2198 | 33 | 'funct': self.funct, | ||
2199 | 34 | 'funct_total': self.funct_total, | ||
2200 | 35 | 'time': time, | ||
2201 | 36 | }) | ||
2202 | 37 | self.context = context | ||
2203 | 38 | |||
2204 | 39 | def funct(self, object, form, ids=None, done=None, level=1): | ||
2205 | 40 | if ids is None: | ||
2206 | 41 | ids = {} | ||
2207 | 42 | if not ids: | ||
2208 | 43 | ids = self.ids | ||
2209 | 44 | if not done: | ||
2210 | 45 | done = {} | ||
2211 | 46 | global tot | ||
2212 | 47 | tot = { | ||
2213 | 48 | 'theo':0.00, | ||
2214 | 49 | 'pln':0.00, | ||
2215 | 50 | 'prac':0.00, | ||
2216 | 51 | 'perc':0.00 | ||
2217 | 52 | } | ||
2218 | 53 | result = [] | ||
2219 | 54 | |||
2220 | 55 | budgets = self.pool.get('crossovered.budget').browse(self.cr, self.uid, [object.id], self.context.copy()) | ||
2221 | 56 | c_b_lines_obj = self.pool.get('crossovered.budget.lines') | ||
2222 | 57 | acc_analytic_obj = self.pool.get('account.analytic.account') | ||
2223 | 58 | for budget_id in budgets: | ||
2224 | 59 | res = {} | ||
2225 | 60 | budget_lines = [] | ||
2226 | 61 | budget_ids = [] | ||
2227 | 62 | d_from = form['date_from'] | ||
2228 | 63 | d_to = form['date_to'] | ||
2229 | 64 | |||
2230 | 65 | for line in budget_id.crossovered_budget_line: | ||
2231 | 66 | budget_ids.append(line.id) | ||
2232 | 67 | |||
2233 | 68 | if not budget_ids: | ||
2234 | 69 | return [] | ||
2235 | 70 | |||
2236 | 71 | self.cr.execute('SELECT DISTINCT(analytic_account_id) FROM crossovered_budget_lines WHERE id = ANY(%s)',(budget_ids,)) | ||
2237 | 72 | an_ids = self.cr.fetchall() | ||
2238 | 73 | |||
2239 | 74 | context = {'wizard_date_from': d_from, 'wizard_date_to': d_to} | ||
2240 | 75 | for i in range(0, len(an_ids)): | ||
2241 | 76 | if not an_ids[i][0]: | ||
2242 | 77 | continue | ||
2243 | 78 | analytic_name = acc_analytic_obj.browse(self.cr, self.uid, [an_ids[i][0]]) | ||
2244 | 79 | res={ | ||
2245 | 80 | 'b_id': '-1', | ||
2246 | 81 | 'a_id': '-1', | ||
2247 | 82 | 'name': analytic_name[0].name, | ||
2248 | 83 | 'status': 1, | ||
2249 | 84 | 'theo': 0.00, | ||
2250 | 85 | 'pln': 0.00, | ||
2251 | 86 | 'prac': 0.00, | ||
2252 | 87 | 'perc': 0.00 | ||
2253 | 88 | } | ||
2254 | 89 | result.append(res) | ||
2255 | 90 | |||
2256 | 91 | line_ids = c_b_lines_obj.search(self.cr, self.uid, [('id', 'in', budget_ids), ('analytic_account_id','=',an_ids[i][0])]) | ||
2257 | 92 | line_id = c_b_lines_obj.browse(self.cr, self.uid, line_ids) | ||
2258 | 93 | tot_theo = tot_pln = tot_prac = tot_perc = 0.00 | ||
2259 | 94 | |||
2260 | 95 | done_budget = [] | ||
2261 | 96 | for line in line_id: | ||
2262 | 97 | if line.id in budget_ids: | ||
2263 | 98 | theo = pract = 0.00 | ||
2264 | 99 | theo = c_b_lines_obj._theo_amt(self.cr, self.uid, [line.id], context)[line.id] | ||
2265 | 100 | pract = c_b_lines_obj._prac_amt(self.cr, self.uid, [line.id], context)[line.id] | ||
2266 | 101 | if line.general_budget_id.id in done_budget: | ||
2267 | 102 | for record in result: | ||
2268 | 103 | if record['b_id'] == line.general_budget_id.id and record['a_id'] == line.analytic_account_id.id: | ||
2269 | 104 | record['theo'] += theo | ||
2270 | 105 | record['pln'] += line.planned_amount | ||
2271 | 106 | record['prac'] += pract | ||
2272 | 107 | if record['theo'] <> 0.00: | ||
2273 | 108 | perc = (record['prac'] / record['theo']) * 100 | ||
2274 | 109 | else: | ||
2275 | 110 | perc = 0.00 | ||
2276 | 111 | record['perc'] = perc | ||
2277 | 112 | tot_theo += theo | ||
2278 | 113 | tot_pln += line.planned_amount | ||
2279 | 114 | tot_prac += pract | ||
2280 | 115 | tot_perc += perc | ||
2281 | 116 | else: | ||
2282 | 117 | if theo <> 0.00: | ||
2283 | 118 | perc = (pract / theo) * 100 | ||
2284 | 119 | else: | ||
2285 | 120 | perc = 0.00 | ||
2286 | 121 | res1 = { | ||
2287 | 122 | 'a_id': line.analytic_account_id.id, | ||
2288 | 123 | 'b_id': line.general_budget_id.id, | ||
2289 | 124 | 'name': line.general_budget_id.name, | ||
2290 | 125 | 'status': 2, | ||
2291 | 126 | 'theo': theo, | ||
2292 | 127 | 'pln': line.planned_amount, | ||
2293 | 128 | 'prac': pract, | ||
2294 | 129 | 'perc': perc, | ||
2295 | 130 | } | ||
2296 | 131 | tot_theo += theo | ||
2297 | 132 | tot_pln += line.planned_amount | ||
2298 | 133 | tot_prac += pract | ||
2299 | 134 | tot_perc += perc | ||
2300 | 135 | if form['report'] == 'analytic-full': | ||
2301 | 136 | result.append(res1) | ||
2302 | 137 | done_budget.append(line.general_budget_id.id) | ||
2303 | 138 | else: | ||
2304 | 139 | |||
2305 | 140 | if line.general_budget_id.id in done_budget: | ||
2306 | 141 | continue | ||
2307 | 142 | else: | ||
2308 | 143 | res1={ | ||
2309 | 144 | 'a_id': line.analytic_account_id.id, | ||
2310 | 145 | 'b_id': line.general_budget_id.id, | ||
2311 | 146 | 'name': line.general_budget_id.name, | ||
2312 | 147 | 'status': 2, | ||
2313 | 148 | 'theo': 0.00, | ||
2314 | 149 | 'pln': 0.00, | ||
2315 | 150 | 'prac': 0.00, | ||
2316 | 151 | 'perc': 0.00 | ||
2317 | 152 | } | ||
2318 | 153 | if form['report'] == 'analytic-full': | ||
2319 | 154 | result.append(res1) | ||
2320 | 155 | done_budget.append(line.general_budget_id.id) | ||
2321 | 156 | if tot_theo == 0.00: | ||
2322 | 157 | tot_perc = 0.00 | ||
2323 | 158 | else: | ||
2324 | 159 | tot_perc = float(tot_prac / tot_theo) * 100 | ||
2325 | 160 | if form['report'] == 'analytic-full': | ||
2326 | 161 | result[-(len(done_budget) +1)]['theo'] = tot_theo | ||
2327 | 162 | tot['theo'] += tot_theo | ||
2328 | 163 | result[-(len(done_budget) +1)]['pln'] = tot_pln | ||
2329 | 164 | tot['pln'] += tot_pln | ||
2330 | 165 | result[-(len(done_budget) +1)]['prac'] = tot_prac | ||
2331 | 166 | tot['prac'] += tot_prac | ||
2332 | 167 | result[-(len(done_budget) +1)]['perc'] = tot_perc | ||
2333 | 168 | else: | ||
2334 | 169 | result[-1]['theo'] = tot_theo | ||
2335 | 170 | tot['theo'] += tot_theo | ||
2336 | 171 | result[-1]['pln'] = tot_pln | ||
2337 | 172 | tot['pln'] += tot_pln | ||
2338 | 173 | result[-1]['prac'] = tot_prac | ||
2339 | 174 | tot['prac'] += tot_prac | ||
2340 | 175 | result[-1]['perc'] = tot_perc | ||
2341 | 176 | if tot['theo'] == 0.00: | ||
2342 | 177 | tot['perc'] = 0.00 | ||
2343 | 178 | else: | ||
2344 | 179 | tot['perc'] = float(tot['prac'] / tot['theo']) * 100 | ||
2345 | 180 | return result | ||
2346 | 181 | |||
2347 | 182 | def funct_total(self, form): | ||
2348 | 183 | result = [] | ||
2349 | 184 | res = {} | ||
2350 | 185 | res = { | ||
2351 | 186 | 'tot_theo': tot['theo'], | ||
2352 | 187 | 'tot_pln': tot['pln'], | ||
2353 | 188 | 'tot_prac': tot['prac'], | ||
2354 | 189 | 'tot_perc': tot['perc'] | ||
2355 | 190 | } | ||
2356 | 191 | result.append(res) | ||
2357 | 192 | return result | ||
2358 | 193 | |||
2359 | 194 | report_sxw.report_sxw('report.crossovered.budget.report.webkit', 'crossovered.budget', 'account_budget_webkit/report/crossovered_budget_report.mako',parser=budget_report,header='internal') | ||
2360 | 195 | |||
2361 | 196 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2362 | 197 | |||
2363 | 0 | 198 | ||
2364 | === added directory 'account_budget_webkit/wizard' | |||
2365 | === added file 'account_budget_webkit/wizard/__init__.py' | |||
2366 | --- account_budget_webkit/wizard/__init__.py 1970-01-01 00:00:00 +0000 | |||
2367 | +++ account_budget_webkit/wizard/__init__.py 2013-10-10 09:47:29 +0000 | |||
2368 | @@ -0,0 +1,27 @@ | |||
2369 | 1 | # -*- coding: utf-8 -*- | ||
2370 | 2 | ############################################################################## | ||
2371 | 3 | # | ||
2372 | 4 | # OpenERP, Open Source Management Solution | ||
2373 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2374 | 6 | # | ||
2375 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2376 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2377 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2378 | 10 | # License, or (at your option) any later version. | ||
2379 | 11 | # | ||
2380 | 12 | # This program is distributed in the hope that it will be useful, | ||
2381 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2382 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2383 | 15 | # GNU Affero General Public License for more details. | ||
2384 | 16 | # | ||
2385 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2386 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2387 | 19 | # | ||
2388 | 20 | ############################################################################ | ||
2389 | 21 | |||
2390 | 22 | import account_budget_crossovered_report | ||
2391 | 23 | import account_budget_analytic | ||
2392 | 24 | import account_budget_crossovered_summary_report | ||
2393 | 25 | import account_budget_report | ||
2394 | 26 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2395 | 27 | |||
2396 | 0 | 28 | ||
2397 | === added file 'account_budget_webkit/wizard/account_budget_analytic.py' | |||
2398 | --- account_budget_webkit/wizard/account_budget_analytic.py 1970-01-01 00:00:00 +0000 | |||
2399 | +++ account_budget_webkit/wizard/account_budget_analytic.py 2013-10-10 09:47:29 +0000 | |||
2400 | @@ -0,0 +1,37 @@ | |||
2401 | 1 | # -*- coding: utf-8 -*- | ||
2402 | 2 | ############################################################################## | ||
2403 | 3 | # | ||
2404 | 4 | # OpenERP, Open Source Management Solution | ||
2405 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2406 | 6 | # | ||
2407 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2408 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2409 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2410 | 10 | # License, or (at your option) any later version. | ||
2411 | 11 | # | ||
2412 | 12 | # This program is distributed in the hope that it will be useful, | ||
2413 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2414 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2415 | 15 | # GNU Affero General Public License for more details. | ||
2416 | 16 | # | ||
2417 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2418 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2419 | 19 | # | ||
2420 | 20 | ############################################################################ | ||
2421 | 21 | import time | ||
2422 | 22 | |||
2423 | 23 | from openerp.osv import fields, osv | ||
2424 | 24 | |||
2425 | 25 | class account_budget_analytic(osv.osv_memory): | ||
2426 | 26 | |||
2427 | 27 | _inherit = "account.budget.analytic" | ||
2428 | 28 | |||
2429 | 29 | def check_report(self, cr, uid, ids, context=None): | ||
2430 | 30 | |||
2431 | 31 | res = super(account_budget_analytic,self).check_report( cr, uid, ids, context=context) | ||
2432 | 32 | res['report_name']= 'account.analytic.account.budget.webkit' | ||
2433 | 33 | return res | ||
2434 | 34 | |||
2435 | 35 | account_budget_analytic() | ||
2436 | 36 | |||
2437 | 37 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2438 | 0 | 38 | ||
2439 | === added file 'account_budget_webkit/wizard/account_budget_crossovered_report.py' | |||
2440 | --- account_budget_webkit/wizard/account_budget_crossovered_report.py 1970-01-01 00:00:00 +0000 | |||
2441 | +++ account_budget_webkit/wizard/account_budget_crossovered_report.py 2013-10-10 09:47:29 +0000 | |||
2442 | @@ -0,0 +1,37 @@ | |||
2443 | 1 | # -*- coding: utf-8 -*- | ||
2444 | 2 | ############################################################################## | ||
2445 | 3 | # | ||
2446 | 4 | # OpenERP, Open Source Management Solution | ||
2447 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2448 | 6 | # | ||
2449 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2450 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2451 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2452 | 10 | # License, or (at your option) any later version. | ||
2453 | 11 | # | ||
2454 | 12 | # This program is distributed in the hope that it will be useful, | ||
2455 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2456 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2457 | 15 | # GNU Affero General Public License for more details. | ||
2458 | 16 | # | ||
2459 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2460 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2461 | 19 | # | ||
2462 | 20 | ############################################################################ | ||
2463 | 21 | import time | ||
2464 | 22 | |||
2465 | 23 | from openerp.osv import fields, osv | ||
2466 | 24 | |||
2467 | 25 | class account_budget_crossvered_report(osv.osv_memory): | ||
2468 | 26 | |||
2469 | 27 | _inherit="account.budget.crossvered.report" | ||
2470 | 28 | |||
2471 | 29 | def check_report(self, cr, uid, ids, context=None): | ||
2472 | 30 | |||
2473 | 31 | res = super(account_budget_crossvered_report,self).check_report( cr, uid, ids, context=context) | ||
2474 | 32 | res['report_name']= 'crossovered.budget.report.webkit' | ||
2475 | 33 | return res | ||
2476 | 34 | |||
2477 | 35 | account_budget_crossvered_report() | ||
2478 | 36 | |||
2479 | 37 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2480 | 0 | 38 | ||
2481 | === added file 'account_budget_webkit/wizard/account_budget_crossovered_summary_report.py' | |||
2482 | --- account_budget_webkit/wizard/account_budget_crossovered_summary_report.py 1970-01-01 00:00:00 +0000 | |||
2483 | +++ account_budget_webkit/wizard/account_budget_crossovered_summary_report.py 2013-10-10 09:47:29 +0000 | |||
2484 | @@ -0,0 +1,40 @@ | |||
2485 | 1 | # -*- coding: utf-8 -*- | ||
2486 | 2 | ############################################################################## | ||
2487 | 3 | # | ||
2488 | 4 | # OpenERP, Open Source Management Solution | ||
2489 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2490 | 6 | # | ||
2491 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2492 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2493 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2494 | 10 | # License, or (at your option) any later version. | ||
2495 | 11 | # | ||
2496 | 12 | # This program is distributed in the hope that it will be useful, | ||
2497 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2498 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2499 | 15 | # GNU Affero General Public License for more details. | ||
2500 | 16 | # | ||
2501 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2502 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2503 | 19 | # | ||
2504 | 20 | ############################################################################ | ||
2505 | 21 | import time | ||
2506 | 22 | |||
2507 | 23 | from openerp.osv import fields, osv | ||
2508 | 24 | |||
2509 | 25 | class account_budget_crossvered_summary_report(osv.osv_memory): | ||
2510 | 26 | """ | ||
2511 | 27 | This wizard provides the crossovered budget summary report' | ||
2512 | 28 | """ | ||
2513 | 29 | _inherit = "account.budget.crossvered.summary.report" | ||
2514 | 30 | |||
2515 | 31 | def check_report(self, cr, uid, ids, context=None): | ||
2516 | 32 | |||
2517 | 33 | res = super(account_budget_crossvered_summary_report,self).check_report( cr, uid, ids, context=context) | ||
2518 | 34 | res['report_name']= 'crossovered.budget.report.webkit' | ||
2519 | 35 | return res | ||
2520 | 36 | |||
2521 | 37 | account_budget_crossvered_summary_report() | ||
2522 | 38 | |||
2523 | 39 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2524 | 40 | |||
2525 | 0 | 41 | ||
2526 | === added file 'account_budget_webkit/wizard/account_budget_report.py' | |||
2527 | --- account_budget_webkit/wizard/account_budget_report.py 1970-01-01 00:00:00 +0000 | |||
2528 | +++ account_budget_webkit/wizard/account_budget_report.py 2013-10-10 09:47:29 +0000 | |||
2529 | @@ -0,0 +1,38 @@ | |||
2530 | 1 | # -*- coding: utf-8 -*- | ||
2531 | 2 | ############################################################################## | ||
2532 | 3 | # | ||
2533 | 4 | # OpenERP, Open Source Management Solution | ||
2534 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2535 | 6 | # | ||
2536 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2537 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2538 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2539 | 10 | # License, or (at your option) any later version. | ||
2540 | 11 | # | ||
2541 | 12 | # This program is distributed in the hope that it will be useful, | ||
2542 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2543 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2544 | 15 | # GNU Affero General Public License for more details. | ||
2545 | 16 | # | ||
2546 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2547 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2548 | 19 | # | ||
2549 | 20 | ############################################################################ | ||
2550 | 21 | import time | ||
2551 | 22 | |||
2552 | 23 | from openerp.osv import fields, osv | ||
2553 | 24 | |||
2554 | 25 | |||
2555 | 26 | class account_budget_report(osv.osv_memory): | ||
2556 | 27 | _inherit = "account.budget.report" | ||
2557 | 28 | |||
2558 | 29 | def check_report(self, cr, uid, ids, context=None): | ||
2559 | 30 | |||
2560 | 31 | res = super(account_budget_report,self).check_report( cr, uid, ids, context=context) | ||
2561 | 32 | res['report_name']= 'account.budget.webkit' | ||
2562 | 33 | return res | ||
2563 | 34 | |||
2564 | 35 | |||
2565 | 36 | account_budget_report() | ||
2566 | 37 | |||
2567 | 38 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2568 | 0 | 39 | ||
2569 | === added directory 'account_test_webkit' | |||
2570 | === added file 'account_test_webkit/__init__.py' | |||
2571 | --- account_test_webkit/__init__.py 1970-01-01 00:00:00 +0000 | |||
2572 | +++ account_test_webkit/__init__.py 2013-10-10 09:47:29 +0000 | |||
2573 | @@ -0,0 +1,22 @@ | |||
2574 | 1 | # -*- coding: utf-8 -*- | ||
2575 | 2 | ############################################################################## | ||
2576 | 3 | # | ||
2577 | 4 | # OpenERP, Open Source Management Solution | ||
2578 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2579 | 6 | # | ||
2580 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2581 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2582 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2583 | 10 | # License, or (at your option) any later version. | ||
2584 | 11 | # | ||
2585 | 12 | # This program is distributed in the hope that it will be useful, | ||
2586 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2587 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2588 | 15 | # GNU Affero General Public License for more details. | ||
2589 | 16 | # | ||
2590 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2591 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2592 | 19 | # | ||
2593 | 20 | ############################################################################ | ||
2594 | 21 | |||
2595 | 22 | import report | ||
2596 | 0 | 23 | ||
2597 | === added file 'account_test_webkit/__openerp__.py' | |||
2598 | --- account_test_webkit/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
2599 | +++ account_test_webkit/__openerp__.py 2013-10-10 09:47:29 +0000 | |||
2600 | @@ -0,0 +1,41 @@ | |||
2601 | 1 | # -*- coding: utf-8 -*- | ||
2602 | 2 | ############################################################################## | ||
2603 | 3 | # | ||
2604 | 4 | # OpenERP, Open Source Management Solution | ||
2605 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2606 | 6 | # | ||
2607 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2608 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2609 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2610 | 10 | # License, or (at your option) any later version. | ||
2611 | 11 | # | ||
2612 | 12 | # This program is distributed in the hope that it will be useful, | ||
2613 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2614 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2615 | 15 | # GNU Affero General Public License for more details. | ||
2616 | 16 | # | ||
2617 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2618 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2619 | 19 | # | ||
2620 | 20 | ############################################################################ | ||
2621 | 21 | |||
2622 | 22 | { | ||
2623 | 23 | 'name' : 'Accounting Consistency Tests', | ||
2624 | 24 | 'version' : '1.0', | ||
2625 | 25 | 'author' : 'Serpent Consulting Services', | ||
2626 | 26 | 'category' : 'Accounting & Finance', | ||
2627 | 27 | 'website': 'http://www.serpentcs.com', | ||
2628 | 28 | 'description': """ | ||
2629 | 29 | Asserts on accounting. | ||
2630 | 30 | ====================== | ||
2631 | 31 | It is conversion of rml report to Webkit Report. | ||
2632 | 32 | |||
2633 | 33 | """, | ||
2634 | 34 | 'depends' : ['account_test','report_webkit'], | ||
2635 | 35 | 'data' : [ | ||
2636 | 36 | 'account_test_report.xml', | ||
2637 | 37 | ], | ||
2638 | 38 | 'active': False, | ||
2639 | 39 | 'installable': True | ||
2640 | 40 | } | ||
2641 | 41 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2642 | 0 | 42 | ||
2643 | === added file 'account_test_webkit/account_test_report.xml' | |||
2644 | --- account_test_webkit/account_test_report.xml 1970-01-01 00:00:00 +0000 | |||
2645 | +++ account_test_webkit/account_test_report.xml 2013-10-10 09:47:29 +0000 | |||
2646 | @@ -0,0 +1,26 @@ | |||
2647 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
2648 | 2 | <openerp> | ||
2649 | 3 | <data> | ||
2650 | 4 | <record id="account_test_header" model="ir.header_webkit"> | ||
2651 | 5 | <field name="footer_html"><![CDATA[]]></field> | ||
2652 | 6 | <field name="orientation">Portrait</field> | ||
2653 | 7 | <field name="format">A4</field> | ||
2654 | 8 | <field name="html"><![CDATA[]]> | ||
2655 | 9 | </field> | ||
2656 | 10 | <field eval="15.0" name="margin_top"/> | ||
2657 | 11 | <field eval="5.0" name="margin_bottom"/> | ||
2658 | 12 | <field name="css"><![CDATA[ ]]> | ||
2659 | 13 | </field> | ||
2660 | 14 | <field name="name">Account Test webkit header</field> | ||
2661 | 15 | </record> | ||
2662 | 16 | |||
2663 | 17 | <report | ||
2664 | 18 | id="account_assert_test_report" | ||
2665 | 19 | model="accounting.assert.test" | ||
2666 | 20 | name="account.test.assert.print.webkit" | ||
2667 | 21 | file="account_test_webkit/report/account_test.mako" | ||
2668 | 22 | webkit_header="account_test_header" | ||
2669 | 23 | report_type="webkit" | ||
2670 | 24 | string="Accounting Tests"/> | ||
2671 | 25 | </data> | ||
2672 | 26 | </openerp> | ||
2673 | 0 | 27 | ||
2674 | === added directory 'account_test_webkit/report' | |||
2675 | === added file 'account_test_webkit/report/__init__.py' | |||
2676 | --- account_test_webkit/report/__init__.py 1970-01-01 00:00:00 +0000 | |||
2677 | +++ account_test_webkit/report/__init__.py 2013-10-10 09:47:29 +0000 | |||
2678 | @@ -0,0 +1,24 @@ | |||
2679 | 1 | # -*- coding: utf-8 -*- | ||
2680 | 2 | ############################################################################## | ||
2681 | 3 | # | ||
2682 | 4 | # OpenERP, Open Source Management Solution | ||
2683 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2684 | 6 | # | ||
2685 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2686 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2687 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2688 | 10 | # License, or (at your option) any later version. | ||
2689 | 11 | # | ||
2690 | 12 | # This program is distributed in the hope that it will be useful, | ||
2691 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2692 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2693 | 15 | # GNU Affero General Public License for more details. | ||
2694 | 16 | # | ||
2695 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2696 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2697 | 19 | # | ||
2698 | 20 | ############################################################################ | ||
2699 | 21 | |||
2700 | 22 | import account_test_report | ||
2701 | 23 | |||
2702 | 24 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2703 | 0 | 25 | ||
2704 | === added file 'account_test_webkit/report/account_test.mako' | |||
2705 | --- account_test_webkit/report/account_test.mako 1970-01-01 00:00:00 +0000 | |||
2706 | +++ account_test_webkit/report/account_test.mako 2013-10-10 09:47:29 +0000 | |||
2707 | @@ -0,0 +1,53 @@ | |||
2708 | 1 | <html> | ||
2709 | 2 | <head> | ||
2710 | 3 | <style type="text/css"> | ||
2711 | 4 | .list_table2 { | ||
2712 | 5 | text-align:left; | ||
2713 | 6 | border-collapse: collapse; | ||
2714 | 7 | } | ||
2715 | 8 | .list_table2 td { | ||
2716 | 9 | border:1px solid black; | ||
2717 | 10 | border-collapse: collapse; | ||
2718 | 11 | font-family:"Times New Roman"; | ||
2719 | 12 | font-size:12px; | ||
2720 | 13 | padding: 5px 5px 5px 5px; | ||
2721 | 14 | } | ||
2722 | 15 | |||
2723 | 16 | </style> | ||
2724 | 17 | <title>Account_Test.pdf</title> | ||
2725 | 18 | </head> | ||
2726 | 19 | <body> | ||
2727 | 20 | <table width="100%" style="font-family: Times New Roman ;font-size:20px;"> | ||
2728 | 21 | <tr> | ||
2729 | 22 | <td align="center"> | ||
2730 | 23 | Accouting tests on ${ datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") } | ||
2731 | 24 | </td> | ||
2732 | 25 | </tr> | ||
2733 | 26 | </table> | ||
2734 | 27 | </br> | ||
2735 | 28 | %for o in objects: | ||
2736 | 29 | <table width="100%" class="list_table2"> | ||
2737 | 30 | <tr> | ||
2738 | 31 | <td> | ||
2739 | 32 | ${o.name} | ||
2740 | 33 | </td> | ||
2741 | 34 | </tr> | ||
2742 | 35 | <tr> | ||
2743 | 36 | <td> | ||
2744 | 37 | <i>${ o.desc or '' }</i> | ||
2745 | 38 | </td> | ||
2746 | 39 | </tr> | ||
2747 | 40 | </table> | ||
2748 | 41 | <table width="100%" style="font-family: Times New Roman;font-size:12px;"> | ||
2749 | 42 | %for test_result in execute_code(o.code_exec): | ||
2750 | 43 | <tr> | ||
2751 | 44 | <td> | ||
2752 | 45 | ${ test_result } | ||
2753 | 46 | </td> | ||
2754 | 47 | </tr> | ||
2755 | 48 | %endfor | ||
2756 | 49 | </table> | ||
2757 | 50 | </br> | ||
2758 | 51 | %endfor | ||
2759 | 52 | </body> | ||
2760 | 53 | </html> | ||
2761 | 0 | \ No newline at end of file | 54 | \ No newline at end of file |
2762 | 1 | 55 | ||
2763 | === added file 'account_test_webkit/report/account_test_report.py' | |||
2764 | --- account_test_webkit/report/account_test_report.py 1970-01-01 00:00:00 +0000 | |||
2765 | +++ account_test_webkit/report/account_test_report.py 2013-10-10 09:47:29 +0000 | |||
2766 | @@ -0,0 +1,88 @@ | |||
2767 | 1 | # -*- coding: utf-8 -*- | ||
2768 | 2 | ############################################################################## | ||
2769 | 3 | # | ||
2770 | 4 | # OpenERP, Open Source Management Solution | ||
2771 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2772 | 6 | # | ||
2773 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2774 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2775 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2776 | 10 | # License, or (at your option) any later version. | ||
2777 | 11 | # | ||
2778 | 12 | # This program is distributed in the hope that it will be useful, | ||
2779 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2780 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2781 | 15 | # GNU Affero General Public License for more details. | ||
2782 | 16 | # | ||
2783 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2784 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2785 | 19 | # | ||
2786 | 20 | ############################################################################ | ||
2787 | 21 | |||
2788 | 22 | |||
2789 | 23 | import datetime | ||
2790 | 24 | import time | ||
2791 | 25 | from report import report_sxw | ||
2792 | 26 | from openerp.tools.translate import _ | ||
2793 | 27 | # | ||
2794 | 28 | # Use period and Journal for selection or resources | ||
2795 | 29 | # | ||
2796 | 30 | class report_assert_account(report_sxw.rml_parse): | ||
2797 | 31 | def __init__(self, cr, uid, name, context): | ||
2798 | 32 | super(report_assert_account, self).__init__(cr, uid, name, context=context) | ||
2799 | 33 | self.localcontext.update( { | ||
2800 | 34 | 'time': time, | ||
2801 | 35 | 'datetime': datetime, | ||
2802 | 36 | 'execute_code': self.execute_code, | ||
2803 | 37 | }) | ||
2804 | 38 | |||
2805 | 39 | def execute_code(self, code_exec): | ||
2806 | 40 | def reconciled_inv(): | ||
2807 | 41 | """ | ||
2808 | 42 | returns the list of invoices that are set as reconciled = True | ||
2809 | 43 | """ | ||
2810 | 44 | return self.pool.get('account.invoice').search(self.cr, self.uid, [('reconciled','=',True)]) | ||
2811 | 45 | |||
2812 | 46 | def order_columns(item, cols=None): | ||
2813 | 47 | """ | ||
2814 | 48 | This function is used to display a dictionary as a string, with its columns in the order chosen. | ||
2815 | 49 | |||
2816 | 50 | :param item: dict | ||
2817 | 51 | :param cols: list of field names | ||
2818 | 52 | :returns: a list of tuples (fieldname: value) in a similar way that would dict.items() do except that the | ||
2819 | 53 | returned values are following the order given by cols | ||
2820 | 54 | :rtype: [(key, value)] | ||
2821 | 55 | """ | ||
2822 | 56 | if cols is None: | ||
2823 | 57 | cols = item.keys() | ||
2824 | 58 | return [(col, item.get(col)) for col in cols if col in item.keys()] | ||
2825 | 59 | |||
2826 | 60 | localdict = { | ||
2827 | 61 | 'cr': self.cr, | ||
2828 | 62 | 'uid': self.uid, | ||
2829 | 63 | 'reconciled_inv': reconciled_inv, #specific function used in different tests | ||
2830 | 64 | 'result': None, #used to store the result of the test | ||
2831 | 65 | 'column_order': None, #used to choose the display order of columns (in case you are returning a list of dict) | ||
2832 | 66 | } | ||
2833 | 67 | exec code_exec in localdict | ||
2834 | 68 | result = localdict['result'] | ||
2835 | 69 | column_order = localdict.get('column_order', None) | ||
2836 | 70 | |||
2837 | 71 | if not isinstance(result, (tuple, list, set)): | ||
2838 | 72 | result = [result] | ||
2839 | 73 | if not result: | ||
2840 | 74 | result = [_('The test was passed successfully')] | ||
2841 | 75 | else: | ||
2842 | 76 | def _format(item): | ||
2843 | 77 | if isinstance(item, dict): | ||
2844 | 78 | return ', '.join(["%s: %s" % (tup[0], tup[1]) for tup in order_columns(item, column_order)]) | ||
2845 | 79 | else: | ||
2846 | 80 | return item | ||
2847 | 81 | result = [_(_format(rec)) for rec in result] | ||
2848 | 82 | |||
2849 | 83 | return result | ||
2850 | 84 | |||
2851 | 85 | report_sxw.report_sxw('report.account.test.assert.print.webkit', 'accounting.assert.test', 'addons/account_test_webkit/report/account_test.mako', parser=report_assert_account, header=False) | ||
2852 | 86 | |||
2853 | 87 | |||
2854 | 88 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2855 | 0 | 89 | ||
2856 | === added directory 'account_voucher_webkit' | |||
2857 | === added file 'account_voucher_webkit/__init__.py' | |||
2858 | --- account_voucher_webkit/__init__.py 1970-01-01 00:00:00 +0000 | |||
2859 | +++ account_voucher_webkit/__init__.py 2013-10-10 09:47:29 +0000 | |||
2860 | @@ -0,0 +1,25 @@ | |||
2861 | 1 | # -*- coding: utf-8 -*- | ||
2862 | 2 | ############################################################################## | ||
2863 | 3 | # | ||
2864 | 4 | # OpenERP, Open Source Management Solution | ||
2865 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2866 | 6 | # | ||
2867 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2868 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2869 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2870 | 10 | # License, or (at your option) any later version. | ||
2871 | 11 | # | ||
2872 | 12 | # This program is distributed in the hope that it will be useful, | ||
2873 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2874 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2875 | 15 | # GNU Affero General Public License for more details. | ||
2876 | 16 | # | ||
2877 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2878 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2879 | 19 | # | ||
2880 | 20 | |||
2881 | 21 | ############################################################################## | ||
2882 | 22 | |||
2883 | 23 | import report | ||
2884 | 24 | |||
2885 | 25 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2886 | 0 | 26 | ||
2887 | === added file 'account_voucher_webkit/__openerp__.py' | |||
2888 | --- account_voucher_webkit/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
2889 | +++ account_voucher_webkit/__openerp__.py 2013-10-10 09:47:29 +0000 | |||
2890 | @@ -0,0 +1,45 @@ | |||
2891 | 1 | # -*- coding: utf-8 -*- | ||
2892 | 2 | ############################################################################## | ||
2893 | 3 | # | ||
2894 | 4 | # OpenERP, Open Source Management Solution | ||
2895 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
2896 | 6 | # | ||
2897 | 7 | # This program is free software: you can redistribute it and/or modify | ||
2898 | 8 | # it under the terms of the GNU Affero General Public License as | ||
2899 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
2900 | 10 | # License, or (at your option) any later version. | ||
2901 | 11 | # | ||
2902 | 12 | # This program is distributed in the hope that it will be useful, | ||
2903 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
2904 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
2905 | 15 | # GNU Affero General Public License for more details. | ||
2906 | 16 | # | ||
2907 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
2908 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
2909 | 19 | # | ||
2910 | 20 | |||
2911 | 21 | ############################################################################## | ||
2912 | 22 | |||
2913 | 23 | { | ||
2914 | 24 | 'name' : 'eInvoicing & Payments', | ||
2915 | 25 | 'version' : '1.0', | ||
2916 | 26 | 'author' : 'Serpent Consulting Services', | ||
2917 | 27 | 'summary': 'Send Invoices and Track Payments', | ||
2918 | 28 | 'description': """ | ||
2919 | 29 | Invoicing & Payments by Accounting Voucher & Receipts | ||
2920 | 30 | ===================================================== | ||
2921 | 31 | It is conversion of rml report to Webkit Report. | ||
2922 | 32 | """, | ||
2923 | 33 | 'category': 'Accounting & Finance', | ||
2924 | 34 | 'sequence': 4, | ||
2925 | 35 | 'website' : 'http://serpentcs.com', | ||
2926 | 36 | 'depends' : ['account_voucher','report_webkit'], | ||
2927 | 37 | 'data' : [ | ||
2928 | 38 | 'account_voucher_report.xml', | ||
2929 | 39 | ], | ||
2930 | 40 | 'auto_install': False, | ||
2931 | 41 | 'application': True, | ||
2932 | 42 | 'installable': True, | ||
2933 | 43 | } | ||
2934 | 44 | |||
2935 | 45 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
2936 | 0 | 46 | ||
2937 | === added file 'account_voucher_webkit/account_voucher_report.xml' | |||
2938 | --- account_voucher_webkit/account_voucher_report.xml 1970-01-01 00:00:00 +0000 | |||
2939 | +++ account_voucher_webkit/account_voucher_report.xml 2013-10-10 09:47:29 +0000 | |||
2940 | @@ -0,0 +1,159 @@ | |||
2941 | 1 | <?xml version="1.0"?> | ||
2942 | 2 | <openerp> | ||
2943 | 3 | <data> | ||
2944 | 4 | <record id="voucher_header" model="ir.header_webkit"> | ||
2945 | 5 | <field name="footer_html"><![CDATA[ | ||
2946 | 6 | <html> | ||
2947 | 7 | <head> | ||
2948 | 8 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
2949 | 9 | <script> | ||
2950 | 10 | function subst() { | ||
2951 | 11 | var vars={}; | ||
2952 | 12 | var x=document.location.search.substring(1).split('&'); | ||
2953 | 13 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
2954 | 14 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
2955 | 15 | for(var i in x) { | ||
2956 | 16 | var y = document.getElementsByClassName(x[i]); | ||
2957 | 17 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
2958 | 18 | } | ||
2959 | 19 | } | ||
2960 | 20 | </script> | ||
2961 | 21 | <style type="text/css"> | ||
2962 | 22 | |||
2963 | 23 | ${css} | ||
2964 | 24 | </style> | ||
2965 | 25 | </head> | ||
2966 | 26 | <body style="border:0; margin: 0;" onload="subst()"> | ||
2967 | 27 | <table class="header" style="border-top: 1px solid black; width: 100%"> | ||
2968 | 28 | <tr > | ||
2969 | 29 | <td style="text-align:center;font-size:12;" >${ company.rml_footer }</td> | ||
2970 | 30 | </tr> | ||
2971 | 31 | <tr > | ||
2972 | 32 | <td style="text-align:center;font-size:12;" >Contact : ${ user.name }</td> | ||
2973 | 33 | </tr> | ||
2974 | 34 | </table> ${_debug or ''|n} </body> | ||
2975 | 35 | </html> | ||
2976 | 36 | ]]></field> | ||
2977 | 37 | <field name="orientation">Portrait</field> | ||
2978 | 38 | <field name="format">A4</field> | ||
2979 | 39 | <field name="html"><![CDATA[ | ||
2980 | 40 | <html> | ||
2981 | 41 | <head> | ||
2982 | 42 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
2983 | 43 | <script> | ||
2984 | 44 | function subst() { | ||
2985 | 45 | var vars={}; | ||
2986 | 46 | var x=document.location.search.substring(1).split('&'); | ||
2987 | 47 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
2988 | 48 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
2989 | 49 | for(var i in x) { | ||
2990 | 50 | var y = document.getElementsByClassName(x[i]); | ||
2991 | 51 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
2992 | 52 | } | ||
2993 | 53 | } | ||
2994 | 54 | </script> | ||
2995 | 55 | <style type="text/css"> | ||
2996 | 56 | |||
2997 | 57 | ${css} | ||
2998 | 58 | </style> | ||
2999 | 59 | </head> | ||
3000 | 60 | <body style="border:0; margin: 0;" onload="subst()"> | ||
3001 | 61 | |||
3002 | 62 | </html>]]> | ||
3003 | 63 | </field> | ||
3004 | 64 | <field eval="17.0" name="margin_top"/> | ||
3005 | 65 | <field eval="25.0" name="margin_bottom"/> | ||
3006 | 66 | <field name="css"><![CDATA[ | ||
3007 | 67 | |||
3008 | 68 | body, table, td, span, div { | ||
3009 | 69 | font-family: Helvetica; | ||
3010 | 70 | } | ||
3011 | 71 | |||
3012 | 72 | body { | ||
3013 | 73 | |||
3014 | 74 | font-size:9; | ||
3015 | 75 | |||
3016 | 76 | } | ||
3017 | 77 | |||
3018 | 78 | |||
3019 | 79 | .header { | ||
3020 | 80 | margin-left:0; | ||
3021 | 81 | text-align:left; | ||
3022 | 82 | width:300px; | ||
3023 | 83 | font-size:12; | ||
3024 | 84 | } | ||
3025 | 85 | .title { | ||
3026 | 86 | font-size:16px; | ||
3027 | 87 | width:100%; | ||
3028 | 88 | font-weight: bold; | ||
3029 | 89 | font-family: Helvetica; | ||
3030 | 90 | text-align:center; | ||
3031 | 91 | padding-bottom:20px; | ||
3032 | 92 | } | ||
3033 | 93 | |||
3034 | 94 | .tbl_header{ | ||
3035 | 95 | width:100%; | ||
3036 | 96 | font-size:12px; | ||
3037 | 97 | font-family: Helvetica; | ||
3038 | 98 | } | ||
3039 | 99 | .tbl_grey_line { | ||
3040 | 100 | width:100%; | ||
3041 | 101 | border:1px solid Grey; | ||
3042 | 102 | border-collapse: collapse; | ||
3043 | 103 | font-family: Helvetica; | ||
3044 | 104 | padding-bottom:20px; | ||
3045 | 105 | } | ||
3046 | 106 | .tbl_grey_line td{ | ||
3047 | 107 | border:1px solid Grey; | ||
3048 | 108 | font-size:11px; | ||
3049 | 109 | font-family: Helvetica; | ||
3050 | 110 | } | ||
3051 | 111 | .tbl_line{ | ||
3052 | 112 | width:100%; | ||
3053 | 113 | font-size:12px; | ||
3054 | 114 | font-family: Helvetica; | ||
3055 | 115 | font-weight: bold; | ||
3056 | 116 | border:1px solid grey; | ||
3057 | 117 | border-left:0px; | ||
3058 | 118 | border-right:0px; | ||
3059 | 119 | } | ||
3060 | 120 | |||
3061 | 121 | .font{ | ||
3062 | 122 | width:100%; | ||
3063 | 123 | font-size:12px; | ||
3064 | 124 | font-family:Helvetica; | ||
3065 | 125 | } | ||
3066 | 126 | .font tr{ | ||
3067 | 127 | padding-top:10px; | ||
3068 | 128 | } | ||
3069 | 129 | .font td{ | ||
3070 | 130 | padding-top:5px; | ||
3071 | 131 | } | ||
3072 | 132 | ]]> | ||
3073 | 133 | </field> | ||
3074 | 134 | <field name="name">Voucher Header</field> | ||
3075 | 135 | </record> | ||
3076 | 136 | |||
3077 | 137 | <report id="report_account_voucher" | ||
3078 | 138 | string="Voucher" | ||
3079 | 139 | model="account.voucher" | ||
3080 | 140 | name="voucher.cash_receipt.drcr.webkit" | ||
3081 | 141 | file="account_voucher_webkit/report/account_voucher.mako" | ||
3082 | 142 | auto="False" | ||
3083 | 143 | report_type="webkit" | ||
3084 | 144 | webkit_header="voucher_header" | ||
3085 | 145 | menu="True"/> | ||
3086 | 146 | |||
3087 | 147 | <!-- This report is awfull so it's better to hide it --> | ||
3088 | 148 | |||
3089 | 149 | <report id="report_account_voucher_print" | ||
3090 | 150 | string="Voucher Print" | ||
3091 | 151 | model="account.voucher" | ||
3092 | 152 | name="voucher.print.webkit" | ||
3093 | 153 | file="account_voucher_webkit/report/account_voucher_print.mako" | ||
3094 | 154 | auto="False" | ||
3095 | 155 | menu="True" | ||
3096 | 156 | report_type="webkit" | ||
3097 | 157 | webkit_header="voucher_header"/> | ||
3098 | 158 | </data> | ||
3099 | 159 | </openerp> | ||
3100 | 0 | 160 | ||
3101 | === added directory 'account_voucher_webkit/report' | |||
3102 | === added file 'account_voucher_webkit/report/.~lock.account_voucher_print.sxw#' | |||
3103 | --- account_voucher_webkit/report/.~lock.account_voucher_print.sxw# 1970-01-01 00:00:00 +0000 | |||
3104 | +++ account_voucher_webkit/report/.~lock.account_voucher_print.sxw# 2013-10-10 09:47:29 +0000 | |||
3105 | @@ -0,0 +1,1 @@ | |||
3106 | 1 | serpentcs ,serpentcs,serpentcs-desktop,17.09.2013 13:01,file:///home/serpentcs/.libreoffice/3; | ||
3107 | 0 | \ No newline at end of file | 2 | \ No newline at end of file |
3108 | 1 | 3 | ||
3109 | === added file 'account_voucher_webkit/report/__init__.py' | |||
3110 | --- account_voucher_webkit/report/__init__.py 1970-01-01 00:00:00 +0000 | |||
3111 | +++ account_voucher_webkit/report/__init__.py 2013-10-10 09:47:29 +0000 | |||
3112 | @@ -0,0 +1,26 @@ | |||
3113 | 1 | # -*- coding: utf-8 -*- | ||
3114 | 2 | ############################################################################## | ||
3115 | 3 | # | ||
3116 | 4 | # OpenERP, Open Source Management Solution | ||
3117 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
3118 | 6 | # | ||
3119 | 7 | # This program is free software: you can redistribute it and/or modify | ||
3120 | 8 | # it under the terms of the GNU Affero General Public License as | ||
3121 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
3122 | 10 | # License, or (at your option) any later version. | ||
3123 | 11 | # | ||
3124 | 12 | # This program is distributed in the hope that it will be useful, | ||
3125 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3126 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3127 | 15 | # GNU Affero General Public License for more details. | ||
3128 | 16 | # | ||
3129 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
3130 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3131 | 19 | # | ||
3132 | 20 | |||
3133 | 21 | ############################################################################## | ||
3134 | 22 | |||
3135 | 23 | import account_voucher | ||
3136 | 24 | import account_voucher_print | ||
3137 | 25 | |||
3138 | 26 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
3139 | 0 | 27 | ||
3140 | === added file 'account_voucher_webkit/report/account_voucher.mako' | |||
3141 | --- account_voucher_webkit/report/account_voucher.mako 1970-01-01 00:00:00 +0000 | |||
3142 | +++ account_voucher_webkit/report/account_voucher.mako 2013-10-10 09:47:29 +0000 | |||
3143 | @@ -0,0 +1,160 @@ | |||
3144 | 1 | <html> | ||
3145 | 2 | <head> | ||
3146 | 3 | <style type="text/css"> | ||
3147 | 4 | ${css} | ||
3148 | 5 | </style> | ||
3149 | 6 | </head> | ||
3150 | 7 | <body> | ||
3151 | 8 | %for voucher in objects: | ||
3152 | 9 | <table class="title"> | ||
3153 | 10 | <tr> | ||
3154 | 11 | <td> | ||
3155 | 12 | ${get_title(voucher.type)} | ||
3156 | 13 | </td> | ||
3157 | 14 | </tr> | ||
3158 | 15 | </table> | ||
3159 | 16 | <table class="tbl_grey_line"> | ||
3160 | 17 | <tr> | ||
3161 | 18 | <td width="20%"><b> | ||
3162 | 19 | ${_('Journal:')}</b> | ||
3163 | 20 | </td> | ||
3164 | 21 | <td colspan="3" width="30%"> | ||
3165 | 22 | ${ voucher.type} | ||
3166 | 23 | </td> | ||
3167 | 24 | <td width="20%"> | ||
3168 | 25 | <b>${_('Number:')}</b> | ||
3169 | 26 | </td> | ||
3170 | 27 | <td width="30%"> | ||
3171 | 28 | ${ voucher.number } | ||
3172 | 29 | </td> | ||
3173 | 30 | </tr> | ||
3174 | 31 | <tr> | ||
3175 | 32 | <td> | ||
3176 | 33 | <b> ${_('Status:')} </b> | ||
3177 | 34 | </td> | ||
3178 | 35 | <td width="10%"> | ||
3179 | 36 | %if voucher.state == 'proforma': | ||
3180 | 37 | PRO-FORMA | ||
3181 | 38 | %endif | ||
3182 | 39 | %if voucher.state == 'draft': | ||
3183 | 40 | Draft | ||
3184 | 41 | %endif | ||
3185 | 42 | %if voucher.state == 'cancel': | ||
3186 | 43 | Canceled | ||
3187 | 44 | %endif | ||
3188 | 45 | %if voucher.state == 'posted': | ||
3189 | 46 | Posted | ||
3190 | 47 | %endif | ||
3191 | 48 | </td> | ||
3192 | 49 | <td width="10%"> | ||
3193 | 50 | <b>${_('Ref. :')}</b> | ||
3194 | 51 | </td> | ||
3195 | 52 | <td width="10%"> | ||
3196 | 53 | ${ voucher.reference or '' } | ||
3197 | 54 | </td> | ||
3198 | 55 | <td> | ||
3199 | 56 | <b>${_('Date:')}</b> | ||
3200 | 57 | </td> | ||
3201 | 58 | <td> | ||
3202 | 59 | ${ formatLang(voucher.date , date=True) or '' } | ||
3203 | 60 | </td> | ||
3204 | 61 | </tr> | ||
3205 | 62 | </table> | ||
3206 | 63 | </br> | ||
3207 | 64 | <table class="tbl_line"> | ||
3208 | 65 | <tr> | ||
3209 | 66 | <td width="50%"> | ||
3210 | 67 | ${_('Particulars')} | ||
3211 | 68 | </td> | ||
3212 | 69 | <td width="25%" align="right"> | ||
3213 | 70 | ${_('Debit')} | ||
3214 | 71 | </td> | ||
3215 | 72 | <td width="25%" align="right"> | ||
3216 | 73 | ${_('Credit')} | ||
3217 | 74 | </td> | ||
3218 | 75 | </tr> | ||
3219 | 76 | </table> | ||
3220 | 77 | <table class="font"> | ||
3221 | 78 | %for move_ids in voucher.move_ids: | ||
3222 | 79 | <tr> | ||
3223 | 80 | <td style="padding-left:5px" width="50%"> | ||
3224 | 81 | <b> ${ (move_ids.partner_id and move_ids.partner_id.name) or 'Account' }</b> | ||
3225 | 82 | </td> | ||
3226 | 83 | <td style="padding-left:15px" width="25%" align="right"> | ||
3227 | 84 | ${ formatLang(move_ids.debit) } | ||
3228 | 85 | </td> | ||
3229 | 86 | <td style="padding-left:15px" width="25%" align="right"> | ||
3230 | 87 | ${ formatLang(move_ids.credit) } | ||
3231 | 88 | </td> | ||
3232 | 89 | </tr> | ||
3233 | 90 | <tr> | ||
3234 | 91 | <td colspan="3" style="padding-left:15px"> | ||
3235 | 92 | ${ move_ids.account_id.name } | ||
3236 | 93 | </td> | ||
3237 | 94 | </tr> | ||
3238 | 95 | <tr> | ||
3239 | 96 | <td colspan="3" style="padding-left:15px" width="25%"> | ||
3240 | 97 | <i>${ move_ids.name } - ${ get_ref(voucher.id,move_ids) }</i> | ||
3241 | 98 | </td> | ||
3242 | 99 | </tr> | ||
3243 | 100 | %endfor | ||
3244 | 101 | <tr> | ||
3245 | 102 | <td colspan="3"> | ||
3246 | 103 | <b>${_('Through :')} | ||
3247 | 104 | </td> | ||
3248 | 105 | </tr> | ||
3249 | 106 | <tr> | ||
3250 | 107 | <td colspan="3" style="padding-left:15px" > | ||
3251 | 108 | ${ voucher.narration or ''} | ||
3252 | 109 | </td> | ||
3253 | 110 | </tr> | ||
3254 | 111 | <tr> | ||
3255 | 112 | <td colspan="3" > | ||
3256 | 113 | <b>${_('On Account of : ')}</b> | ||
3257 | 114 | </td> | ||
3258 | 115 | </tr> | ||
3259 | 116 | <tr> | ||
3260 | 117 | <td colspan="3" style="padding-left:15px > | ||
3261 | 118 | ${ voucher.name or ''} | ||
3262 | 119 | </td> | ||
3263 | 120 | </tr> | ||
3264 | 121 | <tr > | ||
3265 | 122 | <td colspan="3"> | ||
3266 | 123 | <b> ${_('Amount (in words) :') }</b> | ||
3267 | 124 | </td> | ||
3268 | 125 | </tr> | ||
3269 | 126 | <tr> | ||
3270 | 127 | <td style="padding-left:15px"> | ||
3271 | 128 | ${ convert(voucher.amount,voucher.currency_id.name) or '' } | ||
3272 | 129 | </td> | ||
3273 | 130 | <td></td><td></td> | ||
3274 | 131 | </tr> | ||
3275 | 132 | </table> | ||
3276 | 133 | <table class="tbl_line"> | ||
3277 | 134 | <tr> | ||
3278 | 135 | <td width="50%"> | ||
3279 | 136 | |||
3280 | 137 | </td> | ||
3281 | 138 | <td width="25%" align="right" > | ||
3282 | 139 | ${ debit(voucher.move_ids)} | ||
3283 | 140 | </td> | ||
3284 | 141 | <td width="25%" align="right"> | ||
3285 | 142 | ${ credit(voucher.move_ids)} | ||
3286 | 143 | </td> | ||
3287 | 144 | </tr> | ||
3288 | 145 | <table> | ||
3289 | 146 | </br> | ||
3290 | 147 | <table class="tbl_header"> | ||
3291 | 148 | <tr> | ||
3292 | 149 | <td width="50%"> | ||
3293 | 150 | Receiver's Signature | ||
3294 | 151 | </td> | ||
3295 | 152 | <td align="right" width="50%"> | ||
3296 | 153 | Authorised Signatory | ||
3297 | 154 | </td> | ||
3298 | 155 | </tr> | ||
3299 | 156 | </table> | ||
3300 | 157 | <p style="page-break-after:always"></p> | ||
3301 | 158 | %endfor | ||
3302 | 159 | </body> | ||
3303 | 160 | </html> | ||
3304 | 0 | \ No newline at end of file | 161 | \ No newline at end of file |
3305 | 1 | 162 | ||
3306 | === added file 'account_voucher_webkit/report/account_voucher.py' | |||
3307 | --- account_voucher_webkit/report/account_voucher.py 1970-01-01 00:00:00 +0000 | |||
3308 | +++ account_voucher_webkit/report/account_voucher.py 2013-10-10 09:47:29 +0000 | |||
3309 | @@ -0,0 +1,77 @@ | |||
3310 | 1 | # -*- coding: utf-8 -*- | ||
3311 | 2 | ############################################################################## | ||
3312 | 3 | # | ||
3313 | 4 | # OpenERP, Open Source Management Solution | ||
3314 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
3315 | 6 | # | ||
3316 | 7 | # This program is free software: you can redistribute it and/or modify | ||
3317 | 8 | # it under the terms of the GNU Affero General Public License as | ||
3318 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
3319 | 10 | # License, or (at your option) any later version. | ||
3320 | 11 | # | ||
3321 | 12 | # This program is distributed in the hope that it will be useful, | ||
3322 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3323 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3324 | 15 | # GNU Affero General Public License for more details. | ||
3325 | 16 | # | ||
3326 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
3327 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3328 | 19 | # | ||
3329 | 20 | |||
3330 | 21 | ############################################################################## | ||
3331 | 22 | |||
3332 | 23 | import time | ||
3333 | 24 | from openerp.report import report_sxw | ||
3334 | 25 | from openerp.tools import amount_to_text_en | ||
3335 | 26 | |||
3336 | 27 | class report_voucher(report_sxw.rml_parse): | ||
3337 | 28 | def __init__(self, cr, uid, name, context): | ||
3338 | 29 | super(report_voucher, self).__init__(cr, uid, name, context) | ||
3339 | 30 | self.localcontext.update({ | ||
3340 | 31 | 'time': time, | ||
3341 | 32 | 'convert':self.convert, | ||
3342 | 33 | 'get_title': self.get_title, | ||
3343 | 34 | 'debit':self.debit, | ||
3344 | 35 | 'credit':self.credit, | ||
3345 | 36 | 'get_ref': self._get_ref | ||
3346 | 37 | }) | ||
3347 | 38 | |||
3348 | 39 | def convert(self, amount, cur): | ||
3349 | 40 | amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur) | ||
3350 | 41 | return amt_en | ||
3351 | 42 | |||
3352 | 43 | def get_title(self, type): | ||
3353 | 44 | |||
3354 | 45 | title = '' | ||
3355 | 46 | if type: | ||
3356 | 47 | title = type[0].swapcase() + type[1:] + " Voucher" | ||
3357 | 48 | return title | ||
3358 | 49 | |||
3359 | 50 | def debit(self, move_ids): | ||
3360 | 51 | debit = 0.0 | ||
3361 | 52 | for move in move_ids: | ||
3362 | 53 | debit += move.debit | ||
3363 | 54 | return debit | ||
3364 | 55 | |||
3365 | 56 | def credit(self, move_ids): | ||
3366 | 57 | credit = 0.0 | ||
3367 | 58 | for move in move_ids: | ||
3368 | 59 | credit += move.credit | ||
3369 | 60 | return credit | ||
3370 | 61 | |||
3371 | 62 | def _get_ref(self, voucher_id, move_ids): | ||
3372 | 63 | voucher_line_obj = self.pool.get('account.voucher.line') | ||
3373 | 64 | voucher_line = voucher_line_obj.search(self.cr, self.uid, [('partner_id', '=', move_ids.partner_id.id), ('voucher_id', '=', voucher_id)]) | ||
3374 | 65 | if voucher_line: | ||
3375 | 66 | voucher = voucher_line_obj.browse(self.cr, self.uid, voucher_line)[0] | ||
3376 | 67 | return voucher.name | ||
3377 | 68 | else: | ||
3378 | 69 | return | ||
3379 | 70 | report_sxw.report_sxw( | ||
3380 | 71 | 'report.voucher.cash_receipt.drcr.webkit', | ||
3381 | 72 | 'account.voucher', | ||
3382 | 73 | 'addons/account_voucher_webkit/report/account_voucher.mako', | ||
3383 | 74 | parser=report_voucher,header="external" | ||
3384 | 75 | ) | ||
3385 | 76 | |||
3386 | 77 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
3387 | 0 | 78 | ||
3388 | === added file 'account_voucher_webkit/report/account_voucher_print.mako' | |||
3389 | --- account_voucher_webkit/report/account_voucher_print.mako 1970-01-01 00:00:00 +0000 | |||
3390 | +++ account_voucher_webkit/report/account_voucher_print.mako 2013-10-10 09:47:29 +0000 | |||
3391 | @@ -0,0 +1,140 @@ | |||
3392 | 1 | <html> | ||
3393 | 2 | <head> | ||
3394 | 3 | <style type="text/css"> | ||
3395 | 4 | ${css} | ||
3396 | 5 | </style> | ||
3397 | 6 | </head> | ||
3398 | 7 | <body> | ||
3399 | 8 | %for voucher in objects: | ||
3400 | 9 | <table class="title"> | ||
3401 | 10 | <tr> | ||
3402 | 11 | <td> | ||
3403 | 12 | ${ get_title(voucher.type) } | ||
3404 | 13 | </td> | ||
3405 | 14 | </tr> | ||
3406 | 15 | </table> | ||
3407 | 16 | <table class="tbl_header"> | ||
3408 | 17 | <tr> | ||
3409 | 18 | <td width="10%"> | ||
3410 | 19 | <b>${_('Number:')}</b> | ||
3411 | 20 | </td> | ||
3412 | 21 | <td width="40%"> | ||
3413 | 22 | ${_('voucher.number')} | ||
3414 | 23 | <td align="right" width="40%"> | ||
3415 | 24 | <b>${_('Date:')}</b> | ||
3416 | 25 | </td> | ||
3417 | 26 | <td align="right" width="10%"> | ||
3418 | 27 | ${ formatLang(voucher.date , date=True) or '' } | ||
3419 | 28 | </td> | ||
3420 | 29 | </tr> | ||
3421 | 30 | <tr> | ||
3422 | 31 | <td width="10%"> | ||
3423 | 32 | <b> ${_('Status:')}</b> | ||
3424 | 33 | </td> | ||
3425 | 34 | <td width="40%"> | ||
3426 | 35 | %if voucher.state == 'proforma': | ||
3427 | 36 | PRO-FORMA | ||
3428 | 37 | %endif | ||
3429 | 38 | %if voucher.state == 'draft': | ||
3430 | 39 | Draft | ||
3431 | 40 | %endif | ||
3432 | 41 | %if voucher.state == 'cancel': | ||
3433 | 42 | Canceled | ||
3434 | 43 | %endif | ||
3435 | 44 | %if voucher.state == 'posted': | ||
3436 | 45 | Posted | ||
3437 | 46 | %endif | ||
3438 | 47 | </td> | ||
3439 | 48 | <td align="right" width="40%"> | ||
3440 | 49 | <b>${_('Currency:')}</b> | ||
3441 | 50 | </td> | ||
3442 | 51 | <td align="right" width="10%"> | ||
3443 | 52 | ${ voucher.currency_id.symbol } | ||
3444 | 53 | </td> | ||
3445 | 54 | </tr> | ||
3446 | 55 | </table> | ||
3447 | 56 | </br> | ||
3448 | 57 | <table class="tbl_line"> | ||
3449 | 58 | <tr width="70%"> | ||
3450 | 59 | <td> | ||
3451 | 60 | ${_('Particulars')} | ||
3452 | 61 | </td> | ||
3453 | 62 | <td width="30%" align="right"> | ||
3454 | 63 | ${_('Amount')} | ||
3455 | 64 | </td> | ||
3456 | 65 | </tr> | ||
3457 | 66 | </table> | ||
3458 | 67 | |||
3459 | 68 | <table class="font"> | ||
3460 | 69 | %for p in get_lines(voucher): | ||
3461 | 70 | <tr> | ||
3462 | 71 | <td width="70%" style="padding-left:5px"><b> | ||
3463 | 72 | ${_('Account :')}</b> | ||
3464 | 73 | </td> | ||
3465 | 74 | </tr> | ||
3466 | 75 | |||
3467 | 76 | <tr> | ||
3468 | 77 | <td style="padding-left:10px"> | ||
3469 | 78 | ${ p['pname'] } | ||
3470 | 79 | </td> | ||
3471 | 80 | <td align="right"> | ||
3472 | 81 | ${ formatLang(p['amount'], currency_obj=voucher.currency_id) } | ||
3473 | 82 | </td> | ||
3474 | 83 | </tr> | ||
3475 | 84 | |||
3476 | 85 | <tr> | ||
3477 | 86 | <td style="padding-left:10px"> | ||
3478 | 87 | ${ p['ref'] } | ||
3479 | 88 | </td> | ||
3480 | 89 | </tr> | ||
3481 | 90 | <tr> | ||
3482 | 91 | <td style="padding-left:10px"> | ||
3483 | 92 | ${_('Account :')} ${ p['aname']} | ||
3484 | 93 | </td> | ||
3485 | 94 | </tr> | ||
3486 | 95 | %endfor | ||
3487 | 96 | <tr> | ||
3488 | 97 | <td style="padding-left:5px"> | ||
3489 | 98 | <b>${_('Through :')}</b> | ||
3490 | 99 | </td> | ||
3491 | 100 | </tr> | ||
3492 | 101 | <tr> | ||
3493 | 102 | <td style="padding-left:10px"> | ||
3494 | 103 | ${ voucher.journal_id.name or '' } | ||
3495 | 104 | </td> | ||
3496 | 105 | </tr> | ||
3497 | 106 | <tr> | ||
3498 | 107 | <td style="padding-left:5px"> | ||
3499 | 108 | <b>${_('On Account of :')}</b> | ||
3500 | 109 | </td> | ||
3501 | 110 | </tr> | ||
3502 | 111 | <tr> | ||
3503 | 112 | <td style="padding-left:10px"> | ||
3504 | 113 | ${ get_on_account(voucher) } | ||
3505 | 114 | </td> | ||
3506 | 115 | </tr> | ||
3507 | 116 | <tr> | ||
3508 | 117 | <td style="padding-left:5px"> | ||
3509 | 118 | <b>Amount (in words) :</b> | ||
3510 | 119 | </td> | ||
3511 | 120 | </tr> | ||
3512 | 121 | <tr> | ||
3513 | 122 | <td style="padding-left:10px"> | ||
3514 | 123 | ${ convert(voucher.amount,voucher.currency_id.name) } | ||
3515 | 124 | </td> | ||
3516 | 125 | </tr> | ||
3517 | 126 | </table> | ||
3518 | 127 | |||
3519 | 128 | <table class="tbl_line"> | ||
3520 | 129 | <tr> | ||
3521 | 130 | <td width="70%"> | ||
3522 | 131 | </td> | ||
3523 | 132 | <td align="right" width="30%"> | ||
3524 | 133 | ${ formatLang(voucher.amount, currency_obj=voucher.currency_id) } | ||
3525 | 134 | </td> | ||
3526 | 135 | </tr> | ||
3527 | 136 | </table> | ||
3528 | 137 | <p style="page-break-after:always"></p> | ||
3529 | 138 | %endfor | ||
3530 | 139 | </body> | ||
3531 | 140 | </html> | ||
3532 | 0 | \ No newline at end of file | 141 | \ No newline at end of file |
3533 | 1 | 142 | ||
3534 | === added file 'account_voucher_webkit/report/account_voucher_print.py' | |||
3535 | --- account_voucher_webkit/report/account_voucher_print.py 1970-01-01 00:00:00 +0000 | |||
3536 | +++ account_voucher_webkit/report/account_voucher_print.py 2013-10-10 09:47:29 +0000 | |||
3537 | @@ -0,0 +1,98 @@ | |||
3538 | 1 | # -*- coding: utf-8 -*- | ||
3539 | 2 | ############################################################################## | ||
3540 | 3 | # | ||
3541 | 4 | # OpenERP, Open Source Management Solution | ||
3542 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
3543 | 6 | # | ||
3544 | 7 | # This program is free software: you can redistribute it and/or modify | ||
3545 | 8 | # it under the terms of the GNU Affero General Public License as | ||
3546 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
3547 | 10 | # License, or (at your option) any later version. | ||
3548 | 11 | # | ||
3549 | 12 | # This program is distributed in the hope that it will be useful, | ||
3550 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3551 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3552 | 15 | # GNU Affero General Public License for more details. | ||
3553 | 16 | # | ||
3554 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
3555 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3556 | 19 | # | ||
3557 | 20 | |||
3558 | 21 | ############################################################################## | ||
3559 | 22 | |||
3560 | 23 | import time | ||
3561 | 24 | from openerp.report import report_sxw | ||
3562 | 25 | from openerp.tools import amount_to_text_en | ||
3563 | 26 | |||
3564 | 27 | class report_voucher_print(report_sxw.rml_parse): | ||
3565 | 28 | def __init__(self, cr, uid, name, context): | ||
3566 | 29 | super(report_voucher_print, self).__init__(cr, uid, name, context) | ||
3567 | 30 | self.localcontext.update({ | ||
3568 | 31 | 'time': time, | ||
3569 | 32 | 'get_title': self.get_title, | ||
3570 | 33 | 'get_lines':self.get_lines, | ||
3571 | 34 | 'get_on_account':self.get_on_account, | ||
3572 | 35 | 'convert':self.convert | ||
3573 | 36 | }) | ||
3574 | 37 | |||
3575 | 38 | def convert(self, amount, cur): | ||
3576 | 39 | amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur) | ||
3577 | 40 | return amt_en | ||
3578 | 41 | |||
3579 | 42 | def get_lines(self, voucher): | ||
3580 | 43 | result = [] | ||
3581 | 44 | if voucher.type in ('payment','receipt'): | ||
3582 | 45 | type = voucher.line_ids and voucher.line_ids[0].type or False | ||
3583 | 46 | for move in voucher.move_ids: | ||
3584 | 47 | res = {} | ||
3585 | 48 | amount = move.credit | ||
3586 | 49 | if type == 'dr': | ||
3587 | 50 | amount = move.debit | ||
3588 | 51 | if amount > 0.0: | ||
3589 | 52 | res['pname'] = move.partner_id.name | ||
3590 | 53 | res['ref'] = 'Agst Ref'+" "+str(move.name) | ||
3591 | 54 | res['aname'] = move.account_id.name | ||
3592 | 55 | res['amount'] = amount | ||
3593 | 56 | result.append(res) | ||
3594 | 57 | else: | ||
3595 | 58 | type = voucher.line_ids and voucher.line_ids[0].type or False | ||
3596 | 59 | for move in voucher.move_ids: | ||
3597 | 60 | res = {} | ||
3598 | 61 | amount = move.credit | ||
3599 | 62 | if type == 'dr': | ||
3600 | 63 | amount = move.debit | ||
3601 | 64 | if amount > 0.0: | ||
3602 | 65 | res['pname'] = move.partner_id.name | ||
3603 | 66 | res['ref'] = move.name | ||
3604 | 67 | res['aname'] = move.account_id.name | ||
3605 | 68 | res['amount'] = amount | ||
3606 | 69 | result.append(res) | ||
3607 | 70 | return result | ||
3608 | 71 | |||
3609 | 72 | def get_title(self, type): | ||
3610 | 73 | print "type:::><><><><>",type | ||
3611 | 74 | title = '' | ||
3612 | 75 | if type: | ||
3613 | 76 | title = type[0].swapcase() + type[1:] + " Voucher" | ||
3614 | 77 | return title | ||
3615 | 78 | |||
3616 | 79 | def get_on_account(self, voucher): | ||
3617 | 80 | name = "" | ||
3618 | 81 | if voucher.type == 'receipt': | ||
3619 | 82 | name = "Received cash from "+str(voucher.partner_id.name) | ||
3620 | 83 | elif voucher.type == 'payment': | ||
3621 | 84 | name = "Payment from "+str(voucher.partner_id.name) | ||
3622 | 85 | elif voucher.type == 'sale': | ||
3623 | 86 | name = "Sale to "+str(voucher.partner_id.name) | ||
3624 | 87 | elif voucher.type == 'purchase': | ||
3625 | 88 | name = "Purchase from "+str(voucher.partner_id.name) | ||
3626 | 89 | return name | ||
3627 | 90 | |||
3628 | 91 | report_sxw.report_sxw( | ||
3629 | 92 | 'report.voucher.print.webkit', | ||
3630 | 93 | 'account.voucher', | ||
3631 | 94 | 'addons/account_voucher_webkit/report/account_voucher_print.mako', | ||
3632 | 95 | parser=report_voucher_print,header="external" | ||
3633 | 96 | ) | ||
3634 | 97 | |||
3635 | 98 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
3636 | 0 | 99 | ||
3637 | === added directory 'account_webkit' | |||
3638 | === added file 'account_webkit/__init__.py' | |||
3639 | --- account_webkit/__init__.py 1970-01-01 00:00:00 +0000 | |||
3640 | +++ account_webkit/__init__.py 2013-10-10 09:47:29 +0000 | |||
3641 | @@ -0,0 +1,24 @@ | |||
3642 | 1 | # -*- coding: utf-8 -*- | ||
3643 | 2 | ############################################################################## | ||
3644 | 3 | # | ||
3645 | 4 | # OpenERP, Open Source Management Solution | ||
3646 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
3647 | 6 | # | ||
3648 | 7 | # This program is free software: you can redistribute it and/or modify | ||
3649 | 8 | # it under the terms of the GNU Affero General Public License as | ||
3650 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
3651 | 10 | # License, or (at your option) any later version. | ||
3652 | 11 | # | ||
3653 | 12 | # This program is distributed in the hope that it will be useful, | ||
3654 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3655 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3656 | 15 | # GNU Affero General Public License for more details. | ||
3657 | 16 | # | ||
3658 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
3659 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3660 | 19 | # | ||
3661 | 20 | ############################################################################ | ||
3662 | 21 | |||
3663 | 22 | import report | ||
3664 | 23 | import wizard | ||
3665 | 24 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
3666 | 0 | 25 | ||
3667 | === added file 'account_webkit/__openerp__.py' | |||
3668 | --- account_webkit/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
3669 | +++ account_webkit/__openerp__.py 2013-10-10 09:47:29 +0000 | |||
3670 | @@ -0,0 +1,44 @@ | |||
3671 | 1 | # -*- coding: utf-8 -*- | ||
3672 | 2 | ############################################################################## | ||
3673 | 3 | # | ||
3674 | 4 | # OpenERP, Open Source Management Solution | ||
3675 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
3676 | 6 | # | ||
3677 | 7 | # This program is free software: you can redistribute it and/or modify | ||
3678 | 8 | # it under the terms of the GNU Affero General Public License as | ||
3679 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
3680 | 10 | # License, or (at your option) any later version. | ||
3681 | 11 | # | ||
3682 | 12 | # This program is distributed in the hope that it will be useful, | ||
3683 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
3684 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
3685 | 15 | # GNU Affero General Public License for more details. | ||
3686 | 16 | # | ||
3687 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
3688 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
3689 | 19 | # | ||
3690 | 20 | ############################################################################ | ||
3691 | 21 | |||
3692 | 22 | { | ||
3693 | 23 | 'name' : 'eInvoicing Webkit', | ||
3694 | 24 | 'version' : '1.1', | ||
3695 | 25 | 'author' : 'Serpent Consulting Services', | ||
3696 | 26 | 'category' : 'Accounting & Finance', | ||
3697 | 27 | 'description' : """ | ||
3698 | 28 | Accounting and Financial Management. | ||
3699 | 29 | ==================================== | ||
3700 | 30 | It is conversion of rml report to Webkit Report. | ||
3701 | 31 | """, | ||
3702 | 32 | 'website': 'http://www.serpentcs.com', | ||
3703 | 33 | 'depends' : ["account", "report_webkit"], | ||
3704 | 34 | 'init_xml': [], | ||
3705 | 35 | 'update_xml': [ | ||
3706 | 36 | 'account_report.xml', | ||
3707 | 37 | ], | ||
3708 | 38 | 'test': [ | ||
3709 | 39 | ], | ||
3710 | 40 | 'installable': True, | ||
3711 | 41 | 'auto_install': False, | ||
3712 | 42 | |||
3713 | 43 | } | ||
3714 | 44 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
3715 | 0 | 45 | ||
3716 | === added file 'account_webkit/account_report.xml' | |||
3717 | --- account_webkit/account_report.xml 1970-01-01 00:00:00 +0000 | |||
3718 | +++ account_webkit/account_report.xml 2013-10-10 09:47:29 +0000 | |||
3719 | @@ -0,0 +1,658 @@ | |||
3720 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
3721 | 2 | <openerp> | ||
3722 | 3 | <data> | ||
3723 | 4 | |||
3724 | 5 | <record id="account_tax_webkit_header" model="ir.header_webkit"> | ||
3725 | 6 | <field name="footer_html"><![CDATA[]]></field> | ||
3726 | 7 | <field name="orientation">Portrait</field> | ||
3727 | 8 | <field name="format">A4</field> | ||
3728 | 9 | <field name="html"><![CDATA[ | ||
3729 | 10 | <html> | ||
3730 | 11 | <head> | ||
3731 | 12 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
3732 | 13 | <script> | ||
3733 | 14 | function subst() { | ||
3734 | 15 | var vars={}; | ||
3735 | 16 | var x=document.location.search.substring(1).split('&'); | ||
3736 | 17 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
3737 | 18 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
3738 | 19 | for(var i in x) { | ||
3739 | 20 | var y = document.getElementsByClassName(x[i]); | ||
3740 | 21 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
3741 | 22 | } | ||
3742 | 23 | } | ||
3743 | 24 | </script> | ||
3744 | 25 | <style type="text/css"> | ||
3745 | 26 | |||
3746 | 27 | ${css} | ||
3747 | 28 | </style> | ||
3748 | 29 | </head> | ||
3749 | 30 | <body style="border:0; margin: 0;" onload="subst()"> | ||
3750 | 31 | <table class="header" style="border-bottom: 1px solid black; width: 100%"> | ||
3751 | 32 | <tr > | ||
3752 | 33 | <td style="text-align:right;font-size:12;" width="15%">${time.strftime('%m/%d/%Y %I:%M')}</td> | ||
3753 | 34 | <td style="text-align:center;font-size:16;" width="78%">${company.partner_id.name |entity}</td> | ||
3754 | 35 | <td style="text-align:left;font-size:12;" width="3%"><span class="page"/> </td> | ||
3755 | 36 | <td style="text-align:left;font-size:12;" width="1%"> /</td> | ||
3756 | 37 | <td style="text-align:right;font-size:12;" width="3%"><span class="topage"/></td> | ||
3757 | 38 | </tr> | ||
3758 | 39 | </table> ${_debug or ''|n} </body> | ||
3759 | 40 | </html>]]> | ||
3760 | 41 | </field> | ||
3761 | 42 | <field eval="15.0" name="margin_top"/> | ||
3762 | 43 | <field eval="5.0" name="margin_bottom"/> | ||
3763 | 44 | <field name="css"><![CDATA[ | ||
3764 | 45 | |||
3765 | 46 | body, table, td, span, div { | ||
3766 | 47 | font-family: Helvetica, Arial; | ||
3767 | 48 | } | ||
3768 | 49 | |||
3769 | 50 | body { | ||
3770 | 51 | font-family:Arial; | ||
3771 | 52 | font-size:12; | ||
3772 | 53 | |||
3773 | 54 | } | ||
3774 | 55 | |||
3775 | 56 | |||
3776 | 57 | .header { | ||
3777 | 58 | margin-left:0; | ||
3778 | 59 | text-align:left; | ||
3779 | 60 | width:300px; | ||
3780 | 61 | font-size:12; | ||
3781 | 62 | } | ||
3782 | 63 | .title { | ||
3783 | 64 | font-size:16; | ||
3784 | 65 | font-weight: bold; | ||
3785 | 66 | |||
3786 | 67 | } | ||
3787 | 68 | |||
3788 | 69 | |||
3789 | 70 | .basic_table{ | ||
3790 | 71 | text-align:center; | ||
3791 | 72 | border:1px solid lightGrey; | ||
3792 | 73 | border-collapse: collapse; | ||
3793 | 74 | } | ||
3794 | 75 | .basic_table td { | ||
3795 | 76 | border:1px solid lightGrey; | ||
3796 | 77 | font-size:12; | ||
3797 | 78 | |||
3798 | 79 | |||
3799 | 80 | } | ||
3800 | 81 | |||
3801 | 82 | .list_table { | ||
3802 | 83 | border-color:black; | ||
3803 | 84 | text-align:center; | ||
3804 | 85 | border-collapse: collapse; | ||
3805 | 86 | |||
3806 | 87 | } | ||
3807 | 88 | .list_table td { | ||
3808 | 89 | border-color:gray; | ||
3809 | 90 | border-top:1px solid gray; | ||
3810 | 91 | text-align:right; | ||
3811 | 92 | font-size:12; | ||
3812 | 93 | padding-left:3px | ||
3813 | 94 | padding-right:3px | ||
3814 | 95 | padding-top:3px | ||
3815 | 96 | padding-bottom:3px | ||
3816 | 97 | } | ||
3817 | 98 | |||
3818 | 99 | .list_table th { | ||
3819 | 100 | border-bottom:2px solid black; | ||
3820 | 101 | text-align:right; | ||
3821 | 102 | font-size:12; | ||
3822 | 103 | font-weight:bold; | ||
3823 | 104 | padding-left:3px | ||
3824 | 105 | padding-right:3px | ||
3825 | 106 | } | ||
3826 | 107 | |||
3827 | 108 | .list_tabe thead { | ||
3828 | 109 | display:table-header-group; | ||
3829 | 110 | } | ||
3830 | 111 | |||
3831 | 112 | |||
3832 | 113 | .total { | ||
3833 | 114 | width:100%; | ||
3834 | 115 | } | ||
3835 | 116 | .lib { | ||
3836 | 117 | width:10.3%; | ||
3837 | 118 | } | ||
3838 | 119 | .tot { | ||
3839 | 120 | text-align:left; | ||
3840 | 121 | width:15%; | ||
3841 | 122 | } | ||
3842 | 123 | .righttot { | ||
3843 | 124 | width:74%; | ||
3844 | 125 | } | ||
3845 | 126 | .tax { | ||
3846 | 127 | width:50%; | ||
3847 | 128 | } | ||
3848 | 129 | |||
3849 | 130 | .cell{ | ||
3850 | 131 | border-spacing: 0; | ||
3851 | 132 | border-collapse: collapse; | ||
3852 | 133 | border-style:solid; | ||
3853 | 134 | border: 1px solid grey; | ||
3854 | 135 | font-size:10px; | ||
3855 | 136 | text-align:center; | ||
3856 | 137 | } | ||
3857 | 138 | |||
3858 | 139 | .tbl_header{ | ||
3859 | 140 | width:100%; | ||
3860 | 141 | font-size:10px; | ||
3861 | 142 | } | ||
3862 | 143 | .tr_bottom_line{ | ||
3863 | 144 | border-bottom: thin solid black; | ||
3864 | 145 | width:100%; | ||
3865 | 146 | } | ||
3866 | 147 | .tr_bottom_line_dark_grey{ | ||
3867 | 148 | border-bottom: thin solid grey; | ||
3868 | 149 | width:100%; | ||
3869 | 150 | } | ||
3870 | 151 | .tr_bottom_line_light_grey{ | ||
3871 | 152 | border-bottom: thin solid #CCCCCC; | ||
3872 | 153 | width:100%; | ||
3873 | 154 | } | ||
3874 | 155 | .td_f12{ | ||
3875 | 156 | font-size:12px; | ||
3876 | 157 | } | ||
3877 | 158 | .td_f10{ | ||
3878 | 159 | font-size:10px; | ||
3879 | 160 | } | ||
3880 | 161 | .td_f10_right{ | ||
3881 | 162 | font-size:10px; | ||
3882 | 163 | text-align:right; | ||
3883 | 164 | } | ||
3884 | 165 | .td_f12{ | ||
3885 | 166 | font-size:12px; | ||
3886 | 167 | } | ||
3887 | 168 | .td_f12_right{ | ||
3888 | 169 | font-size:12px; | ||
3889 | 170 | text-align:right; | ||
3890 | 171 | } | ||
3891 | 172 | table.head_border_style{ | ||
3892 | 173 | border:1px solid; | ||
3893 | 174 | color: #cccccc; | ||
3894 | 175 | } | ||
3895 | 176 | tr.head_border_style{ | ||
3896 | 177 | border:1px solid; | ||
3897 | 178 | color: #cccccc; | ||
3898 | 179 | } | ||
3899 | 180 | tr.table_header{ | ||
3900 | 181 | font-weight: bold; | ||
3901 | 182 | font-family: sans-serif, serif; | ||
3902 | 183 | font-size: 14px; | ||
3903 | 184 | caption-side: top; | ||
3904 | 185 | padding: 5px; | ||
3905 | 186 | } | ||
3906 | 187 | tr.table_parent_data{ | ||
3907 | 188 | font-family: Helvetica-Bold; | ||
3908 | 189 | font-size: 12px; | ||
3909 | 190 | caption-side: top; | ||
3910 | 191 | font-weight: bold; | ||
3911 | 192 | } | ||
3912 | 193 | tr.table_child_data{ | ||
3913 | 194 | font-family: Helvetica; | ||
3914 | 195 | font-size: 12px; | ||
3915 | 196 | caption-side: top; | ||
3916 | 197 | } | ||
3917 | 198 | tr.report_header{ | ||
3918 | 199 | font-size: 30px; | ||
3919 | 200 | caption-side: top; | ||
3920 | 201 | font-family: Helvetica-Bold | ||
3921 | 202 | padding: 5px; | ||
3922 | 203 | border-bottom: 15px solid black; | ||
3923 | 204 | align: center | ||
3924 | 205 | } | ||
3925 | 206 | |||
3926 | 207 | .top{ | ||
3927 | 208 | border-top:thin solid; | ||
3928 | 209 | border-color:#cccccc; | ||
3929 | 210 | } | ||
3930 | 211 | .bottom { | ||
3931 | 212 | border-bottom:thin solid; | ||
3932 | 213 | border-color:#cccccc; | ||
3933 | 214 | } | ||
3934 | 215 | .head_bottom_border{ | ||
3935 | 216 | border-bottom:thin solid; | ||
3936 | 217 | border-color:black; | ||
3937 | 218 | } | ||
3938 | 219 | .left { | ||
3939 | 220 | border-left:thin solid; | ||
3940 | 221 | border-color:#cccccc; | ||
3941 | 222 | } | ||
3942 | 223 | .right { | ||
3943 | 224 | border-right:thin solid; | ||
3944 | 225 | border-color:#cccccc;account_wbkit | ||
3945 | 226 | } | ||
3946 | 227 | |||
3947 | 228 | ]]> | ||
3948 | 229 | </field> | ||
3949 | 230 | <field name="name">Account Tax Webkit Header</field> | ||
3950 | 231 | </record> | ||
3951 | 232 | <record id="account_print_invoice_header" model="ir.header_webkit"> | ||
3952 | 233 | <field name="footer_html"><![CDATA[ | ||
3953 | 234 | <html> | ||
3954 | 235 | <head> | ||
3955 | 236 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
3956 | 237 | <script> | ||
3957 | 238 | function subst() { | ||
3958 | 239 | var vars={}; | ||
3959 | 240 | var x=document.location.search.substring(1).split('&'); | ||
3960 | 241 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
3961 | 242 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
3962 | 243 | for(var i in x) { | ||
3963 | 244 | var y = document.getElementsByClassName(x[i]); | ||
3964 | 245 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
3965 | 246 | } | ||
3966 | 247 | } | ||
3967 | 248 | </script> | ||
3968 | 249 | <style type="text/css"> | ||
3969 | 250 | |||
3970 | 251 | ${css} | ||
3971 | 252 | </style> | ||
3972 | 253 | </head> | ||
3973 | 254 | <body style="border:0; margin: 0;" onload="subst()"> | ||
3974 | 255 | <table class="header" style="border-top: 1px solid black; width: 100%"> | ||
3975 | 256 | <tr > | ||
3976 | 257 | <td style="text-align:center;font-size:12;" >${ company.rml_footer }</td> | ||
3977 | 258 | </tr> | ||
3978 | 259 | <tr > | ||
3979 | 260 | <td style="text-align:center;font-size:12;" >Contact : ${ user.name }</td> | ||
3980 | 261 | </tr> | ||
3981 | 262 | </table> ${_debug or ''|n} </body> | ||
3982 | 263 | </html> | ||
3983 | 264 | ]]></field> | ||
3984 | 265 | <field name="orientation">Portrait</field> | ||
3985 | 266 | <field name="format">A4</field> | ||
3986 | 267 | <field name="html"><![CDATA[ | ||
3987 | 268 | <html> | ||
3988 | 269 | <head> | ||
3989 | 270 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
3990 | 271 | <script> | ||
3991 | 272 | function subst() { | ||
3992 | 273 | var vars={}; | ||
3993 | 274 | var x=document.location.search.substring(1).split('&'); | ||
3994 | 275 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
3995 | 276 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
3996 | 277 | for(var i in x) {account_wbkit | ||
3997 | 278 | var y = document.getElementsByClassName(x[i]); | ||
3998 | 279 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
3999 | 280 | } | ||
4000 | 281 | } | ||
4001 | 282 | </script> | ||
4002 | 283 | <style type="text/css"> | ||
4003 | 284 | |||
4004 | 285 | ${css} | ||
4005 | 286 | </style> | ||
4006 | 287 | </head> | ||
4007 | 288 | <body style="border:0; margin: 0;" onload="subst()"> | ||
4008 | 289 | <table class="header" style="border-bottom: 1px solid black; width: 100%"> | ||
4009 | 290 | <tr > | ||
4010 | 291 | <td style="text-align:left;font-size:12;" width="20%">${ helper.embed_image('png',company.logo,200,50)|n }</td> | ||
4011 | 292 | <td style="text-align:right;font-size:12;" width="80%"></br></br>${ company.rml_header1 }</td> | ||
4012 | 293 | </tr> | ||
4013 | 294 | </table> ${_debug or ''|n} </body> | ||
4014 | 295 | <p style="text-align:left;font-size:12;">${company.name}</p> | ||
4015 | 296 | </html>]]> | ||
4016 | 297 | </field> | ||
4017 | 298 | <field eval="25.0" name="margin_top"/> | ||
4018 | 299 | <field eval="25.0" name="margin_bottom"/> | ||
4019 | 300 | <field name="css"><![CDATA[ | ||
4020 | 301 | |||
4021 | 302 | body, table, td, span, div { | ||
4022 | 303 | font-family: Helvetica, Arial; | ||
4023 | 304 | } | ||
4024 | 305 | |||
4025 | 306 | body { | ||
4026 | 307 | font-family:Arial; | ||
4027 | 308 | font-size:9; | ||
4028 | 309 | |||
4029 | 310 | } | ||
4030 | 311 | |||
4031 | 312 | |||
4032 | 313 | .header { | ||
4033 | 314 | margin-left:0; | ||
4034 | 315 | text-align:left; | ||
4035 | 316 | width:300px; | ||
4036 | 317 | font-size:12; | ||
4037 | 318 | } | ||
4038 | 319 | .title { | ||
4039 | 320 | font-size:16; | ||
4040 | 321 | font-weight: bold; | ||
4041 | 322 | |||
4042 | 323 | } | ||
4043 | 324 | |||
4044 | 325 | |||
4045 | 326 | .basic_table{ | ||
4046 | 327 | text-align:center; | ||
4047 | 328 | border:1px solid lightGrey; | ||
4048 | 329 | border-collapse: collapse; | ||
4049 | 330 | } | ||
4050 | 331 | .basic_table td { | ||
4051 | 332 | border:1px solid lightGrey; | ||
4052 | 333 | font-size:12; | ||
4053 | 334 | |||
4054 | 335 | |||
4055 | 336 | } | ||
4056 | 337 | |||
4057 | 338 | .list_table { | ||
4058 | 339 | border-color:black; | ||
4059 | 340 | text-align:center; | ||
4060 | 341 | border-collapse: collapse; | ||
4061 | 342 | |||
4062 | 343 | } | ||
4063 | 344 | .list_table td { | ||
4064 | 345 | border-color:gray; | ||
4065 | 346 | border-top:1px solid gray; | ||
4066 | 347 | text-align:right; | ||
4067 | 348 | font-size:12; | ||
4068 | 349 | padding-left:3px | ||
4069 | 350 | padding-right:3px | ||
4070 | 351 | padding-top:3px | ||
4071 | 352 | padding-bottom:3px | ||
4072 | 353 | } | ||
4073 | 354 | |||
4074 | 355 | .list_table th { | ||
4075 | 356 | border-bottom:2px solid black; | ||
4076 | 357 | text-align:right; | ||
4077 | 358 | font-size:12; | ||
4078 | 359 | font-weight:bold; | ||
4079 | 360 | padding-left:3px | ||
4080 | 361 | padding-right:3px | ||
4081 | 362 | } | ||
4082 | 363 | |||
4083 | 364 | .list_tabe thead { | ||
4084 | 365 | display:table-header-group; | ||
4085 | 366 | } | ||
4086 | 367 | |||
4087 | 368 | |||
4088 | 369 | .total { | ||
4089 | 370 | width:100%; | ||
4090 | 371 | } | ||
4091 | 372 | .lib { | ||
4092 | 373 | width:10.3%; | ||
4093 | 374 | } | ||
4094 | 375 | .tot { | ||
4095 | 376 | text-align:left; | ||
4096 | 377 | width:15%; | ||
4097 | 378 | } | ||
4098 | 379 | .righttot { | ||
4099 | 380 | width:74%; | ||
4100 | 381 | } | ||
4101 | 382 | .tax { | ||
4102 | 383 | width:50%; | ||
4103 | 384 | } | ||
4104 | 385 | |||
4105 | 386 | .cell{ | ||
4106 | 387 | border-spacing: 0; | ||
4107 | 388 | border-collapse: collapse; | ||
4108 | 389 | border-style:solid; | ||
4109 | 390 | border: 1px solid grey; | ||
4110 | 391 | font-size:10px; | ||
4111 | 392 | text-align:center; | ||
4112 | 393 | } | ||
4113 | 394 | |||
4114 | 395 | .tbl_header{ | ||
4115 | 396 | width:100%; | ||
4116 | 397 | font-size:10px; | ||
4117 | 398 | } | ||
4118 | 399 | .tr_bottom_line{ | ||
4119 | 400 | border-bottom: thin solid black; | ||
4120 | 401 | width:100%; | ||
4121 | 402 | } | ||
4122 | 403 | .tr_bottom_line_dark_grey{ | ||
4123 | 404 | border-bottom: thin solid grey; | ||
4124 | 405 | width:100%; | ||
4125 | 406 | } | ||
4126 | 407 | .tr_bottom_line_light_grey{ | ||
4127 | 408 | border-bottom: thin solid #CCCCCC; | ||
4128 | 409 | width:100%; | ||
4129 | 410 | } | ||
4130 | 411 | .td_f12{ | ||
4131 | 412 | font-size:12px; | ||
4132 | 413 | } | ||
4133 | 414 | .td_f10{ | ||
4134 | 415 | font-size:10px; | ||
4135 | 416 | } | ||
4136 | 417 | .td_f10_right{ | ||
4137 | 418 | font-size:10px; | ||
4138 | 419 | text-align:right; | ||
4139 | 420 | } | ||
4140 | 421 | .td_f12{ | ||
4141 | 422 | font-size:12px; | ||
4142 | 423 | } | ||
4143 | 424 | .td_f12_right{ | ||
4144 | 425 | font-size:12px; | ||
4145 | 426 | text-align:right; | ||
4146 | 427 | } | ||
4147 | 428 | table.head_border_style{ | ||
4148 | 429 | border:1px solid; | ||
4149 | 430 | color: #cccccc; | ||
4150 | 431 | } | ||
4151 | 432 | tr.head_border_style{ | ||
4152 | 433 | border:1px solid; | ||
4153 | 434 | color: #cccccc; | ||
4154 | 435 | } | ||
4155 | 436 | tr.table_header{ | ||
4156 | 437 | font-weight: bold; | ||
4157 | 438 | font-family: sans-serif, serif; | ||
4158 | 439 | font-size: 14px; | ||
4159 | 440 | caption-side: top; | ||
4160 | 441 | padding: 5px; | ||
4161 | 442 | } | ||
4162 | 443 | tr.table_parent_data{ | ||
4163 | 444 | font-family: Helvetica-Bold; | ||
4164 | 445 | font-size: 12px; | ||
4165 | 446 | caption-side: top; | ||
4166 | 447 | font-weight: bold; | ||
4167 | 448 | } | ||
4168 | 449 | tr.table_child_data{ | ||
4169 | 450 | font-family: Helvetica; | ||
4170 | 451 | font-size: 12px; | ||
4171 | 452 | caption-side: top; | ||
4172 | 453 | } | ||
4173 | 454 | tr.report_header{ | ||
4174 | 455 | font-size: 30px; | ||
4175 | 456 | caption-side: top; | ||
4176 | 457 | font-family: Helvetica-Bold | ||
4177 | 458 | padding: 5px; | ||
4178 | 459 | border-bottom: 15px solid black; | ||
4179 | 460 | align: center | ||
4180 | 461 | } | ||
4181 | 462 | |||
4182 | 463 | .top{ | ||
4183 | 464 | border-top:thin solid; | ||
4184 | 465 | border-color:#cccccc; | ||
4185 | 466 | } | ||
4186 | 467 | .bottom { | ||
4187 | 468 | border-bottom:thin solid; | ||
4188 | 469 | border-color:#cccccc; | ||
4189 | 470 | } | ||
4190 | 471 | .head_bottom_border{ | ||
4191 | 472 | border-bottom:thin solid; | ||
4192 | 473 | border-color:black; | ||
4193 | 474 | } | ||
4194 | 475 | .left { | ||
4195 | 476 | border-left:thin solid; | ||
4196 | 477 | border-color:#cccccc; | ||
4197 | 478 | } | ||
4198 | 479 | .right { | ||
4199 | 480 | border-right:thin solid; | ||
4200 | 481 | border-color:#cccccc; | ||
4201 | 482 | } | ||
4202 | 483 | |||
4203 | 484 | ]]> | ||
4204 | 485 | </field> | ||
4205 | 486 | <field name="name">Invoice Webkit Header</field> | ||
4206 | 487 | </record> | ||
4207 | 488 | |||
4208 | 489 | <report | ||
4209 | 490 | auto="False" | ||
4210 | 491 | id="account_general_ledger" | ||
4211 | 492 | menu="False" | ||
4212 | 493 | model="account.account" | ||
4213 | 494 | name="account.general.ledger.webkit" | ||
4214 | 495 | file="account_webkit/report/account_general_ledger.mako" | ||
4215 | 496 | string="General Ledger" | ||
4216 | 497 | report_type="webkit" | ||
4217 | 498 | webkit_header="account_tax_webkit_header" /> | ||
4218 | 499 | |||
4219 | 500 | <report | ||
4220 | 501 | auto="False" | ||
4221 | 502 | id="account_general_ledger_landscape" | ||
4222 | 503 | menu="False" | ||
4223 | 504 | model="account.account" | ||
4224 | 505 | name="account.general.ledger_landscape.webkit" | ||
4225 | 506 | file="account_webkit/report/account_general_ledger_landscape.mako" | ||
4226 | 507 | string="General Ledger" | ||
4227 | 508 | report_type="webkit" | ||
4228 | 509 | webkit_header="account_tax_webkit_header"/> | ||
4229 | 510 | |||
4230 | 511 | <report | ||
4231 | 512 | auto="False" | ||
4232 | 513 | id="account_3rdparty_ledger" | ||
4233 | 514 | menu="False" | ||
4234 | 515 | model="res.partner" | ||
4235 | 516 | name="account.third_party_ledger.webkit" | ||
4236 | 517 | file="account_webkit/report/account_partner_ledger.mako" | ||
4237 | 518 | string="Partner Ledger" | ||
4238 | 519 | report_type="webkit" | ||
4239 | 520 | webkit_header="account_tax_webkit_header" /> | ||
4240 | 521 | |||
4241 | 522 | <report | ||
4242 | 523 | auto="False" | ||
4243 | 524 | id="account_3rdparty_ledger_other" | ||
4244 | 525 | menu="False" | ||
4245 | 526 | model="res.partner" | ||
4246 | 527 | name="account.third_party_ledger_other.webkit" | ||
4247 | 528 | file="account_webkit/report/account_partner_ledger_other.mako" | ||
4248 | 529 | string="Partner Ledger" | ||
4249 | 530 | report_type="webkit" | ||
4250 | 531 | webkit_header="account_tax_webkit_header" /> | ||
4251 | 532 | |||
4252 | 533 | <report | ||
4253 | 534 | auto="False" | ||
4254 | 535 | id="account_account_balance" | ||
4255 | 536 | menu="False" | ||
4256 | 537 | model="account.account" | ||
4257 | 538 | name="account.account.balance.webkit" | ||
4258 | 539 | file="account_webkit/report/account_balance.mako" | ||
4259 | 540 | string="Trial Balance" | ||
4260 | 541 | report_type="webkit" | ||
4261 | 542 | webkit_header="account_tax_webkit_header" /> | ||
4262 | 543 | |||
4263 | 544 | |||
4264 | 545 | <report | ||
4265 | 546 | auto="False" | ||
4266 | 547 | id="account_3rdparty_account_balance" | ||
4267 | 548 | menu="False" | ||
4268 | 549 | model="account.account" | ||
4269 | 550 | name="account.partner.balance.webkit" | ||
4270 | 551 | file="account_webkit/report/account_partner_balance.mako" | ||
4271 | 552 | string="Partner Balance" | ||
4272 | 553 | report_type="webkit" | ||
4273 | 554 | webkit_header="account_tax_webkit_header" /> | ||
4274 | 555 | |||
4275 | 556 | <report | ||
4276 | 557 | auto= "False" | ||
4277 | 558 | id="account_central_journal" | ||
4278 | 559 | model="account.journal.period" | ||
4279 | 560 | name="account.central.journal.webkit" | ||
4280 | 561 | file="account_webkit/report/account_central_journal.mako" | ||
4281 | 562 | menu="False" | ||
4282 | 563 | string="Central Journal" | ||
4283 | 564 | report_type="webkit" | ||
4284 | 565 | webkit_header="account_tax_webkit_header" /> | ||
4285 | 566 | |||
4286 | 567 | |||
4287 | 568 | <report | ||
4288 | 569 | auto="False" | ||
4289 | 570 | id="account.account_general_journal" | ||
4290 | 571 | model="account.journal.period" | ||
4291 | 572 | name="account.general.journal.webkit" | ||
4292 | 573 | rml="account_webkit/report/account_general_journal.mako" | ||
4293 | 574 | string="General Journal" | ||
4294 | 575 | report_type="webkit" | ||
4295 | 576 | webkit_header="account_tax_webkit_header" /> | ||
4296 | 577 | |||
4297 | 578 | <report | ||
4298 | 579 | auto="False" | ||
4299 | 580 | id="account.account_journal" | ||
4300 | 581 | model="account.journal.period" | ||
4301 | 582 | name="account.journal.period.print.webkit" | ||
4302 | 583 | file="account_webkit/report/account_journal.mako" | ||
4303 | 584 | string="Journal" | ||
4304 | 585 | report_type="webkit" | ||
4305 | 586 | webkit_header="account_tax_webkit_header" /> | ||
4306 | 587 | |||
4307 | 588 | <report | ||
4308 | 589 | auto="False" | ||
4309 | 590 | id="account.webkit_account_journal_sale_purchase" | ||
4310 | 591 | model="account.journal.period" | ||
4311 | 592 | name="account.journal.period.print.sale.purchase.webkit" | ||
4312 | 593 | file="account_webkit/report/account_journal_sale_purchase.mako" | ||
4313 | 594 | string="Sale/Purchase Journal" | ||
4314 | 595 | report_type="webkit" | ||
4315 | 596 | webkit_header="account_tax_webkit_header" /> | ||
4316 | 597 | |||
4317 | 598 | <report | ||
4318 | 599 | auto="False" | ||
4319 | 600 | id="account.account_overdue" | ||
4320 | 601 | model="res.partner" | ||
4321 | 602 | name="account.overdue.webkit" | ||
4322 | 603 | file="account_webkit/report/account_print_overdue.mako" | ||
4323 | 604 | string="Overdue Payments" | ||
4324 | 605 | report_type="webkit" | ||
4325 | 606 | webkit_header="account_print_invoice_header" /> | ||
4326 | 607 | |||
4327 | 608 | |||
4328 | 609 | <report | ||
4329 | 610 | auto="False" | ||
4330 | 611 | id="account.account_invoices" | ||
4331 | 612 | model="account.invoice" | ||
4332 | 613 | name="account.invoice.webkit" | ||
4333 | 614 | file="account_webkit/report/account_print_invoice.mako" | ||
4334 | 615 | string="Invoices" | ||
4335 | 616 | attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')" | ||
4336 | 617 | attachment_use="True" | ||
4337 | 618 | usage="default" | ||
4338 | 619 | report_type="webkit" | ||
4339 | 620 | webkit_header="account_print_invoice_header" /> | ||
4340 | 621 | |||
4341 | 622 | |||
4342 | 623 | |||
4343 | 624 | <report | ||
4344 | 625 | auto="False" | ||
4345 | 626 | id="account_vat_declaration" | ||
4346 | 627 | menu="False" | ||
4347 | 628 | model="account.tax.code" | ||
4348 | 629 | name="account.vat.declaration.webkit" | ||
4349 | 630 | file="account_webkit/report/account_tax_report.mako" | ||
4350 | 631 | string="Taxes Report" | ||
4351 | 632 | report_type="webkit" | ||
4352 | 633 | webkit_header="account_tax_webkit_header"/> | ||
4353 | 634 | |||
4354 | 635 | <report | ||
4355 | 636 | auto="False" | ||
4356 | 637 | menu="False" | ||
4357 | 638 | id="report_webkit_central_journal_id" | ||
4358 | 639 | model="res.partner" | ||
4359 | 640 | name="account.aged_trial_balance.webkit" | ||
4360 | 641 | file="account_webkit/report/account_aged_partner_balance.mako" | ||
4361 | 642 | string="Account aged partner Balance" | ||
4362 | 643 | report_type="webkit" | ||
4363 | 644 | webkit_header="account_tax_webkit_header" /> | ||
4364 | 645 | |||
4365 | 646 | <report | ||
4366 | 647 | auto="False" | ||
4367 | 648 | menu="False" | ||
4368 | 649 | id="account_financial_report" | ||
4369 | 650 | model="account.account" | ||
4370 | 651 | name="account.financial.report.webkit" | ||
4371 | 652 | file="account_webkit/report/account_financial_report.mako" | ||
4372 | 653 | string="Account Financial Report" | ||
4373 | 654 | report_type="webkit" | ||
4374 | 655 | webkit_header="account_tax_webkit_header"/> | ||
4375 | 656 | |||
4376 | 657 | </data> | ||
4377 | 658 | </openerp> | ||
4378 | 0 | 659 | ||
4379 | === added directory 'account_webkit/report' | |||
4380 | === added file 'account_webkit/report/__init__.py' | |||
4381 | --- account_webkit/report/__init__.py 1970-01-01 00:00:00 +0000 | |||
4382 | +++ account_webkit/report/__init__.py 2013-10-10 09:47:29 +0000 | |||
4383 | @@ -0,0 +1,40 @@ | |||
4384 | 1 | # -*- coding: utf-8 -*- | ||
4385 | 2 | ############################################################################## | ||
4386 | 3 | # | ||
4387 | 4 | # OpenERP, Open Source Management Solution | ||
4388 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
4389 | 6 | # | ||
4390 | 7 | # This program is free software: you can redistribute it and/or modify | ||
4391 | 8 | # it under the terms of the GNU Affero General Public License as | ||
4392 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
4393 | 10 | # License, or (at your option) any later version. | ||
4394 | 11 | # | ||
4395 | 12 | # This program is distributed in the hope that it will be useful, | ||
4396 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4397 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4398 | 15 | # GNU Affero General Public License for more details. | ||
4399 | 16 | # | ||
4400 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
4401 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4402 | 19 | # | ||
4403 | 20 | ############################################################################ | ||
4404 | 21 | |||
4405 | 22 | |||
4406 | 23 | import account_central_journal | ||
4407 | 24 | import account_general_journal | ||
4408 | 25 | import account_journal | ||
4409 | 26 | import account_balance | ||
4410 | 27 | import account_partner_balance | ||
4411 | 28 | import account_general_ledger | ||
4412 | 29 | import account_partner_ledger | ||
4413 | 30 | #import invoice | ||
4414 | 31 | import account_print_invoice | ||
4415 | 32 | #import overdue | ||
4416 | 33 | import account_print_overdue | ||
4417 | 34 | import account_aged_partner_balance | ||
4418 | 35 | #import tax_report | ||
4419 | 36 | import account_tax_report | ||
4420 | 37 | import account_financial_report | ||
4421 | 38 | |||
4422 | 39 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | ||
4423 | 40 | |||
4424 | 0 | 41 | ||
4425 | === added file 'account_webkit/report/account_aged_partner_balance.mako' | |||
4426 | --- account_webkit/report/account_aged_partner_balance.mako 1970-01-01 00:00:00 +0000 | |||
4427 | +++ account_webkit/report/account_aged_partner_balance.mako 2013-10-10 09:47:29 +0000 | |||
4428 | @@ -0,0 +1,220 @@ | |||
4429 | 1 | <html> | ||
4430 | 2 | <head> | ||
4431 | 3 | <style type="text/css"> | ||
4432 | 4 | |||
4433 | 5 | table.mystyle{border-width: 0 0 0 0; | ||
4434 | 6 | border-spacing: 0; | ||
4435 | 7 | border-collapse: collapse; | ||
4436 | 8 | border-style: solid; | ||
4437 | 9 | border: 1px solid grey; | ||
4438 | 10 | font-size: 100%;} | ||
4439 | 11 | |||
4440 | 12 | .mystyle td, .mystyle th{ | ||
4441 | 13 | margin: 0; | ||
4442 | 14 | padding: 4px; | ||
4443 | 15 | border-width: 1px 1px 1px 1px; | ||
4444 | 16 | border-style: solid; | ||
4445 | 17 | border: 1px solid grey; | ||
4446 | 18 | font-size: 60%;} | ||
4447 | 19 | |||
4448 | 20 | table.mystyleone{border-width: 0 0 0 0; | ||
4449 | 21 | border-spacing: 0; | ||
4450 | 22 | border-collapse: collapse; | ||
4451 | 23 | border-color: black; | ||
4452 | 24 | font-weight:bold; | ||
4453 | 25 | border-style: solid; | ||
4454 | 26 | font-size: 100%;} | ||
4455 | 27 | |||
4456 | 28 | .mystyleone tr{ | ||
4457 | 29 | margin: 0; | ||
4458 | 30 | padding: 4px; | ||
4459 | 31 | border-width: 0 0 1px 0; | ||
4460 | 32 | border-color: black; | ||
4461 | 33 | font-weight:bold; | ||
4462 | 34 | border-style: solid; | ||
4463 | 35 | font-size: 60%;} | ||
4464 | 36 | </style> | ||
4465 | 37 | </head> | ||
4466 | 38 | |||
4467 | 39 | <body> | ||
4468 | 40 | |||
4469 | 41 | %for o in objects: | ||
4470 | 42 | </br> | ||
4471 | 43 | <center><h2>Aged Trial Balance</h2></center> | ||
4472 | 44 | |||
4473 | 45 | <table width="100%" class="mystyle"> | ||
4474 | 46 | <tr class="table_parent_data_header"> | ||
4475 | 47 | <td width="16%" class="cell"> | ||
4476 | 48 | <b>Chart of Accounts</b> | ||
4477 | 49 | </td> | ||
4478 | 50 | <td width="14%" class="cell"> | ||
4479 | 51 | <b>Fiscal Year</b> | ||
4480 | 52 | </td> | ||
4481 | 53 | <td width="14%" class="cell"> | ||
4482 | 54 | <b>Start Date</b> | ||
4483 | 55 | </td> | ||
4484 | 56 | <td width="14%" class="cell"> | ||
4485 | 57 | <b>Period Length(days)</b> | ||
4486 | 58 | </td> | ||
4487 | 59 | <td width="14%" class="cell"> | ||
4488 | 60 | <b>Partner's</b> | ||
4489 | 61 | </td> | ||
4490 | 62 | <td width="16%" class="cell"> | ||
4491 | 63 | <b>Analysis Direction</b> | ||
4492 | 64 | </td> | ||
4493 | 65 | <td width="14%" class="cell"> | ||
4494 | 66 | <b>Target Moves</b> | ||
4495 | 67 | </td> | ||
4496 | 68 | </tr> | ||
4497 | 69 | |||
4498 | 70 | <tr class="table_child_data_header"> | ||
4499 | 71 | <td width="16%" class="cell"> | ||
4500 | 72 | ${get_account(data) or ''} | ||
4501 | 73 | </td> | ||
4502 | 74 | <td width="14%" class="cell"> | ||
4503 | 75 | ${get_fiscalyear(data) or ''} | ||
4504 | 76 | </td> | ||
4505 | 77 | <td width="14%" class="cell"> | ||
4506 | 78 | ${formatLang(data['form']['date_from'],date=True)} | ||
4507 | 79 | </td> | ||
4508 | 80 | <td width="14%" class="cell"> | ||
4509 | 81 | ${data['form']['period_length'] } | ||
4510 | 82 | </td> | ||
4511 | 83 | <td width="14%" class="cell"> | ||
4512 | 84 | ${get_partners(data)} | ||
4513 | 85 | </td> | ||
4514 | 86 | <td width="16%" class="cell"> | ||
4515 | 87 | ${data['form']['direction_selection']} | ||
4516 | 88 | </td> | ||
4517 | 89 | <td width="14%" class="cell"> | ||
4518 | 90 | ${get_target_move(data)} | ||
4519 | 91 | </td> | ||
4520 | 92 | </tr> | ||
4521 | 93 | </table> | ||
4522 | 94 | </br></br> | ||
4523 | 95 | |||
4524 | 96 | <table width="100%" class="mystyleone"> | ||
4525 | 97 | <tr class="table_parent_data"> | ||
4526 | 98 | <td width="23%"> | ||
4527 | 99 | Partners | ||
4528 | 100 | </td> | ||
4529 | 101 | <% | ||
4530 | 102 | direction = '' | ||
4531 | 103 | if data['form']['direction_selection'] == 'future': | ||
4532 | 104 | direction = 'Due' | ||
4533 | 105 | else: | ||
4534 | 106 | direction = 'Not due' | ||
4535 | 107 | %> | ||
4536 | 108 | <td width="11%" > | ||
4537 | 109 | ${direction} | ||
4538 | 110 | </td> | ||
4539 | 111 | <td width="11%" > | ||
4540 | 112 | ${ data['form']['4']['name']} | ||
4541 | 113 | </td><td width="11%" > | ||
4542 | 114 | ${ data['form']['3']['name']} | ||
4543 | 115 | </td> | ||
4544 | 116 | <td width="11%" > | ||
4545 | 117 | ${ data['form']['2']['name']} | ||
4546 | 118 | </td> | ||
4547 | 119 | <td width="11%" > | ||
4548 | 120 | ${ data['form']['1']['name']} | ||
4549 | 121 | </td> | ||
4550 | 122 | <td width="11%" > | ||
4551 | 123 | ${ data['form']['0']['name']} | ||
4552 | 124 | </td> | ||
4553 | 125 | <td width="11%" > | ||
4554 | 126 | ${_('Total')} | ||
4555 | 127 | </td> | ||
4556 | 128 | </tr> | ||
4557 | 129 | |||
4558 | 130 | |||
4559 | 131 | %if get_lines(data['form']) != False or get_lines_with_out_partner(data['form']) != False: | ||
4560 | 132 | <tr class="table_parent_data"> | ||
4561 | 133 | <td width="23%"> | ||
4562 | 134 | ${_('Account Total')} | ||
4563 | 135 | </td> | ||
4564 | 136 | <td width="11%" > | ||
4565 | 137 | ${formatLang(get_direction('6'), currency_obj=company.currency_id)} | ||
4566 | 138 | </td> | ||
4567 | 139 | <td width="11%" > | ||
4568 | 140 | ${ formatLang(get_for_period('4'), currency_obj=company.currency_id)} | ||
4569 | 141 | </td><td width="11%" > | ||
4570 | 142 | ${ formatLang(get_for_period('3'), currency_obj=company.currency_id)} | ||
4571 | 143 | </td> | ||
4572 | 144 | <td width="11%" > | ||
4573 | 145 | ${ formatLang(get_for_period('2'), currency_obj=company.currency_id)} | ||
4574 | 146 | </td> | ||
4575 | 147 | <td width="11%" > | ||
4576 | 148 | ${ formatLang(get_for_period('1'), currency_obj=company.currency_id)} | ||
4577 | 149 | </td> | ||
4578 | 150 | <td width="11%" > | ||
4579 | 151 | ${ formatLang(get_for_period('0'), currency_obj=company.currency_id)} | ||
4580 | 152 | </td> | ||
4581 | 153 | <td width="11%" > | ||
4582 | 154 | ${formatLang(get_total('5'), currency_obj=company.currency_id)} | ||
4583 | 155 | </td> | ||
4584 | 156 | </tr> | ||
4585 | 157 | |||
4586 | 158 | |||
4587 | 159 | %for partner in get_lines(data['form']): | ||
4588 | 160 | <tr class="table_child_data"> | ||
4589 | 161 | <td width="23%"> | ||
4590 | 162 | ${partner['name']} | ||
4591 | 163 | </td> | ||
4592 | 164 | <td width="11%" > | ||
4593 | 165 | ${formatLang(partner['direction'], currency_obj=company.currency_id)} | ||
4594 | 166 | </td> | ||
4595 | 167 | <td width="11%" > | ||
4596 | 168 | ${ formatLang(partner['4'], currency_obj=company.currency_id)} | ||
4597 | 169 | </td><td width="11%" > | ||
4598 | 170 | ${ formatLang(partner['3'], currency_obj=company.currency_id)} | ||
4599 | 171 | </td> | ||
4600 | 172 | <td width="11%" > | ||
4601 | 173 | ${ formatLang(partner['2'], currency_obj=company.currency_id)} | ||
4602 | 174 | </td> | ||
4603 | 175 | <td width="11%" > | ||
4604 | 176 | ${ formatLang(partner['1'], currency_obj=company.currency_id)} | ||
4605 | 177 | </td> | ||
4606 | 178 | <td width="11%" > | ||
4607 | 179 | ${ formatLang(partner['0'], currency_obj=company.currency_id)} | ||
4608 | 180 | </td> | ||
4609 | 181 | <td width="11%" > | ||
4610 | 182 | ${formatLang(partner['total'], currency_obj=company.currency_id)} | ||
4611 | 183 | </td> | ||
4612 | 184 | </tr> | ||
4613 | 185 | %endfor | ||
4614 | 186 | |||
4615 | 187 | %for not_partner in get_lines_with_out_partner(data['form']): | ||
4616 | 188 | <tr class="table_child_data"> | ||
4617 | 189 | <td width="23%"> | ||
4618 | 190 | ${not_partner['name']} | ||
4619 | 191 | </td> | ||
4620 | 192 | <td width="11%" > | ||
4621 | 193 | ${formatLang(not_partner['direction'], currency_obj=company.currency_id)} | ||
4622 | 194 | </td> | ||
4623 | 195 | <td width="11%" > | ||
4624 | 196 | ${ formatLang(not_partner['4'], currency_obj=company.currency_id)} | ||
4625 | 197 | </td><td width="11%" > | ||
4626 | 198 | ${ formatLang(not_partner['3'], currency_obj=company.currency_id)} | ||
4627 | 199 | </td> | ||
4628 | 200 | <td width="11%" > | ||
4629 | 201 | ${ formatLang(not_partner['2'], currency_obj=company.currency_id)} | ||
4630 | 202 | </td> | ||
4631 | 203 | <td width="11%" > | ||
4632 | 204 | ${ formatLang(not_partner['1'], currency_obj=company.currency_id)} | ||
4633 | 205 | </td> | ||
4634 | 206 | <td width="11%" > | ||
4635 | 207 | ${ formatLang(not_partner['0'], currency_obj=company.currency_id)} | ||
4636 | 208 | </td> | ||
4637 | 209 | <td width="11%" > | ||
4638 | 210 | ${formatLang(not_partner['total'], currency_obj=company.currency_id)} | ||
4639 | 211 | </td> | ||
4640 | 212 | </tr> | ||
4641 | 213 | %endfor | ||
4642 | 214 | %endif | ||
4643 | 215 | |||
4644 | 216 | </table > | ||
4645 | 217 | %endfor | ||
4646 | 218 | |||
4647 | 219 | </body> | ||
4648 | 220 | </html> | ||
4649 | 0 | \ No newline at end of file | 221 | \ No newline at end of file |
4650 | 1 | 222 | ||
4651 | === added file 'account_webkit/report/account_aged_partner_balance.py' | |||
4652 | --- account_webkit/report/account_aged_partner_balance.py 1970-01-01 00:00:00 +0000 | |||
4653 | +++ account_webkit/report/account_aged_partner_balance.py 2013-10-10 09:47:29 +0000 | |||
4654 | @@ -0,0 +1,383 @@ | |||
4655 | 1 | # -*- coding: utf-8 -*- | ||
4656 | 2 | ############################################################################## | ||
4657 | 3 | # | ||
4658 | 4 | # OpenERP, Open Source Management Solution | ||
4659 | 5 | # Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>) | ||
4660 | 6 | # | ||
4661 | 7 | # This program is free software: you can redistribute it and/or modify | ||
4662 | 8 | # it under the terms of the GNU Affero General Public License as | ||
4663 | 9 | # published by the Free Software Foundation, either version 3 of the | ||
4664 | 10 | # License, or (at your option) any later version. | ||
4665 | 11 | # | ||
4666 | 12 | # This program is distributed in the hope that it will be useful, | ||
4667 | 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
4668 | 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
4669 | 15 | # GNU Affero General Public License for more details. | ||
4670 | 16 | # | ||
4671 | 17 | # You should have received a copy of the GNU Affero General Public License | ||
4672 | 18 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
4673 | 19 | # | ||
4674 | 20 | ############################################################################ | ||
4675 | 21 | |||
4676 | 22 | import time | ||
4677 | 23 | from openerp.report import report_sxw | ||
4678 | 24 | from openerp.osv import osv | ||
4679 | 25 | from account.report.common_report_header import common_report_header | ||
4680 | 26 | |||
4681 | 27 | class aged_trial_report(report_sxw.rml_parse, common_report_header): | ||
4682 | 28 | |||
4683 | 29 | def __init__(self, cr, uid, name, context): | ||
4684 | 30 | super(aged_trial_report, self).__init__(cr, uid, name, context=context) | ||
4685 | 31 | self.total_account = [] | ||
4686 | 32 | self.localcontext.update({ | ||
4687 | 33 | 'time': time, | ||
4688 | 34 | 'get_lines_with_out_partner': self._get_lines_with_out_partner, | ||
4689 | 35 | 'get_lines': self._get_lines, | ||
4690 | 36 | 'get_total': self._get_total, | ||
4691 | 37 | 'get_direction': self._get_direction, | ||
4692 | 38 | 'get_for_period': self._get_for_period, | ||
4693 | 39 | 'get_company': self._get_company, | ||
4694 | 40 | 'get_currency': self._get_currency, | ||
4695 | 41 | 'get_partners':self._get_partners, | ||
4696 | 42 | 'get_account': self._get_account, | ||
4697 | 43 | 'get_fiscalyear': self._get_fiscalyear, | ||
4698 | 44 | 'get_target_move': self._get_target_move, | ||
4699 | 45 | }) | ||
4700 | 46 | |||
4701 | 47 | def set_context(self, objects, data, ids, report_type=None): | ||
4702 | 48 | obj_move = self.pool.get('account.move.line') | ||
4703 | 49 | ctx = data['form'].get('used_context', {}) | ||
4704 | 50 | ctx.update({'fiscalyear': False, 'all_fiscalyear': True}) | ||
4705 | 51 | self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx) | ||
4706 | 52 | self.direction_selection = data['form'].get('direction_selection', 'past') | ||
4707 | 53 | self.target_move = data['form'].get('target_move', 'all') | ||
4708 | 54 | self.date_from = data['form'].get('date_from', time.strftime('%Y-%m-%d')) | ||
4709 | 55 | if (data['form']['result_selection'] == 'customer' ): | ||
4710 | 56 | self.ACCOUNT_TYPE = ['receivable'] | ||
4711 | 57 | elif (data['form']['result_selection'] == 'supplier'): | ||
4712 | 58 | self.ACCOUNT_TYPE = ['payable'] | ||
4713 | 59 | else: | ||
4714 | 60 | self.ACCOUNT_TYPE = ['payable','receivable'] | ||
4715 | 61 | return super(aged_trial_report, self).set_context(objects, data, ids, report_type=report_type) | ||
4716 | 62 | |||
4717 | 63 | def _get_lines(self, form): | ||
4718 | 64 | res = [] | ||
4719 | 65 | move_state = ['draft','posted'] | ||
4720 | 66 | if self.target_move == 'posted': | ||
4721 | 67 | move_state = ['posted'] | ||
4722 | 68 | self.cr.execute('SELECT DISTINCT res_partner.id AS id,\ | ||
4723 | 69 | res_partner.name AS name \ | ||
4724 | 70 | FROM res_partner,account_move_line AS l, account_account, account_move am\ | ||
4725 | 71 | WHERE (l.account_id=account_account.id) \ | ||
4726 | 72 | AND (l.move_id=am.id) \ | ||
4727 | 73 | AND (am.state IN %s)\ | ||
4728 | 74 | AND (account_account.type IN %s)\ | ||
4729 | 75 | AND account_account.active\ | ||
4730 | 76 | AND ((reconcile_id IS NULL)\ | ||
4731 | 77 | OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | ||
4732 | 78 | AND (l.partner_id=res_partner.id)\ | ||
4733 | 79 | AND (l.date <= %s)\ | ||
4734 | 80 | AND ' + self.query + ' \ | ||
4735 | 81 | ORDER BY res_partner.name', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,)) | ||
4736 | 82 | partners = self.cr.dictfetchall() | ||
4737 | 83 | ## mise a 0 du total | ||
4738 | 84 | for i in range(7): | ||
4739 | 85 | self.total_account.append(0) | ||
4740 | 86 | # | ||
4741 | 87 | # Build a string like (1,2,3) for easy use in SQL query | ||
4742 | 88 | partner_ids = [x['id'] for x in partners] | ||
4743 | 89 | if not partner_ids: | ||
4744 | 90 | return [] | ||
4745 | 91 | # This dictionary will store the debit-credit for all partners, using partner_id as key. | ||
4746 | 92 | |||
4747 | 93 | totals = {} | ||
4748 | 94 | self.cr.execute('SELECT l.partner_id, SUM(l.debit-l.credit) \ | ||
4749 | 95 | FROM account_move_line AS l, account_account, account_move am \ | ||
4750 | 96 | WHERE (l.account_id = account_account.id) AND (l.move_id=am.id) \ | ||
4751 | 97 | AND (am.state IN %s)\ | ||
4752 | 98 | AND (account_account.type IN %s)\ | ||
4753 | 99 | AND (l.partner_id IN %s)\ | ||
4754 | 100 | AND ((l.reconcile_id IS NULL)\ | ||
4755 | 101 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | ||
4756 | 102 | AND ' + self.query + '\ | ||
4757 | 103 | AND account_account.active\ | ||
4758 | 104 | AND (l.date <= %s)\ | ||
4759 | 105 | GROUP BY l.partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from, self.date_from,)) | ||
4760 | 106 | t = self.cr.fetchall() | ||
4761 | 107 | for i in t: | ||
4762 | 108 | totals[i[0]] = i[1] | ||
4763 | 109 | |||
4764 | 110 | # This dictionary will store the future or past of all partners | ||
4765 | 111 | future_past = {} | ||
4766 | 112 | if self.direction_selection == 'future': | ||
4767 | 113 | self.cr.execute('SELECT l.partner_id, SUM(l.debit-l.credit) \ | ||
4768 | 114 | FROM account_move_line AS l, account_account, account_move am \ | ||
4769 | 115 | WHERE (l.account_id=account_account.id) AND (l.move_id=am.id) \ | ||
4770 | 116 | AND (am.state IN %s)\ | ||
4771 | 117 | AND (account_account.type IN %s)\ | ||
4772 | 118 | AND (COALESCE(l.date_maturity, l.date) < %s)\ | ||
4773 | 119 | AND (l.partner_id IN %s)\ | ||
4774 | 120 | AND ((l.reconcile_id IS NULL)\ | ||
4775 | 121 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | ||
4776 | 122 | AND '+ self.query + '\ | ||
4777 | 123 | AND account_account.active\ | ||
4778 | 124 | AND (l.date <= %s)\ | ||
4779 | 125 | GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids),self.date_from, self.date_from,)) | ||
4780 | 126 | t = self.cr.fetchall() | ||
4781 | 127 | for i in t: | ||
4782 | 128 | future_past[i[0]] = i[1] | ||
4783 | 129 | elif self.direction_selection == 'past': # Using elif so people could extend without this breaking | ||
4784 | 130 | self.cr.execute('SELECT l.partner_id, SUM(l.debit-l.credit) \ | ||
4785 | 131 | FROM account_move_line AS l, account_account, account_move am \ | ||
4786 | 132 | WHERE (l.account_id=account_account.id) AND (l.move_id=am.id)\ | ||
4787 | 133 | AND (am.state IN %s)\ | ||
4788 | 134 | AND (account_account.type IN %s)\ | ||
4789 | 135 | AND (COALESCE(l.date_maturity,l.date) > %s)\ | ||
4790 | 136 | AND (l.partner_id IN %s)\ | ||
4791 | 137 | AND ((l.reconcile_id IS NULL)\ | ||
4792 | 138 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | ||
4793 | 139 | AND '+ self.query + '\ | ||
4794 | 140 | AND account_account.active\ | ||
4795 | 141 | AND (l.date <= %s)\ | ||
4796 | 142 | GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from, self.date_from,)) | ||
4797 | 143 | t = self.cr.fetchall() | ||
4798 | 144 | for i in t: | ||
4799 | 145 | future_past[i[0]] = i[1] | ||
4800 | 146 | |||
4801 | 147 | # Use one query per period and store results in history (a list variable) | ||
4802 | 148 | # Each history will contain: history[1] = {'<partner_id>': <partner_debit-credit>} | ||
4803 | 149 | history = [] | ||
4804 | 150 | for i in range(5): | ||
4805 | 151 | args_list = (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids),self.date_from,) | ||
4806 | 152 | dates_query = '(COALESCE(l.date_maturity,l.date)' | ||
4807 | 153 | if form[str(i)]['start'] and form[str(i)]['stop']: | ||
4808 | 154 | dates_query += ' BETWEEN %s AND %s)' | ||
4809 | 155 | args_list += (form[str(i)]['start'], form[str(i)]['stop']) | ||
4810 | 156 | elif form[str(i)]['start']: | ||
4811 | 157 | dates_query += ' > %s)' | ||
4812 | 158 | args_list += (form[str(i)]['start'],) | ||
4813 | 159 | else: | ||
4814 | 160 | dates_query += ' < %s)' | ||
4815 | 161 | args_list += (form[str(i)]['stop'],) | ||
4816 | 162 | args_list += (self.date_from,) | ||
4817 | 163 | self.cr.execute('''SELECT l.partner_id, SUM(l.debit-l.credit) | ||
4818 | 164 | FROM account_move_line AS l, account_account, account_move am | ||
4819 | 165 | WHERE (l.account_id = account_account.id) AND (l.move_id=am.id) | ||
4820 | 166 | AND (am.state IN %s) | ||
4821 | 167 | AND (account_account.type IN %s) | ||
4822 | 168 | AND (l.partner_id IN %s) | ||
4823 | 169 | AND ((l.reconcile_id IS NULL) | ||
4824 | 170 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s ))) | ||
4825 | 171 | AND ''' + self.query + ''' | ||
4826 | 172 | AND account_account.active | ||
4827 | 173 | AND ''' + dates_query + ''' | ||
4828 | 174 | AND (l.date <= %s) | ||
4829 | 175 | GROUP BY l.partner_id''', args_list) | ||
4830 | 176 | t = self.cr.fetchall() | ||
4831 | 177 | d = {} | ||
4832 | 178 | for i in t: | ||
4833 | 179 | d[i[0]] = i[1] | ||
4834 | 180 | history.append(d) | ||
4835 | 181 | |||
4836 | 182 | for partner in partners: | ||
4837 | 183 | values = {} | ||
4838 | 184 | ## If choise selection is in the future | ||
4839 | 185 | if self.direction_selection == 'future': | ||
4840 | 186 | # Query here is replaced by one query which gets the all the partners their 'before' value | ||
4841 | 187 | before = False | ||
4842 | 188 | if future_past.has_key(partner['id']): | ||
4843 | 189 | before = [ future_past[partner['id']] ] | ||
4844 | 190 | self.total_account[6] = self.total_account[6] + (before and before[0] or 0.0) | ||
4845 | 191 | values['direction'] = before and before[0] or 0.0 | ||
4846 | 192 | elif self.direction_selection == 'past': # Changed this so people could in the future create new direction_selections | ||
4847 | 193 | # Query here is replaced by one query which gets the all the partners their 'after' value | ||
4848 | 194 | after = False | ||
4849 | 195 | if future_past.has_key(partner['id']): # Making sure this partner actually was found by the query | ||
4850 | 196 | after = [ future_past[partner['id']] ] | ||
4851 | 197 | |||
4852 | 198 | self.total_account[6] = self.total_account[6] + (after and after[0] or 0.0) | ||
4853 | 199 | values['direction'] = after and after[0] or 0.0 | ||
4854 | 200 | |||
4855 | 201 | for i in range(5): | ||
4856 | 202 | during = False | ||
4857 | 203 | if history[i].has_key(partner['id']): | ||
4858 | 204 | during = [ history[i][partner['id']] ] | ||
4859 | 205 | # Ajout du compteur | ||
4860 | 206 | self.total_account[(i)] = self.total_account[(i)] + (during and during[0] or 0) | ||
4861 | 207 | values[str(i)] = during and during[0] or 0.0 | ||
4862 | 208 | total = False | ||
4863 | 209 | if totals.has_key( partner['id'] ): | ||
4864 | 210 | total = [ totals[partner['id']] ] | ||
4865 | 211 | values['total'] = total and total[0] or 0.0 | ||
4866 | 212 | ## Add for total | ||
4867 | 213 | self.total_account[(i+1)] = self.total_account[(i+1)] + (total and total[0] or 0.0) | ||
4868 | 214 | values['name'] = partner['name'] | ||
4869 | 215 | |||
4870 | 216 | res.append(values) | ||
4871 | 217 | |||
4872 | 218 | total = 0.0 | ||
4873 | 219 | totals = {} | ||
4874 | 220 | for r in res: | ||
4875 | 221 | total += float(r['total'] or 0.0) | ||
4876 | 222 | for i in range(5)+['direction']: | ||
4877 | 223 | totals.setdefault(str(i), 0.0) | ||
4878 | 224 | totals[str(i)] += float(r[str(i)] or 0.0) | ||
4879 | 225 | return res | ||
4880 | 226 | |||
4881 | 227 | def _get_lines_with_out_partner(self, form): | ||
4882 | 228 | res = [] | ||
4883 | 229 | move_state = ['draft','posted'] | ||
4884 | 230 | if self.target_move == 'posted': | ||
4885 | 231 | move_state = ['posted'] | ||
4886 | 232 | |||
4887 | 233 | ## mise a 0 du total | ||
4888 | 234 | for i in range(7): | ||
4889 | 235 | self.total_account.append(0) | ||
4890 | 236 | totals = {} | ||
4891 | 237 | self.cr.execute('SELECT SUM(l.debit-l.credit) \ | ||
4892 | 238 | FROM account_move_line AS l, account_account, account_move am \ | ||
4893 | 239 | WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\ | ||
4894 | 240 | AND (am.state IN %s)\ | ||
4895 | 241 | AND (l.partner_id IS NULL)\ | ||
4896 | 242 | AND (account_account.type IN %s)\ | ||
4897 | 243 | AND ((l.reconcile_id IS NULL) \ | ||
4898 | 244 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | ||
4899 | 245 | AND ' + self.query + '\ | ||
4900 | 246 | AND (l.date <= %s)\ | ||
4901 | 247 | AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from,)) | ||
4902 | 248 | t = self.cr.fetchall() | ||
4903 | 249 | for i in t: | ||
4904 | 250 | totals['Unknown Partner'] = i[0] | ||
4905 | 251 | future_past = {} | ||
4906 | 252 | if self.direction_selection == 'future': | ||
4907 | 253 | self.cr.execute('SELECT SUM(l.debit-l.credit) \ | ||
4908 | 254 | FROM account_move_line AS l, account_account, account_move am\ | ||
4909 | 255 | WHERE (l.account_id=account_account.id) AND (l.move_id=am.id)\ | ||
4910 | 256 | AND (am.state IN %s)\ | ||
4911 | 257 | AND (l.partner_id IS NULL)\ | ||
4912 | 258 | AND (account_account.type IN %s)\ | ||
4913 | 259 | AND (COALESCE(l.date_maturity, l.date) < %s)\ | ||
4914 | 260 | AND ((l.reconcile_id IS NULL)\ | ||
4915 | 261 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | ||
4916 | 262 | AND '+ self.query + '\ | ||
4917 | 263 | AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from)) | ||
4918 | 264 | t = self.cr.fetchall() | ||
4919 | 265 | for i in t: | ||
4920 | 266 | future_past['Unknown Partner'] = i[0] | ||
4921 | 267 | elif self.direction_selection == 'past': # Using elif so people could extend without this breaking | ||
4922 | 268 | self.cr.execute('SELECT SUM(l.debit-l.credit) \ | ||
4923 | 269 | FROM account_move_line AS l, account_account, account_move am \ | ||
4924 | 270 | WHERE (l.account_id=account_account.id) AND (l.move_id=am.id)\ | ||
4925 | 271 | AND (am.state IN %s)\ | ||
4926 | 272 | AND (l.partner_id IS NULL)\ | ||
4927 | 273 | AND (account_account.type IN %s)\ | ||
4928 | 274 | AND (COALESCE(l.date_maturity,l.date) > %s)\ | ||
4929 | 275 | AND ((l.reconcile_id IS NULL)\ | ||
4930 | 276 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | ||
4931 | 277 | AND '+ self.query + '\ | ||
4932 | 278 | AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from)) | ||
4933 | 279 | t = self.cr.fetchall() | ||
4934 | 280 | for i in t: | ||
4935 | 281 | future_past['Unknown Partner'] = i[0] | ||
4936 | 282 | history = [] | ||
4937 | 283 | |||
4938 | 284 | for i in range(5): | ||
4939 | 285 | args_list = (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from,) | ||
4940 | 286 | dates_query = '(COALESCE(l.date_maturity,l.date)' | ||
4941 | 287 | if form[str(i)]['start'] and form[str(i)]['stop']: | ||
4942 | 288 | dates_query += ' BETWEEN %s AND %s)' | ||
4943 | 289 | args_list += (form[str(i)]['start'], form[str(i)]['stop']) | ||
4944 | 290 | elif form[str(i)]['start']: | ||
4945 | 291 | dates_query += ' > %s)' | ||
4946 | 292 | args_list += (form[str(i)]['start'],) | ||
4947 | 293 | else: | ||
4948 | 294 | dates_query += ' < %s)' | ||
4949 | 295 | args_list += (form[str(i)]['stop'],) | ||
4950 | 296 | args_list += (self.date_from,) | ||
4951 | 297 | self.cr.execute('SELECT SUM(l.debit-l.credit)\ | ||
4952 | 298 | FROM account_move_line AS l, account_account, account_move am \ | ||
4953 | 299 | WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\ | ||
4954 | 300 | AND (am.state IN %s)\ | ||
4955 | 301 | AND (account_account.type IN %s)\ | ||
4956 | 302 | AND (l.partner_id IS NULL)\ | ||
4957 | 303 | AND ((l.reconcile_id IS NULL)\ | ||
4958 | 304 | OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\ | ||
4959 | 305 | AND '+ self.query + '\ | ||
4960 | 306 | AND account_account.active\ | ||
4961 | 307 | AND ' + dates_query + '\ | ||
4962 | 308 | AND (l.date <= %s)\ | ||
4963 | 309 | GROUP BY l.partner_id', args_list) | ||
4964 | 310 | t = self.cr.fetchall() | ||
4965 | 311 | d = {} | ||
4966 | 312 | for i in t: | ||
4967 | 313 | d['Unknown Partner'] = i[0] | ||
4968 | 314 | history.append(d) | ||
4969 | 315 | |||
4970 | 316 | values = {} | ||
4971 | 317 | if self.direction_selection == 'future': | ||
4972 | 318 | before = False | ||
4973 | 319 | if future_past.has_key('Unknown Partner'): | ||
4974 | 320 | before = [ future_past['Unknown Partner'] ] | ||
4975 | 321 | self.total_account[6] = self.total_account[6] + (before and before[0] or 0.0) | ||
4976 | 322 | values['direction'] = before and before[0] or 0.0 | ||
4977 | 323 | elif self.direction_selection == 'past': | ||
4978 | 324 | after = False | ||
4979 | 325 | if future_past.has_key('Unknown Partner'): | ||
4980 | 326 | after = [ future_past['Unknown Partner'] ] | ||
4981 | 327 | self.total_account[6] = self.total_account[6] + (after and after[0] or 0.0) | ||
4982 | 328 | values['direction'] = after and after[0] or 0.0 | ||
4983 | 329 | |||
4984 | 330 | for i in range(5): | ||
4985 | 331 | during = False | ||
4986 | 332 | if history[i].has_key('Unknown Partner'): | ||
4987 | 333 | during = [ history[i]['Unknown Partner'] ] | ||
4988 | 334 | self.total_account[(i)] = self.total_account[(i)] + (during and during[0] or 0) | ||
4989 | 335 | values[str(i)] = during and during[0] or 0.0 | ||
4990 | 336 | |||
4991 | 337 | total = False | ||
4992 | 338 | if totals.has_key( 'Unknown Partner' ): | ||
4993 | 339 | total = [ totals['Unknown Partner'] ] | ||
4994 | 340 | values['total'] = total and total[0] or 0.0 | ||
4995 | 341 | ## Add for total | ||
4996 | 342 | self.total_account[(i+1)] = self.total_account[(i+1)] + (total and total[0] or 0.0) | ||
4997 | 343 | values['name'] = 'Unknown Partner' | ||
4998 | 344 | |||
4999 | 345 | if values['total']: | ||
5000 | 346 | res.append(values) |
The diff has been truncated for viewing.
Could you take the time to bring this to the 7.0 community addons coding conventions. This includes:
* not using the shortcut imports (things in the openerp namespace need to be imported from openerp)
* using the from . import xxx for relative imports (typically in __init__.py files)
* using orm.Model and orm.TransientModel as base class rather than osv.osv and osv.osv_memory
* not instanciating the model classes
* following PEP8 for spacing, line wrapping, etc.
Thanks