Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][ l10n_br_coa][ l10n_br_fiscal][l10n_br_account] forward port #3000 e #3011 #3038

Merged
merged 13 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions l10n_br_account/data/account_tax_group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
<field name="fiscal_tax_group_id" ref="l10n_br_fiscal.tax_group_icmsfcp" />
</record>

<record id="l10n_br_coa.tax_group_icmsfcp_st" model="account.tax.group">
<field name="name">ICMS FCP ST</field>
<field name="fiscal_tax_group_id" ref="l10n_br_fiscal.tax_group_icmsfcp_st" />
</record>

<record id="l10n_br_coa.tax_group_pis" model="account.tax.group">
<field name="name">PIS</field>
<field name="fiscal_tax_group_id" ref="l10n_br_fiscal.tax_group_pis" />
Expand Down
14 changes: 14 additions & 0 deletions l10n_br_account/data/account_tax_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,20 @@
/>
</record>

<record id="l10n_br_coa.tax_template_out_icmsfcp_st" model="account.tax.template">
<field
name="fiscal_tax_ids"
search="[('tax_group_id','=',obj().env.ref('l10n_br_fiscal.tax_group_icmsfcp_st').id)]"
/>
</record>

<record id="l10n_br_coa.tax_template_in_icmsfcp_st" model="account.tax.template">
<field
name="fiscal_tax_ids"
search="[('tax_group_id','=',obj().env.ref('l10n_br_fiscal.tax_group_icmsfcp_st').id)]"
/>
</record>

<record id="l10n_br_coa.tax_template_out_pis" model="account.tax.template">
<field
name="fiscal_tax_ids"
Expand Down
4 changes: 4 additions & 0 deletions l10n_br_coa/data/account_tax_group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<field name="name">ICMS FCP</field>
</record>

<record id="tax_group_icmsfcp_st" model="account.tax.group">
<field name="name">ICMS FCP ST</field>
</record>

<record id="tax_group_pis" model="account.tax.group">
<field name="name">PIS</field>
</record>
Expand Down
6 changes: 6 additions & 0 deletions l10n_br_coa/data/account_tax_tag.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
<field name="country_id" ref="base.br" />
</record>

<record id="tax_tag_icmsfcp_st" model="account.account.tag">
<field name="name">ICMS FCP ST</field>
<field name="applicability">taxes</field>
<field name="country_id" ref="base.br" />
</record>

<record id="tax_tag_pis" model="account.account.tag">
<field name="name">PIS</field>
<field name="applicability">taxes</field>
Expand Down
22 changes: 22 additions & 0 deletions l10n_br_coa/data/account_tax_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,28 @@
<field name="chart_template_id" ref="l10n_br_coa.l10n_br_coa_template" />
</record>

<record id="tax_template_out_icmsfcp_st" model="account.tax.template">
<field name="description">ICMS FCP ST</field>
<field name="name">ICMS Saida FCP ST</field>
<field name="amount">0.00</field>
<field name="type_tax_use">sale</field>
<field eval="0" name="price_include" />
<field eval="0" name="deductible" />
<field name="tax_group_id" ref="tax_group_icmsfcp_st" />
<field name="chart_template_id" ref="l10n_br_coa.l10n_br_coa_template" />
</record>

<record id="tax_template_in_icmsfcp_st" model="account.tax.template">
<field name="description">ICMS FCP ST</field>
<field name="name">ICMS Entrada FCP ST</field>
<field name="amount">0.00</field>
<field name="type_tax_use">purchase</field>
<field eval="0" name="price_include" />
<field eval="0" name="deductible" />
<field name="tax_group_id" ref="tax_group_icmsfcp_st" />
<field name="chart_template_id" ref="l10n_br_coa.l10n_br_coa_template" />
</record>

