From 9fe083fbfb47f26ba99b55508081fb8c8cec9d5f Mon Sep 17 00:00:00 2001 From: Marco Colombo Date: Thu, 31 Oct 2024 19:23:16 +0100 Subject: [PATCH] [ADD] l10n_it_vat_registries_xlsx: new module --- l10n_it_vat_registries_xlsx/README.rst | 166 ++++++ l10n_it_vat_registries_xlsx/__init__.py | 3 + l10n_it_vat_registries_xlsx/__manifest__.py | 24 + l10n_it_vat_registries_xlsx/i18n/it.po | 181 +++++++ l10n_it_vat_registries_xlsx/pyproject.toml | 3 + .../readme/CONTRIBUTORS.md | 1 + l10n_it_vat_registries_xlsx/readme/USAGE.md | 10 + .../report/report_registro_iva.xml | 322 +++++++++++ .../report/reports.xml | 14 + .../security/ir.model.access.csv | 5 + .../security/vat_registry_security.xml | 13 + .../static/description/icon.png | Bin 0 -> 6167 bytes .../static/description/index.html | 499 ++++++++++++++++++ l10n_it_vat_registries_xlsx/tests/__init__.py | 3 + .../tests/test_registry.py | 96 ++++ .../views/account_journal_view.xml | 15 + .../views/account_tax_registry_view.xml | 39 ++ .../views/account_view.xml | 19 + .../wizard/__init__.py | 3 + .../wizard/print_registro_iva.py | 219 ++++++++ .../wizard/print_registro_iva.xml | 20 + 21 files changed, 1655 insertions(+) create mode 100644 l10n_it_vat_registries_xlsx/README.rst create mode 100644 l10n_it_vat_registries_xlsx/__init__.py create mode 100644 l10n_it_vat_registries_xlsx/__manifest__.py create mode 100644 l10n_it_vat_registries_xlsx/i18n/it.po create mode 100644 l10n_it_vat_registries_xlsx/pyproject.toml create mode 100644 l10n_it_vat_registries_xlsx/readme/CONTRIBUTORS.md create mode 100644 l10n_it_vat_registries_xlsx/readme/USAGE.md create mode 100644 l10n_it_vat_registries_xlsx/report/report_registro_iva.xml create mode 100644 l10n_it_vat_registries_xlsx/report/reports.xml create mode 100644 l10n_it_vat_registries_xlsx/security/ir.model.access.csv create mode 100644 l10n_it_vat_registries_xlsx/security/vat_registry_security.xml create mode 100644 l10n_it_vat_registries_xlsx/static/description/icon.png create mode 100644 l10n_it_vat_registries_xlsx/static/description/index.html create mode 100644 l10n_it_vat_registries_xlsx/tests/__init__.py create mode 100644 l10n_it_vat_registries_xlsx/tests/test_registry.py create mode 100644 l10n_it_vat_registries_xlsx/views/account_journal_view.xml create mode 100644 l10n_it_vat_registries_xlsx/views/account_tax_registry_view.xml create mode 100644 l10n_it_vat_registries_xlsx/views/account_view.xml create mode 100644 l10n_it_vat_registries_xlsx/wizard/__init__.py create mode 100644 l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py create mode 100644 l10n_it_vat_registries_xlsx/wizard/print_registro_iva.xml diff --git a/l10n_it_vat_registries_xlsx/README.rst b/l10n_it_vat_registries_xlsx/README.rst new file mode 100644 index 00000000000..337b43307b3 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/README.rst @@ -0,0 +1,166 @@ +================== +ITA - Registri IVA +================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1bb65e521cb096dd4973b1a578e72edc9d6faef2c38d191bed6fae90a73d573e + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_vat_registries + :alt: OCA/l10n-italy +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-italy-16-0/l10n-italy-16-0-l10n_it_vat_registries + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Law: Decreto del Presidente della Repubblica del 26 ottobre 1972 n. 633 +https://goo.gl/31yTVj + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +**Italiano** + +È possibile configurare quali imposte escludere dai registri (ad esempio +le ritenute) impostando il campo dell'imposta 'Escludere dai registri +IVA' + +Per generare i periodi fiscali, aprire Contabilità > Configurazione > +Contabilità > Intervalli data > Generazione intervalli data: + +- Prefisso nome intervallo: prefisso identificativo dell'anno dei + periodi da generare +- Durata: 1 mese +- Numero di intervalli da generare: 12 +- Tipo: creare un tipo o utilizzarne uno esistente, non è richiesta una + configurazione particolare per il tipo +- Data iniziale: primo giorno dell'anno dei periodi da generare (ad + esempio 01/01/2018) + +Tramite Contabilità -> Configurazione -> Contabilità -> Registri IVA è +possibile configurare i registri IVA, ad esempio 'vendite', 'acquisti' o +'corrispettivi'. Per associare un registro contabile a un registro IVA, +aprire il registro tramite Contabilità -> Configurazione -> Contabilità +-> Registri e impostare il campo "Registro IVA". + +Se non ci sono movimenti contabili da stampare, la stampa viene generata +con totale zero. + +**English** + +You can configure which taxes to exclude from registries (like +withholding tax) setting the 'Exclude from VAT registries' field. + +In order to generate fiscal periods, open Accounting > Configuration > +Accounting > Date ranges > Generate Date Ranges: + +- Range name prefix: Prefix identifying the year of the periods to be + generated +- Duration: 1 month +- Number of ranges to generate: 12 +- Type: Create a type or use an existing one, no specific type's + configuration is required +- Date start: first day of the period's year (for instance 01/01/2018) + +Using the menu Accounting -> Configuration -> Accounting -> VAT +registries you can configure VAT registries, like 'Sales', 'Purchases' +or 'corrispettivi'. In order to link a journal to a VAT registry, open +journal by Accounting -> Configuration -> Accounting -> Journals and set +the 'VAT registry' field. + +If there are no account moves to be printed, the report is printed with +total equal to zero. + +Usage +===== + +**Italiano** + +Dal menu Contabilità -> Rendicontazione -> Imposte -> Registri IVA è +possibile lanciare la procedura di stampa, nella quale è necessario +impostare un intervallo di date. Qui è possibile utilizzare un periodo +fiscale nel campo 'Intervallo Date'. + +Nel campo 'Registro IVA' è possibile selezionare un registro +preconfigurato, oppure è possibile andare direttamente a impostare i +registri e la struttura nei campi sottostanti. + +**English** + +Using the menu Accounting -> Reports -> Taxes -> VAT registries it is +possible to launch the print wizard, where you have to set a date range. +You can use a fiscal period in the field 'date range'. + +In the 'VAT registry' field you can select a preconfigured registry, or +you can directly journals and layout in the fields below. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Agile Business Group +* LinkIt Srl + +Contributors +------------ + +- Lorenzo Battistini +- Sergio Corato +- Elena Carlesso +- Alex Comba + +Other credits +------------- + +The development of this module has been financially supported by: + +- Odoo Italia Network + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/l10n-italy `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_it_vat_registries_xlsx/__init__.py b/l10n_it_vat_registries_xlsx/__init__.py new file mode 100644 index 00000000000..14cd1b0579c --- /dev/null +++ b/l10n_it_vat_registries_xlsx/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import wizard diff --git a/l10n_it_vat_registries_xlsx/__manifest__.py b/l10n_it_vat_registries_xlsx/__manifest__.py new file mode 100644 index 00000000000..8fd8527901f --- /dev/null +++ b/l10n_it_vat_registries_xlsx/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright 2024 Marco Colombo +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "version": "16.0.0.0.1", + "name": "ITA - Registri IVA - formato XLSX", + "category": "Localization/Italy", + "author": "Phi Srl, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/l10n-italy", + "license": "AGPL-3", + # "development_status": "Production/Beta", + "depends": [ + "base", + "product", + "report_xlsx_helper", + "l10n_it_vat_registries", + ], + "data": [ + "wizard/print_registro_iva.xml", + "report/reports.xml", + "report/report_registro_iva.xml", + ], + "installable": True, +} diff --git a/l10n_it_vat_registries_xlsx/i18n/it.po b/l10n_it_vat_registries_xlsx/i18n/it.po new file mode 100644 index 00000000000..408975f5297 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/i18n/it.po @@ -0,0 +1,181 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_vat_registries_xlsx +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-10-31 15:46+0000\n" +"PO-Revision-Date: 2024-10-31 16:52+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: it_IT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "BUSINESS NAME" +msgstr "RAGIONE SOCIALE" + +#. module: l10n_it_vat_registries_xlsx +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +msgid "Deductible" +msgstr "Detraibile" + +#. module: l10n_it_vat_registries_xlsx +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +msgid "Description" +msgstr "Descrizione" + +#. module: l10n_it_vat_registries_xlsx +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +msgid "General Total EUR" +msgstr "Totale generale EUR" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "INV. DATE" +msgstr "DATA FATT." + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "INV. NUM." +msgstr "NUM. FATT." + +#. module: l10n_it_vat_registries_xlsx +#: model:ir.actions.report,name:l10n_it_vat_registries_xlsx.action_report_registro_iva +msgid "Invoices VAT Registry XLSX" +msgstr "Registro IVA fatture XLSX" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#, python-format +msgid "N/A" +msgstr "N.D." + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#, python-format +msgid "" +"No journals found in the current selection.\n" +"Please load them before to retry!" +msgstr "" +"Nessun registro trovato nella selezione corrente.\n" +"Caricarli prima di riprovare!" + +#. module: l10n_it_vat_registries_xlsx +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +msgid "Non-Deductible" +msgstr "Indetraibile" + +#. module: l10n_it_vat_registries_xlsx +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.wizard_registro_iva +msgid "Print XLSX" +msgstr "Stampa XLSX" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "REASON" +msgstr "CAUSALE" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "REG. DATE" +msgstr "DATA REG." + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "REG. NUM." +msgstr "NUM. REG." + +#. module: l10n_it_vat_registries_xlsx +#: model:ir.model,name:l10n_it_vat_registries_xlsx.model_wizard_registro_iva +msgid "Run VAT registry" +msgstr "Stampa Registro IVA" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "TIN" +msgstr "P.IVA" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "TOTAL" +msgstr "TOTALE" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "Tax" +msgstr "Imposta" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "Tax description" +msgstr "Descrizione imposta" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +#, python-format +msgid "Taxable" +msgstr "Imponibile" + +#. module: l10n_it_vat_registries_xlsx +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.report_registro_iva +msgid "Totals" +msgstr "Totali" + +#. module: l10n_it_vat_registries_xlsx +#. odoo-python +#: code:addons/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py:0 +#, python-format +msgid "VAT settlement date" +msgstr "Data competenza IVA" + +#. module: l10n_it_vat_registries_xlsx +#: model:ir.model,name:l10n_it_vat_registries_xlsx.model_report_l10n_it_vat_registries_xlsx_action_report_registro_iva +msgid "XLSX report for VAT registries" +msgstr "Resoconto XLSX registro IVA" + +#. module: l10n_it_vat_registries_xlsx +#: model_terms:ir.ui.view,arch_db:l10n_it_vat_registries_xlsx.wizard_registro_iva +msgid "or" +msgstr "oppure" diff --git a/l10n_it_vat_registries_xlsx/pyproject.toml b/l10n_it_vat_registries_xlsx/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/l10n_it_vat_registries_xlsx/readme/CONTRIBUTORS.md b/l10n_it_vat_registries_xlsx/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..b49a129ecdc --- /dev/null +++ b/l10n_it_vat_registries_xlsx/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Marco Cooombo \<\> diff --git a/l10n_it_vat_registries_xlsx/readme/USAGE.md b/l10n_it_vat_registries_xlsx/readme/USAGE.md new file mode 100644 index 00000000000..28f0e55ff4c --- /dev/null +++ b/l10n_it_vat_registries_xlsx/readme/USAGE.md @@ -0,0 +1,10 @@ +**Italiano** + +Dal menu Contabilità -\> Rendicontazione -\> Imposte -\> Registri IVA è +possibile lanciare la procedura di stampa sia in formato PDF che in formato +XLSX. + +**English** + +Using the menu Accounting -\> Reports -\> Taxes -\> VAT registries it is +possible to launch the print wizard, both in PFD and XLSX format. diff --git a/l10n_it_vat_registries_xlsx/report/report_registro_iva.xml b/l10n_it_vat_registries_xlsx/report/report_registro_iva.xml new file mode 100644 index 00000000000..7d7d65092c2 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/report/report_registro_iva.xml @@ -0,0 +1,322 @@ + + + + + + diff --git a/l10n_it_vat_registries_xlsx/report/reports.xml b/l10n_it_vat_registries_xlsx/report/reports.xml new file mode 100644 index 00000000000..4697b692cc2 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/report/reports.xml @@ -0,0 +1,14 @@ + + + + Invoices VAT Registry XLSX + account.move + xlsx + l10n_it_vat_registries_xlsx.report_registro_iva + l10n_it_vat_registries_xlsx.report_registro_iva + + diff --git a/l10n_it_vat_registries_xlsx/security/ir.model.access.csv b/l10n_it_vat_registries_xlsx/security/ir.model.access.csv new file mode 100644 index 00000000000..6dc9c4acd7b --- /dev/null +++ b/l10n_it_vat_registries_xlsx/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_tax_registry_account_manager,account.tax_registry account manager,model_account_tax_registry,account.group_account_manager,1,1,1,1 +access_account_tax_registry_account_user,account.tax_registry account user,model_account_tax_registry,account.group_account_user,1,0,0,0 +access_wizard_registro_iva_account_manager,access_wizard_registro_iva account manager,model_wizard_registro_iva,account.group_account_manager,1,1,1,1 +access_wizard_registro_iva_account_user,access_wizard_registro_iva account user,model_wizard_registro_iva,account.group_account_user,1,0,0,0 diff --git a/l10n_it_vat_registries_xlsx/security/vat_registry_security.xml b/l10n_it_vat_registries_xlsx/security/vat_registry_security.xml new file mode 100644 index 00000000000..842374a6a3d --- /dev/null +++ b/l10n_it_vat_registries_xlsx/security/vat_registry_security.xml @@ -0,0 +1,13 @@ + + + + + tax_registry multi-company + + + ['|',('company_id','=',False),('company_id','in',company_ids)] + + + diff --git a/l10n_it_vat_registries_xlsx/static/description/icon.png b/l10n_it_vat_registries_xlsx/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..fe00c805f8d8b0cab74780fa47ee91932652a7aa GIT binary patch literal 6167 zcmW+)c{o&E9KJJ*J!B^|))3M{i8Lc?mXL@jMfNONvyMHolXYYr`P4*(h+#^`+E}V< zzerp{6RC;Hd{gi5{k`Ws=REKI<38s;&wWm+m8J1ME(tCG0QQ-h7}zjJ+~4M4Ve0mL z&JF;u09NLtFb|2Ko57 z`Y;j1tiKZUuY-aj|J7fK3`%5nBom2$D={)XkqM@xrze7NB1lVTx__NcfzqjPItZnM zOr@nmP&x#sLrgi;CzUd z57F~sIG-7WnTCO9#+V@B@f0ea3gW2{o(khZDjo#!AcO~*o`whMcnHQrG(1Gd!w?>Z z@h}Y!Gd+WVClClkW)Ub<0tF;csRSxhAp!^zK&Ha~NGCub0fGn+On_(vh)#fE0!$;o zbY_kjCjM(8v6)#!3YAD@5+qU~A_x*ehzKzW6CoNAq7z{nk(r{=nwcOqH&ZCh6tJ1f zB-9L2n?bM{WE!{`f|?i38s-?ItgZwXfzTtLSvBVbP}CGp^zwlL8VYZ3J6g^m;yl*h^aIRM5n+I z1%@dwjRMmtG#Z7*R0f5aVlb%81QQ@gg_wk>5KM(=R2ZhhOr=w4G%Ag$3@V*Yr8B4u z2KW~c2*Dss18FcwV=5h_F+e&Uq%%MU1NyfOF#$74gJ^V!&Ljh3FklFV|1}KLm<7}5 zFpUAzX)v7*(-|;>4l@|cjenri=rkIgL1QqOj{dLdbOy8NjK52N$A6AFt93cC#{332 z156x(0DxQYZzF&byclzlJ=oO3kbREh0EdjWq4PyM01&D-HNe`2Pil!}n6Bs?F^7m$2a-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zZYfu$E+QD)wo5Ot^QCiq4i&tQKh=8OO^hb%2U}~*^95Y&f8hIJG;O}~47HC^vp;43 zz2V+t8-w@TTr_Nm%X> + + + + +ITA - Registri IVA + + + +
+

