diff --git a/l10n_es_vat_book_invoice_summary/README.rst b/l10n_es_vat_book_invoice_summary/README.rst new file mode 100644 index 00000000000..728ad8d4f8c --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/README.rst @@ -0,0 +1,87 @@ +================================ +Facturas resumen en libro de IVA +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:62679bd0f6da157bf7ec60ad978de7995a8aff9a0d6cd95d9c674b9c152b6f73 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |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--spain-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-spain/tree/16.0/l10n_es_vat_book_invoice_summary + :alt: OCA/l10n-spain +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-spain-16-0/l10n-spain-16-0-l10n_es_vat_book_invoice_summary + :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-spain&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Se rellenan las casillas de resumen de las facturas emitidas en el excel de Libro de IVA + +**Table of contents** + +.. contents:: + :local: + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * Víctor Martínez + * Pedro M. Baeza + +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. + +.. |maintainer-victoralmau| image:: https://github.com/victoralmau.png?size=40px + :target: https://github.com/victoralmau + :alt: victoralmau + +Current `maintainer `__: + +|maintainer-victoralmau| + +This module is part of the `OCA/l10n-spain `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_es_vat_book_invoice_summary/__init__.py b/l10n_es_vat_book_invoice_summary/__init__.py new file mode 100644 index 00000000000..4c4f242fa03 --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/__init__.py @@ -0,0 +1 @@ +from . import report diff --git a/l10n_es_vat_book_invoice_summary/__manifest__.py b/l10n_es_vat_book_invoice_summary/__manifest__.py new file mode 100644 index 00000000000..b09487fbadd --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/__manifest__.py @@ -0,0 +1,13 @@ +# Copyright 2024 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Facturas resumen en libro de IVA", + "version": "16.0.1.0.0", + "depends": ["l10n_es_aeat_sii_invoice_summary", "l10n_es_vat_book"], + "category": "Accounting & Finance", + "author": "Tecnativa, Odoo Community Association (OCA)", + "license": "AGPL-3", + "website": "https://github.com/OCA/l10n-spain", + "installable": True, + "maintainers": ["victoralmau"], +} diff --git a/l10n_es_vat_book_invoice_summary/i18n/es.po b/l10n_es_vat_book_invoice_summary/i18n/es.po new file mode 100644 index 00000000000..c794b97f994 --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/i18n/es.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_es_vat_book_invoice_summary +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-05-23 11:36+0000\n" +"PO-Revision-Date: 2024-05-23 11:36+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_es_vat_book_invoice_summary +#: model:ir.model.fields,field_description:l10n_es_vat_book_invoice_summary.field_report_l10n_es_vat_book_l10n_es_vat_book_xlsx__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: l10n_es_vat_book_invoice_summary +#: model:ir.model.fields,field_description:l10n_es_vat_book_invoice_summary.field_report_l10n_es_vat_book_l10n_es_vat_book_xlsx__id +msgid "ID" +msgstr "" + +#. module: l10n_es_vat_book_invoice_summary +#: model:ir.model.fields,field_description:l10n_es_vat_book_invoice_summary.field_report_l10n_es_vat_book_l10n_es_vat_book_xlsx____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: l10n_es_vat_book_invoice_summary +#: model:ir.model,name:l10n_es_vat_book_invoice_summary.model_report_l10n_es_vat_book_l10n_es_vat_book_xlsx +msgid "Vat Number Xlsx" +msgstr "Número de IVA Xlsx" diff --git a/l10n_es_vat_book_invoice_summary/i18n/l10n_es_vat_book_invoice_summary.pot b/l10n_es_vat_book_invoice_summary/i18n/l10n_es_vat_book_invoice_summary.pot new file mode 100644 index 00000000000..8e1546cde61 --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/i18n/l10n_es_vat_book_invoice_summary.pot @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_es_vat_book_invoice_summary +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_es_vat_book_invoice_summary +#: model:ir.model.fields,field_description:l10n_es_vat_book_invoice_summary.field_report_l10n_es_vat_book_l10n_es_vat_book_xlsx__display_name +msgid "Display Name" +msgstr "" + +#. module: l10n_es_vat_book_invoice_summary +#: model:ir.model.fields,field_description:l10n_es_vat_book_invoice_summary.field_report_l10n_es_vat_book_l10n_es_vat_book_xlsx__id +msgid "ID" +msgstr "" + +#. module: l10n_es_vat_book_invoice_summary +#: model:ir.model.fields,field_description:l10n_es_vat_book_invoice_summary.field_report_l10n_es_vat_book_l10n_es_vat_book_xlsx____last_update +msgid "Last Modified on" +msgstr "" + +#. module: l10n_es_vat_book_invoice_summary +#: model:ir.model,name:l10n_es_vat_book_invoice_summary.model_report_l10n_es_vat_book_l10n_es_vat_book_xlsx +msgid "Vat Number Xlsx" +msgstr "" diff --git a/l10n_es_vat_book_invoice_summary/readme/CONTRIBUTORS.rst b/l10n_es_vat_book_invoice_summary/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..5fb71305308 --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Tecnativa `_: + + * Víctor Martínez + * Pedro M. Baeza diff --git a/l10n_es_vat_book_invoice_summary/readme/DESCRIPTION.rst b/l10n_es_vat_book_invoice_summary/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..fa1bb6a9ba6 --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Se rellenan las casillas de resumen de las facturas emitidas en el excel de Libro de IVA diff --git a/l10n_es_vat_book_invoice_summary/report/__init__.py b/l10n_es_vat_book_invoice_summary/report/__init__.py new file mode 100644 index 00000000000..afeab59a27f --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/report/__init__.py @@ -0,0 +1 @@ +from . import vat_book_xlsx diff --git a/l10n_es_vat_book_invoice_summary/report/vat_book_xlsx.py b/l10n_es_vat_book_invoice_summary/report/vat_book_xlsx.py new file mode 100644 index 00000000000..797fed79ef2 --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/report/vat_book_xlsx.py @@ -0,0 +1,20 @@ +# Copyright 2024 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class VatNumberXlsx(models.AbstractModel): + _inherit = "report.l10n_es_vat_book.l10n_es_vat_book_xlsx" + + def fill_issued_row_data( + self, sheet, row, line, tax_line, with_total, draft_export + ): + """Add final number if move has is_invoice_summary.""" + res = super().fill_issued_row_data( + sheet, row, line, tax_line, with_total, draft_export + ) + if line.move_id.is_invoice_summary: + sheet.write("D" + str(row), line.move_id.sii_invoice_summary_start) + sheet.write("E" + str(row), line.move_id.sii_invoice_summary_end) + return res diff --git a/l10n_es_vat_book_invoice_summary/static/description/icon.png b/l10n_es_vat_book_invoice_summary/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/l10n_es_vat_book_invoice_summary/static/description/icon.png differ diff --git a/l10n_es_vat_book_invoice_summary/static/description/index.html b/l10n_es_vat_book_invoice_summary/static/description/index.html new file mode 100644 index 00000000000..488291418c8 --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/static/description/index.html @@ -0,0 +1,426 @@ + + + + + +Facturas resumen en libro de IVA + + + +
+

