Merge lp:~icsergio/openobject-italia/adding_l10n_it_vat_registries into lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0

Proposed by Sergio Corato
Status: Merged
Merged at revision: 201
Proposed branch: lp:~icsergio/openobject-italia/adding_l10n_it_vat_registries
Merge into: lp:~openobject-italia-core-devs/openobject-italia/italian-addons-7.0
Diff against target: 1845 lines (+1762/-0)
15 files modified
l10n_it_vat_registries/AUTHORS.txt (+2/-0)
l10n_it_vat_registries/__init__.py (+24/-0)
l10n_it_vat_registries/__openerp__.py (+42/-0)
l10n_it_vat_registries/account.py (+48/-0)
l10n_it_vat_registries/account_view.xml (+17/-0)
l10n_it_vat_registries/i18n/it.po (+190/-0)
l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot (+185/-0)
l10n_it_vat_registries/invoice.py (+356/-0)
l10n_it_vat_registries/reports.xml (+268/-0)
l10n_it_vat_registries/templates/registro_iva_acquisti.mako (+169/-0)
l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako (+127/-0)
l10n_it_vat_registries/templates/registro_iva_vendite.mako (+158/-0)
l10n_it_vat_registries/wizard/__init__.py (+22/-0)
l10n_it_vat_registries/wizard/print_registro_iva.py (+113/-0)
l10n_it_vat_registries/wizard/print_registro_iva.xml (+41/-0)
To merge this branch: bzr merge lp:~icsergio/openobject-italia/adding_l10n_it_vat_registries
Reviewer Review Type Date Requested Status
Lorenzo Battistini Approve
Review via email: mp+142417@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Anche qui, rimuoverei ovunque la scritta 'All Rights Reserved'.

review: Approve
196. By Sergio Corato