ITA - Registri IVA

+ + +

Production/Stable License: AGPL-3 OCA/l10n-italy Translate me on Weblate Try me on Runboat

+

Law: Decreto del Presidente della Repubblica del 26 ottobre 1972 n. 633 +https://goo.gl/31yTVj

+

Table of contents

+ +
+

Configuration

+

Italiano

+

È possibile configurare quali imposte escludere dai registri (ad esempio +le ritenute) impostando il campo dell’imposta ‘Escludere dai registri +IVA’

+

Per generare i periodi fiscali, aprire Contabilità > Configurazione > +Contabilità > Intervalli data > Generazione intervalli data:

+
    +
  • Prefisso nome intervallo: prefisso identificativo dell’anno dei +periodi da generare
  • +
  • Durata: 1 mese
  • +
  • Numero di intervalli da generare: 12
  • +
  • Tipo: creare un tipo o utilizzarne uno esistente, non è richiesta una +configurazione particolare per il tipo
  • +
  • Data iniziale: primo giorno dell’anno dei periodi da generare (ad +esempio 01/01/2018)
  • +
+

Tramite Contabilità -> Configurazione -> Contabilità -> Registri IVA è +possibile configurare i registri IVA, ad esempio ‘vendite’, ‘acquisti’ o +‘corrispettivi’. Per associare un registro contabile a un registro IVA, +aprire il registro tramite Contabilità -> Configurazione -> Contabilità +-> Registri e impostare il campo “Registro IVA”.