<record id="tax_template_out_pis" model="account.tax.template">
<field name="description">PIS</field>
<field name="name">PIS Saida</field>
Expand Down
2 changes: 2 additions & 0 deletions l10n_br_fiscal/constants/fiscal.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
TAX_DOMAIN_ICMS_SN = "icmssn"
TAX_DOMAIN_ICMS_ST = "icmsst"
TAX_DOMAIN_ICMS_FCP = "icmsfcp"
TAX_DOMAIN_ICMS_FCP_ST = "icmsfcpst"
TAX_DOMAIN_PIS = "pis"
TAX_DOMAIN_PIS_ST = "pisst"
TAX_DOMAIN_PIS_WH = "pis_wh"
Expand Down Expand Up @@ -111,6 +112,7 @@
(TAX_DOMAIN_ICMS_SN, "ICMS - Simples Nacional"),
(TAX_DOMAIN_ICMS_FCP, "ICMS FCP - Fundo de Combate a Pobreza"),
(TAX_DOMAIN_ICMS_ST, "ICMS - Subistituição Tributária"),
(TAX_DOMAIN_ICMS_FCP_ST, "ICMS FCP ST- Fundo de Combate a Pobreza ST"),
(TAX_DOMAIN_PIS, "PIS"),
(TAX_DOMAIN_PIS_ST, "PIS ST"),
(TAX_DOMAIN_PIS_WH, "pis_wh"),
Expand Down
6 changes: 6 additions & 0 deletions l10n_br_fiscal/data/l10n_br_fiscal.tax.csv
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@
"tax_icmsfcp_2","FCP 2%","percent","2.00","0.00","tax_group_icmsfcp",,,,,,,"0","4",,
"tax_icmsfcp_4","FCP 4%","percent","4.00","0.00","tax_group_icmsfcp",,,,,,,"0","4",,
"tax_icmsfcp_nt","FCP Não Tributado","percent","0.00","0.00","tax_group_icmsfcp",,,,,,,"0","4",,
"tax_icms_12_st","ICMS 010 12%","percent","12.00","0.00","tax_group_icms","cst_icms_10","cst_icms_10",,,,,"0","4",,
"tax_icmsfcp_st_1","FCP ST 1%","percent","1.00","0.00","tax_group_icmsfcp_st",,,,,,,"0","4",,
"tax_icmsfcp_st_2","FCP ST 2%","percent","2.00","0.00","tax_group_icmsfcp_st",,,,,,,"0","4",,
"tax_icmsfcp_st_4","FCP ST 4%","percent","4.00","0.00","tax_group_icmsfcp_st",,,,,,,"0","4",,
"tax_icmsfcp_st_nt","FCP ST Não Tributado","percent","0.00","0.00","tax_group_icmsfcp_st",,,,,,,"0","4",,
"tax_icmsst_146","ICMS MVA 146%","percent","18.00","0.00","tax_group_icmsst",,,,,,,"0","4","146.0",
"tax_icmsst_148","ICMS MVA 148%","percent","18.00","0.00","tax_group_icmsst",,,,,,,"0","4","148.0",
"tax_icmsst_29_43","ICMS MVA 29,43%","percent","18.00","0.00","tax_group_icmsst",,,,,,,"0","4","29.43",
Expand All @@ -182,6 +187,7 @@
"tax_icmsst_47","ICMS MVA 47%","percent","18.00","0.00","tax_group_icmsst",,,,,,,"0","4","47.0",
"tax_icmsst_57","ICMS MVA 57%","percent","18.00","0.00","tax_group_icmsst",,,,,,,"0","4","57.0",
"tax_icmsst_71_48","ICMS MVA 71,48%","percent","18.00","0.00","tax_group_icmsst",,,,,,,"0","4","71.48",
"tax_icmsst_p30_50","ICMS 30% MVA 50","percent","30.00","0.00","tax_group_icmsst",,,,,,,"0","4","50",
"tax_ii_0","II 0%","percent","0.00","0.00","tax_group_ii",,,,,,,"0","4",,
"tax_ii_10","II 10%","percent","10.00","0.00","tax_group_ii",,,,,,,"0","4",,
"tax_ii_12","II 12%","percent","12.00","0.00","tax_group_ii",,,,,,,"0","4",,
Expand Down
1 change: 1 addition & 0 deletions l10n_br_fiscal/data/l10n_br_fiscal.tax.group.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"tax_group_csll_wh","CSLL RET","csll_wh","True","True",120,"999","federal","res_partner_ministerio_fazenda",20,"False"
"tax_group_icms","ICMS","icms","True","False",30,"30","state",,,"True"
"tax_group_icmsfcp","ICMS FCP","icmsfcp","True","False",135,"135","state",,,"True"
"tax_group_icmsfcp_st","ICMS FCP ST","icmsfcpst","False","False",136,"136","state",,,"True"
"tax_group_icmssn","ICMS - Simples Nacional","icmssn","True","False",125,"125","state",,,"True"
"tax_group_icmsst","ICMS ST","icmsst","False","False",130,"130","state",,,"True"
"tax_group_ii","II","ii","True","False",10,"10","federal",,,"False"
Expand Down
16 changes: 16 additions & 0 deletions l10n_br_fiscal/models/document_fiscal_line_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
TAX_DOMAIN_CSLL_WH,
TAX_DOMAIN_ICMS,
TAX_DOMAIN_ICMS_FCP,
TAX_DOMAIN_ICMS_FCP_ST,
TAX_DOMAIN_ICMS_SN,
TAX_DOMAIN_ICMS_ST,
TAX_DOMAIN_II,
Expand Down Expand Up @@ -443,6 +444,21 @@ def _operation_domain(self):
# de Combate à Pobreza (FCP) da UF de destino
icmsfcp_value = fields.Monetary(string="ICMS FCP Value")

