feat(missao-6): finalizacao descoberta P5-P6, compatibilidade do motor e atualizacao PROJECT_STATE
This commit is contained in:
@@ -317,14 +317,20 @@ def resolve_product(p, d, company, refs, ev, ctx, manual_ncm=None):
|
||||
# store_ipi_profile / contribuinte_ipi gate
|
||||
is_taxpayer = company.get("contribuinte_ipi") == "S"
|
||||
prof, _ = ctx.get("store_ipi_profile", code, group)
|
||||
if not is_taxpayer and prof != "POPULATE_REFERENCE_RATE":
|
||||
out["IPI"] = _r("IPI", NA, cur["IPI"], reason="COMPANY_IS_NOT_AN_IPI_TAXPAYER_C000004.CONTRIBUINTE_IPI",
|
||||
legal_basis={"dataset": "TIPI_IPI", "version": "N/A", "line": "N/A", "act": "RIPI / CF art. 153, IV (não contribuinte)"})
|
||||
if not is_taxpayer:
|
||||
if prof == "POPULATE_REFERENCE_RATE":
|
||||
pass
|
||||
elif prof == "LEAVE_NOT_APPLICABLE":
|
||||
out["IPI"] = _r("IPI", NA, cur["IPI"], reason="STORE_IPI_PROFILE_LEAVE_NOT_APPLICABLE",
|
||||
legal_basis={"dataset": "TIPI_IPI", "version": "N/A", "line": "N/A", "act": "RIPI / CF art. 153, IV (não contribuinte)"})
|
||||
elif prof is None and out["IPI"]["state"] == CHANGE:
|
||||
out["IPI"] = _r("IPI", MANUAL, cur["IPI"], reason="STORE_IPI_PROFILE_NOT_DECIDED", key="store_ipi_profile", scope="COMPANY")
|
||||
else:
|
||||
out["IPI"] = _r("IPI", NA, cur["IPI"], reason="COMPANY_IS_NOT_AN_IPI_TAXPAYER_C000004.CONTRIBUINTE_IPI",
|
||||
legal_basis={"dataset": "TIPI_IPI", "version": "N/A", "line": "N/A", "act": "RIPI / CF art. 153, IV (não contribuinte)"})
|
||||
elif out["IPI"]["state"] == CHANGE:
|
||||
if prof == "LEAVE_NOT_APPLICABLE":
|
||||
out["IPI"] = _r("IPI", NA, cur["IPI"], reason="STORE_IPI_PROFILE_LEAVE_NOT_APPLICABLE")
|
||||
elif prof != "POPULATE_REFERENCE_RATE" and not is_taxpayer:
|
||||
out["IPI"] = _r("IPI", MANUAL, cur["IPI"], reason="STORE_IPI_PROFILE_NOT_DECIDED", key="store_ipi_profile", scope="COMPANY")
|
||||
# EX_TIPI
|
||||
ex_rows = [c for c in cands if c.get("ex")]
|
||||
if ex_ctx:
|
||||
|
||||
Reference in New Issue
Block a user