diff --git a/l10n_br_fiscal/demo/company_demo.xml b/l10n_br_fiscal/demo/company_demo.xml index 2ba2d6cee8be..91b2891a556a 100644 --- a/l10n_br_fiscal/demo/company_demo.xml +++ b/l10n_br_fiscal/demo/company_demo.xml @@ -43,6 +43,10 @@ + @@ -105,6 +109,28 @@ draft + + + + True + True + True + + + draft + + + + + + True + True + True + + + draft + + 3 @@ -116,6 +142,10 @@ + approved + + + + True + True + True + + + draft + + + + + + True + True + True + + + draft + + 1 Série 1 @@ -206,6 +264,10 @@ 815000.00 + @@ -301,5 +363,32 @@ draft + + + + True + True + True + + + draft + + + + + + True + True + True + + + draft + diff --git a/l10n_br_fiscal/models/tax.py b/l10n_br_fiscal/models/tax.py index 9e8eff04bd71..e8a1b765079a 100644 --- a/l10n_br_fiscal/models/tax.py +++ b/l10n_br_fiscal/models/tax.py @@ -618,6 +618,54 @@ def _compute_ipi(self, tax, taxes_dict, **kwargs): return self._compute_tax(tax, taxes_dict, **kwargs) + @api.model + def _compute_ibs(self, tax, taxes_dict, **kwargs): + """The IBS (Tax on Goods and Services) must have the + following taxes removed from its calculation base: + ICMS, PIS, and COFINS.""" + tax_dict = taxes_dict.get(tax.tax_domain) + tax_dict_icms = taxes_dict.get("icms", {}) + tax_dict_pis = taxes_dict.get("pis", {}) + tax_dict_cofins = taxes_dict.get("cofins", {}) + tax_dict["remove_from_base"] += ( + tax_dict_icms.get("tax_value", 0.00) + + tax_dict_pis.get("tax_value", 0.00) + + tax_dict_cofins.get("tax_value", 0.00) + ) + return self._compute_tax(tax, taxes_dict, **kwargs) + + @api.model + def _compute_cbs(self, tax, taxes_dict, **kwargs): + """The CBS (Contribution on Goods and Services) must have the + following taxes removed from its calculation base: + ICMS, PIS, and COFINS.""" + tax_dict = taxes_dict.get(tax.tax_domain) + tax_dict_icms = taxes_dict.get("icms", {}) + tax_dict_pis = taxes_dict.get("pis", {}) + tax_dict_cofins = taxes_dict.get("cofins", {}) + tax_dict["remove_from_base"] += ( + tax_dict_icms.get("tax_value", 0.00) + + tax_dict_pis.get("tax_value", 0.00) + + tax_dict_cofins.get("tax_value", 0.00) + ) + return self._compute_tax(tax, taxes_dict, **kwargs) + + @api.model + def _compute_is(self, tax, taxes_dict, **kwargs): + """CThe ISS tax (Selective Tax) must have the + following taxes removed from its calculation base: + ICMS, PIS, and COFINS.""" + tax_dict = taxes_dict.get(tax.tax_domain) + tax_dict_icms = taxes_dict.get("icms", {}) + tax_dict_pis = taxes_dict.get("pis", {}) + tax_dict_cofins = taxes_dict.get("cofins", {}) + tax_dict["remove_from_base"] += ( + tax_dict_icms.get("tax_value", 0.00) + + tax_dict_pis.get("tax_value", 0.00) + + tax_dict_cofins.get("tax_value", 0.00) + ) + return self._compute_tax(tax, taxes_dict, **kwargs) + @api.model def _compute_tax_sequence(self, taxes_dict, **kwargs): """Método para calcular a ordem que os impostos serão calculados.