# ICMS FCP ST Fields
icmsfcpst_tax_id = fields.Many2one(
comodel_name="l10n_br_fiscal.tax",
string="Tax ICMS FCP ST",
domain=[("tax_domain", "=", TAX_DOMAIN_ICMS_FCP_ST)],
)

# vBCFCPST
icmsfcpst_base = fields.Monetary(
string="ICMS FCP ST Base",
)

# pFCPST - Percentual do FCP ST
icmsfcpst_percent = fields.Float(string="ICMS FCP ST %")

# vFCPST - Valor do ICMS relativo ao
# Fundo de Combate à Pobreza (FCP) por Substituição Tributária
icmsfcpst_value = fields.Monetary(string="ICMS FCP ST Value")
Expand Down
10 changes: 9 additions & 1 deletion l10n_br_fiscal/models/document_fiscal_line_mixin_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"icmsfcp_tax_id",
"icmssn_tax_id",
"icmsst_tax_id",
"icmsfcpst_tax_id",
"ii_tax_id",
"inss_tax_id",
"inss_wh_tax_id",
Expand Down Expand Up @@ -260,6 +261,7 @@ def _remove_all_fiscal_tax_ids(self):
self._set_fields_inss(TAX_DICT_VALUES)
self._set_fields_icms(TAX_DICT_VALUES)
self._set_fields_icmsfcp(TAX_DICT_VALUES)
self._set_fields_icmsfcpst(TAX_DICT_VALUES)
self._set_fields_icmsst(TAX_DICT_VALUES)
self._set_fields_icmssn(TAX_DICT_VALUES)
self._set_fields_ipi(TAX_DICT_VALUES)
Expand Down Expand Up @@ -615,7 +617,12 @@ def _set_fields_icmsfcp(self, tax_dict):
self.icmsfcp_base = tax_dict.get("base", 0.0)
self.icmsfcp_percent = tax_dict.get("percent_amount", 0.0)
self.icmsfcp_value = tax_dict.get("tax_value", 0.0)
self.icmsfcpst_value = tax_dict.get("fcpst_value", 0.0)

def _set_fields_icmsfcpst(self, tax_dict):
self.ensure_one()
self.icmsfcpst_base = self.icmsst_base
self.icmsfcpst_percent = tax_dict.get("percent_amount", 0.0)
self.icmsfcpst_value = tax_dict.get("tax_value", 0.0)

@api.onchange("icmsfcp_percent", "icmsfcp_value")
def _onchange_icmsfcp_fields(self):
Expand Down Expand Up @@ -773,6 +780,7 @@ def _onchange_cofinsst_fields(self):
"icmssn_tax_id",
"icmsst_tax_id",
"icmsfcp_tax_id",
"icmsfcpst_tax_id",
"ipi_tax_id",
"ii_tax_id",
"pis_tax_id",
Expand Down
6 changes: 6 additions & 0 deletions l10n_br_fiscal/models/document_fiscal_mixin_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ def _operation_domain(self):
store=True,
)

amount_icmsfcpst_value = fields.Monetary(
string="ICMS FCP ST Value",
compute="_compute_amount",
store=True,
)

amount_icms_destination_value = fields.Monetary(
string="ICMS Destination Value",
compute="_compute_amount",
Expand Down
Loading
Loading