[REMOVED] All rights reserved

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'l10n_it_vat_registries'
=== added file 'l10n_it_vat_registries/AUTHORS.txt'
--- l10n_it_vat_registries/AUTHORS.txt 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/AUTHORS.txt 2013-01-29 22:10:26 +0000
@@ -0,0 +1,2 @@
1Lorenzo Battistini <lorenzo.battistini@domsense.com>
2Ingrid Barcaro
03
=== added file 'l10n_it_vat_registries/__init__.py'
--- l10n_it_vat_registries/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/__init__.py 2013-01-29 22:10:26 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Associazione OpenERP Italia
5# (<http://www.openerp-italia.org>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as published
9# by the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import wizard
23import account
24import invoice
025
=== added file 'l10n_it_vat_registries/__openerp__.py'
--- l10n_it_vat_registries/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/__openerp__.py 2013-01-29 22:10:26 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011-2012 Associazione OpenERP Italia
5# (<http://www.openerp-italia.org>).
6# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
7# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU Affero General Public License as published
11# by the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU Affero General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23{
24 'name': 'Italian Localisation - VAT Registries',
25 'version': '0.1',
26 'category': 'Localisation/Italy',
27 'description': """Accounting reports for Italian localization - VAT Registries\nhttp://wiki.openerp-italia.org/doku.php/moduli/l10n_it_tax_journal""",
28 'author': 'OpenERP Italian Community',
29 'website': 'http://www.openerp-italia.org',
30 'license': 'AGPL-3',
31 "depends" : ['report_webkit', 'l10n_it_account', 'l10n_it_partially_deductible_vat'],
32 "init_xml" : [
33 ],
34 "update_xml" : [
35 'reports.xml',
36 'account_view.xml',
37 'wizard/print_registro_iva.xml',
38 ],
39 "demo_xml" : [],
40 "active": False,
41 "installable": True
42}
043
=== added file 'l10n_it_vat_registries/account.py'
--- l10n_it_vat_registries/account.py 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/account.py 2013-01-29 22:10:26 +0000
@@ -0,0 +1,48 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011-2012 Associazione OpenERP Italia
5# (<http://www.openerp-italia.org>).
6# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
7# Copyright (C) 2012 Domsense srl (<http://www.domsense.com>)
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU Affero General Public License as published
11# by the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU Affero General Public License for more details.
18#
19# You should have received a copy of the GNU Affero General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24from osv import fields, osv
25from tools.translate import _
26
27
28class account_tax(osv.osv):
29
30 _inherit = 'account.tax'
31 _columns = {
32 'exclude_from_registries': fields.boolean(
33 'Exclude from VAT registries'),
34 'base_tax_ids': fields.one2many(
35 'account.tax', 'base_code_id', 'Base Taxes'), # serve ancora?
36 }
37 _sql_constraints = [
38 ('name_uniq', 'UNIQUE(name)', 'The tax name must be unique!'),
39 ]
40
41 def get_account_tax(self, inv_tax):
42 if inv_tax.tax_code_id:
43 return self.get_account_tax_by_tax_code(inv_tax.tax_code_id)
44 if inv_tax.base_code_id:
45 return self.get_account_tax_by_base_code(inv_tax.base_code_id)
46 raise osv.except_osv(_('Error'),
47 _('No tax codes for invoice tax %s') % str(inv_tax.name))
48
049
=== added file 'l10n_it_vat_registries/account_view.xml'
--- l10n_it_vat_registries/account_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/account_view.xml 2013-01-29 22:10:26 +0000
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="view_tax_form" model="ir.ui.view">
6 <field name="name">account.tax.form</field>
7 <field name="model">account.tax</field>
8 <field name="type">form</field>
9 <field name="inherit_id" ref="account.view_tax_form"></field>
10 <field name="arch" type="xml">
11 <field name="active" position="after">
12 <field name="exclude_from_registries"/>
13 </field>
14 </field>
15 </record>
16 </data>
17</openerp>
018
=== added directory 'l10n_it_vat_registries/i18n'
=== added file 'l10n_it_vat_registries/i18n/it.po'
--- l10n_it_vat_registries/i18n/it.po 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/i18n/it.po 2013-01-29 22:10:26 +0000
@@ -0,0 +1,190 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * l10n_it_vat_registries
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.3\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-11-30 16:28+0000\n"
10"PO-Revision-Date: 2011-11-30 17:33+0100\n"
11"Last-Translator: Lorenzo Battistini <lorenzo.battistini@agilebg.com>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"Plural-Forms: \n"
17
18#. module: l10n_it_vat_registries
19#: code:addons/l10n_it_vat_registries/wizard/print_registro_iva.py:81
20#: code:addons/l10n_it_vat_registries/wizard/print_registro_iva.py:85
21#, python-format
22msgid "Taxes %s have different rates"
23msgstr "Taxes %s have different rates"
24
25#. module: l10n_it_vat_registries
26#: code:addons/l10n_it_vat_registries/invoice.py:41
27#: code:addons/l10n_it_vat_registries/wizard/print_registro_iva.py:81
28#: code:addons/l10n_it_vat_registries/wizard/print_registro_iva.py:85
29#: code:addons/l10n_it_vat_registries/wizard/print_registro_iva.py:90
30#, python-format
31msgid "Error"
32msgstr "Error"
33
34#. module: l10n_it_vat_registries
35#: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_vendite_report_id
36msgid "Customer Invoices VAT Registry"
37msgstr "Registro IVA Fatture Emesse"
38
39#. module: l10n_it_vat_registries
40#: model:ir.model,name:l10n_it_vat_registries.model_wizard_registro_iva
41msgid "wizard.registro.iva"
42msgstr "wizard.registro.iva"
43
44#. module: l10n_it_vat_registries
45#: code:addons/l10n_it_vat_registries/wizard/print_registro_iva.py:90
46#, python-format
47msgid "Wrong tax configuration for tax code %s"
48msgstr "Configurazione sbagliata dell'imposta per il conto imposta %s"
49
50#. module: l10n_it_vat_registries
51#: view:wizard.registro.iva:0
52msgid "Print"
53msgstr "Stampa"
54
55#. module: l10n_it_vat_registries
56#: code:addons/l10n_it_vat_registries/invoice.py:119
57#: code:addons/l10n_it_vat_registries/invoice.py:191
58#: code:addons/l10n_it_vat_registries/invoice.py:221
59#, python-format
60msgid "The tax %s is excluded from registries"
61msgstr "L'imposta %s è esclusa dai registri"
62
63#. module: l10n_it_vat_registries
64#: field:wizard.registro.iva,type:0
65msgid "Type"
66msgstr "Tipo"
67
68#. module: l10n_it_vat_registries
69#: selection:wizard.registro.iva,type:0
70msgid "Supplier Invoices"
71msgstr "Fatture ricevute"
72
73#. module: l10n_it_vat_registries
74#: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_acquisti_report_id
75msgid "Supplier Invoices VAT Registry"
76msgstr "Registro IVA Fatture Ricevute"
77
78#. module: l10n_it_vat_registries
79#: model:ir.actions.act_window,name:l10n_it_vat_registries.action_registro_iva
80msgid "VAT Registry"
81msgstr "Registro IVA"
82
83#. module: l10n_it_vat_registries
84#: code:addons/l10n_it_vat_registries/invoice.py:263
85#, python-format
86msgid "The tax %s has no tax codes"
87msgstr "L'imposta %s non ha codici IVA"
88
89#. module: l10n_it_vat_registries
90#: field:account.tax,base_tax_ids:0
91msgid "Base Taxes"
92msgstr "Imposte dell'imponibile"
93
94#. module: l10n_it_vat_registries
95#: model:ir.module.module,description:l10n_it_vat_registries.module_meta_information
96msgid ""
97"Accounting reports for Italian localization - VAT Registries\n"
98"http://wiki.openerp-italia.org/doku.php/moduli/l10n_it_tax_journal"
99msgstr ""
100"Accounting reports for Italian localization - VAT Registries\n"
101"http://wiki.openerp-italia.org/doku.php/moduli/l10n_it_tax_journal"
102
103#. module: l10n_it_vat_registries
104#: view:wizard.registro.iva:0
105msgid "Tax Journal"
106msgstr "Registro IVA"
107
108#. module: l10n_it_vat_registries
109#: field:wizard.registro.iva,date_to:0
110msgid "To date"
111msgstr "Alla data"
112
113#. module: l10n_it_vat_registries
114#: view:wizard.registro.iva:0
115#: field:wizard.registro.iva,journal_ids:0
116msgid "Journals"
117msgstr "Sezionali"
118
119#. module: l10n_it_vat_registries
120#: code:addons/l10n_it_vat_registries/invoice.py:42
121#, python-format
122msgid "The move %s has different partner account type"
123msgstr "La registrazione %s ha dei tipi di conto legati a partner incongruenti"
124
125#. module: l10n_it_vat_registries
126#: sql_constraint:account.tax:0
127msgid "The tax name must be unique!"
128msgstr "Il nome dell'imposta deve essere unico"
129
130#. module: l10n_it_vat_registries
131#: help:wizard.registro.iva,journal_ids:0
132msgid "Select journals you want retrieve documents from"
133msgstr "Selezionare i sezionali da cui si vuole ottenere i documenti"
134
135#. module: l10n_it_vat_registries
136#: selection:wizard.registro.iva,type:0
137msgid "Corrispettivi"
138msgstr "Corrispettivi"
139
140#. module: l10n_it_vat_registries
141#: code:addons/l10n_it_vat_registries/wizard/print_registro_iva.py:96
142#, python-format
143msgid "No documents found in the current selection"
144msgstr "Nessun documento trovato per la selezione corrente"
145
146#. module: l10n_it_vat_registries
147#: model:ir.module.module,shortdesc:l10n_it_vat_registries.module_meta_information
148msgid "Italian Localisation - VAT Registries"
149msgstr "Localizzazione Italiana - Registri IVA"
150
151#. module: l10n_it_vat_registries
152#: model:ir.ui.menu,name:l10n_it_vat_registries.menu_registro_iva
153msgid "VAT Registries"
154msgstr "Registri IVA"
155
156#. module: l10n_it_vat_registries
157#: field:account.tax,exclude_from_registries:0
158msgid "Exclude from VAT registries"
159msgstr "Escludi dai registri IVA"
160
161#. module: l10n_it_vat_registries
162#: selection:wizard.registro.iva,type:0
163msgid "Customer Invoices"
164msgstr "Fatture emesse"
165
166#. module: l10n_it_vat_registries
167#: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_corrispettivi_report_id
168msgid "Corrispettivi VAT Registry"
169msgstr "Registro IVA Corrispettivi"
170
171#. module: l10n_it_vat_registries
172#: field:wizard.registro.iva,date_from:0
173msgid "From date"
174msgstr "Dalla data"
175
176#. module: l10n_it_vat_registries
177#: view:wizard.registro.iva:0
178msgid "Cancel"
179msgstr "Annulla"
180
181#. module: l10n_it_vat_registries
182#: field:wizard.registro.iva,message:0
183msgid "Message"
184msgstr "Messaggio"
185
186#. module: l10n_it_vat_registries
187#: model:ir.model,name:l10n_it_vat_registries.model_account_tax
188msgid "account.tax"
189msgstr "account.tax"
190
0191
=== added file 'l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot'
--- l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/i18n/l10n_it_vat_registries.pot 2013-01-29 22:10:26 +0000
@@ -0,0 +1,185 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * l10n_it_vat_registries
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.0.2\n"
8"Report-Msgid-Bugs-To: support@openerp.com\n"
9"POT-Creation-Date: 2011-08-19 21:40+0000\n"
10"PO-Revision-Date: 2011-08-19 21:40+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: l10n_it_vat_registries
19#: model:ir.module.module,description:l10n_it_vat_registries.module_meta_information
20msgid "Accounting reports for Italian localization - VAT Registries"
21msgstr ""
22
23#. module: l10n_it_vat_registries
24#: model:ir.model,name:l10n_it_vat_registries.model_account_tax_code
25msgid "Tax Code"
26msgstr ""
27
28#. module: l10n_it_vat_registries
29#: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_vendite_report_id
30msgid "Customer Invoices VAT Registry"
31msgstr ""
32
33#. module: l10n_it_vat_registries
34#: model:ir.model,name:l10n_it_vat_registries.model_wizard_registro_iva
35msgid "wizard.registro.iva"
36msgstr ""
37
38#. module: l10n_it_vat_registries
39#: view:wizard.registro.iva:0
40msgid "Print"
41msgstr ""
42
43#. module: l10n_it_vat_registries
44#: field:wizard.registro.iva,type:0
45msgid "Type"
46msgstr ""
47
48#. module: l10n_it_vat_registries
49#: selection:wizard.registro.iva,type:0
50msgid "Supplier Invoices"
51msgstr ""
52
53#. module: l10n_it_vat_registries
54#: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_acquisti_report_id
55msgid "Supplier Invoices VAT Registry"
56msgstr ""
57
58#. module: l10n_it_vat_registries
59#: model:ir.actions.act_window,name:l10n_it_vat_registries.action_registro_iva
60msgid "VAT Registry"
61msgstr ""
62
63#. module: l10n_it_vat_registries
64#: code:addons/l10n_it_vat_registries/invoice.py:116
65#, python-format
66msgid "The tax %s has no tax codes"
67msgstr ""
68
69#. module: l10n_it_vat_registries
70#: field:account.tax,base_tax_ids:0
71#: field:account.tax.code,base_tax_ids:0
72msgid "Base Taxes"
73msgstr ""
74
75#. module: l10n_it_vat_registries
76#: code:addons/l10n_it_vat_registries/invoice.py:70
77#: code:addons/l10n_it_vat_registries/invoice.py:91
78#, python-format
79msgid "The tax %s is excluded from registries"
80msgstr ""
81
82#. module: l10n_it_vat_registries
83#: view:wizard.registro.iva:0
84msgid "Tax Journal"
85msgstr ""
86
87#. module: l10n_it_vat_registries
88#: field:wizard.registro.iva,date_to:0
89msgid "To date"
90msgstr ""
91
92#. module: l10n_it_vat_registries
93#: view:wizard.registro.iva:0
94#: field:wizard.registro.iva,journal_ids:0
95msgid "Journals"
96msgstr ""
97
98#. module: l10n_it_vat_registries
99#: sql_constraint:account.tax:0
100msgid "The tax name must be unique!"
101msgstr ""
102
103#. module: l10n_it_vat_registries
104#: help:wizard.registro.iva,journal_ids:0
105msgid "Select journals you want retrieve documents from"
106msgstr ""
107
108#. module: l10n_it_vat_registries
109#: field:account.tax.code,tax_ids:0
110msgid "Taxes"
111msgstr ""
112
113#. module: l10n_it_vat_registries
114#: selection:wizard.registro.iva,type:0
115msgid "Corrispettivi"
116msgstr ""
117
118#. module: l10n_it_vat_registries
119#: code:addons/l10n_it_vat_registries/wizard/print_registro_iva.py:94
120#, python-format
121msgid "No documents found in the current selection"
122msgstr ""
123
124#. module: l10n_it_vat_registries
125#: model:ir.module.module,shortdesc:l10n_it_vat_registries.module_meta_information
126msgid "Italian Localisation - VAT Registries"
127msgstr ""
128
129#. module: l10n_it_vat_registries
130#: model:ir.ui.menu,name:l10n_it_vat_registries.menu_registro_iva
131msgid "VAT Registries"
132msgstr ""
133
134#. module: l10n_it_vat_registries
135#: code:addons/l10n_it_vat_registries/invoice.py:52
136#, python-format
137msgid "Too many taxes with name %s"
138msgstr ""
139
140#. module: l10n_it_vat_registries
141#: constraint:account.tax.code:0
142msgid "Error ! You can not create recursive accounts."
143msgstr ""
144
145#. module: l10n_it_vat_registries
146#: field:account.tax,exclude_from_registries:0
147msgid "Exclude from VAT registries"
148msgstr ""
149
150#. module: l10n_it_vat_registries
151#: selection:wizard.registro.iva,type:0
152msgid "Customer Invoices"
153msgstr ""
154
155#. module: l10n_it_vat_registries
156#: model:ir.actions.report.xml,name:l10n_it_vat_registries.registro_iva_corrispettivi_report_id
157msgid "Corrispettivi VAT Registry"
158msgstr ""
159
160#. module: l10n_it_vat_registries
161#: field:wizard.registro.iva,date_from:0
162msgid "From date"
163msgstr ""
164
165#. module: l10n_it_vat_registries
166#: code:addons/l10n_it_vat_registries/invoice.py:50
167#, python-format
168msgid "The tax %s does not exist"
169msgstr ""
170
171#. module: l10n_it_vat_registries
172#: view:wizard.registro.iva:0
173msgid "Cancel"
174msgstr ""
175
176#. module: l10n_it_vat_registries
177#: field:wizard.registro.iva,message:0
178msgid "Message"
179msgstr ""
180
181#. module: l10n_it_vat_registries
182#: model:ir.model,name:l10n_it_vat_registries.model_account_tax
183msgid "account.tax"
184msgstr ""
185
0186
=== added directory 'l10n_it_vat_registries/images'
=== added file 'l10n_it_vat_registries/images/registro-iva-corrispettivi.png'
1Binary files l10n_it_vat_registries/images/registro-iva-corrispettivi.png 1970-01-01 00:00:00 +0000 and l10n_it_vat_registries/images/registro-iva-corrispettivi.png 2013-01-29 22:10:26 +0000 differ187Binary files l10n_it_vat_registries/images/registro-iva-corrispettivi.png 1970-01-01 00:00:00 +0000 and l10n_it_vat_registries/images/registro-iva-corrispettivi.png 2013-01-29 22:10:26 +0000 differ
=== added file 'l10n_it_vat_registries/images/registro-iva-fatture-emesse.png'
2Binary files l10n_it_vat_registries/images/registro-iva-fatture-emesse.png 1970-01-01 00:00:00 +0000 and l10n_it_vat_registries/images/registro-iva-fatture-emesse.png 2013-01-29 22:10:26 +0000 differ188Binary files l10n_it_vat_registries/images/registro-iva-fatture-emesse.png 1970-01-01 00:00:00 +0000 and l10n_it_vat_registries/images/registro-iva-fatture-emesse.png 2013-01-29 22:10:26 +0000 differ
=== added file 'l10n_it_vat_registries/invoice.py'
--- l10n_it_vat_registries/invoice.py 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/invoice.py 2013-01-29 22:10:26 +0000
@@ -0,0 +1,356 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Associazione OpenERP Italia
5# (<http://www.openerp-italia.org>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as published
9# by the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import time
23from report import report_sxw
24from tools.translate import _
25from decimal import *
26import netsvc
27
28class Parser(report_sxw.rml_parse):
29
30 logger = netsvc.Logger()
31
32 def _get_partner_type(self, move_line):
33 partner_type = ''
34 for line in move_line.move_id.line_id:
35 if line.account_id.type == 'payable' or line.account_id.type == 'receivable':
36 if not partner_type:
37 partner_type = line.account_id.type
38 elif partner_type != line.account_id.type:
39 raise Exception(
40 _('The move %s has different partner account type') % move_line.move_id.name)
41 return partner_type
42
43 def _move_total(self, move_line):
44 partner_type = self._get_partner_type(move_line)
45 total = 0.0
46 for line in move_line.move_id.line_id:
47 if line.account_id.type == partner_type:
48 total += (line.debit or line.credit)
49 return total
50
51 # Metto al tax code il segno dell'importo dell'imposta.
52 # Il tax code ha l'importo in valuta base, ma ha segno negativo per l'IVA a credito (da stampare positiva)
53 # e per le note di credito (da stampare negative)
54 def _get_amount_with_sign(self, tax_code_amount, amount):
55 return abs(tax_code_amount) * cmp(amount, 0)
56
57 def _is_refund(self, move_line):
58 if self._get_partner_type(move_line) == 'receivable' and move_line.debit > move_line.credit:
59 return True
60 if self._get_partner_type(move_line) == 'payable' and move_line.debit < move_line.credit:
61 return True
62
63 def _get_line_amount_with_sign(self, move_line):
64 if self._get_partner_type(move_line) == 'receivable':
65 return self._get_amount_with_sign(move_line.tax_amount, move_line.credit - move_line.debit)
66 if self._get_partner_type(move_line) == 'payable':
67 return self._get_amount_with_sign(move_line.tax_amount, move_line.debit - move_line.credit)
68
69 # in valuta base
70 def _get_invoice_amount_total(self, invoice):
71 total = 0.0
72 for inv_tax in invoice.tax_line:
73 total += self._get_amount_with_sign(inv_tax.base_amount, inv_tax.base) \
74 + self._get_amount_with_sign(inv_tax.tax_amount, inv_tax.amount)
75 return total
76
77 # in valuta base
78 def _get_invoice_amount_untaxed(self, invoice):
79 total = 0.0
80 for inv_tax in invoice.tax_line:
81 total += self._get_amount_with_sign(inv_tax.base_amount, inv_tax.base)
82 return total
83
84 def _get_tax_lines(self, move):
85 res=[]
86 tax_obj = self.pool.get('account.tax')
87 cur_pool = self.pool.get('res.currency')
88 inv_pool = self.pool.get('account.invoice')
89 # index è usato per non ripetere la stampa dei dati fattura quando ci sono più codici IVA
90 index=0
91 totale_iva = 0.0
92 totale_iva_inded = 0.0
93 invoice_amount_total = 0.0
94 invoice_amount_untaxed = 0.0
95 related_invoices = []
96
97 ''' riusciamo a essere sempre indipendenti dalle fatture?
98 # se c'è l'oggetto fattura, utilizzo il calcolo su fattura
99 for move_line in move.line_id:
100 if move_line.invoice and move_line.invoice.id not in related_invoices:
101 related_invoices.append(move_line.invoice.id)
102 '''
103
104 if related_invoices:
105 for invoice_id in related_invoices:
106 return self._get_tax_lines_by_invoice(inv_pool.browse(self.cr, self.uid, invoice_id))
107
108 for move_line in move.line_id:
109 tax_item = {}
110 if move_line.tax_code_id and move_line.tax_code_id.tax_ids:
111 # Nel wizard ho già controllato che le eventuali diverse
112 # imposte abbiamo la stessa aliquota.
113 # Le diverse imposte devono comunque usare gli stessi tax code
114 main_tax = tax_obj.get_main_tax(move_line.tax_code_id.tax_ids[0])
115 if main_tax.exclude_from_registries:
116 self.logger.notifyChannel("l10n_it_vat_registries", netsvc.LOG_INFO,
117 _('The tax %s is excluded from registries') % main_tax.name)
118 continue
119 # sommo gli imponibili relativi all'imposta corrente
120 base_amount = 0.0
121 for line in move_line.move_id.line_id:
122 if line.tax_code_id.id == main_tax.base_code_id.id:
123 base_amount += self._get_line_amount_with_sign(line)
124 # calcolo % indetraibile
125 actual_tax_amount = base_amount * main_tax.amount
126 actual_tax_amount = cur_pool.round(
127 self.cr, self.uid, move.company_id.currency_id,
128 actual_tax_amount)
129 non_deductible = 0.0
130 if abs(actual_tax_amount) != abs(move_line.tax_amount):
131 non_deductible = 100
132 if move_line.tax_amount:
133 non_deductible = 100 - abs((
134 move_line.tax_amount * 100.0) / actual_tax_amount)
135 non_deductible = cur_pool.round(
136 self.cr, self.uid, move.company_id.currency_id,
137 non_deductible)
138 # calcolo il totale dell'operazione
139 invoice_amount_total = self._move_total(move_line)
140 if self._is_refund(move_line):
141 invoice_amount_total = - invoice_amount_total
142 str_non_deductible = str(non_deductible).split('.')[0]
143 tax_item = {
144 'tax_percentage': main_tax.amount and str(
145 main_tax.amount * 100).split('.')[0] or
146 move_line.tax_code_id.name,
147 'tax_code_name': move_line.tax_code_id.name,
148 'base': base_amount,
149 'amount': actual_tax_amount,
150 'non_deductible': str_non_deductible != '0' and
151 str_non_deductible or '',
152 'index': index,
153 'amount_total': invoice_amount_total,
154 }
155 res.append(tax_item)
156 iva = cur_pool.round(
157 self.cr, self.uid, move.company_id.currency_id,
158 (actual_tax_amount * (100 - non_deductible) * 0.01))
159 iva_inded = cur_pool.round(
160 self.cr, self.uid, move.company_id.currency_id,
161 (actual_tax_amount * non_deductible * 0.01))
162 tax_difference= (iva + iva_inded) - actual_tax_amount
163 # se risulta un'eccedenza, la tolgo dalla parte detraibile
164 if tax_difference > 0:
165 iva = iva - tax_difference
166 # se risulta una mancanza, la aggiungo alla parte indetraibile
167 elif tax_difference < 0:
168 iva_inded = iva_inded + tax_difference
169 totale_iva += iva
170 invoice_amount_untaxed += base_amount
171 totale_iva_inded += iva_inded
172 index += 1
173
174 if tax_item:
175 if tax_item['tax_code_name'] not in self.localcontext[
176 'tax_codes']:
177 self.localcontext['tax_codes'][tax_item[
178 'tax_code_name']] = {
179 'base': tax_item['base'],
180 'amount': tax_item['amount'],
181 }
182 else:
183 self.localcontext['tax_codes'][tax_item[
184 'tax_code_name']]['base'] += tax_item['base']
185 self.localcontext['tax_codes'][tax_item[
186 'tax_code_name']]['amount'] += tax_item['amount']
187
188 self.localcontext['totali'][
189 'totale_operazioni'] += invoice_amount_total
190 self.localcontext['totali'][
191 'totale_imponibili'] += invoice_amount_untaxed
192 self.localcontext['totali']['totale_iva'] += totale_iva
193 self.localcontext['totali']['totale_iva_inded'] += totale_iva_inded
194
195 return res
196
197 def _get_tax_lines_by_invoice(self, invoice):
198 res=[]
199 tax_obj = self.pool.get('account.tax')
200 # index è usato per non ripetere la stampa dei dati fattura quando ci sono più codici IVA
201 index = 0
202 totale_iva = 0.0
203 totale_iva_inded = 0.0
204 invoice_amount_total = 0.0
205 invoice_amount_untaxed = 0.0
206 for inv_tax in invoice.tax_line:
207 tax_item = {}
208 if inv_tax.base_code_id and inv_tax.tax_code_id:
209 account_tax = tax_obj.get_account_tax(inv_tax)
210 if account_tax.exclude_from_registries:
211 self.logger.notifyChannel("l10n_it_vat_registries",
212 netsvc.LOG_INFO, _(
213 'The tax %s is excluded from registries')
214 % account_tax.name)
215 continue
216 account_tax_amount = account_tax.amount
217 invoice_amount_total = self._get_invoice_amount_total(invoice)
218 invoice_amount_untaxed = self._get_invoice_amount_untaxed(
219 invoice)
220 amount = self._get_amount_with_sign(inv_tax.tax_amount,
221 inv_tax.amount)
222 base = self._get_amount_with_sign(inv_tax.base_amount,
223 inv_tax.base)
224 # calcolo le note di credito con segno invertito
225 if invoice.type in ('in_refund', 'out_refund'):
226 amount = -amount
227 base = -base
228 invoice_amount_untaxed = -invoice_amount_untaxed
229 invoice_amount_total = -invoice_amount_total
230 tax_item = {
231 'tax_percentage': account_tax_amount and str(
232 account_tax_amount * 100).split('.')[0] or
233 inv_tax.tax_code_id.name,
234 'base': base,
235 'amount': amount, # in valuta base
236 'non_deductible': 0.0,
237 'index': index,
238 'amount_total': invoice_amount_total,
239 }
240 res.append(tax_item)
241 totale_iva += amount
242 index += 1
243 # Se non c'è il tax code imponibile, cerco la tassa relativa alla parte non deducibile
244 elif inv_tax.tax_code_id:
245 tax = tax_obj.get_main_tax(tax_obj.get_account_tax(inv_tax))
246 if tax.exclude_from_registries:
247 self.logger.notifyChannel("l10n_it_vat_registries",
248 netsvc.LOG_INFO,
249 _('The tax %s is excluded from registries') % tax.name)
250 continue
251 for inv_tax_2 in invoice.tax_line:
252 if inv_tax_2.base_code_id and not inv_tax_2.tax_code_id:
253 base_tax = tax_obj.get_main_tax(
254 tax_obj.get_account_tax(inv_tax_2))
255 # Se hanno la stessa tassa
256 if base_tax.id == tax.id:
257 # Uso il valore assoluto perchè riferendosi
258 # alla stessa imposta non ci possono essere
259 # segni differenti
260 non_deductible = (abs(inv_tax_2.base_amount) /
261 (abs(inv_tax.base_amount) + abs(
262 inv_tax_2.base_amount)) * 100)
263 invoice_amount_total = \
264 self._get_invoice_amount_total(invoice)
265 invoice_amount_untaxed = \
266 self._get_invoice_amount_untaxed(invoice)
267 amount = self._get_amount_with_sign(
268 inv_tax.tax_amount, inv_tax.amount)
269 base = self._get_amount_with_sign(
270 inv_tax.base_amount, inv_tax.base)
271 amount2 = self._get_amount_with_sign(
272 inv_tax_2.tax_amount, inv_tax_2.amount)
273 base2 = self._get_amount_with_sign(
274 inv_tax_2.base_amount, inv_tax_2.base)
275 # calcolo le note di credito con segno invertito
276 if invoice.type in ('in_refund', 'out_refund'):
277 amount = -amount
278 base = -base
279 amount2 = -amount2
280 base2 = -base2
281 invoice_amount_untaxed = \
282 -invoice_amount_untaxed
283 invoice_amount_total = -invoice_amount_total
284 tax_item = {
285 'tax_percentage': base_tax.amount and str(
286 base_tax.amount * 100).split('.')[0] or
287 inv_tax.tax_code_id.name,
288 'base': base + base2,
289 'amount': amount + amount2,
290 'non_deductible': non_deductible and str(
291 non_deductible).split('.')[0] or '',
292 'index': index,
293 'amount_total': invoice_amount_total,
294 }
295 res.append(tax_item)
296 totale_iva += amount
297 totale_iva_inded += amount2
298 index += 1
299 break
300 elif not inv_tax.tax_code_id and not inv_tax.base_code_id:
301 self.logger.notifyChannel("l10n_it_vat_registries",
302 netsvc.LOG_INFO,
303 _('The tax %s has no tax codes') % inv_tax.name)
304 continue
305 if tax_item:
306 if tax_item['tax_percentage'] not in self.localcontext[
307 'tax_codes']:
308 self.localcontext['tax_codes'][tax_item[
309 'tax_percentage']] = {
310 'base': tax_item['base'],
311 'amount': tax_item['amount'],
312 }
313 else:
314 self.localcontext['tax_codes'][tax_item[
315 'tax_percentage']]['base'] += tax_item['base']
316 self.localcontext['tax_codes'][tax_item[
317 'tax_percentage']]['amount'] += tax_item['amount']
318
319 self.localcontext['totali'][
320 'totale_operazioni'] += invoice_amount_total
321 self.localcontext['totali'][
322 'totale_imponibili'] += invoice_amount_untaxed
323# da analizzare self.totale_variazioni += invoice.amount_total
324 self.localcontext['totali']['totale_iva'] += totale_iva
325 self.localcontext['totali']['totale_iva_inded'] += totale_iva_inded
326
327 return res
328
329 def __init__(self, cr, uid, name, context):
330 super(Parser, self).__init__(cr, uid, name, context)
331 self.localcontext.update({
332 'time': time,
333 'tax_lines': self._get_tax_lines,
334 'totali': {
335 'totale_operazioni': 0.0,
336 'totale_imponibili': 0.0,
337 'totale_variazioni': 0.0,
338 'totale_iva': 0.0,
339 'totale_iva_inded': 0.0,
340 },
341 'tax_codes': {},
342 })
343
344
345report_sxw.report_sxw('report.registro_iva_vendite',
346 'registro_iva_vendite',
347 'addons/l10n_it_vat_registries/templates/registro_iva_vendite.mako',
348 parser=Parser)
349report_sxw.report_sxw('report.registro_iva_acquisti',
350 'registro_iva_acquisti',
351 'addons/l10n_it_vat_registries/templates/registro_iva_acquisti.mako',
352 parser=Parser)
353report_sxw.report_sxw('report.registro_iva_corrispettivi',
354 'registro_iva_corrispettivi',
355 'addons/l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako',
356 parser=Parser)
0357
=== added file 'l10n_it_vat_registries/reports.xml'
--- l10n_it_vat_registries/reports.xml 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/reports.xml 2013-01-29 22:10:26 +0000
@@ -0,0 +1,268 @@
1<?xml version="1.0"?>
2<openerp>
3 <data noupdate="1">
4 <record id="ir_header_webkit_vat_registry_sale" model="ir.header_webkit">
5 <field name="orientation">Landscape</field>
6 <field name="format">A4</field>
7 <field name="margin_top">60</field>
8 <field name="html"><![CDATA[<html>
9 <head>
10 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
11 <script>
12 function subst() {
13 var vars={};
14 var x=document.location.search.substring(1).split('&');
15 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
16 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
17 for(var i in x) {
18 var y = document.getElementsByClassName(x[i]);
19 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
20 }
21 }
22 </script>
23 </head>
24 <body style="border:0; margin: 0;" onload="subst()">
25 <% setLang(company.partner_id.lang or "en_US") %>
26 <h1>Registro I.V.A. Vendite</h1>
27 <h3>${company.partner_id.name or ''|entity}</h3>
28 <table style="border-bottom: 4px solid black; width: 100%; padding-bottom: 8px">
29 <tr>
30 <td>
31 <div>${company.partner_id.street or ''|entity}</div>
32 <div>${company.partner_id.street2 or ''|entity}</div>
33 <div>${company.partner_id.zip or ''|entity}</div>
34 <div>${company.partner_id.city or ''|entity}</div>
35 <div>${company.partner_id.province and company.partner_id.province.code or ''|entity}</div>
36 </td>
37 <td>
38 <div>P. IVA: ${company.partner_id.vat or ''|entity}</div>
39 <div>Codice Fiscale: ${company.partner_id.fiscalcode or ''|entity}</div>
40 <div>Codice Attività:</div>
41 <div>Registro Imprese:</div>
42 </td>
43 </tr>
44 </table>
45 <br/>
46 </body>
47</html>]]>
48</field>
49 <field name="footer_html"><![CDATA[<html>
50 <head>
51 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
52 <script>
53 function subst() {
54 var vars={};
55 var x=document.location.search.substring(1).split('&');
56 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
57 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
58 for(var i in x) {
59 var y = document.getElementsByClassName(x[i]);
60 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
61 }
62 }
63 </script>
64 </head>
65 <body style="border:0; margin: 0;" onload="subst()">
66 <table style="border-top: 1px solid black; width: 100%">
67 <tr >
68 <td style="text-align:right;font-size:12;" width="95%">Page ${objects[0].period_id and objects[0].period_id.fiscalyear_id and objects[0].period_id.fiscalyear_id.name or ''|entity}/<span class="page"/></td><td style="text-align:left;font-size:12;"></td>
69 </tr>
70 </table>
71 </body>
72</html>]]></field><field name="css" ><![CDATA[
73tr {
74 page-break-inside: avoid;
75}
76thead{
77 display: table-header-group; /* http://code.google.com/p/wkhtmltopdf/issues/detail?id=9#c8 */
78}
79]]> </field>
80 <field name="name">Registro IVA vendite</field>
81 </record>
82 <record id="ir_header_webkit_vat_registry_purchase" model="ir.header_webkit">
83 <field name="orientation">Landscape</field>
84 <field name="format">A4</field>
85 <field name="margin_top">60</field>
86 <field name="html"><![CDATA[<html>
87 <head>
88 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
89 <script>
90 function subst() {
91 var vars={};
92 var x=document.location.search.substring(1).split('&');
93 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
94 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
95 for(var i in x) {
96 var y = document.getElementsByClassName(x[i]);
97 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
98 }
99 }
100 </script>
101 </head>
102 <body style="border:0; margin: 0;" onload="subst()">
103 <% setLang(company.partner_id.lang or "en_US") %>
104 <h1>Registro I.V.A. Acquisti</h1>
105 <h3>${company.partner_id.name or ''|entity}</h3>
106 <table style="border-bottom: 4px solid black; width: 100%; padding-bottom: 8px">
107 <tr>
108 <td>
109 <div>${company.partner_id.street or ''|entity}</div>
110 <div>${company.partner_id.street2 or ''|entity}</div>
111 <div>${company.partner_id.zip or ''|entity}</div>
112 <div>${company.partner_id.city or ''|entity}</div>
113 <div>${company.partner_id.province and company.partner_id.province.code or ''|entity}</div>
114 </td>
115 <td>
116 <div>P. IVA: ${company.partner_id.vat or ''|entity}</div>
117 <div>Codice Fiscale: ${company.partner_id.fiscalcode or ''|entity}</div>
118 <div>Codice Attività:</div>
119 <div>Registro Imprese:</div>
120 </td>
121 </tr>
122 </table>
123 <br/>
124 </body>
125</html>]]>
126</field>
127 <field name="footer_html"><![CDATA[<html>
128 <head>
129 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
130 <script>
131 function subst() {
132 var vars={};
133 var x=document.location.search.substring(1).split('&');
134 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
135 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
136 for(var i in x) {
137 var y = document.getElementsByClassName(x[i]);
138 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
139 }
140 }
141 </script>
142 </head>
143 <body style="border:0; margin: 0;" onload="subst()">
144 <table style="border-top: 1px solid black; width: 100%">
145 <tr >
146 <td style="text-align:right;font-size:12;" width="95%">Page ${objects[0].period_id and objects[0].period_id.fiscalyear_id and objects[0].period_id.fiscalyear_id.name or ''|entity}/<span class="page"/></td><td style="text-align:left;font-size:12;"></td>
147 </tr>
148 </table>
149 </body>
150</html>]]></field><field name="css" ><![CDATA[
151tr {
152 page-break-inside: avoid;
153}
154thead{
155 display: table-header-group; /* http://code.google.com/p/wkhtmltopdf/issues/detail?id=9#c8 */
156}
157]]> </field>
158 <field name="name">Registro IVA acquisti</field>
159 </record>
160 <record id="ir_header_webkit_vat_registry_corrispettivi" model="ir.header_webkit">
161 <field name="orientation">Landscape</field>
162 <field name="format">A4</field>
163 <field name="margin_top">60</field>
164 <field name="html"><![CDATA[<html>
165 <head>
166 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
167 <script>
168 function subst() {
169 var vars={};
170 var x=document.location.search.substring(1).split('&');
171 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
172 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
173 for(var i in x) {
174 var y = document.getElementsByClassName(x[i]);
175 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
176 }
177 }
178 </script>
179 </head>
180 <body style="border:0; margin: 0;" onload="subst()">
181 <% setLang(company.partner_id.lang or "en_US") %>
182 <h1>Registro I.V.A. Corrispettivi</h1>
183 <h3>${company.partner_id.name or ''|entity}</h3>
184 <table style="border-bottom: 4px solid black; width: 100%; padding-bottom: 8px">
185 <tr>
186 <td>
187 <div>${company.partner_id.street or ''|entity}</div>
188 <div>${company.partner_id.street2 or ''|entity}</div>
189 <div>${company.partner_id.zip or ''|entity}</div>
190 <div>${company.partner_id.city or ''|entity}</div>
191 <div>${company.partner_id.province and company.partner_id.province.code or ''|entity}</div>
192 </td>
193 <td>
194 <div>P. IVA: ${company.partner_id.vat or ''|entity}</div>
195 <div>Codice Fiscale: ${company.partner_id.fiscalcode or ''|entity}</div>
196 <div>Codice Attività:</div>
197 <div>Registro Imprese:</div>
198 </td>
199 </tr>
200 </table>
201 <br/>
202 </body>
203</html>]]>
204</field>
205 <field name="footer_html"><![CDATA[<html>
206 <head>
207 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
208 <script>
209 function subst() {
210 var vars={};
211 var x=document.location.search.substring(1).split('&');
212 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
213 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
214 for(var i in x) {
215 var y = document.getElementsByClassName(x[i]);
216 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
217 }
218 }
219 </script>
220 </head>
221 <body style="border:0; margin: 0;" onload="subst()">
222 <table style="border-top: 1px solid black; width: 100%">
223 <tr >
224 <td style="text-align:right;font-size:12;" width="95%">Page ${objects[0].period_id and objects[0].period_id.fiscalyear_id and objects[0].period_id.fiscalyear_id.name or ''|entity}/<span class="page"/></td><td style="text-align:left;font-size:12;"></td>
225 </tr>
226 </table>
227 </body>
228</html>]]></field><field name="css" ><![CDATA[
229tr {
230 page-break-inside: avoid;
231}
232thead{
233 display: table-header-group; /* http://code.google.com/p/wkhtmltopdf/issues/detail?id=9#c8 */
234}
235]]> </field>
236 <field name="name">Registro IVA corrispettivi</field>
237 </record>
238
239 <record id="registro_iva_vendite_report_id" model="ir.actions.report.xml">
240 <field name="name">Customer Invoices VAT Registry</field>
241 <field name="type">ir.actions.report.xml</field>
242 <field name="model">account.move</field>
243 <field name="report_name">registro_iva_vendite</field>
244 <field name="report_type">webkit</field>
245 <field name="report_rml">l10n_it_vat_registries/templates/registro_iva_vendite.mako</field>
246 <field name="webkit_header" ref="ir_header_webkit_vat_registry_sale"/>
247 </record>
248 <record id="registro_iva_acquisti_report_id" model="ir.actions.report.xml">
249 <field name="name">Supplier Invoices VAT Registry</field>
250 <field name="type">ir.actions.report.xml</field>
251 <field name="model">account.move</field>
252 <field name="report_name">registro_iva_acquisti</field>
253 <field name="report_type">webkit</field>
254 <field name="report_rml">l10n_it_vat_registries/templates/registro_iva_acquisti.mako</field>
255 <field name="webkit_header" ref="ir_header_webkit_vat_registry_purchase"/>
256 </record>
257 <record id="registro_iva_corrispettivi_report_id" model="ir.actions.report.xml">
258 <field name="name">Corrispettivi VAT Registry</field>
259 <field name="type">ir.actions.report.xml</field>
260 <field name="model">account.move</field>
261 <field name="report_name">registro_iva_corrispettivi</field>
262 <field name="report_type">webkit</field>
263 <field name="report_rml">l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako</field>
264 <field name="webkit_header" ref="ir_header_webkit_vat_registry_corrispettivi"/>
265 </record>
266 </data>
267</openerp>
268
0269
=== added directory 'l10n_it_vat_registries/templates'
=== added file 'l10n_it_vat_registries/templates/registro_iva_acquisti.mako'
--- l10n_it_vat_registries/templates/registro_iva_acquisti.mako 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/templates/registro_iva_acquisti.mako 2013-01-29 22:10:26 +0000
@@ -0,0 +1,169 @@
1<html>
2<head>
3 <style type="text/css">
4 ${css}
5 .left_with_line {
6 text-align:left; vertical-align:text-top; border-top:1px solid #000; padding:5px
7 }
8 .right_with_line {
9 text-align:right; vertical-align:text-top; border-top:1px solid #000; padding:5px
10 }
11 .left_without_line {
12 text-align:left; vertical-align:text-top; padding:5px
13 }
14 .right_without_line {
15 text-align:right; vertical-align:text-top; padding:5px
16 }
17 </style>
18</head>
19<body>
20 <h2>Fatture Ricevute</h2>
21 <% setLang(objects[0].company_id.partner_id.lang or "en_US") %>
22 <table style="width:100%;" cellspacing="0">
23 <thead>
24 <tr>
25 <th class="left_without_line">Data registrazione</th>
26 <th class="left_without_line">Numero</th>
27 <th class="left_without_line">Ragione sociale</th>
28 <th class="left_without_line">Numero fattura</th>
29 <th class="left_without_line">Data fattura</th>
30 <th class="left_without_line">Causale</th>
31 <th class="right_without_line">Totale fattura</th>
32 <th class="right_without_line">Imponibile</th>
33 <th class="right_without_line">% IVA</th>
34 <th class="right_without_line">Imposta</th>
35 <th class="right_without_line">% inded.</th>
36 <th></th>
37 </tr>
38 </thead>
39 <tbody>
40 <% counter = 0 %>
41 %for object in objects :
42 <% counter += 1 %>
43 %for line in tax_lines(object) :
44 %if line['index']==0:
45 <tr><td class="left_with_line">
46 %else:
47 <tr><td class="left_without_line">
48 %endif
49 %if line['index']==0:
50 ${ formatLang(object.date,date=True) or '' | entity}
51 %endif
52 %if line['index']==0:
53 </td><td class="left_with_line">
54 %else:
55 </td><td class="left_without_line">
56 %endif
57 %if line['index']==0:
58 ${ counter | entity}
59 %endif
60 %if line['index']==0:
61 </td><td class="left_with_line">
62 %else:
63 </td><td class="left_without_line">
64 %endif
65 %if line['index']==0:
66 ${object.partner_id.name or ''| entity}
67 %endif
68 %if line['index']==0:
69 </td><td class="left_with_line">
70 %else:
71 </td><td class="left_without_line">
72 %endif
73 %if line['index']==0:
74 ${object.name or ''| entity}
75 %endif
76 %if line['index']==0:
77 </td><td class="left_with_line">
78 %else:
79 </td><td class="left_without_line">
80 %endif
81 %if line['index']==0:
82 ${ formatLang(object.date,date=True) or '' | entity}
83 %endif
84 %if line['index']==0:
85 </td><td class="left_with_line">
86 %else:
87 </td><td class="left_without_line">
88 %endif
89 %if line['index']==0:
90 %if line['amount_total'] >= 0:
91 Fattura
92 %else:
93 Nota di credito
94 %endif
95 %endif
96 %if line['index']==0:
97 </td><td class="right_with_line">
98 %else:
99 </td><td class="right_without_line">
100 %endif
101 %if line['index']==0:
102 ${ formatLang(line['amount_total']) | entity}
103 %endif
104 </td>
105 %if line['index']==0:
106 <td class="right_with_line">${ formatLang(line['base']) or ''| entity}</td>
107 %else:
108 <td class="right_without_line">${ formatLang(line['base']) or ''| entity}</td>
109 %endif
110 %if line['index']==0:
111 <td class="right_with_line">${ line['tax_percentage'] or ''| entity}</td>
112 %else:
113 <td class="right_without_line">${ line['tax_percentage'] or ''| entity}</td>
114 %endif
115 %if line['index']==0:
116 <td class="right_with_line">${ formatLang(line['amount']) or ''| entity}</td>
117 %else:
118 <td class="right_without_line">${ formatLang(line['amount']) or ''| entity}</td>
119 %endif
120 %if line['index']==0:
121 <td class="right_with_line">
122 %else:
123 <td class="right_without_line">
124 %endif
125 %if line['non_deductible']:
126 ${ line['non_deductible'] | entity} %
127 %endif
128 </td>
129 <td></td>
130 </tr>
131 %endfor
132 %endfor
133 </tbody>
134 </table>
135 <div style="page-break-inside: avoid;">
136 <br/>
137 <table style="width:100%; " border="1">
138 <tr style="border-style:ridge;border-width:5px">
139 <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>
140 </tr>
141 <tr>
142 <td rowspan="2" style="vertical-align:text-top;padding:10">
143 <table style="width:100%;">
144 <tr>
145 <th style="text-align:left">Descrizione</th>
146 <th style="text-align:right">Imponibile</th>
147 <th style="text-align:right">Imposta</th>
148 </tr>
149 %for tax_code in tax_codes :
150 <tr>
151 <td>${tax_code|entity}
152 </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['base'])|entity}
153 </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['amount']) or ''|entity}
154 </td>
155 </tr>
156 %endfor
157 </table>
158 </td><td style="padding:10">Totale operazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_operazioni'])|entity}</strong></p><br/></td>
159 <td colspan="2" style="padding:10">Totale imponibili:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_imponibili'])|entity}</strong></p><br/></td>
160 </tr>
161 <tr>
162 <td style="padding:10">Totale variazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_variazioni'])|entity}</strong></p><br/></td>
163 <td style="padding:10">Totale IVA Detraibile:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_iva'])|entity}</strong></p><br/></td>
164 <td style="padding:10">Totale IVA Indetraibile:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_iva_inded'])|entity}</strong></p><br/></td>
165 </tr>
166 </table>
167 </div>
168</body>
169</html>
0170
=== added file 'l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako'
--- l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/templates/registro_iva_corrispettivi.mako 2013-01-29 22:10:26 +0000
@@ -0,0 +1,127 @@
1<html>
2<head>
3 <style type="text/css">
4 ${css}
5 .left_with_line {
6 text-align:left; vertical-align:text-top; border-top:1px solid #000; padding:5px
7 }
8 .right_with_line {
9 text-align:right; vertical-align:text-top; border-top:1px solid #000; padding:5px
10 }
11 .left_without_line {
12 text-align:left; vertical-align:text-top; padding:5px
13 }
14 .right_without_line {
15 text-align:right; vertical-align:text-top; padding:5px
16 }
17 </style>
18</head>
19<body>
20 <h2>Corrispettivi</h2>
21 <% setLang(objects[0].company_id.partner_id.lang or "en_US") %>
22 <table style="width:100%;" cellspacing="0">
23 <thead>
24 <tr>
25 <th class="left_without_line">Numero</th>
26 <th class="left_without_line">Data registrazione</th>
27 <th class="left_without_line">Causale</th>
28 <th class="right_without_line">Importo totale</th>
29 <th class="right_without_line">Imponibile</th>
30 <th class="right_without_line">% IVA</th>
31 <th class="right_without_line">Imposta</th>
32 <th></th>
33 </tr>
34 </thead>
35 <tbody>
36 <% counter = 0 %>
37 %for object in objects :
38 <% counter += 1 %>
39 %for line in tax_lines(object) :
40 %if line['index']==0:
41 <tr><td class="left_with_line">
42 %else:
43 <tr><td class="left_without_line">
44 %endif
45 %if line['index']==0:
46 ${ counter | entity}
47 %endif
48 %if line['index']==0:
49 </td><td class="left_with_line">
50 %else:
51 </td><td class="left_without_line">
52 %endif
53 %if line['index']==0:
54 ${ formatLang(object.date,date=True) or ''| entity}
55 %endif
56 %if line['index']==0:
57 </td><td class="left_with_line">
58 %else:
59 </td><td class="left_without_line">
60 %endif
61 %if line['index']==0:
62 Corrispettivi
63 %endif
64 %if line['index']==0:
65 </td><td class="right_with_line">
66 %else:
67 </td><td class="right_without_line">
68 %endif
69 %if line['index']==0:
70 ${ formatLang(line['amount_total']) | entity}
71 %endif
72 </td>
73 %if line['index']==0:
74 <td class="right_with_line">${ formatLang(line['base']) or ''| entity}</td>
75 %else:
76 <td class="right_without_line">${ formatLang(line['base']) or ''| entity}</td>
77 %endif
78 %if line['index']==0:
79 <td class="right_with_line">${ line['tax_percentage'] or ''| entity}</td>
80 %else:
81 <td class="right_without_line">${ line['tax_percentage'] or ''| entity}</td>
82 %endif
83 %if line['index']==0:
84 <td class="right_with_line">${ formatLang(line['amount']) or ''| entity}</td>
85 %else:
86 <td class="right_without_line">${ formatLang(line['amount']) or ''| entity}</td>
87 %endif
88 <td></td>
89 </tr>
90 %endfor
91 %endfor
92 </tbody>
93 </table>
94 <div style="page-break-inside: avoid;">
95 <br/>
96 <table style="width:100%; " border="1">
97 <tr style="border-style:ridge;border-width:5px">
98 <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>
99 </tr>
100 <tr>
101 <td rowspan="2" style="vertical-align:text-top;padding:10">
102 <table style="width:100%;">
103 <tr>
104 <th style="text-align:left">Descrizione</th>
105 <th style="text-align:right">Imponibile</th>
106 <th style="text-align:right">Imposta</th>
107 </tr>
108 %for tax_code in tax_codes :
109 <tr>
110 <td>${tax_code|entity}
111 </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['base'])|entity}
112 </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['amount']) or ''|entity}
113 </td>
114 </tr>
115 %endfor
116 </table>
117 </td><td style="padding:10">Totale operazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_operazioni'])|entity}</strong></p><br/></td>
118 <td style="padding:10">Totale imponibili:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_imponibili'])|entity}</strong></p><br/></td>
119 </tr>
120 <tr>
121 <td style="padding:10">Totale variazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_variazioni'])|entity}</strong></p><br/></td>
122 <td style="padding:10">Totale IVA:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_iva'])|entity}</strong></p><br/></td>
123 </tr>
124 </table>
125 </div>
126</body>
127</html>
0128
=== added file 'l10n_it_vat_registries/templates/registro_iva_vendite.mako'
--- l10n_it_vat_registries/templates/registro_iva_vendite.mako 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/templates/registro_iva_vendite.mako 2013-01-29 22:10:26 +0000
@@ -0,0 +1,158 @@
1<html>
2<head>
3 <style type="text/css">
4 ${css}
5 .left_with_line {
6 text-align:left; vertical-align:text-top; border-top:1px solid #000; padding:5px
7 }
8 .right_with_line {
9 text-align:right; vertical-align:text-top; border-top:1px solid #000; padding:5px
10 }
11 .left_without_line {
12 text-align:left; vertical-align:text-top; padding:5px
13 }
14 .right_without_line {
15 text-align:right; vertical-align:text-top; padding:5px
16 }
17 </style>
18</head>
19<body>
20 <h2>Fatture Emesse</h2>
21 <% setLang(objects[0].company_id.partner_id.lang or "en_US") %>
22 <table style="width:100%;" cellspacing="0">
23 <thead>
24 <tr>
25 <th class="left_without_line">Data registrazione</th>
26 <th class="left_without_line">Numero</th>
27 <th class="left_without_line">Ragione sociale</th>
28 <th class="left_without_line">Numero fattura</th>
29 <th class="left_without_line">Data fattura</th>
30 <th class="left_without_line">Causale</th>
31 <th class="right_without_line">Totale fattura</th>
32 <th class="right_without_line">Imponibile</th>
33 <th class="right_without_line">% IVA</th>
34 <th class="right_without_line">Imposta</th>
35 <th></th>
36 </tr>
37 </thead>
38 <tbody>
39 <% counter = 0 %>
40 %for object in objects :
41 <% counter += 1 %>
42 %for line in tax_lines(object) :
43 %if line['index']==0:
44 <tr><td class="left_with_line">
45 %else:
46 <tr><td class="left_without_line">
47 %endif
48 %if line['index']==0:
49 ${ formatLang(object.date,date=True) or '' | entity}
50 %endif
51 %if line['index']==0:
52 </td><td class="left_with_line">
53 %else:
54 </td><td class="left_without_line">
55 %endif
56 %if line['index']==0:
57 ${ counter | entity}
58 %endif
59 %if line['index']==0:
60 </td><td class="left_with_line">
61 %else:
62 </td><td class="left_without_line">
63 %endif
64 %if line['index']==0:
65 ${object.partner_id.name or ''| entity}
66 %endif
67 %if line['index']==0:
68 </td><td class="left_with_line">
69 %else:
70 </td><td class="left_without_line">
71 %endif
72 %if line['index']==0:
73 ${object.name or ''| entity}
74 %endif
75 %if line['index']==0:
76 </td><td class="left_with_line">
77 %else:
78 </td><td class="left_without_line">
79 %endif
80 %if line['index']==0:
81 ${ formatLang(object.date,date=True) or '' | entity}
82 %endif
83 %if line['index']==0:
84 </td><td class="left_with_line">
85 %else:
86 </td><td class="left_without_line">
87 %endif
88 %if line['index']==0:
89 %if line['amount_total'] >= 0:
90 Fattura
91 %else:
92 Nota di credito
93 %endif
94 %endif
95 %if line['index']==0:
96 </td><td class="right_with_line">
97 %else:
98 </td><td class="right_without_line">
99 %endif
100 %if line['index']==0:
101 ${ formatLang(line['amount_total']) | entity}
102 %endif
103 </td>
104 %if line['index']==0:
105 <td class="right_with_line">${ formatLang(line['base']) or ''| entity}</td>
106 %else:
107 <td class="right_without_line">${ formatLang(line['base']) or ''| entity}</td>
108 %endif
109 %if line['index']==0:
110 <td class="right_with_line">${ line['tax_percentage'] or ''| entity}</td>
111 %else:
112 <td class="right_without_line">${ line['tax_percentage'] or ''| entity}</td>
113 %endif
114 %if line['index']==0:
115 <td class="right_with_line">${ formatLang(line['amount']) or ''| entity}</td>
116 %else:
117 <td class="right_without_line">${ formatLang(line['amount']) or ''| entity}</td>
118 %endif
119 <td></td>
120 </tr>
121 %endfor
122 %endfor
123 </tbody>
124 </table>
125 <div style="page-break-inside: avoid;">
126 <br/>
127 <table style="width:100%; " border="1">
128 <tr style="border-style:ridge;border-width:5px">
129 <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>
130 </tr>
131 <tr>
132 <td rowspan="2" style="vertical-align:text-top;padding:10">
133 <table style="width:100%;">
134 <tr>
135 <th style="text-align:left">Descrizione</th>
136 <th style="text-align:right">Imponibile</th>
137 <th style="text-align:right">Imposta</th>
138 </tr>
139 %for tax_code in tax_codes :
140 <tr>
141 <td>${tax_code|entity}
142 </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['base'])|entity}
143 </td><td style="text-align:right">${formatLang(tax_codes[tax_code]['amount']) or ''|entity}
144 </td>
145 </tr>
146 %endfor
147 </table>
148 </td><td style="padding:10">Totale operazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_operazioni'])|entity}</strong></p><br/></td>
149 <td style="padding:10">Totale imponibili:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_imponibili'])|entity}</strong></p><br/></td>
150 </tr>
151 <tr>
152 <td style="padding:10">Totale variazioni:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_variazioni'])|entity}</strong></p><br/></td>
153 <td style="padding:10">Totale IVA:<br/><p style="text-align:center"><strong>${formatLang(totali['totale_iva'])|entity}</strong></p><br/></td>
154 </tr>
155 </table>
156 </div>
157</body>
158</html>
0159
=== added directory 'l10n_it_vat_registries/wizard'
=== added file 'l10n_it_vat_registries/wizard/__init__.py'
--- l10n_it_vat_registries/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/wizard/__init__.py 2013-01-29 22:10:26 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Associazione OpenERP Italia
5# (<http://www.openerp-italia.org>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as published
9# by the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import print_registro_iva
023
=== added file 'l10n_it_vat_registries/wizard/print_registro_iva.py'
--- l10n_it_vat_registries/wizard/print_registro_iva.py 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/wizard/print_registro_iva.py 2013-01-29 22:10:26 +0000
@@ -0,0 +1,113 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2011 Associazione OpenERP Italia
5# (<http://www.openerp-italia.org>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as published
9# by the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from osv import fields,osv
23from tools.translate import _
24import time
25
26class wizard_registro_iva(osv.osv_memory):
27
28 _name = "wizard.registro.iva"
29 _columns = {
30 'date_from': fields.date('From date', required=True),
31 'date_to': fields.date('To date', required=True),
32 'type': fields.selection([
33 ('customer', 'Customer Invoices'),
34 ('supplier', 'Supplier Invoices'),
35 ('corrispettivi', 'Corrispettivi'),
36 ], 'Layout', required=True),
37 '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),
38 'message': fields.char('Message', size=64, readonly=True),
39 }
40 _defaults = {
41 'type': 'customer',
42 'date_from': lambda * a: time.strftime('%Y-%m-%d'),
43 'date_to': lambda * a: time.strftime('%Y-%m-%d'),
44 #'journal_ids': lambda s, cr, uid, c: s.pool.get('account.journal').search(cr, uid, []),
45 }
46
47 def counterparts_number(self, move_line):
48 counter = 0
49 if not move_line.credit:
50 for line in move_line.move_id.line_id:
51 if line.credit:
52 counter += 1
53 elif not move_line.debit:
54 for line in move_line.move_id.line_id:
55 if line.debit:
56 counter += 1
57 return counter
58
59 def print_registro(self, cr, uid, ids, context=None):
60 move_ids = []
61 wizard = self.read(cr, uid, ids)[0]
62 move_line_obj = self.pool.get('account.move.line')
63 tax_pool = self.pool.get('account.tax')
64 search_list = []
65 search_list = [
66 ('journal_id', 'in', wizard['journal_ids']),
67 ('move_id.date', '<=', wizard['date_to']),
68 ('move_id.date', '>=', wizard['date_from']),
69 ('move_id.state', '=', 'posted'),
70 ('tax_code_id', '!=', False),
71 ]
72 move_line_ids = move_line_obj.search(cr, uid, search_list, order='date')
73 if context is None:
74 context = {}
75 for move_line in move_line_obj.browse(cr, uid, move_line_ids):
76 # verifico che sia coinvolto un conto imposta legato ad un'imposta tramite conto standard o conto refund
77 if move_line.tax_code_id.tax_ids or move_line.tax_code_id.ref_tax_ids:
78 if move_line.tax_code_id.tax_ids:
79 if not tax_pool._have_same_rate(move_line.tax_code_id.tax_ids):
80 raise osv.except_osv(_('Error'), _('Taxes %s have different rates')
81 % str(move_line.tax_code_id.tax_ids))
82 if move_line.tax_code_id.ref_tax_ids:
83 if not tax_pool._have_same_rate(move_line.tax_code_id.ref_tax_ids):
84 raise osv.except_osv(_('Error'), _('Taxes %s have different rates')
85 % str(move_line.tax_code_id.ref_tax_ids))
86 # controllo che ogni tax code abbia una e una sola imposta
87 ''' non posso farlo per via dell IVA inclusa nel prezzo
88 if len(move_line.tax_code_id.tax_ids) != 1:
89 raise osv.except_osv(_('Error'), _('Wrong tax configuration for tax code %s')
90 % move_line.tax_code_id.name)
91 '''
92 if move_line.move_id.id not in move_ids:
93 move_ids.append(move_line.move_id.id)
94 if not move_ids:
95 self.write(cr, uid, ids, {'message': _('No documents found in the current selection')})
96 return True
97 datas = {'ids': move_ids}
98 datas['model'] = 'account.move'
99 datas['form'] = wizard
100 datas['move_ids'] = move_ids
101 res= {
102 'type': 'ir.actions.report.xml',
103 'datas': datas,
104 }
105 if wizard['type'] == 'customer':
106 res['report_name'] = 'registro_iva_vendite'
107 elif wizard['type'] == 'supplier':
108 res['report_name'] = 'registro_iva_acquisti'
109 elif wizard['type'] == 'corrispettivi':
110 res['report_name'] = 'registro_iva_corrispettivi'
111 return res
112
113wizard_registro_iva()
0114
=== added file 'l10n_it_vat_registries/wizard/print_registro_iva.xml'
--- l10n_it_vat_registries/wizard/print_registro_iva.xml 1970-01-01 00:00:00 +0000
+++ l10n_it_vat_registries/wizard/print_registro_iva.xml 2013-01-29 22:10:26 +0000
@@ -0,0 +1,41 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="wizard_registro_iva" model="ir.ui.view">
6 <field name="name">VAT Registry</field>
7 <field name="model">wizard.registro.iva</field>
8 <field name="type">form</field>
9 <field name="arch" type="xml">
10 <form string="Tax Journal">
11 <field name="date_from"/>
12 <field name="date_to"/>
13 <field name="type" colspan="4"/>
14 <separator string="Journals" colspan="4"/>
15 <field name="journal_ids" colspan="4" nolabel="1" height="250"/>
16 <button icon="gtk-cancel" special="cancel" string="Cancel"/>
17 <button icon="gtk-ok" name="print_registro" string="Print" type="object"/>
18 <newline/>
19 <field name="message" nolabel="1" colspan="4"/>
20 </form>
21 </field>
22 </record>
23
24 <record id="action_registro_iva" model="ir.actions.act_window">
25 <field name="name">VAT Registry</field>
26 <field name="type">ir.actions.act_window</field>
27 <field name="res_model">wizard.registro.iva</field>
28 <field name="view_type">form</field>
29 <field name="view_mode">form</field>
30 <field name="target">new</field>
31 </record>
32
33 <menuitem
34 name="VAT Registries"
35 parent="account.menu_finance_reporting"
36 action="action_registro_iva"
37 id="menu_registro_iva"
38 icon="STOCK_PRINT"/>
39
40 </data>
41</openerp>

Subscribers

People subscribed via source and target branches