diff --git a/l10n_es_vat_book/README.rst b/l10n_es_vat_book/README.rst index 72148ffca54..f2cb6b641cf 100644 --- a/l10n_es_vat_book/README.rst +++ b/l10n_es_vat_book/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ================================== Libros registro del IVA y del IRPF ================================== @@ -17,7 +13,7 @@ Libros registro del IVA y del IRPF .. |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/license-AGPL--3-blue.png +.. |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 @@ -140,7 +136,10 @@ Contributors - Fernando La Chica - Victor Garcia - Luis Lafaurie -- Eduardo de miguel +- `Moduon Team `__: + + - Eduardo de miguel + - Emilio Pascual Maintainers ----------- diff --git a/l10n_es_vat_book/models/l10n_es_vat_book.py b/l10n_es_vat_book/models/l10n_es_vat_book.py index 3bfc7f93250..2803b8c0409 100644 --- a/l10n_es_vat_book/models/l10n_es_vat_book.py +++ b/l10n_es_vat_book/models/l10n_es_vat_book.py @@ -272,26 +272,31 @@ def upsert_book_line_tax(self, move_line, vat_book_line, implied_taxes): sign = 1 if move_line.tax_line_id: res = {} - tax = move_line.tax_line_id - move_line._process_aeat_tax_fee_info(res, tax, sign) - key = self.get_book_line_tax_key(move_line, tax) - value = tax_lines.setdefault(key, default_dict | {"tax_id": tax.id}) - value["tax_amount"] += res[tax]["amount"] - value["deductible_amount"] += res[tax]["deductible_amount"] - value["move_line_ids"].append((4, move_line.id)) + move_line._process_aeat_tax_fee_info(res, move_line.tax_line_id, sign) + for child_tax, info in res.items(): + key = self.get_book_line_tax_key(move_line, child_tax) + value = tax_lines.setdefault( + key, default_dict | {"tax_id": child_tax.id} + ) + value["tax_amount"] += info["amount"] + value["deductible_amount"] += info["deductible_amount"] + value["move_line_ids"].append((4, move_line.id)) for i, tax in enumerate(move_line.tax_ids): res = {} move_line._process_aeat_tax_base_info(res, tax, sign) if i == 0: - vat_book_line["base_amount"] += res[tax]["base"] - if tax not in implied_taxes: - continue - key = self.get_book_line_tax_key(move_line, tax) - value = tax_lines.setdefault(key, default_dict | {"tax_id": tax.id}) - value["base_amount"] += res[tax]["base"] - value["base_move_line_ids"].append((4, move_line.id)) - # For later matching special taxes - value["other_tax_ids"] = (move_line.tax_ids - tax).ids + vat_book_line["base_amount"] += next(iter(res.values()))["base"] + for child_tax, info in res.items(): + if child_tax not in implied_taxes: + continue + key = self.get_book_line_tax_key(move_line, child_tax) + value = tax_lines.setdefault( + key, default_dict | {"tax_id": child_tax.id} + ) + value["base_amount"] += info["base"] + value["base_move_line_ids"].append((4, move_line.id)) + # For later matching special taxes + value["other_tax_ids"] = (move_line.tax_ids - tax).ids def _clear_old_data(self): """ diff --git a/l10n_es_vat_book/readme/CONTRIBUTORS.md b/l10n_es_vat_book/readme/CONTRIBUTORS.md index 5a89e30ebd2..6ed2e4a5ce7 100644 --- a/l10n_es_vat_book/readme/CONTRIBUTORS.md +++ b/l10n_es_vat_book/readme/CONTRIBUTORS.md @@ -10,4 +10,6 @@ - Fernando La Chica \<\> - Victor Garcia \<\> - Luis Lafaurie \<\> -- Eduardo de miguel \<\> +- [Moduon Team](https://www.moduon.team/): + - Eduardo de miguel + - Emilio Pascual diff --git a/l10n_es_vat_book/static/description/index.html b/l10n_es_vat_book/static/description/index.html index 3e6b91b422a..3675f1b737a 100644 --- a/l10n_es_vat_book/static/description/index.html +++ b/l10n_es_vat_book/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +Libros registro del IVA y del IRPF -
+
+

Libros registro del IVA y del IRPF

- - -Odoo Community Association - -
-

Libros registro del IVA y del IRPF

-

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

+

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

Módulo que calcula los libros de IVA e IRPF español.

Esto módulo introduce el menú “Libros de IVA y del IRPF” en Contabilidad -> Informe -> Declaraciones AEAT.

