diff --git a/l10n_it_reverse_charge/models/account_move.py b/l10n_it_reverse_charge/models/account_move.py index 1b79aab8b2e8..eb6a5aba6326 100644 --- a/l10n_it_reverse_charge/models/account_move.py +++ b/l10n_it_reverse_charge/models/account_move.py @@ -534,11 +534,16 @@ def button_draft(self): self_purchase_invoice.button_draft() return super(AccountMove, new_self).button_draft() + def get_discount_for_rc(self, line): + """Hook for compute discount correctly""" + return line.discount + def get_tax_amount_added_for_rc(self): res = 0 for line in self.invoice_line_ids: if line.rc: - price_unit = line.price_unit * (1 - (line.discount or 0.0) / 100.0) + discount = self.get_discount_for_rc(line) + price_unit = line.price_unit * (1 - (discount or 0.0) / 100.0) taxes = line.tax_ids.compute_all( price_unit, self.currency_id, diff --git a/l10n_it_reverse_charge_triple_discount/README.rst b/l10n_it_reverse_charge_triple_discount/README.rst new file mode 100644 index 000000000000..024615515bb3 --- /dev/null +++ b/l10n_it_reverse_charge_triple_discount/README.rst @@ -0,0 +1,82 @@ +======================================================= +ITA - Inversione contabile - Integrazione sconto triplo +======================================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:69d90c5d583b2433847e793221319f28d3b72b0928ca6a2e631ed4262bef808c + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_reverse_charge_triple_discount + :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-14-0/l10n-italy-14-0-l10n_it_reverse_charge_triple_discount + :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=14.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +**Italiano** + +Questo modulo consente di gestire correttamente l'inversione contabile quando il modulo account_invoice_triple_discount è installato. + +**English** + +The module allows to manage correctly the reverse charge when the module account_invoice_triple_discount is installed. + +**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 +~~~~~~~ + +* Odoo Italia Network + +Contributors +~~~~~~~~~~~~ + +* Giuseppe Borruso + +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_reverse_charge_triple_discount/__init__.py b/l10n_it_reverse_charge_triple_discount/__init__.py new file mode 100644 index 000000000000..d3689b9ec508 --- /dev/null +++ b/l10n_it_reverse_charge_triple_discount/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2024 Giuseppe Borruso - Dinamiche Aziendali srl + +from . import models diff --git a/l10n_it_reverse_charge_triple_discount/__manifest__.py b/l10n_it_reverse_charge_triple_discount/__manifest__.py new file mode 100644 index 000000000000..566737af4c69 --- /dev/null +++ b/l10n_it_reverse_charge_triple_discount/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2024 Giuseppe Borruso - Dinamiche Aziendali srl +# License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl) + +{ + "name": "ITA - Inversione contabile - Integrazione sconto triplo", + "version": "14.0.1.0.0", + "category": "Localization/Italy", + "summary": "Modulo ponte tra inversione contabile e sconto triplo", + "author": "Odoo Italia Network, Odoo Community Association (OCA)", + "license": "LGPL-3", + "website": "https://github.com/OCA/l10n-italy", + "depends": [ + "l10n_it_reverse_charge", + "account_invoice_triple_discount", + ], + "data": [], + "installable": True, +} diff --git a/l10n_it_reverse_charge_triple_discount/i18n/l10n_it_reverse_charge_triple_discount.pot b/l10n_it_reverse_charge_triple_discount/i18n/l10n_it_reverse_charge_triple_discount.pot new file mode 100644 index 000000000000..ef51f980d336 --- /dev/null +++ b/l10n_it_reverse_charge_triple_discount/i18n/l10n_it_reverse_charge_triple_discount.pot @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_reverse_charge_triple_discount +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-07-01 14:07+0000\n" +"PO-Revision-Date: 2024-07-01 14:07+0000\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_it_reverse_charge_triple_discount +#: model:ir.model.fields,field_description:l10n_it_reverse_charge_triple_discount.field_account_move__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: l10n_it_reverse_charge_triple_discount +#: model:ir.model.fields,field_description:l10n_it_reverse_charge_triple_discount.field_account_move__id +msgid "ID" +msgstr "" + +#. module: l10n_it_reverse_charge_triple_discount +#: model:ir.model,name:l10n_it_reverse_charge_triple_discount.model_account_move +msgid "Journal Entry" +msgstr "Registrazione contabile" + +#. module: l10n_it_reverse_charge_triple_discount +#: model:ir.model.fields,field_description:l10n_it_reverse_charge_triple_discount.field_account_move____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" diff --git a/l10n_it_reverse_charge_triple_discount/models/__init__.py b/l10n_it_reverse_charge_triple_discount/models/__init__.py new file mode 100644 index 000000000000..ce6806469a74 --- /dev/null +++ b/l10n_it_reverse_charge_triple_discount/models/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2024 Giuseppe Borruso - Dinamiche Aziendali srl + +from . import account_move diff --git a/l10n_it_reverse_charge_triple_discount/models/account_move.py b/l10n_it_reverse_charge_triple_discount/models/account_move.py new file mode 100644 index 000000000000..e0531ecd24b3 --- /dev/null +++ b/l10n_it_reverse_charge_triple_discount/models/account_move.py @@ -0,0 +1,24 @@ +# Copyright 2024 Giuseppe Borruso - Dinamiche Aziendali srl + +import functools + +from odoo import models + + +class AccountMoveInherit(models.Model): + _inherit = "account.move" + + def rc_inv_line_vals(self, line): + line_vals = super().rc_inv_line_vals(line) + line_vals["discount2"] = line.discount2 + line_vals["discount3"] = line.discount3 + return line_vals + + def get_discount_for_rc(self, line): + discount_values = [ + 1 - (line.discount or 0.0) / 100.0, + 1 - (line.discount2 or 0.0) / 100.0, + 1 - (line.discount3 or 0.0) / 100.0, + ] + res = (1 - functools.reduce((lambda x, y: x * y), discount_values)) * 100 + return res diff --git a/l10n_it_reverse_charge_triple_discount/readme/CONTRIBUTORS.rst b/l10n_it_reverse_charge_triple_discount/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..d58d6363550b --- /dev/null +++ b/l10n_it_reverse_charge_triple_discount/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Giuseppe Borruso diff --git a/l10n_it_reverse_charge_triple_discount/readme/DESCRIPTION.rst b/l10n_it_reverse_charge_triple_discount/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..1d85ae2e984a --- /dev/null +++ b/l10n_it_reverse_charge_triple_discount/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +**Italiano** + +Questo modulo consente di gestire correttamente l'inversione contabile quando il modulo account_invoice_triple_discount è installato. + +**English** + +The module allows to manage correctly the reverse charge when the module account_invoice_triple_discount is installed. diff --git a/l10n_it_reverse_charge_triple_discount/static/description/icon.png b/l10n_it_reverse_charge_triple_discount/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/l10n_it_reverse_charge_triple_discount/static/description/icon.png differ diff --git a/l10n_it_reverse_charge_triple_discount/static/description/index.html b/l10n_it_reverse_charge_triple_discount/static/description/index.html new file mode 100644 index 000000000000..631ad0498558 --- /dev/null +++ b/l10n_it_reverse_charge_triple_discount/static/description/index.html @@ -0,0 +1,424 @@ + + + + + + +ITA - Inversione contabile - Integrazione sconto triplo + + + +
+

ITA - Inversione contabile - Integrazione sconto triplo

+ + +

Beta License: LGPL-3 OCA/l10n-italy Translate me on Weblate Try me on Runboat

+

Italiano

+

Questo modulo consente di gestire correttamente l’inversione contabile quando il modulo account_invoice_triple_discount è installato.

+

English

+

The module allows to manage correctly the reverse charge when the module account_invoice_triple_discount is installed.

+

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

+
    +
  • Odoo Italia Network
  • +
+
+
+

Contributors

+ +
+
+

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/setup/l10n_it_reverse_charge_triple_discount/odoo/addons/l10n_it_reverse_charge_triple_discount b/setup/l10n_it_reverse_charge_triple_discount/odoo/addons/l10n_it_reverse_charge_triple_discount new file mode 120000 index 000000000000..6381b29effa9 --- /dev/null +++ b/setup/l10n_it_reverse_charge_triple_discount/odoo/addons/l10n_it_reverse_charge_triple_discount @@ -0,0 +1 @@ +../../../../l10n_it_reverse_charge_triple_discount \ No newline at end of file diff --git a/setup/l10n_it_reverse_charge_triple_discount/setup.py b/setup/l10n_it_reverse_charge_triple_discount/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/l10n_it_reverse_charge_triple_discount/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)