Facturas resumen en libro de IVA

+ + +

Beta License: AGPL-3 OCA/l10n-spain Translate me on Weblate Try me on Runboat

+

Se rellenan las casillas de resumen de las facturas emitidas en el excel de Libro de IVA

+

Table of contents

+ +
+

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

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa:
      +
    • Víctor Martínez
    • +
    • Pedro M. Baeza
    • +
    +
  • +
+
+
+

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.

+

Current maintainer:

+

victoralmau

+

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

+

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

+
+
+
+ + diff --git a/l10n_es_vat_book_invoice_summary/tests/__init__.py b/l10n_es_vat_book_invoice_summary/tests/__init__.py new file mode 100644 index 00000000000..a38f676b065 --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/tests/__init__.py @@ -0,0 +1 @@ +from . import test_l10n_es_vat_book_invoice_summary diff --git a/l10n_es_vat_book_invoice_summary/tests/test_l10n_es_vat_book_invoice_summary.py b/l10n_es_vat_book_invoice_summary/tests/test_l10n_es_vat_book_invoice_summary.py new file mode 100644 index 00000000000..13cf7bf8424 --- /dev/null +++ b/l10n_es_vat_book_invoice_summary/tests/test_l10n_es_vat_book_invoice_summary.py @@ -0,0 +1,52 @@ +# Copyright 2024 Tecnativa - Víctor Martínez +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0 + +import logging + +from xlrd import open_workbook + +from odoo.addons.l10n_es_aeat.tests.test_l10n_es_aeat_mod_base import ( + TestL10nEsAeatModBase, +) + +_logger = logging.getLogger("aeat.vat.book.invoice.summary") + + +class TestL10nEsVatBookInvoiceSummary(TestL10nEsAeatModBase): + debug = False + taxes_sale = { + # tax code: (base, tax_amount) + "S_IVA21S": (1500, 315), + } + + def test_model_vat_book(self): + # Sale invoices with invoice summary + sale = self._invoice_sale_create("2017-01-13") + sale.is_invoice_summary = True + sale.sii_invoice_summary_start = "SALE-START" + sale.sii_invoice_summary_end = "SALE-END" + # Create vat boo + calculate + self.company.vat = "ES12345678Z" + vat_book = self.env["l10n.es.vat.book"].create( + { + "name": "Test VAT Book", + "company_id": self.company.id, + "company_vat": "1234567890", + "contact_name": "Test owner", + "statement_type": "N", + "support_type": "T", + "contact_phone": "911234455", + "year": 2017, + "period_type": "1T", + "date_start": "2017-01-01", + "date_end": "2017-03-31", + } + ) + vat_book.button_calculate() + # Export to XLSX + check specific values + report_name = "l10n_es_vat_book.l10n_es_vat_book_xlsx" + report_xlsx = self.env["ir.actions.report"]._render(report_name, vat_book.ids) + wb = open_workbook(file_contents=report_xlsx[0]) + sheet = wb.sheet_by_index(0) + self.assertEqual(sheet.cell(7, 3).value, "SALE-START") + self.assertEqual(sheet.cell(7, 4).value, "SALE-END") diff --git a/setup/l10n_es_vat_book_invoice_summary/odoo/addons/l10n_es_vat_book_invoice_summary b/setup/l10n_es_vat_book_invoice_summary/odoo/addons/l10n_es_vat_book_invoice_summary new file mode 120000 index 00000000000..7f2040b8ef5 --- /dev/null +++ b/setup/l10n_es_vat_book_invoice_summary/odoo/addons/l10n_es_vat_book_invoice_summary @@ -0,0 +1 @@ +../../../../l10n_es_vat_book_invoice_summary \ No newline at end of file diff --git a/setup/l10n_es_vat_book_invoice_summary/setup.py b/setup/l10n_es_vat_book_invoice_summary/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/l10n_es_vat_book_invoice_summary/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)