@@ -403,7 +398,7 @@

Libros registro del IVA y del IRPF

-

Installation

+

Installation

Para instalar este modulo necesitas:

-

Configuration

+

Configuration

Los códigos de impuestos incluidos en el Libro de IVA pueden verse en: Contabilidad -> Configuración -> AEAT -> Mapeo AEAT libro de IVA

Los clientes utilizados para ventas por caja deben tener marcado el @@ -430,7 +425,7 @@

Configuration

no tener NIF informado siguiendo lo especificado en el formato BOE.

-

Usage

+

Usage

  1. Ve a Contabilidad > Declaraciones AEAT > Libro de IVA.
  2. Crea un nuevo registro.
  3. @@ -440,7 +435,7 @@

    Usage

-

Known issues / Roadmap

+

Known issues / Roadmap

Funcionalidades del Libro Registro de IVA no incluídas por el momento:

-

Bug Tracker

+

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 @@ -460,9 +455,9 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • PRAXYA
  • ForgeFlow
  • @@ -470,7 +465,7 @@

    Authors

-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -503,6 +502,5 @@

Maintainers

-
diff --git a/l10n_es_vat_book/tests/test_l10n_es_aeat_vat_book.py b/l10n_es_vat_book/tests/test_l10n_es_aeat_vat_book.py index 348f15d599a..22eb0b288c8 100644 --- a/l10n_es_vat_book/tests/test_l10n_es_aeat_vat_book.py +++ b/l10n_es_vat_book/tests/test_l10n_es_aeat_vat_book.py @@ -28,6 +28,7 @@ class TestL10nEsAeatVatBookBase(TestL10nEsAeatModBase): "P_REQ014": (280, 3.92), "P_REQ52": (290, 15.08), "P_IRPF19": (1024, 194.56), + "P_IVA21_IBC_GROUP": (1000, 210), } @@ -79,38 +80,42 @@ def test_model_vat_book(self): self.assertEqual(line.base_amount, 0.0) self.assertEqual(line.tax_amount, 0.0) # Check tax summary for received invoices - self.assertEqual(len(vat_book.received_tax_summary_ids), 7) + self.assertEqual(len(vat_book.received_tax_summary_ids), 8) rec_summaries = sorted( vat_book.received_tax_summary_ids, key=lambda line: line.tax_amount, reverse=True, ) - # P_IVA21_SC - 21% IVA soportado (servicios corrientes) + # P_IVA21_IBC_GROUP - IVA 21% Importaciones DUA bienes corrientes line = rec_summaries[0] + self.assertAlmostEqual(line.base_amount, 1000) + self.assertAlmostEqual(line.tax_amount, 210) + # P_IVA21_SC - 21% IVA soportado (servicios corrientes) + line = rec_summaries[1] self.assertAlmostEqual(line.base_amount, 230) self.assertAlmostEqual(line.tax_amount, 48.3) # P_IVA21_IC_BC - IVA 21% Adquisición Intracomunitaria. Bienes corrientes - line = rec_summaries[1] + line = rec_summaries[2] self.assertAlmostEqual(line.base_amount, 200) self.assertAlmostEqual(line.tax_amount, 42) # P_IVA0_ND - 21% IVA Soportado no deducible - line = rec_summaries[2] + line = rec_summaries[3] self.assertAlmostEqual(line.base_amount, 100) self.assertAlmostEqual(line.tax_amount, 21) # P_REQ52 - 5.2% Recargo de equivalencia sobre operaciones sujetas a IVA - line = rec_summaries[3] + line = rec_summaries[4] self.assertAlmostEqual(line.base_amount, 290) self.assertAlmostEqual(line.tax_amount, 15.08) # P_REQ014 - 1.4% Recargo de equivalencia sobre operaciones sujetas a IVA - line = rec_summaries[4] + line = rec_summaries[5] self.assertAlmostEqual(line.base_amount, 280) self.assertAlmostEqual(line.tax_amount, 3.92) # P_REQ05 - 0.5% Recargo de equivalencia sobre operaciones sujetas a IVA - line = rec_summaries[5] + line = rec_summaries[6] self.assertAlmostEqual(line.base_amount, 270) self.assertAlmostEqual(line.tax_amount, 1.35) # P_IRPF19 - 19% Impuesto sobre la resta fisica - line = rec_summaries[6] + line = rec_summaries[7] self.assertAlmostEqual(line.base_amount, 1024) self.assertAlmostEqual(line.tax_amount, -194.56) # Let's dig into this tax detail for checking the deductible amount