+

Se non ci sono movimenti contabili da stampare, la stampa viene generata +con totale zero.

+

English

+

You can configure which taxes to exclude from registries (like +withholding tax) setting the ‘Exclude from VAT registries’ field.

+

In order to generate fiscal periods, open Accounting > Configuration > +Accounting > Date ranges > Generate Date Ranges:

+
    +
  • Range name prefix: Prefix identifying the year of the periods to be +generated
  • +
  • Duration: 1 month
  • +
  • Number of ranges to generate: 12
  • +
  • Type: Create a type or use an existing one, no specific type’s +configuration is required
  • +
  • Date start: first day of the period’s year (for instance 01/01/2018)
  • +
+

Using the menu Accounting -> Configuration -> Accounting -> VAT +registries you can configure VAT registries, like ‘Sales’, ‘Purchases’ +or ‘corrispettivi’. In order to link a journal to a VAT registry, open +journal by Accounting -> Configuration -> Accounting -> Journals and set +the ‘VAT registry’ field.

+

If there are no account moves to be printed, the report is printed with +total equal to zero.

+
+
+

Usage

+

Italiano

+

Dal menu Contabilità -> Rendicontazione -> Imposte -> Registri IVA è +possibile lanciare la procedura di stampa, nella quale è necessario +impostare un intervallo di date. Qui è possibile utilizzare un periodo +fiscale nel campo ‘Intervallo Date’.

