Merge lp:~openobject-italia-core-devs/openobject-italia/adding_l10n_it_tax_journal into lp:~openobject-italia-core-devs/openobject-italia/italian-addons
- adding_l10n_it_tax_journal
- Merge into italian-addons
Proposed by
Lorenzo Battistini
Status: | Merged |
---|---|
Merged at revision: | 121 |
Proposed branch: | lp:~openobject-italia-core-devs/openobject-italia/adding_l10n_it_tax_journal |
Merge into: | lp:~openobject-italia-core-devs/openobject-italia/italian-addons |
Diff against target: |
1317 lines (+1239/-0) 15 files modified
l10n_it_vat_registries/AUTHORS.txt (+2/-0) l10n_it_vat_registries/__init__.py (+25/-0) l10n_it_vat_registries/__openerp__.py (+41/-0) l10n_it_vat_registries/account.py (+46/-0) l10n_it_vat_registries/account_view.xml (+17/-0) l10n_it_vat_registries/i18n/it.po (+185/-0) l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot (+185/-0) l10n_it_vat_registries/invoice.py (+163/-0) l10n_it_vat_registries/reports.xml (+112/-0) l10n_it_vat_registries/templates/registro_iva_acquisti.mako (+106/-0) l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako (+80/-0) l10n_it_vat_registries/templates/registro_iva_vendite.mako (+99/-0) l10n_it_vat_registries/wizard/__init__.py (+23/-0) l10n_it_vat_registries/wizard/print_registro_iva.py (+114/-0) l10n_it_vat_registries/wizard/print_registro_iva.xml (+41/-0) |
To merge this branch: | bzr merge lp:~openobject-italia-core-devs/openobject-italia/adding_l10n_it_tax_journal |
Related bugs: | |
Related blueprints: |
Registrazioni IVA
(High)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Davide Corio (community) | Approve | ||
Review via email: mp+71277@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
- 131. By Lorenzo Battistini
-
[FIX] coding
- 132. By Lorenzo Battistini
-
[IMP] non VAT management
- 133. By Lorenzo Battistini
-
[imp] translation
Revision history for this message
Davide Corio (enlightx-deactivatedaccount) wrote : | # |
review:
Approve
- 134. By Lorenzo Battistini
-
[DEL] old odt templates
- 135. By Lorenzo Battistini
-
[DEL] l10n_it_
vat_registries_ aeroo moved to https:/ /code.launchpad .net/~openobjec t-italia- core-devs/ openobject- italia/ l10n_it_ vat_registries_ aeroo
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'l10n_it_vat_registries' | |||
2 | === added file 'l10n_it_vat_registries/AUTHORS.txt' | |||
3 | --- l10n_it_vat_registries/AUTHORS.txt 1970-01-01 00:00:00 +0000 | |||
4 | +++ l10n_it_vat_registries/AUTHORS.txt 2011-08-24 09:56:24 +0000 | |||
5 | @@ -0,0 +1,2 @@ | |||
6 | 1 | Lorenzo Battistini <lorenzo.battistini@domsense.com> | ||
7 | 2 | Ingrid Barcaro | ||
8 | 0 | 3 | ||
9 | === added file 'l10n_it_vat_registries/__init__.py' | |||
10 | --- l10n_it_vat_registries/__init__.py 1970-01-01 00:00:00 +0000 | |||
11 | +++ l10n_it_vat_registries/__init__.py 2011-08-24 09:56:24 +0000 | |||
12 | @@ -0,0 +1,25 @@ | |||
13 | 1 | # -*- coding: utf-8 -*- | ||
14 | 2 | ############################################################################## | ||
15 | 3 | # | ||
16 | 4 | # Copyright (C) 2011 Associazione OpenERP Italia | ||
17 | 5 | # (<http://www.openerp-italia.org>). | ||
18 | 6 | # All Rights Reserved | ||
19 | 7 | # | ||
20 | 8 | # This program is free software: you can redistribute it and/or modify | ||
21 | 9 | # it under the terms of the GNU Affero General Public License as published | ||
22 | 10 | # by the Free Software Foundation, either version 3 of the License, or | ||
23 | 11 | # (at your option) any later version. | ||
24 | 12 | # | ||
25 | 13 | # This program is distributed in the hope that it will be useful, | ||
26 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
27 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
28 | 16 | # GNU General Public License for more details. | ||
29 | 17 | # | ||
30 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
31 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
32 | 20 | # | ||
33 | 21 | ############################################################################## | ||
34 | 22 | |||
35 | 23 | import wizard | ||
36 | 24 | import account | ||
37 | 25 | import invoice | ||
38 | 0 | 26 | ||
39 | === added file 'l10n_it_vat_registries/__openerp__.py' | |||
40 | --- l10n_it_vat_registries/__openerp__.py 1970-01-01 00:00:00 +0000 | |||
41 | +++ l10n_it_vat_registries/__openerp__.py 2011-08-24 09:56:24 +0000 | |||
42 | @@ -0,0 +1,41 @@ | |||
43 | 1 | # -*- coding: utf-8 -*- | ||
44 | 2 | ############################################################################## | ||
45 | 3 | # | ||
46 | 4 | # Copyright (C) 2011 Associazione OpenERP Italia | ||
47 | 5 | # (<http://www.openerp-italia.org>). | ||
48 | 6 | # All Rights Reserved | ||
49 | 7 | # | ||
50 | 8 | # This program is free software: you can redistribute it and/or modify | ||
51 | 9 | # it under the terms of the GNU Affero General Public License as published | ||
52 | 10 | # by the Free Software Foundation, either version 3 of the License, or | ||
53 | 11 | # (at your option) any later version. | ||
54 | 12 | # | ||
55 | 13 | # This program is distributed in the hope that it will be useful, | ||
56 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
57 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
58 | 16 | # GNU General Public License for more details. | ||
59 | 17 | # | ||
60 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
61 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
62 | 20 | # | ||
63 | 21 | ############################################################################## | ||
64 | 22 | { | ||
65 | 23 | 'name': 'Italian Localisation - VAT Registries', | ||
66 | 24 | 'version': '0.1', | ||
67 | 25 | 'category': 'Localisation/Italy', | ||
68 | 26 | 'description': """Accounting reports for Italian localization - VAT Registries\nhttp://wiki.openerp-italia.org/doku.php/moduli/l10n_it_tax_journal""", | ||
69 | 27 | 'author': 'OpenERP Italian Community', | ||
70 | 28 | 'website': 'http://www.openerp-italia.org', | ||
71 | 29 | 'license': 'AGPL-3', | ||
72 | 30 | "depends" : ['l10n_it_base', 'report_webkit', 'l10n_it_account', 'l10n_it_corrispettivi'], | ||
73 | 31 | "init_xml" : [ | ||
74 | 32 | ], | ||
75 | 33 | "update_xml" : [ | ||
76 | 34 | 'reports.xml', | ||
77 | 35 | 'account_view.xml', | ||
78 | 36 | 'wizard/print_registro_iva.xml', | ||
79 | 37 | ], | ||
80 | 38 | "demo_xml" : [], | ||
81 | 39 | "active": False, | ||
82 | 40 | "installable": True | ||
83 | 41 | } | ||
84 | 0 | 42 | ||
85 | === added file 'l10n_it_vat_registries/account.py' | |||
86 | --- l10n_it_vat_registries/account.py 1970-01-01 00:00:00 +0000 | |||
87 | +++ l10n_it_vat_registries/account.py 2011-08-24 09:56:24 +0000 | |||
88 | @@ -0,0 +1,46 @@ | |||
89 | 1 | # -*- encoding: utf-8 -*- | ||
90 | 2 | ############################################################################## | ||
91 | 3 | # | ||
92 | 4 | # Copyright (C) 2011 Associazione OpenERP Italia | ||
93 | 5 | # (<http://www.openerp-italia.org>). | ||
94 | 6 | # All Rights Reserved | ||
95 | 7 | # | ||
96 | 8 | # This program is free software: you can redistribute it and/or modify | ||
97 | 9 | # it under the terms of the GNU Affero General Public License as published | ||
98 | 10 | # by the Free Software Foundation, either version 3 of the License, or | ||
99 | 11 | # (at your option) any later version. | ||
100 | 12 | # | ||
101 | 13 | # This program is distributed in the hope that it will be useful, | ||
102 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
103 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
104 | 16 | # GNU General Public License for more details. | ||
105 | 17 | # | ||
106 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
107 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
108 | 20 | # | ||
109 | 21 | ############################################################################## | ||
110 | 22 | |||
111 | 23 | from osv import fields, osv | ||
112 | 24 | |||
113 | 25 | class account_tax_code(osv.osv): | ||
114 | 26 | |||
115 | 27 | _inherit = 'account.tax.code' | ||
116 | 28 | _columns = { | ||
117 | 29 | 'tax_ids': fields.one2many('account.tax', 'tax_code_id', 'Taxes'), | ||
118 | 30 | 'base_tax_ids': fields.one2many('account.tax', 'base_code_id', 'Base Taxes'), | ||
119 | 31 | } | ||
120 | 32 | |||
121 | 33 | account_tax_code() | ||
122 | 34 | |||
123 | 35 | class account_invoice_tax(osv.osv): | ||
124 | 36 | |||
125 | 37 | _inherit = 'account.tax' | ||
126 | 38 | _columns = { | ||
127 | 39 | 'exclude_from_registries': fields.boolean('Exclude from VAT registries'), | ||
128 | 40 | 'base_tax_ids': fields.one2many('account.tax', 'base_code_id', 'Base Taxes'), | ||
129 | 41 | } | ||
130 | 42 | _sql_constraints = [ | ||
131 | 43 | ('name_uniq', 'UNIQUE(name)', 'The tax name must be unique!'), | ||
132 | 44 | ] | ||
133 | 45 | |||
134 | 46 | account_invoice_tax() | ||
135 | 0 | 47 | ||
136 | === added file 'l10n_it_vat_registries/account_view.xml' | |||
137 | --- l10n_it_vat_registries/account_view.xml 1970-01-01 00:00:00 +0000 | |||
138 | +++ l10n_it_vat_registries/account_view.xml 2011-08-24 09:56:24 +0000 | |||
139 | @@ -0,0 +1,17 @@ | |||
140 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
141 | 2 | <openerp> | ||
142 | 3 | <data> | ||
143 | 4 | |||
144 | 5 | <record id="view_tax_form" model="ir.ui.view"> | ||
145 | 6 | <field name="name">account.tax.form</field> | ||
146 | 7 | <field name="model">account.tax</field> | ||
147 | 8 | <field name="type">form</field> | ||
148 | 9 | <field name="inherit_id" ref="account.view_tax_form"></field> | ||
149 | 10 | <field name="arch" type="xml"> | ||
150 | 11 | <field name="active" position="after"> | ||
151 | 12 | <field name="exclude_from_registries"/> | ||
152 | 13 | </field> | ||
153 | 14 | </field> | ||
154 | 15 | </record> | ||
155 | 16 | </data> | ||
156 | 17 | </openerp> | ||
157 | 0 | 18 | ||
158 | === added directory 'l10n_it_vat_registries/i18n' | |||
159 | === added file 'l10n_it_vat_registries/i18n/it.po' | |||
160 | --- l10n_it_vat_registries/i18n/it.po 1970-01-01 00:00:00 +0000 | |||
161 | +++ l10n_it_vat_registries/i18n/it.po 2011-08-24 09:56:24 +0000 | |||
162 | @@ -0,0 +1,185 @@ | |||
163 | 1 | # Translation of OpenERP Server. | ||
164 | 2 | # This file contains the translation of the following modules: | ||
165 | 3 | # * l10n_it_vat_registries | ||
166 | 4 | # | ||
167 | 5 | msgid "" | ||
168 | 6 | msgstr "" | ||
169 | 7 | "Project-Id-Version: OpenERP Server 6.0.2\n" | ||
170 | 8 | "Report-Msgid-Bugs-To: support@openerp.com\n" | ||
171 | 9 | "POT-Creation-Date: 2011-08-19 21:40+0000\n" | ||
172 | 10 | "PO-Revision-Date: 2011-08-19 23:43+0100\n" | ||
173 | 11 | "Last-Translator: eLBati <lorenzo.battistini@domsense.com>\n" | ||
174 | 12 | "Language-Team: \n" | ||
175 | 13 | "MIME-Version: 1.0\n" | ||
176 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
177 | 15 | "Content-Transfer-Encoding: 8bit\n" | ||
178 | 16 | "Plural-Forms: \n" | ||
179 | 17 | |||
180 | 18 | #. module: l10n_it_vat_registries | ||
181 | 19 | #: model:ir.module.module,description:l10n_it_vat_registries.module_meta_information | ||
182 | 20 | msgid "Accounting reports for Italian localization - VAT Registries" | ||
183 | 21 | msgstr "Report contabili per la localizzazione italiana - Registri IVA" | ||
184 | 22 | |||
185 | 23 | #. module: l10n_it_vat_registries | ||
186 | 24 | #: model:ir.model,name:l10n_it_vat_registries.model_account_tax_code | ||
187 | 25 | msgid "Tax Code" | ||
188 | 26 | msgstr "Codice imposta" | ||
189 | 27 | |||
190 | 28 | #. module: l10n_it_vat_registries | ||
191 | 29 | #: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_vendite_report_id | ||
192 | 30 | msgid "Customer Invoices VAT Registry" | ||
193 | 31 | msgstr "Registro IVA Fatture Emesse" | ||
194 | 32 | |||
195 | 33 | #. module: l10n_it_vat_registries | ||
196 | 34 | #: model:ir.model,name:l10n_it_vat_registries.model_wizard_registro_iva | ||
197 | 35 | msgid "wizard.registro.iva" | ||
198 | 36 | msgstr "wizard.registro.iva" | ||
199 | 37 | |||
200 | 38 | #. module: l10n_it_vat_registries | ||
201 | 39 | #: view:wizard.registro.iva:0 | ||
202 | 40 | msgid "Print" | ||
203 | 41 | msgstr "Stampa" | ||
204 | 42 | |||
205 | 43 | #. module: l10n_it_vat_registries | ||
206 | 44 | #: field:wizard.registro.iva,type:0 | ||
207 | 45 | msgid "Type" | ||
208 | 46 | msgstr "Tipo" | ||
209 | 47 | |||
210 | 48 | #. module: l10n_it_vat_registries | ||
211 | 49 | #: selection:wizard.registro.iva,type:0 | ||
212 | 50 | msgid "Supplier Invoices" | ||
213 | 51 | msgstr "Fatture ricevute" | ||
214 | 52 | |||
215 | 53 | #. module: l10n_it_vat_registries | ||
216 | 54 | #: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_acquisti_report_id | ||
217 | 55 | msgid "Supplier Invoices VAT Registry" | ||
218 | 56 | msgstr "Registro IVA Fatture Ricevute" | ||
219 | 57 | |||
220 | 58 | #. module: l10n_it_vat_registries | ||
221 | 59 | #: model:ir.actions.act_window,name:l10n_it_vat_registries.action_registro_iva | ||
222 | 60 | msgid "VAT Registry" | ||
223 | 61 | msgstr "Registro IVA" | ||
224 | 62 | |||
225 | 63 | #. module: l10n_it_vat_registries | ||
226 | 64 | #: code:addons/l10n_it_vat_registries/invoice.py:116 | ||
227 | 65 | #, python-format | ||
228 | 66 | msgid "The tax %s has no tax codes" | ||
229 | 67 | msgstr "L'imposta %s non ha codici IVA" | ||
230 | 68 | |||
231 | 69 | #. module: l10n_it_vat_registries | ||
232 | 70 | #: field:account.tax,base_tax_ids:0 | ||
233 | 71 | #: field:account.tax.code,base_tax_ids:0 | ||
234 | 72 | msgid "Base Taxes" | ||
235 | 73 | msgstr "Imposte dell'imponibile" | ||
236 | 74 | |||
237 | 75 | #. module: l10n_it_vat_registries | ||
238 | 76 | #: code:addons/l10n_it_vat_registries/invoice.py:70 | ||
239 | 77 | #: code:addons/l10n_it_vat_registries/invoice.py:91 | ||
240 | 78 | #, python-format | ||
241 | 79 | msgid "The tax %s is excluded from registries" | ||
242 | 80 | msgstr "L'imposta %s è esclusa dai registri" | ||
243 | 81 | |||
244 | 82 | #. module: l10n_it_vat_registries | ||
245 | 83 | #: view:wizard.registro.iva:0 | ||
246 | 84 | msgid "Tax Journal" | ||
247 | 85 | msgstr "Registro IVA" | ||
248 | 86 | |||
249 | 87 | #. module: l10n_it_vat_registries | ||
250 | 88 | #: field:wizard.registro.iva,date_to:0 | ||
251 | 89 | msgid "To date" | ||
252 | 90 | msgstr "Alla data" | ||
253 | 91 | |||
254 | 92 | #. module: l10n_it_vat_registries | ||
255 | 93 | #: view:wizard.registro.iva:0 | ||
256 | 94 | #: field:wizard.registro.iva,journal_ids:0 | ||
257 | 95 | msgid "Journals" | ||
258 | 96 | msgstr "Sezionali" | ||
259 | 97 | |||
260 | 98 | #. module: l10n_it_vat_registries | ||
261 | 99 | #: sql_constraint:account.tax:0 | ||
262 | 100 | msgid "The tax name must be unique!" | ||
263 | 101 | msgstr "Il nome dell'imposta deve essere unico" | ||
264 | 102 | |||
265 | 103 | #. module: l10n_it_vat_registries | ||
266 | 104 | #: help:wizard.registro.iva,journal_ids:0 | ||
267 | 105 | msgid "Select journals you want retrieve documents from" | ||
268 | 106 | msgstr "Selezionare i sezionali da cui si vuole ottenere i documenti" | ||
269 | 107 | |||
270 | 108 | #. module: l10n_it_vat_registries | ||
271 | 109 | #: field:account.tax.code,tax_ids:0 | ||
272 | 110 | msgid "Taxes" | ||
273 | 111 | msgstr "Tasse" | ||
274 | 112 | |||
275 | 113 | #. module: l10n_it_vat_registries | ||
276 | 114 | #: selection:wizard.registro.iva,type:0 | ||
277 | 115 | msgid "Corrispettivi" | ||
278 | 116 | msgstr "Corrispettivi" | ||
279 | 117 | |||
280 | 118 | #. module: l10n_it_vat_registries | ||
281 | 119 | #: code:addons/l10n_it_vat_registries/wizard/print_registro_iva.py:94 | ||
282 | 120 | #, python-format | ||
283 | 121 | msgid "No documents found in the current selection" | ||
284 | 122 | msgstr "Nessun documento trovato per la selezione corrente" | ||
285 | 123 | |||
286 | 124 | #. module: l10n_it_vat_registries | ||
287 | 125 | #: model:ir.module.module,shortdesc:l10n_it_vat_registries.module_meta_information | ||
288 | 126 | msgid "Italian Localisation - VAT Registries" | ||
289 | 127 | msgstr "Localizzazione Italiana - Registri IVA" | ||
290 | 128 | |||
291 | 129 | #. module: l10n_it_vat_registries | ||
292 | 130 | #: model:ir.ui.menu,name:l10n_it_vat_registries.menu_registro_iva | ||
293 | 131 | msgid "VAT Registries" | ||
294 | 132 | msgstr "Registri IVA" | ||
295 | 133 | |||
296 | 134 | #. module: l10n_it_vat_registries | ||
297 | 135 | #: code:addons/l10n_it_vat_registries/invoice.py:52 | ||
298 | 136 | #, python-format | ||
299 | 137 | msgid "Too many taxes with name %s" | ||
300 | 138 | msgstr "Troppe tasse con nome %s" | ||
301 | 139 | |||
302 | 140 | #. module: l10n_it_vat_registries | ||
303 | 141 | #: constraint:account.tax.code:0 | ||
304 | 142 | msgid "Error ! You can not create recursive accounts." | ||
305 | 143 | msgstr "Errore! Non puoi creare conti ricorsivi" | ||
306 | 144 | |||
307 | 145 | #. module: l10n_it_vat_registries | ||
308 | 146 | #: field:account.tax,exclude_from_registries:0 | ||
309 | 147 | msgid "Exclude from VAT registries" | ||
310 | 148 | msgstr "Escludi dai registri IVA" | ||
311 | 149 | |||
312 | 150 | #. module: l10n_it_vat_registries | ||
313 | 151 | #: selection:wizard.registro.iva,type:0 | ||
314 | 152 | msgid "Customer Invoices" | ||
315 | 153 | msgstr "Fatture emesse" | ||
316 | 154 | |||
317 | 155 | #. module: l10n_it_vat_registries | ||
318 | 156 | #: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_corrispettivi_report_id | ||
319 | 157 | msgid "Corrispettivi VAT Registry" | ||
320 | 158 | msgstr "Registro IVA Corrispettivi" | ||
321 | 159 | |||
322 | 160 | #. module: l10n_it_vat_registries | ||
323 | 161 | #: field:wizard.registro.iva,date_from:0 | ||
324 | 162 | msgid "From date" | ||
325 | 163 | msgstr "Dalla data" | ||
326 | 164 | |||
327 | 165 | #. module: l10n_it_vat_registries | ||
328 | 166 | #: code:addons/l10n_it_vat_registries/invoice.py:50 | ||
329 | 167 | #, python-format | ||
330 | 168 | msgid "The tax %s does not exist" | ||
331 | 169 | msgstr "L'imposta %s non esiste" | ||
332 | 170 | |||
333 | 171 | #. module: l10n_it_vat_registries | ||
334 | 172 | #: view:wizard.registro.iva:0 | ||
335 | 173 | msgid "Cancel" | ||
336 | 174 | msgstr "Annulla" | ||
337 | 175 | |||
338 | 176 | #. module: l10n_it_vat_registries | ||
339 | 177 | #: field:wizard.registro.iva,message:0 | ||
340 | 178 | msgid "Message" | ||
341 | 179 | msgstr "Messaggio" | ||
342 | 180 | |||
343 | 181 | #. module: l10n_it_vat_registries | ||
344 | 182 | #: model:ir.model,name:l10n_it_vat_registries.model_account_tax | ||
345 | 183 | msgid "account.tax" | ||
346 | 184 | msgstr "account.tax" | ||
347 | 185 | |||
348 | 0 | 186 | ||
349 | === added file 'l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot' | |||
350 | --- l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot 1970-01-01 00:00:00 +0000 | |||
351 | +++ l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot 2011-08-24 09:56:24 +0000 | |||
352 | @@ -0,0 +1,185 @@ | |||
353 | 1 | # Translation of OpenERP Server. | ||
354 | 2 | # This file contains the translation of the following modules: | ||
355 | 3 | # * l10n_it_vat_registries | ||
356 | 4 | # | ||
357 | 5 | msgid "" | ||
358 | 6 | msgstr "" | ||
359 | 7 | "Project-Id-Version: OpenERP Server 6.0.2\n" | ||
360 | 8 | "Report-Msgid-Bugs-To: support@openerp.com\n" | ||
361 | 9 | "POT-Creation-Date: 2011-08-19 21:40+0000\n" | ||
362 | 10 | "PO-Revision-Date: 2011-08-19 21:40+0000\n" | ||
363 | 11 | "Last-Translator: <>\n" | ||
364 | 12 | "Language-Team: \n" | ||
365 | 13 | "MIME-Version: 1.0\n" | ||
366 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
367 | 15 | "Content-Transfer-Encoding: \n" | ||
368 | 16 | "Plural-Forms: \n" | ||
369 | 17 | |||
370 | 18 | #. module: l10n_it_vat_registries | ||
371 | 19 | #: model:ir.module.module,description:l10n_it_vat_registries.module_meta_information | ||
372 | 20 | msgid "Accounting reports for Italian localization - VAT Registries" | ||
373 | 21 | msgstr "" | ||
374 | 22 | |||
375 | 23 | #. module: l10n_it_vat_registries | ||
376 | 24 | #: model:ir.model,name:l10n_it_vat_registries.model_account_tax_code | ||
377 | 25 | msgid "Tax Code" | ||
378 | 26 | msgstr "" | ||
379 | 27 | |||
380 | 28 | #. module: l10n_it_vat_registries | ||
381 | 29 | #: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_vendite_report_id | ||
382 | 30 | msgid "Customer Invoices VAT Registry" | ||
383 | 31 | msgstr "" | ||
384 | 32 | |||
385 | 33 | #. module: l10n_it_vat_registries | ||
386 | 34 | #: model:ir.model,name:l10n_it_vat_registries.model_wizard_registro_iva | ||
387 | 35 | msgid "wizard.registro.iva" | ||
388 | 36 | msgstr "" | ||
389 | 37 | |||
390 | 38 | #. module: l10n_it_vat_registries | ||
391 | 39 | #: view:wizard.registro.iva:0 | ||
392 | 40 | msgid "Print" | ||
393 | 41 | msgstr "" | ||
394 | 42 | |||
395 | 43 | #. module: l10n_it_vat_registries | ||
396 | 44 | #: field:wizard.registro.iva,type:0 | ||
397 | 45 | msgid "Type" | ||
398 | 46 | msgstr "" | ||
399 | 47 | |||
400 | 48 | #. module: l10n_it_vat_registries | ||
401 | 49 | #: selection:wizard.registro.iva,type:0 | ||
402 | 50 | msgid "Supplier Invoices" | ||
403 | 51 | msgstr "" | ||
404 | 52 | |||
405 | 53 | #. module: l10n_it_vat_registries | ||
406 | 54 | #: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_acquisti_report_id | ||
407 | 55 | msgid "Supplier Invoices VAT Registry" | ||
408 | 56 | msgstr "" | ||
409 | 57 | |||
410 | 58 | #. module: l10n_it_vat_registries | ||
411 | 59 | #: model:ir.actions.act_window,name:l10n_it_vat_registries.action_registro_iva | ||
412 | 60 | msgid "VAT Registry" | ||
413 | 61 | msgstr "" | ||
414 | 62 | |||
415 | 63 | #. module: l10n_it_vat_registries | ||
416 | 64 | #: code:addons/l10n_it_vat_registries/invoice.py:116 | ||
417 | 65 | #, python-format | ||
418 | 66 | msgid "The tax %s has no tax codes" | ||
419 | 67 | msgstr "" | ||
420 | 68 | |||
421 | 69 | #. module: l10n_it_vat_registries | ||
422 | 70 | #: field:account.tax,base_tax_ids:0 | ||
423 | 71 | #: field:account.tax.code,base_tax_ids:0 | ||
424 | 72 | msgid "Base Taxes" | ||
425 | 73 | msgstr "" | ||
426 | 74 | |||
427 | 75 | #. module: l10n_it_vat_registries | ||
428 | 76 | #: code:addons/l10n_it_vat_registries/invoice.py:70 | ||
429 | 77 | #: code:addons/l10n_it_vat_registries/invoice.py:91 | ||
430 | 78 | #, python-format | ||
431 | 79 | msgid "The tax %s is excluded from registries" | ||
432 | 80 | msgstr "" | ||
433 | 81 | |||
434 | 82 | #. module: l10n_it_vat_registries | ||
435 | 83 | #: view:wizard.registro.iva:0 | ||
436 | 84 | msgid "Tax Journal" | ||
437 | 85 | msgstr "" | ||
438 | 86 | |||
439 | 87 | #. module: l10n_it_vat_registries | ||
440 | 88 | #: field:wizard.registro.iva,date_to:0 | ||
441 | 89 | msgid "To date" | ||
442 | 90 | msgstr "" | ||
443 | 91 | |||
444 | 92 | #. module: l10n_it_vat_registries | ||
445 | 93 | #: view:wizard.registro.iva:0 | ||
446 | 94 | #: field:wizard.registro.iva,journal_ids:0 | ||
447 | 95 | msgid "Journals" | ||
448 | 96 | msgstr "" | ||
449 | 97 | |||
450 | 98 | #. module: l10n_it_vat_registries | ||
451 | 99 | #: sql_constraint:account.tax:0 | ||
452 | 100 | msgid "The tax name must be unique!" | ||
453 | 101 | msgstr "" | ||
454 | 102 | |||
455 | 103 | #. module: l10n_it_vat_registries | ||
456 | 104 | #: help:wizard.registro.iva,journal_ids:0 | ||
457 | 105 | msgid "Select journals you want retrieve documents from" | ||
458 | 106 | msgstr "" | ||
459 | 107 | |||
460 | 108 | #. module: l10n_it_vat_registries | ||
461 | 109 | #: field:account.tax.code,tax_ids:0 | ||
462 | 110 | msgid "Taxes" | ||
463 | 111 | msgstr "" | ||
464 | 112 | |||
465 | 113 | #. module: l10n_it_vat_registries | ||
466 | 114 | #: selection:wizard.registro.iva,type:0 | ||
467 | 115 | msgid "Corrispettivi" | ||
468 | 116 | msgstr "" | ||
469 | 117 | |||
470 | 118 | #. module: l10n_it_vat_registries | ||
471 | 119 | #: code:addons/l10n_it_vat_registries/wizard/print_registro_iva.py:94 | ||
472 | 120 | #, python-format | ||
473 | 121 | msgid "No documents found in the current selection" | ||
474 | 122 | msgstr "" | ||
475 | 123 | |||
476 | 124 | #. module: l10n_it_vat_registries | ||
477 | 125 | #: model:ir.module.module,shortdesc:l10n_it_vat_registries.module_meta_information | ||
478 | 126 | msgid "Italian Localisation - VAT Registries" | ||
479 | 127 | msgstr "" | ||
480 | 128 | |||
481 | 129 | #. module: l10n_it_vat_registries | ||
482 | 130 | #: model:ir.ui.menu,name:l10n_it_vat_registries.menu_registro_iva | ||
483 | 131 | msgid "VAT Registries" | ||
484 | 132 | msgstr "" | ||
485 | 133 | |||
486 | 134 | #. module: l10n_it_vat_registries | ||
487 | 135 | #: code:addons/l10n_it_vat_registries/invoice.py:52 | ||
488 | 136 | #, python-format | ||
489 | 137 | msgid "Too many taxes with name %s" | ||
490 | 138 | msgstr "" | ||
491 | 139 | |||
492 | 140 | #. module: l10n_it_vat_registries | ||
493 | 141 | #: constraint:account.tax.code:0 | ||
494 | 142 | msgid "Error ! You can not create recursive accounts." | ||
495 | 143 | msgstr "" | ||
496 | 144 | |||
497 | 145 | #. module: l10n_it_vat_registries | ||
498 | 146 | #: field:account.tax,exclude_from_registries:0 | ||
499 | 147 | msgid "Exclude from VAT registries" | ||
500 | 148 | msgstr "" | ||
501 | 149 | |||
502 | 150 | #. module: l10n_it_vat_registries | ||
503 | 151 | #: selection:wizard.registro.iva,type:0 | ||
504 | 152 | msgid "Customer Invoices" | ||
505 | 153 | msgstr "" | ||
506 | 154 | |||
507 | 155 | #. module: l10n_it_vat_registries | ||
508 | 156 | #: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_corrispettivi_report_id | ||
509 | 157 | msgid "Corrispettivi VAT Registry" | ||
510 | 158 | msgstr "" | ||
511 | 159 | |||
512 | 160 | #. module: l10n_it_vat_registries | ||
513 | 161 | #: field:wizard.registro.iva,date_from:0 | ||
514 | 162 | msgid "From date" | ||
515 | 163 | msgstr "" | ||
516 | 164 | |||
517 | 165 | #. module: l10n_it_vat_registries | ||
518 | 166 | #: code:addons/l10n_it_vat_registries/invoice.py:50 | ||
519 | 167 | #, python-format | ||
520 | 168 | msgid "The tax %s does not exist" | ||
521 | 169 | msgstr "" | ||
522 | 170 | |||
523 | 171 | #. module: l10n_it_vat_registries | ||
524 | 172 | #: view:wizard.registro.iva:0 | ||
525 | 173 | msgid "Cancel" | ||
526 | 174 | msgstr "" | ||
527 | 175 | |||
528 | 176 | #. module: l10n_it_vat_registries | ||
529 | 177 | #: field:wizard.registro.iva,message:0 | ||
530 | 178 | msgid "Message" | ||
531 | 179 | msgstr "" | ||
532 | 180 | |||
533 | 181 | #. module: l10n_it_vat_registries | ||
534 | 182 | #: model:ir.model,name:l10n_it_vat_registries.model_account_tax | ||
535 | 183 | msgid "account.tax" | ||
536 | 184 | msgstr "" | ||
537 | 185 | |||
538 | 0 | 186 | ||
539 | === added file 'l10n_it_vat_registries/invoice.py' | |||
540 | --- l10n_it_vat_registries/invoice.py 1970-01-01 00:00:00 +0000 | |||
541 | +++ l10n_it_vat_registries/invoice.py 2011-08-24 09:56:24 +0000 | |||
542 | @@ -0,0 +1,163 @@ | |||
543 | 1 | # -*- coding: utf-8 -*- | ||
544 | 2 | ############################################################################## | ||
545 | 3 | # | ||
546 | 4 | # Copyright (C) 2011 Associazione OpenERP Italia | ||
547 | 5 | # (<http://www.openerp-italia.org>). | ||
548 | 6 | # All Rights Reserved | ||
549 | 7 | # | ||
550 | 8 | # This program is free software: you can redistribute it and/or modify | ||
551 | 9 | # it under the terms of the GNU Affero General Public License as published | ||
552 | 10 | # by the Free Software Foundation, either version 3 of the License, or | ||
553 | 11 | # (at your option) any later version. | ||
554 | 12 | # | ||
555 | 13 | # This program is distributed in the hope that it will be useful, | ||
556 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
557 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
558 | 16 | # GNU General Public License for more details. | ||
559 | 17 | # | ||
560 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
561 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
562 | 20 | # | ||
563 | 21 | ############################################################################## | ||
564 | 22 | |||
565 | 23 | import time | ||
566 | 24 | from report import report_sxw | ||
567 | 25 | from osv import osv | ||
568 | 26 | from tools.translate import _ | ||
569 | 27 | from decimal import * | ||
570 | 28 | import netsvc | ||
571 | 29 | |||
572 | 30 | class Parser(report_sxw.rml_parse): | ||
573 | 31 | |||
574 | 32 | logger = netsvc.Logger() | ||
575 | 33 | |||
576 | 34 | def _get_main_tax(self, tax): | ||
577 | 35 | if not tax.parent_id: | ||
578 | 36 | return tax | ||
579 | 37 | else: | ||
580 | 38 | return self._get_main_tax(tax.parent_id) | ||
581 | 39 | |||
582 | 40 | def _get_account_tax(self, inv_tax): | ||
583 | 41 | splitted_name = inv_tax.name.split(' - ') | ||
584 | 42 | if len(splitted_name) > 1: | ||
585 | 43 | tax_name = splitted_name[1] | ||
586 | 44 | else: | ||
587 | 45 | tax_name = splitted_name[0] | ||
588 | 46 | tax_obj = self.pool.get('account.tax') | ||
589 | 47 | # cerco la tassa per nome, dopo averlo ottenuto dalla tassa in fattura | ||
590 | 48 | tax_ids = tax_obj.search(self.cr, self.uid, [('name', '=', tax_name)]) | ||
591 | 49 | if not tax_ids: | ||
592 | 50 | raise Exception(_('The tax %s does not exist') % tax_name) | ||
593 | 51 | if len(tax_ids) > 1: | ||
594 | 52 | raise Exception(_('Too many taxes with name %s') % tax_name) | ||
595 | 53 | return tax_obj.browse(self.cr, self.uid, tax_ids[0]) | ||
596 | 54 | |||
597 | 55 | def _get_tax_lines(self, invoice): | ||
598 | 56 | res=[] | ||
599 | 57 | # index è usato per non ripetere la stampa dei dati fattura quando ci sono più codici IVA | ||
600 | 58 | index=0 | ||
601 | 59 | totale_iva = 0.0 | ||
602 | 60 | totale_iva_inded = 0.0 | ||
603 | 61 | invoice_amount_total = 0.0 | ||
604 | 62 | invoice_amount_untaxed = 0.0 | ||
605 | 63 | precision = self.pool.get('decimal.precision').precision_get(self.cr, self.uid, 'Account') | ||
606 | 64 | for inv_tax in invoice.tax_line: | ||
607 | 65 | tax_item = {} | ||
608 | 66 | if inv_tax.base_code_id and inv_tax.tax_code_id: | ||
609 | 67 | account_tax = self._get_account_tax(inv_tax) | ||
610 | 68 | if account_tax.exclude_from_registries: | ||
611 | 69 | self.logger.notifyChannel("l10n_it_vat_registries", netsvc.LOG_INFO, | ||
612 | 70 | _('The tax %s is excluded from registries') % account_tax.name) | ||
613 | 71 | continue | ||
614 | 72 | account_tax_amount = account_tax.amount | ||
615 | 73 | tax_item = { | ||
616 | 74 | 'tax_percentage': account_tax_amount and str( | ||
617 | 75 | account_tax_amount * 100).split('.')[0] or inv_tax.tax_code_id.name, | ||
618 | 76 | 'base': inv_tax.base, | ||
619 | 77 | 'amount': inv_tax.amount, | ||
620 | 78 | 'non_deductible': 0.0, | ||
621 | 79 | 'index': index, | ||
622 | 80 | } | ||
623 | 81 | res.append(tax_item) | ||
624 | 82 | totale_iva += inv_tax.amount | ||
625 | 83 | invoice_amount_total = invoice.amount_total | ||
626 | 84 | invoice_amount_untaxed = invoice.amount_untaxed | ||
627 | 85 | index += 1 | ||
628 | 86 | # Se non c'è il tax code imponibile, cerco la tassa relativa alla parte non deducibile | ||
629 | 87 | elif inv_tax.tax_code_id: | ||
630 | 88 | tax = self._get_main_tax(self._get_account_tax(inv_tax)) | ||
631 | 89 | if tax.exclude_from_registries: | ||
632 | 90 | self.logger.notifyChannel("l10n_it_vat_registries", netsvc.LOG_INFO, | ||
633 | 91 | _('The tax %s is excluded from registries') % tax.name) | ||
634 | 92 | continue | ||
635 | 93 | for inv_tax_2 in invoice.tax_line: | ||
636 | 94 | if inv_tax_2.base_code_id and not inv_tax_2.tax_code_id: | ||
637 | 95 | base_tax = self._get_main_tax(self._get_account_tax(inv_tax_2)) | ||
638 | 96 | # Se hanno la stessa tassa | ||
639 | 97 | if base_tax.id == tax.id: | ||
640 | 98 | tax_item = { | ||
641 | 99 | 'tax_percentage': base_tax.amount and str( | ||
642 | 100 | base_tax.amount * 100).split('.')[0] or inv_tax.tax_code_id.name, | ||
643 | 101 | 'base': inv_tax.base + inv_tax_2.base, | ||
644 | 102 | 'amount': inv_tax.amount + inv_tax_2.amount, | ||
645 | 103 | 'non_deductible': float(Decimal(str(inv_tax_2.base / (inv_tax.base + inv_tax_2.base) * 100) | ||
646 | 104 | ).quantize(Decimal('.1'), rounding=ROUND_HALF_UP)), | ||
647 | 105 | 'index': index, | ||
648 | 106 | } | ||
649 | 107 | res.append(tax_item) | ||
650 | 108 | totale_iva += inv_tax.amount | ||
651 | 109 | totale_iva_inded += inv_tax_2.amount | ||
652 | 110 | invoice_amount_total = invoice.amount_total | ||
653 | 111 | invoice_amount_untaxed = invoice.amount_untaxed | ||
654 | 112 | index += 1 | ||
655 | 113 | break | ||
656 | 114 | elif not inv_tax.tax_code_id and not inv_tax.base_code_id: | ||
657 | 115 | self.logger.notifyChannel("l10n_it_vat_registries", netsvc.LOG_INFO, | ||
658 | 116 | _('The tax %s has no tax codes') % inv_tax.name) | ||
659 | 117 | continue | ||
660 | 118 | if tax_item: | ||
661 | 119 | if tax_item['tax_percentage'] not in self.localcontext['tax_codes']: | ||
662 | 120 | self.localcontext['tax_codes'][tax_item['tax_percentage']] = { | ||
663 | 121 | 'base': tax_item['base'], | ||
664 | 122 | 'amount': tax_item['amount'], | ||
665 | 123 | } | ||
666 | 124 | else: | ||
667 | 125 | self.localcontext['tax_codes'][tax_item['tax_percentage']]['base'] += tax_item['base'] | ||
668 | 126 | self.localcontext['tax_codes'][tax_item['tax_percentage']]['amount'] += tax_item['amount'] | ||
669 | 127 | |||
670 | 128 | self.localcontext['totali']['totale_operazioni'] += invoice_amount_total | ||
671 | 129 | self.localcontext['totali']['totale_imponibili'] += invoice_amount_untaxed | ||
672 | 130 | # da analizzare self.totale_variazioni += invoice.amount_total | ||
673 | 131 | self.localcontext['totali']['totale_iva'] += totale_iva | ||
674 | 132 | self.localcontext['totali']['totale_iva_inded'] += totale_iva_inded | ||
675 | 133 | |||
676 | 134 | return res | ||
677 | 135 | |||
678 | 136 | def __init__(self, cr, uid, name, context): | ||
679 | 137 | super(Parser, self).__init__(cr, uid, name, context) | ||
680 | 138 | self.localcontext.update({ | ||
681 | 139 | 'time': time, | ||
682 | 140 | 'tax_lines': self._get_tax_lines, | ||
683 | 141 | 'totali': { | ||
684 | 142 | 'totale_operazioni': 0.0, | ||
685 | 143 | 'totale_imponibili': 0.0, | ||
686 | 144 | 'totale_variazioni': 0.0, | ||
687 | 145 | 'totale_iva': 0.0, | ||
688 | 146 | 'totale_iva_inded': 0.0, | ||
689 | 147 | }, | ||
690 | 148 | 'tax_codes': {}, | ||
691 | 149 | }) | ||
692 | 150 | |||
693 | 151 | |||
694 | 152 | report_sxw.report_sxw('report.registro_iva_vendite', | ||
695 | 153 | 'registro_iva_vendite', | ||
696 | 154 | 'addons/l10n_it_vat_registries/templates/registro_iva_vendite.mako', | ||
697 | 155 | parser=Parser) | ||
698 | 156 | report_sxw.report_sxw('report.registro_iva_acquisti', | ||
699 | 157 | 'registro_iva_acquisti', | ||
700 | 158 | 'addons/l10n_it_vat_registries/templates/registro_iva_acquisti.mako', | ||
701 | 159 | parser=Parser) | ||
702 | 160 | report_sxw.report_sxw('report.registro_iva_corrispettivi', | ||
703 | 161 | 'registro_iva_corrispettivi', | ||
704 | 162 | 'addons/l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako', | ||
705 | 163 | parser=Parser) | ||
706 | 0 | 164 | ||
707 | === added file 'l10n_it_vat_registries/reports.xml' | |||
708 | --- l10n_it_vat_registries/reports.xml 1970-01-01 00:00:00 +0000 | |||
709 | +++ l10n_it_vat_registries/reports.xml 2011-08-24 09:56:24 +0000 | |||
710 | @@ -0,0 +1,112 @@ | |||
711 | 1 | <?xml version="1.0"?> | ||
712 | 2 | <openerp> | ||
713 | 3 | <data> | ||
714 | 4 | <record id="ir_header_webkit_vat_registries" model="ir.header_webkit"> | ||
715 | 5 | <field name="orientation">Landscape</field> | ||
716 | 6 | <field name="format">A4</field> | ||
717 | 7 | <field name="margin_top">60</field> | ||
718 | 8 | <field name="html"><![CDATA[<html> | ||
719 | 9 | <head> | ||
720 | 10 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
721 | 11 | <script> | ||
722 | 12 | function subst() { | ||
723 | 13 | var vars={}; | ||
724 | 14 | var x=document.location.search.substring(1).split('&'); | ||
725 | 15 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
726 | 16 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
727 | 17 | for(var i in x) { | ||
728 | 18 | var y = document.getElementsByClassName(x[i]); | ||
729 | 19 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
730 | 20 | } | ||
731 | 21 | } | ||
732 | 22 | </script> | ||
733 | 23 | </head> | ||
734 | 24 | <body style="border:0; margin: 0;" onload="subst()"> | ||
735 | 25 | <% setLang(company.partner_id.lang or "en_US") %> | ||
736 | 26 | <h1>Registro IVA</h1> | ||
737 | 27 | <h3>${company.partner_id.name or ''|entity}</h3> | ||
738 | 28 | <table style="border-bottom: 1px solid black; width: 100%"> | ||
739 | 29 | <tr> | ||
740 | 30 | <td> | ||
741 | 31 | <div>${company.partner_id.address and company.partner_id.address[0].street or ''|entity}</div> | ||
742 | 32 | <div>${company.partner_id.address and company.partner_id.address[0].street2 or ''|entity}</div> | ||
743 | 33 | <div>${company.partner_id.address and company.partner_id.address[0].zip or ''|entity}</div> | ||
744 | 34 | <div>${company.partner_id.address and company.partner_id.address[0].city or ''|entity}</div> | ||
745 | 35 | <div>${company.partner_id.address and company.partner_id.address[0].province and company.partner_id.address[0].province.code or ''|entity}</div> | ||
746 | 36 | </td> | ||
747 | 37 | <td> | ||
748 | 38 | <div>P. IVA: ${company.partner_id.vat or ''|entity}</div> | ||
749 | 39 | <div>Codice Fiscale: ${company.partner_id.fiscalcode or ''|entity}</div> | ||
750 | 40 | <div>Codice Attività :</div> | ||
751 | 41 | <div>Registro Imprese:</div> | ||
752 | 42 | </td> | ||
753 | 43 | </tr> | ||
754 | 44 | </table> | ||
755 | 45 | <br/> | ||
756 | 46 | </body> | ||
757 | 47 | </html>]]> | ||
758 | 48 | </field> | ||
759 | 49 | <field name="footer_html"><![CDATA[<html> | ||
760 | 50 | <head> | ||
761 | 51 | <meta content="text/html; charset=UTF-8" http-equiv="content-type"/> | ||
762 | 52 | <script> | ||
763 | 53 | function subst() { | ||
764 | 54 | var vars={}; | ||
765 | 55 | var x=document.location.search.substring(1).split('&'); | ||
766 | 56 | for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);} | ||
767 | 57 | var x=['frompage','topage','page','webpage','section','subsection','subsubsection']; | ||
768 | 58 | for(var i in x) { | ||
769 | 59 | var y = document.getElementsByClassName(x[i]); | ||
770 | 60 | for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]]; | ||
771 | 61 | } | ||
772 | 62 | } | ||
773 | 63 | </script> | ||
774 | 64 | </head> | ||
775 | 65 | <body style="border:0; margin: 0;" onload="subst()"> | ||
776 | 66 | <table style="border-top: 1px solid black; width: 100%"> | ||
777 | 67 | <tr > | ||
778 | 68 | <td style="text-align:right;font-size:12;" width="95%">Page <span class="page"/></td><td style="text-align:left;font-size:12;"> of <span class="topage"/></td> | ||
779 | 69 | </tr> | ||
780 | 70 | </table> | ||
781 | 71 | </body> | ||
782 | 72 | </html>]]></field><field name="css" ><![CDATA[ | ||
783 | 73 | tr { | ||
784 | 74 | page-break-inside: avoid; | ||
785 | 75 | } | ||
786 | 76 | thead{ | ||
787 | 77 | display: table-header-group; /* http://code.google.com/p/wkhtmltopdf/issues/detail?id=9#c8 */ | ||
788 | 78 | } | ||
789 | 79 | ]]> </field> | ||
790 | 80 | <field name="name">Registri IVA</field> | ||
791 | 81 | </record> | ||
792 | 82 | |||
793 | 83 | <record id="registro_iva_vendite_report_id" model="ir.actions.report.xml"> | ||
794 | 84 | <field name="name">Customer Invoices VAT Registry</field> | ||
795 | 85 | <field name="type">ir.actions.report.xml</field> | ||
796 | 86 | <field name="model">account.invoice</field> | ||
797 | 87 | <field name="report_name">registro_iva_vendite</field> | ||
798 | 88 | <field name="report_type">webkit</field> | ||
799 | 89 | <field name="report_rml">l10n_it_vat_registries/templates/registro_iva_vendite.mako</field> | ||
800 | 90 | <field name="webkit_header" ref="ir_header_webkit_vat_registries"/> | ||
801 | 91 | </record> | ||
802 | 92 | <record id="registro_iva_acquisti_report_id" model="ir.actions.report.xml"> | ||
803 | 93 | <field name="name">Supplier Invoices VAT Registry</field> | ||
804 | 94 | <field name="type">ir.actions.report.xml</field> | ||
805 | 95 | <field name="model">account.invoice</field> | ||
806 | 96 | <field name="report_name">registro_iva_acquisti</field> | ||
807 | 97 | <field name="report_type">webkit</field> | ||
808 | 98 | <field name="report_rml">l10n_it_vat_registries/templates/registro_iva_acquisti.mako</field> | ||
809 | 99 | <field name="webkit_header" ref="ir_header_webkit_vat_registries"/> | ||
810 | 100 | </record> | ||
811 | 101 | <record id="registro_iva_corrispettivi_report_id" model="ir.actions.report.xml"> | ||
812 | 102 | <field name="name">Corrispettivi VAT Registry</field> | ||
813 | 103 | <field name="type">ir.actions.report.xml</field> | ||
814 | 104 | <field name="model">account.invoice</field> | ||
815 | 105 | <field name="report_name">registro_iva_corrispettivi</field> | ||
816 | 106 | <field name="report_type">webkit</field> | ||
817 | 107 | <field name="report_rml">l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako</field> | ||
818 | 108 | <field name="webkit_header" ref="ir_header_webkit_vat_registries"/> | ||
819 | 109 | </record> | ||
820 | 110 | </data> | ||
821 | 111 | </openerp> | ||
822 | 112 | |||
823 | 0 | 113 | ||
824 | === added directory 'l10n_it_vat_registries/templates' | |||
825 | === added file 'l10n_it_vat_registries/templates/registro_iva_acquisti.mako' | |||
826 | --- l10n_it_vat_registries/templates/registro_iva_acquisti.mako 1970-01-01 00:00:00 +0000 | |||
827 | +++ l10n_it_vat_registries/templates/registro_iva_acquisti.mako 2011-08-24 09:56:24 +0000 | |||
828 | @@ -0,0 +1,106 @@ | |||
829 | 1 | <html> | ||
830 | 2 | <head> | ||
831 | 3 | <style type="text/css"> | ||
832 | 4 | ${css} | ||
833 | 5 | </style> | ||
834 | 6 | </head> | ||
835 | 7 | <body> | ||
836 | 8 | <h2>Fatture Ricevute</h2> | ||
837 | 9 | <% setLang(objects[0].company_id.partner_id.lang or "en_US") %> | ||
838 | 10 | <table style="width:100%;"> | ||
839 | 11 | <thead> | ||
840 | 12 | <tr> | ||
841 | 13 | <th style="text-align:left">Data registrazione</th> | ||
842 | 14 | <th style="text-align:left">Data fattura</th> | ||
843 | 15 | <th style="text-align:left">Numero fattura</th> | ||
844 | 16 | <th style="text-align:left">Ragione sociale</th> | ||
845 | 17 | <th style="text-align:left">Descrizione</th> | ||
846 | 18 | <th style="text-align:right">Totale fattura</th> | ||
847 | 19 | <th style="text-align:right">% IVA</th> | ||
848 | 20 | <th style="text-align:right">Imponibile</th> | ||
849 | 21 | <th style="text-align:right">Imposta</th> | ||
850 | 22 | <th style="text-align:right">% inded.</th> | ||
851 | 23 | <th></th> | ||
852 | 24 | </tr> | ||
853 | 25 | </thead> | ||
854 | 26 | <tbody> | ||
855 | 27 | %for object in objects : | ||
856 | 28 | %for line in tax_lines(object) : | ||
857 | 29 | <tr><td> | ||
858 | 30 | %if line['index']==0: | ||
859 | 31 | ${ formatLang(object.move_id.date,date=True) or ''| entity} | ||
860 | 32 | %endif | ||
861 | 33 | </td><td> | ||
862 | 34 | %if line['index']==0: | ||
863 | 35 | ${ formatLang(object.date_invoice,date=True) or '' | entity} | ||
864 | 36 | %endif | ||
865 | 37 | </td><td> | ||
866 | 38 | %if line['index']==0: | ||
867 | 39 | ${object.number or ''| entity} | ||
868 | 40 | %endif | ||
869 | 41 | </td><td> | ||
870 | 42 | %if line['index']==0: | ||
871 | 43 | ${object.partner_id.name | entity} | ||
872 | 44 | %endif | ||
873 | 45 | </td><td> | ||
874 | 46 | %if line['index']==0: | ||
875 | 47 | %if object.type == 'in_invoice': | ||
876 | 48 | Fattura | ||
877 | 49 | %elif object.type == 'in_refund': | ||
878 | 50 | Nota di debito | ||
879 | 51 | %endif | ||
880 | 52 | %endif | ||
881 | 53 | </td><td style="text-align:right"> | ||
882 | 54 | %if line['index']==0: | ||
883 | 55 | ${ object.amount_total | entity} | ||
884 | 56 | %endif | ||
885 | 57 | </td> | ||
886 | 58 | <td style="text-align:right">${ line['tax_percentage'] or ''| entity}</td> | ||
887 | 59 | <td style="text-align:right">${ line['base'] or ''| entity}</td> | ||
888 | 60 | <td style="text-align:right">${ line['amount'] or ''| entity}</td> | ||
889 | 61 | <td style="text-align:right"> | ||
890 | 62 | %if line['non_deductible']: | ||
891 | 63 | ${ line['non_deductible'] | entity} % | ||
892 | 64 | %endif | ||
893 | 65 | </td> | ||
894 | 66 | <td></td> | ||
895 | 67 | </tr> | ||
896 | 68 | %endfor | ||
897 | 69 | %endfor | ||
898 | 70 | </tbody> | ||
899 | 71 | </table> | ||
900 | 72 | <div style="page-break-inside: avoid;"> | ||
901 | 73 | <br/> | ||
902 | 74 | <table style="width:100%; " border="1"> | ||
903 | 75 | <tr style="border-style:ridge;border-width:5px"> | ||
904 | 76 | <td colspan="4" style="padding:10; ">Periodo di stampa dal <strong>${formatLang(data['form']['date_from'],date=True)| entity}</strong> al <strong>${formatLang(data['form']['date_to'],date=True)| entity}</strong></td> | ||
905 | 77 | </tr> | ||
906 | 78 | <tr> | ||
907 | 79 | <td rowspan="2" style="vertical-align:text-top;padding:10"> | ||
908 | 80 | <table style="width:100%;"> | ||
909 | 81 | <tr> | ||
910 | 82 | <th style="text-align:left">Descrizione</th> | ||
911 | 83 | <th style="text-align:right">Imponibile</th> | ||
912 | 84 | <th style="text-align:right">Imposta</th> | ||
913 | 85 | </tr> | ||
914 | 86 | %for tax_code in tax_codes : | ||
915 | 87 | <tr> | ||
916 | 88 | <td>${tax_code|entity} | ||
917 | 89 | </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['base'])|entity} | ||
918 | 90 | </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['amount']) or ''|entity} | ||
919 | 91 | </td> | ||
920 | 92 | </tr> | ||
921 | 93 | %endfor | ||
922 | 94 | </table> | ||
923 | 95 | </td><td style="padding:10">Totale operazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_operazioni'])|entity}</strong></p><br/></td> | ||
924 | 96 | <td colspan="2" style="padding:10">Totale imponibili:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_imponibili'])|entity}</strong></p><br/></td> | ||
925 | 97 | </tr> | ||
926 | 98 | <tr> | ||
927 | 99 | <td style="padding:10">Totale variazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_variazioni'])|entity}</strong></p><br/></td> | ||
928 | 100 | <td style="padding:10">Totale IVA Detraibile:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_iva'])|entity}</strong></p><br/></td> | ||
929 | 101 | <td style="padding:10">Totale IVA Indetraibile:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_iva_inded'])|entity}</strong></p><br/></td> | ||
930 | 102 | </tr> | ||
931 | 103 | </table> | ||
932 | 104 | </div> | ||
933 | 105 | </body> | ||
934 | 106 | </html> | ||
935 | 0 | 107 | ||
936 | === added file 'l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako' | |||
937 | --- l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako 1970-01-01 00:00:00 +0000 | |||
938 | +++ l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako 2011-08-24 09:56:24 +0000 | |||
939 | @@ -0,0 +1,80 @@ | |||
940 | 1 | <html> | ||
941 | 2 | <head> | ||
942 | 3 | <style type="text/css"> | ||
943 | 4 | ${css} | ||
944 | 5 | </style> | ||
945 | 6 | </head> | ||
946 | 7 | <body> | ||
947 | 8 | <h2>Corrispettivi</h2> | ||
948 | 9 | <% setLang(objects[0].company_id.partner_id.lang or "en_US") %> | ||
949 | 10 | <table style="width:100%;"> | ||
950 | 11 | <thead> | ||
951 | 12 | <tr> | ||
952 | 13 | <th style="text-align:left">Data registrazione</th> | ||
953 | 14 | <th style="text-align:left">Descrizione</th> | ||
954 | 15 | <th style="text-align:right">Importo totale</th> | ||
955 | 16 | <th style="text-align:right">% IVA</th> | ||
956 | 17 | <th style="text-align:right">Imponibile</th> | ||
957 | 18 | <th style="text-align:right">Imposta</th> | ||
958 | 19 | <th></th> | ||
959 | 20 | </tr> | ||
960 | 21 | </thead> | ||
961 | 22 | <tbody> | ||
962 | 23 | %for object in objects : | ||
963 | 24 | %for line in tax_lines(object) : | ||
964 | 25 | <tr><td> | ||
965 | 26 | %if line['index']==0: | ||
966 | 27 | ${ formatLang(object.move_id.date,date=True) or ''| entity} | ||
967 | 28 | %endif | ||
968 | 29 | </td><td> | ||
969 | 30 | %if line['index']==0: | ||
970 | 31 | Corrispettivo | ||
971 | 32 | %endif | ||
972 | 33 | </td><td style="text-align:right"> | ||
973 | 34 | %if line['index']==0: | ||
974 | 35 | ${ object.amount_total | entity} | ||
975 | 36 | %endif | ||
976 | 37 | </td> | ||
977 | 38 | <td style="text-align:right">${ line['tax_percentage'] or ''| entity}</td> | ||
978 | 39 | <td style="text-align:right">${ line['base'] or ''| entity}</td> | ||
979 | 40 | <td style="text-align:right">${ line['amount'] or ''| entity}</td> | ||
980 | 41 | <td></td> | ||
981 | 42 | </tr> | ||
982 | 43 | %endfor | ||
983 | 44 | %endfor | ||
984 | 45 | </tbody> | ||
985 | 46 | </table> | ||
986 | 47 | <div style="page-break-inside: avoid;"> | ||
987 | 48 | <br/> | ||
988 | 49 | <table style="width:100%; " border="1"> | ||
989 | 50 | <tr style="border-style:ridge;border-width:5px"> | ||
990 | 51 | <td colspan="3" style="padding:10; ">Periodo di stampa dal <strong>${formatLang(data['form']['date_from'],date=True)| entity}</strong> al <strong>${formatLang(data['form']['date_to'],date=True)| entity}</strong></td> | ||
991 | 52 | </tr> | ||
992 | 53 | <tr> | ||
993 | 54 | <td rowspan="2" style="vertical-align:text-top;padding:10"> | ||
994 | 55 | <table style="width:100%;"> | ||
995 | 56 | <tr> | ||
996 | 57 | <th style="text-align:left">Descrizione</th> | ||
997 | 58 | <th style="text-align:right">Imponibile</th> | ||
998 | 59 | <th style="text-align:right">Imposta</th> | ||
999 | 60 | </tr> | ||
1000 | 61 | %for tax_code in tax_codes : | ||
1001 | 62 | <tr> | ||
1002 | 63 | <td>${tax_code|entity} | ||
1003 | 64 | </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['base'])|entity} | ||
1004 | 65 | </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['amount']) or ''|entity} | ||
1005 | 66 | </td> | ||
1006 | 67 | </tr> | ||
1007 | 68 | %endfor | ||
1008 | 69 | </table> | ||
1009 | 70 | </td><td style="padding:10">Totale operazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_operazioni'])|entity}</strong></p><br/></td> | ||
1010 | 71 | <td style="padding:10">Totale imponibili:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_imponibili'])|entity}</strong></p><br/></td> | ||
1011 | 72 | </tr> | ||
1012 | 73 | <tr> | ||
1013 | 74 | <td style="padding:10">Totale variazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_variazioni'])|entity}</strong></p><br/></td> | ||
1014 | 75 | <td style="padding:10">Totale IVA:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_iva'])|entity}</strong></p><br/></td> | ||
1015 | 76 | </tr> | ||
1016 | 77 | </table> | ||
1017 | 78 | </div> | ||
1018 | 79 | </body> | ||
1019 | 80 | </html> | ||
1020 | 0 | 81 | ||
1021 | === added file 'l10n_it_vat_registries/templates/registro_iva_vendite.mako' | |||
1022 | --- l10n_it_vat_registries/templates/registro_iva_vendite.mako 1970-01-01 00:00:00 +0000 | |||
1023 | +++ l10n_it_vat_registries/templates/registro_iva_vendite.mako 2011-08-24 09:56:24 +0000 | |||
1024 | @@ -0,0 +1,99 @@ | |||
1025 | 1 | <html> | ||
1026 | 2 | <head> | ||
1027 | 3 | <style type="text/css"> | ||
1028 | 4 | ${css} | ||
1029 | 5 | </style> | ||
1030 | 6 | </head> | ||
1031 | 7 | <body> | ||
1032 | 8 | <h2>Fatture Emesse</h2> | ||
1033 | 9 | <% setLang(objects[0].company_id.partner_id.lang or "en_US") %> | ||
1034 | 10 | <table style="width:100%;"> | ||
1035 | 11 | <thead> | ||
1036 | 12 | <tr> | ||
1037 | 13 | <th style="text-align:left">Data registrazione</th> | ||
1038 | 14 | <th style="text-align:left">Data fattura</th> | ||
1039 | 15 | <th style="text-align:left">Numero fattura</th> | ||
1040 | 16 | <th style="text-align:left">Ragione sociale</th> | ||
1041 | 17 | <th style="text-align:left">Descrizione</th> | ||
1042 | 18 | <th style="text-align:right">Totale fattura</th> | ||
1043 | 19 | <th style="text-align:right">% IVA</th> | ||
1044 | 20 | <th style="text-align:right">Imponibile</th> | ||
1045 | 21 | <th style="text-align:right">Imposta</th> | ||
1046 | 22 | <th></th> | ||
1047 | 23 | </tr> | ||
1048 | 24 | </thead> | ||
1049 | 25 | <tbody> | ||
1050 | 26 | %for object in objects : | ||
1051 | 27 | %for line in tax_lines(object) : | ||
1052 | 28 | <tr><td> | ||
1053 | 29 | %if line['index']==0: | ||
1054 | 30 | ${ formatLang(object.move_id.date,date=True) or ''| entity} | ||
1055 | 31 | %endif | ||
1056 | 32 | </td><td> | ||
1057 | 33 | %if line['index']==0: | ||
1058 | 34 | ${ formatLang(object.date_invoice,date=True) or '' | entity} | ||
1059 | 35 | %endif | ||
1060 | 36 | </td><td> | ||
1061 | 37 | %if line['index']==0: | ||
1062 | 38 | ${object.number or ''| entity} | ||
1063 | 39 | %endif | ||
1064 | 40 | </td><td> | ||
1065 | 41 | %if line['index']==0: | ||
1066 | 42 | ${object.partner_id.name | entity} | ||
1067 | 43 | %endif | ||
1068 | 44 | </td><td> | ||
1069 | 45 | %if line['index']==0: | ||
1070 | 46 | %if object.type == 'out_invoice': | ||
1071 | 47 | Fattura | ||
1072 | 48 | %elif object.type == 'out_refund': | ||
1073 | 49 | Nota di credito | ||
1074 | 50 | %endif | ||
1075 | 51 | %endif | ||
1076 | 52 | </td><td style="text-align:right"> | ||
1077 | 53 | %if line['index']==0: | ||
1078 | 54 | ${ object.amount_total | entity} | ||
1079 | 55 | %endif | ||
1080 | 56 | </td> | ||
1081 | 57 | <td style="text-align:right">${ line['tax_percentage'] or ''| entity}</td> | ||
1082 | 58 | <td style="text-align:right">${ line['base'] or ''| entity}</td> | ||
1083 | 59 | <td style="text-align:right">${ line['amount'] or ''| entity}</td> | ||
1084 | 60 | <td></td> | ||
1085 | 61 | </tr> | ||
1086 | 62 | %endfor | ||
1087 | 63 | %endfor | ||
1088 | 64 | </tbody> | ||
1089 | 65 | </table> | ||
1090 | 66 | <div style="page-break-inside: avoid;"> | ||
1091 | 67 | <br/> | ||
1092 | 68 | <table style="width:100%; " border="1"> | ||
1093 | 69 | <tr style="border-style:ridge;border-width:5px"> | ||
1094 | 70 | <td colspan="3" style="padding:10; ">Periodo di stampa dal <strong>${formatLang(data['form']['date_from'],date=True)| entity}</strong> al <strong>${formatLang(data['form']['date_to'],date=True)| entity}</strong></td> | ||
1095 | 71 | </tr> | ||
1096 | 72 | <tr> | ||
1097 | 73 | <td rowspan="2" style="vertical-align:text-top;padding:10"> | ||
1098 | 74 | <table style="width:100%;"> | ||
1099 | 75 | <tr> | ||
1100 | 76 | <th style="text-align:left">Descrizione</th> | ||
1101 | 77 | <th style="text-align:right">Imponibile</th> | ||
1102 | 78 | <th style="text-align:right">Imposta</th> | ||
1103 | 79 | </tr> | ||
1104 | 80 | %for tax_code in tax_codes : | ||
1105 | 81 | <tr> | ||
1106 | 82 | <td>${tax_code|entity} | ||
1107 | 83 | </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['base'])|entity} | ||
1108 | 84 | </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['amount']) or ''|entity} | ||
1109 | 85 | </td> | ||
1110 | 86 | </tr> | ||
1111 | 87 | %endfor | ||
1112 | 88 | </table> | ||
1113 | 89 | </td><td style="padding:10">Totale operazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_operazioni'])|entity}</strong></p><br/></td> | ||
1114 | 90 | <td style="padding:10">Totale imponibili:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_imponibili'])|entity}</strong></p><br/></td> | ||
1115 | 91 | </tr> | ||
1116 | 92 | <tr> | ||
1117 | 93 | <td style="padding:10">Totale variazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_variazioni'])|entity}</strong></p><br/></td> | ||
1118 | 94 | <td style="padding:10">Totale IVA:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_iva'])|entity}</strong></p><br/></td> | ||
1119 | 95 | </tr> | ||
1120 | 96 | </table> | ||
1121 | 97 | </div> | ||
1122 | 98 | </body> | ||
1123 | 99 | </html> | ||
1124 | 0 | 100 | ||
1125 | === added directory 'l10n_it_vat_registries/wizard' | |||
1126 | === added file 'l10n_it_vat_registries/wizard/__init__.py' | |||
1127 | --- l10n_it_vat_registries/wizard/__init__.py 1970-01-01 00:00:00 +0000 | |||
1128 | +++ l10n_it_vat_registries/wizard/__init__.py 2011-08-24 09:56:24 +0000 | |||
1129 | @@ -0,0 +1,23 @@ | |||
1130 | 1 | # -*- coding: utf-8 -*- | ||
1131 | 2 | ############################################################################## | ||
1132 | 3 | # | ||
1133 | 4 | # Copyright (C) 2011 Associazione OpenERP Italia | ||
1134 | 5 | # (<http://www.openerp-italia.org>). | ||
1135 | 6 | # All Rights Reserved | ||
1136 | 7 | # | ||
1137 | 8 | # This program is free software: you can redistribute it and/or modify | ||
1138 | 9 | # it under the terms of the GNU Affero General Public License as published | ||
1139 | 10 | # by the Free Software Foundation, either version 3 of the License, or | ||
1140 | 11 | # (at your option) any later version. | ||
1141 | 12 | # | ||
1142 | 13 | # This program is distributed in the hope that it will be useful, | ||
1143 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1144 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1145 | 16 | # GNU General Public License for more details. | ||
1146 | 17 | # | ||
1147 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
1148 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1149 | 20 | # | ||
1150 | 21 | ############################################################################## | ||
1151 | 22 | |||
1152 | 23 | import print_registro_iva | ||
1153 | 0 | 24 | ||
1154 | === added file 'l10n_it_vat_registries/wizard/print_registro_iva.py' | |||
1155 | --- l10n_it_vat_registries/wizard/print_registro_iva.py 1970-01-01 00:00:00 +0000 | |||
1156 | +++ l10n_it_vat_registries/wizard/print_registro_iva.py 2011-08-24 09:56:24 +0000 | |||
1157 | @@ -0,0 +1,114 @@ | |||
1158 | 1 | # -*- encoding: utf-8 -*- | ||
1159 | 2 | ############################################################################## | ||
1160 | 3 | # | ||
1161 | 4 | # Copyright (C) 2011 Associazione OpenERP Italia | ||
1162 | 5 | # (<http://www.openerp-italia.org>). | ||
1163 | 6 | # All Rights Reserved | ||
1164 | 7 | # | ||
1165 | 8 | # This program is free software: you can redistribute it and/or modify | ||
1166 | 9 | # it under the terms of the GNU Affero General Public License as published | ||
1167 | 10 | # by the Free Software Foundation, either version 3 of the License, or | ||
1168 | 11 | # (at your option) any later version. | ||
1169 | 12 | # | ||
1170 | 13 | # This program is distributed in the hope that it will be useful, | ||
1171 | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1172 | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1173 | 16 | # GNU General Public License for more details. | ||
1174 | 17 | # | ||
1175 | 18 | # You should have received a copy of the GNU Affero General Public License | ||
1176 | 19 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1177 | 20 | # | ||
1178 | 21 | ############################################################################## | ||
1179 | 22 | |||
1180 | 23 | from osv import fields,osv | ||
1181 | 24 | from tools.translate import _ | ||
1182 | 25 | import time | ||
1183 | 26 | |||
1184 | 27 | class wizard_registro_iva(osv.osv_memory): | ||
1185 | 28 | |||
1186 | 29 | _name = "wizard.registro.iva" | ||
1187 | 30 | _columns = { | ||
1188 | 31 | 'date_from': fields.date('From date', required=True), | ||
1189 | 32 | 'date_to': fields.date('To date', required=True), | ||
1190 | 33 | 'type': fields.selection([ | ||
1191 | 34 | ('customer', 'Customer Invoices'), | ||
1192 | 35 | ('supplier', 'Supplier Invoices'), | ||
1193 | 36 | ('corrispettivi', 'Corrispettivi'), | ||
1194 | 37 | ], 'Type', required=True), | ||
1195 | 38 | 'journal_ids': fields.many2many('account.journal', 'registro_iva_journals_rel', 'journal_id', 'registro_id', 'Journals', help='Select journals you want retrieve documents from', required=True), | ||
1196 | 39 | 'message': fields.char('Message', size=64, readonly=True), | ||
1197 | 40 | } | ||
1198 | 41 | _defaults = { | ||
1199 | 42 | 'type': 'customer', | ||
1200 | 43 | 'date_from': lambda * a: time.strftime('%Y-%m-%d'), | ||
1201 | 44 | 'date_to': lambda * a: time.strftime('%Y-%m-%d'), | ||
1202 | 45 | 'journal_ids': lambda s, cr, uid, c: s.pool.get('account.journal').search(cr, uid, []), | ||
1203 | 46 | } | ||
1204 | 47 | |||
1205 | 48 | def print_registro(self, cr, uid, ids, context=None): | ||
1206 | 49 | inv_ids = [] | ||
1207 | 50 | wizard = self.read(cr, uid, ids)[0] | ||
1208 | 51 | inv_obj = self.pool.get('account.invoice') | ||
1209 | 52 | search_list = [] | ||
1210 | 53 | if wizard['type'] == 'customer': | ||
1211 | 54 | search_list = [ | ||
1212 | 55 | ('journal_id', 'in', wizard['journal_ids']), | ||
1213 | 56 | ('corrispettivo', '=', False), | ||
1214 | 57 | ('move_id.date', '<=', wizard['date_to']), | ||
1215 | 58 | ('move_id.date', '>=', wizard['date_from']), | ||
1216 | 59 | '|', | ||
1217 | 60 | ('type', '=', 'out_invoice'), | ||
1218 | 61 | ('type', '=', 'out_refund'), | ||
1219 | 62 | '|', | ||
1220 | 63 | ('state', '=', 'open'), | ||
1221 | 64 | ('state', '=', 'paid'), | ||
1222 | 65 | ] | ||
1223 | 66 | elif wizard['type'] == 'supplier': | ||
1224 | 67 | search_list = [ | ||
1225 | 68 | ('journal_id', 'in', wizard['journal_ids']), | ||
1226 | 69 | ('corrispettivo', '=', False), | ||
1227 | 70 | ('move_id.date', '<=', wizard['date_to']), | ||
1228 | 71 | ('move_id.date', '>=', wizard['date_from']), | ||
1229 | 72 | '|', | ||
1230 | 73 | ('type', '=', 'in_invoice'), | ||
1231 | 74 | ('type', '=', 'in_refund'), | ||
1232 | 75 | '|', | ||
1233 | 76 | ('state', '=', 'open'), | ||
1234 | 77 | ('state', '=', 'paid'), | ||
1235 | 78 | ] | ||
1236 | 79 | elif wizard['type'] == 'corrispettivi': | ||
1237 | 80 | search_list = [ | ||
1238 | 81 | ('journal_id', 'in', wizard['journal_ids']), | ||
1239 | 82 | ('corrispettivo', '=', True), | ||
1240 | 83 | ('move_id.date', '<=', wizard['date_to']), | ||
1241 | 84 | ('move_id.date', '>=', wizard['date_from']), | ||
1242 | 85 | '|', | ||
1243 | 86 | ('type', '=', 'out_invoice'), | ||
1244 | 87 | ('type', '=', 'out_refund'), | ||
1245 | 88 | '|', | ||
1246 | 89 | ('state', '=', 'open'), | ||
1247 | 90 | ('state', '=', 'paid'), | ||
1248 | 91 | ] | ||
1249 | 92 | inv_ids = inv_obj.search(cr, uid, search_list) | ||
1250 | 93 | if not inv_ids: | ||
1251 | 94 | self.write(cr, uid, ids, {'message': _('No documents found in the current selection')}) | ||
1252 | 95 | return True | ||
1253 | 96 | if context is None: | ||
1254 | 97 | context = {} | ||
1255 | 98 | datas = {'ids': inv_ids} | ||
1256 | 99 | datas['model'] = 'account.invoice' | ||
1257 | 100 | datas['form'] = wizard | ||
1258 | 101 | datas['inv_ids'] = inv_ids | ||
1259 | 102 | res= { | ||
1260 | 103 | 'type': 'ir.actions.report.xml', | ||
1261 | 104 | 'datas': datas, | ||
1262 | 105 | } | ||
1263 | 106 | if wizard['type'] == 'customer': | ||
1264 | 107 | res['report_name'] = 'registro_iva_vendite' | ||
1265 | 108 | elif wizard['type'] == 'supplier': | ||
1266 | 109 | res['report_name'] = 'registro_iva_acquisti' | ||
1267 | 110 | elif wizard['type'] == 'corrispettivi': | ||
1268 | 111 | res['report_name'] = 'registro_iva_corrispettivi' | ||
1269 | 112 | return res | ||
1270 | 113 | |||
1271 | 114 | wizard_registro_iva() | ||
1272 | 0 | 115 | ||
1273 | === added file 'l10n_it_vat_registries/wizard/print_registro_iva.xml' | |||
1274 | --- l10n_it_vat_registries/wizard/print_registro_iva.xml 1970-01-01 00:00:00 +0000 | |||
1275 | +++ l10n_it_vat_registries/wizard/print_registro_iva.xml 2011-08-24 09:56:24 +0000 | |||
1276 | @@ -0,0 +1,41 @@ | |||
1277 | 1 | <?xml version="1.0" encoding="utf-8"?> | ||
1278 | 2 | <openerp> | ||
1279 | 3 | <data> | ||
1280 | 4 | |||
1281 | 5 | <record id="wizard_registro_iva" model="ir.ui.view"> | ||
1282 | 6 | <field name="name">VAT Registry</field> | ||
1283 | 7 | <field name="model">wizard.registro.iva</field> | ||
1284 | 8 | <field name="type">form</field> | ||
1285 | 9 | <field name="arch" type="xml"> | ||
1286 | 10 | <form string="Tax Journal"> | ||
1287 | 11 | <field name="date_from"/> | ||
1288 | 12 | <field name="date_to"/> | ||
1289 | 13 | <field name="type" colspan="4"/> | ||
1290 | 14 | <separator string="Journals" colspan="4"/> | ||
1291 | 15 | <field name="journal_ids" colspan="4" nolabel="1" height="250"/> | ||
1292 | 16 | <button icon="gtk-cancel" special="cancel" string="Cancel"/> | ||
1293 | 17 | <button icon="gtk-ok" name="print_registro" string="Print" type="object"/> | ||
1294 | 18 | <newline/> | ||
1295 | 19 | <field name="message" nolabel="1" colspan="4"/> | ||
1296 | 20 | </form> | ||
1297 | 21 | </field> | ||
1298 | 22 | </record> | ||
1299 | 23 | |||
1300 | 24 | <record id="action_registro_iva" model="ir.actions.act_window"> | ||
1301 | 25 | <field name="name">VAT Registry</field> | ||
1302 | 26 | <field name="type">ir.actions.act_window</field> | ||
1303 | 27 | <field name="res_model">wizard.registro.iva</field> | ||
1304 | 28 | <field name="view_type">form</field> | ||
1305 | 29 | <field name="view_mode">form</field> | ||
1306 | 30 | <field name="target">new</field> | ||
1307 | 31 | </record> | ||
1308 | 32 | |||
1309 | 33 | <menuitem | ||
1310 | 34 | name="VAT Registries" | ||
1311 | 35 | parent="account.menu_finance_reporting" | ||
1312 | 36 | action="action_registro_iva" | ||
1313 | 37 | id="menu_registro_iva" | ||
1314 | 38 | icon="STOCK_PRINT"/> | ||
1315 | 39 | |||
1316 | 40 | </data> | ||
1317 | 41 | </openerp> |
mi pare funzionare tutto correttamente dal punto di vista tecnico