Merge lp:~openobject-italia-core-devs/openobject-italia/adding_l10n_it_tax_journal into lp:~openobject-italia-core-devs/openobject-italia/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
Reviewer Review Type Date Requested Status
Davide Corio (community) Approve
Review via email: mp+71277@code.launchpad.net
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 :

mi pare funzionare tutto correttamente dal punto di vista tecnico

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