+

Nel campo ‘Registro IVA’ è possibile selezionare un registro +preconfigurato, oppure è possibile andare direttamente a impostare i +registri e la struttura nei campi sottostanti.

+

English

+

Using the menu Accounting -> Reports -> Taxes -> VAT registries it is +possible to launch the print wizard, where you have to set a date range. +You can use a fiscal period in the field ‘date range’.

+

In the ‘VAT registry’ field you can select a preconfigured registry, or +you can directly journals and layout in the fields below.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Agile Business Group
  • +
  • LinkIt Srl
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The development of this module has been financially supported by:

+
    +
  • Odoo Italia Network
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/l10n-italy project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/l10n_it_vat_registries_xlsx/tests/__init__.py b/l10n_it_vat_registries_xlsx/tests/__init__.py new file mode 100644 index 00000000000..7c08fc04115 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_registry diff --git a/l10n_it_vat_registries_xlsx/tests/test_registry.py b/l10n_it_vat_registries_xlsx/tests/test_registry.py new file mode 100644 index 00000000000..03ce969415d --- /dev/null +++ b/l10n_it_vat_registries_xlsx/tests/test_registry.py @@ -0,0 +1,96 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import io +from zipfile import ZipFile + +from odoo import fields +from odoo.tests.common import TransactionCase + + +class TestRegistry(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.test_date = fields.Date.today() + cls.journal = cls.env["account.journal"].search( + [("type", "=", "sale")], limit=1 + ) + cls.ova = cls.env["account.account"].search( + [("account_type", "=", "asset_current")], + limit=1, + ) + cls.tax = cls.env["account.tax"].create( + { + "name": "Tax 10.0", + "amount": 10.0, + "amount_type": "fixed", + } + ) + cls.tax_registry = cls.env["account.tax.registry"].create( + { + "name": "Sales", + "layout_type": "customer", + "journal_ids": [(6, 0, [cls.journal.id])], + } + ) + + cls.invoice_line_account = ( + cls.env["account.account"] + .search( + [("account_type", "=", "expense")], + limit=1, + ) + .id + ) + + cls.invoice = cls.env["account.move"].create( + { + "partner_id": cls.env.ref("base.res_partner_2").id, + "invoice_date": cls.test_date, + "move_type": "out_invoice", + "journal_id": cls.journal.id, + "invoice_line_ids": [ + ( + 0, + None, + { + "product_id": cls.env.ref("product.product_product_4").id, + "quantity": 1.0, + "price_unit": 100.0, + "name": "product that cost 100", + "account_id": cls.invoice_line_account, + "tax_ids": [(6, 0, [cls.tax.id])], + }, + ) + ], + } + ) + cls.invoice.action_post() + + def test_invoice_and_report(self): + wizard = self.env["wizard.registro.iva"].create( + { + "from_date": self.test_date, + "to_date": self.test_date, + "tax_registry_id": self.tax_registry.id, + "layout_type": "supplier", + "fiscal_page_base": 0, + } + ) + wizard.on_change_tax_registry_id() + res = wizard.print_registro_xlsx() + + report_name = "l10n_it_vat_registries_xlsx.report_registro_iva" + domain = [ + ("report_type", "=", "xlsx"), + ("report_name", "=", report_name), + ] + report = self.env["ir.actions.report"].search(domain) + data = res["context"]["report_action"]["data"] + xlsx, _type = report._render_xlsx(report_name, data["ids"], data) + + # basic reading of a file + # we don't want to depend on other non-standard libraries such as openpyxl + f = io.BytesIO(xlsx) + with ZipFile(f, "r").open("xl/sharedStrings.xml", "r") as wf: + self.assertTrue(self.invoice.partner_id.name.encode("utf8") in wf.read()) diff --git a/l10n_it_vat_registries_xlsx/views/account_journal_view.xml b/l10n_it_vat_registries_xlsx/views/account_journal_view.xml new file mode 100644 index 00000000000..cfa32928355 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/views/account_journal_view.xml @@ -0,0 +1,15 @@ + + + + + account.journal.form + account.journal + + + + + + + + + diff --git a/l10n_it_vat_registries_xlsx/views/account_tax_registry_view.xml b/l10n_it_vat_registries_xlsx/views/account_tax_registry_view.xml new file mode 100644 index 00000000000..86d4606bec5 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/views/account_tax_registry_view.xml @@ -0,0 +1,39 @@ + + + + + account.tax.registry.form + account.tax.registry + +
+ + + + + + + + + + +
+ + + VAT registries + account.tax.registry + tree,form + +

+ Click to add a VAT registry. +

+ A VAT registry is used to group several journals in one registry. +

+
+
+ + +
diff --git a/l10n_it_vat_registries_xlsx/views/account_view.xml b/l10n_it_vat_registries_xlsx/views/account_view.xml new file mode 100644 index 00000000000..f80eb3be6e0 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/views/account_view.xml @@ -0,0 +1,19 @@ + + + + + account.tax.code.form + account.tax + + + + + + + + + + diff --git a/l10n_it_vat_registries_xlsx/wizard/__init__.py b/l10n_it_vat_registries_xlsx/wizard/__init__.py new file mode 100644 index 00000000000..8fefb155964 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/wizard/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import print_registro_iva diff --git a/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py b/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py new file mode 100644 index 00000000000..5a01110f17e --- /dev/null +++ b/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.py @@ -0,0 +1,219 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import logging + +from odoo import _, models +from odoo.exceptions import UserError +from odoo.tools.misc import formatLang + +from odoo.addons.l10n_it_vat_registries.models.vat_registry import ReportRegistroIva +from odoo.addons.report_xlsx_helper.report.report_xlsx_format import ( + FORMATS, + XLS_HEADERS, +) + +_logger = logging.getLogger(__name__) + + +class WizardRegistroIva(models.TransientModel): + _inherit = "wizard.registro.iva" + + # most of this code is borrowed from print_registro() + # a bit of refactoring is in order to de-duplicate the code + def print_registro_xlsx(self): + # begin of shared code 8< + self.ensure_one() + wizard = self + if not wizard.journal_ids: + raise UserError( + _( + "No journals found in the current selection.\n" + "Please load them before to retry!" + ) + ) + move_ids = self._get_move_ids(wizard) + + datas_form = {} + datas_form["from_date"] = wizard.from_date + datas_form["to_date"] = wizard.to_date + datas_form["journal_ids"] = [j.id for j in wizard.journal_ids] + datas_form["fiscal_page_base"] = wizard.fiscal_page_base + datas_form["registry_type"] = wizard.layout_type + datas_form["year_footer"] = wizard.year_footer + + lang_code = self.env.company.partner_id.lang + lang = self.env["res.lang"] + lang_id = lang._lang_get(lang_code) + date_format = lang_id.date_format + datas_form["date_format"] = date_format + + if wizard.tax_registry_id: + datas_form["tax_registry_name"] = wizard.tax_registry_id.name + else: + datas_form["tax_registry_name"] = "" + datas_form["only_totals"] = wizard.only_totals + datas_form["entry_order"] = wizard.entry_order + datas_form["show_full_contact_addess"] = wizard.show_full_contact_addess + # >8 end of shared code + + report_name = "l10n_it_vat_registries_xlsx.action_report_registro_iva" + datas = {"ids": move_ids, "model": "account.move", "form": datas_form} + moves = self.env["account.move"].browse(move_ids) + return self.env.ref(report_name).report_action(moves, data=datas) + + +class ReportRegistroIvaXlsx(ReportRegistroIva): + _name = "report.l10n_it_vat_registries_xlsx.report_registro_iva" + _inherit = "report.report_xlsx.abstract" + _description = "XLSX report for VAT registries" + + def _get_ws_params(self, workbook, data, objects): + registry_type = data["form"]["registry_type"] + titles = { + "customer": "Registro IVA vendite", + "supplier": "Registro IVA acquisti", + "corrispettivi": "Registro corrispettivi", + } + title = data["form"]["tax_registry_name"] or titles.get(registry_type, _("N/A")) + + col_specs = { + "date": { + "header": {"value": _("REG. DATE")}, + "lines": {"value": self._render("format_date(move.date,date_format)")}, + "width": 20, + }, + "no": { + "header": {"value": _("REG. NUM.")}, + "lines": {"value": self._render("move.name")}, + "width": 20, + }, + "reason": { + "header": {"value": _("REASON")}, + "lines": {"value": self._render("line['invoice_type']")}, + "width": 20, + }, + "inv_date": { + "header": {"value": _("INV. DATE")}, + "lines": { + "value": self._render( + "format_date(line['invoice_date'],date_format)" + ) + }, + "width": 20, + }, + "inv_name": { + "header": {"value": _("INV. NUM.")}, + "lines": { + "value": self._render( + "move.ref if move.journal_id.type == 'purchase' " + "else move.name" + ) + }, + "width": 20, + }, + "partner": { + "header": {"value": _("BUSINESS NAME")}, + "lines": {"value": self._render("move.partner_id.name")}, + "width": 20, + }, + "tin": { + "header": {"value": _("TIN")}, + "lines": {"value": self._render("move.partner_id.vat")}, + "width": 20, + }, + "total": { + "header": {"value": _("TOTAL")}, + "lines": { + "value": self._render("formatLang(env, invoice_total(move))") + }, + "width": 20, + }, + "tax_name": { + "header": {"value": _("Tax description")}, + "lines": {"value": self._render("line['tax_code_name']")}, + "width": 20, + }, + "taxable": { + "header": {"value": _("Taxable")}, + "lines": {"value": self._render("formatLang(env, line['base'])")}, + "width": 20, + }, + "tax": { + "header": {"value": _("Tax")}, + "lines": {"value": self._render("formatLang(env, line['tax'])")}, + "width": 20, + }, + } + + # dynamic based on presence of field + if "l10n_it_vat_settlement_date" in self.env["account.move"]._fields: + col_specs.update( + { + "vat_settlement_date": { + "header": {"value": _("VAT settlement date")}, + "lines": { + "value": self._render( + "format_date(move.l10n_it_vat_settlement_date," + "date_format)" + ) + }, + "width": 20, + } + } + ) + + wanted = col_specs.keys() + if registry_type == "corrispettivi": + wanted -= ["reason", "inv_date", "inv_name", "partner", "tin"] + + return [ + { + "ws_name": "vat_registry", + "title": title, + "wanted_list": wanted, + "col_specs": col_specs, + "generate_ws_method": "generate_ws", + } + ] + + def generate_ws(self, workbook, ws, ws_params, data, objects): + ws.set_landscape() + ws.fit_to_pages(1, 0) + ws.set_header(XLS_HEADERS["xls_headers"]["standard"]) + ws.set_footer(XLS_HEADERS["xls_footers"]["standard"]) + + self._set_column_width(ws, ws_params) + + row_pos = 0 + row_pos = self._write_ws_title(ws, row_pos, ws_params) + + row_pos = self._write_line( + ws, + row_pos, + ws_params, + col_specs_section="header", + default_format=FORMATS["format_theader_yellow_left"], + ) + + ws.freeze_panes(row_pos, 0) + + for move in objects: + inv_taxes, used_taxes = self._get_tax_lines(move, data["form"]) + + for line in inv_taxes: + row_pos = self._write_line( + ws, + row_pos, + ws_params, + col_specs_section="lines", + render_space={ + "env": self.env, + "move": move, + "line": line, + "format_date": self._format_date, + "date_format": data["form"]["date_format"], + "formatLang": formatLang, + "invoice_total": self._get_move_total, + }, + default_format=FORMATS["format_tcell_left"], + ) diff --git a/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.xml b/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.xml new file mode 100644 index 00000000000..3257c595ee8 --- /dev/null +++ b/l10n_it_vat_registries_xlsx/wizard/print_registro_iva.xml @@ -0,0 +1,20 @@ + + + + VAT Registry XLSX + wizard.registro.iva + form + + + + or +