Compare commits
78
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fde644af79 | ||
|
|
ed87593a01 | ||
|
|
a1af1f60cd | ||
|
|
fcac2d5ebd | ||
|
|
26c55ffab0 | ||
|
|
0bbb02b7ec | ||
|
|
7f110f3c8b | ||
|
|
4b3578acbf | ||
|
|
5f202fe5b5 | ||
|
|
9bfd95083f | ||
|
|
f94007acfc | ||
|
|
63b654ba1b | ||
|
|
dc34894bde | ||
|
|
3c293dbee0 | ||
|
|
70c71739b2 | ||
|
|
324a20ea73 | ||
|
|
a4dc45db5d | ||
|
|
daf0465489 | ||
|
|
974139a710 | ||
|
|
bbdac0821a | ||
|
|
6f363df462 | ||
|
|
5fdcc98d05 | ||
|
|
a8026f346e | ||
|
|
56c9788928 | ||
|
|
fa9c5a5be8 | ||
|
|
289877d6a4 | ||
|
|
18fefc5a09 | ||
|
|
c64ecea04e | ||
|
|
03cd76ae28 | ||
|
|
d3b3cb6cb2 | ||
|
|
11fcf48156 | ||
|
|
4f1be49d39 | ||
|
|
1244fc8b7a | ||
|
|
109e0cef51 | ||
|
|
717370e537 | ||
|
|
d7a76ab17a | ||
|
|
3eda84ef79 | ||
|
|
b68936290c | ||
|
|
7b2f368642 | ||
|
|
d77c51f291 | ||
|
|
57d4bc1cf4 | ||
|
|
e4e67e8228 | ||
|
|
46ab0abcb0 | ||
|
|
56b94011ba | ||
|
|
97171c5e1e | ||
|
|
07dd6dd221 | ||
|
|
31651a76b1 | ||
|
|
823d6b3559 | ||
|
|
f2f6ffca88 | ||
|
|
0b0dbc5214 | ||
|
|
75bb95f2b4 | ||
|
|
cd65e41e84 | ||
|
|
744bfccb69 | ||
|
|
b8435c1a0e | ||
|
|
dc1c85bf8e | ||
|
|
40b76278d5 | ||
|
|
f6c3c28ac6 | ||
|
|
c42b36db62 | ||
|
|
ec6d951e31 | ||
|
|
321901cec5 | ||
|
|
d3cdddde96 | ||
|
|
abc050f14d | ||
|
|
cccead8a3c | ||
|
|
dbd8bac5aa | ||
|
|
aa79180b47 | ||
|
|
359ee45f57 | ||
|
|
3d88e3e92e | ||
|
|
0ce373670f | ||
|
|
aa03d346ba | ||
|
|
fb7b5c35b3 | ||
|
|
1b7ccfee23 | ||
|
|
479b66815c | ||
|
|
525d0ab672 | ||
|
|
08ade21bab | ||
|
|
bf866f9862 | ||
|
|
d1551dab08 | ||
|
|
4dce666134 | ||
|
|
bee96fc9fd |
@@ -12,6 +12,3 @@ database/data/economic-references-lot-01.json text eol=crlf
|
||||
CHANGELOG.md export-ignore
|
||||
README.md export-ignore
|
||||
.github/workflows/browser-tests.yml export-ignore
|
||||
|
||||
# Preserve the original archived BM HTML bytes and whitespace.
|
||||
docs/investmoz/simulations/source-archive/BM-Mercado-Monetario-MAIBOR-20261025.html -text -diff
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -27526,6 +27526,63 @@
|
||||
"resolution": "Externos;exportar não executa nem certifica esses actos."
|
||||
}
|
||||
],
|
||||
"active_changes": false
|
||||
"active_changes": false,
|
||||
"prepared_delivery": {
|
||||
"candidate": "4d6f8282302c7646bd7350b8d67695d005feab9a",
|
||||
"report": "irpc-l5-grouped-prepared-delivery-20261025.json",
|
||||
"bundle_verified": true,
|
||||
"active_changes": false
|
||||
},
|
||||
"installed_followup": "irpc_l5_delivered_20261025"
|
||||
},
|
||||
"irpc_l5_delivered_20261025": {
|
||||
"status": "installed_scoped_grouped_IRPC_L5_delta_verified",
|
||||
"commit": "2b33a1c343d192f80fb24aac2a27b2d375af5601",
|
||||
"requested_included": "4d6f8282",
|
||||
"receipt": "irpc-l5-delivery-20261025.json",
|
||||
"backup_restore_verified": true,
|
||||
"tables": 174,
|
||||
"files": 369,
|
||||
"L3_ISPC_FX_preserved": true,
|
||||
"L5_integrally_completed": false,
|
||||
"remaining": [
|
||||
{
|
||||
"item": "Dispensas68 e casos residentes/EP dependentes",
|
||||
"data_needed": "Titular/operação e condições de68(a/b/c/d/f/g),incluindo gestão de imóveis próprios/transparência,participações e tipos de juros;casos digitais residentes/EP confrontados com62(5)/68(d).",
|
||||
"resolution": "Ramo específico por dispensa/factos;não bloquear royalties comuns,retenções definitivas ou especiais independentes."
|
||||
},
|
||||
{
|
||||
"item": "Convenções/benefícios invocados",
|
||||
"data_needed": "País/convenção/artigo,beneficiário,residência,condições/período e prova invocados",
|
||||
"resolution": "Só esse caso fica indeterminado;sem taxa reduzida presumida."
|
||||
},
|
||||
{
|
||||
"item": "Outros rendimentos/devedores/períodos",
|
||||
"data_needed": "Artigo próprio para categorias fora dos ramos agrupados,via devedorIRPS,anos fora2026,EP de categorias especiais62(4)quando não cabe62(2)",
|
||||
"resolution": "Não aplicar20%ou10%genéricos;avançar os casos compatíveis."
|
||||
},
|
||||
{
|
||||
"item": "Juros,rectificações e arredondamento de entrega",
|
||||
"data_needed": "Regra/taxa/base/período dejuros,declaração/guia anterior,documentos de correcção e regra de arredondamento legal da entrega se aplicável",
|
||||
"resolution": "Aritmética exacta preservada;aproximação assinalada;sem zero dejuros ou crédito anual automático."
|
||||
},
|
||||
{
|
||||
"item": "EntregaAT com comprovativo em moeda estrangeira",
|
||||
"data_needed": "MontanteMZN efectivamente entregue no comprovativo;conversão do pagamento ao beneficiário não prova entregaIRPC",
|
||||
"resolution": "Base e comprovativo de retenção sofrida já convertem pelo mecanismo entregue;esta limitação não reabre o câmbio geral."
|
||||
}
|
||||
],
|
||||
"external": [
|
||||
{
|
||||
"item": "MRFTA/CER e remissão67(7)",
|
||||
"data_needed": "Correspondência concreta de rubricas/CER para novos casos;67(7)refere62(6),nova taxaestá62(5);manteroriginal",
|
||||
"resolution": "Preparação/exportação disponível;sem adivinhar código,assinatura ou submissão."
|
||||
},
|
||||
{
|
||||
"item": "ActosAT",
|
||||
"data_needed": "Submissão,recepção,aceitação e eventuais comprovativos externos",
|
||||
"resolution": "Externos;exportar não executa nem certifica esses actos."
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,475 @@
|
||||
{
|
||||
"status": "prepared_delivery_exact_QA_candidate_not_installed",
|
||||
"candidate": "5fa64bc0f4b067e81d8728b344eb8697415ebedf",
|
||||
"baseline_last_reported_installed": "ce746d889d5711f23f4e0ac8d9802997b5e106f9",
|
||||
"main_verified": "ce746d889d5711f23f4e0ac8d9802997b5e106f9",
|
||||
"branch": "codex/irpc-juros-mrfta-qa-20261025",
|
||||
"authorization": "Tempo:preparar entrega de5fa64bc0,explicitar juros documentados sem cálculo automático e CER/rubricas pendentes;delimitar apenas esses dois pontos;L5 parcial;preservarL3/ISPC/câmbio;reutilizar provas.",
|
||||
"delivery_scope_pt": [
|
||||
"Preparação MRFTA por período,quadros1–7,com documentos e entregas reutilizados.",
|
||||
"Juros compensatórios registados a partir de liquidação documentada. Registar não significa calcular automaticamente.",
|
||||
"Zero de juros apenas na ausência de atraso demonstrada pela reconciliação e prazo documentado.",
|
||||
"Relatório/dossier e exportação HTML de preparação,com informação insuficiente e histórico preservados.",
|
||||
"CER e rubricas sem correspondência identificados,sem preenchimento presumido;CER999 de teste não é código oficial."
|
||||
],
|
||||
"not_claimed": [
|
||||
"Cálculo automático de juros ou parametrização2026 completa",
|
||||
"Catálogo CER/rubricas integral",
|
||||
"Preenchimento/alteração do PDF oficial,assinaturas,submissão ou aceitação AT",
|
||||
"Conclusão integral deL5/IRPC/IRPS"
|
||||
],
|
||||
"changes": [
|
||||
".gitattributes",
|
||||
"docs/investmoz/consolidated-review-matrix-2026-10-03.md",
|
||||
"docs/investmoz/simulations/irpc-juros-mrfta-qa-20261025.json",
|
||||
"docs/investmoz/simulations/irpc-l5-reliefs-delivery-20261025.json",
|
||||
"docs/investmoz/simulations/official-source-register.md",
|
||||
"docs/investmoz/simulations/source-archive/BM-Mercado-Monetario-MAIBOR-20261025.html",
|
||||
"docs/investmoz/unification/traceability-and-manual.md",
|
||||
"docs/investmoz/v2/auditoria-portal/matriz-requisitos.csv",
|
||||
"resources/js/components/simulation-irpc-mrfta.tsx",
|
||||
"resources/js/components/simulation-irpc-withholdings.tsx",
|
||||
"resources/js/lib/irpc-mrfta.ts",
|
||||
"resources/js/lib/irpc-withholdings.ts",
|
||||
"tests/Feature/IrpcMrftaDraftTest.php",
|
||||
"tests/frontend/irpc-mrfta.test.mjs",
|
||||
"tools/irpc-mrfta-qa.php"
|
||||
],
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/irpc-mrfta.ts",
|
||||
"sha256_LF": "1ff1725724dbdaaa9a3857941d03e312c6a7da573d369ee86015edc90cd2d0d1"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-withholdings.ts",
|
||||
"sha256_LF": "8e5f3c035ce5e4d6c3fc82f933439ab580fa5519492f9c4d32cfb71b77b54803"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-mrfta.tsx",
|
||||
"sha256_LF": "9cf7d5e447e1a9ed37d1bd24b4ac5104b1adec3790ff8db4356c3b68b339d89a"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-withholdings.tsx",
|
||||
"sha256_LF": "751af4fab346659bc5ccb08b8a2169769af7521ea0035050af32b41ea7f5aa76"
|
||||
}
|
||||
],
|
||||
"protected_runtime": [
|
||||
{
|
||||
"path": "resources/js/components/acquisition-beverage-restitution.tsx",
|
||||
"sha256": "6f44897b8b12569314551df0022c26da57a165634087942a724293e66837558d",
|
||||
"sha256_LF": "6f44897b8b12569314551df0022c26da57a165634087942a724293e66837558d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/fiscal-calculation-gaps.tsx",
|
||||
"sha256": "1dab6ceb73756d4e023096b3b2ba767aaa843ff6cc69046ea630ab449a00b0dd",
|
||||
"sha256_LF": "1dab6ceb73756d4e023096b3b2ba767aaa843ff6cc69046ea630ab449a00b0dd"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/fiscal-l3-preparation.tsx",
|
||||
"sha256": "e84a7b1ccadaa1b5bd78d778a3287f96ccaf530855eef404786cd7aa3d321b73",
|
||||
"sha256_LF": "e84a7b1ccadaa1b5bd78d778a3287f96ccaf530855eef404786cd7aa3d321b73"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-acquisitions.tsx",
|
||||
"sha256": "c206d4cfe575d6ba007aa2b425b5f898efa97e4162b8710e358b6ecfd9458542",
|
||||
"sha256_LF": "c206d4cfe575d6ba007aa2b425b5f898efa97e4162b8710e358b6ecfd9458542"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-operations.tsx",
|
||||
"sha256": "a7e55972fa790063dcf11945055de2af46a77db9e509900af22ede7ec47bb4cf",
|
||||
"sha256_LF": "a7e55972fa790063dcf11945055de2af46a77db9e509900af22ede7ec47bb4cf"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-acquisition-bc.ts",
|
||||
"sha256": "b0ef55e0917bdb79f14b53ba9e95d73c08153befeb7d4ce73f81e6fb13992225",
|
||||
"sha256_LF": "b0ef55e0917bdb79f14b53ba9e95d73c08153befeb7d4ce73f81e6fb13992225"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-beverage-allocation.ts",
|
||||
"sha256": "32968d198c7fe0c53ca89641c22d5749be6636be2c79127b867e4e3afd0dd40d",
|
||||
"sha256_LF": "32968d198c7fe0c53ca89641c22d5749be6636be2c79127b867e4e3afd0dd40d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-beverage-restitution.ts",
|
||||
"sha256": "5c650cbd9469d5f99001f56fc4ff99ac973eb368036d4e96c6d171f1b220bd9e",
|
||||
"sha256_LF": "5c650cbd9469d5f99001f56fc4ff99ac973eb368036d4e96c6d171f1b220bd9e"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-calculation-gaps.ts",
|
||||
"sha256": "2e7d84a0c196bd5b56fd67cc1a389d43d5041894184e675680a4de3cd10b31a2",
|
||||
"sha256_LF": "2e7d84a0c196bd5b56fd67cc1a389d43d5041894184e675680a4de3cd10b31a2"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-operations.ts",
|
||||
"sha256": "ec37b949f1233c5f5c14a87450c421ed29fabf1ed5b73fb32564564a2bc31f54",
|
||||
"sha256_LF": "ec37b949f1233c5f5c14a87450c421ed29fabf1ed5b73fb32564564a2bc31f54"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/l3-form-preparation.ts",
|
||||
"sha256": "fc47f5fa5ec1420fbd847d0d081f00d99ebbb524164eef785b20877e0562f704",
|
||||
"sha256_LF": "fc47f5fa5ec1420fbd847d0d081f00d99ebbb524164eef785b20877e0562f704"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-residuals.ts",
|
||||
"sha256": "40d5751c06c7c155ab4b7a17ee2d1653da2fbbf075807fbb8561cdbe19820955",
|
||||
"sha256_LF": "40d5751c06c7c155ab4b7a17ee2d1653da2fbbf075807fbb8561cdbe19820955"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-residuals.tsx",
|
||||
"sha256": "a9219d6f41ccbd0ce45659d4f6aa0fa1c169a685840f5cb1e18daeca377d5e18",
|
||||
"sha256_LF": "a9219d6f41ccbd0ce45659d4f6aa0fa1c169a685840f5cb1e18daeca377d5e18"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-eligibility.ts",
|
||||
"sha256": "44675c5efacdc1ae19505667611ba3b522d3043cebacc8754597c3a68ca89d25",
|
||||
"sha256_LF": "44675c5efacdc1ae19505667611ba3b522d3043cebacc8754597c3a68ca89d25"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-quarter.tsx",
|
||||
"sha256": "2c2555309b32d4261f14e7164f39314c9188129c2990357fc54090a2468dd2b4",
|
||||
"sha256_LF": "2c2555309b32d4261f14e7164f39314c9188129c2990357fc54090a2468dd2b4"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-withholding.tsx",
|
||||
"sha256": "e0445d015b72859e48726959aa52686f79b1cf5c2ade29751efa83257068b878",
|
||||
"sha256_LF": "e0445d015b72859e48726959aa52686f79b1cf5c2ade29751efa83257068b878"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-quarter.ts",
|
||||
"sha256": "f66bd52e9cdfe1ddaa6b00a931465862b3d890b9be216b7a056740f027f24129",
|
||||
"sha256_LF": "f66bd52e9cdfe1ddaa6b00a931465862b3d890b9be216b7a056740f027f24129"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-withholding.ts",
|
||||
"sha256": "6c31b240299edd3262efa28f7f3d5aee21123f94e30ef4ab90e26c35777cb6e4",
|
||||
"sha256_LF": "6c31b240299edd3262efa28f7f3d5aee21123f94e30ef4ab90e26c35777cb6e4"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-eligibility.tsx",
|
||||
"sha256": "f48dd4a8f87a994eda0447f81a463589905e5873b2e1044debac9d10825a880c",
|
||||
"sha256_LF": "f48dd4a8f87a994eda0447f81a463589905e5873b2e1044debac9d10825a880c"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-acquisitions.ts",
|
||||
"sha256": "cce283b1d0a07fb383fcb527225f4dd5bec829010a662cbaae1d60e595221977",
|
||||
"sha256_LF": "cce283b1d0a07fb383fcb527225f4dd5bec829010a662cbaae1d60e595221977"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-modelo-a.ts",
|
||||
"sha256": "c641619a05613c1620385baad0e9ffbf810dd970aafb30e12b3a7f9a3bf11846",
|
||||
"sha256_LF": "c641619a05613c1620385baad0e9ffbf810dd970aafb30e12b3a7f9a3bf11846"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-fx-selection.ts",
|
||||
"sha256": "9aa07ad443bc777b80510a3b5bd6aff9ddb9814d2450f3c690e531e74d71d998",
|
||||
"sha256_LF": "9aa07ad443bc777b80510a3b5bd6aff9ddb9814d2450f3c690e531e74d71d998"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-fx-selection.tsx",
|
||||
"sha256": "39bb6d87d404745b0b66349bc11626545a3672ae27321ce9b4658416592059bf",
|
||||
"sha256_LF": "39bb6d87d404745b0b66349bc11626545a3672ae27321ce9b4658416592059bf"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/business-financial-plan.ts",
|
||||
"sha256": "c20274722d1ffcd0360f041a6cacb5d868fe0621cb27a1aca6e06826612c3ebb",
|
||||
"sha256_LF": "c20274722d1ffcd0360f041a6cacb5d868fe0621cb27a1aca6e06826612c3ebb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-currency-events.ts",
|
||||
"sha256": "cc9f2045d302d7987310da4006cc250fc5c99a27397918d166d649bfc32fab08",
|
||||
"sha256_LF": "cc9f2045d302d7987310da4006cc250fc5c99a27397918d166d649bfc32fab08"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-fx.ts",
|
||||
"sha256": "5c4a7a477429f8d775acf6db3e117008468f5554e5731dec81f60fbb75e948fb",
|
||||
"sha256_LF": "5c4a7a477429f8d775acf6db3e117008468f5554e5731dec81f60fbb75e948fb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-form.tsx",
|
||||
"sha256": "01d20f4761933a3e4dd7c776bd4adcf9610ac0435d918a1998ae9f0c3ce3f234",
|
||||
"sha256_LF": "01d20f4761933a3e4dd7c776bd4adcf9610ac0435d918a1998ae9f0c3ce3f234"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256": "df8b224b9472449711d0b69a873fa75f9cc9f4d84dce1a314fc576fae9c6eae2",
|
||||
"sha256_LF": "df8b224b9472449711d0b69a873fa75f9cc9f4d84dce1a314fc576fae9c6eae2"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier-report.ts",
|
||||
"sha256_LF": "4523365e2d4a2fcd014e13393deb33a5ec4b9396ff580d8a237aa8c4f02265e4"
|
||||
}
|
||||
],
|
||||
"originals_preserved": [
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Comunicado-9-2026-ISPC.pdf",
|
||||
"sha256": "106f8a9ce9255c03549c70bf07fe999d32e6e55302d009b509862aa74ccb4973"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Modelo-30-ISPC.pdf",
|
||||
"sha256": "6802edd06b6ff638a0b851a3ec7ecf69af8f07840faa47446becad67d35d445c"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Modelo-B-Geral.pdf",
|
||||
"sha256": "bd977c7c59d4d98befd92e2c566b1bf168cb1343bb519f51b41a3807f431fc57"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-MRFTA-19-39.pdf",
|
||||
"sha256": "8ea62c53066b482f87078a7a7b1ecf15ca98a12a122e8d7abca63acfc993186b"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-16-I-Serie-2008-04-16.pdf",
|
||||
"sha256": "fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-248-I-Suplemento-1-2025.pdf",
|
||||
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-89-I-Serie-2017-06-08.pdf",
|
||||
"sha256": "11f0cab15eb6e51010952203ffa24fdc533a24fd642e19525fe4f46b17a1f5e5"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-95-I-Suplemento-2025-05-21.pdf",
|
||||
"sha256": "e0e682e2c027c3cd9c1d46a73a3f48bc5f6bdbf05667fd97314d7a3f6a456358"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR252-I-Serie-2022-Lei20-PESOE.pdf",
|
||||
"sha256": "1159fd3ce1ba5581671796d083534da48bd3c5578298819e896f1c2a8026318d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-22-2021-BR70.pdf",
|
||||
"sha256": "a8fac38dcfe08f9c7a8e46254cff10e1ec82fc4f7a8d88ad6e4fe7d91ffc21a5"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-27-2026-BR123.pdf",
|
||||
"sha256": "26249c3fa58f149c81de36e99d1aac2819a4771379d9e8833159660dabf539bb"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-29-1998-BR22-5-suplemento.pdf",
|
||||
"sha256": "6242cbe675faadf085f43f95ec8c7e8868aafe67c3b2ab2bb010992288f954f8"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-3-2011-BR-11-I-mineiros.pdf",
|
||||
"sha256": "5bca1133666ba9c69870b89823420175b7b5b8d0eccb667ecdf5c29716f3b6be"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-37-2023-BR124.pdf",
|
||||
"sha256": "7e680b191481faa0e2e9057fa5053587eb2a29d1d8c819e0eb9f02814255a04c"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-9-2008-BR16.pdf",
|
||||
"sha256": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-13-2016-CIVA-BR-156-10-suplemento.pdf",
|
||||
"sha256": "b90dc7c14ecea2e378c4a62e8e5a47d54a5644c457baeb8b8053b92fd2a5710b"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-14-1992-BR42.pdf",
|
||||
"sha256": "089fff7423e99a70a230a73ca379e4ea3a91d124703f91016e57ff82794b9e56"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-17-2022-BR251-exemplar-MCNet5.pdf",
|
||||
"sha256": "14eb34f0af91a8f5cb1770c7b52d6ff839c6818302d1ed96d79afbfb9fe999d4"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-17-2022-IPP-BR250-Parlamento.pdf",
|
||||
"sha256": "978cd22403ffd336a631704ecd7a5bbd814a427c815b9acdaca5515591dd9e2a"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2013-BR76.pdf",
|
||||
"sha256": "bba96d645cc935ffc3d1a79b9f0f73ac1c693d6459c2ad41f56cd2841accae76"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2017-IRPS-BR-OCAM.pdf",
|
||||
"sha256": "c3a0186cb9ad090d7a9533006295dc9bb6a62ad0d6150173cbd49dba4ee4b52d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-2-2011-BR-1-4-suplemento-MCNet.pdf",
|
||||
"sha256": "a7543a68cc3287a46a83c39a04821b40f649dd06c4e9b5dc51ff0b47fba08899"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-22-2022-IVA-republicada-BR-250-2-suplemento.pdf",
|
||||
"sha256": "ea1b0dc6f5cf6e595f6d9a19e7042f398999e0087caef1785f6e8fac571b5f53"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-34-2007-BR52.pdf",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-1994-BR37-3-suplemento.pdf",
|
||||
"sha256": "210df9db8980d0a5690cd187a6eeec7e37a900d743e39062c16f4e0d12215c7e"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-2012-BR3.pdf",
|
||||
"sha256": "b8845cef41dcbd9ba50c43dbfa743a56030dd3d348242a107e1ae30279eec121"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-7-1991-Partidos-IFES.pdf",
|
||||
"sha256": "6b783a0bb3330688ef10660a58060d9724aa2da6a873d234fe902f0eaaeda42d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/PT-MZ-CDT-1992.pdf",
|
||||
"sha256": "d504e1024b28aee5c6acf4592acb96ec9c915a8414f67a61ab6984d6acf9df9d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/PT-MZ-Protocolo-2009.pdf",
|
||||
"sha256": "f353773dcf41f09f4daa6cf5ba5a5f7994f3e02615867c2dcffc61c3d901bf9b"
|
||||
}
|
||||
],
|
||||
"new_source_exact_bytes": {
|
||||
"path": "docs/investmoz/simulations/source-archive/BM-Mercado-Monetario-MAIBOR-20261025.html",
|
||||
"sha256": "00e8a7e0d3a1db4ca3beb56d5361b2084a0f1684f3d40fc1c203702a2190e063",
|
||||
"url": "https://bancomoc.mz/pt/areas-de-actuacao/mercados/mercado-monetario/",
|
||||
"review": "Official page expressly documentsdiscontinuedMAIBOR publication;MIMO/Prime not transported into fiscalrule",
|
||||
"publication_import_activation": "Private source archive only;no library publication or fiscal activation;no scan claimed"
|
||||
},
|
||||
"accepted_proofs_reused": {
|
||||
"frontend": "12 new tests+1 directed existing IRPC presentation test passed",
|
||||
"types": "tsc --noEmit exit0",
|
||||
"build": "complete QA build exit0",
|
||||
"private_api": "1test/14assertions;DatabaseTransactions rollback;127.0.0.1:55441/simulator_fiscal_delta_20261021_test",
|
||||
"dossier": "generated from actual private API recovered model",
|
||||
"UI": {
|
||||
"calculation": true,
|
||||
"localSaveRecovery": true,
|
||||
"privateApiProof": "IrpcMrftaDraftTest, separate",
|
||||
"report": true,
|
||||
"documentedInterest": true,
|
||||
"insufficientInformation": true,
|
||||
"download": true,
|
||||
"errors": []
|
||||
},
|
||||
"CER_example": "999 is explicitly fictional QA data,not an official recipe-code mapping",
|
||||
"unchanged_proofs": "AcceptedL3/ISPC/FX and ce746d88 calculation proofs reused;no manual repeat suites"
|
||||
},
|
||||
"all_recorded_proof_hashes_match": true,
|
||||
"proofs_reexecuted": false,
|
||||
"runtime_changed_during_preparation": false,
|
||||
"bundle_sha256": "bc63ec2a02bea9b2efdf12ba70c707f4f8a940c6b6a9ad033cb8311110a729ba",
|
||||
"bundle_verified": true,
|
||||
"QA_receipt": "docs/investmoz/simulations/irpc-juros-mrfta-qa-20261025.json",
|
||||
"QA_receipt_sha256": "fdde06e72d8e36faee623fe34a1907e1de55da2ebe9ee36c6e34073516a5e4c8",
|
||||
"remaining_only_these_two_points": {
|
||||
"juros": {
|
||||
"entregue": "Transcrição de liquidação de juros compensatórios, com montante/data/período/documento; ou ausência de atraso demonstrada por entrega integral e prazo documentado. Nenhuma taxa aplicada pelo motor para calcular juros.",
|
||||
"resta": [
|
||||
"Corresponder fonte, parâmetro/taxa e versão temporal aplicáveis ao cálculo automático dos juros da retenção; a referência MAIBOR12meses+2p.p. e a descontinuidade documentada não autorizam escolher MIMO/Prime como substituto.",
|
||||
"Delimitar, na mesma operação, início/fim da contagem, natureza por conta/definitiva, base em dívida após entregas parciais, regra diária e arredondamento; distinguir compensatórios e mora sem cumulação presumida.",
|
||||
"Implementar apenas os casos com regra completa e provar o novo delta: atraso com entrega integral/parcial, mudança de parâmetro se aplicável e dados/taxa ausentes. Reutilizar transcrição, persistência e relatórios já demonstrados."
|
||||
],
|
||||
"condicao_de_fecho": "Cálculo reproduzível do caso suportado com fonte/versão, principal, taxa, dias e juros discriminados; sem parâmetro aplicável, juros continuam indeterminados e o principal mantém-se disponível.",
|
||||
"nao_reabrir": [
|
||||
"Registo de juros documentados",
|
||||
"Conferência de entrega integral no prazo documentado",
|
||||
"Gravação/recuperação/histórico/relatório já demonstrados"
|
||||
]
|
||||
},
|
||||
"cer_rubricas": {
|
||||
"entregue": "Rubricas correntes correspondidas pelo rendimento e natureza; CER transcrito com referência. Ausência de CER, rubrica desconhecida e mistura de taxas/CER ficam pendentes. CER999 é exclusivamente fictício de QA.",
|
||||
"resta": [
|
||||
"Corresponder códigos CER a rubrica, natureza, rendimento e período com o catálogo/modelo/procedimento oficial aplicável; os números dos campos da guia antiga não são códigos CER por inferência.",
|
||||
"Resolver apenas as rubricas ainda pendentes: digital/moeda electrónica, categorias especiais e outros rendimentos sem correspondência actual, incluindo casos por conta que não cabem nas rubricas já mapeadas.",
|
||||
"Corresponder o tratamento de taxas/CER diferentes na mesma rubrica: conservar parcelas e documentos; não fundir taxas, calcular taxa média ou criar declarações/anexos por presunção.",
|
||||
"Acrescentar casos dirigidos para cada nova correspondência e para código ausente, período incompatível ou rubrica desconhecida, mantendo casos independentes e cálculos anteriores."
|
||||
],
|
||||
"condicao_de_fecho": "Cada novo caso liga rendimento/natureza/período ao CER e à rubrica com referência verificável e apresentação correcta; o catálogo parcial nunca implica cobertura integral.",
|
||||
"nao_reabrir": [
|
||||
"Preparação de um mês/ano",
|
||||
"Bases/taxas/imposto/entregas provenientes do cálculo guardado",
|
||||
"Separação de dispensas, retenções sofridas e outros períodos",
|
||||
"Exportação HTML e dossier demonstrados"
|
||||
]
|
||||
}
|
||||
},
|
||||
"execution_remaining": [
|
||||
"Na futura disponibilização: confirmar revisão de destino e ausência de alterações concorrentes;backup/restauro fresco e conferência de dados/schema/configuração/permissões pelo procedimento existente.",
|
||||
"Integrar apenas a candidata exacta pelo Git após os controlos;não integrar a branch documental do workspace.",
|
||||
"Conferir release anterior conservada,delta servido e preservação;reutilizar as provas aceites quando não afectadas."
|
||||
],
|
||||
"fresh_backup_restore": "Não executado nesta preparação;os recibos anteriores mantêm-se históricos e não são apresentados como frescos.",
|
||||
"active_changes": false,
|
||||
"schema_backend_config_permissions_api_dependencies_delta": false,
|
||||
"L5_integrally_completed": false,
|
||||
"broader_L5_balance": "Mantido no estado anterior;este seguimento não alarga nem reabre o restante lote.",
|
||||
"packet_proofs": [
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/api.txt",
|
||||
"sha256": "63e401f6422cdea294b4ae58bf1ff5c25e7c5dd87eccf81c249319bffbb06dd3"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/AT-MRFTA-19-39.pdf1.png",
|
||||
"sha256": "d0f4118a696ab940d2fd9a9cb792656dcba860b9b3a300c78334445d43d46a72"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/AT-MRFTA-19-39.pdf2.png",
|
||||
"sha256": "449ce541e08d886e7851e04c6b53ee44694d89508143da3c497d16db1a3f6a59"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/build.txt",
|
||||
"sha256": "ede4498073edeeadcbda9b1868b4be5574ad31a36d78664a1ebf8fb27ee89c86"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/calculated.json",
|
||||
"sha256": "b41a7dec0802a573d67f8e9b0ba42e54c4a20e935e844febd538752605d3446f"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/Decreto-9-2008-BR16.pdf6.png",
|
||||
"sha256": "ae8f0d02c2c01fafd1f390492ecf442defa094edd5612923c5f34b458f6c6392"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/Decreto-9-2008-BR16.pdf8.png",
|
||||
"sha256": "6097b3137f22a59c55cf1017643e0be4c0d6ba571e1d3c84331940988a4967b7"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/dossier.html",
|
||||
"sha256": "743a1960b2b70dfd4e5231f37bbf0799184f8f9d39c58c7569f66852ad1e3db5"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/dossier.json",
|
||||
"sha256": "864a2c9da690b086a2aa7c10ae18549d7d462f43a6f87826e6b1f57d8751e5c0"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/dossier.txt",
|
||||
"sha256": "a0473de355821758c4d320eea8e7af76a0d196a9cee652c71af723d6f69832f0"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/frontend.txt",
|
||||
"sha256": "707ef1a9c37fbeb53997027c1aff5c3a85c3358e40b3ed63512ddf93ded74b7a"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/index.html",
|
||||
"sha256": "6bb76e37ac20a73cb9ffcda14f1ac9db701aa01bc2ef2f62fc5adaaffb640ca8"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/preparation.html",
|
||||
"sha256": "c8855ab0bcbaa85e95149ca36d1b035b59a21760d3336c088b552c147eafc330"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/recovered.json",
|
||||
"sha256": "f7ef8221ad1ffba237f683eb2333e4bde8b076e00a459c131f8c81c96c3048f5"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/types.txt",
|
||||
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/ui-export.html",
|
||||
"sha256": "c8855ab0bcbaa85e95149ca36d1b035b59a21760d3336c088b552c147eafc330"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/ui-proof.json",
|
||||
"sha256": "9d41f8a7f48e0a1f611bd0916e58e9dc6ffaa9760b281f056edbe2ccde115777"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/ui.png",
|
||||
"sha256": "ee9e6f5240d1f0b58569609bdb6c0c38a3cd11373db7b6ad0008b15fb229afad"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/ui.txt",
|
||||
"sha256": "59df712c7a7873532c4eab94fb582fd1e470803a5da1bfd68c884f8e8ad2386b"
|
||||
}
|
||||
],
|
||||
"packet_bundle": "outputs/irpc-mrfta-prepared-delivery-20261025/candidate.bundle",
|
||||
"packet_QA_receipt": "outputs/irpc-mrfta-prepared-delivery-20261025/accepted-proofs/qa-receipt.json"
|
||||
}
|
||||
@@ -0,0 +1,623 @@
|
||||
{
|
||||
"status": "installed_scoped_grouped_IRPC_L5_delta_verified",
|
||||
"authorization": "Tempo:installgroupedIRPCL5viaGit,freshbackup/restoreanddeltaverification;preserveL3/ISPC/FX;eachcalculationidentifiescategory/rate/definitiveorontaxaccount.",
|
||||
"candidate_installed": "2b33a1c343d192f80fb24aac2a27b2d375af5601",
|
||||
"requested_candidate_included": "4d6f8282302c7646bd7350b8d67695d005feab9a",
|
||||
"previous_installed": "5c0cb25cea7826811c389b55a64bcdf5e43b937f",
|
||||
"presentation_only_followup": {
|
||||
"status": "directed_presentation_delta_passed",
|
||||
"base": "4d6f8282302c7646bd7350b8d67695d005feab9a",
|
||||
"authorization": "Tempo:each calculation identifiesincomeclassification,rateanddefinitive/onaccountnature.",
|
||||
"changed_runtime": "resources/js/lib/irpc-withholdings.ts",
|
||||
"sha256_LF": "919a6b7427fcbf67976797358dde0d02a3aba1121bb827b17280b13c0ddc3bd4",
|
||||
"arithmetic_input_persistence_logic_changed": false,
|
||||
"verification": {
|
||||
"presentation": "1newdirectedtest;all6savedcases showcategory/rate/nature inPortuguese;frozendataunchanged",
|
||||
"affected_export": "1existingexportcase;obsoleteEnglishlabelassertionupdated",
|
||||
"types": "exit0",
|
||||
"build": "exit0"
|
||||
},
|
||||
"proof_hashes": {
|
||||
"presentation.txt": "7b348f1e6d64ac0e5cab732175e69fa32154db504e7781c028ced14ec703aaf8",
|
||||
"export-presentation.txt": "54ada0166f309a216fdbc294bcee98283392b09a2d20a6b2718f2584fb78a133",
|
||||
"types.txt": "5346ac8a6566c1c38cb0bbda6a029579df58cd78af78e2c4845d9c82b5d1d76c",
|
||||
"build.txt": "2291bfc0b02957632c92a3a39215c35931a469eba4548473db4de26135468eed"
|
||||
},
|
||||
"other_accepted_proofs": "Reused;no new calculationround.",
|
||||
"active_changes": false
|
||||
},
|
||||
"fresh_backup": {
|
||||
"stage": "/var/backups/investmoz-irpc-l5-delivery-20261025/backup",
|
||||
"created_at": "2026-10-25T17:22:27Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "8188b1e8ec5a9a360ba753bae3d4d5f0889cd51a0d4b7bd5817b909cd040dd8a",
|
||||
"files_sha256": "b68334e7426f250c5822d7d84c57b899a224a0bcc3e81378c7b335ad29119ef8",
|
||||
"restore_verified": false
|
||||
},
|
||||
"isolated_restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "irpc_l5_restore_20261025",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "8188b1e8ec5a9a360ba753bae3d4d5f0889cd51a0d4b7bd5817b909cd040dd8a",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"authenticated_preflight": {
|
||||
"free_bytes": 6629892096,
|
||||
"existing_pipeline_minimum_bytes": 5368709120,
|
||||
"space_guard_satisfied": true,
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "5c0cb25cea7826811c389b55a64bcdf5e43b937f",
|
||||
"release": "/var/www/investmoz-homologacao/releases/5c0cb25cea7826811c389b55a64bcdf5e43b937f-32c4fd00",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6af7092e83b9b3932712aa7a9f527393fcec4da8-647c8e2e",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/5c0cb25cea7826811c389b55a64bcdf5e43b937f-32c4fd00",
|
||||
"release_revision": {
|
||||
"commit": "5c0cb25cea7826811c389b55a64bcdf5e43b937f",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-25T16:24:27.707113+00:00",
|
||||
"manifest_sha256": "385a289f9ba26a632aa0164fbba3913cc8dc2fb891641881fc8d2dcda1951626"
|
||||
},
|
||||
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"configuration_keys": [
|
||||
"repository",
|
||||
"branch",
|
||||
"target_url",
|
||||
"legacy_root",
|
||||
"state_root",
|
||||
"release_root",
|
||||
"current_link",
|
||||
"shared_assets",
|
||||
"php",
|
||||
"schema_contract",
|
||||
"ci_environment",
|
||||
"postgis_image",
|
||||
"test_database",
|
||||
"qa_port",
|
||||
"retention",
|
||||
"webhook_secret_file"
|
||||
],
|
||||
"safe_paths": {
|
||||
"repository": "nala/Investidor-V2",
|
||||
"release_root": "/var/www/investmoz-homologacao/releases",
|
||||
"postgis_image": "postgis/postgis@sha256:01a6a70e41e6c4467c8f55f6063555ed72db2d6662cd0d571040d42eadaeb6f6"
|
||||
},
|
||||
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604"
|
||||
},
|
||||
"installed_protected_delta": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "2b33a1c343d192f80fb24aac2a27b2d375af5601",
|
||||
"release": "/var/www/investmoz-homologacao/releases/2b33a1c343d192f80fb24aac2a27b2d375af5601-23fd8416",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/5c0cb25cea7826811c389b55a64bcdf5e43b937f-32c4fd00",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"runtime_files_verified": 5,
|
||||
"preserved_L3_ISPC_FX_runtime_files_verified": 26,
|
||||
"documentary_files_verified": 27,
|
||||
"persistent_files_and_env_verified": 369,
|
||||
"tables_compared": 174,
|
||||
"changed_tables": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 106,
|
||||
"checksum": "0a671fc2cb099fd27499646ebb94d27a"
|
||||
},
|
||||
"after": {
|
||||
"rows": 106,
|
||||
"checksum": "fe403cc7b0405832070ec0c04bf3d12d"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 12,
|
||||
"checksum": "ceeca5de9479af1ad2f8dd58d0fdbc32"
|
||||
},
|
||||
"after": {
|
||||
"rows": 13,
|
||||
"checksum": "da9b1fbe0c5de15db41fdb33532693b5"
|
||||
}
|
||||
}
|
||||
},
|
||||
"preserved_counts": {
|
||||
"published_fiches": 29,
|
||||
"relations": 28,
|
||||
"geometries": 408
|
||||
},
|
||||
"migration_count": 0,
|
||||
"content_imports": 0,
|
||||
"comparison_role": "postgres_before_and_after;sameexportedsnapshotbaseline;noapplicationRLSvisibilityinference",
|
||||
"writes_by_verification": 0
|
||||
},
|
||||
"schema_permissions_comparison": {
|
||||
"schema_sha256": "5045b3e51d2185377aa3d9ac7fa07a44fad3ec620cdfa83ffe31c8884ee1601d",
|
||||
"roles_grants_sha256": "1530c33cb016e67bfdc64891ddfce7f185b13b56b2cd87c012871a685e118109",
|
||||
"filesystem_permissions": {
|
||||
".env": {
|
||||
"mode": 416,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage/app": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"bootstrap/cache": {
|
||||
"mode": 1528,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
}
|
||||
},
|
||||
"comparison_identity": "postgres;catalogue read only;no passwords collected",
|
||||
"unchanged": true
|
||||
},
|
||||
"installed_public": {
|
||||
"status": "installed_delta_verified",
|
||||
"served_revision": {
|
||||
"commit": "2b33a1c343d192f80fb24aac2a27b2d375af5601",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-25T17:27:10.176918+00:00",
|
||||
"manifest_sha256": "75b06330161a813a10e3eb3a044e2ba4a924537dae381f97d0c8d4ee7295295a"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"Calcular e guardar retenções IRPC": [
|
||||
"assets/services-C27l7hHG.js"
|
||||
],
|
||||
"Base do rendimento/conversão por resolver:": [
|
||||
"assets/project-dossier-DK8thPzJ.js"
|
||||
],
|
||||
"Retenção liberatória20%62(3)a/b": [
|
||||
"assets/project-dossier-DK8thPzJ.js"
|
||||
],
|
||||
"Reutilizar selecção cambial": [
|
||||
"assets/services-C27l7hHG.js"
|
||||
],
|
||||
"Calcular e guardar apuramento trimestral ISPC": [
|
||||
"assets/services-C27l7hHG.js"
|
||||
],
|
||||
"Calcular e guardar restituição E": [
|
||||
"assets/services-C27l7hHG.js"
|
||||
],
|
||||
"Retenção definitiva": [
|
||||
"assets/project-dossier-DK8thPzJ.js"
|
||||
],
|
||||
"Imposto por conta (sem crédito anual automático)": [
|
||||
"assets/project-dossier-DK8thPzJ.js"
|
||||
],
|
||||
"enquadramento: ": [
|
||||
"assets/project-dossier-DK8thPzJ.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/project-dossier-DK8thPzJ.js",
|
||||
"status": 200,
|
||||
"sha256": "66455ee000d25e9fd96782dbe8f3d107ce416bc3723183058c2b052a75303e55"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-juCZO5Hz.js",
|
||||
"status": 200,
|
||||
"sha256": "78a76cdb8b46a32cfcb1e902cf2637f5511a5e621ab683386ec97be1a36f26ab"
|
||||
},
|
||||
{
|
||||
"file": "assets/simulation-form-BqVD91Ek.js",
|
||||
"status": 200,
|
||||
"sha256": "85cbd533c5bc92af5a448db71da006d4346d2d0adb09dde825db0aa19ad5048c"
|
||||
},
|
||||
{
|
||||
"file": "assets/services-C27l7hHG.js",
|
||||
"status": 200,
|
||||
"sha256": "8207e29d68f619f137715f7677ff5e190365805118d98403e1e9b6c27821816b"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-BfSW9Uvj.js",
|
||||
"existing_fiscal_availability": {
|
||||
"data": {
|
||||
"enabled": true,
|
||||
"coverage_start": "2026-01-01",
|
||||
"coverage_end": "2026-12-31",
|
||||
"message": "IVA geral sobre base líquida disponível; enquadramento declarado."
|
||||
}
|
||||
},
|
||||
"synthetic_private_writes": 0,
|
||||
"method": "Read-only installedrevision/manifest/newcompiledcatalogueandreaders/simulatorentry;acceptedQAproofsreused"
|
||||
},
|
||||
"operational_delta": {
|
||||
"status": "operational_delta_reconciled",
|
||||
"comparison_identity": "postgres before/after;isolated restored baseline;no RLS visibility inference",
|
||||
"cache": "queue:restart value/expiry and request-throttle counter/timer pair;no deleted cache rows",
|
||||
"sessions": "anonymous sessions created by exact delivery verification user-agent",
|
||||
"delta": {
|
||||
"cache": {
|
||||
"before_rows": 106,
|
||||
"after_rows": 106,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "8d6ea77eb4b34d86d207362d583cfa8bf2880b907becd9b00398964482c6b4bd",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-{hash}",
|
||||
"is_queue_restart_key": false,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "2f251473865d14b953236ab95b1521764754d76abd79b58ca7d38c96dfe2fab1",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"value",
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-{hash}:timer",
|
||||
"is_queue_restart_key": false,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "7f7dd83f47f5bf404d55e6e9f1367948721579970b195680645e356031a070ff",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"value",
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-illuminate:queue:restart",
|
||||
"is_queue_restart_key": true,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"before_rows": 12,
|
||||
"after_rows": 15,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "370587fb3e7cb81ea94832777824ec2cad58ba6d70670382bd967b547042e232",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "990a42e080b187697530e7d3369c7f45001e10fc3035c05294b129c0a4473fa6",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "16650201f4d075fad4b3c2fe786db34ef5d27c3b0f85e7a697c25f69fc3bb307",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"business_tables_to_confirm_separately": 172,
|
||||
"active_data_writes_by_comparison": 0,
|
||||
"restore_network": "none"
|
||||
},
|
||||
"pipeline_status": {
|
||||
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "2b33a1c343d192f80fb24aac2a27b2d375af5601",
|
||||
"release": "/var/www/investmoz-homologacao/releases/2b33a1c343d192f80fb24aac2a27b2d375af5601-23fd8416",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/5c0cb25cea7826811c389b55a64bcdf5e43b937f-32c4fd00",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "2b33a1c343d192f80fb24aac2a27b2d375af5601",
|
||||
"release": "/var/www/investmoz-homologacao/releases/2b33a1c343d192f80fb24aac2a27b2d375af5601-23fd8416",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/5c0cb25cea7826811c389b55a64bcdf5e43b937f-32c4fd00",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"2b33a1c343d192f80fb24aac2a27b2d375af5601"
|
||||
],
|
||||
"finished_at": "2026-10-25T17:27:13.229147+00:00"
|
||||
},
|
||||
"log_file": "1792949039569584370.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 29.86s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 838",
|
||||
"# pass 838",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 241081
|
||||
},
|
||||
"archived_old_build_dependencies": {
|
||||
"status": "dependencies_archived_and_verified",
|
||||
"versions": 5,
|
||||
"free_before": 5315416064,
|
||||
"free_after": 6630199296,
|
||||
"receipt": "/var/backups/investmoz-build-dependencies-irpc-l5-20261025/receipt.json",
|
||||
"protected": [
|
||||
"/var/www/investmoz-homologacao/releases/5c0cb25cea7826811c389b55a64bcdf5e43b937f-32c4fd00",
|
||||
"/var/www/investmoz-homologacao/releases/6af7092e83b9b3932712aa7a9f527393fcec4da8-647c8e2e"
|
||||
],
|
||||
"active_or_previous_release_modified": false,
|
||||
"source_data_backups_deleted": 0
|
||||
},
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/irpc-withholdings.ts",
|
||||
"sha256_LF": "919a6b7427fcbf67976797358dde0d02a3aba1121bb827b17280b13c0ddc3bd4"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-withholdings.tsx",
|
||||
"sha256_LF": "5cffcc26c72ed736e88386589710cf7929ec9bc25f78910648ba676fb1cf4b08"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-fx.ts",
|
||||
"sha256_LF": "5c4a7a477429f8d775acf6db3e117008468f5554e5731dec81f60fbb75e948fb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-form.tsx",
|
||||
"sha256_LF": "01d20f4761933a3e4dd7c776bd4adcf9610ac0435d918a1998ae9f0c3ce3f234"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "df8b224b9472449711d0b69a873fa75f9cc9f4d84dce1a314fc576fae9c6eae2"
|
||||
}
|
||||
],
|
||||
"preserved_runtime": [
|
||||
{
|
||||
"path": "resources/js/components/acquisition-beverage-restitution.tsx",
|
||||
"sha256": "6f44897b8b12569314551df0022c26da57a165634087942a724293e66837558d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/fiscal-calculation-gaps.tsx",
|
||||
"sha256": "1dab6ceb73756d4e023096b3b2ba767aaa843ff6cc69046ea630ab449a00b0dd"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/fiscal-l3-preparation.tsx",
|
||||
"sha256": "e84a7b1ccadaa1b5bd78d778a3287f96ccaf530855eef404786cd7aa3d321b73"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-acquisitions.tsx",
|
||||
"sha256": "c206d4cfe575d6ba007aa2b425b5f898efa97e4162b8710e358b6ecfd9458542"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-operations.tsx",
|
||||
"sha256": "a7e55972fa790063dcf11945055de2af46a77db9e509900af22ede7ec47bb4cf"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-acquisition-bc.ts",
|
||||
"sha256": "b0ef55e0917bdb79f14b53ba9e95d73c08153befeb7d4ce73f81e6fb13992225"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-beverage-allocation.ts",
|
||||
"sha256": "32968d198c7fe0c53ca89641c22d5749be6636be2c79127b867e4e3afd0dd40d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-beverage-restitution.ts",
|
||||
"sha256": "5c650cbd9469d5f99001f56fc4ff99ac973eb368036d4e96c6d171f1b220bd9e"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-calculation-gaps.ts",
|
||||
"sha256": "2e7d84a0c196bd5b56fd67cc1a389d43d5041894184e675680a4de3cd10b31a2"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-operations.ts",
|
||||
"sha256": "ec37b949f1233c5f5c14a87450c421ed29fabf1ed5b73fb32564564a2bc31f54"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/l3-form-preparation.ts",
|
||||
"sha256": "fc47f5fa5ec1420fbd847d0d081f00d99ebbb524164eef785b20877e0562f704"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-residuals.ts",
|
||||
"sha256": "40d5751c06c7c155ab4b7a17ee2d1653da2fbbf075807fbb8561cdbe19820955"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-residuals.tsx",
|
||||
"sha256": "a9219d6f41ccbd0ce45659d4f6aa0fa1c169a685840f5cb1e18daeca377d5e18"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-eligibility.ts",
|
||||
"sha256": "44675c5efacdc1ae19505667611ba3b522d3043cebacc8754597c3a68ca89d25"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-quarter.tsx",
|
||||
"sha256": "2c2555309b32d4261f14e7164f39314c9188129c2990357fc54090a2468dd2b4"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-withholding.tsx",
|
||||
"sha256": "e0445d015b72859e48726959aa52686f79b1cf5c2ade29751efa83257068b878"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-quarter.ts",
|
||||
"sha256": "f66bd52e9cdfe1ddaa6b00a931465862b3d890b9be216b7a056740f027f24129"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-withholding.ts",
|
||||
"sha256": "6c31b240299edd3262efa28f7f3d5aee21123f94e30ef4ab90e26c35777cb6e4"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-eligibility.tsx",
|
||||
"sha256": "f48dd4a8f87a994eda0447f81a463589905e5873b2e1044debac9d10825a880c"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-acquisitions.ts",
|
||||
"sha256": "cce283b1d0a07fb383fcb527225f4dd5bec829010a662cbaae1d60e595221977"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-modelo-a.ts",
|
||||
"sha256": "c641619a05613c1620385baad0e9ffbf810dd970aafb30e12b3a7f9a3bf11846"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier-report.ts",
|
||||
"sha256": "0db9f5fcb2929fd8340894bd13b74ee7c400af25e483ddfe5651002fd7160f49"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-fx-selection.ts",
|
||||
"sha256": "9aa07ad443bc777b80510a3b5bd6aff9ddb9814d2450f3c690e531e74d71d998"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-fx-selection.tsx",
|
||||
"sha256": "39bb6d87d404745b0b66349bc11626545a3672ae27321ce9b4658416592059bf"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/business-financial-plan.ts",
|
||||
"sha256": "c20274722d1ffcd0360f041a6cacb5d868fe0621cb27a1aca6e06826612c3ebb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-currency-events.ts",
|
||||
"sha256": "cc9f2045d302d7987310da4006cc250fc5c99a27397918d166d649bfc32fab08"
|
||||
}
|
||||
],
|
||||
"existing_FX_files_unchanged": {
|
||||
"resources/js/lib/iva-fx-selection.ts": "9aa07ad443bc777b80510a3b5bd6aff9ddb9814d2450f3c690e531e74d71d998",
|
||||
"resources/js/components/simulation-fx-selection.tsx": "39bb6d87d404745b0b66349bc11626545a3672ae27321ce9b4658416592059bf",
|
||||
"resources/js/lib/business-financial-plan.ts": "c20274722d1ffcd0360f041a6cacb5d868fe0621cb27a1aca6e06826612c3ebb",
|
||||
"resources/js/lib/iva-currency-events.ts": "cc9f2045d302d7987310da4006cc250fc5c99a27397918d166d649bfc32fab08"
|
||||
},
|
||||
"accepted_QA_proofs_reused": {
|
||||
"new_frontend_distinct": 19,
|
||||
"frontend_proofs": [
|
||||
"frontend.txt:17pass;listedcapitalcase superseded bydirectedcapital",
|
||||
"directed-capital.txt:updatedcapitalcase+1newcasepass",
|
||||
"directed-report.txt:3affectedreportcasespass",
|
||||
"directed-fx-origin.txt:1newcasepass"
|
||||
],
|
||||
"API": "1test/34assertions;loopback55441/simulator_fiscal_delta_20261021_test;DatabaseTransactionsrollback;acceptedhistory/oldmaps preserved",
|
||||
"types": "types-final.txt:exit0",
|
||||
"build": "build-final.txt:exit0",
|
||||
"UI": "ActualexistingFXpreview/confirmationinsideIRPC,calculation/save/recover/report/export;localfileharness distinguishedfromprivateAPI",
|
||||
"unaffected_old_functional_suites_repeated": false
|
||||
},
|
||||
"manual_calculation_round_repeated": false,
|
||||
"pipeline_checks": "MandatoryexistingGitpipelineonly;presentationdirectedcase/affectedexportcheckedwithoutrecalculatingacceptedbooks.",
|
||||
"available": [
|
||||
"Scopedordinary20% andspecial10%IRPCwithholdings,includingpreviousda0d8abb/4d6f8282cases.",
|
||||
"Eachcalculation/report identifiesincomeclassification,appliedrate,andRetenção definitiva orImposto por conta;indeterminatecasesremainexplicit.",
|
||||
"ExistingFXselectorandconversionreusedwithoutchange;originalamount/currency,bulletin,column,date/direction andhistorypreserved.",
|
||||
"Counterparty/document/paymentreuse,partialsettlement/foreignwithholdingproofreconciliation,privatepersistence/recovery/report/preparationexport."
|
||||
],
|
||||
"remaining_calculations_and_mapping": [
|
||||
{
|
||||
"item": "Dispensas68 e casos residentes/EP dependentes",
|
||||
"data_needed": "Titular/operação e condições de68(a/b/c/d/f/g),incluindo gestão de imóveis próprios/transparência,participações e tipos de juros;casos digitais residentes/EP confrontados com62(5)/68(d).",
|
||||
"resolution": "Ramo específico por dispensa/factos;não bloquear royalties comuns,retenções definitivas ou especiais independentes."
|
||||
},
|
||||
{
|
||||
"item": "Convenções/benefícios invocados",
|
||||
"data_needed": "País/convenção/artigo,beneficiário,residência,condições/período e prova invocados",
|
||||
"resolution": "Só esse caso fica indeterminado;sem taxa reduzida presumida."
|
||||
},
|
||||
{
|
||||
"item": "Outros rendimentos/devedores/períodos",
|
||||
"data_needed": "Artigo próprio para categorias fora dos ramos agrupados,via devedorIRPS,anos fora2026,EP de categorias especiais62(4)quando não cabe62(2)",
|
||||
"resolution": "Não aplicar20%ou10%genéricos;avançar os casos compatíveis."
|
||||
},
|
||||
{
|
||||
"item": "Juros,rectificações e arredondamento de entrega",
|
||||
"data_needed": "Regra/taxa/base/período dejuros,declaração/guia anterior,documentos de correcção e regra de arredondamento legal da entrega se aplicável",
|
||||
"resolution": "Aritmética exacta preservada;aproximação assinalada;sem zero dejuros ou crédito anual automático."
|
||||
},
|
||||
{
|
||||
"item": "EntregaAT com comprovativo em moeda estrangeira",
|
||||
"data_needed": "MontanteMZN efectivamente entregue no comprovativo;conversão do pagamento ao beneficiário não prova entregaIRPC",
|
||||
"resolution": "Base e comprovativo de retenção sofrida já convertem pelo mecanismo entregue;esta limitação não reabre o câmbio geral."
|
||||
}
|
||||
],
|
||||
"external_formalities": [
|
||||
{
|
||||
"item": "MRFTA/CER e remissão67(7)",
|
||||
"data_needed": "Correspondência concreta de rubricas/CER para novos casos;67(7)refere62(6),nova taxaestá62(5);manteroriginal",
|
||||
"resolution": "Preparação/exportação disponível;sem adivinhar código,assinatura ou submissão."
|
||||
},
|
||||
{
|
||||
"item": "ActosAT",
|
||||
"data_needed": "Submissão,recepção,aceitação e eventuais comprovativos externos",
|
||||
"resolution": "Externos;exportar não executa nem certifica esses actos."
|
||||
}
|
||||
],
|
||||
"external_AT_acts": "Exportdoesnotconstitutesubmission,receipt,acceptanceorpaymentAT.",
|
||||
"L5_integrally_completed": false,
|
||||
"IRPC_integrally_completed": false,
|
||||
"IRPS_integrally_completed": false,
|
||||
"schema_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"L3_ISPC": "Preserved;residualsremaininexistingmatrixandaffectonlydependentcases.",
|
||||
"preserved_L3_amounts_MZN": {
|
||||
"documentary": 16,
|
||||
"deduction_this_route": 0,
|
||||
"recognised": 12,
|
||||
"received": 7,
|
||||
"awaiting": 5
|
||||
},
|
||||
"P001_P058": "nonblocking",
|
||||
"P084_P085": "closed",
|
||||
"statistics_AI": "deferred",
|
||||
"proof_hashes": {
|
||||
"outputs/irpc-l5-delivery-20261025/backup.txt": "b7ccc1c494bde77d5dc78e659f778e1bd41bf446b3f26c3d03af4d54d978f1a5",
|
||||
"outputs/irpc-l5-delivery-20261025/build.txt": "2291bfc0b02957632c92a3a39215c35931a469eba4548473db4de26135468eed",
|
||||
"outputs/irpc-l5-delivery-20261025/compact-dependencies.txt": "f90ae404c35fbe1f0f765286a33577f360ed86d116bc34a00fa4436dca08b4ed",
|
||||
"outputs/irpc-l5-delivery-20261025/export-presentation.txt": "54ada0166f309a216fdbc294bcee98283392b09a2d20a6b2718f2584fb78a133",
|
||||
"outputs/irpc-l5-delivery-20261025/installed-protected.txt": "fb7626c4ef893bf66ab224d2d7624be46e09268d34b3a81847edd34b0bbdc7b9",
|
||||
"outputs/irpc-l5-delivery-20261025/installed-public-delta.json": "d3e4ece297fc71283f3668634ba383fa09bc3ef2294a1028b1bcca7d2e1748ba",
|
||||
"outputs/irpc-l5-delivery-20261025/installed-public.txt": "57a024376eed270ffc1a571bbe9289a35ddfb9dc5e91439dcf8dcbb6010c2759",
|
||||
"outputs/irpc-l5-delivery-20261025/integration.txt": "acf26ab3ede3c8758bd71cabf0ebf748f65c223cb951f6929bad373003948b6b",
|
||||
"outputs/irpc-l5-delivery-20261025/manifest-served.json": "75b06330161a813a10e3eb3a044e2ba4a924537dae381f97d0c8d4ee7295295a",
|
||||
"outputs/irpc-l5-delivery-20261025/operational-delta.txt": "f4a40a229690907529993ec919a231d20fbdbaf161106609678b32c65a49ffbb",
|
||||
"outputs/irpc-l5-delivery-20261025/preflight.txt": "e8d298fc21f9cba4318312d9088efa48ad416e2da494df83109334b45389c832",
|
||||
"outputs/irpc-l5-delivery-20261025/preparation.json": "bd7109cd9df71382b5cd2108d564d6f3af0249408153b71d6de5caf39373fe1e",
|
||||
"outputs/irpc-l5-delivery-20261025/presentation.txt": "7b348f1e6d64ac0e5cab732175e69fa32154db504e7781c028ced14ec703aaf8",
|
||||
"outputs/irpc-l5-delivery-20261025/restore.txt": "98bcaebbaf8d1d4b077b225d577efc992ac5a5ffa1ca023d6eb204590b0d6f83",
|
||||
"outputs/irpc-l5-delivery-20261025/schema-permissions-after.txt": "76b5a4d8af11e4898a205062766cfb7ab6ec0783200e77e60a1927aa1ca18597",
|
||||
"outputs/irpc-l5-delivery-20261025/schema-permissions-before.txt": "0ab7c964792acdd8917bce256c472e55e034b103500a58b49f020b5084823ed7",
|
||||
"outputs/irpc-l5-delivery-20261025/status-final.txt": "f13c611d4b12d16701ecc42f601e34c7917d4a8af643658d98929f8e724404a2",
|
||||
"outputs/irpc-l5-delivery-20261025/status1.txt": "3f0db035a0d53507176ff8af6f9361c813fe0f64975c61f91ea48a6b53ab5ea5",
|
||||
"outputs/irpc-l5-delivery-20261025/status2.txt": "2ead5f8ca6cf55b5e0b4df0a63a15d1dc0f5c9fa11e95fbf98a3e55086924ef8",
|
||||
"outputs/irpc-l5-delivery-20261025/status3.txt": "1d77e6eb46f84cf0b048462eae12dd5618a1cf143a4667073613fc2a834ccf53",
|
||||
"outputs/irpc-l5-delivery-20261025/status4.txt": "1d77e6eb46f84cf0b048462eae12dd5618a1cf143a4667073613fc2a834ccf53",
|
||||
"outputs/irpc-l5-delivery-20261025/status5.txt": "f13c611d4b12d16701ecc42f601e34c7917d4a8af643658d98929f8e724404a2",
|
||||
"outputs/irpc-l5-delivery-20261025/types.txt": "5346ac8a6566c1c38cb0bbda6a029579df58cd78af78e2c4845d9c82b5d1d76c"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
{
|
||||
"status": "installed_scoped_IRPC_L5",
|
||||
"candidate": "4d6f8282302c7646bd7350b8d67695d005feab9a",
|
||||
"installed_baseline": "5c0cb25cea7826811c389b55a64bcdf5e43b937f",
|
||||
"branch": "codex/irpc-l5-withholdings-qa-20261025",
|
||||
"includes_first_QA": "da0d8abb4775a7a68142f84129e312b86dadfe23",
|
||||
"scope_receipt": "irpc-l5-grouped-qa-20261025.json",
|
||||
"authorization": "Tempo:agrupar restantes enquadramentos compatíveis,reutilizar contrapartes/documentos/pagamentos e câmbio entregue;preparar entrega conjunta;manterportal5c/L3/ISPC;sem instalar este incremento.",
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/irpc-withholdings.ts",
|
||||
"sha256_LF": "f10d82f1bf353b1a92c37790b213fad9e769ed39139a99577747ee703be63b49"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-withholdings.tsx",
|
||||
"sha256_LF": "5cffcc26c72ed736e88386589710cf7929ec9bc25f78910648ba676fb1cf4b08"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-fx.ts",
|
||||
"sha256_LF": "5c4a7a477429f8d775acf6db3e117008468f5554e5731dec81f60fbb75e948fb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-form.tsx",
|
||||
"sha256_LF": "01d20f4761933a3e4dd7c776bd4adcf9610ac0435d918a1998ae9f0c3ce3f234"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "df8b224b9472449711d0b69a873fa75f9cc9f4d84dce1a314fc576fae9c6eae2"
|
||||
}
|
||||
],
|
||||
"documentary_delta": [
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Comunicado-9-2026-ISPC.pdf",
|
||||
"sha256": "106f8a9ce9255c03549c70bf07fe999d32e6e55302d009b509862aa74ccb4973"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Modelo-30-ISPC.pdf",
|
||||
"sha256": "6802edd06b6ff638a0b851a3ec7ecf69af8f07840faa47446becad67d35d445c"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Modelo-B-Geral.pdf",
|
||||
"sha256": "bd977c7c59d4d98befd92e2c566b1bf168cb1343bb519f51b41a3807f431fc57"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-MRFTA-19-39.pdf",
|
||||
"sha256": "8ea62c53066b482f87078a7a7b1ecf15ca98a12a122e8d7abca63acfc993186b"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-16-I-Serie-2008-04-16.pdf",
|
||||
"sha256": "fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-248-I-Suplemento-1-2025.pdf",
|
||||
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-89-I-Serie-2017-06-08.pdf",
|
||||
"sha256": "11f0cab15eb6e51010952203ffa24fdc533a24fd642e19525fe4f46b17a1f5e5"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-95-I-Suplemento-2025-05-21.pdf",
|
||||
"sha256": "e0e682e2c027c3cd9c1d46a73a3f48bc5f6bdbf05667fd97314d7a3f6a456358"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR252-I-Serie-2022-Lei20-PESOE.pdf",
|
||||
"sha256": "1159fd3ce1ba5581671796d083534da48bd3c5578298819e896f1c2a8026318d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-22-2021-BR70.pdf",
|
||||
"sha256": "a8fac38dcfe08f9c7a8e46254cff10e1ec82fc4f7a8d88ad6e4fe7d91ffc21a5"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-27-2026-BR123.pdf",
|
||||
"sha256": "26249c3fa58f149c81de36e99d1aac2819a4771379d9e8833159660dabf539bb"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-29-1998-BR22-5-suplemento.pdf",
|
||||
"sha256": "6242cbe675faadf085f43f95ec8c7e8868aafe67c3b2ab2bb010992288f954f8"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-3-2011-BR-11-I-mineiros.pdf",
|
||||
"sha256": "5bca1133666ba9c69870b89823420175b7b5b8d0eccb667ecdf5c29716f3b6be"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-37-2023-BR124.pdf",
|
||||
"sha256": "7e680b191481faa0e2e9057fa5053587eb2a29d1d8c819e0eb9f02814255a04c"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-9-2008-BR16.pdf",
|
||||
"sha256": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-13-2016-CIVA-BR-156-10-suplemento.pdf",
|
||||
"sha256": "b90dc7c14ecea2e378c4a62e8e5a47d54a5644c457baeb8b8053b92fd2a5710b"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-14-1992-BR42.pdf",
|
||||
"sha256": "089fff7423e99a70a230a73ca379e4ea3a91d124703f91016e57ff82794b9e56"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-17-2022-BR251-exemplar-MCNet5.pdf",
|
||||
"sha256": "14eb34f0af91a8f5cb1770c7b52d6ff839c6818302d1ed96d79afbfb9fe999d4"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-17-2022-IPP-BR250-Parlamento.pdf",
|
||||
"sha256": "978cd22403ffd336a631704ecd7a5bbd814a427c815b9acdaca5515591dd9e2a"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2013-BR76.pdf",
|
||||
"sha256": "bba96d645cc935ffc3d1a79b9f0f73ac1c693d6459c2ad41f56cd2841accae76"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2017-IRPS-BR-OCAM.pdf",
|
||||
"sha256": "c3a0186cb9ad090d7a9533006295dc9bb6a62ad0d6150173cbd49dba4ee4b52d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-2-2011-BR-1-4-suplemento-MCNet.pdf",
|
||||
"sha256": "a7543a68cc3287a46a83c39a04821b40f649dd06c4e9b5dc51ff0b47fba08899"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-22-2022-IVA-republicada-BR-250-2-suplemento.pdf",
|
||||
"sha256": "ea1b0dc6f5cf6e595f6d9a19e7042f398999e0087caef1785f6e8fac571b5f53"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-34-2007-BR52.pdf",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-1994-BR37-3-suplemento.pdf",
|
||||
"sha256": "210df9db8980d0a5690cd187a6eeec7e37a900d743e39062c16f4e0d12215c7e"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-2012-BR3.pdf",
|
||||
"sha256": "b8845cef41dcbd9ba50c43dbfa743a56030dd3d348242a107e1ae30279eec121"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-7-1991-Partidos-IFES.pdf",
|
||||
"sha256": "6b783a0bb3330688ef10660a58060d9724aa2da6a873d234fe902f0eaaeda42d"
|
||||
}
|
||||
],
|
||||
"existing_FX_files_unchanged": {
|
||||
"resources/js/lib/iva-fx-selection.ts": "9aa07ad443bc777b80510a3b5bd6aff9ddb9814d2450f3c690e531e74d71d998",
|
||||
"resources/js/components/simulation-fx-selection.tsx": "39bb6d87d404745b0b66349bc11626545a3672ae27321ce9b4658416592059bf",
|
||||
"resources/js/lib/business-financial-plan.ts": "c20274722d1ffcd0360f041a6cacb5d868fe0621cb27a1aca6e06826612c3ebb",
|
||||
"resources/js/lib/iva-currency-events.ts": "cc9f2045d302d7987310da4006cc250fc5c99a27397918d166d649bfc32fab08"
|
||||
},
|
||||
"accepted_previous_proofs_reused": {
|
||||
"new_frontend_distinct": 17,
|
||||
"frontend": "frontend.txt:16pass;directed-cross-context.txt:1pass",
|
||||
"API": "1test/23assertions;guardedloopback55441/simulator_fiscal_delta_20261021_test;DatabaseTransactionsrollback;allpreviousL3/ISPCmapsidentical",
|
||||
"types": "types-final.txt:exit0",
|
||||
"build": "build-final.txt:exit0",
|
||||
"UI": "Actualcomponent calculation/save/recover/report andexport;localfileharness distinguishedfromprivateAPI;reuse existingacquisition at373 demonstrated;UI proof reused for unchanged positive route after final shared-payment-key refinement;directed test proves only that delta",
|
||||
"previous_functional_suites_repeated": false
|
||||
},
|
||||
"additional_proofs": {
|
||||
"new_frontend_distinct": 19,
|
||||
"frontend_proofs": [
|
||||
"frontend.txt:17pass;listedcapitalcase superseded bydirectedcapital",
|
||||
"directed-capital.txt:updatedcapitalcase+1newcasepass",
|
||||
"directed-report.txt:3affectedreportcasespass",
|
||||
"directed-fx-origin.txt:1newcasepass"
|
||||
],
|
||||
"API": "1test/34assertions;loopback55441/simulator_fiscal_delta_20261021_test;DatabaseTransactionsrollback;acceptedhistory/oldmaps preserved",
|
||||
"types": "types-final.txt:exit0",
|
||||
"build": "build-final.txt:exit0",
|
||||
"UI": "ActualexistingFXpreview/confirmationinsideIRPC,calculation/save/recover/report/export;localfileharness distinguishedfromprivateAPI",
|
||||
"unaffected_old_functional_suites_repeated": false
|
||||
},
|
||||
"compiled_markers": {
|
||||
"Calcular e guardar retenções IRPC": [
|
||||
"assets/services-Es7_7t9u.js"
|
||||
],
|
||||
"Base do rendimento/conversão por resolver:": [
|
||||
"assets/project-dossier-DZQJzKcc.js"
|
||||
],
|
||||
"Retenção liberatória20%62(3)a/b": [
|
||||
"assets/project-dossier-DZQJzKcc.js"
|
||||
],
|
||||
"Reutilizar selecção cambial": [
|
||||
"assets/services-Es7_7t9u.js"
|
||||
],
|
||||
"Calcular e guardar apuramento trimestral ISPC": [
|
||||
"assets/services-Es7_7t9u.js"
|
||||
],
|
||||
"Calcular e guardar restituição E": [
|
||||
"assets/services-Es7_7t9u.js"
|
||||
]
|
||||
},
|
||||
"changes": [
|
||||
"docs/investmoz/simulations/integrated-review-continuation-20261020-receipt.json",
|
||||
"docs/investmoz/simulations/irpc-l5-grouped-qa-20261025.json",
|
||||
"docs/investmoz/simulations/irpc-l5-withholdings-qa-20261025.json",
|
||||
"docs/investmoz/simulations/ispc-residual-delivery-20261025.json",
|
||||
"docs/investmoz/simulations/ispc-residuals-qa-20261025.json",
|
||||
"docs/investmoz/simulations/official-source-register.md",
|
||||
"docs/investmoz/simulations/source-archive/AT-MRFTA-19-39.pdf",
|
||||
"docs/investmoz/simulations/source-archive/BR252-I-Serie-2022-Lei20-PESOE.pdf",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-9-2008-BR16.pdf",
|
||||
"docs/investmoz/simulations/source-archive/Lei-19-2013-BR76.pdf",
|
||||
"docs/investmoz/simulations/source-archive/Lei-34-2007-BR52.pdf",
|
||||
"docs/investmoz/simulations/source-archive/Lei-4-2012-BR3.pdf",
|
||||
"docs/investmoz/unification/traceability-and-manual.md",
|
||||
"docs/investmoz/v2/auditoria-portal/matriz-requisitos.csv",
|
||||
"resources/js/components/simulation-form.tsx",
|
||||
"resources/js/components/simulation-irpc-withholdings.tsx",
|
||||
"resources/js/lib/irpc-fx.ts",
|
||||
"resources/js/lib/irpc-withholdings.ts",
|
||||
"resources/js/lib/project-dossier.ts",
|
||||
"tests/Feature/IrpcGroupedDraftTest.php",
|
||||
"tests/Feature/IrpcWithholdingDraftTest.php",
|
||||
"tests/frontend/fixtures/irpc-grouped-preserved.json",
|
||||
"tests/frontend/fixtures/irpc-l5-preserved.json",
|
||||
"tests/frontend/irpc-grouped.test.mjs",
|
||||
"tests/frontend/irpc-withholdings.test.mjs"
|
||||
],
|
||||
"remaining_L5": [
|
||||
{
|
||||
"item": "Dispensas68 e casos residentes/EP dependentes",
|
||||
"data_needed": "Titular/operação e condições de68(a/b/c/d/f/g),incluindo gestão de imóveis próprios/transparência,participações e tipos de juros;casos digitais residentes/EP confrontados com62(5)/68(d).",
|
||||
"resolution": "Ramo específico por dispensa/factos;não bloquear royalties comuns,retenções definitivas ou especiais independentes."
|
||||
},
|
||||
{
|
||||
"item": "Convenções/benefícios invocados",
|
||||
"data_needed": "País/convenção/artigo,beneficiário,residência,condições/período e prova invocados",
|
||||
"resolution": "Só esse caso fica indeterminado;sem taxa reduzida presumida."
|
||||
},
|
||||
{
|
||||
"item": "Outros rendimentos/devedores/períodos",
|
||||
"data_needed": "Artigo próprio para categorias fora dos ramos agrupados,via devedorIRPS,anos fora2026,EP de categorias especiais62(4)quando não cabe62(2)",
|
||||
"resolution": "Não aplicar20%ou10%genéricos;avançar os casos compatíveis."
|
||||
},
|
||||
{
|
||||
"item": "Juros,rectificações e arredondamento de entrega",
|
||||
"data_needed": "Regra/taxa/base/período dejuros,declaração/guia anterior,documentos de correcção e regra de arredondamento legal da entrega se aplicável",
|
||||
"resolution": "Aritmética exacta preservada;aproximação assinalada;sem zero dejuros ou crédito anual automático."
|
||||
},
|
||||
{
|
||||
"item": "EntregaAT com comprovativo em moeda estrangeira",
|
||||
"data_needed": "MontanteMZN efectivamente entregue no comprovativo;conversão do pagamento ao beneficiário não prova entregaIRPC",
|
||||
"resolution": "Base e comprovativo de retenção sofrida já convertem pelo mecanismo entregue;esta limitação não reabre o câmbio geral."
|
||||
}
|
||||
],
|
||||
"external_formalities": [
|
||||
{
|
||||
"item": "MRFTA/CER e remissão67(7)",
|
||||
"data_needed": "Correspondência concreta de rubricas/CER para novos casos;67(7)refere62(6),nova taxaestá62(5);manteroriginal",
|
||||
"resolution": "Preparação/exportação disponível;sem adivinhar código,assinatura ou submissão."
|
||||
},
|
||||
{
|
||||
"item": "ActosAT",
|
||||
"data_needed": "Submissão,recepção,aceitação e eventuais comprovativos externos",
|
||||
"resolution": "Externos;exportar não executa nem certifica esses actos."
|
||||
}
|
||||
],
|
||||
"backup_restore": "Not run in this preparation. At installation: fresh authenticated destination/schema/data/config/permissions comparison and backup with isolated verified restore;prior receipts are preserved,notrepresented asfresh.",
|
||||
"execution_remaining": [
|
||||
"Authenticatedfreshdestinationcomparison,backupandisolatedrestorebeforeinstallation.",
|
||||
"FastforwarddeliverybyexistingGitprocessafterfreshguards;nevermergerootP001experimentalruntime.",
|
||||
"Verifyinstalledruntime/compiledmarkers/persistentfiles/configuration/schema/permissions/dataunder equivalentidentity;reuseacceptedfunctionalproofs."
|
||||
],
|
||||
"main_changed": false,
|
||||
"active_changes": false,
|
||||
"L3_ISPC": "Preserved;ISPCinterest/otherexcess/instructionsinexistingmatrix;IRPSstillonlypreviousdemonstratedcase;P001/P058nonblocking;P084/P085closed;statistics/AIdeferred.",
|
||||
"L5_integrally_completed": false,
|
||||
"IRPC_integrally_completed": false,
|
||||
"IRPS_integrally_completed": false,
|
||||
"bundle_sha256": "975f8930ea701d6028b48c0dc80c01c1de034ce330eb2041ae70ea40cde99c9f",
|
||||
"status_before_installation": "prepared_grouped_Git_delivery_not_installed",
|
||||
"installation_followup": {
|
||||
"commit": "2b33a1c343d192f80fb24aac2a27b2d375af5601",
|
||||
"includes": "4d6f8282/da0d8abb",
|
||||
"presentation_followup": "category/rate/natureexplicitinPortuguese;arithmeticunchanged",
|
||||
"receipt": "irpc-l5-delivery-20261025.json",
|
||||
"L5_integrally_completed": false
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"status": "QA_grouped_compatible_L5_prepared_not_installed",
|
||||
"status": "installed_scoped_IRPC_L5",
|
||||
"installed_baseline": "5c0cb25cea7826811c389b55a64bcdf5e43b937f",
|
||||
"previous_QA": "da0d8abb4775a7a68142f84129e312b86dadfe23",
|
||||
"branch": "codex/irpc-l5-withholdings-qa-20261025",
|
||||
@@ -189,5 +189,13 @@
|
||||
"outputs/irpc-l5-grouped-20261025/ui-report.txt": "0561e14566e4b9b4ab333c5c2a13b03f055c4ae413d3f9d211e663f2da38a7b5",
|
||||
"outputs/irpc-l5-grouped-20261025/preparation.html": "c3c3e8df77e3f22e34e0cfbd2a8cc04a7d3cdc2e7080a0a70415f8f1c661818b",
|
||||
"outputs/irpc-l5-grouped-20261025/active-baseline.json": "2f2d1a9d3e311f12099d2372d0c1a01eb5ff3918a39218c73b668dfbe51c66f8"
|
||||
},
|
||||
"status_before_installation": "QA_grouped_compatible_L5_prepared_not_installed",
|
||||
"installation_followup": {
|
||||
"commit": "2b33a1c343d192f80fb24aac2a27b2d375af5601",
|
||||
"includes": "4d6f8282/da0d8abb",
|
||||
"presentation_followup": "category/rate/natureexplicitinPortuguese;arithmeticunchanged",
|
||||
"receipt": "irpc-l5-delivery-20261025.json",
|
||||
"L5_integrally_completed": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,330 +0,0 @@
|
||||
{
|
||||
"status": "QA_demonstrated_grouped_candidate_not_installed",
|
||||
"baseline_reported_installed": "2b33a1c3",
|
||||
"branch": "codex/irpc-l5-reliefs-qa-20261025",
|
||||
"implemented": [
|
||||
"CIRPC68d qualified on-account services/equipment",
|
||||
"CIRPC68f own-property management,not fiscal transparency",
|
||||
"PT-MZ12 qualified royalties/equipment10%gross definitive",
|
||||
"Insufficient/contradictory/out-of-period evidence remains indeterminate",
|
||||
"Private API persistence,recovery,history;standalone report and complete financial dossier",
|
||||
"IRPC dossier section association restored"
|
||||
],
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/irpc-relief-preparation.ts",
|
||||
"sha256_LF": "e41a389ad0b5d3f33985e375b0c488eed8c2d185257eec1cf5f7d40fccd365d4"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-withholdings.ts",
|
||||
"sha256_LF": "75bf1c5940595e90d7a27355aeae6f9fdca4841f3e9ce3cb02103376bbd4d91b"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-withholdings.tsx",
|
||||
"sha256_LF": "28dd35e40c5d8440adad01131714d324f0c7fcdfeb3f6ddd9d27750d563b5e4f"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier-report.ts",
|
||||
"sha256_LF": "4523365e2d4a2fcd014e13393deb33a5ec4b9396ff580d8a237aa8c4f02265e4"
|
||||
}
|
||||
],
|
||||
"verification": {
|
||||
"routes": "normal Wayfinder generate --with-form through guarded QA wrapper",
|
||||
"types": "tsc --noEmit passed",
|
||||
"build": "complete QA build passed; existing optional-font/chunk-size notices only",
|
||||
"frontend": "9 new tests passed",
|
||||
"compatibility": "5 directed IRPC cases passed;no repeated L3/ISPC/FX suites",
|
||||
"api": "1test/17assertions;private endpoints;55441/simulator_fiscal_delta_20261021_test;DatabaseTransactions rollback",
|
||||
"report": "retentions preparation and financial dossier from actual API recovered sample",
|
||||
"ui": {
|
||||
"calculation": true,
|
||||
"localSaveRecovery": true,
|
||||
"privateApiProof": "IrpcReliefsDraftTest, separate",
|
||||
"report": true,
|
||||
"insufficientInformation": true,
|
||||
"errors": []
|
||||
}
|
||||
},
|
||||
"preserved_FX_files": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-fx-selection.ts",
|
||||
"sha256_LF": "9aa07ad443bc777b80510a3b5bd6aff9ddb9814d2450f3c690e531e74d71d998"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-fx-selection.tsx",
|
||||
"sha256_LF": "39bb6d87d404745b0b66349bc11626545a3672ae27321ce9b4658416592059bf"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/business-financial-plan.ts",
|
||||
"sha256_LF": "c20274722d1ffcd0360f041a6cacb5d868fe0621cb27a1aca6e06826612c3ebb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-currency-events.ts",
|
||||
"sha256_LF": "cc9f2045d302d7987310da4006cc250fc5c99a27397918d166d649bfc32fab08"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-fx.ts",
|
||||
"sha256_LF": "5c4a7a477429f8d775acf6db3e117008468f5554e5731dec81f60fbb75e948fb"
|
||||
}
|
||||
],
|
||||
"sources_inventory": [
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Comunicado-9-2026-ISPC.pdf",
|
||||
"sha256": "106f8a9ce9255c03549c70bf07fe999d32e6e55302d009b509862aa74ccb4973",
|
||||
"bytes": 308401
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Modelo-30-ISPC.pdf",
|
||||
"sha256": "6802edd06b6ff638a0b851a3ec7ecf69af8f07840faa47446becad67d35d445c",
|
||||
"bytes": 159748
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Modelo-B-Geral.pdf",
|
||||
"sha256": "bd977c7c59d4d98befd92e2c566b1bf168cb1343bb519f51b41a3807f431fc57",
|
||||
"bytes": 319577
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-MRFTA-19-39.pdf",
|
||||
"sha256": "8ea62c53066b482f87078a7a7b1ecf15ca98a12a122e8d7abca63acfc993186b",
|
||||
"bytes": 256695
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-16-I-Serie-2008-04-16.pdf",
|
||||
"sha256": "fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee",
|
||||
"bytes": 2267865
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-248-I-Suplemento-1-2025.pdf",
|
||||
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251",
|
||||
"bytes": 440018
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-89-I-Serie-2017-06-08.pdf",
|
||||
"sha256": "11f0cab15eb6e51010952203ffa24fdc533a24fd642e19525fe4f46b17a1f5e5",
|
||||
"bytes": 9456358
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-95-I-Suplemento-2025-05-21.pdf",
|
||||
"sha256": "e0e682e2c027c3cd9c1d46a73a3f48bc5f6bdbf05667fd97314d7a3f6a456358",
|
||||
"bytes": 329070
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR252-I-Serie-2022-Lei20-PESOE.pdf",
|
||||
"sha256": "1159fd3ce1ba5581671796d083534da48bd3c5578298819e896f1c2a8026318d",
|
||||
"bytes": 17966640
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-22-2021-BR70.pdf",
|
||||
"sha256": "a8fac38dcfe08f9c7a8e46254cff10e1ec82fc4f7a8d88ad6e4fe7d91ffc21a5",
|
||||
"bytes": 905551
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-27-2026-BR123.pdf",
|
||||
"sha256": "26249c3fa58f149c81de36e99d1aac2819a4771379d9e8833159660dabf539bb",
|
||||
"bytes": 665722
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-29-1998-BR22-5-suplemento.pdf",
|
||||
"sha256": "6242cbe675faadf085f43f95ec8c7e8868aafe67c3b2ab2bb010992288f954f8",
|
||||
"bytes": 590418
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-3-2011-BR-11-I-mineiros.pdf",
|
||||
"sha256": "5bca1133666ba9c69870b89823420175b7b5b8d0eccb667ecdf5c29716f3b6be",
|
||||
"bytes": 135471
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-37-2023-BR124.pdf",
|
||||
"sha256": "7e680b191481faa0e2e9057fa5053587eb2a29d1d8c819e0eb9f02814255a04c",
|
||||
"bytes": 730017
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-9-2008-BR16.pdf",
|
||||
"sha256": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697",
|
||||
"bytes": 900370
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-13-2016-CIVA-BR-156-10-suplemento.pdf",
|
||||
"sha256": "b90dc7c14ecea2e378c4a62e8e5a47d54a5644c457baeb8b8053b92fd2a5710b",
|
||||
"bytes": 2127554
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-14-1992-BR42.pdf",
|
||||
"sha256": "089fff7423e99a70a230a73ca379e4ea3a91d124703f91016e57ff82794b9e56",
|
||||
"bytes": 1604284
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-17-2022-BR251-exemplar-MCNet5.pdf",
|
||||
"sha256": "14eb34f0af91a8f5cb1770c7b52d6ff839c6818302d1ed96d79afbfb9fe999d4",
|
||||
"bytes": 1603184
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-17-2022-IPP-BR250-Parlamento.pdf",
|
||||
"sha256": "978cd22403ffd336a631704ecd7a5bbd814a427c815b9acdaca5515591dd9e2a",
|
||||
"bytes": 1990307
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2013-BR76.pdf",
|
||||
"sha256": "bba96d645cc935ffc3d1a79b9f0f73ac1c693d6459c2ad41f56cd2841accae76",
|
||||
"bytes": 147521
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2017-IRPS-BR-OCAM.pdf",
|
||||
"sha256": "c3a0186cb9ad090d7a9533006295dc9bb6a62ad0d6150173cbd49dba4ee4b52d",
|
||||
"bytes": 1894997
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-2-2011-BR-1-4-suplemento-MCNet.pdf",
|
||||
"sha256": "a7543a68cc3287a46a83c39a04821b40f649dd06c4e9b5dc51ff0b47fba08899",
|
||||
"bytes": 161625
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-22-2022-IVA-republicada-BR-250-2-suplemento.pdf",
|
||||
"sha256": "ea1b0dc6f5cf6e595f6d9a19e7042f398999e0087caef1785f6e8fac571b5f53",
|
||||
"bytes": 1834284
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-34-2007-BR52.pdf",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e",
|
||||
"bytes": 1676884
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-1994-BR37-3-suplemento.pdf",
|
||||
"sha256": "210df9db8980d0a5690cd187a6eeec7e37a900d743e39062c16f4e0d12215c7e",
|
||||
"bytes": 186487
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-2012-BR3.pdf",
|
||||
"sha256": "b8845cef41dcbd9ba50c43dbfa743a56030dd3d348242a107e1ae30279eec121",
|
||||
"bytes": 187572
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-7-1991-Partidos-IFES.pdf",
|
||||
"sha256": "6b783a0bb3330688ef10660a58060d9724aa2da6a873d234fe902f0eaaeda42d",
|
||||
"bytes": 309350
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/PT-MZ-CDT-1992.pdf",
|
||||
"sha256": "d504e1024b28aee5c6acf4592acb96ec9c915a8414f67a61ab6984d6acf9df9d",
|
||||
"bytes": 199331
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/PT-MZ-Protocolo-2009.pdf",
|
||||
"sha256": "f353773dcf41f09f4daa6cf5ba5a5f7994f3e02615867c2dcffc61c3d901bf9b",
|
||||
"bytes": 197027
|
||||
}
|
||||
],
|
||||
"new_sources": [
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/PT-MZ-CDT-1992.pdf",
|
||||
"sha256": "d504e1024b28aee5c6acf4592acb96ec9c915a8414f67a61ab6984d6acf9df9d",
|
||||
"bytes": 199331,
|
||||
"url": "https://dcjri.ministeriopublico.pt/sites/default/files/documentos/instrumentos/rar36-1992.pdf"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/PT-MZ-Protocolo-2009.pdf",
|
||||
"sha256": "f353773dcf41f09f4daa6cf5ba5a5f7994f3e02615867c2dcffc61c3d901bf9b",
|
||||
"bytes": 197027,
|
||||
"url": "https://files.dre.pt/1s/2009/05/08900/0275202756.pdf"
|
||||
}
|
||||
],
|
||||
"remaining": [
|
||||
"Other68paragraphs and digital/resident-specific cases",
|
||||
"Other countries,treaties,EP-related and special-relationship excess cases",
|
||||
"Dividends,interest-specific treaty branches",
|
||||
"Late-payment interest,rectifications,aggregation,MRFTA/CER/form filling",
|
||||
"External treaty claiming formalities are not declared satisfied by this calculation"
|
||||
],
|
||||
"active_changes": false,
|
||||
"active_verification": "No fresh live inspection claimed;2b33a1c3 remains last reported installation",
|
||||
"schema_config_permissions_delta": false,
|
||||
"L5_integrally_completed": false,
|
||||
"L3_ISPC_FX": "Unchanged;accepted proofs reused;no repeated functional suites",
|
||||
"installation_remaining": "Existing Git release process,destination comparison and fresh backup/restore safeguards at installation",
|
||||
"proofs": [
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/api.txt",
|
||||
"sha256": "5cccf4ee4e62ae00ef85276d48482fa8c13e202ddf68b6d79b1948977fb1f597"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/build.txt",
|
||||
"sha256": "c60d4a5285f57a6458285163f64279d87558a8119f9b386cad8d12861d49e025"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/calculated.json",
|
||||
"sha256": "563e05189c0a1255bf071fd1086aa8e67d6f0872891c5851dccbfc0d944752fe"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/compatibility.txt",
|
||||
"sha256": "f37ad0ac9a0f2675fa4199f7600f3ae4e5a2df35a7294fe6e5aefd8024344051"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/dossier.html",
|
||||
"sha256": "a34c2e9ef8b4d202e23412aaf6862ef9d603efeee0518a16adeb9d895f775641"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/dossier.json",
|
||||
"sha256": "717561321d4b6c7659f0e6ab82c0e411ada0002a4f5436ba42092f8002f96076"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/dossier.txt",
|
||||
"sha256": "a0473de355821758c4d320eea8e7af76a0d196a9cee652c71af723d6f69832f0"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/frontend.txt",
|
||||
"sha256": "f86464b0d6a36ccfc39e22c0616d4a2e4f657126da134cb2014fcc199a11bdf2"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/index.html",
|
||||
"sha256": "6bb76e37ac20a73cb9ffcda14f1ac9db701aa01bc2ef2f62fc5adaaffb640ca8"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/Lei-19-2013-BR76.pdf-review.png",
|
||||
"sha256": "b62716ed89669622a33bde81a5ab6dcf0a6faafaf41726a09cd5b473b59abab1"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/Lei-34-2007-BR52.pdf19.png",
|
||||
"sha256": "8355aa0b103439bb2b652b8499b2abf9bee1e4f3cc1af54b1be3ea059a2384f4"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/Lei-4-2012-BR3.pdf-review.png",
|
||||
"sha256": "207224d8712713c9f4c5dda4e61539eba28f37af1ec70ef139cff0b450a62b2e"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/preparation.html",
|
||||
"sha256": "2943b6cd21cc4ac043ae9b0605aee23c0fbbbed552842aeafef187ff963389a1"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/protocol-page1.png",
|
||||
"sha256": "d981c72e254239c911554ff1289b578f7136bae7964a3d53f76a69094186cc04"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/PT-MZ-CDT-1992.pdf13.png",
|
||||
"sha256": "2a57bc9924c0c826452bbc7f097b48c1899e6b642d6cdc247c244ace8993bb96"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/PT-MZ-CDT-1992.pdf14.png",
|
||||
"sha256": "9fd31dcf17bdd1526390758a48a5afa8f9b98aebd83209b962ea97b7deef4006"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/PT-MZ-Protocolo-2009.pdf-review.png",
|
||||
"sha256": "ba5ad799456a16959b83878c8935eb326ec3f0d87a2ba32e43217411e3f0dac9"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/recovered.json",
|
||||
"sha256": "0b2378d1b8232b1424cf3d13e199146f4eabc330b9750a74b2b59f172741515e"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/types.txt",
|
||||
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/ui-proof.json",
|
||||
"sha256": "274ffe6c237da799aceff79df76087cf17f2a83505755aa6354d90b9d1f85abb"
|
||||
},
|
||||
{
|
||||
"path": "outputs/irpc-reliefs/ui.png",
|
||||
"sha256": "55df91c9dfc9a028eceafaf0b55b4ad2df892da491f8ac97d5d8edaacea73a4e"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"status": "QA_first_scoped_increment_not_installed",
|
||||
"status": "installed_scoped_IRPC_L5",
|
||||
"base_installed": "5c0cb25cea7826811c389b55a64bcdf5e43b937f",
|
||||
"branch": "codex/irpc-l5-withholdings-qa-20261025",
|
||||
"L5_integrally_completed": false,
|
||||
@@ -196,5 +196,13 @@
|
||||
"source2022_gap": "ResolvedbynewfullBR,p2731",
|
||||
"currency_gap": "Resolvedthroughdeliveredmechanismforbaseandwithholdingproof",
|
||||
"previous_proofs": "Preserved;originalscopeandhistorynotrevoked"
|
||||
},
|
||||
"status_before_installation": "QA_first_scoped_increment_not_installed",
|
||||
"installation_followup": {
|
||||
"commit": "2b33a1c343d192f80fb24aac2a27b2d375af5601",
|
||||
"includes": "4d6f8282/da0d8abb",
|
||||
"presentation_followup": "category/rate/natureexplicitinPortuguese;arithmeticunchanged",
|
||||
"receipt": "irpc-l5-delivery-20261025.json",
|
||||
"L5_integrally_completed": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,145 +0,0 @@
|
||||
{
|
||||
"status": "three_compatible_L6_sets_QA_prepared_not_installed",
|
||||
"installed_baseline": "2f684e59846187f3fb8a338d9d6f6a08cadb4d0d",
|
||||
"branch": "codex/irpc-l6-compatible-sets-qa-20261025",
|
||||
"QA_workspace": "C:\\laragon\\www\\portal-investidor-irpc-l6-sets-qa-20261025",
|
||||
"scope": "Ordinary documented rules, annual MZN periods ending2026, resident general or attributable EP result; no assumed fiscal rounding or final settlement.",
|
||||
"demonstrated": {
|
||||
"accounting_profit": "6240MZN",
|
||||
"installed_addbacks": "220MZN",
|
||||
"new_effects": {
|
||||
"third_party_tax": 250,
|
||||
"patrimonial_gain": 200,
|
||||
"patrimonial_cost": -50,
|
||||
"timing": 100,
|
||||
"depreciation_difference": 20
|
||||
},
|
||||
"taxable_profit": "6980MZN",
|
||||
"previous_losses_explicit_deduction": "2300MZN",
|
||||
"taxable_base": "4680MZN",
|
||||
"general_rate": "32%",
|
||||
"colecta": "1497.60MZN",
|
||||
"payable": null,
|
||||
"recoverable": null,
|
||||
"current_loss_case": "3820MZN loss;known zero base/colecta;no official carryforward",
|
||||
"EP_case": "2025-07-01 to2026-06-30,12 monthly periods"
|
||||
},
|
||||
"new_proofs": {
|
||||
"frontend_tests": 14,
|
||||
"private_API_tests": 1,
|
||||
"private_API_assertions": 78,
|
||||
"database": "127.0.0.1:55441/simulator_fiscal_delta_20261021_test;DatabaseTransactions rollback",
|
||||
"routes_actions_generated": true,
|
||||
"typescript": "passed",
|
||||
"build": "passed",
|
||||
"actual_UI": "field editing;unsupported asset rate;missing interest;save/recovery;download;current loss",
|
||||
"dossier": "from API-recovered calculated/missing/loss/EP JSON"
|
||||
},
|
||||
"preservation": {
|
||||
"installed4_fixture_matches_accepted_sha256": true,
|
||||
"versions1_to4_keys_unchanged_without_optin": true,
|
||||
"other_runtime_changes": false,
|
||||
"schema_API_config_permissions_dependencies_changed": false,
|
||||
"L3_ISPC_FX_L5_accepted_proofs": "reused;not repeated",
|
||||
"L5_ten_questions": "unchanged,only dependent cases blocked",
|
||||
"active_data_changed": false
|
||||
},
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-normal.tsx",
|
||||
"sha256_LF": "e33b3839aac53a1b7ca2a76eda0ec4c54015a6d1c75e386aaeb5d342943f5965"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-schedules.tsx",
|
||||
"sha256_LF": "eebd6d9e4100920a5ebf91b800537ffe301fd6a994b86a3b080d673f4a9c9a42"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-assessment.ts",
|
||||
"sha256_LF": "1dc6adc0835af033ef296d12cdc1e9ef354b2f54cd36e2349b2df66e369c1ee3"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-base.ts",
|
||||
"sha256_LF": "85fa1eb78ce2b8a144a9f0dcda93b542083a7ff119cbc43f4334c87284bfd312"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-forms.ts",
|
||||
"sha256_LF": "4e986addb9f2d74e7a80345f8f1e4d8e0b2f562c867fa6eee84880d9f72a3649"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-profit.ts",
|
||||
"sha256_LF": "d5a2b52f7deb4cf35651188e04f103fcba950a007e3aa4de5ba7017e686614df"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-schedules.ts",
|
||||
"sha256_LF": "b0045fd2c072998ebb290c2a8332c26d05a1f5f746b3beb1805508147497cac8"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal.ts",
|
||||
"sha256_LF": "62d20bbcebb523f77fde950f623933a13f03283238665cf22fec9390f7ba9333"
|
||||
}
|
||||
],
|
||||
"source_exemplar_added": {
|
||||
"document": "Decreto72/2013,BR102,2suplemento,23December2013",
|
||||
"official_issue": "https://www.inm.gov.mz/pt-br/content/conselho-de-ministros-suplemento-n%C2%BA-2-de-231213-pag-1074-3-24-br-n%C2%BA-102-boletim-da-rep%C3%BAblica",
|
||||
"gazette_copy": "https://www.lexlink.eu/FileGet.aspx?FileId=1152468",
|
||||
"local_original": "C:\\laragon\\www\\portal-investidor-irpc-l6-sets-qa-20261025\\outputs\\irpc-l6-sets\\decreto-72-2013.pdf",
|
||||
"sha256": "922ef67cb0c1111405c3c0a092d8c302a74fba8a34d627b6e9e13223612e0659",
|
||||
"visual_pages": [
|
||||
1,
|
||||
2,
|
||||
17
|
||||
],
|
||||
"rate_table": "tableII/group3/items9=25%,9.1=20%,Gazettepage1074(21)/PDF17",
|
||||
"consultation": "preserved in QA proof archive;no publication/import into active library",
|
||||
"legal_application": "articles3–7,ordinary annual constant method,tableI precedence;other categories/methods visibly unsupported",
|
||||
"scan_status": "not asserted"
|
||||
},
|
||||
"existing_form_sources": {
|
||||
"M22": "4b61bd83d1fbcfd3b7b5c5523cea5923f7d0f65dc4c004eff58e5db38f763c88;three accepted page images reused",
|
||||
"M20_workbook": "1ceca6f4c6d77853c1b2b445876599b42093175fa89eecf40590180956d83a9e;existing structure inventory reused;no third-party sample values or cached formulas",
|
||||
"concrete_conflict": "M20A.1 refers result to M22 field201/Q8;PDF M22 uses200/Q10;automatic transfer blocked only for that mapping"
|
||||
},
|
||||
"remaining": "Concrete cases enumerated in same matrix/manual section25/10;cost limits/provisions/prior-year timing;remaining asset categories/methods;short periods/annual foreign-currency reconciliation;fractional fiscal representation;remaining result/form mapping. L7 benefits/special cases and L8 settlement remain own scopes.",
|
||||
"L6_complete": false,
|
||||
"installation_performed": false,
|
||||
"next_delivery": "Joint Git bundle from installed2f684e59;fresh authenticated destination backup/restore and delta required only at installation,not performed in QA.",
|
||||
"proof_sha256": {
|
||||
"api.txt": "3c3142dd55febf17c5e16e3cfabf2266759be7290b8d5ac92823e0f71cbffa6a",
|
||||
"build-exit.txt": "13bf7b3039c63bf5a50491fa3cfd8eb4e699d1ba1436315aef9cbe5711530354",
|
||||
"build.txt": "ba955cab87896b78652787f188c092e79108fc0e5289f237be1ddf21d73dbbf3",
|
||||
"calculated.json": "109426b86ae7c14463699b1d197064617f124ecec0c55085d9e81aeddc505a5a",
|
||||
"decreto-72-2013.pdf": "922ef67cb0c1111405c3c0a092d8c302a74fba8a34d627b6e9e13223612e0659",
|
||||
"decreto-72-2013.txt": "bbbf05f109201a6d31e153046576a088e6c0cca97ada07833d0499698d0afcfa",
|
||||
"decreto-72-page1.png": "bb681e5df24a13d8484a521ae58e480c9dd23b4fd09de3ff11d5287ddd26a4f9",
|
||||
"decreto-72-page17.png": "bb3468fde9f95576d8d6392a4c906ae904941ad35843c472d3671492c24f0945",
|
||||
"decreto-72-page2.png": "9bf0f11a4724b079b494f640e905eee5bd278b729091e67aa03d0bfe71f5c273",
|
||||
"dossier-calculated.json": "e9487c0325db125f8a0ff5266d137141916f329283857f2efc1f64732353454b",
|
||||
"dossier-ep.json": "57b55c94118bd9767f06b4cd0673bcecbd8882ca1ec8681c393216a0fc3a7ac7",
|
||||
"dossier-loss.json": "28eb77522fea39947a6cffd7419c24cd37795f361559050377f79d8b9f1cd1fb",
|
||||
"dossier-missing.json": "bda0394cb059a1800a5dcf4728ba58a5b3ee975a87a7a938ebf5673e0ace1587",
|
||||
"dossier.mjs": "9ab7bc1ad64ab8f04936068df0f0555749048d9edd9f2d48e8246542204257dc",
|
||||
"download.html": "d084c44b3b527c9ed5f3f2c2e7ccd88229b0a19b9956e153e63b14618020acdb",
|
||||
"ep.json": "9ae0b179c100ea5e642ce2ed9362b74e60bf1040bf6e7227592db84220babb23",
|
||||
"frontend.txt": "92d096de8d364f04339178feeb6e77cf247cbc4974974bce56ba7728401bbdc5",
|
||||
"index.html": "09941968500d2910121bdcb0029e326fc6d44bb025b01766654289a28caa62fa",
|
||||
"loss.json": "8a0e85205db146a02fc9e06a2667cdce5a00e48ed8a7e7568a50d361e40671b2",
|
||||
"missing.json": "1f52b06286d0724fe27d24ab91386732c873fc65064521c270faf357ac193135",
|
||||
"preparation.html": "7ac15855048512bec05690170368df1ee4d4879f224a9d6c56749c3500d2d9c0",
|
||||
"qa.tsx": "e2f5dc5e9a9c142b3fe65889c0cefcbfb03fb3b46957437af1108dbf20569647",
|
||||
"recovered-calculated.html": "7ac15855048512bec05690170368df1ee4d4879f224a9d6c56749c3500d2d9c0",
|
||||
"recovered-calculated.json": "db98c66ba9cf46a67ead4267d7b3d25b08275a4d8a11bbd316f4bec2b77644af",
|
||||
"recovered-ep.html": "47df28ba65d7825192ec7fd3fad61998f378829046df2c1b3ab74b7fb32980ef",
|
||||
"recovered-ep.json": "56f12435276c4cf9604f10e8c53bba61f1eb84dcaa5b911ac06242112d740764",
|
||||
"recovered-loss.html": "a3f70ddcfe4a10a38110690b7583f1c89be6427fe347a321e9a395db6214fc6a",
|
||||
"recovered-loss.json": "fe280337741a5004c13c83a41f83ca87c98c07f815fc87b617a0d5c8dbd03573",
|
||||
"recovered-missing.html": "8989a835f9145e94434f31c90c96c801219494019fbc6167f1c8272d08c6debc",
|
||||
"recovered-missing.json": "a4a24bc80dd6352c0883a1a555de9cd32a71335bd07b4826526ebe311700766f",
|
||||
"types.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"ui-calculated.png": "1578772454a4e5902d3ac8f607dbcda3b3c3b7e23d0870bbe233da036f15ba5e",
|
||||
"ui-missing.png": "72d48f81bc67bd9342c5078d81044290912afacd305980806c42cd96b038a614",
|
||||
"ui-proof.json": "7bd7a522b4307d8f72fb04317106c3b7cc53763fe8923017ae0f63a510b9bb9e",
|
||||
"ui.cjs": "207eea61db65ac778f26f35beecd18387d6126b75e1effcf3e33c1e26e957215",
|
||||
"ui.txt": "9b120d22b3e2539e8862c5ce5a973cce4fc2632a16680e7f997020f4e2cd0196",
|
||||
"vite.config.ts": "11a4a8f0bf0394f380e731cfb30cf4a0f3de3c6f3734653491e1aa26f57315f1"
|
||||
}
|
||||
}
|
||||
@@ -1,869 +0,0 @@
|
||||
{
|
||||
"status": "compatible_cost_limits_provisions_timing_QA_prepared_not_installed",
|
||||
"installed_baseline": "a2de725901c308fb2ac2bc3d72181ab50ef46b7a",
|
||||
"branch": "codex/irpc-l6-costs-provisions-timing-qa-20261026",
|
||||
"QA_workspace": "C:\\laragon\\www\\portal-investidor-irpc-l6-costs-qa-20261026",
|
||||
"version": "IRPC-normal-adjustments/6",
|
||||
"scope": "AnnualMZN periods ending2026,ordinary documented cost/provision categories and prior-year/work timing;normal profit/base/colecta only;L7/L8 remain own scopes.",
|
||||
"demonstrated_sequence": {
|
||||
"accounting_profit": "6240MZN unchanged",
|
||||
"previous_addbacks": "220MZN",
|
||||
"previous_schedule_effect": "520MZN",
|
||||
"new_cost_provision_prior_timing_adjustments": "350MZN",
|
||||
"new_work_adjustment": "-600MZN",
|
||||
"taxable_profit": "6730MZN",
|
||||
"previous_loss_deduction": "2300MZN explicit,unchanged",
|
||||
"taxable_base": "4430MZN",
|
||||
"rate": "32%",
|
||||
"colecta": "1417.60MZN",
|
||||
"final_payable": null,
|
||||
"final_recoverable": null,
|
||||
"final_balance_scope": "L8"
|
||||
},
|
||||
"cases_recovered_by_private_API": {
|
||||
"calculated": {
|
||||
"profit": {
|
||||
"numerator": "6730",
|
||||
"denominator": "1"
|
||||
},
|
||||
"base": {
|
||||
"numerator": "4430",
|
||||
"denominator": "1"
|
||||
},
|
||||
"colecta": {
|
||||
"numerator": "7088",
|
||||
"denominator": "5"
|
||||
},
|
||||
"cost_effect": {
|
||||
"numerator": "-250",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pending": [],
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
},
|
||||
"missing": {
|
||||
"profit": null,
|
||||
"base": null,
|
||||
"colecta": null,
|
||||
"cost_effect": {
|
||||
"numerator": "-400",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pending": [
|
||||
"QA-credit: Provisão fiscal anterior dos créditos em falta; não presumir zero."
|
||||
],
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
},
|
||||
"additional": {
|
||||
"profit": {
|
||||
"numerator": "7050",
|
||||
"denominator": "1"
|
||||
},
|
||||
"base": {
|
||||
"numerator": "4750",
|
||||
"denominator": "1"
|
||||
},
|
||||
"colecta": {
|
||||
"numerator": "1520",
|
||||
"denominator": "1"
|
||||
},
|
||||
"cost_effect": {
|
||||
"numerator": "70",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pending": [],
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
},
|
||||
"limits": {
|
||||
"profit": {
|
||||
"numerator": "7210",
|
||||
"denominator": "1"
|
||||
},
|
||||
"base": {
|
||||
"numerator": "4910",
|
||||
"denominator": "1"
|
||||
},
|
||||
"colecta": {
|
||||
"numerator": "7856",
|
||||
"denominator": "5"
|
||||
},
|
||||
"cost_effect": {
|
||||
"numerator": "230",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pending": [],
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
},
|
||||
"closing": {
|
||||
"profit": {
|
||||
"numerator": "6530",
|
||||
"denominator": "1"
|
||||
},
|
||||
"base": {
|
||||
"numerator": "4230",
|
||||
"denominator": "1"
|
||||
},
|
||||
"colecta": {
|
||||
"numerator": "6768",
|
||||
"denominator": "5"
|
||||
},
|
||||
"cost_effect": {
|
||||
"numerator": "-450",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pending": [],
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
}
|
||||
},
|
||||
"categories_demonstrated": {
|
||||
"allowance": {
|
||||
"case": "calculated",
|
||||
"source_amount": {
|
||||
"numerator": "100",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "70",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "30",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": {
|
||||
"numerator": "30",
|
||||
"denominator": "1"
|
||||
},
|
||||
"rule_source": "CIRPC36(1)e",
|
||||
"reason": "50% só da parcela não facturada a clientes nem tributada emIRPS; parcelas mutuamente exclusivas."
|
||||
},
|
||||
"representation": {
|
||||
"case": "calculated",
|
||||
"source_amount": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "10",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "40",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": null,
|
||||
"rule_source": "CIRPC36(1)f/36(3)",
|
||||
"reason": "20% aceite;80% acrescido. Eventual tributação autónoma não calculada, âmbitoL7."
|
||||
},
|
||||
"advertising": {
|
||||
"case": "calculated",
|
||||
"source_amount": {
|
||||
"numerator": "80",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "80",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": {
|
||||
"numerator": "120",
|
||||
"denominator": "1"
|
||||
},
|
||||
"rule_source": "CIRPC36(1)n,Lei20/2009",
|
||||
"reason": "Limite único anual1% das vendas normais; repartição aritmética proporcional entre parcelas para a simulação, sem ordem fiscal obrigatória."
|
||||
},
|
||||
"credit": {
|
||||
"case": "calculated",
|
||||
"source_amount": {
|
||||
"numerator": "200",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "150",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"rule_source": "CIRPC28(1)a/29",
|
||||
"reason": "29:1,5% anual,6% acumulado sobre créditos da actividade normal existentes no fim; saldo fiscal anterior conhecido. Repartição proporcional do limite único, sem consumir saldo oficial."
|
||||
},
|
||||
"stock": {
|
||||
"case": "calculated",
|
||||
"source_amount": {
|
||||
"numerator": "60",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "30",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "30",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": {
|
||||
"numerator": "40",
|
||||
"denominator": "1"
|
||||
},
|
||||
"rule_source": "CIRPC28(1)b",
|
||||
"reason": "28b:limite das perdas efectivamente observadas, incluindo saldo anterior."
|
||||
},
|
||||
"litigation": {
|
||||
"case": "calculated",
|
||||
"source_amount": {
|
||||
"numerator": "90",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "80",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "10",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": {
|
||||
"numerator": "100",
|
||||
"denominator": "1"
|
||||
},
|
||||
"rule_source": "CIRPC28(1)c",
|
||||
"reason": "28c:obrigações de processo judicial em curso que seriam custos dedutíveis, com saldo anterior reconciliado."
|
||||
},
|
||||
"fuel": {
|
||||
"case": "calculated",
|
||||
"source_amount": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "40",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "10",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": null,
|
||||
"rule_source": "CIRPC36(1)i/36(4)",
|
||||
"reason": "36i: parcela ligada a activo próprio/locado e consumo normal comprovados."
|
||||
},
|
||||
"prior_cost": {
|
||||
"case": "calculated",
|
||||
"source_amount": {
|
||||
"numerator": "80",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "80",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": null,
|
||||
"rule_source": "CIRPC18(2)",
|
||||
"reason": "18(2):conhecido/previsível no encerramento anterior; excluído do actual, sem alterar declarações/históricos anteriores."
|
||||
},
|
||||
"work": {
|
||||
"case": "calculated",
|
||||
"source_amount": {
|
||||
"numerator": "1000",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "200",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "-600",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": {
|
||||
"numerator": "400",
|
||||
"denominator": "1"
|
||||
},
|
||||
"rule_source": "CIRPC19(1–6)",
|
||||
"reason": "19:grau=incorrido/custo total;valores fiscais do exercício obtidos dos acumulados menos o já reconhecido. Proveito fiscal corrente:400.00 MZN;custo fiscal corrente:200.00 MZN;sem imposto/pagamento ou perda estimada presumidos."
|
||||
},
|
||||
"vehicle": {
|
||||
"case": "additional",
|
||||
"source_amount": {
|
||||
"numerator": "100",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": null,
|
||||
"rule_source": "CIRPC36(4)",
|
||||
"reason": "50% dos outros encargos de passageiros, excepto serviço público de transportes/locação na actividade normal; não inclui quotas, aluguer sem condutor ou combustível já discriminados."
|
||||
},
|
||||
"rental": {
|
||||
"case": "additional",
|
||||
"source_amount": {
|
||||
"numerator": "100",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "80",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "20",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": null,
|
||||
"rule_source": "CIRPC36(1)h/36(4)",
|
||||
"reason": "36h: reutiliza parcela de quota não aceite documentada; o portal não apura automaticamente essa quota de viatura."
|
||||
},
|
||||
"estimated_work_loss": {
|
||||
"case": "additional",
|
||||
"source_amount": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": null,
|
||||
"rule_source": "CIRPC36(1)m,Lei20/2009",
|
||||
"reason": "36m:perda meramente estimada em obra em curso não dedutível; custo efectivo não confundido com estimativa."
|
||||
},
|
||||
"provision_reversal": {
|
||||
"case": "additional",
|
||||
"source_amount": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": null,
|
||||
"rule_source": "CIRPC28(2)",
|
||||
"reason": "28(2):proveito da provisão antes deduzida; só acresce quando ainda não incluído no resultado."
|
||||
},
|
||||
"taxed_reversal": {
|
||||
"case": "additional",
|
||||
"source_amount": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "-50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": null,
|
||||
"rule_source": "CIRPC17/28;sem dupla tributação da parcela comprovada",
|
||||
"reason": "Parcela antes tributada comprovada; exclui a reversão contabilística sem duplicar dedução."
|
||||
},
|
||||
"prior_income": {
|
||||
"case": "additional",
|
||||
"source_amount": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"accepted": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"adjustment": {
|
||||
"numerator": "-50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"limit": null,
|
||||
"rule_source": "CIRPC18(2)",
|
||||
"reason": "18(2):conhecido/previsível no encerramento anterior; excluído do actual, sem alterar declarações/históricos anteriores."
|
||||
}
|
||||
},
|
||||
"verification": {
|
||||
"new_frontend_tests": 22,
|
||||
"private_API_tests": 1,
|
||||
"private_API_assertions": 83,
|
||||
"database": "127.0.0.1:55441/simulator_fiscal_delta_20261021_test;DatabaseTransactions rollback",
|
||||
"routes_actions": "generated by existing guarded procedure",
|
||||
"typescript": "passed",
|
||||
"build": "passed",
|
||||
"UI": "actual component;fieldediting;missingconditions;reviewed topic reconciliation;sharedcaps;local roundtrip;download;mandatory work method",
|
||||
"dossier": "generated from5 API recovered cases",
|
||||
"accepted_functional_suites": "reused,not manually repeated"
|
||||
},
|
||||
"preservation": {
|
||||
"installed5_fixture_sha256": "109426b86ae7c14463699b1d197064617f124ecec0c55085d9e81aeddc505a5a",
|
||||
"matches_accepted5_fixture": true,
|
||||
"versions1_to5_current_keys": "unchanged without optional costs input",
|
||||
"history": "old record preserved unchanged on new calculation;no rewriting prior returns",
|
||||
"other_books": "preserved in snapshot roundtrip",
|
||||
"source_plan": "reused,no re-entry of financial result/base/colecta",
|
||||
"schema_API_config_permissions_dependencies_changed": false,
|
||||
"active_data_changed": false,
|
||||
"official_fiscal_balances_consumed": false,
|
||||
"fractional_precision_delta": "Exact numerator comparison for current loss and loss-deduction cap;negative subcent result cannot be truncated to zero"
|
||||
},
|
||||
"runtime_delta_joint_from_a2de7259": [
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-costs.tsx",
|
||||
"sha256_LF": "c4156916835daf0f33addf89dfedd40c31b8dc3297112cd98beac33422af274d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-normal.tsx",
|
||||
"sha256_LF": "8001d2e71b58fa07c77f74da2c2b51566659a5d784d9e044133192c66518cb15"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-base.ts",
|
||||
"sha256_LF": "fef34966db603633eb03c9830ad3c09e7cd0ffaed49720dbab60f9dc0fd8a8fb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-costs.ts",
|
||||
"sha256_LF": "29aeb16bf8fe60bb322b5449fb3efd84b5108b06112b91be5fc76d8e897d8860"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-profit.ts",
|
||||
"sha256_LF": "26810caea4e7d177b385e36452147d84602a7b23cb5f8f23a88488d1bfaf619f"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal.ts",
|
||||
"sha256_LF": "98adf3e1c84938d27535f65afa24edc0650bfb12a1f9b32352b0d4d71c2c2035"
|
||||
}
|
||||
],
|
||||
"protected_runtime": [
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-schedules.tsx",
|
||||
"sha256_LF": "eebd6d9e4100920a5ebf91b800537ffe301fd6a994b86a3b080d673f4a9c9a42"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-assessment.ts",
|
||||
"sha256_LF": "1dc6adc0835af033ef296d12cdc1e9ef354b2f54cd36e2349b2df66e369c1ee3"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-forms.ts",
|
||||
"sha256_LF": "4e986addb9f2d74e7a80345f8f1e4d8e0b2f562c867fa6eee84880d9f72a3649"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-schedules.ts",
|
||||
"sha256_LF": "b0045fd2c072998ebb290c2a8332c26d05a1f5f746b3beb1805508147497cac8"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-taxable-base.tsx",
|
||||
"sha256_LF": "e4fe9f66d35d24aa68fd87de6a5a6a0e901706b270c18962fd0c7ab00f9abd93"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-assessment.tsx",
|
||||
"sha256_LF": "7174cc0160005a0c332ea40f02ba8a6d57985081b5ab45177ccd6e721bceea54"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/acquisition-beverage-restitution.tsx",
|
||||
"sha256_LF": "6f44897b8b12569314551df0022c26da57a165634087942a724293e66837558d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/fiscal-calculation-gaps.tsx",
|
||||
"sha256_LF": "1dab6ceb73756d4e023096b3b2ba767aaa843ff6cc69046ea630ab449a00b0dd"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/fiscal-l3-preparation.tsx",
|
||||
"sha256_LF": "e84a7b1ccadaa1b5bd78d778a3287f96ccaf530855eef404786cd7aa3d321b73"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-acquisitions.tsx",
|
||||
"sha256_LF": "c206d4cfe575d6ba007aa2b425b5f898efa97e4162b8710e358b6ecfd9458542"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-operations.tsx",
|
||||
"sha256_LF": "a7e55972fa790063dcf11945055de2af46a77db9e509900af22ede7ec47bb4cf"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-acquisition-bc.ts",
|
||||
"sha256_LF": "b0ef55e0917bdb79f14b53ba9e95d73c08153befeb7d4ce73f81e6fb13992225"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-beverage-allocation.ts",
|
||||
"sha256_LF": "32968d198c7fe0c53ca89641c22d5749be6636be2c79127b867e4e3afd0dd40d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-beverage-restitution.ts",
|
||||
"sha256_LF": "5c650cbd9469d5f99001f56fc4ff99ac973eb368036d4e96c6d171f1b220bd9e"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-calculation-gaps.ts",
|
||||
"sha256_LF": "2e7d84a0c196bd5b56fd67cc1a389d43d5041894184e675680a4de3cd10b31a2"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-operations.ts",
|
||||
"sha256_LF": "ec37b949f1233c5f5c14a87450c421ed29fabf1ed5b73fb32564564a2bc31f54"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/l3-form-preparation.ts",
|
||||
"sha256_LF": "fc47f5fa5ec1420fbd847d0d081f00d99ebbb524164eef785b20877e0562f704"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-residuals.ts",
|
||||
"sha256_LF": "40d5751c06c7c155ab4b7a17ee2d1653da2fbbf075807fbb8561cdbe19820955"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-residuals.tsx",
|
||||
"sha256_LF": "a9219d6f41ccbd0ce45659d4f6aa0fa1c169a685840f5cb1e18daeca377d5e18"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-eligibility.ts",
|
||||
"sha256_LF": "44675c5efacdc1ae19505667611ba3b522d3043cebacc8754597c3a68ca89d25"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-quarter.tsx",
|
||||
"sha256_LF": "2c2555309b32d4261f14e7164f39314c9188129c2990357fc54090a2468dd2b4"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-withholding.tsx",
|
||||
"sha256_LF": "e0445d015b72859e48726959aa52686f79b1cf5c2ade29751efa83257068b878"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-quarter.ts",
|
||||
"sha256_LF": "f66bd52e9cdfe1ddaa6b00a931465862b3d890b9be216b7a056740f027f24129"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-withholding.ts",
|
||||
"sha256_LF": "6c31b240299edd3262efa28f7f3d5aee21123f94e30ef4ab90e26c35777cb6e4"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-eligibility.tsx",
|
||||
"sha256_LF": "f48dd4a8f87a994eda0447f81a463589905e5873b2e1044debac9d10825a880c"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-acquisitions.ts",
|
||||
"sha256_LF": "cce283b1d0a07fb383fcb527225f4dd5bec829010a662cbaae1d60e595221977"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-modelo-a.ts",
|
||||
"sha256_LF": "c641619a05613c1620385baad0e9ffbf810dd970aafb30e12b3a7f9a3bf11846"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-fx-selection.ts",
|
||||
"sha256_LF": "9aa07ad443bc777b80510a3b5bd6aff9ddb9814d2450f3c690e531e74d71d998"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-fx-selection.tsx",
|
||||
"sha256_LF": "39bb6d87d404745b0b66349bc11626545a3672ae27321ce9b4658416592059bf"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/business-financial-plan.ts",
|
||||
"sha256_LF": "c20274722d1ffcd0360f041a6cacb5d868fe0621cb27a1aca6e06826612c3ebb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-currency-events.ts",
|
||||
"sha256_LF": "cc9f2045d302d7987310da4006cc250fc5c99a27397918d166d649bfc32fab08"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-fx.ts",
|
||||
"sha256_LF": "5c4a7a477429f8d775acf6db3e117008468f5554e5731dec81f60fbb75e948fb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-withholdings.ts",
|
||||
"sha256_LF": "8e5f3c035ce5e4d6c3fc82f933439ab580fa5519492f9c4d32cfb71b77b54803"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-withholdings.tsx",
|
||||
"sha256_LF": "751af4fab346659bc5ccb08b8a2169769af7521ea0035050af32b41ea7f5aa76"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-interest.ts",
|
||||
"sha256_LF": "f8e6390b3b2c58c296f7e3fd14576e06ae248bc0cabce1a666b7094611f2a7dd"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-mrfta.ts",
|
||||
"sha256_LF": "76dcce8954f68b081d500be61de9c5b146a452a3eb578a0b78776ba9e1f8051c"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-mrfta-cases.ts",
|
||||
"sha256_LF": "4266746076ab3f70312fd042351e24dd2f136c4f3e8a277b57dd97849a9f1862"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-mrfta.tsx",
|
||||
"sha256_LF": "913d1bb4ac0fc59763cf5d27bc637f6a713b2050c4463748db554af4be451538"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/financial-fiscal-bridge.ts",
|
||||
"sha256_LF": "5a30c501653b16b5fedcb12631ce81fcce4fe473aa542e94374986b3c50f2d33"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-form.tsx",
|
||||
"sha256_LF": "85b024a7f45ceb52efd6ff1f21d0eab1fd8fcf1ab59e4b5302c08685235c472a"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "a0909bbfcdf7e8542b010faa104fcb918e86ae38ddf096082d4d5be98d31b2b9"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier-report.ts",
|
||||
"sha256_LF": "5207a2ffeb208cd5ace6713038cee85208020ee618194dca7114e94fc3200b6c"
|
||||
}
|
||||
],
|
||||
"originals_preserved": [
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Comunicado-9-2026-ISPC.pdf",
|
||||
"sha256": "106f8a9ce9255c03549c70bf07fe999d32e6e55302d009b509862aa74ccb4973"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Modelo-30-ISPC.pdf",
|
||||
"sha256": "6802edd06b6ff638a0b851a3ec7ecf69af8f07840faa47446becad67d35d445c"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Modelo-B-Geral.pdf",
|
||||
"sha256": "bd977c7c59d4d98befd92e2c566b1bf168cb1343bb519f51b41a3807f431fc57"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-MRFTA-19-39.pdf",
|
||||
"sha256": "8ea62c53066b482f87078a7a7b1ecf15ca98a12a122e8d7abca63acfc993186b"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BM-Mercado-Monetario-MAIBOR-20261025.html",
|
||||
"sha256": "00e8a7e0d3a1db4ca3beb56d5361b2084a0f1684f3d40fc1c203702a2190e063"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-16-I-Serie-2008-04-16.pdf",
|
||||
"sha256": "fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-248-I-Suplemento-1-2025.pdf",
|
||||
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-89-I-Serie-2017-06-08.pdf",
|
||||
"sha256": "11f0cab15eb6e51010952203ffa24fdc533a24fd642e19525fe4f46b17a1f5e5"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-95-I-Suplemento-2025-05-21.pdf",
|
||||
"sha256": "e0e682e2c027c3cd9c1d46a73a3f48bc5f6bdbf05667fd97314d7a3f6a456358"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR252-I-Serie-2022-Lei20-PESOE.pdf",
|
||||
"sha256": "1159fd3ce1ba5581671796d083534da48bd3c5578298819e896f1c2a8026318d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-22-2021-BR70.pdf",
|
||||
"sha256": "a8fac38dcfe08f9c7a8e46254cff10e1ec82fc4f7a8d88ad6e4fe7d91ffc21a5"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-27-2026-BR123.pdf",
|
||||
"sha256": "26249c3fa58f149c81de36e99d1aac2819a4771379d9e8833159660dabf539bb"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-29-1998-BR22-5-suplemento.pdf",
|
||||
"sha256": "6242cbe675faadf085f43f95ec8c7e8868aafe67c3b2ab2bb010992288f954f8"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-3-2011-BR-11-I-mineiros.pdf",
|
||||
"sha256": "5bca1133666ba9c69870b89823420175b7b5b8d0eccb667ecdf5c29716f3b6be"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-37-2023-BR124.pdf",
|
||||
"sha256": "7e680b191481faa0e2e9057fa5053587eb2a29d1d8c819e0eb9f02814255a04c"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-9-2008-BR16.pdf",
|
||||
"sha256": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-13-2016-CIVA-BR-156-10-suplemento.pdf",
|
||||
"sha256": "b90dc7c14ecea2e378c4a62e8e5a47d54a5644c457baeb8b8053b92fd2a5710b"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-14-1992-BR42.pdf",
|
||||
"sha256": "089fff7423e99a70a230a73ca379e4ea3a91d124703f91016e57ff82794b9e56"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-17-2022-BR251-exemplar-MCNet5.pdf",
|
||||
"sha256": "14eb34f0af91a8f5cb1770c7b52d6ff839c6818302d1ed96d79afbfb9fe999d4"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-17-2022-IPP-BR250-Parlamento.pdf",
|
||||
"sha256": "978cd22403ffd336a631704ecd7a5bbd814a427c815b9acdaca5515591dd9e2a"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2013-BR76.pdf",
|
||||
"sha256": "bba96d645cc935ffc3d1a79b9f0f73ac1c693d6459c2ad41f56cd2841accae76"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2017-IRPS-BR-OCAM.pdf",
|
||||
"sha256": "c3a0186cb9ad090d7a9533006295dc9bb6a62ad0d6150173cbd49dba4ee4b52d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-2-2011-BR-1-4-suplemento-MCNet.pdf",
|
||||
"sha256": "a7543a68cc3287a46a83c39a04821b40f649dd06c4e9b5dc51ff0b47fba08899"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-20-2009-BR36-AT-exemplar19.pdf",
|
||||
"sha256": "fc1c8144db42960cbf73e717e095896f511ece0f907f58f78819b27d6917a7ee"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-22-2022-IVA-republicada-BR-250-2-suplemento.pdf",
|
||||
"sha256": "ea1b0dc6f5cf6e595f6d9a19e7042f398999e0087caef1785f6e8fac571b5f53"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-34-2007-BR52.pdf",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-1994-BR37-3-suplemento.pdf",
|
||||
"sha256": "210df9db8980d0a5690cd187a6eeec7e37a900d743e39062c16f4e0d12215c7e"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-2012-BR3.pdf",
|
||||
"sha256": "b8845cef41dcbd9ba50c43dbfa743a56030dd3d348242a107e1ae30279eec121"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-7-1991-Partidos-IFES.pdf",
|
||||
"sha256": "6b783a0bb3330688ef10660a58060d9724aa2da6a873d234fe902f0eaaeda42d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/PT-MZ-CDT-1992.pdf",
|
||||
"sha256": "d504e1024b28aee5c6acf4592acb96ec9c915a8414f67a61ab6984d6acf9df9d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/PT-MZ-Protocolo-2009.pdf",
|
||||
"sha256": "f353773dcf41f09f4daa6cf5ba5a5f7994f3e02615867c2dcffc61c3d901bf9b"
|
||||
}
|
||||
],
|
||||
"source_evidence": [
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-34-2007-BR52.pdf",
|
||||
"new_clauses": "18(2)/19 PDF6–7;28/29 PDF8–9;36e/f/h/i/4 PDF10–11",
|
||||
"use": "ordinaryconditions/rates/caps/timing,visual excerpts retained inQA"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-20-2009-BR36-AT-exemplar19.pdf",
|
||||
"new_clauses": "PDF2 retains18(1–6),adds7–10;PDF3 updates28 wording;PDF4 adds36m/n and36-A",
|
||||
"use": "provisions/estimatedworkloss/ordinary advertising1percent;campaign36-A explicitlypending"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-2012-BR3.pdf",
|
||||
"new_clauses": "PDF2 retains36a–n;adds36o",
|
||||
"use": "scope cross-check of supplied amended source"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2013-BR76.pdf",
|
||||
"new_clauses": "PDF2 retains36a–o;adds p/q",
|
||||
"use": "scope cross-check;no new related-party interest rule introduced"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-248-I-Suplemento-1-2025.pdf",
|
||||
"use": "Existing supplied scope ofLei12/2025,source acceptance and rateproof reused;no unrelated revalidation or L5 research"
|
||||
}
|
||||
],
|
||||
"case_specific_remaining": [
|
||||
{
|
||||
"case": "Overlapping36h/i exclusion and36(4)50percent",
|
||||
"example": "Fuel100,supported80,ordinary passenger vehicle",
|
||||
"condition": "Correspond explicit combination rule for the cited clauses or obtain a targeted AT clarification;no additive/proportional tax rule presumed"
|
||||
},
|
||||
{
|
||||
"case": "Rental36h quota",
|
||||
"condition": "Supply documented nonaccepted quota for supported matching;automatic vehicle-quota determination remains in asset scope"
|
||||
},
|
||||
{
|
||||
"case": "Multi-year launch campaign36-A and1percent limit",
|
||||
"condition": "Implement3exercise timing and its interaction with36n;do not treat as ordinary advertising"
|
||||
},
|
||||
{
|
||||
"case": "Regulated provisions28d,financial unwind28(3),other sector provisions",
|
||||
"condition": "Map applicable supervision/sector rule and documented balances;do not reuse ordinary29 caps"
|
||||
},
|
||||
{
|
||||
"case": "Positive deferred receipts19(5),authorised method change19(6)",
|
||||
"condition": "Map remainingcost/deferredreceipt rollforward and applicable authorisation;only knownzero deferral/unchanged method demonstrated"
|
||||
},
|
||||
{
|
||||
"case": "Specific timing18(6–10),other asset/method/shortperiod/annualFX/fiscalrepresentation/form mappings",
|
||||
"condition": "Remaining concrete L6 cases preserved in existing matrix,not closed by this ordinary increment"
|
||||
}
|
||||
],
|
||||
"m20_m22_divergence": "Unchanged and limited to result transfer201/Q8 versus200/Q10;no dependency gate in cost calculation;no new official field correspondence presumed",
|
||||
"L5_ten_questions": "unchanged,not researched;only actual dependent cases blocked",
|
||||
"L6_complete": false,
|
||||
"L7_L8_own_scopes": true,
|
||||
"installation_performed": false,
|
||||
"proof_sha256": {
|
||||
"additional.json": "b76790cb34736281fd181cbf0c871135cb42e75e1acc34ab3c42ed7e696ad5b1",
|
||||
"api.txt": "dff9be0d1338e833adf5c7f10dc4c4e5d5cefde97f284db927608f3c3c334be2",
|
||||
"build-exit.txt": "13bf7b3039c63bf5a50491fa3cfd8eb4e699d1ba1436315aef9cbe5711530354",
|
||||
"build.txt": "21ce0d3af4edc5c74d5cbeebd817b4716b233b0eb54ad03b1f22ebe80edd844a",
|
||||
"calculated.json": "23119339a0337c755f2a045078903858b7da6b95196a91de51170ca115d468a7",
|
||||
"closing.json": "9f87eec9710aeec4819a7b10b64986ad9e4afbb458cd95a49a8f6f035c235ad8",
|
||||
"Decreto-9-2008-BR16.txt": "c680dfb73eeb638cf85d06fb0fe19550487de2994ce76f60077ef4baa88e3238",
|
||||
"dossier-additional.json": "19ad04483c38306982cd182e08445952ec1e5ad5ce821cc345df5ccf75ac4a7a",
|
||||
"dossier-calculated.json": "99c4bff798b7338138216a405aa5de228e88429af3c12290bf1b7071bd40e01a",
|
||||
"dossier-closing.json": "d054eb3da44363d3861037c7bb59074572f630078f6d3aa3d2e4de89983928b0",
|
||||
"dossier-limits.json": "52aaea2415159cacdbc44d56a98918a8438e3bacde06199e0545a265b7d6982d",
|
||||
"dossier-missing.json": "50eff5af4b909ef08f4619ac768d5e8f8d4de01d003c81ef3748bd74a9bccfe2",
|
||||
"dossier.mjs": "0824a3b05fa4bf758bbb165c0fce74fe9cd6ab817ceda5437ef7c73b28794a46",
|
||||
"download.html": "ebf40a955530b10753da0cfd7769c0ad879b079bdade64f4e06ec901912456df",
|
||||
"frontend.txt": "c6aa5222a8b5c867e50a2aca4ab5edd6ab9812f9fb2f6bce8482092951e022bd",
|
||||
"index.html": "09941968500d2910121bdcb0029e326fc6d44bb025b01766654289a28caa62fa",
|
||||
"Lei-19-2013-BR76-page2.png": "952cb5d68fa162043964c282b1ac32faf8bcbb92f2bb83fef2084ae691afae12",
|
||||
"Lei-19-2013-BR76.txt": "7060584c3e59f0b2f12f34aa0b40faadf4aa5790a0459f3319852bcd63262cbb",
|
||||
"Lei-20-2009-BR36-AT-exemplar19-page2.png": "e39eadef731b6c3ae8cb4820238c4db3184111557d982a20dadee139ea2952a2",
|
||||
"Lei-20-2009-BR36-AT-exemplar19-page3.png": "a4a39a81849f32e4c596ef7c0726d2054e74bf45531dd8e920d3927cafdb70bd",
|
||||
"Lei-20-2009-BR36-AT-exemplar19-page4.png": "cafa0e22b0f29296bd28772609fa87708811704c25ae7bf676dba53783e25168",
|
||||
"Lei-20-2009-BR36-AT-exemplar19.txt": "2e04eb1c5be52619e21eb1c376f71603d998672f4c220e0bfc1648df80d5e6fe",
|
||||
"Lei-34-2007-BR52-page10.png": "74937b18d2863c1199e88380e25d39c7ada80c37621196e5402bffa61f6b49be",
|
||||
"Lei-34-2007-BR52-page6.png": "de2c1cc9c8bf5b0cefa9671cc8ad776e21a8492b791648be492d1540d78f748f",
|
||||
"Lei-34-2007-BR52-page8.png": "f69bbe8484e315a5bf5818277c1bb3d67e4e86724544b34565731d5c3f4408df",
|
||||
"Lei-34-2007-BR52-page9.png": "e449f13d39c9f23e408c185e00bafd621706d9cccd037d399e602eece33b6ba5",
|
||||
"Lei-4-2012-BR3-page2.png": "99c5a820ad1e1201af25f60b51c86b3c7bced25acc12343366eadb3133185128",
|
||||
"Lei-4-2012-BR3.txt": "9478ac3ef61ae9df286d951edbfce4c24049f65e860f053ed9eb2c3fbd78d051",
|
||||
"limits.json": "c73905029246c1bbdf91b24869582b6057d62d01dd853e76d2e603786d8810ea",
|
||||
"missing.json": "159c4d3f21d87ff3ea43ad5cfa8a42faea05105feab0a4b5529d37e72d9aea73",
|
||||
"originals-inventory.json": "f91baf686619187dac23bce2c3bde71cc7ddf201fef10a24479548c44abc7d94",
|
||||
"preparation.html": "e9951a85471c44fd9ff5211e59a8eb740e5b8823a4bb6b63c12237feb3d997fd",
|
||||
"qa.tsx": "58e66698e44d68d169117a70d0d15aa07ce77b88bed1234d922d0844a9aac9b0",
|
||||
"recovered-additional.html": "3f562a91fcc2ba6f47c1661f13a39a6c7d939c4730bd4ba9178b60fb05d5b6a6",
|
||||
"recovered-additional.json": "a7adf543887479edf259d2501fe061a14c8aa03e206848726fae0f567b594419",
|
||||
"recovered-calculated.html": "e9951a85471c44fd9ff5211e59a8eb740e5b8823a4bb6b63c12237feb3d997fd",
|
||||
"recovered-calculated.json": "e000b426aefbfad520fe2a03707ca756a87fe04ab39536d509008e03c6288c2b",
|
||||
"recovered-closing.html": "d17bd5944b2f37d752883b22955bcd3c57695f72b464580087403dfa448d785e",
|
||||
"recovered-closing.json": "5f1b2cbe830154e35e60512882aa023fdc443125cf37253e10b85af7f47dddb2",
|
||||
"recovered-limits.html": "4b24bebe5b4d93bc6b06233d795197bb28ca4116eb29832981bafb33804d1a2d",
|
||||
"recovered-limits.json": "28611229e027a0d51593ecf71bae32b6f35f7f2767c26680fa2dceb0e7d9ad11",
|
||||
"recovered-missing.html": "6fa22cb9757a5812d23a1615a43337f20ba1812097d8b4d79c1a3db1a356d8dd",
|
||||
"recovered-missing.json": "b5aa2c3045d79193518621b4764540775470db97bdbc84ac19804c70baa05324",
|
||||
"types.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"ui-calculated.png": "3c1070fbb0b9ca66d1b128935ab23e737a11ee2918fc566259a5d70bbae4aa26",
|
||||
"ui-missing.png": "d0c1c138e9b2404ae8a17c0732d8ab1b7bfbcf89ff431aa4d80e3dfaf7f8d5db",
|
||||
"ui-proof.json": "108af6bd1557c6a920842102b1a9b54711fc3ab96e32296e1c2c3f77abda177a",
|
||||
"ui.cjs": "2de9dd0e333edca1a3fd23a6e409cd41271f619cfb2186bbfdf6444855dd35d0",
|
||||
"ui.txt": "8799b836baa3cf8efefce8a5b0b6951c7963e50fb3e08b0be3d2de3434ff4795",
|
||||
"vite.config.ts": "2ad3c19a485d8175b33550b017f2a67934f9fbebda5f6f16e69b9fb89809c398"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,869 +0,0 @@
|
||||
{
|
||||
"status": "short_period_and_foreign_currency_plan_QA_prepared_not_installed",
|
||||
"installed_baseline": "e9fe102259c183a9d9bf7e39f246a8c3860839c6",
|
||||
"branch": "codex/irpc-l6-periods-fx-qa-20261026",
|
||||
"version": "IRPC-normal-adjustments/8",
|
||||
"cases_recovered": {
|
||||
"short": {
|
||||
"accountingProfit": {
|
||||
"numerator": "3120",
|
||||
"denominator": "1"
|
||||
},
|
||||
"taxableProfit": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"taxableBase": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"colecta": {
|
||||
"numerator": "5008",
|
||||
"denominator": "5"
|
||||
},
|
||||
"period": {
|
||||
"version": 1,
|
||||
"kind": "start",
|
||||
"from": "2026-07-01",
|
||||
"to": "2026-12-31",
|
||||
"planStart": "2026-01-01",
|
||||
"reference": "QA início documentado1Julho;correspondência completa dos meses7–12 ao período do sujeito",
|
||||
"conversionReference": "",
|
||||
"mznMapsReference": "QA activo/quotas/juros e demais mapas reconciliados explicitamente emMZN no período",
|
||||
"months": []
|
||||
},
|
||||
"pending": []
|
||||
},
|
||||
"fx": {
|
||||
"accountingProfit": {
|
||||
"numerator": "199680",
|
||||
"denominator": "1"
|
||||
},
|
||||
"taxableProfit": {
|
||||
"numerator": "200320",
|
||||
"denominator": "1"
|
||||
},
|
||||
"taxableBase": {
|
||||
"numerator": "200320",
|
||||
"denominator": "1"
|
||||
},
|
||||
"colecta": {
|
||||
"numerator": "320512",
|
||||
"denominator": "5"
|
||||
},
|
||||
"period": {
|
||||
"version": 1,
|
||||
"kind": "start",
|
||||
"from": "2026-07-01",
|
||||
"to": "2026-12-31",
|
||||
"planStart": "2026-01-01",
|
||||
"reference": "QA início documentado1Julho;correspondência completa dos meses7–12 ao período do sujeito",
|
||||
"conversionReference": "QA pressuposto de simulação64MZN/USD aplicado aos meses seleccionados;sem regra fiscal anual confirmada",
|
||||
"mznMapsReference": "QA activo/quotas/juros e demais mapas reconciliados explicitamente emMZN no período",
|
||||
"months": [
|
||||
{
|
||||
"period": 7,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.920Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"period": 8,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.920Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"period": 9,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.920Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"period": 10,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.920Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"period": 11,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.920Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"period": 12,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.920Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"pending": []
|
||||
},
|
||||
"missing": {
|
||||
"accountingProfit": null,
|
||||
"taxableProfit": null,
|
||||
"taxableBase": null,
|
||||
"colecta": null,
|
||||
"period": {
|
||||
"version": 1,
|
||||
"kind": "start",
|
||||
"from": "2026-07-01",
|
||||
"to": "2026-12-31",
|
||||
"planStart": "2026-01-01",
|
||||
"reference": "QA início documentado1Julho;correspondência completa dos meses7–12 ao período do sujeito",
|
||||
"conversionReference": "QA pressuposto de simulação64MZN/USD aplicado aos meses seleccionados;sem regra fiscal anual confirmada",
|
||||
"mznMapsReference": "QA activo/quotas/juros e demais mapas reconciliados explicitamente emMZN no período",
|
||||
"months": [
|
||||
{
|
||||
"period": 7,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.924Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"period": 8,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.924Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"period": 9,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.924Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"period": 10,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.924Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"period": 11,
|
||||
"currency": "USD",
|
||||
"fxSelection": {
|
||||
"nature": "commercial",
|
||||
"submissionDate": "2026-10-26",
|
||||
"bulletinDate": "2026-10-26",
|
||||
"bulletinRef": "QA pressuposto sintético64; não boletim real",
|
||||
"source": "https://www.bancomoc.mz/",
|
||||
"sourceCurrency": "USD",
|
||||
"direction": "mzn_per_unit",
|
||||
"bulletinPerspective": "",
|
||||
"relation": "",
|
||||
"buy": "",
|
||||
"sell": "",
|
||||
"mean": "64",
|
||||
"mode": "general",
|
||||
"exceptionRef": "",
|
||||
"exceptionScope": "",
|
||||
"exceptionDate": "",
|
||||
"exceptionRate": "",
|
||||
"applied": {
|
||||
"column": "mean",
|
||||
"rate": "64",
|
||||
"date": "2026-10-26",
|
||||
"source": "QA pressuposto sintético64; não boletim real;https://www.bancomoc.mz/;perspectiva:média de referênciaBM;natureza:commercial;relação:não aplicável à média;Orientação operacional expressa da Tempo,25/10/2026:compra de moeda→taxa de compra;venda→taxa de venda;operações comerciais→taxa média de referência do Banco de Moçambique na data de submissão indicada. Interpretar compra/venda pela perspectiva do boletim. Excepções fiscais específicas conservam disposição,data,taxa e âmbito;sem recálculo automático dos históricos.",
|
||||
"selectedAt": "2026-10-26T07:51:24.924Z",
|
||||
"selectionKey": "{\"nature\":\"commercial\",\"submissionDate\":\"2026-10-26\",\"bulletinDate\":\"2026-10-26\",\"bulletinRef\":\"QA pressuposto sintético64; não boletim real\",\"source\":\"https://www.bancomoc.mz/\",\"sourceCurrency\":\"USD\",\"direction\":\"mzn_per_unit\",\"bulletinPerspective\":\"\",\"relation\":\"\",\"buy\":\"\",\"sell\":\"\",\"mean\":\"64\",\"mode\":\"general\",\"exceptionRef\":\"\",\"exceptionScope\":\"\",\"exceptionDate\":\"\",\"exceptionRate\":\"\"}"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"pending": [
|
||||
"revenue/mês12: Error: Selecção cambial deste mês/moeda em falta;sem usar taxa de outro mês por defeito.",
|
||||
"cost_of_sales/mês12: Error: Selecção cambial deste mês/moeda em falta;sem usar taxa de outro mês por defeito.",
|
||||
"operating_expenses/mês12: Error: Selecção cambial deste mês/moeda em falta;sem usar taxa de outro mês por defeito.",
|
||||
"personnel/mês12: Error: Selecção cambial deste mês/moeda em falta;sem usar taxa de outro mês por defeito.",
|
||||
"depreciation/mês12: Error: Selecção cambial deste mês/moeda em falta;sem usar taxa de outro mês por defeito.",
|
||||
"interest_expense/mês12: Error: Selecção cambial deste mês/moeda em falta;sem usar taxa de outro mês por defeito."
|
||||
]
|
||||
},
|
||||
"loss": {
|
||||
"accountingProfit": {
|
||||
"numerator": "3120",
|
||||
"denominator": "1"
|
||||
},
|
||||
"taxableProfit": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"taxableBase": null,
|
||||
"colecta": null,
|
||||
"period": {
|
||||
"version": 1,
|
||||
"kind": "start",
|
||||
"from": "2026-07-01",
|
||||
"to": "2026-12-31",
|
||||
"planStart": "2026-01-01",
|
||||
"reference": "QA início documentado1Julho;correspondência completa dos meses7–12 ao período do sujeito",
|
||||
"conversionReference": "",
|
||||
"mznMapsReference": "QA activo/quotas/juros e demais mapas reconciliados explicitamente emMZN no período",
|
||||
"months": []
|
||||
},
|
||||
"pending": []
|
||||
}
|
||||
},
|
||||
"verification": {
|
||||
"frontend_tests": 13,
|
||||
"API_tests": 1,
|
||||
"API_assertions": 58,
|
||||
"database": "127.0.0.1:55441/simulator_fiscal_delta_20261021_test;DatabaseTransactions rollback",
|
||||
"routes_actions": "generated by guarded existing procedure",
|
||||
"typescript": "passed",
|
||||
"build": "passed",
|
||||
"UI": "actual component;dates/FX edit+confirmation;originals/assumptions;save/recovery/export;missingdata",
|
||||
"accepted_proofs": "reused"
|
||||
},
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-normal.tsx",
|
||||
"sha256_LF": "557714bb3af75080e443ae67b11a66d9feb49d9a4b269065769b128a6d712837"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-period-fx.tsx",
|
||||
"sha256_LF": "4b5f718b5ef415ecf5f96dabb0e3806254558c20905de6478e10dacf67569c49"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-schedules.tsx",
|
||||
"sha256_LF": "3768c316d5887d337eb3647671863c9464f961d1df4703403e7d57e5641273ed"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-assessment.ts",
|
||||
"sha256_LF": "a9b3ced852e37e3e087ce5dab1add4ec0737145ce19f61857a54d5d3d24a6f8c"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-base.ts",
|
||||
"sha256_LF": "22019d678f6eb16fead2207dc3d3fa9fd63413c6254633c1ffd4f1c0320344ac"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-costs.ts",
|
||||
"sha256_LF": "471457692a2a2f70a1bd1c7abb38d3ce42f07b62a63e5a4ab985ad1bbd068b46"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-depreciation.ts",
|
||||
"sha256_LF": "1dad3053157aeac44f6d3bd58885cfc47a73c19d2808284c16931679dfe4291b"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-period-fx.ts",
|
||||
"sha256_LF": "a2e7b066623eae17f0d8185d065d0adf5d3a485f780f8b09118a664dc4ba0531"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal.ts",
|
||||
"sha256_LF": "e4de2fe0421e489bf555885b9cbb459c00ee77803ea9b6e5af45179bd6bb4f21"
|
||||
}
|
||||
],
|
||||
"protected_runtime": [
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-depreciation.tsx",
|
||||
"sha256_LF": "1f9918bfb435bb5b7c0ddd2fafd7bace2a02514c6ece04b93f15975e494a5f53"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-profit.ts",
|
||||
"sha256_LF": "909e129a0245e6bf098317485b886a2d19e02c64bbfd9c6f718e98ec6b935b8d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-schedules.ts",
|
||||
"sha256_LF": "edfb6fd338411fa8f87a6bdf9a9d4fd5c6dc2fad9d2eb3d32f2640e2951cbbe9"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-costs.tsx",
|
||||
"sha256_LF": "c4156916835daf0f33addf89dfedd40c31b8dc3297112cd98beac33422af274d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal-forms.ts",
|
||||
"sha256_LF": "4e986addb9f2d74e7a80345f8f1e4d8e0b2f562c867fa6eee84880d9f72a3649"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-taxable-base.tsx",
|
||||
"sha256_LF": "e4fe9f66d35d24aa68fd87de6a5a6a0e901706b270c18962fd0c7ab00f9abd93"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-assessment.tsx",
|
||||
"sha256_LF": "7174cc0160005a0c332ea40f02ba8a6d57985081b5ab45177ccd6e721bceea54"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/acquisition-beverage-restitution.tsx",
|
||||
"sha256_LF": "6f44897b8b12569314551df0022c26da57a165634087942a724293e66837558d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/fiscal-calculation-gaps.tsx",
|
||||
"sha256_LF": "1dab6ceb73756d4e023096b3b2ba767aaa843ff6cc69046ea630ab449a00b0dd"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/fiscal-l3-preparation.tsx",
|
||||
"sha256_LF": "e84a7b1ccadaa1b5bd78d778a3287f96ccaf530855eef404786cd7aa3d321b73"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-acquisitions.tsx",
|
||||
"sha256_LF": "c206d4cfe575d6ba007aa2b425b5f898efa97e4162b8710e358b6ecfd9458542"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-operations.tsx",
|
||||
"sha256_LF": "a7e55972fa790063dcf11945055de2af46a77db9e509900af22ede7ec47bb4cf"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-acquisition-bc.ts",
|
||||
"sha256_LF": "b0ef55e0917bdb79f14b53ba9e95d73c08153befeb7d4ce73f81e6fb13992225"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-beverage-allocation.ts",
|
||||
"sha256_LF": "32968d198c7fe0c53ca89641c22d5749be6636be2c79127b867e4e3afd0dd40d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-beverage-restitution.ts",
|
||||
"sha256_LF": "5c650cbd9469d5f99001f56fc4ff99ac973eb368036d4e96c6d171f1b220bd9e"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-calculation-gaps.ts",
|
||||
"sha256_LF": "2e7d84a0c196bd5b56fd67cc1a389d43d5041894184e675680a4de3cd10b31a2"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-operations.ts",
|
||||
"sha256_LF": "ec37b949f1233c5f5c14a87450c421ed29fabf1ed5b73fb32564564a2bc31f54"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/l3-form-preparation.ts",
|
||||
"sha256_LF": "fc47f5fa5ec1420fbd847d0d081f00d99ebbb524164eef785b20877e0562f704"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-residuals.ts",
|
||||
"sha256_LF": "40d5751c06c7c155ab4b7a17ee2d1653da2fbbf075807fbb8561cdbe19820955"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-residuals.tsx",
|
||||
"sha256_LF": "a9219d6f41ccbd0ce45659d4f6aa0fa1c169a685840f5cb1e18daeca377d5e18"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-eligibility.ts",
|
||||
"sha256_LF": "44675c5efacdc1ae19505667611ba3b522d3043cebacc8754597c3a68ca89d25"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-quarter.tsx",
|
||||
"sha256_LF": "2c2555309b32d4261f14e7164f39314c9188129c2990357fc54090a2468dd2b4"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-withholding.tsx",
|
||||
"sha256_LF": "e0445d015b72859e48726959aa52686f79b1cf5c2ade29751efa83257068b878"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-quarter.ts",
|
||||
"sha256_LF": "f66bd52e9cdfe1ddaa6b00a931465862b3d890b9be216b7a056740f027f24129"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/ispc-withholding.ts",
|
||||
"sha256_LF": "6c31b240299edd3262efa28f7f3d5aee21123f94e30ef4ab90e26c35777cb6e4"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-ispc-eligibility.tsx",
|
||||
"sha256_LF": "f48dd4a8f87a994eda0447f81a463589905e5873b2e1044debac9d10825a880c"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-acquisitions.ts",
|
||||
"sha256_LF": "cce283b1d0a07fb383fcb527225f4dd5bec829010a662cbaae1d60e595221977"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-modelo-a.ts",
|
||||
"sha256_LF": "c641619a05613c1620385baad0e9ffbf810dd970aafb30e12b3a7f9a3bf11846"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-fx-selection.ts",
|
||||
"sha256_LF": "9aa07ad443bc777b80510a3b5bd6aff9ddb9814d2450f3c690e531e74d71d998"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-fx-selection.tsx",
|
||||
"sha256_LF": "39bb6d87d404745b0b66349bc11626545a3672ae27321ce9b4658416592059bf"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/business-financial-plan.ts",
|
||||
"sha256_LF": "c20274722d1ffcd0360f041a6cacb5d868fe0621cb27a1aca6e06826612c3ebb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-currency-events.ts",
|
||||
"sha256_LF": "cc9f2045d302d7987310da4006cc250fc5c99a27397918d166d649bfc32fab08"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-fx.ts",
|
||||
"sha256_LF": "5c4a7a477429f8d775acf6db3e117008468f5554e5731dec81f60fbb75e948fb"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-withholdings.ts",
|
||||
"sha256_LF": "8e5f3c035ce5e4d6c3fc82f933439ab580fa5519492f9c4d32cfb71b77b54803"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-withholdings.tsx",
|
||||
"sha256_LF": "751af4fab346659bc5ccb08b8a2169769af7521ea0035050af32b41ea7f5aa76"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-interest.ts",
|
||||
"sha256_LF": "f8e6390b3b2c58c296f7e3fd14576e06ae248bc0cabce1a666b7094611f2a7dd"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-mrfta.ts",
|
||||
"sha256_LF": "76dcce8954f68b081d500be61de9c5b146a452a3eb578a0b78776ba9e1f8051c"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-mrfta-cases.ts",
|
||||
"sha256_LF": "4266746076ab3f70312fd042351e24dd2f136c4f3e8a277b57dd97849a9f1862"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-mrfta.tsx",
|
||||
"sha256_LF": "913d1bb4ac0fc59763cf5d27bc637f6a713b2050c4463748db554af4be451538"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/financial-fiscal-bridge.ts",
|
||||
"sha256_LF": "5a30c501653b16b5fedcb12631ce81fcce4fe473aa542e94374986b3c50f2d33"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-form.tsx",
|
||||
"sha256_LF": "85b024a7f45ceb52efd6ff1f21d0eab1fd8fcf1ab59e4b5302c08685235c472a"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "a0909bbfcdf7e8542b010faa104fcb918e86ae38ddf096082d4d5be98d31b2b9"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier-report.ts",
|
||||
"sha256_LF": "5207a2ffeb208cd5ace6713038cee85208020ee618194dca7114e94fc3200b6c"
|
||||
}
|
||||
],
|
||||
"originals_preserved": [
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Comunicado-9-2026-ISPC.pdf",
|
||||
"sha256": "106f8a9ce9255c03549c70bf07fe999d32e6e55302d009b509862aa74ccb4973"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Modelo-30-ISPC.pdf",
|
||||
"sha256": "6802edd06b6ff638a0b851a3ec7ecf69af8f07840faa47446becad67d35d445c"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-Modelo-B-Geral.pdf",
|
||||
"sha256": "bd977c7c59d4d98befd92e2c566b1bf168cb1343bb519f51b41a3807f431fc57"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/AT-MRFTA-19-39.pdf",
|
||||
"sha256": "8ea62c53066b482f87078a7a7b1ecf15ca98a12a122e8d7abca63acfc993186b"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BM-Mercado-Monetario-MAIBOR-20261025.html",
|
||||
"sha256": "00e8a7e0d3a1db4ca3beb56d5361b2084a0f1684f3d40fc1c203702a2190e063"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-16-I-Serie-2008-04-16.pdf",
|
||||
"sha256": "fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-248-I-Suplemento-1-2025.pdf",
|
||||
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-89-I-Serie-2017-06-08.pdf",
|
||||
"sha256": "11f0cab15eb6e51010952203ffa24fdc533a24fd642e19525fe4f46b17a1f5e5"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR-95-I-Suplemento-2025-05-21.pdf",
|
||||
"sha256": "e0e682e2c027c3cd9c1d46a73a3f48bc5f6bdbf05667fd97314d7a3f6a456358"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/BR252-I-Serie-2022-Lei20-PESOE.pdf",
|
||||
"sha256": "1159fd3ce1ba5581671796d083534da48bd3c5578298819e896f1c2a8026318d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-22-2021-BR70.pdf",
|
||||
"sha256": "a8fac38dcfe08f9c7a8e46254cff10e1ec82fc4f7a8d88ad6e4fe7d91ffc21a5"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-27-2026-BR123.pdf",
|
||||
"sha256": "26249c3fa58f149c81de36e99d1aac2819a4771379d9e8833159660dabf539bb"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-29-1998-BR22-5-suplemento.pdf",
|
||||
"sha256": "6242cbe675faadf085f43f95ec8c7e8868aafe67c3b2ab2bb010992288f954f8"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-3-2011-BR-11-I-mineiros.pdf",
|
||||
"sha256": "5bca1133666ba9c69870b89823420175b7b5b8d0eccb667ecdf5c29716f3b6be"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-37-2023-BR124.pdf",
|
||||
"sha256": "7e680b191481faa0e2e9057fa5053587eb2a29d1d8c819e0eb9f02814255a04c"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Decreto-9-2008-BR16.pdf",
|
||||
"sha256": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-13-2016-CIVA-BR-156-10-suplemento.pdf",
|
||||
"sha256": "b90dc7c14ecea2e378c4a62e8e5a47d54a5644c457baeb8b8053b92fd2a5710b"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-14-1992-BR42.pdf",
|
||||
"sha256": "089fff7423e99a70a230a73ca379e4ea3a91d124703f91016e57ff82794b9e56"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-17-2022-BR251-exemplar-MCNet5.pdf",
|
||||
"sha256": "14eb34f0af91a8f5cb1770c7b52d6ff839c6818302d1ed96d79afbfb9fe999d4"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-17-2022-IPP-BR250-Parlamento.pdf",
|
||||
"sha256": "978cd22403ffd336a631704ecd7a5bbd814a427c815b9acdaca5515591dd9e2a"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2013-BR76.pdf",
|
||||
"sha256": "bba96d645cc935ffc3d1a79b9f0f73ac1c693d6459c2ad41f56cd2841accae76"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-19-2017-IRPS-BR-OCAM.pdf",
|
||||
"sha256": "c3a0186cb9ad090d7a9533006295dc9bb6a62ad0d6150173cbd49dba4ee4b52d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-2-2011-BR-1-4-suplemento-MCNet.pdf",
|
||||
"sha256": "a7543a68cc3287a46a83c39a04821b40f649dd06c4e9b5dc51ff0b47fba08899"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-20-2009-BR36-AT-exemplar19.pdf",
|
||||
"sha256": "fc1c8144db42960cbf73e717e095896f511ece0f907f58f78819b27d6917a7ee"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-22-2022-IVA-republicada-BR-250-2-suplemento.pdf",
|
||||
"sha256": "ea1b0dc6f5cf6e595f6d9a19e7042f398999e0087caef1785f6e8fac571b5f53"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-34-2007-BR52.pdf",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-1994-BR37-3-suplemento.pdf",
|
||||
"sha256": "210df9db8980d0a5690cd187a6eeec7e37a900d743e39062c16f4e0d12215c7e"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-4-2012-BR3.pdf",
|
||||
"sha256": "b8845cef41dcbd9ba50c43dbfa743a56030dd3d348242a107e1ae30279eec121"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/Lei-7-1991-Partidos-IFES.pdf",
|
||||
"sha256": "6b783a0bb3330688ef10660a58060d9724aa2da6a873d234fe902f0eaaeda42d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/PT-MZ-CDT-1992.pdf",
|
||||
"sha256": "d504e1024b28aee5c6acf4592acb96ec9c915a8414f67a61ab6984d6acf9df9d"
|
||||
},
|
||||
{
|
||||
"path": "docs/investmoz/simulations/source-archive/PT-MZ-Protocolo-2009.pdf",
|
||||
"sha256": "f353773dcf41f09f4daa6cf5ba5a5f7994f3e02615867c2dcffc61c3d901bf9b"
|
||||
}
|
||||
],
|
||||
"source_evidence": {
|
||||
"CIRPC": "Lei34/2007 PDF4 art7(4)/(7),PDF12 art41(5);original preserved",
|
||||
"decree72_reused_sha256": "922ef67cb0c1111405c3c0a092d8c302a74fba8a34d627b6e9e13223612e0659",
|
||||
"visual_pages": [
|
||||
"cirpc-page4.png",
|
||||
"cirpc-page12.png",
|
||||
"decreto72-page3.png"
|
||||
]
|
||||
},
|
||||
"installed7_fixture_sha256": "d58beac3cf7db665a632f516a736f754a5874f82585291dfbc5fa6bcda654d0d",
|
||||
"history_versions1_to7": "unchanged;optional8;source plan not rewritten",
|
||||
"FX_engine": "Existing selectFx/convertIrpcAmount/convertCents/direction/evidence/link unchanged;monthly assumptions explicit;no fiscal annual rule asserted",
|
||||
"FX_rate64": "synthetic QA assumption,not real BM bulletin",
|
||||
"schema_API_config_permissions_dependencies_changed": false,
|
||||
"active_data_changed": false,
|
||||
"L6_complete": false,
|
||||
"L7_L8_own_scopes": true,
|
||||
"remaining_reference": "Same matrix section26/10 períodos curtos e planos noutra moeda;concrete conditions per case",
|
||||
"proof_sha256": {
|
||||
"api.txt": "e2c50de5a45a76cdd596d4093974b88c449d23ba8011edf5f8a6325d2cf01d07",
|
||||
"build-exit.txt": "13bf7b3039c63bf5a50491fa3cfd8eb4e699d1ba1436315aef9cbe5711530354",
|
||||
"build.txt": "9b167ca7bcd724a65f6a4030a46ce9e81accaad5a2e80160b623ca3807400bc7",
|
||||
"cirpc-page12.png": "12bb97ef4964b69816c30894bca201cedf2dcbadb29b3be9e867f2325e575abd",
|
||||
"cirpc-page4.png": "3f6fdfd75d4fef4d07f461969675118f5f000c33ab593fcb6e0ee0fc93f56737",
|
||||
"cirpc.txt": "c3ba3b845fcb12c25bc28b08485f3e5d70034895ece4ff60cf640fd0be796f9a",
|
||||
"decreto-72-2013.pdf": "922ef67cb0c1111405c3c0a092d8c302a74fba8a34d627b6e9e13223612e0659",
|
||||
"decreto72-page3.png": "4a150dd00dc7c7d4602c231bb42ebea5d7505917f1e21781c2d967cf5da8e327",
|
||||
"dossier-fx.json": "5d1e429a48e8fd6c53a9116b3176641146e2aa6b68c888558ac6c4ff0950138c",
|
||||
"dossier-loss.json": "862ee41f5b38546255335ab569039e52388d64f7bf30f38c3033f6f583e04d7c",
|
||||
"dossier-missing.json": "514c2386e8e1cd687545c880fd5e66a0099c851433c0c8f337439a69e56db5b1",
|
||||
"dossier-short.json": "cdab2ed8019f46f132f600c6b301d99ad44e8027926117abf3e57eb6c6000071",
|
||||
"dossier.mjs": "cd967cfdba196bf0b7c691fe418f38dd39232030c6e601c22f8e25bd27e93d46",
|
||||
"download.html": "95f59ff469af21bc2a41225358769bf99f25cf056479ff9a9c3d1dad4cb5f521",
|
||||
"frontend.txt": "d9c7e51b63e020bf35d2a4a3aa22f29ca71d003e4bcf22b111e90173e442745b",
|
||||
"fx.html": "5bae85164ca7cec78d76fc4c72c3c33cdaca70c63c42929c8e037ab7e91ba93f",
|
||||
"fx.json": "e92ed4b718eef390aef573728a459679fdd3130bdf923db4cfd8f7a560958fbf",
|
||||
"index.html": "09941968500d2910121bdcb0029e326fc6d44bb025b01766654289a28caa62fa",
|
||||
"loss.html": "b672fd43361efcc81c4da4f83b7eba12dd9bd7799de0b463f248928065a4de97",
|
||||
"loss.json": "07e56fb88034d377ca9bc2b098b9a4a266058a46aeb7b127a99b3c539bceec1b",
|
||||
"missing.html": "ed41bf1b5ffab532a59b8e07d8a3700bd62576bc15c9256750c84a371a2cbc8a",
|
||||
"missing.json": "5022f8eddd7f09b9a10a837f0e407e7db3619e27302e19f367923a956ebe47a6",
|
||||
"qa.tsx": "c7c06f793e4a5aa3df70f36ec6681a6399b6016f27168d18917be2f22dffdbaf",
|
||||
"recovered-fx.html": "5bae85164ca7cec78d76fc4c72c3c33cdaca70c63c42929c8e037ab7e91ba93f",
|
||||
"recovered-fx.json": "2c7d1e8858af254930bff8a420f3369475ebd335ca4251b4ddc691558ed1c9aa",
|
||||
"recovered-loss.html": "b672fd43361efcc81c4da4f83b7eba12dd9bd7799de0b463f248928065a4de97",
|
||||
"recovered-loss.json": "2618a36d92005ebf791c938687662789086d351606f95f62f4eb1133f4b029e2",
|
||||
"recovered-missing.html": "ed41bf1b5ffab532a59b8e07d8a3700bd62576bc15c9256750c84a371a2cbc8a",
|
||||
"recovered-missing.json": "094b1ee4822bdcee6ac8ce5dc9ea5cfc178bf555b15f31a6cd2a1c6becd759ae",
|
||||
"recovered-short.html": "955f182b29c160774bacc8997477c2da44cd1fcc401d1ed1955fa62f9f94d743",
|
||||
"recovered-short.json": "e4399308561d5f412c9bb803c83fd6e045d89d24986a4d6a8279c2977044bb96",
|
||||
"short.html": "955f182b29c160774bacc8997477c2da44cd1fcc401d1ed1955fa62f9f94d743",
|
||||
"short.json": "a6b0e4ea322353f84c0ba6ff09d6cf89ee270dbefb850f225c4f8fe4485f68fb",
|
||||
"types.txt": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"ui-fx.png": "deaede13c0c4eb6cc74ce0a55fc9b7bc2948f52fe7863ffc53ab83ca42456587",
|
||||
"ui-proof.json": "56b6005ea84dfd370ac55167a5f47d19bffcee8408982c2046cb1ad27ecc9f20",
|
||||
"ui-short.png": "b716d583fc3ca286c2e19cbeefca018ec08e8b75e0e95499ff7d27ab06a843d6",
|
||||
"ui.cjs": "1f5506f7865cdbfcfa8aea853be241bab849807e6d641f3c5596534727cb5938",
|
||||
"ui.txt": "85e77d9f361edf72d68990272040cc9b6edab3cc0873f921b1d5e561dc0553af",
|
||||
"vite.config.ts": "0351ec239d5a6ba429ee17b9aa68757e31f59902f8f88a522afdd56bd3b44879"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,789 @@
|
||||
{
|
||||
"status": "L7_combinations_installed",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"release": "/var/www/investmoz-homologacao/releases/f8d57bddf96b4610604a013fcc5bdd703c7dc6d5-7a31e8ac",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"previous_installed": "a7434cd27c09df3d8e6c586f9676b67abcde798e",
|
||||
"preserved_fiscal_delivery": "632dc069",
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-irpc-l7-combinations-delivery-20261026/backup",
|
||||
"created_at": "2026-10-26T14:20:47Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "2a069fcda7a89368323cda9d5339e76e545b85088de594c1e5a585891dd7b3c3",
|
||||
"files_sha256": "289ebdcb8cf1983f8fcdb237d3fb947d43fbe71a575064cede233368d43b4584",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "irpc_l7_combinations_restore_20261026",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "2a069fcda7a89368323cda9d5339e76e545b85088de594c1e5a585891dd7b3c3",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"backup_restore_verified": true,
|
||||
"capacity_before_recovery": {
|
||||
"checked_at_UTC": "2026-10-26T14:16:50.285126+00:00",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "a7434cd27c09df3d8e6c586f9676b67abcde798e",
|
||||
"release": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/632dc06930d6b4f1b012feb3b4daa3b1cfc53f39-4c020686",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"release_revision": {
|
||||
"commit": "a7434cd27c09df3d8e6c586f9676b67abcde798e",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-26T14:07:54.031522+00:00",
|
||||
"manifest_sha256": "06af8bbd9ffabeac215cbb0357531f4e4169955461d8cfac380f3776e923e64e"
|
||||
},
|
||||
"service": "MainPID=0\nExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5430136832,
|
||||
"available_inodes": 21367883,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5430136832,
|
||||
"available_inodes": 21367883,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5430136832,
|
||||
"available_inodes": 21367883,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5430136832,
|
||||
"available_inodes": 21367883,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5430136832,
|
||||
"available_inodes": 21367883,
|
||||
"total_inodes": 29089792
|
||||
}
|
||||
],
|
||||
"free_bytes": 5430136832,
|
||||
"existing_pipeline_minimum_bytes": 5368709120,
|
||||
"observed_previous_backup_bytes": 175918494,
|
||||
"same_partition_release_and_backup": true,
|
||||
"space_guard_satisfied": false,
|
||||
"current_release_entry_reference": 31237,
|
||||
"inodes_available_vs_reference": true,
|
||||
"inode_note": "Observed current release footprint for scale;no new arbitrary inode threshold. Capacity rechecked after fresh backup.",
|
||||
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604",
|
||||
"active_writes": 0
|
||||
},
|
||||
"regenerable_Node_cache_recovery": {
|
||||
"at_UTC": "2026-10-26T14:18:26.184720+00:00",
|
||||
"target": "/tmp/node-compile-cache",
|
||||
"kind": "Node versioned compilation cache;source and node_modules retained;regenerable by Node",
|
||||
"files_removed": 6893,
|
||||
"logical_bytes": 206715844,
|
||||
"free_before": 5429366784,
|
||||
"free_after": 5652504576,
|
||||
"recovered_bytes": 223137792,
|
||||
"installed_record_unchanged": true,
|
||||
"directory_owner_permissions_preserved": true,
|
||||
"projects_releases_backups_originals_logs_untouched": true,
|
||||
"active_business_writes": 0
|
||||
},
|
||||
"capacity_before": {
|
||||
"checked_at_UTC": "2026-10-26T14:19:01.971003+00:00",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "a7434cd27c09df3d8e6c586f9676b67abcde798e",
|
||||
"release": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/632dc06930d6b4f1b012feb3b4daa3b1cfc53f39-4c020686",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"release_revision": {
|
||||
"commit": "a7434cd27c09df3d8e6c586f9676b67abcde798e",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-26T14:07:54.031522+00:00",
|
||||
"manifest_sha256": "06af8bbd9ffabeac215cbb0357531f4e4169955461d8cfac380f3776e923e64e"
|
||||
},
|
||||
"service": "MainPID=0\nExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5652262912,
|
||||
"available_inodes": 21374782,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5652262912,
|
||||
"available_inodes": 21374782,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5652262912,
|
||||
"available_inodes": 21374782,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5652262912,
|
||||
"available_inodes": 21374782,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5652242432,
|
||||
"available_inodes": 21374780,
|
||||
"total_inodes": 29089792
|
||||
}
|
||||
],
|
||||
"free_bytes": 5652262912,
|
||||
"existing_pipeline_minimum_bytes": 5368709120,
|
||||
"observed_previous_backup_bytes": 175918494,
|
||||
"same_partition_release_and_backup": true,
|
||||
"space_guard_satisfied": true,
|
||||
"current_release_entry_reference": 31237,
|
||||
"inodes_available_vs_reference": true,
|
||||
"inode_note": "Observed current release footprint for scale;no new arbitrary inode threshold. Capacity rechecked after fresh backup.",
|
||||
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604",
|
||||
"active_writes": 0
|
||||
},
|
||||
"capacity_after_backup": {
|
||||
"checked_at_UTC": "2026-10-26T14:22:54.407089+00:00",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "a7434cd27c09df3d8e6c586f9676b67abcde798e",
|
||||
"release": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/632dc06930d6b4f1b012feb3b4daa3b1cfc53f39-4c020686",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"release_revision": {
|
||||
"commit": "a7434cd27c09df3d8e6c586f9676b67abcde798e",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-26T14:07:54.031522+00:00",
|
||||
"manifest_sha256": "06af8bbd9ffabeac215cbb0357531f4e4169955461d8cfac380f3776e923e64e"
|
||||
},
|
||||
"service": "MainPID=0\nExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5472501760,
|
||||
"available_inodes": 21374766,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5472501760,
|
||||
"available_inodes": 21374766,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5472501760,
|
||||
"available_inodes": 21374766,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5472501760,
|
||||
"available_inodes": 21374766,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 5472501760,
|
||||
"available_inodes": 21374766,
|
||||
"total_inodes": 29089792
|
||||
}
|
||||
],
|
||||
"free_bytes": 5472501760,
|
||||
"existing_pipeline_minimum_bytes": 5368709120,
|
||||
"observed_previous_backup_bytes": 175918494,
|
||||
"same_partition_release_and_backup": true,
|
||||
"space_guard_satisfied": false,
|
||||
"current_release_entry_reference": 31237,
|
||||
"inodes_available_vs_reference": true,
|
||||
"inode_note": "Observed current release footprint for scale;no new arbitrary inode threshold. Capacity rechecked after fresh backup.",
|
||||
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604",
|
||||
"active_writes": 0
|
||||
},
|
||||
"post_backup_existing_build_minimum_satisfied": true,
|
||||
"post_backup_next_fresh_backup_guard_not_required_for_already_completed_backup": true,
|
||||
"capacity_after_installation": {
|
||||
"checked_at_UTC": "2026-10-26T14:29:30.537317+00:00",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"release": "/var/www/investmoz-homologacao/releases/f8d57bddf96b4610604a013fcc5bdd703c7dc6d5-7a31e8ac",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/f8d57bddf96b4610604a013fcc5bdd703c7dc6d5-7a31e8ac",
|
||||
"release_revision": {
|
||||
"commit": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-26T14:26:51.629481+00:00",
|
||||
"manifest_sha256": "367be71b25b56a83571d610e211ea11beae2af87989d62ef6cc7b9c54eabf580"
|
||||
},
|
||||
"service": "MainPID=0\nExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 4441751552,
|
||||
"available_inodes": 21342698,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 4441751552,
|
||||
"available_inodes": 21342698,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 4441751552,
|
||||
"available_inodes": 21342698,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 4441747456,
|
||||
"available_inodes": 21342697,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 4441747456,
|
||||
"available_inodes": 21342696,
|
||||
"total_inodes": 29089792
|
||||
}
|
||||
],
|
||||
"free_bytes": 4441751552,
|
||||
"existing_pipeline_minimum_bytes": 5368709120,
|
||||
"observed_previous_backup_bytes": 175918494,
|
||||
"same_partition_release_and_backup": true,
|
||||
"space_guard_satisfied": false,
|
||||
"current_release_entry_reference": 31259,
|
||||
"inodes_available_vs_reference": true,
|
||||
"inode_note": "Observed current release footprint for scale;no new arbitrary inode threshold. Capacity rechecked after fresh backup.",
|
||||
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604",
|
||||
"active_writes": 0
|
||||
},
|
||||
"next_delivery_capacity_adjustment_required": true,
|
||||
"delta": [
|
||||
{
|
||||
"path": "resources/js/lib/irpc-special.ts",
|
||||
"sha256_LF": "aea0e55b9317ca8ebb313a02e5e92c5b0bac805157d67d54f7c30c71068f46e6"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-normal.ts",
|
||||
"sha256_LF": "bce82366ab4ae41fc5f889d9a68d041604e1c032823e4a9384a1227e170c649b"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-irpc-special.tsx",
|
||||
"sha256_LF": "de77c20af4f07cb2fda31b94cb2c163b627b987d816b43e196590afe59d22fb8"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/irpc-special-combinations.ts",
|
||||
"sha256_LF": "0c80d39930e2a3f598ba2fed6d7e31252bc24211b5a908778367e2451fcbc90c"
|
||||
}
|
||||
],
|
||||
"preservation": {
|
||||
"previous_release_preserved": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"release": "/var/www/investmoz-homologacao/releases/f8d57bddf96b4610604a013fcc5bdd703c7dc6d5-7a31e8ac",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"runtime_files_verified": 4,
|
||||
"preserved_L3_ISPC_FX_runtime_files_verified": 68,
|
||||
"documentary_files_verified": 31,
|
||||
"persistent_files_and_env_verified": 369,
|
||||
"tables_compared": 174,
|
||||
"changed_tables": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 106,
|
||||
"checksum": "0d909f267cc44165e41d5ac5e966448f"
|
||||
},
|
||||
"after": {
|
||||
"rows": 106,
|
||||
"checksum": "8381b51b093febcc81854e20cb22bec8"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 12,
|
||||
"checksum": "aa6448d95c23f325f4e2004fb48315ce"
|
||||
},
|
||||
"after": {
|
||||
"rows": 13,
|
||||
"checksum": "e64cf16446c054a7e852f4944574dabf"
|
||||
}
|
||||
}
|
||||
},
|
||||
"preserved_counts": {
|
||||
"published_fiches": 29,
|
||||
"relations": 28,
|
||||
"geometries": 408
|
||||
},
|
||||
"migration_count": 0,
|
||||
"content_imports": 0,
|
||||
"comparison_role": "postgres_before_and_after;sameexportedsnapshotbaseline;noapplicationRLSvisibilityinference",
|
||||
"writes_by_verification": 0
|
||||
},
|
||||
"schema_permissions_after": {
|
||||
"schema_sha256": "5045b3e51d2185377aa3d9ac7fa07a44fad3ec620cdfa83ffe31c8884ee1601d",
|
||||
"roles_grants_sha256": "1530c33cb016e67bfdc64891ddfce7f185b13b56b2cd87c012871a685e118109",
|
||||
"filesystem_permissions": {
|
||||
".env": {
|
||||
"mode": 416,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage/app": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"bootstrap/cache": {
|
||||
"mode": 1528,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
}
|
||||
},
|
||||
"comparison_identity": "postgres;catalogue read only;no passwords collected",
|
||||
"unchanged": true
|
||||
},
|
||||
"operational_delta": {
|
||||
"status": "operational_delta_reconciled",
|
||||
"comparison_identity": "postgres before/after;isolated restored baseline;no RLS visibility inference",
|
||||
"cache": "queue:restart;requestthrottle;identical home-sector cached value with refreshed expiry(HomeController remember10min);no deletedcache",
|
||||
"sessions": "anonymous sessions from delivery user-agent or exactUA/time correlated with nginx public request;deleted sessions individually expired beyond configured lifetime,normal database session garbage collection(config/session lottery2/100)",
|
||||
"delta": {
|
||||
"cache": {
|
||||
"before_rows": 106,
|
||||
"after_rows": 106,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "7f7dd83f47f5bf404d55e6e9f1367948721579970b195680645e356031a070ff",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"value",
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-illuminate:queue:restart",
|
||||
"is_queue_restart_key": true,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": false,
|
||||
"same_value_home_cache_expiry_refresh": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"before_rows": 12,
|
||||
"after_rows": 14,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "d8e8fff391c7cb6369d141adae95227c9616f39055ffd58b5fda3f0cc6eda2a4",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "1618c52511f4c5d1fba6bbf74167ce464d7fbe7a121a937cab645415fa7f0878",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"business_tables_to_confirm_separately": 172,
|
||||
"active_data_writes_by_comparison": 0,
|
||||
"restore_network": "none"
|
||||
},
|
||||
"public": {
|
||||
"status": "installed_delta_verified",
|
||||
"served_revision": {
|
||||
"commit": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-26T14:26:51.629481+00:00",
|
||||
"manifest_sha256": "367be71b25b56a83571d610e211ea11beae2af87989d62ef6cc7b9c54eabf580"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"IRPC-normal-adjustments/14": [
|
||||
"assets/project-dossier-JLJx7klI.js"
|
||||
],
|
||||
"Preparar cumulações dos tratamentos L7 registados": [
|
||||
"assets/services-BKUDFoA6.js"
|
||||
],
|
||||
"Combinação incompatível": [
|
||||
"assets/project-dossier-JLJx7klI.js"
|
||||
],
|
||||
"única diferença adicional:": [
|
||||
"assets/project-dossier-JLJx7klI.js"
|
||||
],
|
||||
"IRPC-normal-adjustments/13": [
|
||||
"assets/project-dossier-JLJx7klI.js"
|
||||
],
|
||||
"Preparar CBF16 para início de actividade": [
|
||||
"assets/services-BKUDFoA6.js"
|
||||
],
|
||||
"Preparar CBF16 para cessação e quotas anteriores": [
|
||||
"assets/services-BKUDFoA6.js"
|
||||
],
|
||||
"sem consumo de saldos oficiais": [
|
||||
"assets/project-dossier-JLJx7klI.js"
|
||||
],
|
||||
"Preparar CBF16 com duodécimos": [
|
||||
"assets/services-BKUDFoA6.js"
|
||||
],
|
||||
"CBF16 — duodécimos reutilizados de L6": [
|
||||
"assets/project-dossier-JLJx7klI.js"
|
||||
],
|
||||
"Suporte dos duodécimos CBF16": [
|
||||
"assets/services-BKUDFoA6.js"
|
||||
],
|
||||
"Manter preparação anual CBF16": [
|
||||
"assets/services-BKUDFoA6.js"
|
||||
],
|
||||
"CBF16 por duodécimos — ": [
|
||||
"assets/project-dossier-JLJx7klI.js"
|
||||
],
|
||||
"diferença adicional:": [
|
||||
"assets/project-dossier-JLJx7klI.js"
|
||||
],
|
||||
"IRPC-normal-adjustments/10": [
|
||||
"assets/project-dossier-JLJx7klI.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/project-dossier-document-W46BRNSe.js",
|
||||
"status": 200,
|
||||
"sha256": "80e14fba26e9e81f840ba09eb3f9e24a70404bbe7e6933b490b3085299a6186f"
|
||||
},
|
||||
{
|
||||
"file": "assets/services-BKUDFoA6.js",
|
||||
"status": 200,
|
||||
"sha256": "0ac8c266fcecec0e564619948f4cec28cd2572975aff70acc6997971a67fcfd9"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-JLJx7klI.js",
|
||||
"status": 200,
|
||||
"sha256": "1016cb33e4476a95e1a06ce17fad4312efc93aef01994a2674e251d00c884f0b"
|
||||
},
|
||||
{
|
||||
"file": "assets/simulation-form-zFZ4YNrB.js",
|
||||
"status": 200,
|
||||
"sha256": "338068b86cce1c3215ee71b1328a6cb2f754b903ed78ff1886f8554df506d2d6"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-BPLj40Iz.js",
|
||||
"synthetic_private_writes": 0,
|
||||
"method": "Read-only installedrevision/manifest/newcompiledcatalogueandreaders/simulatorentry;acceptedQAproofsreused"
|
||||
},
|
||||
"pipeline": {
|
||||
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"release": "/var/www/investmoz-homologacao/releases/f8d57bddf96b4610604a013fcc5bdd703c7dc6d5-7a31e8ac",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"release": "/var/www/investmoz-homologacao/releases/f8d57bddf96b4610604a013fcc5bdd703c7dc6d5-7a31e8ac",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/a7434cd27c09df3d8e6c586f9676b67abcde798e-60070b10",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"f8d57bddf96b4610604a013fcc5bdd703c7dc6d5"
|
||||
],
|
||||
"finished_at": "2026-10-26T14:26:54.452008+00:00"
|
||||
},
|
||||
"log_file": "1793024604346159017.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 32.14s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 1054",
|
||||
"# pass 1054",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 299642
|
||||
},
|
||||
"accepted_QA_proofs_reused": {
|
||||
"new_frontend_tests": 12,
|
||||
"API_tests": 1,
|
||||
"API_assertions": 133,
|
||||
"QA_database": "simulator_fiscal_delta_20261021_test",
|
||||
"QA_host": "127.0.0.1",
|
||||
"QA_port": 55441,
|
||||
"QA_transaction_rollback": true,
|
||||
"wayfinder_with_form": true,
|
||||
"typescript": true,
|
||||
"build": true,
|
||||
"recovered_HTML_and_financial_dossier": 7,
|
||||
"UI": {
|
||||
"actualComponent": true,
|
||||
"explicitPrepareCancel": true,
|
||||
"assetsPeriodsBenefitsNotEdited": true,
|
||||
"missingOnlyDependentL7": true,
|
||||
"CBF16Additional25ThenCooperative16": true,
|
||||
"prior15AlreadyIncluded": true,
|
||||
"specificGenericIncompatibilityNoAutomaticChoice": true,
|
||||
"unmappedExceptionIndeterminate": true,
|
||||
"autonomous35NotHalved": true,
|
||||
"saveRecoverDownload": true,
|
||||
"accepted13InputPreserved": true,
|
||||
"L8FinalUnknown": true,
|
||||
"errors": []
|
||||
},
|
||||
"accepted13_exact_model_key_history_comparison": true,
|
||||
"accepted_suites_not_rerun": true,
|
||||
"typescript_build_after_main": true
|
||||
},
|
||||
"no_custom_QA_suite_repeated": true,
|
||||
"L7_remaining_code": [
|
||||
"other combinations and express exceptions",
|
||||
"CBF17-19 and potential15 entitlement",
|
||||
"specific sector/territorial regimes",
|
||||
"mixed/withheld cooperativeincome and otherentities",
|
||||
"other autonome expense origins",
|
||||
"furtherCBF16 scopes",
|
||||
"capitalgains/specialoperations",
|
||||
"officialL7M20M22transport"
|
||||
],
|
||||
"L7_resume_conditions": [
|
||||
"disposition/article/scope/period/order/limit and segregatedparcel for combination",
|
||||
"implement not-yet-supported treatment before adding its effect",
|
||||
"specific document only for dependentcase/field"
|
||||
],
|
||||
"L8_first_increment": {
|
||||
"status": "L8_first_increment_delimited_not_implemented",
|
||||
"date": "2026-10-26",
|
||||
"installed_L7": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"no_new_L8_calculator_installed": true,
|
||||
"initial_scope": "resident general IRPC,annualcivil2026,MZN,currentdetermined assessment,documented absence of positive PEC/unmappedcredits and autonomoustax needing ownsettlement",
|
||||
"inputs_reused": [
|
||||
"current L6 or applicable qualifiedL7 assessment key/version/subjectNUIT/period;never add both",
|
||||
"L5 received/effective/on_account qualified and reconciled withholding proofs",
|
||||
"actual documented PPC payments by subject/period/receipt",
|
||||
"known/declaredabsence/missing states for every credit/paymentfamily"
|
||||
],
|
||||
"wrong_credits_excluded": [
|
||||
"withholding remitted by enterprise on payments to others",
|
||||
"definitive withholding",
|
||||
"projected amount without effective proof",
|
||||
"duplicate receipt/allocation/year",
|
||||
"unmapped positive PEC/investment/doubletax credit"
|
||||
],
|
||||
"sequence": [
|
||||
"validassessment",
|
||||
"admissibledeductions and explicitabsence",
|
||||
"effective onaccount withholdings",
|
||||
"actual PPC",
|
||||
"signed arithmeticbalance",
|
||||
"applicable collection/refund minimum rules",
|
||||
"simulatedpayable orrecoverable;not submittedor receivedrefund"
|
||||
],
|
||||
"proposed_acceptance_cases": [
|
||||
{
|
||||
"colecta": "1408",
|
||||
"withholdings": "300",
|
||||
"PPC": "500",
|
||||
"arithmetic_balance": "608"
|
||||
},
|
||||
{
|
||||
"colecta": "1408",
|
||||
"withholdings": "1000",
|
||||
"PPC": "600",
|
||||
"arithmetic_balance": "-192"
|
||||
},
|
||||
{
|
||||
"colecta": "1408",
|
||||
"withholdings": "408",
|
||||
"PPC": "1000",
|
||||
"arithmetic_balance": "0"
|
||||
},
|
||||
"minimumrule boundaries afterperiod/version mapping",
|
||||
"knownzero vs declaredabsence vs missing",
|
||||
"wrongbeneficiary/definitive/duplicates",
|
||||
"calculation-save-recover-report with oldhistories unchanged"
|
||||
],
|
||||
"cases_tested_now": false,
|
||||
"rule_work_before_implementation": [
|
||||
"CIRPC63/67 with Lei12/2025 nature applicable",
|
||||
"Decreto9/2008 art21(2-5) deductionorder/limits and27(1-2/6) settlement",
|
||||
"100MZN minimum in accepted2008 exemplar:link to applicable version/period before enabling parameter;no generic credibility revalidation",
|
||||
"retain PEC/credits distinct and nonrefundable limits;no3/5year automaticcarry"
|
||||
],
|
||||
"boundaries": [
|
||||
"qualified cooperative withoutwithheldincome cannot silently acceptpositivereceivedwithholdings without L7segregation",
|
||||
"no L6fallback toignore applicablependingL7effect",
|
||||
"autonomoustax/61Apositive needs own settlement articulation",
|
||||
"fraction exact;unmapped formrepresentation onlyblocks affectedtransport"
|
||||
],
|
||||
"deferred": [
|
||||
"automatic PPC/PEC obligationcalculation",
|
||||
"positivePEC/creditorderlimitscarry",
|
||||
"autonomoustaxsettlement",
|
||||
"specialperiods/foreigncurrencypayments",
|
||||
"interest/penalties/calendar/guideremittance",
|
||||
"AT submission/refundprocessing",
|
||||
"unmappedM20M22fields"
|
||||
],
|
||||
"sources_reused": [
|
||||
{
|
||||
"file": "C:\\laragon\\www\\portal-investidor-irpc-l7-common-qa-20261026\\docs\\investmoz\\simulations\\source-archive\\Lei-34-2007-BR52.pdf",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e",
|
||||
"articles": "CIRPC63/67",
|
||||
"PDF_pages": [
|
||||
18,
|
||||
19
|
||||
],
|
||||
"official_source_acceptance_preserved": true
|
||||
},
|
||||
{
|
||||
"file": "C:\\laragon\\www\\portal-investidor-irpc-l7-common-qa-20261026\\docs\\investmoz\\simulations\\source-archive\\Decreto-9-2008-BR16.pdf",
|
||||
"sha256": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697",
|
||||
"articles": "RIRPC21/27",
|
||||
"PDF_pages": [
|
||||
6,
|
||||
7
|
||||
],
|
||||
"official_source_acceptance_preserved": true
|
||||
},
|
||||
{
|
||||
"file": "C:\\laragon\\www\\portal-investidor-irpc-l7-common-qa-20261026\\docs\\investmoz\\simulations\\source-archive\\BR-248-I-Suplemento-1-2025.pdf",
|
||||
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251",
|
||||
"articles": "Lei12/2025 IRPC67/version2026",
|
||||
"PDF_pages": [
|
||||
18,
|
||||
19,
|
||||
20
|
||||
],
|
||||
"official_source_acceptance_preserved": true
|
||||
}
|
||||
],
|
||||
"global_effort": {
|
||||
"initial_L8_L14_reference_hours": [
|
||||
240,
|
||||
416
|
||||
],
|
||||
"is_current_remainingforecast": false,
|
||||
"reconciliation_before_globalforecast": [
|
||||
"implemented/reusable vs remainingcode perlot",
|
||||
"reuseacceptedproofs;no duplicate sharedcomponentestimate",
|
||||
"documentarywait separately",
|
||||
"L1-L7residuals,integration/delivery,L15-L16 included"
|
||||
]
|
||||
},
|
||||
"L7_partial": true,
|
||||
"L8_final_still_not_implemented": true
|
||||
},
|
||||
"global_effort_forecast_not_assumed": true,
|
||||
"L6_operational_delimited": true,
|
||||
"L7_partial": true,
|
||||
"L8_final_separate": true,
|
||||
"SGF_TEMPO_untouched": true
|
||||
}
|
||||
@@ -0,0 +1,614 @@
|
||||
{
|
||||
"status": "combinations_QA_ready_not_installed",
|
||||
"date": "2026-10-26",
|
||||
"branch": "codex/irpc-l7-combinations-qa-20261026",
|
||||
"installed_baseline": "632dc06930d6b4f1b012feb3b4daa3b1cfc53f39",
|
||||
"documentation_baseline": "f33d99b4",
|
||||
"version": "IRPC-normal-adjustments/14",
|
||||
"optional_input": "special.combinations version1;document presence/absence of specific/other benefits and express exception;reuse existing qualification/period/assets",
|
||||
"scope": "CIRPC12 qualified pure cooperative + genericCBF16;separate expense61(4);CBF4/13 incompatibility of specific+generic without express exception;unmapped exception/other benefit remain indeterminate",
|
||||
"calculation_order": [
|
||||
"CBF16 net difference once",
|
||||
"existing taxablebase deductions/losses",
|
||||
"16percent on fullyeligible cooperativebase",
|
||||
"35percent autonomous expenses separately",
|
||||
"L8 final remains unknown"
|
||||
],
|
||||
"positive_unmapped_L6_benefit_not_reapplied": true,
|
||||
"runtime_delta": {
|
||||
"resources/js/lib/irpc-special.ts": "bc72c0c045fa7d7fc2a6b98ca95205479aa448f0c2a9819b930e72f7c93f6ade",
|
||||
"resources/js/lib/irpc-normal.ts": "4741c2bdecb8570fe786e51f777c633da34dcb0052bb000f9b63ebfde48b1f4a",
|
||||
"resources/js/components/simulation-irpc-special.tsx": "bb567f06cf2c844419341fa298751752ef94a2f493972d28f68b5f2245b95e00",
|
||||
"resources/js/lib/irpc-special-combinations.ts": "b638fdf96e33a27c1c73492fb5690c7b170ecbe97dd4ad9881465b2c4eaa6a22"
|
||||
},
|
||||
"L6_depreciation_period_fx_engines_unchanged": true,
|
||||
"cases_recovered": {
|
||||
"combined": {
|
||||
"L6_profit": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_base": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_colecta": {
|
||||
"numerator": "5008",
|
||||
"denominator": "5"
|
||||
},
|
||||
"status": "compatible",
|
||||
"order": [
|
||||
"Diferença adicionalCBF16 aplicada uma vez ao lucroL6",
|
||||
"Matéria colectável recalculada com as mesmas deduções/perdasL6",
|
||||
"Cooperativa12:50% da taxa geral32%=16% apenas na base integralmente elegível",
|
||||
"Imposto autónomo61(4) separado a35%,sem redução cooperativa",
|
||||
"Saldo final a pagar/recuperar permaneceL8"
|
||||
],
|
||||
"asset_claims": [
|
||||
{
|
||||
"assetId": "server",
|
||||
"document": "QA-activo-servidor",
|
||||
"line": "1",
|
||||
"normalDeduction": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"acceleratedDeduction": {
|
||||
"numerator": "75",
|
||||
"denominator": "1"
|
||||
},
|
||||
"priorRecoveredIncluded": {
|
||||
"numerator": "15",
|
||||
"denominator": "1"
|
||||
},
|
||||
"additionalDeduction": {
|
||||
"numerator": "25",
|
||||
"denominator": "1"
|
||||
},
|
||||
"remainingFiscal": {
|
||||
"numerator": "825",
|
||||
"denominator": "1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"L7_profit": {
|
||||
"numerator": "3105",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L7_base": {
|
||||
"numerator": "3105",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L7_colecta": {
|
||||
"numerator": "2484",
|
||||
"denominator": "5"
|
||||
},
|
||||
"autonomous_tax": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"combined_colecta": {
|
||||
"numerator": "2484",
|
||||
"denominator": "5"
|
||||
},
|
||||
"pending": [],
|
||||
"L8_final": {
|
||||
"scope": "L8",
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
}
|
||||
},
|
||||
"autonomous": {
|
||||
"L6_profit": {
|
||||
"numerator": "3230",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_base": {
|
||||
"numerator": "3230",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_colecta": {
|
||||
"numerator": "5168",
|
||||
"denominator": "5"
|
||||
},
|
||||
"status": "compatible",
|
||||
"order": [
|
||||
"Diferença adicionalCBF16 aplicada uma vez ao lucroL6",
|
||||
"Matéria colectável recalculada com as mesmas deduções/perdasL6",
|
||||
"Cooperativa12:50% da taxa geral32%=16% apenas na base integralmente elegível",
|
||||
"Imposto autónomo61(4) separado a35%,sem redução cooperativa",
|
||||
"Saldo final a pagar/recuperar permaneceL8"
|
||||
],
|
||||
"asset_claims": [
|
||||
{
|
||||
"assetId": "server",
|
||||
"document": "QA-activo-servidor",
|
||||
"line": "1",
|
||||
"normalDeduction": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"acceleratedDeduction": {
|
||||
"numerator": "75",
|
||||
"denominator": "1"
|
||||
},
|
||||
"priorRecoveredIncluded": {
|
||||
"numerator": "15",
|
||||
"denominator": "1"
|
||||
},
|
||||
"additionalDeduction": {
|
||||
"numerator": "25",
|
||||
"denominator": "1"
|
||||
},
|
||||
"remainingFiscal": {
|
||||
"numerator": "825",
|
||||
"denominator": "1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"L7_profit": {
|
||||
"numerator": "3205",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L7_base": {
|
||||
"numerator": "3205",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L7_colecta": {
|
||||
"numerator": "2564",
|
||||
"denominator": "5"
|
||||
},
|
||||
"autonomous_tax": {
|
||||
"numerator": "35",
|
||||
"denominator": "1"
|
||||
},
|
||||
"combined_colecta": {
|
||||
"numerator": "2739",
|
||||
"denominator": "5"
|
||||
},
|
||||
"pending": [],
|
||||
"L8_final": {
|
||||
"scope": "L8",
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
}
|
||||
},
|
||||
"incompatible": {
|
||||
"L6_profit": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_base": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_colecta": {
|
||||
"numerator": "5008",
|
||||
"denominator": "5"
|
||||
},
|
||||
"status": "incompatible",
|
||||
"order": [
|
||||
"Diferença adicionalCBF16 aplicada uma vez ao lucroL6",
|
||||
"Matéria colectável recalculada com as mesmas deduções/perdasL6",
|
||||
"Cooperativa12:50% da taxa geral32%=16% apenas na base integralmente elegível",
|
||||
"Imposto autónomo61(4) separado a35%,sem redução cooperativa",
|
||||
"Saldo final a pagar/recuperar permaneceL8"
|
||||
],
|
||||
"asset_claims": [
|
||||
{
|
||||
"assetId": "server",
|
||||
"document": "QA-activo-servidor",
|
||||
"line": "1",
|
||||
"normalDeduction": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"acceleratedDeduction": null,
|
||||
"priorRecoveredIncluded": null,
|
||||
"additionalDeduction": null,
|
||||
"remainingFiscal": null
|
||||
}
|
||||
],
|
||||
"L7_profit": null,
|
||||
"L7_base": null,
|
||||
"L7_colecta": null,
|
||||
"autonomous_tax": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"combined_colecta": null,
|
||||
"pending": [
|
||||
"IncompatibilidadeCBF4/13:benefício específico declarado e genéricoCBF16 sem excepção expressa;nenhum benefício é escolhido ou removido automaticamente."
|
||||
],
|
||||
"L8_final": {
|
||||
"scope": "L8",
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
}
|
||||
},
|
||||
"missing": {
|
||||
"L6_profit": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_base": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_colecta": {
|
||||
"numerator": "5008",
|
||||
"denominator": "5"
|
||||
},
|
||||
"status": "indeterminate",
|
||||
"order": [
|
||||
"Diferença adicionalCBF16 aplicada uma vez ao lucroL6",
|
||||
"Matéria colectável recalculada com as mesmas deduções/perdasL6",
|
||||
"Cooperativa12:50% da taxa geral32%=16% apenas na base integralmente elegível",
|
||||
"Imposto autónomo61(4) separado a35%,sem redução cooperativa",
|
||||
"Saldo final a pagar/recuperar permaneceL8"
|
||||
],
|
||||
"asset_claims": [
|
||||
{
|
||||
"assetId": "server",
|
||||
"document": "QA-activo-servidor",
|
||||
"line": "1",
|
||||
"normalDeduction": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"acceleratedDeduction": null,
|
||||
"priorRecoveredIncluded": null,
|
||||
"additionalDeduction": null,
|
||||
"remainingFiscal": null
|
||||
}
|
||||
],
|
||||
"L7_profit": null,
|
||||
"L7_base": null,
|
||||
"L7_colecta": null,
|
||||
"autonomous_tax": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"combined_colecta": null,
|
||||
"pending": [
|
||||
"Benefícios específicosCBF:identifique presença ou ausência documentada;localização não prova estatuto."
|
||||
],
|
||||
"L8_final": {
|
||||
"scope": "L8",
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
}
|
||||
},
|
||||
"exception": {
|
||||
"L6_profit": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_base": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_colecta": {
|
||||
"numerator": "5008",
|
||||
"denominator": "5"
|
||||
},
|
||||
"status": "indeterminate",
|
||||
"order": [
|
||||
"Diferença adicionalCBF16 aplicada uma vez ao lucroL6",
|
||||
"Matéria colectável recalculada com as mesmas deduções/perdasL6",
|
||||
"Cooperativa12:50% da taxa geral32%=16% apenas na base integralmente elegível",
|
||||
"Imposto autónomo61(4) separado a35%,sem redução cooperativa",
|
||||
"Saldo final a pagar/recuperar permaneceL8"
|
||||
],
|
||||
"asset_claims": [
|
||||
{
|
||||
"assetId": "server",
|
||||
"document": "QA-activo-servidor",
|
||||
"line": "1",
|
||||
"normalDeduction": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"acceleratedDeduction": null,
|
||||
"priorRecoveredIncluded": null,
|
||||
"additionalDeduction": null,
|
||||
"remainingFiscal": null
|
||||
}
|
||||
],
|
||||
"L7_profit": null,
|
||||
"L7_base": null,
|
||||
"L7_colecta": null,
|
||||
"autonomous_tax": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"combined_colecta": null,
|
||||
"pending": [
|
||||
"Excepção expressa invocada:ligar artigo,âmbito,período e limites à combinação antes de calcular;esta excepção ainda não está correspondida."
|
||||
],
|
||||
"L8_final": {
|
||||
"scope": "L8",
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
}
|
||||
},
|
||||
"negative": {
|
||||
"L6_profit": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_base": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_colecta": {
|
||||
"numerator": "5008",
|
||||
"denominator": "5"
|
||||
},
|
||||
"status": "compatible",
|
||||
"order": [
|
||||
"Diferença adicionalCBF16 aplicada uma vez ao lucroL6",
|
||||
"Matéria colectável recalculada com as mesmas deduções/perdasL6",
|
||||
"Cooperativa12:50% da taxa geral32%=16% apenas na base integralmente elegível",
|
||||
"Imposto autónomo61(4) separado a35%,sem redução cooperativa",
|
||||
"Saldo final a pagar/recuperar permaneceL8"
|
||||
],
|
||||
"asset_claims": [
|
||||
{
|
||||
"assetId": "server",
|
||||
"document": "QA-activo-servidor",
|
||||
"line": "1",
|
||||
"normalDeduction": {
|
||||
"numerator": "50",
|
||||
"denominator": "1"
|
||||
},
|
||||
"acceleratedDeduction": {
|
||||
"numerator": "75",
|
||||
"denominator": "1"
|
||||
},
|
||||
"priorRecoveredIncluded": {
|
||||
"numerator": "15",
|
||||
"denominator": "1"
|
||||
},
|
||||
"additionalDeduction": {
|
||||
"numerator": "25",
|
||||
"denominator": "1"
|
||||
},
|
||||
"remainingFiscal": {
|
||||
"numerator": "825",
|
||||
"denominator": "1"
|
||||
}
|
||||
}
|
||||
],
|
||||
"L7_profit": {
|
||||
"numerator": "3105",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L7_base": {
|
||||
"numerator": "3105",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L7_colecta": {
|
||||
"numerator": "4968",
|
||||
"denominator": "5"
|
||||
},
|
||||
"autonomous_tax": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"combined_colecta": {
|
||||
"numerator": "4968",
|
||||
"denominator": "5"
|
||||
},
|
||||
"pending": [],
|
||||
"L8_final": {
|
||||
"scope": "L8",
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
}
|
||||
},
|
||||
"absent": {
|
||||
"L6_profit": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_base": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L6_colecta": {
|
||||
"numerator": "5008",
|
||||
"denominator": "5"
|
||||
},
|
||||
"status": "compatible",
|
||||
"order": [
|
||||
"Diferença adicionalCBF16 aplicada uma vez ao lucroL6",
|
||||
"Matéria colectável recalculada com as mesmas deduções/perdasL6",
|
||||
"Cooperativa12:50% da taxa geral32%=16% apenas na base integralmente elegível",
|
||||
"Imposto autónomo61(4) separado a35%,sem redução cooperativa",
|
||||
"Saldo final a pagar/recuperar permaneceL8"
|
||||
],
|
||||
"asset_claims": [],
|
||||
"L7_profit": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L7_base": {
|
||||
"numerator": "3130",
|
||||
"denominator": "1"
|
||||
},
|
||||
"L7_colecta": {
|
||||
"numerator": "2504",
|
||||
"denominator": "5"
|
||||
},
|
||||
"autonomous_tax": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"combined_colecta": {
|
||||
"numerator": "2504",
|
||||
"denominator": "5"
|
||||
},
|
||||
"pending": [],
|
||||
"L8_final": {
|
||||
"scope": "L8",
|
||||
"payable": null,
|
||||
"recoverable": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"checks": {
|
||||
"new_frontend_tests": 12,
|
||||
"API_tests": 1,
|
||||
"API_assertions": 133,
|
||||
"QA_database": "simulator_fiscal_delta_20261021_test",
|
||||
"QA_host": "127.0.0.1",
|
||||
"QA_port": 55441,
|
||||
"QA_transaction_rollback": true,
|
||||
"wayfinder_with_form": true,
|
||||
"typescript": true,
|
||||
"build": true,
|
||||
"recovered_HTML_and_financial_dossier": 7,
|
||||
"UI": {
|
||||
"actualComponent": true,
|
||||
"explicitPrepareCancel": true,
|
||||
"assetsPeriodsBenefitsNotEdited": true,
|
||||
"missingOnlyDependentL7": true,
|
||||
"CBF16Additional25ThenCooperative16": true,
|
||||
"prior15AlreadyIncluded": true,
|
||||
"specificGenericIncompatibilityNoAutomaticChoice": true,
|
||||
"unmappedExceptionIndeterminate": true,
|
||||
"autonomous35NotHalved": true,
|
||||
"saveRecoverDownload": true,
|
||||
"accepted13InputPreserved": true,
|
||||
"L8FinalUnknown": true,
|
||||
"errors": []
|
||||
},
|
||||
"accepted13_exact_model_key_history_comparison": true,
|
||||
"accepted_suites_not_rerun": true,
|
||||
"typescript_build_after_main": true
|
||||
},
|
||||
"preservation": {
|
||||
"tracked_files_compared_before_docs": 2822,
|
||||
"unchanged": 2819,
|
||||
"modified": [
|
||||
"resources/js/components/simulation-irpc-special.tsx",
|
||||
"resources/js/lib/irpc-normal.ts",
|
||||
"resources/js/lib/irpc-special.ts"
|
||||
],
|
||||
"new_runtime_module": "resources/js/lib/irpc-special-combinations.ts",
|
||||
"originals": {
|
||||
"docs/investmoz/simulations/source-archive/AT-Comunicado-9-2026-ISPC.pdf": "106f8a9ce9255c03549c70bf07fe999d32e6e55302d009b509862aa74ccb4973",
|
||||
"docs/investmoz/simulations/source-archive/AT-MRFTA-19-39.pdf": "8ea62c53066b482f87078a7a7b1ecf15ca98a12a122e8d7abca63acfc993186b",
|
||||
"docs/investmoz/simulations/source-archive/AT-Modelo-30-ISPC.pdf": "6802edd06b6ff638a0b851a3ec7ecf69af8f07840faa47446becad67d35d445c",
|
||||
"docs/investmoz/simulations/source-archive/AT-Modelo-B-Geral.pdf": "bd977c7c59d4d98befd92e2c566b1bf168cb1343bb519f51b41a3807f431fc57",
|
||||
"docs/investmoz/simulations/source-archive/BM-Mercado-Monetario-MAIBOR-20261025.html": "00e8a7e0d3a1db4ca3beb56d5361b2084a0f1684f3d40fc1c203702a2190e063",
|
||||
"docs/investmoz/simulations/source-archive/BR-16-I-Serie-2008-04-16.pdf": "fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee",
|
||||
"docs/investmoz/simulations/source-archive/BR-248-I-Suplemento-1-2025.pdf": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251",
|
||||
"docs/investmoz/simulations/source-archive/BR-89-I-Serie-2017-06-08.pdf": "11f0cab15eb6e51010952203ffa24fdc533a24fd642e19525fe4f46b17a1f5e5",
|
||||
"docs/investmoz/simulations/source-archive/BR-95-I-Suplemento-2025-05-21.pdf": "e0e682e2c027c3cd9c1d46a73a3f48bc5f6bdbf05667fd97314d7a3f6a456358",
|
||||
"docs/investmoz/simulations/source-archive/BR252-I-Serie-2022-Lei20-PESOE.pdf": "1159fd3ce1ba5581671796d083534da48bd3c5578298819e896f1c2a8026318d",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-22-2021-BR70.pdf": "a8fac38dcfe08f9c7a8e46254cff10e1ec82fc4f7a8d88ad6e4fe7d91ffc21a5",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-27-2026-BR123.pdf": "26249c3fa58f149c81de36e99d1aac2819a4771379d9e8833159660dabf539bb",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-29-1998-BR22-5-suplemento.pdf": "6242cbe675faadf085f43f95ec8c7e8868aafe67c3b2ab2bb010992288f954f8",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-3-2011-BR-11-I-mineiros.pdf": "5bca1133666ba9c69870b89823420175b7b5b8d0eccb667ecdf5c29716f3b6be",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-37-2023-BR124.pdf": "7e680b191481faa0e2e9057fa5053587eb2a29d1d8c819e0eb9f02814255a04c",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-9-2008-BR16.pdf": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697",
|
||||
"docs/investmoz/simulations/source-archive/Lei-13-2016-CIVA-BR-156-10-suplemento.pdf": "b90dc7c14ecea2e378c4a62e8e5a47d54a5644c457baeb8b8053b92fd2a5710b",
|
||||
"docs/investmoz/simulations/source-archive/Lei-14-1992-BR42.pdf": "089fff7423e99a70a230a73ca379e4ea3a91d124703f91016e57ff82794b9e56",
|
||||
"docs/investmoz/simulations/source-archive/Lei-17-2022-BR251-exemplar-MCNet5.pdf": "14eb34f0af91a8f5cb1770c7b52d6ff839c6818302d1ed96d79afbfb9fe999d4",
|
||||
"docs/investmoz/simulations/source-archive/Lei-17-2022-IPP-BR250-Parlamento.pdf": "978cd22403ffd336a631704ecd7a5bbd814a427c815b9acdaca5515591dd9e2a",
|
||||
"docs/investmoz/simulations/source-archive/Lei-19-2013-BR76.pdf": "bba96d645cc935ffc3d1a79b9f0f73ac1c693d6459c2ad41f56cd2841accae76",
|
||||
"docs/investmoz/simulations/source-archive/Lei-19-2017-IRPS-BR-OCAM.pdf": "c3a0186cb9ad090d7a9533006295dc9bb6a62ad0d6150173cbd49dba4ee4b52d",
|
||||
"docs/investmoz/simulations/source-archive/Lei-2-2011-BR-1-4-suplemento-MCNet.pdf": "a7543a68cc3287a46a83c39a04821b40f649dd06c4e9b5dc51ff0b47fba08899",
|
||||
"docs/investmoz/simulations/source-archive/Lei-20-2009-BR36-AT-exemplar19.pdf": "fc1c8144db42960cbf73e717e095896f511ece0f907f58f78819b27d6917a7ee",
|
||||
"docs/investmoz/simulations/source-archive/Lei-22-2022-IVA-republicada-BR-250-2-suplemento.pdf": "ea1b0dc6f5cf6e595f6d9a19e7042f398999e0087caef1785f6e8fac571b5f53",
|
||||
"docs/investmoz/simulations/source-archive/Lei-34-2007-BR52.pdf": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e",
|
||||
"docs/investmoz/simulations/source-archive/Lei-4-1994-BR37-3-suplemento.pdf": "210df9db8980d0a5690cd187a6eeec7e37a900d743e39062c16f4e0d12215c7e",
|
||||
"docs/investmoz/simulations/source-archive/Lei-4-2012-BR3.pdf": "b8845cef41dcbd9ba50c43dbfa743a56030dd3d348242a107e1ae30279eec121",
|
||||
"docs/investmoz/simulations/source-archive/Lei-7-1991-Partidos-IFES.pdf": "6b783a0bb3330688ef10660a58060d9724aa2da6a873d234fe902f0eaaeda42d",
|
||||
"docs/investmoz/simulations/source-archive/PT-MZ-CDT-1992.pdf": "d504e1024b28aee5c6acf4592acb96ec9c915a8414f67a61ab6984d6acf9df9d",
|
||||
"docs/investmoz/simulations/source-archive/PT-MZ-Protocolo-2009.pdf": "f353773dcf41f09f4daa6cf5ba5a5f7994f3e02615867c2dcffc61c3d901bf9b"
|
||||
},
|
||||
"histories_assets_balances_plan_otherbooks_preserved": true,
|
||||
"official_balances_not_consumed": true,
|
||||
"active_writes": 0,
|
||||
"migrations": 0,
|
||||
"SGF_TEMPO_untouched": true
|
||||
},
|
||||
"sources_reused": [
|
||||
{
|
||||
"path": "C:/laragon/www/portal-investidor-irpc-l7-scope-20261026/outputs/irpc-l7-scope/APIEX-legislacao-investimentos-2025.pdf",
|
||||
"sha256": "ba1e9eaabfec5d0c4cb2d9f2444a6860f7a90f222034764197829be402d408ed",
|
||||
"pages": [
|
||||
66,
|
||||
70,
|
||||
72
|
||||
],
|
||||
"articles": "CBF4/13/16"
|
||||
},
|
||||
{
|
||||
"path": "C:\\laragon\\www\\portal-investidor-irpc-l7-common-qa-20261026\\docs\\investmoz\\simulations\\source-archive\\Lei-34-2007-BR52.pdf",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e",
|
||||
"pages": [
|
||||
5
|
||||
],
|
||||
"articles": "CIRPC12/14"
|
||||
}
|
||||
],
|
||||
"inventory_reused": 8143,
|
||||
"remaining_code": [
|
||||
"other combinations and express exceptions",
|
||||
"CBF17-19 and potential15 entitlement",
|
||||
"specific sector/territorial regimes",
|
||||
"mixed/withheld cooperativeincome and otherentities",
|
||||
"other autonome expense origins",
|
||||
"furtherCBF16 scopes",
|
||||
"capitalgains/specialoperations",
|
||||
"officialL7M20M22transport"
|
||||
],
|
||||
"resume_conditions": [
|
||||
"disposition/article/scope/period/order/limit and segregatedparcel for combination",
|
||||
"implement not-yet-supported treatment before adding its effect",
|
||||
"specific document only for dependentcase/field"
|
||||
],
|
||||
"effort_reference": {
|
||||
"type": "initial planning figures,not updated remainingestimate",
|
||||
"L8_to_L14_hours": [
|
||||
240,
|
||||
416
|
||||
],
|
||||
"eight_hour_days": [
|
||||
30,
|
||||
52
|
||||
],
|
||||
"excludes": [
|
||||
"L1-L7residuals",
|
||||
"L15-L16unestimated",
|
||||
"documentarywait"
|
||||
],
|
||||
"global_completion_percentage_not_established": true
|
||||
},
|
||||
"future_delivery_requires_fresh_main_capacity_backup_restore": true,
|
||||
"L6_operational_delimited": true,
|
||||
"L7_partial": true,
|
||||
"L8_final_balance_separate": true,
|
||||
"evidence_directory": "outputs/irpc-l7-combinations",
|
||||
"main_incorporated": "a7434cd27c09df3d8e6c586f9676b67abcde798e",
|
||||
"main_merge_commit": "ea2bceb5ce0c089698603da4cfd268ac1cafbb7a",
|
||||
"main_source_delta_preserved": [
|
||||
"app/Http/Controllers/PortalServicesController.php",
|
||||
"app/Http/Controllers/PublicPortalController.php",
|
||||
"app/Services/SectorInvestment.php",
|
||||
"docs/investmoz/unification/traceability-and-manual.md",
|
||||
"docs/investmoz/v2/auditoria-portal/matriz-requisitos.csv",
|
||||
"resources/js/components/educational-article-card.tsx",
|
||||
"resources/js/components/sector-content.tsx",
|
||||
"resources/js/components/sector-entry.tsx",
|
||||
"resources/js/pages/portal/services.tsx",
|
||||
"resources/js/pages/portal/why-invest.tsx",
|
||||
"tests/Feature/SectorCatalogueContentTest.php"
|
||||
],
|
||||
"accepted_QA13_manual_appendix_restored": true,
|
||||
"served_revision_not_rechecked_this_QA": true
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
{
|
||||
"date": "2026-10-28",
|
||||
"status": "implemented and demonstrated in isolated QA; not installed",
|
||||
"branch": "codex/irpc-l8-carry-qa-20261028",
|
||||
"base": "cf4e0638",
|
||||
"installed_reference_unchanged": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"scope": {
|
||||
"year": "2026",
|
||||
"subject": "same subject, resident general",
|
||||
"period": "annual ordinary origins; calendar-year current close",
|
||||
"currency": "documented MZN; exact foreign-credit fractions supported",
|
||||
"international": "eligible origin credit minus origin deduction and documented actual later uses; five subsequent exercises, art65(3)",
|
||||
"pec": "actual PEC eligible origin minus origin deduction and actual later uses; three subsequent exercises, art66(1–2)",
|
||||
"allocation": "explicit documented selection between current and prior exercises, confirmed against current assessment; no presumed FIFO or automatic reduction",
|
||||
"expiry": "ordinary window ended excludes current deduction but keeps source and arithmetic historical remainder",
|
||||
"origin_rules": "origin assessment, inclusion/limits/insufficient collection and applicable period documented; exceptional/transitional rules outside scope"
|
||||
},
|
||||
"restriction_origins": {
|
||||
"Tempo": "preserve approved sources, accepted deliveries, data/history, QA isolation; continue L8",
|
||||
"accepted_requirement": "CIRPC65(3),66(1–2), source already accepted; no new provenance approval",
|
||||
"technical_choices": "optional versioned snapshot extension; consolidated nature/country/origin-year balance; explicit selection avoids invented interyear priority"
|
||||
},
|
||||
"verification": {
|
||||
"new_frontend_tests": 16,
|
||||
"affected_previously_accepted_tests": 49,
|
||||
"total_frontend_pass": 65,
|
||||
"frontend_fail": 0,
|
||||
"API_tests": 1,
|
||||
"API_assertions": 119,
|
||||
"API_cases": 6,
|
||||
"API_database": "proactive_investment_20261027_test",
|
||||
"API_port": 55441,
|
||||
"API_transactions_rolled_back": true,
|
||||
"recovered_recalculated_HTML_dossier": 6,
|
||||
"frozen_prior_results_preserved": true,
|
||||
"typescript": "passed",
|
||||
"build": "passed, actual subprocess exit0",
|
||||
"PHP_formatting": "pint passed",
|
||||
"browser_manual": "not performed; no manual UI acceptance claimed"
|
||||
},
|
||||
"preservation": {
|
||||
"previous_deliveries": [
|
||||
"international838ad941",
|
||||
"PECe182d1d7",
|
||||
"sectors669cb897"
|
||||
],
|
||||
"source_files_byte_identical": 31,
|
||||
"existing_QA_records": {
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"tables": {
|
||||
"opportunities": {
|
||||
"existing_rows": 55,
|
||||
"unchanged": true
|
||||
},
|
||||
"documents": {
|
||||
"existing_rows": 64,
|
||||
"unchanged": true
|
||||
},
|
||||
"opportunity_documents": {
|
||||
"existing_rows": 1,
|
||||
"unchanged": true
|
||||
},
|
||||
"simulation_form_drafts": {
|
||||
"existing_rows": 19,
|
||||
"unchanged": true
|
||||
},
|
||||
"users": {
|
||||
"existing_rows": 40,
|
||||
"unchanged": true
|
||||
},
|
||||
"organizations": {
|
||||
"existing_rows": 3,
|
||||
"unchanged": true
|
||||
},
|
||||
"audit_events": {
|
||||
"existing_rows": 409,
|
||||
"unchanged": true
|
||||
}
|
||||
},
|
||||
"transaction_rollback": true
|
||||
},
|
||||
"matrix": "existing AUD-SIM-INT02 updated; all other rows semantically unchanged",
|
||||
"new_accounts_permissions_migrations": false,
|
||||
"active_data_or_configuration_written": false,
|
||||
"remote_deployment_or_publication": false,
|
||||
"Songo_Gurue": "no pilot changes; remain private",
|
||||
"other_dossiers": "same-snapshot origins checked, no global official account reconciliation"
|
||||
},
|
||||
"cases": [
|
||||
{
|
||||
"name": "payable",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "550",
|
||||
"denominator": "1"
|
||||
},
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "expired",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "missing-use",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "overallocated",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "fractional",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "1822",
|
||||
"denominator": "3"
|
||||
},
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "recoverable",
|
||||
"status": "recoverable",
|
||||
"balance": {
|
||||
"numerator": "-500",
|
||||
"denominator": "1"
|
||||
},
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
}
|
||||
],
|
||||
"remaining_L8": [
|
||||
"automatic national-fraction derivation and case-specific treaty correspondence",
|
||||
"economic credit art64/53 and benefit-specific credits with own qualification/limits",
|
||||
"PPC/PEC obligation and calendar, interest/penalties and payment guides with applicable edition",
|
||||
"autonomous taxation, special periods, other currencies, M20/M22 transport/submission",
|
||||
"exceptional or transitional interyear cases outside ordinary source window; no official ledger created"
|
||||
],
|
||||
"next_independent_increment": {
|
||||
"item": "economic double-tax credit",
|
||||
"source": "existing accepted CIRPC64,53(1)a and exclusion40; BR52 original",
|
||||
"required_correspondence": "distributed profits included, payer/recipient residence and IRPC nonexemption, art40 distinction, source tax, gross-up53, proportional cap64, actual use and nonduplication; do not infer from declared dividend alone"
|
||||
},
|
||||
"L8_complete": false,
|
||||
"evidence": {
|
||||
"api.log": "ef604fbe7a289930cb0b6dfa35407e0f115092894d32fd98c04a9e1f3b732415",
|
||||
"build-result.json": "80bb1b6bb0ccadaf94f241ace9b0b19f77461b193b8b7522afa655d414d36198",
|
||||
"build.log": "d93839f94f37e181acafe3f6295c10982e036475b1f5186aedba9a9ae3cd6bd9",
|
||||
"existing-records-preservation.json": "b45b3306d3c9dee63fbbaf9a04bba31008019e65892bd16322460b5ef53eda7d",
|
||||
"frontend-tests.log": "86a878a794a8f1ed7db56d689f0b9d5a2bdbc6079aa66e3cfe4b65ae64e656f6",
|
||||
"protected-consumers.json": "9f147ea688a79a77a8d7507cf1c322a6a3c03b959be8fc5ed114db63dac05761",
|
||||
"recovered-report-receipt.json": "82df86eaabbb79d760e4f2f1efb0f900d9e9607e11ea49502746dbafc46fed03",
|
||||
"source-preservation.json": "c28df37db83989fe5746dcb5382a75c4f39471a16a7cbe64670260209cf6ad79"
|
||||
},
|
||||
"qa_commit": "d134a92d169f9159a692ed158e3a051889f7ab3a",
|
||||
"qa_branch_pushed": false
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"status": "prepared_delivery_deferred_by_user_capacity_not_satisfied",
|
||||
"date": "2026-10-27",
|
||||
"candidate": "14360748194f3658d91a7d7ae5615efd0fcbfbb7",
|
||||
"QA_runtime_commit": "11a6cee981f0a425b0fceefb6ed85485bb298245",
|
||||
"candidate_branch": "codex/irpc-l8-settlement-qa-20261026",
|
||||
"remote_main_verified": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"installed_remote_verified": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"capacity": {
|
||||
"checked_at_UTC": "2026-10-27T06:05:28.744338+00:00",
|
||||
"partition": "/dev/md2 / ext4",
|
||||
"free_bytes": 4402343936,
|
||||
"free_GiB": 4.100002288818359,
|
||||
"required_after_backup_bytes": 5368709120,
|
||||
"previous_backup_reference_bytes": 175917490,
|
||||
"estimated_required_before_backup_bytes": 5544626610,
|
||||
"additional_free_bytes_needed": 1142282674,
|
||||
"additional_GiB_needed_rounded_up": 1.07,
|
||||
"inodes_available": 21340182,
|
||||
"release_entries_reference": 31259,
|
||||
"inodes_sufficient_against_reference": true,
|
||||
"fresh_measurement_required_on_resume": true,
|
||||
"installer_threshold_not_changed": true
|
||||
},
|
||||
"baseline": {
|
||||
"baseline": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"files_verified": 168,
|
||||
"active_writes": 0
|
||||
},
|
||||
"prepared_runtime_delta_files": 5,
|
||||
"preserved_runtime_files": 134,
|
||||
"originals_preserved": 31,
|
||||
"caches_read_only": {
|
||||
"caches": [
|
||||
{
|
||||
"path": "/root/.cache/composer/files",
|
||||
"resolved": "/root/.cache/composer/files",
|
||||
"symlink": false,
|
||||
"bytes": 127242240,
|
||||
"first_entries": [
|
||||
"carbonphp",
|
||||
"maatwebsite",
|
||||
"iamcal",
|
||||
"bordoni",
|
||||
"fidry",
|
||||
"mockery",
|
||||
"symfony",
|
||||
"mtdowling",
|
||||
"inertiajs",
|
||||
"tcg",
|
||||
"nyholm",
|
||||
"dflydev"
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "/tmp/node-compile-cache",
|
||||
"resolved": "/tmp/node-compile-cache",
|
||||
"symlink": false,
|
||||
"bytes": 4009984,
|
||||
"first_entries": [
|
||||
"v22.23.4-x64-d04b8edd-1001"
|
||||
]
|
||||
}
|
||||
],
|
||||
"package_manager_processes": [],
|
||||
"open_cache_handles": [],
|
||||
"service": "ActiveState=inactive\nSubState=dead\n",
|
||||
"active_writes": 0
|
||||
},
|
||||
"caches_insufficient_to_resolve_gap": true,
|
||||
"cleanup_performed": false,
|
||||
"fresh_backup_executed": false,
|
||||
"fresh_restore_executed": false,
|
||||
"main_push_executed": false,
|
||||
"installation_executed": false,
|
||||
"server_persistent_writes": 0,
|
||||
"business_database_writes": 0,
|
||||
"user_decision": "Manter a entrega preparada por agora",
|
||||
"next_action": "New space/inode and main/servedrevision checks;confirm capacity for freshbackup/restore and isolatedbuild;then authorized Git delivery and onlydelta verification. Keep active release until new is ready.",
|
||||
"QA_proofs_reused": {
|
||||
"frontend": 19,
|
||||
"API_assertions": 170,
|
||||
"UI_round_trip": true,
|
||||
"typescript": true,
|
||||
"isolatedbuild": true,
|
||||
"not_repeated": true
|
||||
},
|
||||
"L8_partial": true,
|
||||
"PEC_and_own_credits_separate": true,
|
||||
"L7_residuals_unchanged": true,
|
||||
"SGF_TEMPO_untouched": true,
|
||||
"preflight_pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604",
|
||||
"resume_candidate_branch": "codex/irpc-l8-settlement-qa-20261026",
|
||||
"notes_branch": "codex/irpc-l8-delivery-capacity-20261027"
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
{
|
||||
"date": "2026-10-28",
|
||||
"status": "ordinary economic credit implemented and demonstrated in isolated QA; not installed",
|
||||
"branch": "codex/irpc-l8-economic-qa-20261028",
|
||||
"base": "6ededb59",
|
||||
"last_installed_receipt_reference": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"remote_status_read_this_turn": false,
|
||||
"scope": {
|
||||
"current_year": "2026",
|
||||
"current_period": "calendar year, resident general",
|
||||
"currency": "documented MZN; exact fractions without fiscal rounding",
|
||||
"profit_kind": "ordinary distributions art64(1–2)",
|
||||
"eligibility": "same-country seat/effective management; payer subject to IRPC and nonexempt; nonapplication of40(1) documented, including2009 version",
|
||||
"nominal_credit": "60 percent of documented IRPC corresponding to included distributed profits; no assumed rate on net dividend",
|
||||
"gross_up": "expected nominal60 percent reconciled with53(1)a amount already included in current L6; does not overwrite or recalculate source base",
|
||||
"proportional_ceiling": "case-specific documented input tied to current assessment; not automatically derived",
|
||||
"prior_use": "actual documented economic credit use, distinct from simulation history and prior source-tax attributions",
|
||||
"order": [
|
||||
"economic credit up to collecta",
|
||||
"international credit current/prior according to existing explicit selection",
|
||||
"PEC current/prior according to existing explicit selection",
|
||||
"own withholdings and PPC"
|
||||
],
|
||||
"refund": "no economic-credit refund or carry created; PPC can create simulated recoverable balance"
|
||||
},
|
||||
"proof_parcels": {
|
||||
"stable_identity": "issuer/document/parcel; distribution identity also independent of source-tax document,date and row id",
|
||||
"economic_vs_international": "same physical tax parcel cannot fund both credit natures",
|
||||
"same_paper_different_tax": "supported distinct parcels can coexist; old proof without a parcel overlaps the whole paper until reconciled",
|
||||
"capacity": "same proof parcel amounts and prior attributions must agree and total allocation remains within available amount across snapshot contexts",
|
||||
"L5": "existing withholding source/allocation checks preserved; parcel relabelling cannot turn repeated L5 use into new tax",
|
||||
"partial_information": "saved and recovered as indeterminate, never reset or silently assumed absent",
|
||||
"global_official_account_reconciliation": false
|
||||
},
|
||||
"compatibility_group": {
|
||||
"included_prior_QA": "d134a92d169f9159a692ed158e3a051889f7ab3a; receipt6ededb59",
|
||||
"candidate_contains_carry_increment": true,
|
||||
"combined_API_case": "1408-12economic-8currentInternational-50priorInternational-200currentPEC-100priorPEC-500PPC=538MZN payable simulated",
|
||||
"previous_carry_history_preserved": "550 MZN prior simulated result retained unchanged",
|
||||
"changed_allocation": "economic priority checks remaining collecta but keeps user prior/current allocations; over-allocation becomes pending rather than reduced automatically",
|
||||
"installation": false
|
||||
},
|
||||
"restriction_origins": {
|
||||
"Tempo": "next economic increment, distinction from international, no duplicate same parcel, preserve approved evidence/history; compatible grouping allowed",
|
||||
"accepted_requirement": "CIRPC64(1–2),53(1)a,40(1) amended by20/2009; RIRPC21(2/5)",
|
||||
"implementation_choices": "optional versioned detail; normal resident general2026/MZN scope; documentary inclusion/gross-up/proportional quota; optional parcel annotations on existing proof types; no additional organizational authority"
|
||||
},
|
||||
"verification": {
|
||||
"economic_new_frontend_tests": 20,
|
||||
"previous_affected_tests": 65,
|
||||
"frontend_pass": 85,
|
||||
"frontend_fail": 0,
|
||||
"API_tests": 1,
|
||||
"API_assertions": 210,
|
||||
"API_cases": 11,
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"loopback_port": 55441,
|
||||
"API_transactions_rolled_back": true,
|
||||
"recovered_cases_recalculated_with_HTML_and_dossier": 11,
|
||||
"frozen_histories_preserved": true,
|
||||
"typescript": "passed",
|
||||
"build": "isolated QA, subprocess exit0, final component hashes recorded",
|
||||
"PHP_formatting": "pint passed",
|
||||
"new_browser_manual_proof": false,
|
||||
"team_usability_evaluation": "unchanged; awaiting team feedback"
|
||||
},
|
||||
"preservation": {
|
||||
"protected_files_same_git_content": 558,
|
||||
"raw_checkout_difference": {
|
||||
"kind": "LF/CRLF environment difference only, no semantic loss",
|
||||
"files": [
|
||||
"docs/investmoz/simulations/irpc-l8-carry-qa-20261028.json"
|
||||
]
|
||||
},
|
||||
"source_originals_same_bytes": 31,
|
||||
"existing_QA_records": {
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"tables": {
|
||||
"opportunities": {
|
||||
"existing_rows": 55,
|
||||
"unchanged": true
|
||||
},
|
||||
"documents": {
|
||||
"existing_rows": 64,
|
||||
"unchanged": true
|
||||
},
|
||||
"opportunity_documents": {
|
||||
"existing_rows": 1,
|
||||
"unchanged": true
|
||||
},
|
||||
"simulation_form_drafts": {
|
||||
"existing_rows": 19,
|
||||
"unchanged": true
|
||||
},
|
||||
"users": {
|
||||
"existing_rows": 40,
|
||||
"unchanged": true
|
||||
},
|
||||
"organizations": {
|
||||
"existing_rows": 3,
|
||||
"unchanged": true
|
||||
},
|
||||
"audit_events": {
|
||||
"existing_rows": 409,
|
||||
"unchanged": true
|
||||
}
|
||||
},
|
||||
"transaction_rollback": true
|
||||
},
|
||||
"existing_matrix": "only AUD-SIM-INT02 evidence updated; other records unchanged semantically",
|
||||
"old_carry_receipt_and_fixture": "unchanged",
|
||||
"schema_permissions_configuration": "no schema/configuration/migration/grant changes; no new live comparison claimed",
|
||||
"active_data_writes": false,
|
||||
"new_accounts": false,
|
||||
"new_imports_or_publication": false,
|
||||
"remote_operations": false,
|
||||
"Songo_Gurue_SGF_TEMPO": "untouched"
|
||||
},
|
||||
"cases": [
|
||||
{
|
||||
"name": "payable",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "688",
|
||||
"denominator": "1"
|
||||
},
|
||||
"economicDeduction": {
|
||||
"numerator": "12",
|
||||
"denominator": "1"
|
||||
},
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "combined",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "538",
|
||||
"denominator": "1"
|
||||
},
|
||||
"economicDeduction": {
|
||||
"numerator": "12",
|
||||
"denominator": "1"
|
||||
},
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "quota",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "695",
|
||||
"denominator": "1"
|
||||
},
|
||||
"economicDeduction": {
|
||||
"numerator": "5",
|
||||
"denominator": "1"
|
||||
},
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "prior-use",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "691",
|
||||
"denominator": "1"
|
||||
},
|
||||
"economicDeduction": {
|
||||
"numerator": "9",
|
||||
"denominator": "1"
|
||||
},
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "duplicate",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"economicDeduction": null,
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "missing-gross-up",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"economicDeduction": null,
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "article40",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"economicDeduction": null,
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "shared-paper",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "688",
|
||||
"denominator": "1"
|
||||
},
|
||||
"economicDeduction": {
|
||||
"numerator": "12",
|
||||
"denominator": "1"
|
||||
},
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "partial-parcel",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"economicDeduction": null,
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "fractional",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "349997",
|
||||
"denominator": "500"
|
||||
},
|
||||
"economicDeduction": {
|
||||
"numerator": "3",
|
||||
"denominator": "500"
|
||||
},
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
},
|
||||
{
|
||||
"name": "recoverable",
|
||||
"status": "recoverable",
|
||||
"balance": {
|
||||
"numerator": "-500",
|
||||
"denominator": "1"
|
||||
},
|
||||
"economicDeduction": {
|
||||
"numerator": "12",
|
||||
"denominator": "1"
|
||||
},
|
||||
"apiRecovered": true,
|
||||
"recalculationEqual": true,
|
||||
"html": true,
|
||||
"dossier": true,
|
||||
"frozenHistoryPreserved": true
|
||||
}
|
||||
],
|
||||
"remaining": {
|
||||
"economic": [
|
||||
"automatic inclusion/correction of distributed profits and53 addition in L6",
|
||||
"automatic proportional ceiling derivation and complete40(1) exclusion treatment at base stage",
|
||||
"liquidation64(3),associations64(4),special-period and other-currency cases"
|
||||
],
|
||||
"other_L8": [
|
||||
"specific benefit credits and their qualification,cumulation and limits",
|
||||
"automatic international national-fraction and case-specific treaty matching",
|
||||
"PPC/PEC obligation/calendar,interest/penalties and payment guides with applicable edition",
|
||||
"autonomous taxation,special periods,other currencies and M20/M22 transport/submission",
|
||||
"exceptional/transitional interyear cases beyond accepted ordinary carry scope"
|
||||
]
|
||||
},
|
||||
"L8_complete": false,
|
||||
"evidence": {
|
||||
"api-result.json": "124fd50cb6d223cdd18fedc166d00af7254199b6e6dedf9be82f71db87af6d01",
|
||||
"api.log": "e5cb58ba25c82feb1a14a8259cd112a58455b8cc1c17d8540b08ec30b87583c7",
|
||||
"build-result.json": "256bb54e1d47ec73de37810b9673f10464c65fb970ea3b7ae28bbea36ba222e3",
|
||||
"build.log": "69f17893b47b8d748651933f6a88a5f4206d58173397c1695d58472db9a26cf6",
|
||||
"existing-records-preservation.json": "b45b3306d3c9dee63fbbaf9a04bba31008019e65892bd16322460b5ef53eda7d",
|
||||
"frontend-result.json": "f73293b96cda7c81c86a6716a04a18d632e10361bf7d3f616695dbdc7695aeb0",
|
||||
"frontend.log": "ff784389cda3f2c232f4760f74c053bc16b6d134ef975d0aad13132373e5e275",
|
||||
"pint-result.json": "124fd50cb6d223cdd18fedc166d00af7254199b6e6dedf9be82f71db87af6d01",
|
||||
"pint.log": "cd1a94fc2cf6a965b86e1a4809d6c7fb9148b1ee374e1010ed2ac96ff4876ec2",
|
||||
"protected-consumers.json": "172542788e44fe604ca90d95a71d87f47a3baeae0c61950bc50d342658aa82ad",
|
||||
"recovered-report-receipt.json": "ecce91a9c00c3a88d234486c020b5aa1681928eb1b1aeaeef0e7a569a2e17654",
|
||||
"source-preservation.json": "6aceebe1cf883ca709ccbbbef7f2a756ee5dc51c12b3281c3659e83abfd90b70",
|
||||
"types-result.json": "256bb54e1d47ec73de37810b9673f10464c65fb970ea3b7ae28bbea36ba222e3",
|
||||
"types.log": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
||||
},
|
||||
"qa_commit": "aae67c169dc0d14f95cf2ee6fa28e5ff05341dcf",
|
||||
"qa_branch_pushed": false,
|
||||
"grouped_delivery_manifest": "outputs/irpc-l8-economic-20261028/grouped-delivery-prepared.json"
|
||||
}
|
||||
@@ -0,0 +1,382 @@
|
||||
{
|
||||
"status": "QA_complete_ready_for_grouped_delivery_not_installed",
|
||||
"date": "2026-10-26",
|
||||
"branch": "codex/irpc-l8-settlement-qa-20261026",
|
||||
"runtime_revision": "11a6cee981f0a425b0fceefb6ed85485bb298245",
|
||||
"installed_revision_per_user": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"remote_main_checked": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"version": "IRPC-annual-settlement/1",
|
||||
"scope": "resident general IRPC,annualcivil2026,MZN,currentdetermined assessment,documented absence of positive PEC/unmappedcredits and autonomoustax needing ownsettlement",
|
||||
"inputs_reused": [
|
||||
"current L6 or applicable qualifiedL7 assessment key/version/subjectNUIT/period;never add both",
|
||||
"L5 received/effective/on_account qualified and reconciled withholding proofs",
|
||||
"actual documented PPC payments by subject/period/receipt",
|
||||
"known/declaredabsence/missing states for every credit/paymentfamily"
|
||||
],
|
||||
"PEC_and_special_credits_separate": true,
|
||||
"official_credit_consumption_or_central_reservation": false,
|
||||
"duplicate_guards": [
|
||||
"same L5 allocation/pair",
|
||||
"normalised issuer/document even if date changed",
|
||||
"same receipt as withholding and PPC",
|
||||
"receipt total including partial allocations in other contexts in same dossier",
|
||||
"same sourceKey L5 allocation cannot consume larger receipt twice",
|
||||
"different entity/year or inconsistent proven amount"
|
||||
],
|
||||
"cases": {
|
||||
"payable": {
|
||||
"status": "payable",
|
||||
"knownWithholdings": {
|
||||
"numerator": "300",
|
||||
"denominator": "1"
|
||||
},
|
||||
"knownPpc": {
|
||||
"numerator": "500",
|
||||
"denominator": "1"
|
||||
},
|
||||
"arithmeticBalance": {
|
||||
"numerator": "608",
|
||||
"denominator": "1"
|
||||
},
|
||||
"payable": {
|
||||
"numerator": "608",
|
||||
"denominator": "1"
|
||||
},
|
||||
"recoverable": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pending": []
|
||||
},
|
||||
"recoverable": {
|
||||
"status": "recoverable",
|
||||
"knownWithholdings": {
|
||||
"numerator": "1000",
|
||||
"denominator": "1"
|
||||
},
|
||||
"knownPpc": {
|
||||
"numerator": "600",
|
||||
"denominator": "1"
|
||||
},
|
||||
"arithmeticBalance": {
|
||||
"numerator": "-192",
|
||||
"denominator": "1"
|
||||
},
|
||||
"payable": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"recoverable": {
|
||||
"numerator": "192",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pending": []
|
||||
},
|
||||
"balanced": {
|
||||
"status": "balanced",
|
||||
"knownWithholdings": {
|
||||
"numerator": "408",
|
||||
"denominator": "1"
|
||||
},
|
||||
"knownPpc": {
|
||||
"numerator": "1000",
|
||||
"denominator": "1"
|
||||
},
|
||||
"arithmeticBalance": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"payable": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"recoverable": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pending": []
|
||||
},
|
||||
"absent": {
|
||||
"status": "payable",
|
||||
"knownWithholdings": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"knownPpc": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"arithmeticBalance": {
|
||||
"numerator": "1408",
|
||||
"denominator": "1"
|
||||
},
|
||||
"payable": {
|
||||
"numerator": "1408",
|
||||
"denominator": "1"
|
||||
},
|
||||
"recoverable": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pending": []
|
||||
},
|
||||
"missing": {
|
||||
"status": "indeterminate",
|
||||
"knownWithholdings": {
|
||||
"numerator": "300",
|
||||
"denominator": "1"
|
||||
},
|
||||
"knownPpc": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"arithmeticBalance": null,
|
||||
"payable": null,
|
||||
"recoverable": null,
|
||||
"pending": [
|
||||
"QA-PPC-2026-1: Error: PPC exige comprovativo efectivo,MZN,data,entidade e exercício correspondentes;projecção/tesouraria não é pagamento"
|
||||
]
|
||||
},
|
||||
"duplicate": {
|
||||
"status": "indeterminate",
|
||||
"knownWithholdings": {
|
||||
"numerator": "300",
|
||||
"denominator": "1"
|
||||
},
|
||||
"knownPpc": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"arithmeticBalance": null,
|
||||
"payable": null,
|
||||
"recoverable": null,
|
||||
"pending": [
|
||||
"QA-PPC-2026-1: Comprovativo utilizado além do montante disponível ou com montantes divergentes neste/outro mapa."
|
||||
]
|
||||
},
|
||||
"pec": {
|
||||
"status": "indeterminate",
|
||||
"knownWithholdings": {
|
||||
"numerator": "300",
|
||||
"denominator": "1"
|
||||
},
|
||||
"knownPpc": {
|
||||
"numerator": "500",
|
||||
"denominator": "1"
|
||||
},
|
||||
"arithmeticBalance": null,
|
||||
"payable": null,
|
||||
"recoverable": null,
|
||||
"pending": [
|
||||
"PEC: Error: montante positivo fora deste recorte:corresponder ordem,limite e transporte próprios;sem abatimento ou reembolso automático"
|
||||
]
|
||||
}
|
||||
},
|
||||
"checks": {
|
||||
"frontend_tests": 19,
|
||||
"frontend_pass": 19,
|
||||
"API_tests": 1,
|
||||
"API_assertions": 170,
|
||||
"API_cases": 7,
|
||||
"database": "simulator_fiscal_delta_20261021_test",
|
||||
"host": "127.0.0.1",
|
||||
"port": 55441,
|
||||
"transaction_rollback": true,
|
||||
"actual_components_UI": {
|
||||
"actualComponents": true,
|
||||
"explicitPreparation": true,
|
||||
"onlyActualOnAccountProofSelectable": true,
|
||||
"duplicateSelectionDisabled": true,
|
||||
"missingNotZero": true,
|
||||
"ownBeneficiaryAndIncludedIncomeConfirmed": true,
|
||||
"actualPPCConfirmed": true,
|
||||
"PECAndCreditsSeparate": true,
|
||||
"payable608": true,
|
||||
"recoverable192": true,
|
||||
"balanced": true,
|
||||
"duplicateIndeterminate": true,
|
||||
"positivePECIndeterminate": true,
|
||||
"oldBooksAndPlanUnchanged": true,
|
||||
"saveReloadRecoverReportDownload": true,
|
||||
"errors": []
|
||||
},
|
||||
"wayfinder_with_form": "passed",
|
||||
"typescript": "passed",
|
||||
"isolated_QA_build": "passed",
|
||||
"build_existing_warnings": [
|
||||
"chunk size over500kB;plugin timing diagnostic"
|
||||
],
|
||||
"prior_accepted_suites_not_repeated": true
|
||||
},
|
||||
"runtime_delta": [
|
||||
"resources/js/components/simulation-form.tsx",
|
||||
"resources/js/components/simulation-irpc-annual.tsx",
|
||||
"resources/js/lib/irpc-annual-settlement.ts",
|
||||
"resources/js/lib/project-dossier-report.ts",
|
||||
"resources/js/lib/project-dossier.ts",
|
||||
"tests/Feature/IrpcAnnualSettlementDraftTest.php",
|
||||
"tests/frontend/irpc-annual-settlement.test.mjs",
|
||||
"tools/irpc-annual-settlement-qa.php"
|
||||
],
|
||||
"preservation": {
|
||||
"baseline": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"documentation_base": "d5f11462",
|
||||
"existing_tracked_files": 2832,
|
||||
"changed_existing_files": [
|
||||
"docs/investmoz/consolidated-review-matrix-2026-10-03.md",
|
||||
"docs/investmoz/unification/traceability-and-manual.md",
|
||||
"docs/investmoz/v2/auditoria-portal/matriz-requisitos.csv",
|
||||
"resources/js/components/simulation-form.tsx",
|
||||
"resources/js/lib/project-dossier-report.ts",
|
||||
"resources/js/lib/project-dossier.ts"
|
||||
],
|
||||
"all_other_existing_files_byte_identical": true,
|
||||
"schema_configuration_permissions_unchanged": true,
|
||||
"L5_L6_L7_engines_and_fixtures_byte_identical": true,
|
||||
"originals_count": 31,
|
||||
"originals": {
|
||||
"docs/investmoz/simulations/source-archive/AT-Comunicado-9-2026-ISPC.pdf": "106f8a9ce9255c03549c70bf07fe999d32e6e55302d009b509862aa74ccb4973",
|
||||
"docs/investmoz/simulations/source-archive/AT-MRFTA-19-39.pdf": "8ea62c53066b482f87078a7a7b1ecf15ca98a12a122e8d7abca63acfc993186b",
|
||||
"docs/investmoz/simulations/source-archive/AT-Modelo-30-ISPC.pdf": "6802edd06b6ff638a0b851a3ec7ecf69af8f07840faa47446becad67d35d445c",
|
||||
"docs/investmoz/simulations/source-archive/AT-Modelo-B-Geral.pdf": "bd977c7c59d4d98befd92e2c566b1bf168cb1343bb519f51b41a3807f431fc57",
|
||||
"docs/investmoz/simulations/source-archive/BM-Mercado-Monetario-MAIBOR-20261025.html": "00e8a7e0d3a1db4ca3beb56d5361b2084a0f1684f3d40fc1c203702a2190e063",
|
||||
"docs/investmoz/simulations/source-archive/BR-16-I-Serie-2008-04-16.pdf": "fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee",
|
||||
"docs/investmoz/simulations/source-archive/BR-248-I-Suplemento-1-2025.pdf": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251",
|
||||
"docs/investmoz/simulations/source-archive/BR-89-I-Serie-2017-06-08.pdf": "11f0cab15eb6e51010952203ffa24fdc533a24fd642e19525fe4f46b17a1f5e5",
|
||||
"docs/investmoz/simulations/source-archive/BR-95-I-Suplemento-2025-05-21.pdf": "e0e682e2c027c3cd9c1d46a73a3f48bc5f6bdbf05667fd97314d7a3f6a456358",
|
||||
"docs/investmoz/simulations/source-archive/BR252-I-Serie-2022-Lei20-PESOE.pdf": "1159fd3ce1ba5581671796d083534da48bd3c5578298819e896f1c2a8026318d",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-22-2021-BR70.pdf": "a8fac38dcfe08f9c7a8e46254cff10e1ec82fc4f7a8d88ad6e4fe7d91ffc21a5",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-27-2026-BR123.pdf": "26249c3fa58f149c81de36e99d1aac2819a4771379d9e8833159660dabf539bb",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-29-1998-BR22-5-suplemento.pdf": "6242cbe675faadf085f43f95ec8c7e8868aafe67c3b2ab2bb010992288f954f8",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-3-2011-BR-11-I-mineiros.pdf": "5bca1133666ba9c69870b89823420175b7b5b8d0eccb667ecdf5c29716f3b6be",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-37-2023-BR124.pdf": "7e680b191481faa0e2e9057fa5053587eb2a29d1d8c819e0eb9f02814255a04c",
|
||||
"docs/investmoz/simulations/source-archive/Decreto-9-2008-BR16.pdf": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697",
|
||||
"docs/investmoz/simulations/source-archive/Lei-13-2016-CIVA-BR-156-10-suplemento.pdf": "b90dc7c14ecea2e378c4a62e8e5a47d54a5644c457baeb8b8053b92fd2a5710b",
|
||||
"docs/investmoz/simulations/source-archive/Lei-14-1992-BR42.pdf": "089fff7423e99a70a230a73ca379e4ea3a91d124703f91016e57ff82794b9e56",
|
||||
"docs/investmoz/simulations/source-archive/Lei-17-2022-BR251-exemplar-MCNet5.pdf": "14eb34f0af91a8f5cb1770c7b52d6ff839c6818302d1ed96d79afbfb9fe999d4",
|
||||
"docs/investmoz/simulations/source-archive/Lei-17-2022-IPP-BR250-Parlamento.pdf": "978cd22403ffd336a631704ecd7a5bbd814a427c815b9acdaca5515591dd9e2a",
|
||||
"docs/investmoz/simulations/source-archive/Lei-19-2013-BR76.pdf": "bba96d645cc935ffc3d1a79b9f0f73ac1c693d6459c2ad41f56cd2841accae76",
|
||||
"docs/investmoz/simulations/source-archive/Lei-19-2017-IRPS-BR-OCAM.pdf": "c3a0186cb9ad090d7a9533006295dc9bb6a62ad0d6150173cbd49dba4ee4b52d",
|
||||
"docs/investmoz/simulations/source-archive/Lei-2-2011-BR-1-4-suplemento-MCNet.pdf": "a7543a68cc3287a46a83c39a04821b40f649dd06c4e9b5dc51ff0b47fba08899",
|
||||
"docs/investmoz/simulations/source-archive/Lei-20-2009-BR36-AT-exemplar19.pdf": "fc1c8144db42960cbf73e717e095896f511ece0f907f58f78819b27d6917a7ee",
|
||||
"docs/investmoz/simulations/source-archive/Lei-22-2022-IVA-republicada-BR-250-2-suplemento.pdf": "ea1b0dc6f5cf6e595f6d9a19e7042f398999e0087caef1785f6e8fac571b5f53",
|
||||
"docs/investmoz/simulations/source-archive/Lei-34-2007-BR52.pdf": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e",
|
||||
"docs/investmoz/simulations/source-archive/Lei-4-1994-BR37-3-suplemento.pdf": "210df9db8980d0a5690cd187a6eeec7e37a900d743e39062c16f4e0d12215c7e",
|
||||
"docs/investmoz/simulations/source-archive/Lei-4-2012-BR3.pdf": "b8845cef41dcbd9ba50c43dbfa743a56030dd3d348242a107e1ae30279eec121",
|
||||
"docs/investmoz/simulations/source-archive/Lei-7-1991-Partidos-IFES.pdf": "6b783a0bb3330688ef10660a58060d9724aa2da6a873d234fe902f0eaaeda42d",
|
||||
"docs/investmoz/simulations/source-archive/PT-MZ-CDT-1992.pdf": "d504e1024b28aee5c6acf4592acb96ec9c915a8414f67a61ab6984d6acf9df9d",
|
||||
"docs/investmoz/simulations/source-archive/PT-MZ-Protocolo-2009.pdf": "f353773dcf41f09f4daa6cf5ba5a5f7994f3e02615867c2dcffc61c3d901bf9b"
|
||||
},
|
||||
"all_seven_recovered_cases_match_final_inputs": true,
|
||||
"no_active_database_or_server_operations": true,
|
||||
"no_SGF_TEMPO_operations": true,
|
||||
"runtime_changed_existing_files": [
|
||||
"resources/js/components/simulation-form.tsx",
|
||||
"resources/js/lib/project-dossier-report.ts",
|
||||
"resources/js/lib/project-dossier.ts"
|
||||
],
|
||||
"documentation_changed_existing_files": [
|
||||
"docs/investmoz/consolidated-review-matrix-2026-10-03.md",
|
||||
"docs/investmoz/unification/traceability-and-manual.md",
|
||||
"docs/investmoz/v2/auditoria-portal/matriz-requisitos.csv"
|
||||
],
|
||||
"documentation_only_appends_and_target_AUD_record": true
|
||||
},
|
||||
"sources_reused": [
|
||||
{
|
||||
"file": "docs/investmoz/simulations/source-archive/Lei-34-2007-BR52.pdf",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e",
|
||||
"articles": "CIRPC63/67",
|
||||
"PDF_pages": [
|
||||
18,
|
||||
19
|
||||
],
|
||||
"official_source_acceptance_preserved": true
|
||||
},
|
||||
{
|
||||
"file": "docs/investmoz/simulations/source-archive/Decreto-9-2008-BR16.pdf",
|
||||
"sha256": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697",
|
||||
"articles": "RIRPC21/27",
|
||||
"PDF_pages": [
|
||||
6,
|
||||
7
|
||||
],
|
||||
"official_source_acceptance_preserved": true
|
||||
},
|
||||
{
|
||||
"file": "docs/investmoz/simulations/source-archive/BR-248-I-Suplemento-1-2025.pdf",
|
||||
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251",
|
||||
"articles": "Lei12/2025 IRPC67/version2026",
|
||||
"PDF_pages": [
|
||||
18,
|
||||
19,
|
||||
20
|
||||
],
|
||||
"official_source_acceptance_preserved": true
|
||||
}
|
||||
],
|
||||
"minimum": {
|
||||
"rule": "Decreto9/2008 art27(6)",
|
||||
"scope": "2026 resident_general/calendar/MZN",
|
||||
"less_than": "100 MZN",
|
||||
"strict_boundary_tests": [
|
||||
"+99.99",
|
||||
"+100",
|
||||
"-99.99",
|
||||
"-100"
|
||||
],
|
||||
"arithmetic_exact": true,
|
||||
"new_rounding": false,
|
||||
"automatic_carry": false
|
||||
},
|
||||
"remaining_code": [
|
||||
"automatic PPC/PEC obligationcalculation",
|
||||
"positivePEC/creditorderlimitscarry",
|
||||
"autonomoustaxsettlement",
|
||||
"specialperiods/foreigncurrencypayments",
|
||||
"interest/penalties/calendar/guideremittance",
|
||||
"AT submission/refundprocessing",
|
||||
"unmappedM20M22fields"
|
||||
],
|
||||
"documentary_dependencies": {
|
||||
"previous_L5_L6_L7_matrix_items_preserved": true,
|
||||
"examples": [
|
||||
"mixed/withheld cooperativeincome needs L7 segregation",
|
||||
"express cumulation exception requires disposition/period/limits",
|
||||
"divergent M20M22 field needs exactedition and representation"
|
||||
],
|
||||
"only_dependent_case_blocked": true
|
||||
},
|
||||
"L6_operational_delimited": true,
|
||||
"L7_partial": true,
|
||||
"L8_partial": true,
|
||||
"submitted_or_payment_or_refund_received": false,
|
||||
"server_operations_this_turn": false,
|
||||
"reported_server_free_GiB": 4.14,
|
||||
"reported_capacity_not_measured_this_turn": true,
|
||||
"capacity_blocks_future_install_not_QA": true,
|
||||
"future_delivery": {
|
||||
"fresh_main_compatibility": true,
|
||||
"measure_space_and_inodes": true,
|
||||
"confirm_backup_and_isolated_build_capacity": true,
|
||||
"fresh_backup_restore": true,
|
||||
"keep_active_until_new_ready": true,
|
||||
"verify_served_revision_and_only_delta": true
|
||||
},
|
||||
"evidence_directory": "outputs/irpc-l8-settlement/",
|
||||
"global_effort": {
|
||||
"initial_L8_L14_reference_hours": [
|
||||
240,
|
||||
416
|
||||
],
|
||||
"is_current_remainingforecast": false,
|
||||
"reconciliation_before_globalforecast": [
|
||||
"implemented/reusable vs remainingcode perlot",
|
||||
"reuseacceptedproofs;no duplicate sharedcomponentestimate",
|
||||
"documentarywait separately",
|
||||
"L1-L7residuals,integration/delivery,L15-L16 included"
|
||||
]
|
||||
},
|
||||
"root_checkout_runtime_not_merged": true,
|
||||
"SGF_TEMPO_untouched": true
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
{
|
||||
"status": "L8_first_increment_delimited_not_implemented",
|
||||
"date": "2026-10-26",
|
||||
"installed_L7": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"no_new_L8_calculator_installed": true,
|
||||
"initial_scope": "resident general IRPC,annualcivil2026,MZN,currentdetermined assessment,documented absence of positive PEC/unmappedcredits and autonomoustax needing ownsettlement",
|
||||
"inputs_reused": [
|
||||
"current L6 or applicable qualifiedL7 assessment key/version/subjectNUIT/period;never add both",
|
||||
"L5 received/effective/on_account qualified and reconciled withholding proofs",
|
||||
"actual documented PPC payments by subject/period/receipt",
|
||||
"known/declaredabsence/missing states for every credit/paymentfamily"
|
||||
],
|
||||
"wrong_credits_excluded": [
|
||||
"withholding remitted by enterprise on payments to others",
|
||||
"definitive withholding",
|
||||
"projected amount without effective proof",
|
||||
"duplicate receipt/allocation/year",
|
||||
"unmapped positive PEC/investment/doubletax credit"
|
||||
],
|
||||
"sequence": [
|
||||
"validassessment",
|
||||
"admissibledeductions and explicitabsence",
|
||||
"effective onaccount withholdings",
|
||||
"actual PPC",
|
||||
"signed arithmeticbalance",
|
||||
"applicable collection/refund minimum rules",
|
||||
"simulatedpayable orrecoverable;not submittedor receivedrefund"
|
||||
],
|
||||
"proposed_acceptance_cases": [
|
||||
{
|
||||
"colecta": "1408",
|
||||
"withholdings": "300",
|
||||
"PPC": "500",
|
||||
"arithmetic_balance": "608"
|
||||
},
|
||||
{
|
||||
"colecta": "1408",
|
||||
"withholdings": "1000",
|
||||
"PPC": "600",
|
||||
"arithmetic_balance": "-192"
|
||||
},
|
||||
{
|
||||
"colecta": "1408",
|
||||
"withholdings": "408",
|
||||
"PPC": "1000",
|
||||
"arithmetic_balance": "0"
|
||||
},
|
||||
"minimumrule boundaries afterperiod/version mapping",
|
||||
"knownzero vs declaredabsence vs missing",
|
||||
"wrongbeneficiary/definitive/duplicates",
|
||||
"calculation-save-recover-report with oldhistories unchanged"
|
||||
],
|
||||
"cases_tested_now": false,
|
||||
"rule_work_before_implementation": [
|
||||
"CIRPC63/67 with Lei12/2025 nature applicable",
|
||||
"Decreto9/2008 art21(2-5) deductionorder/limits and27(1-2/6) settlement",
|
||||
"100MZN minimum in accepted2008 exemplar:link to applicable version/period before enabling parameter;no generic credibility revalidation",
|
||||
"retain PEC/credits distinct and nonrefundable limits;no3/5year automaticcarry"
|
||||
],
|
||||
"boundaries": [
|
||||
"qualified cooperative withoutwithheldincome cannot silently acceptpositivereceivedwithholdings without L7segregation",
|
||||
"no L6fallback toignore applicablependingL7effect",
|
||||
"autonomoustax/61Apositive needs own settlement articulation",
|
||||
"fraction exact;unmapped formrepresentation onlyblocks affectedtransport"
|
||||
],
|
||||
"deferred": [
|
||||
"automatic PPC/PEC obligationcalculation",
|
||||
"positivePEC/creditorderlimitscarry",
|
||||
"autonomoustaxsettlement",
|
||||
"specialperiods/foreigncurrencypayments",
|
||||
"interest/penalties/calendar/guideremittance",
|
||||
"AT submission/refundprocessing",
|
||||
"unmappedM20M22fields"
|
||||
],
|
||||
"sources_reused": [
|
||||
{
|
||||
"file": "C:\\laragon\\www\\portal-investidor-irpc-l7-common-qa-20261026\\docs\\investmoz\\simulations\\source-archive\\Lei-34-2007-BR52.pdf",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e",
|
||||
"articles": "CIRPC63/67",
|
||||
"PDF_pages": [
|
||||
18,
|
||||
19
|
||||
],
|
||||
"official_source_acceptance_preserved": true
|
||||
},
|
||||
{
|
||||
"file": "C:\\laragon\\www\\portal-investidor-irpc-l7-common-qa-20261026\\docs\\investmoz\\simulations\\source-archive\\Decreto-9-2008-BR16.pdf",
|
||||
"sha256": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697",
|
||||
"articles": "RIRPC21/27",
|
||||
"PDF_pages": [
|
||||
6,
|
||||
7
|
||||
],
|
||||
"official_source_acceptance_preserved": true
|
||||
},
|
||||
{
|
||||
"file": "C:\\laragon\\www\\portal-investidor-irpc-l7-common-qa-20261026\\docs\\investmoz\\simulations\\source-archive\\BR-248-I-Suplemento-1-2025.pdf",
|
||||
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251",
|
||||
"articles": "Lei12/2025 IRPC67/version2026",
|
||||
"PDF_pages": [
|
||||
18,
|
||||
19,
|
||||
20
|
||||
],
|
||||
"official_source_acceptance_preserved": true
|
||||
}
|
||||
],
|
||||
"global_effort": {
|
||||
"initial_L8_L14_reference_hours": [
|
||||
240,
|
||||
416
|
||||
],
|
||||
"is_current_remainingforecast": false,
|
||||
"reconciliation_before_globalforecast": [
|
||||
"implemented/reusable vs remainingcode perlot",
|
||||
"reuseacceptedproofs;no duplicate sharedcomponentestimate",
|
||||
"documentarywait separately",
|
||||
"L1-L7residuals,integration/delivery,L15-L16 included"
|
||||
]
|
||||
},
|
||||
"L7_partial": true,
|
||||
"L8_final_still_not_implemented": true
|
||||
}
|
||||
@@ -0,0 +1,793 @@
|
||||
{
|
||||
"date": "2026-10-28",
|
||||
"status": "installed_and_verified",
|
||||
"served_commit": "569a1cd750f3d2a0b87f130e992e73e070bbd1ab",
|
||||
"previous_commit": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"accepted_QA": {
|
||||
"economic": "aae67c169dc0d14f95cf2ee6fa28e5ff05341dcf",
|
||||
"carry": "d134a92d169f9159a692ed158e3a051889f7ab3a"
|
||||
},
|
||||
"scope": {
|
||||
"economic": {
|
||||
"current_year": "2026",
|
||||
"current_period": "calendar year, resident general",
|
||||
"currency": "documented MZN; exact fractions without fiscal rounding",
|
||||
"profit_kind": "ordinary distributions art64(1–2)",
|
||||
"eligibility": "same-country seat/effective management; payer subject to IRPC and nonexempt; nonapplication of40(1) documented, including2009 version",
|
||||
"nominal_credit": "60 percent of documented IRPC corresponding to included distributed profits; no assumed rate on net dividend",
|
||||
"gross_up": "expected nominal60 percent reconciled with53(1)a amount already included in current L6; does not overwrite or recalculate source base",
|
||||
"proportional_ceiling": "case-specific documented input tied to current assessment; not automatically derived",
|
||||
"prior_use": "actual documented economic credit use, distinct from simulation history and prior source-tax attributions",
|
||||
"order": [
|
||||
"economic credit up to collecta",
|
||||
"international credit current/prior according to existing explicit selection",
|
||||
"PEC current/prior according to existing explicit selection",
|
||||
"own withholdings and PPC"
|
||||
],
|
||||
"refund": "no economic-credit refund or carry created; PPC can create simulated recoverable balance"
|
||||
},
|
||||
"carry": {
|
||||
"year": "2026",
|
||||
"subject": "same subject, resident general",
|
||||
"period": "annual ordinary origins; calendar-year current close",
|
||||
"currency": "documented MZN; exact foreign-credit fractions supported",
|
||||
"international": "eligible origin credit minus origin deduction and documented actual later uses; five subsequent exercises, art65(3)",
|
||||
"pec": "actual PEC eligible origin minus origin deduction and actual later uses; three subsequent exercises, art66(1–2)",
|
||||
"allocation": "explicit documented selection between current and prior exercises, confirmed against current assessment; no presumed FIFO or automatic reduction",
|
||||
"expiry": "ordinary window ended excludes current deduction but keeps source and arithmetic historical remainder",
|
||||
"origin_rules": "origin assessment, inclusion/limits/insufficient collection and applicable period documented; exceptional/transitional rules outside scope"
|
||||
},
|
||||
"grouped_example": "1408-12economic-8currentInternational-50priorInternational-200currentPEC-100priorPEC-500PPC=538MZN payable simulated",
|
||||
"same_parcel_nonduplication": {
|
||||
"stable_identity": "issuer/document/parcel; distribution identity also independent of source-tax document,date and row id",
|
||||
"economic_vs_international": "same physical tax parcel cannot fund both credit natures",
|
||||
"same_paper_different_tax": "supported distinct parcels can coexist; old proof without a parcel overlaps the whole paper until reconciled",
|
||||
"capacity": "same proof parcel amounts and prior attributions must agree and total allocation remains within available amount across snapshot contexts",
|
||||
"L5": "existing withholding source/allocation checks preserved; parcel relabelling cannot turn repeated L5 use into new tax",
|
||||
"partial_information": "saved and recovered as indeterminate, never reset or silently assumed absent",
|
||||
"global_official_account_reconciliation": false
|
||||
}
|
||||
},
|
||||
"compatibility": {
|
||||
"main_normal_fast_forward": true,
|
||||
"force_used": false,
|
||||
"runtime_files_identical_to_accepted_QA": true,
|
||||
"runtime_delta": [
|
||||
{
|
||||
"file": "resources/js/components/fiscal-proof-parcel.tsx",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "9712108707e20c60ed625b296aa8cec92a6ce1b7f6af5c51355d52b6b08a4f7a"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/components/simulation-irpc-annual.tsx",
|
||||
"before_sha256": "307725306df321fc89caf3d1a9efcf7463bb93d9d515d44347f8e14d4fd3136b",
|
||||
"after_sha256": "75176ae721b88f2686987be5b499bf8909fc1d958a497bfdffde8ae22fca9586"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/components/simulation-irpc-carry.tsx",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "020e2c26643b8b0dcf31d673db55217a7285b2187bdb8abf020bdfc6cc78e868"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/components/simulation-irpc-economic.tsx",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "57a019d4359f0ee119d9d52202104ca846518b1bfba2bfb8fddb769c168ecd44"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/components/simulation-irpc-international.tsx",
|
||||
"before_sha256": "6a9f796cc1e678823ed1dc14fbc28ca0e270752b2650518de239424dc75d167c",
|
||||
"after_sha256": "64b6077bfb673b918476f923a045d39cfde73c07aca2ae066772a24bef9a396d"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/components/simulation-irpc-pec.tsx",
|
||||
"before_sha256": "c3f0ea9ff9389cf856ecda3894c7a1486f44193eb893c341ef10c67f888a2fc6",
|
||||
"after_sha256": "d0bba7015521d9d143c819e4203e03cf2f6d076093f5cd29deb96c3a11fc6aa1"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/fiscal-proof-parcel.ts",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "9eb500a7be2e05f39203c5cebf86cd3c64bbace7a615b9b62161f34dbe4a63da"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/irpc-annual-settlement.ts",
|
||||
"before_sha256": "47d4167d0f80c649e6d89a586e0d206d2d2a12b8553a7e98be362ea56203a540",
|
||||
"after_sha256": "ac2896dca3002b27bf5f6bfd2e670295dcfaa3dc24f77b8e52469ed551cb1877"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/irpc-credit-carry.ts",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "5e88833842304f8e8e580916e2be657c33ad1fc53b7d544fa453b51ea27004e1"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/irpc-economic-credit.ts",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "fa19b289cba504d3636d76b3232694327e63674c907305425c2043d847046af1"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/irpc-international-credit.ts",
|
||||
"before_sha256": "40b46fbaaff6071ce6a35fd82de586158bf1f58fae8f46bcf6e4ddbbf84287f1",
|
||||
"after_sha256": "4fc68f1fbe0cb82ca01a3c30dcb505adb60eced1de92213260b9a5ea1711fe7b"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/irpc-pec.ts",
|
||||
"before_sha256": "eb40b0601b6a1a69a6e81ad210589cc8744d74c6ef65e12132de13a5fcd6a90e",
|
||||
"after_sha256": "9715ba106fd44b9ef16a55f2e85c2169ad09413a75167990e78ee644556fa381"
|
||||
}
|
||||
],
|
||||
"source_files_before": 1005,
|
||||
"source_files_after": 1011,
|
||||
"all_other_compared_sources_preserved": true,
|
||||
"schema_configuration_routes_permissions_preserved": true,
|
||||
"previous_accepted_receipts_and_frozen_history_preserved": true
|
||||
},
|
||||
"accepted_QA_reused": {
|
||||
"economic_new_frontend_tests": 20,
|
||||
"previous_affected_tests": 65,
|
||||
"frontend_pass": 85,
|
||||
"frontend_fail": 0,
|
||||
"API_tests": 1,
|
||||
"API_assertions": 210,
|
||||
"API_cases": 11,
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"loopback_port": 55441,
|
||||
"API_transactions_rolled_back": true,
|
||||
"recovered_cases_recalculated_with_HTML_and_dossier": 11,
|
||||
"frozen_histories_preserved": true,
|
||||
"typescript": "passed",
|
||||
"build": "isolated QA, subprocess exit0, final component hashes recorded",
|
||||
"PHP_formatting": "pint passed",
|
||||
"new_browser_manual_proof": false,
|
||||
"team_usability_evaluation": "unchanged; awaiting team feedback"
|
||||
},
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-irpc-l8-grouped-20261028/backup",
|
||||
"created_at": "2026-10-28T12:38:25Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "007cd1851d5bd51a54265ab99a342d6a312de06ef642fc42b38b7a5e771d4d9a",
|
||||
"files_sha256": "cd81cc9421e1d324648c706d8e56cbb6ad8766eb13e9a1a9cfda87814388b51f",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "irpc_grouped_restore_20261028",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "007cd1851d5bd51a54265ab99a342d6a312de06ef642fc42b38b7a5e771d4d9a",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"capacity_before": {
|
||||
"checked_at_UTC": "2026-10-28T12:38:00.155432+00:00",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"release": "/var/www/investmoz-homologacao/releases/838ad941a24ae76ec4bf91ccc3f92012668fe8cf-ca7817df",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/e182d1d79dc945f35d2079c6b8ca2ac93048cec3-e2a185b3",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/838ad941a24ae76ec4bf91ccc3f92012668fe8cf-ca7817df",
|
||||
"release_revision": {
|
||||
"commit": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-27T13:20:18.055286+00:00",
|
||||
"manifest_sha256": "b873c14f3e0e43435fa8f67fa9a65ff8978123cd8792c5f7c2e0cf6f8f84a3b2"
|
||||
},
|
||||
"service": "MainPID=0\nExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 88808570880,
|
||||
"available_inodes": 23523855,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 88808570880,
|
||||
"available_inodes": 23523855,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 88808570880,
|
||||
"available_inodes": 23523855,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 88808570880,
|
||||
"available_inodes": 23523855,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 88808570880,
|
||||
"available_inodes": 23523855,
|
||||
"total_inodes": 29089792
|
||||
}
|
||||
],
|
||||
"free_bytes": 88808570880,
|
||||
"existing_pipeline_minimum_bytes": 5368709120,
|
||||
"observed_previous_backup_bytes": 175921269,
|
||||
"same_partition_release_and_backup": true,
|
||||
"space_guard_satisfied": true,
|
||||
"current_release_entry_reference": 31327,
|
||||
"inodes_available_vs_reference": true,
|
||||
"inode_note": "Observed current release footprint for scale;no new arbitrary inode threshold. Capacity rechecked after fresh backup.",
|
||||
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604",
|
||||
"active_writes": 0
|
||||
},
|
||||
"capacity_after_backup": {
|
||||
"at": "2026-10-28T12:40:09.841070+00:00",
|
||||
"baseline": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"capacity_after_backup_satisfied": true,
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"free_bytes": 88629272576,
|
||||
"free_inodes": 23523836
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"free_bytes": 88629272576,
|
||||
"free_inodes": 23523836
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"free_bytes": 88629272576,
|
||||
"free_inodes": 23523836
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"free_bytes": 88629272576,
|
||||
"free_inodes": 23523836
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"free_bytes": 88629272576,
|
||||
"free_inodes": 23523836
|
||||
}
|
||||
],
|
||||
"backup_age_seconds": 104.841034,
|
||||
"backup_dump_sha256": "007cd1851d5bd51a54265ab99a342d6a312de06ef642fc42b38b7a5e771d4d9a",
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"files_verified": 369,
|
||||
"backup_paths": {
|
||||
"dump": "/var/backups/investmoz-irpc-l8-grouped-20261028/backup/database.dump",
|
||||
"files": "/var/backups/investmoz-irpc-l8-grouped-20261028/backup/files-before.tar.gz"
|
||||
},
|
||||
"active_writes": 0
|
||||
},
|
||||
"schema_permissions": {
|
||||
"schema_sha256": "5045b3e51d2185377aa3d9ac7fa07a44fad3ec620cdfa83ffe31c8884ee1601d",
|
||||
"roles_grants_sha256": "5f0c554373e879fa9db81c3e746886a40a3c47875e6f41c61cfc0b3aee2dfd2b",
|
||||
"filesystem_permissions": {
|
||||
".env": {
|
||||
"mode": 416,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage/app": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"bootstrap/cache": {
|
||||
"mode": 1528,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
}
|
||||
},
|
||||
"comparison_identity": "postgres;catalogue read only;no passwords collected",
|
||||
"unchanged": true
|
||||
},
|
||||
"preservation": {
|
||||
"checked_at": "2026-10-28T12:47:37.401210+00:00",
|
||||
"installed": "569a1cd750f3d2a0b87f130e992e73e070bbd1ab",
|
||||
"business_tables_unchanged": 172,
|
||||
"total_tables": 174,
|
||||
"operational_tables_to_reconcile": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 110,
|
||||
"checksum": "59099e8b28be3b1cd3b30a0be1b22519"
|
||||
},
|
||||
"after": {
|
||||
"rows": 110,
|
||||
"checksum": "832a86e7c4ccd6c9b5d725a45a63f2cb"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 2,
|
||||
"checksum": "09d77c0790973a0ed80f9dbb177f186c"
|
||||
},
|
||||
"after": {
|
||||
"rows": 4,
|
||||
"checksum": "570c460243c35d5c20b2e700077c15b3"
|
||||
}
|
||||
}
|
||||
},
|
||||
"persistent_files_unchanged": 369,
|
||||
"original_configuration_preserved": true,
|
||||
"synthetic_QA_storage_not_served": true,
|
||||
"QA_storage_saved_outside_active": "/var/lib/investmoz-deploy/qa-runtime/569a1cd750f3d2a0b87f130e992e73e070bbd1ab-53a57d6f",
|
||||
"fixture_or_content_imports": 0,
|
||||
"migrations": 0,
|
||||
"comparison_identity": "postgres;UTC;consistent before snapshot and after read-only transaction",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"operational_delta": {
|
||||
"status": "operational_delta_reconciled",
|
||||
"comparison_identity": "postgres before/after;isolated restored baseline;no RLS visibility inference",
|
||||
"cache": "queue:restart;requestthrottle;identical home-sector cached value with refreshed expiry(HomeController remember10min);no deletedcache",
|
||||
"sessions": "anonymous sessions from delivery user-agent or exactUA/time correlated with nginx public request;deleted sessions individually expired beyond configured lifetime,normal database session garbage collection(config/session lottery2/100)",
|
||||
"delta": {
|
||||
"cache": {
|
||||
"before_rows": 110,
|
||||
"after_rows": 110,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "7f7dd83f47f5bf404d55e6e9f1367948721579970b195680645e356031a070ff",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"value",
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-illuminate:queue:restart",
|
||||
"is_queue_restart_key": true,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": false,
|
||||
"same_value_home_cache_expiry_refresh": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"before_rows": 2,
|
||||
"after_rows": 4,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "61ee61858f50dc6bb6b3c42a15ea2a158e29a8de51071570a48e245072f35647",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "93d2f8d1f352499a4b04fe6ffe15ecd52738871794282140a78bfef2ad6ba80b",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"business_tables_to_confirm_separately": 172,
|
||||
"active_data_writes_by_comparison": 0,
|
||||
"restore_network": "none"
|
||||
},
|
||||
"installer": {
|
||||
"service": "MainPID=0\nExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "569a1cd750f3d2a0b87f130e992e73e070bbd1ab",
|
||||
"release": "/var/www/investmoz-homologacao/releases/569a1cd750f3d2a0b87f130e992e73e070bbd1ab-53a57d6f",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/838ad941a24ae76ec4bf91ccc3f92012668fe8cf-ca7817df",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "569a1cd750f3d2a0b87f130e992e73e070bbd1ab",
|
||||
"release": "/var/www/investmoz-homologacao/releases/569a1cd750f3d2a0b87f130e992e73e070bbd1ab-53a57d6f",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/838ad941a24ae76ec4bf91ccc3f92012668fe8cf-ca7817df",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"569a1cd750f3d2a0b87f130e992e73e070bbd1ab"
|
||||
],
|
||||
"finished_at": "2026-10-28T12:44:28.780095+00:00"
|
||||
},
|
||||
"log_file": "1793191252185211711.log",
|
||||
"mandatory_summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"✓ built in 30.82s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 1146",
|
||||
"# pass 1146",
|
||||
"# fail 0"
|
||||
]
|
||||
},
|
||||
"public_delta": {
|
||||
"phase": "after",
|
||||
"revision": {
|
||||
"commit": "569a1cd750f3d2a0b87f130e992e73e070bbd1ab",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-28T12:44:25.642859+00:00",
|
||||
"manifest_sha256": "9cb557f62c0dbe49ec87d7ccb532f6c7dc29fc980658ffc51ff024755c26f186"
|
||||
},
|
||||
"manifest_verified": true,
|
||||
"simulator_HTTP": 200,
|
||||
"simulator_component": "portal/services",
|
||||
"active_QA_records_created": false,
|
||||
"compiled_markers": {
|
||||
"IRPC-credit-carry/1": [
|
||||
"assets/project-dossier-BUI-Tqnq.js"
|
||||
],
|
||||
"IRPC-economic-credit/1": [
|
||||
"assets/project-dossier-BUI-Tqnq.js"
|
||||
],
|
||||
"Preparar saldos anteriores": [
|
||||
"assets/services-DOMV1YET.js"
|
||||
],
|
||||
"Preparar crédito económico": [
|
||||
"assets/services-DOMV1YET.js"
|
||||
],
|
||||
"Crédito económico — antes do internacional": [
|
||||
"assets/project-dossier-BUI-Tqnq.js"
|
||||
],
|
||||
"Confirmar afectação à colecta seleccionada": [
|
||||
"assets/services-DOMV1YET.js"
|
||||
],
|
||||
"IRPC-international-credit/1": [
|
||||
"assets/project-dossier-BUI-Tqnq.js"
|
||||
],
|
||||
"IRPC-PEC/1": [
|
||||
"assets/project-dossier-BUI-Tqnq.js"
|
||||
]
|
||||
}
|
||||
},
|
||||
"remote_backup": "/var/backups/investmoz-irpc-l8-grouped-20261028/backup",
|
||||
"remote_receipt": "/var/backups/investmoz-irpc-l8-grouped-20261028/installed-receipt.json",
|
||||
"remaining": {
|
||||
"economic": [
|
||||
"automatic inclusion/correction of distributed profits and53 addition in L6",
|
||||
"automatic proportional ceiling derivation and complete40(1) exclusion treatment at base stage",
|
||||
"liquidation64(3),associations64(4),special-period and other-currency cases"
|
||||
],
|
||||
"other_L8": [
|
||||
"specific benefit credits and their qualification,cumulation and limits",
|
||||
"automatic international national-fraction and case-specific treaty matching",
|
||||
"PPC/PEC obligation/calendar,interest/penalties and payment guides with applicable edition",
|
||||
"autonomous taxation,special periods,other currencies and M20/M22 transport/submission",
|
||||
"exceptional/transitional interyear cases beyond accepted ordinary carry scope"
|
||||
]
|
||||
},
|
||||
"L8_complete": false,
|
||||
"limits": [
|
||||
"No global annual IRPC closure claimed",
|
||||
"No official tax-account balance consumed,submitted or refunded",
|
||||
"Economic credit limited to ordinary documented current-year case;source inclusion/gross-up and proportional quota not automatically derived",
|
||||
"Carry retains its documented ordinary-year scope;no exceptional/transitional rule inferred",
|
||||
"No new manual team usability acceptance claimed",
|
||||
"Songo/Gurue remain private;SGF TEMPO untouched;no active QA fixture/content imports"
|
||||
],
|
||||
"local_evidence_directory": "outputs/irpc-l8-grouped-delivery-20261028",
|
||||
"local_artifacts": [
|
||||
{
|
||||
"file": "authenticate.ps1",
|
||||
"sha256": "80109eafe4fe5c065debcb3ebf626638904f09c04450565b0be940a6372ddc1d",
|
||||
"bytes": 214
|
||||
},
|
||||
{
|
||||
"file": "backup.py",
|
||||
"sha256": "f1e02236d97caaed537249dfc8c7a002c18bd8cc067af5bd11f94cc4dc1ad027",
|
||||
"bytes": 5448
|
||||
},
|
||||
{
|
||||
"file": "capacity-after.py",
|
||||
"sha256": "9f1e2df54963469c670098b77392020f2719bb3f795cd04e5ecdad6f1fad1b84",
|
||||
"bytes": 1621
|
||||
},
|
||||
{
|
||||
"file": "compatibility-and-preservation-plan.json",
|
||||
"sha256": "00e4f0b33e5ea46007c74a2d8a7976fec363baf5cace55063b764fa3fceb822a",
|
||||
"bytes": 1160
|
||||
},
|
||||
{
|
||||
"file": "git-main-delivery.json",
|
||||
"sha256": "28c6503ad9229afdefd7f3466e7ab235417c1f2f7a7372ce269951db0657ef6f",
|
||||
"bytes": 242
|
||||
},
|
||||
{
|
||||
"file": "group-backup-20261028-response.json",
|
||||
"sha256": "9860fd3a9f4c1abb5e9298965a604cfa5efc0198ee8069aaf7ed9844b2bf00d6",
|
||||
"bytes": 606
|
||||
},
|
||||
{
|
||||
"file": "group-backup-20261028.json",
|
||||
"sha256": "f1e0096263b3b8a83401c3a83035e67e0c8f50e647030812811fe1b1700c6dea",
|
||||
"bytes": 437
|
||||
},
|
||||
{
|
||||
"file": "group-capacity-after-20261028-response.json",
|
||||
"sha256": "ce5b65cc2e31b9f938dac177d0420baaca6ad2df95e417c43e6fd79b474bc2d5",
|
||||
"bytes": 1394
|
||||
},
|
||||
{
|
||||
"file": "group-capacity-after-20261028.json",
|
||||
"sha256": "0d63c97cecd57683cd4046f3d327d489a966b67508e5f8c54c5829da85e8e869",
|
||||
"bytes": 1200
|
||||
},
|
||||
{
|
||||
"file": "group-operational-20261028-response.json",
|
||||
"sha256": "d7ca760c85a2deb24084167701aafb389bcd0a807c95bce5a6a9cddd4f6480ff",
|
||||
"bytes": 2483
|
||||
},
|
||||
{
|
||||
"file": "group-operational-20261028.json",
|
||||
"sha256": "dd0476edc7212ca0cc25646441c7f73aa5e406201563070e9adb3930751d21b6",
|
||||
"bytes": 2434
|
||||
},
|
||||
{
|
||||
"file": "group-preflight-20261028-response.json",
|
||||
"sha256": "b98a6d1970dc4f681e99c8500e863b24dc30bafe3d536d256183924911c2da6c",
|
||||
"bytes": 3029
|
||||
},
|
||||
{
|
||||
"file": "group-preflight-20261028.json",
|
||||
"sha256": "5f70b0af720beb1199c09cb21118a6d13f47e07ab55f4eeef3ae969ad1fcac14",
|
||||
"bytes": 2595
|
||||
},
|
||||
{
|
||||
"file": "group-preserve-20261028-response.json",
|
||||
"sha256": "9f96f52a494c5d29702cc9abd1ace94d314a8cda54281ec6ac1b810efc6b8c50",
|
||||
"bytes": 1324
|
||||
},
|
||||
{
|
||||
"file": "group-preserve-20261028.json",
|
||||
"sha256": "f655c23059156461f49200a419fafffdf0cecab62df99b5995bcab59eaf7e7de",
|
||||
"bytes": 1137
|
||||
},
|
||||
{
|
||||
"file": "group-progress-a1-20261028-response.json",
|
||||
"sha256": "b968fa1a79f043c1b2f9440e7e1828eea466c7b77e45c8f66dec47cc59202305",
|
||||
"bytes": 2715
|
||||
},
|
||||
{
|
||||
"file": "group-progress-a1-20261028.json",
|
||||
"sha256": "8f3cd7de2b9c10ea72a04783f2740301a96f641f07189515c386908aad7bf139",
|
||||
"bytes": 2294
|
||||
},
|
||||
{
|
||||
"file": "group-progress-a2-20261028-response.json",
|
||||
"sha256": "05432b187845dd4ea7ba3a966fea54023877c7bc0cb1c5721539f9591b8c174d",
|
||||
"bytes": 1567
|
||||
},
|
||||
{
|
||||
"file": "group-progress-a2-20261028.json",
|
||||
"sha256": "19ee1ec59ed4d91487a765c079cb042d84e70d8c6f575385425132832f4a8f88",
|
||||
"bytes": 1247
|
||||
},
|
||||
{
|
||||
"file": "group-restore-20261028-response.json",
|
||||
"sha256": "4ce2051902d1c00d04bef1f34fd88671c0be6b5b65228d4c13271bb541453a0f",
|
||||
"bytes": 427
|
||||
},
|
||||
{
|
||||
"file": "group-restore-20261028.json",
|
||||
"sha256": "aa3a90c80a037d4977988d7d9935a52f226b25ea414e54012446e528b69769c2",
|
||||
"bytes": 282
|
||||
},
|
||||
{
|
||||
"file": "group-schema-after-20261028-response.json",
|
||||
"sha256": "740062552f5a4747fc0151ab32956774f8cb8cef6be6fef116a9c8b0505db67c",
|
||||
"bytes": 772
|
||||
},
|
||||
{
|
||||
"file": "group-schema-after-20261028.json",
|
||||
"sha256": "265a0f0bb3b8e8232c8a8f2f72802664091ff8f9127e7a3868694f1373fc7b51",
|
||||
"bytes": 668
|
||||
},
|
||||
{
|
||||
"file": "group-schema-before-20261028-response.json",
|
||||
"sha256": "ba122cba99109784b22699391efc6359c53d17e44dbe4bb14184389589cb0d80",
|
||||
"bytes": 745
|
||||
},
|
||||
{
|
||||
"file": "group-schema-before-20261028.json",
|
||||
"sha256": "8c171cfaae6feef78fbd43f8046ffb62c1daad9a258d95e6df43d20ba4b335c4",
|
||||
"bytes": 646
|
||||
},
|
||||
{
|
||||
"file": "group-source-after-20261028-response.json",
|
||||
"sha256": "be446ca8152ea5d940a8650d38fc8d141ee94cebafab8406d7c33b9a97cb6b4f",
|
||||
"bytes": 284
|
||||
},
|
||||
{
|
||||
"file": "group-source-after-20261028.json",
|
||||
"sha256": "f9a457698c36c0e433ff5c10956cef3f4548534ae0a9d8718a03af2f3101360b",
|
||||
"bytes": 165
|
||||
},
|
||||
{
|
||||
"file": "group-source-before-20261028-response.json",
|
||||
"sha256": "e2f155845283962a0729a295856d0ba0b631530faa40074c317a57b90836e1b5",
|
||||
"bytes": 285
|
||||
},
|
||||
{
|
||||
"file": "group-source-before-20261028.json",
|
||||
"sha256": "3383b6c77419378eac7fb078dad3e57989a8def0965c29477f0a827e1972a67c",
|
||||
"bytes": 166
|
||||
},
|
||||
{
|
||||
"file": "group-status-a1-20261028-response.json",
|
||||
"sha256": "860ba2f40d709ff491113c54cd253926adb0b21e22179b02e978a388ef6e2bc9",
|
||||
"bytes": 1809
|
||||
},
|
||||
{
|
||||
"file": "group-status-a1-20261028.json",
|
||||
"sha256": "38c718738dad722e06069993894ad9eba2f61b946d6e2042cfbc33e6d1c6aa10",
|
||||
"bytes": 1442
|
||||
},
|
||||
{
|
||||
"file": "group-status-a2-20261028-response.json",
|
||||
"sha256": "2f6815214d9b0240cc298f78b7838fd2b7061333e4cfda1ecab2779a688be130",
|
||||
"bytes": 2117
|
||||
},
|
||||
{
|
||||
"file": "group-status-a2-20261028.json",
|
||||
"sha256": "328e6fc9e8ce7f488e83c9c7154472f76cacf08381ad48ea38af8c6139317b7f",
|
||||
"bytes": 1706
|
||||
},
|
||||
{
|
||||
"file": "group-status-a3-20261028-response.json",
|
||||
"sha256": "a9af2b8c3c53341a0dbc030ceaa984818af1710b9be1f13437026093edc9b9ea",
|
||||
"bytes": 2117
|
||||
},
|
||||
{
|
||||
"file": "group-status-a3-20261028.json",
|
||||
"sha256": "e79288f392bd00c31059031c653ba703a4546d853945f0859f426bbccb8f381d",
|
||||
"bytes": 1706
|
||||
},
|
||||
{
|
||||
"file": "group-status-final-20261028-response.json",
|
||||
"sha256": "1e54588459017ee079eae4759d07cf4629287f053df50679fcf4026052696a9c",
|
||||
"bytes": 2220
|
||||
},
|
||||
{
|
||||
"file": "group-status-final-20261028.json",
|
||||
"sha256": "dca34a8237f9d019d3f36976668dd8b4a86e492e3d29c3eac8294c0d5294edee",
|
||||
"bytes": 1795
|
||||
},
|
||||
{
|
||||
"file": "pipeline-progress.py",
|
||||
"sha256": "848be5b9c462802395e2944fb30487407d86668ff27640125885994acdd4c241",
|
||||
"bytes": 1006
|
||||
},
|
||||
{
|
||||
"file": "preflight.py",
|
||||
"sha256": "92113ce782cc6cce88e3146dcc34363ad21d888f83b26b4e5a0d26fbf60e640f",
|
||||
"bytes": 2338
|
||||
},
|
||||
{
|
||||
"file": "preparation.json",
|
||||
"sha256": "47007bfe846aa9e22dc723b320e4a580396e413a75bb846c44c9cfda60ad84eb",
|
||||
"bytes": 251405
|
||||
},
|
||||
{
|
||||
"file": "preserve-data.py",
|
||||
"sha256": "e56d27b726c5e710b9bd5721d729cc019d57011b2ea1e2699fee6685f1f1bfbd",
|
||||
"bytes": 2304
|
||||
},
|
||||
{
|
||||
"file": "public-after.json",
|
||||
"sha256": "db39a1bd518eddcc4b23ee1fa28ae7a06d51e289d549790cfb64b04100976b6b",
|
||||
"bytes": 1149
|
||||
},
|
||||
{
|
||||
"file": "public-before.json",
|
||||
"sha256": "05a748e8a0f08ba438026f4e53c2d8260586c93061748ad3428188afe86e9b2a",
|
||||
"bytes": 414
|
||||
},
|
||||
{
|
||||
"file": "reconcile-operational-delta.py",
|
||||
"sha256": "1ad5c3663364e59d54bfaff2a0686b43fe7d658f5445076f670fb9aa69c1321c",
|
||||
"bytes": 5336
|
||||
},
|
||||
{
|
||||
"file": "remote_delivery_inspection.py",
|
||||
"sha256": "7c95ba88a9d5a62a15ec2bf581fa62f5151e548014d106f081487889e56b2703",
|
||||
"bytes": 1947
|
||||
},
|
||||
{
|
||||
"file": "restore.py",
|
||||
"sha256": "dcb4952f56d2524f36bc4b24164f8041f99de8e98d461bd40bafbb5102c28349",
|
||||
"bytes": 2792
|
||||
},
|
||||
{
|
||||
"file": "rpc.py",
|
||||
"sha256": "9c9ebe126d345d20ab46a07469f41bac3e76dbfbcdb64ac32606796c9c0f9520",
|
||||
"bytes": 1650
|
||||
},
|
||||
{
|
||||
"file": "schema-permissions-after.py",
|
||||
"sha256": "44fd24feb568ca5b9488c923fbd3967756c0fbb2e6fee4016f6c0272c536cac1",
|
||||
"bytes": 1862
|
||||
},
|
||||
{
|
||||
"file": "schema-permissions-before.py",
|
||||
"sha256": "d17fbac06b88b189171da56ea2d4e501eae331a39bd78c14cbd3fc65d19e59c4",
|
||||
"bytes": 1705
|
||||
},
|
||||
{
|
||||
"file": "source-after-input.json",
|
||||
"sha256": "3716126155fcff9b74fb34c408b57bc7b9482e62ed1b3f29dfd994d1c894f11a",
|
||||
"bytes": 240716
|
||||
},
|
||||
{
|
||||
"file": "source-before-input.json",
|
||||
"sha256": "8ca115700b7df7db7b306d7a0ff1063a54716977465674a31d5d2cd588d8f2e2",
|
||||
"bytes": 240717
|
||||
},
|
||||
{
|
||||
"file": "source-check.py",
|
||||
"sha256": "1cec620043b013e6b6f79b9f67e4e5588117d91ee7dc0c93592fc6b8d6d0557f",
|
||||
"bytes": 676
|
||||
},
|
||||
{
|
||||
"file": "ssh-session.py",
|
||||
"sha256": "e81df6aae12e03b0faac33e03108ef6dcdc5c0d3598538c4db5bb4bb65e9f3f4",
|
||||
"bytes": 3084
|
||||
},
|
||||
{
|
||||
"file": "status.py",
|
||||
"sha256": "41d3a13211c4d4725178477aa48e10f27fe313f41a2b33e555f7ae04a8a14bdd",
|
||||
"bytes": 1204
|
||||
},
|
||||
{
|
||||
"file": "store-receipt.py",
|
||||
"sha256": "9c671b6019c7fd80df91c9af795b16a8a80c119a79877ad6cf57c8fea436ef9c",
|
||||
"bytes": 864
|
||||
},
|
||||
{
|
||||
"file": "update-existing-docs.py",
|
||||
"sha256": "e088143d2e3e24390b36c5a08dd3312537b2b3f5778633c8086fcbdde00b2b60",
|
||||
"bytes": 1478
|
||||
},
|
||||
{
|
||||
"file": "verify-public.py",
|
||||
"sha256": "f6b5ad42ead0f6a7f2ddcb6f16a648293ad5eba1001b591dc32f4ddfa4f68f00",
|
||||
"bytes": 2107
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,722 @@
|
||||
{
|
||||
"date": "2026-10-27",
|
||||
"status": "installed_and_verified",
|
||||
"served_commit": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"accepted_qa": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"previous_commit": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"sector_fix_preserved": "669cb8979b0c372659fc2ad3876aebc919d5df19",
|
||||
"scope": {
|
||||
"year": "2026",
|
||||
"resident": "general",
|
||||
"period": "calendar year",
|
||||
"currency": "documented MZN",
|
||||
"foreign_tax": "actual income tax paid; inclusion in taxable base documented",
|
||||
"national_fraction": "documented exact input, not automatically derived",
|
||||
"treaty": "case-specific applicability and ceiling documented, not inferred from country",
|
||||
"order": [
|
||||
"international credit limited to eligible available amount and collection",
|
||||
"PEC limited to remaining collection",
|
||||
"withholdings and PPC"
|
||||
],
|
||||
"known_absent_missing_distinct": true,
|
||||
"proof_deduplication": "issuer/document across tax natures, dates and snapshot contexts; consolidate country-year quota",
|
||||
"officialBalancesConsumed": false,
|
||||
"carryCreated": false
|
||||
},
|
||||
"example": {
|
||||
"foreign_tax_paid": "10 MZN",
|
||||
"documented_national_limit": "8 MZN",
|
||||
"documented_treaty_nonapplication": "synthetic only, not actual country entitlement",
|
||||
"credit": "8 MZN",
|
||||
"calculation": "1408 - 8 = 1400; - PEC200 = 1200; - PPC500 = 700 MZN simulated payable",
|
||||
"above_eligibility_limit": "2 MZN, not a carry",
|
||||
"insufficient_collection_example": "available2000, deducted1408, insufficient592; PEC200 not deducted; recoverable500 derives from PPC only"
|
||||
},
|
||||
"accepted_QA_reused": {
|
||||
"frontend_new": 18,
|
||||
"frontend_affected_annual_pec": 31,
|
||||
"api_assertions": 171,
|
||||
"recovered_HTML_dossier_cases": 7
|
||||
},
|
||||
"cases": [
|
||||
{
|
||||
"name": "payable",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "700",
|
||||
"denominator": "1"
|
||||
},
|
||||
"current": true,
|
||||
"history_records": 0,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "treaty",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "702",
|
||||
"denominator": "1"
|
||||
},
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "missing",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "limited-collecta",
|
||||
"status": "recoverable",
|
||||
"balance": {
|
||||
"numerator": "-500",
|
||||
"denominator": "1"
|
||||
},
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "duplicate",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "absent",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "708",
|
||||
"denominator": "1"
|
||||
},
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "prior-use",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "703",
|
||||
"denominator": "1"
|
||||
},
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
}
|
||||
],
|
||||
"compatibility": {
|
||||
"fast_forward_over": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"runtime_files_byte_identical_to_accepted_QA": true,
|
||||
"runtime_delta": [
|
||||
{
|
||||
"file": "resources/js/components/simulation-irpc-annual.tsx",
|
||||
"before_sha256": "7f18abcaa1100251c5c2780fdfac32e21979d8e6ffed52f732e4a0d345ab4f40",
|
||||
"after_sha256": "307725306df321fc89caf3d1a9efcf7463bb93d9d515d44347f8e14d4fd3136b"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/components/simulation-irpc-international.tsx",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "6a9f796cc1e678823ed1dc14fbc28ca0e270752b2650518de239424dc75d167c"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/country-iso-codes.ts",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "1c4e2b6d67457ea2dba3dda28a9b6ce09242c36dfcf04855a8bc1f44506a9fac"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/irpc-annual-settlement.ts",
|
||||
"before_sha256": "6d80889677c1904b3236b5e43fa5a3dc28327745679392529dfb5fbf5a273f7d",
|
||||
"after_sha256": "47d4167d0f80c649e6d89a586e0d206d2d2a12b8553a7e98be362ea56203a540"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/irpc-international-credit.ts",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "40b46fbaaff6071ce6a35fd82de586158bf1f58fae8f46bcf6e4ddbbf84287f1"
|
||||
}
|
||||
],
|
||||
"all_other_compared_sources_unchanged": true,
|
||||
"schema_config_routes_permissions_unchanged": true,
|
||||
"legacy_annual_and_PEC_history_preserved": true,
|
||||
"no_new_manual_retest_of_independent_accepted_proofs": true
|
||||
},
|
||||
"source_files_verified": {
|
||||
"before": 1002,
|
||||
"after": 1005
|
||||
},
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-irpc-l8-international-20261027/backup",
|
||||
"created_at": "2026-10-27T13:15:39Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "b1e9740653a8664c23268e228efd3ed6a0514bf3e8786dd5adf43342cdb475e1",
|
||||
"files_sha256": "9d3a790f9c7f4a35ebf660d304e92d69f86557d20d2f8be1e996c828711b19ac",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "irpc_international_restore_20261027",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "b1e9740653a8664c23268e228efd3ed6a0514bf3e8786dd5adf43342cdb475e1",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"capacity_before": {
|
||||
"checked_at_UTC": "2026-10-27T13:15:02.501911+00:00",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"release": "/var/www/investmoz-homologacao/releases/e182d1d79dc945f35d2079c6b8ca2ac93048cec3-e2a185b3",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/669cb8979b0c372659fc2ad3876aebc919d5df19-6a2f00c6",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/e182d1d79dc945f35d2079c6b8ca2ac93048cec3-e2a185b3",
|
||||
"release_revision": {
|
||||
"commit": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-27T12:10:18.923517+00:00",
|
||||
"manifest_sha256": "47bbdd09864d0587133deec179781018e439f9c83b7b328c9dcd52482eaf6d31"
|
||||
},
|
||||
"service": "MainPID=0\nExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 92293206016,
|
||||
"available_inodes": 23699087,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 92293206016,
|
||||
"available_inodes": 23699087,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 92293206016,
|
||||
"available_inodes": 23699087,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 92293206016,
|
||||
"available_inodes": 23699087,
|
||||
"total_inodes": 29089792
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"mount": "/dev/md2 / ext4",
|
||||
"device": 2306,
|
||||
"available_bytes": 92293206016,
|
||||
"available_inodes": 23699087,
|
||||
"total_inodes": 29089792
|
||||
}
|
||||
],
|
||||
"free_bytes": 92293206016,
|
||||
"existing_pipeline_minimum_bytes": 5368709120,
|
||||
"observed_previous_backup_bytes": 175920446,
|
||||
"same_partition_release_and_backup": true,
|
||||
"space_guard_satisfied": true,
|
||||
"current_release_entry_reference": 31315,
|
||||
"inodes_available_vs_reference": true,
|
||||
"inode_note": "Observed current release footprint for scale;no new arbitrary inode threshold. Capacity rechecked after fresh backup.",
|
||||
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604",
|
||||
"active_writes": 0
|
||||
},
|
||||
"capacity_after_backup": {
|
||||
"at": "2026-10-27T13:16:13.360261+00:00",
|
||||
"baseline": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"capacity_after_backup_satisfied": true,
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"free_bytes": 92114915328,
|
||||
"free_inodes": 23699075
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"free_bytes": 92114915328,
|
||||
"free_inodes": 23699075
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"free_bytes": 92114915328,
|
||||
"free_inodes": 23699075
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"free_bytes": 92114915328,
|
||||
"free_inodes": 23699075
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"free_bytes": 92114915328,
|
||||
"free_inodes": 23699075
|
||||
}
|
||||
],
|
||||
"backup_age_seconds": 34.36022,
|
||||
"backup_dump_sha256": "b1e9740653a8664c23268e228efd3ed6a0514bf3e8786dd5adf43342cdb475e1",
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"files_verified": 369,
|
||||
"backup_paths": {
|
||||
"dump": "/var/backups/investmoz-irpc-l8-international-20261027/backup/database.dump",
|
||||
"files": "/var/backups/investmoz-irpc-l8-international-20261027/backup/files-before.tar.gz"
|
||||
},
|
||||
"active_writes": 0
|
||||
},
|
||||
"schema_permissions": {
|
||||
"schema_sha256": "5045b3e51d2185377aa3d9ac7fa07a44fad3ec620cdfa83ffe31c8884ee1601d",
|
||||
"roles_grants_sha256": "1530c33cb016e67bfdc64891ddfce7f185b13b56b2cd87c012871a685e118109",
|
||||
"filesystem_permissions": {
|
||||
".env": {
|
||||
"mode": 416,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage/app": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"bootstrap/cache": {
|
||||
"mode": 1528,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
}
|
||||
},
|
||||
"comparison_identity": "postgres;catalogue read only;no passwords collected",
|
||||
"unchanged": true
|
||||
},
|
||||
"preservation": {
|
||||
"checked_at": "2026-10-27T13:21:25.836367+00:00",
|
||||
"installed": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"business_tables_unchanged": 172,
|
||||
"total_tables": 174,
|
||||
"operational_tables_to_reconcile": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 108,
|
||||
"checksum": "c5e94e4bb71bf085e36447c1da35696e"
|
||||
},
|
||||
"after": {
|
||||
"rows": 108,
|
||||
"checksum": "ddbdb9e11a50777bd84bc353d178608a"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 53,
|
||||
"checksum": "fe52dca3e79f71d1f5a3bd474c7d72d1"
|
||||
},
|
||||
"after": {
|
||||
"rows": 55,
|
||||
"checksum": "359f4b80ea80b807a1f3a50687fe2309"
|
||||
}
|
||||
}
|
||||
},
|
||||
"persistent_files_unchanged": 369,
|
||||
"original_configuration_preserved": true,
|
||||
"synthetic_QA_storage_not_served": true,
|
||||
"QA_storage_saved_outside_active": "/var/lib/investmoz-deploy/qa-runtime/838ad941a24ae76ec4bf91ccc3f92012668fe8cf-ca7817df",
|
||||
"fixture_or_content_imports": 0,
|
||||
"migrations": 0,
|
||||
"comparison_identity": "postgres;UTC;consistent before snapshot and after read-only transaction",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"operational_delta": {
|
||||
"status": "operational_delta_reconciled",
|
||||
"comparison_identity": "postgres before/after;isolated restored baseline;no RLS visibility inference",
|
||||
"cache": "queue:restart;requestthrottle;identical home-sector cached value with refreshed expiry(HomeController remember10min);no deletedcache",
|
||||
"sessions": "anonymous sessions from delivery user-agent or exactUA/time correlated with nginx public request;deleted sessions individually expired beyond configured lifetime,normal database session garbage collection(config/session lottery2/100)",
|
||||
"delta": {
|
||||
"cache": {
|
||||
"before_rows": 108,
|
||||
"after_rows": 108,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "7f7dd83f47f5bf404d55e6e9f1367948721579970b195680645e356031a070ff",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"value",
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-illuminate:queue:restart",
|
||||
"is_queue_restart_key": true,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": false,
|
||||
"same_value_home_cache_expiry_refresh": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"before_rows": 53,
|
||||
"after_rows": 55,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "cc9234289e8c94733fb352f52407a2863d547165e1ee7f6eb4523c1ed7b33c1a",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "dbf3b24ccc55e4bf0a14aad872309de7d890942acb4f68b0c1ec608ff5e49035",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"business_tables_to_confirm_separately": 172,
|
||||
"active_data_writes_by_comparison": 0,
|
||||
"restore_network": "none"
|
||||
},
|
||||
"installer": {
|
||||
"service": "MainPID=0\nExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"release": "/var/www/investmoz-homologacao/releases/838ad941a24ae76ec4bf91ccc3f92012668fe8cf-ca7817df",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/e182d1d79dc945f35d2079c6b8ca2ac93048cec3-e2a185b3",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"release": "/var/www/investmoz-homologacao/releases/838ad941a24ae76ec4bf91ccc3f92012668fe8cf-ca7817df",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/e182d1d79dc945f35d2079c6b8ca2ac93048cec3-e2a185b3",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"838ad941a24ae76ec4bf91ccc3f92012668fe8cf"
|
||||
],
|
||||
"finished_at": "2026-10-27T13:20:20.796156+00:00"
|
||||
},
|
||||
"log_file": "1793107006281021543.log",
|
||||
"log_bytes": 313361,
|
||||
"mandatory_summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"✓ built in 31.55s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 1110",
|
||||
"# pass 1110",
|
||||
"# fail 0"
|
||||
]
|
||||
},
|
||||
"public_delta": {
|
||||
"phase": "after",
|
||||
"revision": {
|
||||
"commit": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-27T13:20:18.055286+00:00",
|
||||
"manifest_sha256": "b873c14f3e0e43435fa8f67fa9a65ff8978123cd8792c5f7c2e0cf6f8f84a3b2"
|
||||
},
|
||||
"manifest_verified": true,
|
||||
"simulator_HTTP": 200,
|
||||
"simulator_component": "portal/services",
|
||||
"active_QA_records_created": false,
|
||||
"compiled_markers": {
|
||||
"IRPC-international-credit/1": [
|
||||
"assets/project-dossier-bSv3Ugr2.js"
|
||||
],
|
||||
"Preparar crédito internacional": [
|
||||
"assets/services-YUy8XgPr.js"
|
||||
],
|
||||
"Vincular inclusão e limites ao país": [
|
||||
"assets/services-YUy8XgPr.js"
|
||||
],
|
||||
"Crédito internacional — antes do PEC": [
|
||||
"assets/project-dossier-bSv3Ugr2.js"
|
||||
],
|
||||
"Não determina a fracção nacional": [
|
||||
"assets/project-dossier-bSv3Ugr2.js"
|
||||
],
|
||||
"IRPC-PEC/1": [
|
||||
"assets/project-dossier-bSv3Ugr2.js"
|
||||
]
|
||||
}
|
||||
},
|
||||
"remote_backup": "/var/backups/investmoz-irpc-l8-international-20261027/backup",
|
||||
"remote_receipt": "/var/backups/investmoz-irpc-l8-international-20261027/installed-receipt.json",
|
||||
"limits": [
|
||||
"L8 partial",
|
||||
"no new PEC excess/carry scope",
|
||||
"no automatic foreign exchange or official rounding rule",
|
||||
"no official tax balance consumption, submission or refund execution",
|
||||
"same-snapshot deduplication is not a global inter-dossier official ledger",
|
||||
"synthetic QA examples do not assert any actual foreign treaty",
|
||||
"L8 partial after this bounded delivery",
|
||||
"Songo/Gurue remain private; no QA fixture or content import into active data"
|
||||
],
|
||||
"remaining_code": [
|
||||
"automatic national fraction and case-specific treaty matching",
|
||||
"economic double-tax and CBF benefit credits with own rules",
|
||||
"international carry/expiry65(3), separate from PEC66 carry/expiry",
|
||||
"PPC/PEC obligation/calendar; autonomous tax, special periods, other currencies and M20/M22 transport/submission"
|
||||
],
|
||||
"document_dependencies": [
|
||||
{
|
||||
"missing": "income inclusion and national fraction",
|
||||
"example": "tax10 but no included income/base correspondence",
|
||||
"resume_when": "income/base and documented fraction matched"
|
||||
},
|
||||
{
|
||||
"missing": "treaty article/period/ceiling",
|
||||
"example": "country selected but no applicable article or eligible tax",
|
||||
"resume_when": "case-specific article, effective period and eligible ceiling identified"
|
||||
},
|
||||
{
|
||||
"missing": "proof/titular/previous actual use/temporal link",
|
||||
"example": "payment2027 selected for2026 without correspondence",
|
||||
"resume_when": "actual payment and explicit2026 link supported, prior use reconciled"
|
||||
}
|
||||
],
|
||||
"local_startup_fix": {
|
||||
"cause": "Local inspect.py shadowed Python stdlib before SSH connection",
|
||||
"renamed_to": "remote_delivery_inspection.py",
|
||||
"inspect_module": "C:/laragon/bin/python/python-3.10/lib/inspect.py",
|
||||
"python": "C:/laragon/bin/python/python-3.10/python.exe",
|
||||
"paramiko": "5.1.0",
|
||||
"remote_linux_geteuid_ssh_guard_preserved": true,
|
||||
"credentials_changed": false,
|
||||
"server_failure_inferred": false
|
||||
},
|
||||
"local_evidence_directory": "outputs/irpc-l8-international-delivery-20261027",
|
||||
"local_artifacts": [
|
||||
{
|
||||
"file": "authenticate.ps1",
|
||||
"bytes": 237,
|
||||
"sha256": "89492b8a16b8d5ec8dbe1d6a1a44af0bfbf8e99ccef2abfc5568a831623c05ba"
|
||||
},
|
||||
{
|
||||
"file": "backup.py",
|
||||
"bytes": 5460,
|
||||
"sha256": "ef5406ffa735d3d563e9b4da0e8ac067c6978710df455d24e2c8e2cbc305fa49"
|
||||
},
|
||||
{
|
||||
"file": "capacity-after.py",
|
||||
"bytes": 1621,
|
||||
"sha256": "9f1e2df54963469c670098b77392020f2719bb3f795cd04e5ecdad6f1fad1b84"
|
||||
},
|
||||
{
|
||||
"file": "diagnose-session-delta.py",
|
||||
"bytes": 7395,
|
||||
"sha256": "312e2446a489a99bf9060797e785de4d16d28866b6f9a05a9d99fb60e3a9c838"
|
||||
},
|
||||
{
|
||||
"file": "int-backup-20261027.json",
|
||||
"bytes": 443,
|
||||
"sha256": "5314107e4438ea22bc6c3261dda9b893faac3cf131c596f30dc6517bc35cd30f"
|
||||
},
|
||||
{
|
||||
"file": "int-capacity-after-20261027.json",
|
||||
"bytes": 1210,
|
||||
"sha256": "72934b91dcc7ecf5370d7a667ef26ecf8a78a0ceeeeeb71a3062abab33925767"
|
||||
},
|
||||
{
|
||||
"file": "int-operational-20261027.json",
|
||||
"bytes": 2436,
|
||||
"sha256": "f8936062bdf569740ea4bafc618c88c08ef8a1def30dcf1240c6afa3113ec1c3"
|
||||
},
|
||||
{
|
||||
"file": "int-preflight-20261027.json",
|
||||
"bytes": 2595,
|
||||
"sha256": "cd339ef9913f8d89644e45ee5d337003cecb758d827764a79f4cfacc1b350dca"
|
||||
},
|
||||
{
|
||||
"file": "int-preserve-20261027.json",
|
||||
"bytes": 1139,
|
||||
"sha256": "110ec10adf5d2a4de426dd3e6f947026dbff6ef828a56c0353b1e7a0426e2c78"
|
||||
},
|
||||
{
|
||||
"file": "int-read-20261027.json",
|
||||
"bytes": 2919,
|
||||
"sha256": "12ba15343b9485e08f654a7abb0305e4f10f396b1d20f7aaca844e9ea5317fdc"
|
||||
},
|
||||
{
|
||||
"file": "int-restore-20261027.json",
|
||||
"bytes": 288,
|
||||
"sha256": "7d9c3fb60ea87407441db867edf8e872e58aeb9aaf209c1b89830b0e0eedea59"
|
||||
},
|
||||
{
|
||||
"file": "int-schema-after-20261027.json",
|
||||
"bytes": 668,
|
||||
"sha256": "e1767424312345a28a28223c67c424df1ac68d9d1aecec30a4856a71fbe91bfc"
|
||||
},
|
||||
{
|
||||
"file": "int-schema-before-20261027.json",
|
||||
"bytes": 646,
|
||||
"sha256": "da666867fc18a60b0473e04bcd7966328135dcb684fb974b405b66e53e5a4377"
|
||||
},
|
||||
{
|
||||
"file": "int-source-after-20261027.json",
|
||||
"bytes": 165,
|
||||
"sha256": "46c3a8f356197988ebbb4325a7a43807a0e5f097eb5eee5c09c063f68dc022cc"
|
||||
},
|
||||
{
|
||||
"file": "int-source-before-20261027.json",
|
||||
"bytes": 166,
|
||||
"sha256": "3130bda62b9b5b736d8b3a884c34973e2c7387564c1f3e9edfcf626075d4fbbd"
|
||||
},
|
||||
{
|
||||
"file": "int-status-a1-20261027.json",
|
||||
"bytes": 1442,
|
||||
"sha256": "c895209842c6f59f552a5b9af9542e0a4c58515d91213b188c1ee4300037b3ba"
|
||||
},
|
||||
{
|
||||
"file": "int-status-final-20261027.json",
|
||||
"bytes": 1795,
|
||||
"sha256": "2c57678c23eabf455295695214f9d87cca99be25245417310c12d25a6ac69e41"
|
||||
},
|
||||
{
|
||||
"file": "preflight.py",
|
||||
"bytes": 2328,
|
||||
"sha256": "2fccdc6dcd727db3b9599f5c4882b3ca389036ccbf12b91f2953d3789726e13c"
|
||||
},
|
||||
{
|
||||
"file": "preparation.json",
|
||||
"bytes": 247525,
|
||||
"sha256": "61d83eb63dd5f14d99cd0cce2f460150812b1831a27850c876a991d847b7febc"
|
||||
},
|
||||
{
|
||||
"file": "preserve-data.py",
|
||||
"bytes": 2304,
|
||||
"sha256": "e56d27b726c5e710b9bd5721d729cc019d57011b2ea1e2699fee6685f1f1bfbd"
|
||||
},
|
||||
{
|
||||
"file": "public-after.json",
|
||||
"bytes": 986,
|
||||
"sha256": "65a39cc9e37575d5da4731e185728d8762387d28abf34c7991c1f81b8c24479d"
|
||||
},
|
||||
{
|
||||
"file": "public-before.json",
|
||||
"bytes": 414,
|
||||
"sha256": "010725fedaa5b820efaea13d52140f07b450221f14d71624b6141fbdf5bb6b33"
|
||||
},
|
||||
{
|
||||
"file": "reconcile-operational-delta.py",
|
||||
"bytes": 5342,
|
||||
"sha256": "1fa90ff8496d2210dee1e01c0ee409abe0f4f1713f844ac99fa6f4b4c889e645"
|
||||
},
|
||||
{
|
||||
"file": "remote_delivery_inspection.py",
|
||||
"bytes": 1947,
|
||||
"sha256": "7c95ba88a9d5a62a15ec2bf581fa62f5151e548014d106f081487889e56b2703"
|
||||
},
|
||||
{
|
||||
"file": "restore.py",
|
||||
"bytes": 2828,
|
||||
"sha256": "fcfd6eb0adfff107ee9259b5825ac1afc550c9bd8eabf111fa0b1739d7dd3efd"
|
||||
},
|
||||
{
|
||||
"file": "schema-permissions-after.py",
|
||||
"bytes": 1868,
|
||||
"sha256": "d71436183c0cf121381e4119560d70f1bcaf850439830b822b728b6e86a04005"
|
||||
},
|
||||
{
|
||||
"file": "schema-permissions-before.py",
|
||||
"bytes": 1711,
|
||||
"sha256": "10c8acceabaebaeeb5d2e5161d37c3b7927b9f4e44e725e19f0a2eb738638b07"
|
||||
},
|
||||
{
|
||||
"file": "source-after-input.json",
|
||||
"bytes": 237267,
|
||||
"sha256": "b735f3c10108a40de67eba37cdac203329baea164fe8e48020087ee636462481"
|
||||
},
|
||||
{
|
||||
"file": "source-before-input.json",
|
||||
"bytes": 237268,
|
||||
"sha256": "3835b8ab18392212a54c4560be32807b5573b22378ff3403ecd10637ff81d59f"
|
||||
},
|
||||
{
|
||||
"file": "source-check.py",
|
||||
"bytes": 676,
|
||||
"sha256": "1cec620043b013e6b6f79b9f67e4e5588117d91ee7dc0c93592fc6b8d6d0557f"
|
||||
},
|
||||
{
|
||||
"file": "ssh-import-collision-resolution.json",
|
||||
"bytes": 411,
|
||||
"sha256": "a997a96b0ab7fcd9cb8797c788f4ec27b46df8e70a7008f59400a3af57b99286"
|
||||
},
|
||||
{
|
||||
"file": "ssh-session.py",
|
||||
"bytes": 3058,
|
||||
"sha256": "f506635c84dcc7c75c1b1cb244f8d1ffa98bcb6a1d906d6c70c5bfc5771bf177"
|
||||
},
|
||||
{
|
||||
"file": "status.py",
|
||||
"bytes": 1195,
|
||||
"sha256": "2282805a03dcbc4c82d5f8be3504c6408f49a5ddb63d7a3deeed1dbd650d021f"
|
||||
},
|
||||
{
|
||||
"file": "store-receipt.py",
|
||||
"bytes": 870,
|
||||
"sha256": "e407ff7db3b36fd554f6760dbd05c574c656770a18bf4631b430a8457293b6ea"
|
||||
},
|
||||
{
|
||||
"file": "update-docs.py",
|
||||
"bytes": 8322,
|
||||
"sha256": "be77002ecad1640fc1999a05d5a50584290e03294c2328cf403768005d4e2b35"
|
||||
},
|
||||
{
|
||||
"file": "verify-public.py",
|
||||
"bytes": 2037,
|
||||
"sha256": "df9aa7ec8b8581192abf8b3c726668205b4c50413005faa872a3fc8ecefbd5ad"
|
||||
}
|
||||
],
|
||||
"remote_receipt_sha256": "d80324b898fd160ab3e7a2fd0b11ea2decd0b99a9324255850062ee4a13e0f0f"
|
||||
}
|
||||
@@ -0,0 +1,222 @@
|
||||
{
|
||||
"date": "2026-10-27",
|
||||
"status": "QA demonstrated; not installed",
|
||||
"branch": "codex/irpc-l8-international-credit-qa-20261027",
|
||||
"base": "814fe0a9",
|
||||
"installed_reference": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"sector_fix_preserved": "669cb8979b0c372659fc2ad3876aebc919d5df19",
|
||||
"scope": {
|
||||
"year": "2026",
|
||||
"resident": "general",
|
||||
"period": "calendar year",
|
||||
"currency": "documented MZN",
|
||||
"foreign_tax": "actual income tax paid; inclusion in taxable base documented",
|
||||
"national_fraction": "documented exact input, not automatically derived",
|
||||
"treaty": "case-specific applicability and ceiling documented, not inferred from country",
|
||||
"order": [
|
||||
"international credit limited to eligible available amount and collection",
|
||||
"PEC limited to remaining collection",
|
||||
"withholdings and PPC"
|
||||
],
|
||||
"known_absent_missing_distinct": true,
|
||||
"proof_deduplication": "issuer/document across tax natures, dates and snapshot contexts; consolidate country-year quota",
|
||||
"officialBalancesConsumed": false,
|
||||
"carryCreated": false
|
||||
},
|
||||
"sources": {
|
||||
"reuse": "accepted CIRPC65(1–2), Lei34/2007 BR52 PDF18/printed768-(72); CIRPC66/RIRPC21 order",
|
||||
"originals_preserved": 30,
|
||||
"source_preservation_artifact": "outputs/irpc-l8-international-20261027/source-preservation.json",
|
||||
"automatic_treaty_entitlement": false
|
||||
},
|
||||
"verification": {
|
||||
"frontend_new": 18,
|
||||
"frontend_annual_pec_affected": 31,
|
||||
"frontend_pass": 49,
|
||||
"frontend_fail": 0,
|
||||
"api_tests": 1,
|
||||
"api_assertions": 171,
|
||||
"api_cases": 7,
|
||||
"api_path": "POST/PUT/GET private simulation drafts; DatabaseTransactions rollback in isolated guarded PostgreSQL55441",
|
||||
"recovered_reports": "fresh recalculation of all7 API recoveries; existing HTML and dossier finance report; frozen previous result",
|
||||
"wayfinder_routes_actions": "passed --with-form",
|
||||
"typescript": "passed",
|
||||
"isolated_build": "passed",
|
||||
"new_browser_manual_proof": false,
|
||||
"team_usability_evaluation": "awaiting team return; separate"
|
||||
},
|
||||
"cases": [
|
||||
{
|
||||
"name": "payable",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "700",
|
||||
"denominator": "1"
|
||||
},
|
||||
"current": true,
|
||||
"history_records": 0,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "treaty",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "702",
|
||||
"denominator": "1"
|
||||
},
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "missing",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "limited-collecta",
|
||||
"status": "recoverable",
|
||||
"balance": {
|
||||
"numerator": "-500",
|
||||
"denominator": "1"
|
||||
},
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "duplicate",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "absent",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "708",
|
||||
"denominator": "1"
|
||||
},
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"name": "prior-use",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "703",
|
||||
"denominator": "1"
|
||||
},
|
||||
"current": true,
|
||||
"history_records": 1,
|
||||
"apiRoundTrip": true,
|
||||
"dossier": true
|
||||
}
|
||||
],
|
||||
"example": {
|
||||
"foreign_tax_paid": "10 MZN",
|
||||
"documented_national_limit": "8 MZN",
|
||||
"documented_treaty_nonapplication": "synthetic only, not actual country entitlement",
|
||||
"credit": "8 MZN",
|
||||
"calculation": "1408 - 8 = 1400; - PEC200 = 1200; - PPC500 = 700 MZN simulated payable",
|
||||
"above_eligibility_limit": "2 MZN, not a carry",
|
||||
"insufficient_collection_example": "available2000, deducted1408, insufficient592; PEC200 not deducted; recoverable500 derives from PPC only"
|
||||
},
|
||||
"preservation": {
|
||||
"existing_records": {
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"tables": {
|
||||
"opportunities": {
|
||||
"existing_rows": 55,
|
||||
"unchanged": true
|
||||
},
|
||||
"documents": {
|
||||
"existing_rows": 64,
|
||||
"unchanged": true
|
||||
},
|
||||
"opportunity_documents": {
|
||||
"existing_rows": 1,
|
||||
"unchanged": true
|
||||
},
|
||||
"simulation_form_drafts": {
|
||||
"existing_rows": 19,
|
||||
"unchanged": true
|
||||
},
|
||||
"users": {
|
||||
"existing_rows": 40,
|
||||
"unchanged": true
|
||||
},
|
||||
"organizations": {
|
||||
"existing_rows": 3,
|
||||
"unchanged": true
|
||||
},
|
||||
"audit_events": {
|
||||
"existing_rows": 409,
|
||||
"unchanged": true
|
||||
}
|
||||
},
|
||||
"transaction_rollback": true
|
||||
},
|
||||
"originals": 30,
|
||||
"protected_consumers_count": 11,
|
||||
"no_migrations_or_permissions_changes": true,
|
||||
"legacy_summary_and_frozen_history_preserved": true,
|
||||
"private_pilots": "Songo/Gurue unchanged and private",
|
||||
"production_written": false,
|
||||
"SGF_TEMPO": "unchanged"
|
||||
},
|
||||
"remaining_code": [
|
||||
"automatic national fraction and case-specific treaty matching",
|
||||
"economic double-tax and CBF benefit credits with own rules",
|
||||
"international carry/expiry65(3), separate from PEC66 carry/expiry",
|
||||
"PPC/PEC obligation/calendar; autonomous tax, special periods, other currencies and M20/M22 transport/submission"
|
||||
],
|
||||
"document_dependencies": [
|
||||
{
|
||||
"missing": "income inclusion and national fraction",
|
||||
"example": "tax10 but no included income/base correspondence",
|
||||
"resume_when": "income/base and documented fraction matched"
|
||||
},
|
||||
{
|
||||
"missing": "treaty article/period/ceiling",
|
||||
"example": "country selected but no applicable article or eligible tax",
|
||||
"resume_when": "case-specific article, effective period and eligible ceiling identified"
|
||||
},
|
||||
{
|
||||
"missing": "proof/titular/previous actual use/temporal link",
|
||||
"example": "payment2027 selected for2026 without correspondence",
|
||||
"resume_when": "actual payment and explicit2026 link supported, prior use reconciled"
|
||||
}
|
||||
],
|
||||
"limits": [
|
||||
"L8 partial",
|
||||
"no new PEC excess/carry scope",
|
||||
"no automatic foreign exchange or official rounding rule",
|
||||
"no official tax balance consumption, submission or refund execution",
|
||||
"same-snapshot deduplication is not a global inter-dossier official ledger",
|
||||
"synthetic QA examples do not assert any actual foreign treaty",
|
||||
"no production deployment or publication of pilots"
|
||||
],
|
||||
"local_evidence": {
|
||||
"outputs\\irpc-l8-international-20261027\\frontend-tests.log": "7f981dc819ffe0947565994c9a29a72c408eb94a9cd687dba1d1b93903949b87",
|
||||
"outputs\\irpc-l8-international-20261027\\types.log": "82962651e47f564de653ad2883f8fd34e7dae4b4468e4ac459cb3331962a3879",
|
||||
"outputs\\irpc-l8-international-20261027\\build.log": "d9a173ef26392275e42f6ef8927c2c9a79039a16c98a371e8bbcccbeea17776b",
|
||||
"outputs\\irpc-l8-international-20261027\\existing-records-preservation.json": "b45b3306d3c9dee63fbbaf9a04bba31008019e65892bd16322460b5ef53eda7d",
|
||||
"outputs\\irpc-l8-international-20261027\\source-preservation.json": "d82c68f709793103373f2110b3b55ef226fd5e6a51a6835c62425c7407bcf0bd",
|
||||
"outputs\\irpc-l8-international-20261027\\recovered-report-receipt.json": "080d61ad1e3e4a849ea8b71642fb256881aa05a9fef81144cb7cf56848383cb2"
|
||||
},
|
||||
"qa_commit": "838ad941a24ae76ec4bf91ccc3f92012668fe8cf",
|
||||
"qa_branch_pushed": true
|
||||
}
|
||||
@@ -0,0 +1,901 @@
|
||||
{
|
||||
"date": "2026-10-27",
|
||||
"status": "installed_and_verified",
|
||||
"served_commit": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"includes_accepted_qa": "7fdb6b424b70ef6462a4f88338e52e2750b9e222",
|
||||
"previous_commit": "669cb8979b0c372659fc2ad3876aebc919d5df19",
|
||||
"sector_regression_preserved": "669cb897",
|
||||
"remote_backup": "/var/backups/investmoz-irpc-l8-pec-20261027/backup",
|
||||
"remote_receipt": "/var/backups/investmoz-irpc-l8-pec-20261027/installed-receipt.json",
|
||||
"scope": {
|
||||
"subject": "resident general",
|
||||
"year": "2026",
|
||||
"period": "calendar",
|
||||
"currency": "MZN",
|
||||
"treatment": "actual documented PEC of own exercise,selected available amount after prior use,capped to valid collecta before RF/PPC",
|
||||
"preceding_credits": "absent or documented known zero;positive/missing remains indeterminate",
|
||||
"no_automatic": [
|
||||
"PEC obligation",
|
||||
"prior-year carry",
|
||||
"expiry",
|
||||
"excess PEC refund",
|
||||
"official balance consumption",
|
||||
"special positive credits",
|
||||
"declaration submission"
|
||||
]
|
||||
},
|
||||
"accepted_qa_reused": {
|
||||
"new_PEC_tests": 12,
|
||||
"affected_annual_tests": 19,
|
||||
"api_assertions": 102,
|
||||
"cases_recovered_to_HTML_and_dossier": 5,
|
||||
"runtime_files_byte_identical_to_QA": 4
|
||||
},
|
||||
"compatibility": {
|
||||
"runtime_delta": [
|
||||
"resources/js/components/simulation-irpc-annual.tsx",
|
||||
"resources/js/components/simulation-irpc-pec.tsx",
|
||||
"resources/js/lib/irpc-annual-settlement.ts",
|
||||
"resources/js/lib/irpc-pec.ts"
|
||||
],
|
||||
"runtime_PEC_identity_to_accepted_QA": true,
|
||||
"sector_code_and_tests_identity_to669cb897": true,
|
||||
"changed_matrix_ids": [
|
||||
"RF-CLU-003",
|
||||
"MASTER-9dee08d0-0067",
|
||||
"MASTER-471012ab-0010",
|
||||
"MASTER-471012ab-0067",
|
||||
"AUD-SIM-INT02"
|
||||
],
|
||||
"matrix_note": "Four accepted team-use documentation updates from PEC ancestry preserved;plus PEC AUD-SIM-INT02. Sector rows unchanged.",
|
||||
"other_records_unchanged": true,
|
||||
"schema_config_routes_unchanged": true
|
||||
},
|
||||
"runtime_delta": [
|
||||
{
|
||||
"file": "resources/js/components/simulation-irpc-annual.tsx",
|
||||
"before_sha256": "91ac4ed53ab3f05129f2173cbcf196cef2db1da080a5de5f37e0cd3c5ef74554",
|
||||
"after_sha256": "7f18abcaa1100251c5c2780fdfac32e21979d8e6ffed52f732e4a0d345ab4f40"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/components/simulation-irpc-pec.tsx",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "c3f0ea9ff9389cf856ecda3894c7a1486f44193eb893c341ef10c67f888a2fc6"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/irpc-annual-settlement.ts",
|
||||
"before_sha256": "8cca5316259e3ebabfa75be9f64143a8664a447ac30b23b882318edfd70a68f1",
|
||||
"after_sha256": "6d80889677c1904b3236b5e43fa5a3dc28327745679392529dfb5fbf5a273f7d"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/irpc-pec.ts",
|
||||
"before_sha256": null,
|
||||
"after_sha256": "eb40b0601b6a1a69a6e81ad210589cc8744d74c6ef65e12132de13a5fcd6a90e"
|
||||
}
|
||||
],
|
||||
"source_files_verified": {
|
||||
"before": 1000,
|
||||
"after": 1002
|
||||
},
|
||||
"installer": {
|
||||
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"release": "/var/www/investmoz-homologacao/releases/e182d1d79dc945f35d2079c6b8ca2ac93048cec3-e2a185b3",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/669cb8979b0c372659fc2ad3876aebc919d5df19-6a2f00c6",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"release": "/var/www/investmoz-homologacao/releases/e182d1d79dc945f35d2079c6b8ca2ac93048cec3-e2a185b3",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/669cb8979b0c372659fc2ad3876aebc919d5df19-6a2f00c6",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"e182d1d79dc945f35d2079c6b8ca2ac93048cec3"
|
||||
],
|
||||
"finished_at": "2026-10-27T12:10:22.122557+00:00"
|
||||
},
|
||||
"log_file": "1793102808310738327.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 30.51s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 1092",
|
||||
"# pass 1092",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 308894
|
||||
},
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-irpc-l8-pec-20261027/backup",
|
||||
"created_at": "2026-10-27T12:05:00Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "eff57769cda1e9d0f3d507348b57fc455c0bbc6e38beeb3688135109a6e219fd",
|
||||
"files_sha256": "7830fd2f7671405777d7e5001edade7d5b08b1ebc1f86defb4bf3ec62a10446e",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "irpc_pec_restore_20261027",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "eff57769cda1e9d0f3d507348b57fc455c0bbc6e38beeb3688135109a6e219fd",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"capacity_after_backup": {
|
||||
"at": "2026-10-27T12:06:10.511691+00:00",
|
||||
"baseline": "669cb8979b0c372659fc2ad3876aebc919d5df19",
|
||||
"capacity_after_backup_satisfied": true,
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"free_bytes": 93404454912,
|
||||
"free_inodes": 23730955
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"free_bytes": 93404454912,
|
||||
"free_inodes": 23730955
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"free_bytes": 93404454912,
|
||||
"free_inodes": 23730955
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"free_bytes": 93404454912,
|
||||
"free_inodes": 23730955
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"free_bytes": 93404454912,
|
||||
"free_inodes": 23730955
|
||||
}
|
||||
],
|
||||
"backup_age_seconds": 70.511645,
|
||||
"backup_dump_sha256": "eff57769cda1e9d0f3d507348b57fc455c0bbc6e38beeb3688135109a6e219fd",
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"files_verified": 369,
|
||||
"backup_paths": {
|
||||
"dump": "/var/backups/investmoz-irpc-l8-pec-20261027/backup/database.dump",
|
||||
"files": "/var/backups/investmoz-irpc-l8-pec-20261027/backup/files-before.tar.gz"
|
||||
},
|
||||
"active_writes": 0
|
||||
},
|
||||
"schema_permissions": {
|
||||
"schema_sha256": "5045b3e51d2185377aa3d9ac7fa07a44fad3ec620cdfa83ffe31c8884ee1601d",
|
||||
"roles_grants_sha256": "1530c33cb016e67bfdc64891ddfce7f185b13b56b2cd87c012871a685e118109",
|
||||
"filesystem_permissions": {
|
||||
".env": {
|
||||
"mode": 416,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage/app": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"bootstrap/cache": {
|
||||
"mode": 1528,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
}
|
||||
},
|
||||
"comparison_identity": "postgres;catalogue read only;no passwords collected",
|
||||
"unchanged": true
|
||||
},
|
||||
"preservation": {
|
||||
"checked_at": "2026-10-27T12:11:58.610510+00:00",
|
||||
"installed": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"business_tables_unchanged": 172,
|
||||
"total_tables": 174,
|
||||
"operational_tables_to_reconcile": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 108,
|
||||
"checksum": "8ad8adb3b4cee975cebcb15806c60af5"
|
||||
},
|
||||
"after": {
|
||||
"rows": 108,
|
||||
"checksum": "5079060f1cdc89bf00b1bb3abdc2ff40"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 41,
|
||||
"checksum": "738960921c69e7c0272c0fdac68ce33b"
|
||||
},
|
||||
"after": {
|
||||
"rows": 53,
|
||||
"checksum": "7a5824a4f4e5bbe8b9d745a975aad665"
|
||||
}
|
||||
}
|
||||
},
|
||||
"persistent_files_unchanged": 369,
|
||||
"original_configuration_preserved": true,
|
||||
"synthetic_QA_storage_not_served": true,
|
||||
"QA_storage_saved_outside_active": "/var/lib/investmoz-deploy/qa-runtime/e182d1d79dc945f35d2079c6b8ca2ac93048cec3-e2a185b3",
|
||||
"fixture_or_content_imports": 0,
|
||||
"migrations": 0,
|
||||
"comparison_identity": "postgres;UTC;consistent before snapshot and after read-only transaction",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"operational_delta": {
|
||||
"status": "operational_delta_reconciled",
|
||||
"comparison_identity": "postgres before/after;isolated restored baseline;no RLS visibility inference",
|
||||
"cache": "queue:restart;requestthrottle;identical home-sector cached value with refreshed expiry(HomeController remember10min);no deletedcache",
|
||||
"sessions": "Anonymous delivery sessions or individually correlated public requests;one existing anonymous session had only token/previous-URL changes in payload and IP/activity metadata,with exact UA/IP/time/HTTP200 document request proof;no identity or other payload change. Deleted sessions,if any,individually expired. No session overwritten.",
|
||||
"delta": {
|
||||
"cache": {
|
||||
"before_rows": 108,
|
||||
"after_rows": 108,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "7f7dd83f47f5bf404d55e6e9f1367948721579970b195680645e356031a070ff",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"value",
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-illuminate:queue:restart",
|
||||
"is_queue_restart_key": true,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": false,
|
||||
"same_value_home_cache_expiry_refresh": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"before_rows": 41,
|
||||
"after_rows": 59,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "4e78c6a57b8f1771f6b334d7dd2697275c222d72620007b8e86e3f049427a8b3",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "f4fa6adfd3d6918ec9e7de8022a61c9cffe66f75800cf521c12aeb98bc3f062f",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "af76f65ffd28dfed5e35dd2111184a06a4e974608cbd2cc07314dae0dfc09a7f",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "a23c33b4c0cc464b1d78f36f59fb3e63b12a476983d19692f3cc003a629f7f52",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "1b9d5c268f04935e5c4daebefd1edfc1ef88c6581d7c5ebb7034b9790a37ec87",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "805dd129ffaa6ef2e03fff399836bc1945ddee46e714fb0ab8b6ffbf62305a3b",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "d5c7afdfe907c762e30c9036fa3821a2b6ba10eab06a87db9adfbb6e3c51c0dc",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "4ed17597603a4ea407a9a48740ea36ae8831e484a18a6cac9fb8fd29e17d2bcd",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "9d33a9812dcec08990f3f5e525f1d2045a0178e55c52b01e6b766c18db970909",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "38f6c88aecd61073863027dedbdfea596cddfd088ce26bc181461381d790263d",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "6590dfcbfa25d90e3cf00b5f3ed65ebe0385c1fdb8bbd4cfefee45775f3fb394",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "82c72ffd5859310ca5d1ab4781d1c297e69f32808382491eb5dbae4739560a08",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "301015a1771a6e3142105fe8267d63716d480bf2012c62f5ee1b21e5d9018cba",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "4c3537f85bb2c588fb86f5f832f08bfafcae211c951b2b65709cb63813cc2dae",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"ip_address",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": false,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true,
|
||||
"payload_diagnostic": {
|
||||
"changed_keys": [
|
||||
"_token",
|
||||
"_previous"
|
||||
],
|
||||
"token_shapes_valid": true,
|
||||
"token_unchanged": false,
|
||||
"before_previous_path": "/sectores/bens-de-consumo-e-franquias",
|
||||
"after_previous_path": "/documentos/27/view"
|
||||
},
|
||||
"public_navigation_log_matches": true,
|
||||
"current_ip_matches_public_request": true,
|
||||
"both_anonymous": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "58f135bb096ab4309792562b7cef59cd64eef92cb22baf5a1fbbf3a1410106b9",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "312f863d14b15caadb4c8d69bfe56af46cc3046f6443a540de9f4fae4bddb9c7",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "f7c9c5ef85f5adbe12adba07b05275d5405cdab6b01cee0a97344939f12d6ee0",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "e34c74bd2b7e86dfb654e2b65ff97a60b146925ca76169866b31fa4954398bbf",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "63d475bd758e4fd66f1e23c5bf5424e572c1e5ce2cb4ea533261ce0858040e6a",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"business_tables_to_confirm_separately": 172,
|
||||
"active_data_writes_by_comparison": 0,
|
||||
"restore_network": "none"
|
||||
},
|
||||
"public_delta": {
|
||||
"revision": {
|
||||
"commit": "e182d1d79dc945f35d2079c6b8ca2ac93048cec3",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-27T12:10:18.923517+00:00",
|
||||
"manifest_sha256": "47bbdd09864d0587133deec179781018e439f9c83b7b328c9dcd52482eaf6d31"
|
||||
},
|
||||
"manifest_verified": true,
|
||||
"pec_compiled_markers": {
|
||||
"IRPC-PEC/1": [
|
||||
"assets/project-dossier-D001tZjC.js"
|
||||
],
|
||||
"Preparar detalhe PEC": [
|
||||
"assets/services-I_s1lj16.js"
|
||||
],
|
||||
"Registar comprovativo PEC": [
|
||||
"assets/services-I_s1lj16.js"
|
||||
],
|
||||
"Não calcula a obrigação PEC": [
|
||||
"assets/project-dossier-D001tZjC.js"
|
||||
],
|
||||
"Excedente sem reembolso PEC": [
|
||||
"assets/project-dossier-D001tZjC.js"
|
||||
]
|
||||
},
|
||||
"sector_cards_unchanged": 10,
|
||||
"three_selected_sector_pages_and_guides_unchanged": true,
|
||||
"sector_index_still_without_aggregated_details": true,
|
||||
"filter_preserved": "agronegocio",
|
||||
"active_QA_records_created": false
|
||||
},
|
||||
"l8_remainder_and_credit_resumption": {
|
||||
"scope": "L8 partial after bounded current-year PEC delivery",
|
||||
"next_increment": {
|
||||
"name": "Own-exercise international double-tax credit",
|
||||
"status": "delimited for QA implementation; not yet implemented",
|
||||
"source": "Accepted CIRPC art65,Lei34/2007,PDF18/printed768-(72);order relative to PEC in art66 and RIRPC21",
|
||||
"reuse": [
|
||||
"entity and exercise",
|
||||
"valid L6/L7 collecta",
|
||||
"annual withholding/PPC/PEC book and frozen histories",
|
||||
"existing documents and source references",
|
||||
"existing currency records when an applicable conversion is documented"
|
||||
],
|
||||
"required_case_facts": [
|
||||
"foreign-source income included in the taxable base",
|
||||
"actual foreign income tax, not projected withholding/remittance",
|
||||
"subject, country, exercise, document and available unused amount",
|
||||
"documented domestic IRPC fraction for that foreign income",
|
||||
"known convention applicability and its limit if applicable",
|
||||
"known state of preceding credit groups; no missing-as-zero"
|
||||
],
|
||||
"calculation_contract": "Eligible current credit limited by proven foreign tax and corresponding domestic IRPC fraction, and treaty limit when applicable;then residual collecta for PEC before RF/PPC. No automatic carry/refund/official balance consumption.",
|
||||
"illustrative_case": {
|
||||
"synthetic": true,
|
||||
"foreign_tax": 10,
|
||||
"domestic_limit_documented": 8,
|
||||
"convention_not_applicable_documented": true,
|
||||
"eligible_credit": 8,
|
||||
"collecta": 1408,
|
||||
"after_credit": 1400,
|
||||
"pec": 200,
|
||||
"after_pec": 1200,
|
||||
"withholdings": 0,
|
||||
"ppc": 500,
|
||||
"simulated_payable": 700,
|
||||
"implemented": false,
|
||||
"unutilized_above_limit": "2 is not automatically a carry credit"
|
||||
},
|
||||
"delta_acceptance": [
|
||||
"known/absent/missing and qualification",
|
||||
"country/subject/year and physical proof identity",
|
||||
"no double use across credit/PEC/PPC/RF in the same snapshot",
|
||||
"credit before PEC;separate amounts and limits",
|
||||
"frozen history;save/recover/report",
|
||||
"indeterminate dependent annual balance when facts or preceding credits are missing"
|
||||
]
|
||||
},
|
||||
"remaining_code": [
|
||||
{
|
||||
"item": "international credit eligibility,limits and own-year deduction",
|
||||
"condition": "Implement the documented input contract and demonstrate only new totals and persistence."
|
||||
},
|
||||
{
|
||||
"item": "economic double-tax credit",
|
||||
"condition": "Art64 own conditions,profit inclusion and corresponding tax evidence;separate from international credit."
|
||||
},
|
||||
{
|
||||
"item": "investment/benefit credit",
|
||||
"condition": "Reuse L7 qualification and specific CBF period,amount,limit and accumulation;location alone never grants credit."
|
||||
},
|
||||
{
|
||||
"item": "prior-year PEC/credit transport,usage and expiry",
|
||||
"condition": "Implement provenance by year and actual prior use;distinguish PEC art66 from credit art65;do not equate excess above eligibility limit with lack of collecta."
|
||||
},
|
||||
{
|
||||
"item": "PPC/PEC obligation,instalments,interest and guides",
|
||||
"condition": "Specific facts and applicable rule/edition;actual paid PEC deduction already delivered is separate."
|
||||
},
|
||||
{
|
||||
"item": "autonomous tax,special periods,non-MZN,M20/M22 transport and submission",
|
||||
"condition": "Keep existing separate dependencies;no silent offset or provisional official fields."
|
||||
}
|
||||
],
|
||||
"documentary_dependencies": [
|
||||
{
|
||||
"item": "actual case evidence",
|
||||
"example": "10 MZN foreign tax with no proof of income inclusion or domestic limit",
|
||||
"resume_when": "Identify the existing evidence and amount;no generic revalidation of accepted sources."
|
||||
},
|
||||
{
|
||||
"item": "international convention",
|
||||
"example": "Treaty applies but the article/ceiling and foreign tax paid under it are unknown",
|
||||
"resume_when": "Exact country,convention,article,period and limit;block only dependent case."
|
||||
},
|
||||
{
|
||||
"item": "2026 regulatory amendment for obligation/calendars",
|
||||
"example": "Announcement without published operative articles",
|
||||
"resume_when": "Published diploma,changed articles and effective date for affected obligation/calendar only."
|
||||
}
|
||||
],
|
||||
"private_pilots": "Songo/Gurue remain private",
|
||||
"team_evaluation": "Await actual feedback;do not repeat accepted technical tests."
|
||||
},
|
||||
"private_pilots": "Songo/Gurue private;no publication,fixtures or content import",
|
||||
"team_use_evaluation": "Await actual feedback;accepted technical proofs retained",
|
||||
"artifacts": [
|
||||
{
|
||||
"file": "after.json",
|
||||
"sha256": "0a156acdc9665995f99553a8ffba04e0515ee7250e5266b1115c10d641d0bef7",
|
||||
"bytes": 235814
|
||||
},
|
||||
{
|
||||
"file": "backup.py",
|
||||
"sha256": "6342cf198110b4e5adbc8f3de524667cf30cb0779b3a5208fd2d4d85cb7ae6cc",
|
||||
"bytes": 5440
|
||||
},
|
||||
{
|
||||
"file": "backup.txt",
|
||||
"sha256": "c57f4716111352a2560ebbfd03e2fc9c24745d88067ed78dd15e83b6a108c7a7",
|
||||
"bytes": 810
|
||||
},
|
||||
{
|
||||
"file": "before.json",
|
||||
"sha256": "d50f7e56cdc84aa9ebcf690a6f2614cc81b6a2268fe61da01ba3e6c8ed7a887f",
|
||||
"bytes": 235815
|
||||
},
|
||||
{
|
||||
"file": "capacity-after.py",
|
||||
"sha256": "5fc773a1f74a3f6028c2d190c452c8d58f8b4a2f56afc508c61002d4eb892371",
|
||||
"bytes": 1610
|
||||
},
|
||||
{
|
||||
"file": "capacity-after.txt",
|
||||
"sha256": "9ee2aef5d44b3fb142e0af17e6992de052bfa9e987ffbfd39ea174aca5300af8",
|
||||
"bytes": 983
|
||||
},
|
||||
{
|
||||
"file": "compatibility.json",
|
||||
"sha256": "a9579d644b1dbd4cce1acca10374addeca11971604c5f1a4b87bcde4aac98310",
|
||||
"bytes": 715
|
||||
},
|
||||
{
|
||||
"file": "diagnose-session-delta.py",
|
||||
"sha256": "b6c0ca60258b920333e124d89252fd740587eb6081d2f965c97c13c44297941d",
|
||||
"bytes": 7385
|
||||
},
|
||||
{
|
||||
"file": "inspect.py",
|
||||
"sha256": "7c95ba88a9d5a62a15ec2bf581fa62f5151e548014d106f081487889e56b2703",
|
||||
"bytes": 1947
|
||||
},
|
||||
{
|
||||
"file": "inspect.txt",
|
||||
"sha256": "e3aa850ab8f75765fba2f18777223ea217139768a5fe3b151542462fb576e3fc",
|
||||
"bytes": 4930
|
||||
},
|
||||
{
|
||||
"file": "integrated.json",
|
||||
"sha256": "e81548bd610d293a4919c3727128681edec70badb26209d372c6cc1079cd8c76",
|
||||
"bytes": 281
|
||||
},
|
||||
{
|
||||
"file": "l8-remaining-and-credit-resumption.json",
|
||||
"sha256": "9f04414ad329af20a3f6026152477457481a8ea248367a7c2c21e6a7451df667",
|
||||
"bytes": 4496
|
||||
},
|
||||
{
|
||||
"file": "operational-delta.txt",
|
||||
"sha256": "fe6e21047fe47803c9f5040e296bc78137b9ef3c564bd3edc4005e4894c3d4b8",
|
||||
"bytes": 15960
|
||||
},
|
||||
{
|
||||
"file": "preflight.py",
|
||||
"sha256": "16c4a12ffa9766cf1350351c91c0c935776ed36fc9e214cd864d22d0941bcb42",
|
||||
"bytes": 2334
|
||||
},
|
||||
{
|
||||
"file": "preflight.txt",
|
||||
"sha256": "8d2b03d441da3f46ec268fb9b9274e41cf5ac88ae81af3284f64f1d143db316d",
|
||||
"bytes": 4446
|
||||
},
|
||||
{
|
||||
"file": "preparation.json",
|
||||
"sha256": "933e276820b297a268264a47c909fd7f8b82b2ae95d0b0b657be19fb1458b13f",
|
||||
"bytes": 245902
|
||||
},
|
||||
{
|
||||
"file": "preservation.txt",
|
||||
"sha256": "80d56892cc29aee66b012fbce808e685b409fb04ea8587c2b535a18b7e49457a",
|
||||
"bytes": 945
|
||||
},
|
||||
{
|
||||
"file": "preserve-data.py",
|
||||
"sha256": "9f0c3097467fe171508e741fa1e360df7747aab15f2feb1465adaf38520e69c3",
|
||||
"bytes": 2288
|
||||
},
|
||||
{
|
||||
"file": "public-after.json",
|
||||
"sha256": "5e9f81a2b5430e944ccb9c6cbc6a8df5e1f448d6d8e296b7bb282524972bbb49",
|
||||
"bytes": 43379
|
||||
},
|
||||
{
|
||||
"file": "public-before.json",
|
||||
"sha256": "07717e8041b44bc3b39f6e2f3f3eb78a9cf8349d88bb097faa9b41e088038f80",
|
||||
"bytes": 42785
|
||||
},
|
||||
{
|
||||
"file": "reconcile-operational-delta.py",
|
||||
"sha256": "7f85064f6d733024f4233c2fd2de05504297f033db37d70c1d7fd9a068f2fd89",
|
||||
"bytes": 8276
|
||||
},
|
||||
{
|
||||
"file": "restore.py",
|
||||
"sha256": "8a2e85c85dcf37bc1169f42d4f4164421e914ba06b8630875a68a2b122b16714",
|
||||
"bytes": 2768
|
||||
},
|
||||
{
|
||||
"file": "restore.txt",
|
||||
"sha256": "21a4b64404a16d341014e310beba4a8f802ed0dea140d6c85e474d7fbe4b6277",
|
||||
"bytes": 536
|
||||
},
|
||||
{
|
||||
"file": "schema-after.txt",
|
||||
"sha256": "d5855a7a0a16c1762cce140750c3b8c984e9ea61817bdf02e684cc9ae1c01592",
|
||||
"bytes": 526
|
||||
},
|
||||
{
|
||||
"file": "schema-before.txt",
|
||||
"sha256": "64e445bb8d8546aa399a151adbfe53a64383ea23380f77991d3ddf11721c7127",
|
||||
"bytes": 507
|
||||
},
|
||||
{
|
||||
"file": "schema-permissions-after.py",
|
||||
"sha256": "03b3eafc23c7598fa90bfbcb3e8fb6ee76e5404f3594a69206661538ab9d2a1d",
|
||||
"bytes": 1858
|
||||
},
|
||||
{
|
||||
"file": "schema-permissions-before.py",
|
||||
"sha256": "bc720ff8d3c0814f8a55a5808efd1481da111b75d538e79a3fa15d4ffc2ca74e",
|
||||
"bytes": 1701
|
||||
},
|
||||
{
|
||||
"file": "session-diagnostic.txt",
|
||||
"sha256": "b6d3e7871b1c20153dce3e3182b5a618c1172725bf3be4d4c45b978c10e472ee",
|
||||
"bytes": 1384
|
||||
},
|
||||
{
|
||||
"file": "source-after.txt",
|
||||
"sha256": "756651eb3db81a1e50ee369a62d05d6cfc86e36878194cc509324dcffdda9ad8",
|
||||
"bytes": 160
|
||||
},
|
||||
{
|
||||
"file": "source-before.txt",
|
||||
"sha256": "1a349bee2c2aff9ad38ede72205dc6a1ececea89148e0d67eab126fde5945dd2",
|
||||
"bytes": 161
|
||||
},
|
||||
{
|
||||
"file": "source-check.py",
|
||||
"sha256": "2ea95b35eb8c2eb950216ab77e2a3127b2400372e5034179953edae058b0eb84",
|
||||
"bytes": 669
|
||||
},
|
||||
{
|
||||
"file": "status-a1.txt",
|
||||
"sha256": "f6f22631054fa0920a3c897db7bc6e3a00bce5420e4893f08125bd103dc5fb8f",
|
||||
"bytes": 2244
|
||||
},
|
||||
{
|
||||
"file": "status-a2.txt",
|
||||
"sha256": "6711c9d6d9f93625851c4e161d4bd56997a77626d1df045020fce30e34fd31cf",
|
||||
"bytes": 2162
|
||||
},
|
||||
{
|
||||
"file": "status-a3.txt",
|
||||
"sha256": "6711c9d6d9f93625851c4e161d4bd56997a77626d1df045020fce30e34fd31cf",
|
||||
"bytes": 2162
|
||||
},
|
||||
{
|
||||
"file": "status-a4.txt",
|
||||
"sha256": "d45f8c746654e183e058066ae494ddbe65dd60c157f0e8ba349e256df8758a0a",
|
||||
"bytes": 2244
|
||||
},
|
||||
{
|
||||
"file": "verify-public.py",
|
||||
"sha256": "c5a7535398e0c8ad79458178bd835fa68812b540363495af6abbb38ad2cdd87d",
|
||||
"bytes": 3349
|
||||
}
|
||||
],
|
||||
"remote_receipt_sha256": "a970266625807803ce73f1e63d0da1a540cff264ab88a19d3a8a387a85b26c34"
|
||||
}
|
||||
@@ -0,0 +1,505 @@
|
||||
{
|
||||
"date": "2026-10-27",
|
||||
"status": "QA implemented, not installed",
|
||||
"branch": "codex/irpc-l8-pec-qa-20261027",
|
||||
"baseline": "dc14f01e1479f6bef48be60d2fbe961d9d445e0e",
|
||||
"portal_reference_from_previous_receipt": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"active_changed": false,
|
||||
"main_changed": false,
|
||||
"scope": {
|
||||
"year": "2026",
|
||||
"regime": "resident_general",
|
||||
"currency": "MZN",
|
||||
"period": "calendar",
|
||||
"payment": "documented current-year PEC, available amount after prior use",
|
||||
"deduction": "min(available selected PEC, valid collecta after preceding credits), before RF/PPC",
|
||||
"special_credits": "only documented absent or known zero; positive/missing stays indeterminate",
|
||||
"excess": "selected amount not deducted, no PEC refund or official carry created"
|
||||
},
|
||||
"examples": [
|
||||
{
|
||||
"case": "payable",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "708",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pec": {
|
||||
"version": "IRPC-PEC/1",
|
||||
"available": {
|
||||
"numerator": "200",
|
||||
"denominator": "1"
|
||||
},
|
||||
"deducted": {
|
||||
"numerator": "200",
|
||||
"denominator": "1"
|
||||
},
|
||||
"remaining": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"afterPec": {
|
||||
"numerator": "1208",
|
||||
"denominator": "1"
|
||||
},
|
||||
"source": "CIRPC, art. 66(1–2), Lei 34/2007, exemplar BR52, p. 768-(72): dedução após créditos anteriores, até à colecta, sem reembolso do PEC. Recorte demonstrado: pagamento efectivo do próprio exercício 2026, residente geral, ano civil, MZN. Não calcula a obrigação PEC, transporte, caducidade ou consumo de saldos oficiais.",
|
||||
"officialBalancesConsumed": false,
|
||||
"carryCreated": false
|
||||
},
|
||||
"rows": 7,
|
||||
"history": 0,
|
||||
"apiRoundTrip": true,
|
||||
"current": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"case": "capped",
|
||||
"status": "balanced",
|
||||
"balance": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pec": {
|
||||
"version": "IRPC-PEC/1",
|
||||
"available": {
|
||||
"numerator": "2000",
|
||||
"denominator": "1"
|
||||
},
|
||||
"deducted": {
|
||||
"numerator": "1408",
|
||||
"denominator": "1"
|
||||
},
|
||||
"remaining": {
|
||||
"numerator": "592",
|
||||
"denominator": "1"
|
||||
},
|
||||
"afterPec": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"source": "CIRPC, art. 66(1–2), Lei 34/2007, exemplar BR52, p. 768-(72): dedução após créditos anteriores, até à colecta, sem reembolso do PEC. Recorte demonstrado: pagamento efectivo do próprio exercício 2026, residente geral, ano civil, MZN. Não calcula a obrigação PEC, transporte, caducidade ou consumo de saldos oficiais.",
|
||||
"officialBalancesConsumed": false,
|
||||
"carryCreated": false
|
||||
},
|
||||
"rows": 6,
|
||||
"history": 1,
|
||||
"apiRoundTrip": true,
|
||||
"current": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"case": "recoverable",
|
||||
"status": "recoverable",
|
||||
"balance": {
|
||||
"numerator": "-500",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pec": {
|
||||
"version": "IRPC-PEC/1",
|
||||
"available": {
|
||||
"numerator": "2000",
|
||||
"denominator": "1"
|
||||
},
|
||||
"deducted": {
|
||||
"numerator": "1408",
|
||||
"denominator": "1"
|
||||
},
|
||||
"remaining": {
|
||||
"numerator": "592",
|
||||
"denominator": "1"
|
||||
},
|
||||
"afterPec": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"source": "CIRPC, art. 66(1–2), Lei 34/2007, exemplar BR52, p. 768-(72): dedução após créditos anteriores, até à colecta, sem reembolso do PEC. Recorte demonstrado: pagamento efectivo do próprio exercício 2026, residente geral, ano civil, MZN. Não calcula a obrigação PEC, transporte, caducidade ou consumo de saldos oficiais.",
|
||||
"officialBalancesConsumed": false,
|
||||
"carryCreated": false
|
||||
},
|
||||
"rows": 7,
|
||||
"history": 1,
|
||||
"apiRoundTrip": true,
|
||||
"current": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"case": "missing",
|
||||
"status": "indeterminate",
|
||||
"balance": null,
|
||||
"pec": {
|
||||
"version": "IRPC-PEC/1",
|
||||
"available": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"deducted": null,
|
||||
"remaining": null,
|
||||
"afterPec": null,
|
||||
"source": "CIRPC, art. 66(1–2), Lei 34/2007, exemplar BR52, p. 768-(72): dedução após créditos anteriores, até à colecta, sem reembolso do PEC. Recorte demonstrado: pagamento efectivo do próprio exercício 2026, residente geral, ano civil, MZN. Não calcula a obrigação PEC, transporte, caducidade ou consumo de saldos oficiais.",
|
||||
"officialBalancesConsumed": false,
|
||||
"carryCreated": false
|
||||
},
|
||||
"rows": 7,
|
||||
"history": 1,
|
||||
"apiRoundTrip": true,
|
||||
"current": true,
|
||||
"dossier": true
|
||||
},
|
||||
{
|
||||
"case": "prior-use",
|
||||
"status": "payable",
|
||||
"balance": {
|
||||
"numerator": "1208",
|
||||
"denominator": "1"
|
||||
},
|
||||
"pec": {
|
||||
"version": "IRPC-PEC/1",
|
||||
"available": {
|
||||
"numerator": "200",
|
||||
"denominator": "1"
|
||||
},
|
||||
"deducted": {
|
||||
"numerator": "200",
|
||||
"denominator": "1"
|
||||
},
|
||||
"remaining": {
|
||||
"numerator": "0",
|
||||
"denominator": "1"
|
||||
},
|
||||
"afterPec": {
|
||||
"numerator": "1208",
|
||||
"denominator": "1"
|
||||
},
|
||||
"source": "CIRPC, art. 66(1–2), Lei 34/2007, exemplar BR52, p. 768-(72): dedução após créditos anteriores, até à colecta, sem reembolso do PEC. Recorte demonstrado: pagamento efectivo do próprio exercício 2026, residente geral, ano civil, MZN. Não calcula a obrigação PEC, transporte, caducidade ou consumo de saldos oficiais.",
|
||||
"officialBalancesConsumed": false,
|
||||
"carryCreated": false
|
||||
},
|
||||
"rows": 6,
|
||||
"history": 1,
|
||||
"apiRoundTrip": true,
|
||||
"current": true,
|
||||
"dossier": true
|
||||
}
|
||||
],
|
||||
"proofs": {
|
||||
"new_frontend_tests": 12,
|
||||
"affected_annual_tests": 19,
|
||||
"api_tests": 1,
|
||||
"api_assertions": 102,
|
||||
"api_cases": 5,
|
||||
"api_round_trip_reports": 5,
|
||||
"routes": "wayfinder --with-form passed",
|
||||
"typescript": "passed",
|
||||
"isolated_build": "passed; optional fontaine/chunk-size notices only",
|
||||
"manual_browser_test": false,
|
||||
"real_team_evaluation": "pending external feedback"
|
||||
},
|
||||
"preservation": {
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"tables": {
|
||||
"opportunities": {
|
||||
"existing_rows": 55,
|
||||
"unchanged": true
|
||||
},
|
||||
"documents": {
|
||||
"existing_rows": 64,
|
||||
"unchanged": true
|
||||
},
|
||||
"opportunity_documents": {
|
||||
"existing_rows": 1,
|
||||
"unchanged": true
|
||||
},
|
||||
"simulation_form_drafts": {
|
||||
"existing_rows": 19,
|
||||
"unchanged": true
|
||||
},
|
||||
"users": {
|
||||
"existing_rows": 40,
|
||||
"unchanged": true
|
||||
},
|
||||
"organizations": {
|
||||
"existing_rows": 3,
|
||||
"unchanged": true
|
||||
},
|
||||
"audit_events": {
|
||||
"existing_rows": 409,
|
||||
"unchanged": true
|
||||
}
|
||||
},
|
||||
"transaction_rollback": true
|
||||
},
|
||||
"source_preservation": {
|
||||
"baseline": "dc14f01e",
|
||||
"count": 30,
|
||||
"all_equal": true,
|
||||
"files": [
|
||||
{
|
||||
"file": "AT-Comunicado-9-2026-ISPC.pdf",
|
||||
"sha256": "106f8a9ce9255c03549c70bf07fe999d32e6e55302d009b509862aa74ccb4973"
|
||||
},
|
||||
{
|
||||
"file": "AT-Modelo-30-ISPC.pdf",
|
||||
"sha256": "6802edd06b6ff638a0b851a3ec7ecf69af8f07840faa47446becad67d35d445c"
|
||||
},
|
||||
{
|
||||
"file": "AT-Modelo-B-Geral.pdf",
|
||||
"sha256": "bd977c7c59d4d98befd92e2c566b1bf168cb1343bb519f51b41a3807f431fc57"
|
||||
},
|
||||
{
|
||||
"file": "AT-MRFTA-19-39.pdf",
|
||||
"sha256": "8ea62c53066b482f87078a7a7b1ecf15ca98a12a122e8d7abca63acfc993186b"
|
||||
},
|
||||
{
|
||||
"file": "BR-16-I-Serie-2008-04-16.pdf",
|
||||
"sha256": "fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee"
|
||||
},
|
||||
{
|
||||
"file": "BR-248-I-Suplemento-1-2025.pdf",
|
||||
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251"
|
||||
},
|
||||
{
|
||||
"file": "BR-89-I-Serie-2017-06-08.pdf",
|
||||
"sha256": "11f0cab15eb6e51010952203ffa24fdc533a24fd642e19525fe4f46b17a1f5e5"
|
||||
},
|
||||
{
|
||||
"file": "BR-95-I-Suplemento-2025-05-21.pdf",
|
||||
"sha256": "e0e682e2c027c3cd9c1d46a73a3f48bc5f6bdbf05667fd97314d7a3f6a456358"
|
||||
},
|
||||
{
|
||||
"file": "BR252-I-Serie-2022-Lei20-PESOE.pdf",
|
||||
"sha256": "1159fd3ce1ba5581671796d083534da48bd3c5578298819e896f1c2a8026318d"
|
||||
},
|
||||
{
|
||||
"file": "Decreto-22-2021-BR70.pdf",
|
||||
"sha256": "a8fac38dcfe08f9c7a8e46254cff10e1ec82fc4f7a8d88ad6e4fe7d91ffc21a5"
|
||||
},
|
||||
{
|
||||
"file": "Decreto-27-2026-BR123.pdf",
|
||||
"sha256": "26249c3fa58f149c81de36e99d1aac2819a4771379d9e8833159660dabf539bb"
|
||||
},
|
||||
{
|
||||
"file": "Decreto-29-1998-BR22-5-suplemento.pdf",
|
||||
"sha256": "6242cbe675faadf085f43f95ec8c7e8868aafe67c3b2ab2bb010992288f954f8"
|
||||
},
|
||||
{
|
||||
"file": "Decreto-3-2011-BR-11-I-mineiros.pdf",
|
||||
"sha256": "5bca1133666ba9c69870b89823420175b7b5b8d0eccb667ecdf5c29716f3b6be"
|
||||
},
|
||||
{
|
||||
"file": "Decreto-37-2023-BR124.pdf",
|
||||
"sha256": "7e680b191481faa0e2e9057fa5053587eb2a29d1d8c819e0eb9f02814255a04c"
|
||||
},
|
||||
{
|
||||
"file": "Decreto-9-2008-BR16.pdf",
|
||||
"sha256": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697"
|
||||
},
|
||||
{
|
||||
"file": "Lei-13-2016-CIVA-BR-156-10-suplemento.pdf",
|
||||
"sha256": "b90dc7c14ecea2e378c4a62e8e5a47d54a5644c457baeb8b8053b92fd2a5710b"
|
||||
},
|
||||
{
|
||||
"file": "Lei-14-1992-BR42.pdf",
|
||||
"sha256": "089fff7423e99a70a230a73ca379e4ea3a91d124703f91016e57ff82794b9e56"
|
||||
},
|
||||
{
|
||||
"file": "Lei-17-2022-BR251-exemplar-MCNet5.pdf",
|
||||
"sha256": "14eb34f0af91a8f5cb1770c7b52d6ff839c6818302d1ed96d79afbfb9fe999d4"
|
||||
},
|
||||
{
|
||||
"file": "Lei-17-2022-IPP-BR250-Parlamento.pdf",
|
||||
"sha256": "978cd22403ffd336a631704ecd7a5bbd814a427c815b9acdaca5515591dd9e2a"
|
||||
},
|
||||
{
|
||||
"file": "Lei-19-2013-BR76.pdf",
|
||||
"sha256": "bba96d645cc935ffc3d1a79b9f0f73ac1c693d6459c2ad41f56cd2841accae76"
|
||||
},
|
||||
{
|
||||
"file": "Lei-19-2017-IRPS-BR-OCAM.pdf",
|
||||
"sha256": "c3a0186cb9ad090d7a9533006295dc9bb6a62ad0d6150173cbd49dba4ee4b52d"
|
||||
},
|
||||
{
|
||||
"file": "Lei-2-2011-BR-1-4-suplemento-MCNet.pdf",
|
||||
"sha256": "a7543a68cc3287a46a83c39a04821b40f649dd06c4e9b5dc51ff0b47fba08899"
|
||||
},
|
||||
{
|
||||
"file": "Lei-20-2009-BR36-AT-exemplar19.pdf",
|
||||
"sha256": "fc1c8144db42960cbf73e717e095896f511ece0f907f58f78819b27d6917a7ee"
|
||||
},
|
||||
{
|
||||
"file": "Lei-22-2022-IVA-republicada-BR-250-2-suplemento.pdf",
|
||||
"sha256": "ea1b0dc6f5cf6e595f6d9a19e7042f398999e0087caef1785f6e8fac571b5f53"
|
||||
},
|
||||
{
|
||||
"file": "Lei-34-2007-BR52.pdf",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e"
|
||||
},
|
||||
{
|
||||
"file": "Lei-4-1994-BR37-3-suplemento.pdf",
|
||||
"sha256": "210df9db8980d0a5690cd187a6eeec7e37a900d743e39062c16f4e0d12215c7e"
|
||||
},
|
||||
{
|
||||
"file": "Lei-4-2012-BR3.pdf",
|
||||
"sha256": "b8845cef41dcbd9ba50c43dbfa743a56030dd3d348242a107e1ae30279eec121"
|
||||
},
|
||||
{
|
||||
"file": "Lei-7-1991-Partidos-IFES.pdf",
|
||||
"sha256": "6b783a0bb3330688ef10660a58060d9724aa2da6a873d234fe902f0eaaeda42d"
|
||||
},
|
||||
{
|
||||
"file": "PT-MZ-CDT-1992.pdf",
|
||||
"sha256": "d504e1024b28aee5c6acf4592acb96ec9c915a8414f67a61ab6984d6acf9df9d"
|
||||
},
|
||||
{
|
||||
"file": "PT-MZ-Protocolo-2009.pdf",
|
||||
"sha256": "f353773dcf41f09f4daa6cf5ba5a5f7994f3e02615867c2dcffc61c3d901bf9b"
|
||||
}
|
||||
]
|
||||
},
|
||||
"rule_sources": [
|
||||
{
|
||||
"file": "Lei-34-2007-BR52.pdf",
|
||||
"pdf_page": 18,
|
||||
"printed_page": "768-(72)",
|
||||
"article": "66(1–2)",
|
||||
"sha256": "cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e"
|
||||
},
|
||||
{
|
||||
"file": "Decreto-9-2008-BR16.pdf",
|
||||
"pdf_pages": [
|
||||
6,
|
||||
7
|
||||
],
|
||||
"articles": "21(2/5),27;29 for deferred obligation context",
|
||||
"sha256": "96fccdecbfdc11c9eafb90fbc6c7bc259f88bbd4c7507d1ac3af1fa03f960697"
|
||||
}
|
||||
],
|
||||
"remaining_code": [
|
||||
"PEC obligation and instalments, separate from actual payment",
|
||||
"Prior-year carry, expiry and usage ledger",
|
||||
"Special credits/autonomous tax/special periods/non-MZN/M20-M22 remain own groups"
|
||||
],
|
||||
"documentary_resume_conditions": [
|
||||
"Published 2026 regulatory amendment: exact articles and effective date for affected obligation/calendar",
|
||||
"Prior-year PEC: exact last eligible exercise, transition and documented usage",
|
||||
"Specific positive credit: own legal limit, order, period, evidence and convention if relevant"
|
||||
],
|
||||
"private_pilots": "Songo/Gurue unchanged and private; no publication",
|
||||
"proactive_team_use": "await actual team feedback; implement concrete observed corrections only",
|
||||
"artifacts": [
|
||||
{
|
||||
"file": "Decreto-9-2008-BR16.pdf-6.png",
|
||||
"sha256": "109f862c8b94e15f55270ec41f90a66ed9cb3b5cf1f772615a8808a9a6034964",
|
||||
"bytes": 476800
|
||||
},
|
||||
{
|
||||
"file": "Decreto-9-2008-BR16.pdf-7.png",
|
||||
"sha256": "943f945fae0a5086fad53cc468f1105257c9b4d762220b823816874bd1878884",
|
||||
"bytes": 504338
|
||||
},
|
||||
{
|
||||
"file": "dossier-capped.json",
|
||||
"sha256": "a93f9dc6b0b2c21526dfaff9a415bbc2b6a53124dbd860ea5d1809c8868dd2d3",
|
||||
"bytes": 31771
|
||||
},
|
||||
{
|
||||
"file": "dossier-missing.json",
|
||||
"sha256": "563e015d9a9069b09dd16548efa21fa37399b24fc6634d136100080706aa6d9a",
|
||||
"bytes": 32184
|
||||
},
|
||||
{
|
||||
"file": "dossier-payable.json",
|
||||
"sha256": "b4cde0e17a9306bf08b7f54103eb499d11e4fd14d70fd38e4858013074d08a3a",
|
||||
"bytes": 32130
|
||||
},
|
||||
{
|
||||
"file": "dossier-prior-use.json",
|
||||
"sha256": "5b2f95e06711099051fc463509854b439a48f7134c6da45210ce0ca529f77622",
|
||||
"bytes": 31776
|
||||
},
|
||||
{
|
||||
"file": "dossier-recoverable.json",
|
||||
"sha256": "27d954e4e6a48980cbbd391a9352ea83456b1e61b42663389f6ada47b55d7c77",
|
||||
"bytes": 32142
|
||||
},
|
||||
{
|
||||
"file": "existing-records-preservation.json",
|
||||
"sha256": "b45b3306d3c9dee63fbbaf9a04bba31008019e65892bd16322460b5ef53eda7d",
|
||||
"bytes": 822
|
||||
},
|
||||
{
|
||||
"file": "Lei-34-2007-BR52.pdf-18.png",
|
||||
"sha256": "25a5493d2d63d492ca849b5b798b87ad792fa4f6a95493ec96fa5c974c8c4c62",
|
||||
"bytes": 467400
|
||||
},
|
||||
{
|
||||
"file": "Lei-34-2007-BR52.pdf-19.png",
|
||||
"sha256": "160f635ce804f400e73d878dff19dc0cae360a195a06952294766f00c74f78d0",
|
||||
"bytes": 483003
|
||||
},
|
||||
{
|
||||
"file": "PEC-excerpts.json",
|
||||
"sha256": "3d8795a9bde96195a59dfef0387c1294a14bd6f671d3df76ac8f7e95ebd7a1ad",
|
||||
"bytes": 19256
|
||||
},
|
||||
{
|
||||
"file": "recovered-capped.json",
|
||||
"sha256": "e9465e01490fc6f3d52ebdf74d12842d60d5bde155e863a14ec8224592dd5ab4",
|
||||
"bytes": 349126
|
||||
},
|
||||
{
|
||||
"file": "recovered-missing.json",
|
||||
"sha256": "32b4183191ed48954f6d13b8b0a2c127a1edfd7a2308370396bf1cce26f7504b",
|
||||
"bytes": 349856
|
||||
},
|
||||
{
|
||||
"file": "recovered-payable.json",
|
||||
"sha256": "8b039e9127e57a2b104f7b37dbedb60e857b82e271bee7c784cf9be06fef2731",
|
||||
"bytes": 344415
|
||||
},
|
||||
{
|
||||
"file": "recovered-prior-use.json",
|
||||
"sha256": "ae5099bc2dd54755f232567a6cf7c87080ca8fc1dfde09db6ed4426d4189d800",
|
||||
"bytes": 348899
|
||||
},
|
||||
{
|
||||
"file": "recovered-recoverable.json",
|
||||
"sha256": "cae038d1abe19bfc3101216d3e0b79a4cc3ef360f3ca4f8fa3e298a7c187d843",
|
||||
"bytes": 349415
|
||||
},
|
||||
{
|
||||
"file": "recovered-report-receipt.json",
|
||||
"sha256": "e70e0777dd92cf8ef17d199238cef3fcef8223a4dfba3b56c420ba4aca42a6f7",
|
||||
"bytes": 5362
|
||||
},
|
||||
{
|
||||
"file": "report-capped.html",
|
||||
"sha256": "ddf9e4fa8508daa86c2f5a337f57fe6d8c443018c8706d79f34c8151a6bd9465",
|
||||
"bytes": 5214
|
||||
},
|
||||
{
|
||||
"file": "report-missing.html",
|
||||
"sha256": "7313eaa4f984ae2976d7a66b81242899bb5a9cc5c55e62f85a0d4813b7710c91",
|
||||
"bytes": 5594
|
||||
},
|
||||
{
|
||||
"file": "report-payable.html",
|
||||
"sha256": "d654183e1d293f7fd025918ddaca6da0d30915e4fd6cc4b34e899b210ed6eb52",
|
||||
"bytes": 5540
|
||||
},
|
||||
{
|
||||
"file": "report-prior-use.html",
|
||||
"sha256": "113bdc44ad910a8679ec99949726d637297180f078c2b6ba4760076e8dd0da85",
|
||||
"bytes": 5219
|
||||
},
|
||||
{
|
||||
"file": "report-recoverable.html",
|
||||
"sha256": "c91511cd25706322ddfc9f081e1058325a8af617a97580c97388304f6481194a",
|
||||
"bytes": 5552
|
||||
},
|
||||
{
|
||||
"file": "source-preservation.json",
|
||||
"sha256": "621864a86ef46931a949d039d3de854c339e205310955fa886d9f879404834e2",
|
||||
"bytes": 4483
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -143,37 +143,6 @@ Origem: https://www.cipmoz.org/wp-content/uploads/2023/financas/17F%29%20Lei%202
|
||||
SHA256: `1159fd3ce1ba5581671796d083534da48bd3c5578298819e896f1c2a8026318d`. Exemplar: `docs/investmoz/simulations/source-archive/BR252-I-Serie-2022-Lei20-PESOE.pdf`. Lei19/2013 PDF2/p682(22) também conferida visualmente:62(3)liberatória20% e62(4)a–d10% específicos. Lei20/2022 mantém62(1/3/4) e termina medidas agrícolas em31/12/2025;Lei12/2025 estabelece62(5)digital/moeda electrónica. A fonte oficial permanece aceite; a nova leitura resolve uma lacuna de texto, sem revalidação genérica. Sem publicação/importação automática ou scan declarado. Recibo: `irpc-l5-grouped-qa-20261025.json`.
|
||||
|
||||
|
||||
## 25/10/2026 — L5 dispensas e convenção PT–MZ
|
||||
|
||||
Inventários anteriores reutilizados; inventário completo dos29 originais fiscais em `irpc-l5-reliefs-qa-20261025.json`, incluindo27 anteriores preservados e2 novos. CIRPC Lei34/2007 art68(d/f), PDF19/p768(73), conferido visualmente; listas de alterações Lei4/2012 PDF1 e Lei19/2013 PDF1 não alteram68. Lei20/2022 e Lei12/2025 já correspondidas no recibo agrupado. Sem reutilizar código revogado2002.
|
||||
|
||||
CDT PT–MZ, RAR36/1992: original oficial no arquivo do Ministério Público português, arts1/4/12;PDF13–14 conferidas visualmente. Protocolo/RAR36/2009, original DR,PDF1–2/p2752–2753:IRPC/residência e definição12(3);art15 aplicabilidade temporal confrontado. DR apresenta os diplomas em vigor; vigência do Protocolo07/06/2009 documentada na ficha oficial do Ministério Público, efeitos na fonte a partir do ano seguinte. Recorte2026 não estende automaticamente a outras categorias ou tratados. A condição de aplicação12(2) não é confundida com cumprimento de formalidades externas;21-RFI português não imposto em Moçambique.
|
||||
|
||||
Novos originais privados preservados, sem publicação/importação automáticas, sem scan ou certificação declarados:
|
||||
|
||||
- docs/investmoz/simulations/source-archive/PT-MZ-CDT-1992.pdf;SHA256`d504e1024b28aee5c6acf4592acb96ec9c915a8414f67a61ab6984d6acf9df9d`;origem:https://dcjri.ministeriopublico.pt/sites/default/files/documentos/instrumentos/rar36-1992.pdf.
|
||||
|
||||
- docs/investmoz/simulations/source-archive/PT-MZ-Protocolo-2009.pdf;SHA256`f353773dcf41f09f4daa6cf5ba5a5f7994f3e02615867c2dcffc61c3d901bf9b`;origem:https://files.dre.pt/1s/2009/05/08900/0275202756.pdf.
|
||||
|
||||
Referências oficiais adicionais: https://diariodarepublica.pt/dr/detalhe/resolucao-assembleia-republica/36-1992-408879 ; https://diariodarepublica.pt/dr/detalhe/resolucao-assembleia-republica/36-2009-607572 ; https://dcjri.ministeriopublico.pt/instrumento/protocolo-entre-republica-portuguesa-e-republica-de-mocambique-que-reve-convencao-para . A aceitação das fontes oficiais permanece, sem revalidação genérica.
|
||||
|
||||
|
||||
## 25/10/2026 — MRFTA e juros compensatórios: correspondência concreta
|
||||
|
||||
Reutilizados os29 originais aceites,sem perdas por hash. MRFTA19/39AT,PDF1–2,semAcroForms:quadros1–7 e instruções conferidos visualmente,8/9 reservados. O incremento preenche um mapaHTML correspondente,sem alterar o original ou alegar submissão. Rubricas normais de capitais/prediais e liberatórias IRPC intelectuais/equipamento/capitais/serviços correspondidas pelo nome e natureza;digital/especiais não presumidos. CER permanece dado transcrito com referência,não número de campo da guia antiga.
|
||||
|
||||
Decreto9/2008,PDF6/p121,art25(1–3),ePDF8/p123,art35:juros compensatórios e distinção da natureza da retenção. A página oficial BM do Mercado Monetário explica a descontinuidade da MAIBOR em consequência do acordo de17/05/2017. Snapshot integral preservado em `source-archive/BM-Mercado-Monetario-MAIBOR-20261025.html`,SHA256`00e8a7e0d3a1db4ca3beb56d5361b2084a0f1684f3d40fc1c203702a2190e063`. Origem:https://bancomoc.mz/pt/areas-de-actuacao/mercados/mercado-monetario/ . Não usar MIMO ou Prime como sucessor fiscal por inferência. Nenhuma taxa2026 genérica activada;liquidação documentada pode ser transcrita com período/data/prova. Sem nova validação de credibilidade oficial,sem publicação/importação automáticas,sem scan declarado. Inventário completo e hashes no recibo `irpc-juros-mrfta-qa-20261025.json`.
|
||||
|
||||
O snapshot HTML é versionado com `-text -diff` no caminho exacto de `.gitattributes`,conservando bytes e espaços do original em vez de normalizar linhas. Hash conferido também contra o blob Git antes de preparar o bundle final.
|
||||
|
||||
|
||||
## 25/10/2026 — dois pontos restantes: parâmetros e correspondências
|
||||
|
||||
Reutilizados30originais aceites,sem alteração por hash. O seguimento não carrega taxa fiscal2026 nem novo CER. A aritmética exige fonte/fundamento,janela temporal,base anual e arredondamento explícitos do caso;ensaios usam parâmetros fictícios. Registo de montante liquidado e cálculo por perfil são vias distintas.
|
||||
|
||||
Inventário oficial AT189documentos recuperado em `outputs/irpc-interest-cer/at-legislation-inventory.json`,SHA256`d74e764224d97fdea2e6e6e3496614c9b0f94941e8f8757eed8e7847bda9508c`;escopo desta leitura:metadados/títulos,não revisão integral de novos PDFs. URL:https://www.at.gov.mz/api/documents?root=LEGISLACAO . Referências aoDecreto68/2014/desagregaçãoCER identificadas em pesquisa;sem correspondência detalhada aplicável recuperada para activação. Rascunhos sem diploma/número e agregados de receitas não usados como CER MRFTA. Sem revalidação genérica da credibilidade das fontes aceites,sem publicação/importação automática. As lacunas concretas permanecem no recibo `irpc-interest-cer-qa-20261025.json`.
|
||||
|
||||
|
||||
## 25/10/2026 — L6, cadeia do primeiro acréscimo36(1)c
|
||||
|
||||
Reutilizados30originais aceites,sem alteração. Conferidos visualmenteLei34/2007PDF6/p768(60) ePDF10/p768(64);Lei4/2012PDF2/p34(5) ePDF3/p34(6);Lei19/2013PDF1/2,p682(21/22). Novo exemplar oficialAT,catálogo19/2009,conserva5páginas do4.ºsuplementoBR36,10/09/2009,incluindoLei20/2009. PDF4/p272(16)confirma36(1)a–i mantidas eaditamentosj–n;fonte original/hash/URL no reciboirpc-l6-adjustments-qa-20261025.json. Correspondência executável limitada36(1)c;demais artigos não declarados implementados. Lei20/2022altera61/62 eLei12/2025altera3/5/20/62/67/75,adita61-A/revogações próprias,conforme provas aceites. Nova consulta responde só à cadeia do acréscimoL6,não às pendênciasL5. Sem publicação/importação documental,scan ou certificação presumidos.
|
||||
@@ -192,3 +161,30 @@ Reutilizados31originais sem alteração por hash. Lei34/2007PDF5/p768(59),15(1)a
|
||||
## 25/10/2026 — L6:taxa geral para a colecta normal2026
|
||||
|
||||
Sem novos originais:31exemplares preservados por hash. Conferidos visualmenteCIRPC Lei34/2007PDF17/p768(71),61(1),taxa geral32%;Lei20/2022PDF1/p2731,61(1)mantido e61(2)temporário;Lei12/2025PDF18/p2180(18),lista de alterações,ePDF20/p2180(20),61-A/vigência. A alteração61(2)daLei4/2012 já aceite é reutilizada. Índice primárioINM confirmaLei20/2022,artigos61/62,p2731. Não se transportam medidas expiradas,casos autónomos ou taxas de retenção para a colecta normal. Enquadramento do caso/ano é expresso;nenhum aprovador ou revalidação genérica criado. Sem pesquisa das pendênciasL5. Retenções/pagamentos/créditos anuais permanecemL8.
|
||||
|
||||
|
||||
## 27/10/2026 — L8: dedução PEC do próprio exercício
|
||||
|
||||
Sem novo original legal importado. Conferidos visualmente Lei34/2007PDF18/p768-(72),art66(1–2),eDecreto9/2008PDF6/p121,21(2/5),PDF7/p122,27/29;Lei34PDF19/art71 lido para delimitar obrigação separada. Lei4/2012,Lei19/2013 e acervo de alteraçõesLei12/2025 reutilizados;nenhuma alteração doart66 identificada nesses exemplares. Dedução corrente limitada à colecta,sem reembolso PEC;transporte/caducidade e obrigação separados.30PDFs presentes no arquivo source-archive iguais byte a byte a dc14f01e;recibo source-preservation.json.
|
||||
|
||||
Consulta primária dirigida identificou anúncio do Governo de alterações regulamentares2026: https://portaldogoverno.gov.mz/governo-introduz-alteracoes-nos-regulamentos-fiscais-para-reforcar-eficiencia-tributaria/ . O anúncio não fornece o articulado promulgado e contém referência editorial divergente à lei; não é tratado como nova regra. Retoma específica para obrigação/calendário: diploma publicado,artigos e vigência. Sem nova pesquisa genérica ou substituição das fontes aceites;art66 e cálculo simulado corrente permanecem no recorte explícito. Model39 oficialAT identificaPEC,mas não foi inferido transporte automáticoM20/M22: https://edeclaracao.at.gov.mz/formularios/irpc/view/formulario_irpc_m39.aspx .
|
||||
|
||||
|
||||
### 27/10/2026 — Reutilização executável: crédito internacional corrente em QA
|
||||
|
||||
CIRPC65(1–2), Lei34/2007, exemplarBR52, PDF18/p768-(72), e ordem face aoPEC em66/RIRPC21 já aceites: usados no menor entre imposto estrangeiro efectivamente pago, fracção nacional documentada e limiteCDT aplicável, antes doPEC e até à colecta. Conferência da página existente para aplicação da fonte, sem nova exigência de autenticação. Original preservado, sem activação por importação/publicação. Afracção nacional eCDT do caso continuam documentadas pelo utilizador; aQA não estabelece correspondências oficiais de convenções.65(3), transportes, créditos económicos/CBF e obrigaçãoPEC continuam separados. Ver recibo `irpc-l8-international-credit-qa-20261027.json`; não instalado.
|
||||
|
||||
|
||||
### 27/10/2026 — Crédito internacional entregue
|
||||
|
||||
A implementaçãoQA documentada acima foi instalada em`838ad941`,sem alterar fontes ou concederCDT automaticamente. CIRPC65(1–2)/66/RIRPC21 reutilizados no recorte demonstrado;65(3) e transportePEC continuam separados. Ver `irpc-l8-international-credit-delivery-20261027.json`.
|
||||
|
||||
|
||||
## 28/10/2026 — aplicação de65(3)/66 aos saldos anteriores
|
||||
|
||||
Reutilizados os31ficheiros do acervo, todos iguais por bytes a `cf4e0638`. Lei34/2007,BR52,PDF18/p768-(72),SHA256`cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e`: página conferida visualmente;65(3)cinco exercícios seguintes,66(1–2)três paraPEC,sem reembolso. Referência à regra/apuramento aplicáveis na origem é correspondência de período, não nova validação de autenticidade da fonte. Leitura remota do URL arquivado falhou por timeout; usado o exemplar oficial exacto já aceite. Nenhum original alterado,scan declarado ou novo cálculo activado por publicação. Recorte:origens anuais ordinárias documentadas,mesmo sujeito,fecho2026/MZN;sem situações transitórias/especiais presumidas. Recibo `irpc-l8-carry-qa-20261028.json`.
|
||||
|
||||
|
||||
## 28/10/2026 — crédito económico64 e distinção de40/65
|
||||
|
||||
Inventário anterior reutilizado:31ficheiros do acervo byte a byte iguais a6ededb59. Sem novo original. Lei34/2007BR52,SHA256`cdbef875ad7ccc1517b12faf5de0e893a70ed2ed81e33913cd6dc4a674474e6e`,PDF18/p768-(72),64(1–2),ePDF15/p768-(69),53(1)a,conferidos visualmente.40(1):Lei20/2009,exemplarAT19/2009,PDF4/p272-(16),redacção20%/dois anos e condições próprias,substitui a redacção original25%. Listas dasLeis4/2012 e19/2013 conferidas;cadeias20/2022 e12/2025 já aceites reutilizadas nos seus âmbitos. Decreto9/2008,RIRPC21(2/5),PDF6/p121:económico,internacional,benefícios,PEC,até à colecta,sem reembolso. Qualificação do caso,inclusão/acréscimo e quota proporcional documentados;sem automatizar a exclusão40 ou alterarL6por presunção. Sem nova exigência de autenticidade de fonte,scan ou publicação/importação. Pesquisa dirigida não substituiu os exemplares oficiais arquivados. Recibo:`irpc-l8-economic-qa-20261028.json`.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"date": "2026-10-28",
|
||||
"status": "QA_corrected_and_verified_not_installed",
|
||||
"installed_baseline": "6e8de43ae7fec29b0766d95e209a8cb8baf0d88c",
|
||||
"user_case": "Agronegócio / Maputo Província",
|
||||
"reproduction": {
|
||||
"QA_public_agribusiness": 37,
|
||||
"Maputo_corridor_public_opportunities": 5,
|
||||
"province_results_before": 0,
|
||||
"province_results_after": 5
|
||||
},
|
||||
"cause": "The provincial catalogue ignored the corridor context already approved by Tempo; no records were deleted.",
|
||||
"reused_decision": [
|
||||
"config/investment_corridors.php",
|
||||
"docs/investmoz/unification/corridor-adaptive-context-20261023.json"
|
||||
],
|
||||
"correction": [
|
||||
"Reuse approved corridor province context only at province level, with the accepted source hash and existing public publication decisions",
|
||||
"Do not override an explicit primary/additional territory or infer district/post/coordinates",
|
||||
"Display available province,district,administrative post,locality directly in results",
|
||||
"Show both approved Maputo units as contextual coverage, not as two separate opportunities",
|
||||
"Keep catalogue,API,corridor view and unlocated map list consistent",
|
||||
"One action returns from district to whole province; no requirement to select every level"
|
||||
],
|
||||
"QA": {
|
||||
"tests": 6,
|
||||
"assertions": 617,
|
||||
"failures": 0,
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"port": 55441,
|
||||
"transactions_rolled_back": true,
|
||||
"types": "passed",
|
||||
"build": "passed",
|
||||
"PHP_syntax": "passed"
|
||||
},
|
||||
"preserved": [
|
||||
"Installed menus and accepted supply proofs",
|
||||
"Originals,source data,territory IDs,publication states,permissions,private lists and histories",
|
||||
"L8 unchanged,partial"
|
||||
],
|
||||
"limitations": [
|
||||
"No active installation in this report",
|
||||
"Real authenticated visual conference remains pending;last connector error The browser access host is unavailable",
|
||||
"This fixes the shared investment catalogue and corridor view;it is not proof that every menu in the portal has been audited",
|
||||
"Provincial corridor coverage is not a documented district site;unknown levels stay unknown"
|
||||
],
|
||||
"existing_requirements": [
|
||||
"V2-07",
|
||||
"V2-10"
|
||||
],
|
||||
"restriction_origins": {
|
||||
"territorial_behaviour": "Tempo current request",
|
||||
"corridor_coverage": "Tempo express decision,23/10/2026",
|
||||
"no_new_publication_or_roles": "existing approved scope",
|
||||
"UI_summary_and_province_shortcut": "implementation choice"
|
||||
},
|
||||
"scope": "national;shared investment catalogue and similar location entry points",
|
||||
"national_verification": {
|
||||
"provincial_units": 11,
|
||||
"approved_corridors": 6,
|
||||
"sectors_for_descendant_fixtures": 2,
|
||||
"province_and_legacy_location_entry_points": true,
|
||||
"district_containment": true,
|
||||
"unrelated_provinces_excluded": true,
|
||||
"test_data": "synthetic fixtures rolled back;accepted published source reused"
|
||||
},
|
||||
"selector_delta": {
|
||||
"Tempo_request": "Dropdown belongs to Pesquisar província;remove separate Seleccione control",
|
||||
"scope": [
|
||||
"ProvinceSelect",
|
||||
"TerritoryLevel:province,district,administrative post,locality"
|
||||
],
|
||||
"behaviour": [
|
||||
"One combobox input opens the list and searches the existing endpoint",
|
||||
"Explicit choice commits the existing option;typing or Escape does not clear saved values",
|
||||
"Arrow keys and Enter select;clear is explicit;dependent levels remain disabled without parent",
|
||||
"Paging retained inside dropdown;loading cannot commit a stale option"
|
||||
],
|
||||
"QA": {
|
||||
"event_state_contract_tests": 4,
|
||||
"failures": 0,
|
||||
"types": "passed",
|
||||
"build": "passed",
|
||||
"limit": "Controlled React component contract;not browser visual/session evidence"
|
||||
},
|
||||
"publication_data_permissions_and_territory_rules": "unchanged",
|
||||
"national_province_evidence": "6 tests/617 assertions reused;unchanged PHP runtime",
|
||||
"status": "QA_not_installed"
|
||||
},
|
||||
"catalogue_result_presentation": {
|
||||
"Tempo_request": "Province+sector must show matching opportunities,not educational text and unfiltered national sector shortcuts",
|
||||
"public_read_snapshot": {
|
||||
"filtered": {
|
||||
"total": 0,
|
||||
"province": "Cabo Delgado",
|
||||
"sector": "turismo",
|
||||
"province_id": "059b02ca-7095-577a-8705-4d4c46896747"
|
||||
},
|
||||
"active_writes": 0,
|
||||
"sector_only": {
|
||||
"total": 16,
|
||||
"declared_provinces": [
|
||||
"Inhambane"
|
||||
],
|
||||
"sector": "turismo"
|
||||
},
|
||||
"method": "anonymous public API read; no authenticated session claimed",
|
||||
"meaning": "public catalogue snapshot;not evidence of absence of market supply",
|
||||
"checked_at": "2026-10-28T19:03:36.8285860Z",
|
||||
"target": "https://teste-investidor.tempo.co.mz/"
|
||||
},
|
||||
"UI_changes": [
|
||||
"Heading identifies applied sector and territorial path",
|
||||
"Educational cards and their broad sector opportunity button removed from catalogue results",
|
||||
"Guide titles remain available only inside closed optional support details",
|
||||
"Removing location is explicitly labelled as searching other provinces",
|
||||
"Empty state is limited to published records in the consulted catalogue;not absence of market supply"
|
||||
],
|
||||
"QA": {
|
||||
"new_component_SSR_tests": 2,
|
||||
"failures": 0,
|
||||
"types": "passed",
|
||||
"build": "passed",
|
||||
"accepted_national_and_selector_proofs": "reused;backend and selector unchanged"
|
||||
},
|
||||
"status": "QA_not_installed",
|
||||
"authenticated_visual_validation": "pending;public API read does not prove real session behaviour",
|
||||
"active_writes": 0,
|
||||
"new_publications": 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
{
|
||||
"date": "2026-10-28",
|
||||
"status": "not_demonstrated",
|
||||
"audited_use": "companies,hotels and restaurants lists as private supply-comparison basis inside proactive journey",
|
||||
"Tempo_decision": "know existing supply by location/sector/activity;compare ideas for competition,complementarity and possible partners;identify evidenced needs and prepare opportunities;no absence-of-offer inference from absent records;no automatic public directory",
|
||||
"installed_runtime": "569a1cd750f3d2a0b87f130e992e73e070bbd1ab",
|
||||
"scope": {
|
||||
"destination": "teste-investidor.tempo.co.mz",
|
||||
"database": "teste_investidor",
|
||||
"catalogue_tables": 198,
|
||||
"schemas": {
|
||||
"public": 174,
|
||||
"skills_edu": 24
|
||||
},
|
||||
"identity": "postgres owner,read-only transactions;technical metadata inventory,not an authenticated team UI proof",
|
||||
"read_only": true,
|
||||
"RLS_note": "No permissions changed or RLS bypassed for a team operation. Owner inventory is explicitly separated from application/user visibility. Differences from earlier investemoz/QA environments are not declared deletion/loss.",
|
||||
"source_matching_limit": "plaintext metadata/reference matches only; absence does not establish missing encrypted or external records or absence of real market supply"
|
||||
},
|
||||
"source_inventory": {
|
||||
"accessible_files_in_two_source_roots": 13,
|
||||
"all_inventoried_before_selection": true,
|
||||
"known_originals": [
|
||||
{
|
||||
"alias": "companies.xlsx",
|
||||
"file_name": "EMPRESAS_LIST 2014-2022.xlsx",
|
||||
"sha256": "1ba4c4114b16b407e7746712d00d4f681246bbbc1b42351e96a31f7129acad30",
|
||||
"bytes": 26586267,
|
||||
"unchanged": true,
|
||||
"sheet_names": [
|
||||
"EMPRESAS 2014-2022"
|
||||
],
|
||||
"prior_nonempty_XML_rows": 148557,
|
||||
"row_count_is_not_unique_business_count": true,
|
||||
"period": "2014–2022 stated in file name"
|
||||
},
|
||||
{
|
||||
"alias": "licensed.xlsx",
|
||||
"file_name": "Empresas Licenciadas.xlsx",
|
||||
"sha256": "1b5087b464e39e88c42def39655c2391aaaf684b4c832d6a77ff274b98889f00",
|
||||
"bytes": 34940776,
|
||||
"unchanged": true,
|
||||
"sheet_names": [
|
||||
"EMPRESAS"
|
||||
],
|
||||
"prior_nonempty_XML_rows": 212632,
|
||||
"row_count_is_not_unique_business_count": true,
|
||||
"period": "varies by record;reference date not inferred from file modification time"
|
||||
},
|
||||
{
|
||||
"alias": "tourism.xlsx",
|
||||
"file_name": "CADASTRO DE EMPREENDIMENTOS TURISTICOS 3, 4 E 5 ESTRELAS 30.10.24 18,00h.xlsx",
|
||||
"sha256": "f02e086ed4973ef17234aa6cc54b98fbb7a6952ffb16ec4dc4f7d0c72af6400c",
|
||||
"bytes": 73955,
|
||||
"unchanged": true,
|
||||
"sheet_names": [
|
||||
"1. Alojamento",
|
||||
"Folha1"
|
||||
],
|
||||
"prior_nonempty_XML_rows": 460,
|
||||
"row_count_is_not_unique_business_count": true,
|
||||
"period": "30/10/2024 stated in file name;current operating status unconfirmed"
|
||||
},
|
||||
{
|
||||
"alias": "cae.xlsx",
|
||||
"file_name": "CAE eBAU.xlsx",
|
||||
"sha256": "83b4f1200988e99834c2ae3915346fbf237d128308554b67b5a080d4956bf506",
|
||||
"bytes": 75018,
|
||||
"unchanged": true,
|
||||
"sheet_names": [
|
||||
"CAE"
|
||||
],
|
||||
"prior_nonempty_XML_rows": null,
|
||||
"row_count_is_not_unique_business_count": true,
|
||||
"period": "code labels supplied;version/application require source correspondence"
|
||||
}
|
||||
],
|
||||
"duplicates_detected_by_bytes": [],
|
||||
"private_fields_exported": false,
|
||||
"tourism_scope": "workbook labelled accommodation;not treated as an exhaustive restaurant or hotel market census",
|
||||
"restaurant_scope": "separate restaurant dataset not identified in these two source roots;restaurant activities may exist within company registers;not a finding of absence in the market"
|
||||
},
|
||||
"findings": {
|
||||
"originals_available_and_unchanged": true,
|
||||
"loading_into_portal": "not demonstrated in audited destination;no exact known source hash matches among368persistent files;no exact known source references in audited metadata",
|
||||
"normalisation_and_classification": "source company workbooks have province/district/CAE and a supplied CAE code table;mapping of their entities to portal location/sector/activity not demonstrated",
|
||||
"journey_linkage": "not demonstrated;installed ProactiveInvestment.options only returns document links/groups/project-cluster-corridor-park-chain references;no list-backed offer query or company/hotel/restaurant relation consumer in that method",
|
||||
"manual_evidence_path": "already delivered;acceptance preserved. Manual source/locator/period/coverage/observed_supply fields do not establish imported source records or catalogue-backed comparison.",
|
||||
"active_counts_context_only": {
|
||||
"existing_businesses": 0,
|
||||
"organizations": 1,
|
||||
"documents": 60,
|
||||
"economic_activities": 11,
|
||||
"portal_resources": 59
|
||||
},
|
||||
"no_market_absence_inference": true,
|
||||
"no_loss_claim": true
|
||||
},
|
||||
"demonstration_attempt": {
|
||||
"kind": "read-only trace and canonical-location check,not a browser or team end-to-end proof",
|
||||
"location": {
|
||||
"name": "Gurué",
|
||||
"id": "87a8ba3d-b152-560c-a566-7db4531ad536",
|
||||
"type": "district"
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"step": 1,
|
||||
"action": "choose location",
|
||||
"observed": "canonical Gurué district exists;previous location-selection path acceptance reused;no new manual UI proof claimed",
|
||||
"status": "location_reference_available"
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"action": "consult existing supply from these lists",
|
||||
"observed": "no wired list-backed offer consumer or demonstrated imported/classified enterprise records for this location",
|
||||
"status": "not_demonstrated",
|
||||
"blocks_remaining_demo": true
|
||||
},
|
||||
{
|
||||
"step": 3,
|
||||
"action": "compare with an idea for competitors/complements/partners",
|
||||
"observed": "manual analysis fields exist;no reproducible offer-result set/source-row linkage demonstrated",
|
||||
"status": "not_demonstrated"
|
||||
},
|
||||
{
|
||||
"step": 4,
|
||||
"action": "identify a need with dates and uncertainties",
|
||||
"observed": "cannot infer unmet need from missing catalogue records;hypothesis and unknown coverage remain explicit",
|
||||
"status": "not_demonstrated_for_this_list_backed_flow"
|
||||
},
|
||||
{
|
||||
"step": 5,
|
||||
"action": "prepare opportunity retaining sources/period/coverage/uncertainty",
|
||||
"observed": "existing private preparation mechanism preserved;no new opportunity created to simulate completion of missing steps2–4",
|
||||
"status": "not_demonstrated_for_this_list_backed_flow"
|
||||
}
|
||||
],
|
||||
"end_to_end_criterion_passed": false
|
||||
},
|
||||
"preservation": {
|
||||
"proactive_delivery_preserved": true,
|
||||
"previous_manual_real_source_QA_pilots_preserved": true,
|
||||
"Songo_Gurue": "existing private QA hypotheses unchanged;their manual spreadsheet reading does not establish list integration",
|
||||
"L8_delivery_569a1cd7": "unchanged,remains partial",
|
||||
"application_code_changes": 0,
|
||||
"new_tests": 0,
|
||||
"new_imports_or_normalisation": 0,
|
||||
"new_opportunities": 0,
|
||||
"new_publication": 0,
|
||||
"active_writes": 0,
|
||||
"new_roles_or_grants": 0,
|
||||
"no_new_matrix_or_backlog": true
|
||||
},
|
||||
"next_concrete_work": "Establish traceable private source batches/rows and mappings using existing data/inventory mechanisms;expose authorised location-sector-activity supply query in existing proactive editor;link selected supply records and source coverage to comparison/need/opportunity,then demonstrate save/recover end-to-end in isolated QA. Do not publish a directory or treat unknown coverage as zero supply. Analytical supply records must not require a user organisation,a business-for-sale listing,a real promoter or a confirmed commercial commitment just to be consulted internally.",
|
||||
"matrix_ids": [
|
||||
"RF-CLU-003",
|
||||
"MASTER-471012ab-0010",
|
||||
"M2-d0c06a75-0147",
|
||||
"M2-d0c06a75-0151",
|
||||
"MASTER-1f0a4cde-0002"
|
||||
],
|
||||
"evidence": {
|
||||
"active_source_code_verified": [
|
||||
{
|
||||
"file": "app/Services/ProactiveInvestment.php",
|
||||
"sha256": "957dc455f0153d615577fe182b51969e6d253b33e24ac78547fcccd06215a51c",
|
||||
"installed_matches_Git": true
|
||||
},
|
||||
{
|
||||
"file": "app/Services/OpportunityManagement.php",
|
||||
"sha256": "ebe5535d94ad3c7d607bd70f2ff5dce75d810ab26924ac55ac08f036fd5eee33",
|
||||
"installed_matches_Git": true
|
||||
},
|
||||
{
|
||||
"file": "resources/js/components/proactive-investment.tsx",
|
||||
"sha256": "9c6acadef8d29732efcfcc4bcdfb28ce3be4f19127a626c1e85c6df98fd91ecf",
|
||||
"installed_matches_Git": true
|
||||
},
|
||||
{
|
||||
"file": "app/Services/InvestorContext.php",
|
||||
"sha256": "54be88361214d896640c808d8fe29f93c552a69870d6bb3ecce4de458a51ed48",
|
||||
"installed_matches_Git": true
|
||||
},
|
||||
{
|
||||
"file": "routes/web.php",
|
||||
"sha256": "95930c76977d446b74a422acc4b60869ff6bae5d4567c21cc644484c5f09cbda",
|
||||
"installed_matches_Git": true
|
||||
}
|
||||
],
|
||||
"local_artifacts": {
|
||||
"accessible-source-inventory.json": "2815b778b0a4d1d601fd85c46c9b5c3a19bd7adcdb46cf86f0f28f45717b2afa",
|
||||
"accepted-source-check.json": "06b814ee4e322fb78f081788b061936a324b3edcf6d56a80a82eeabdf2906ec6",
|
||||
"active-audit.json": "06e3cfba8c180e93a86a9dc5db86403220e7c5406229ef166b4e604cc2d8e71c",
|
||||
"consumer-trace.json": "df1fa6fa8dc3c18485b6e83a4f6a688f2d5a2124e9a8f5c75a944ec859e420f3"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
{
|
||||
"status": "installed_delta_verified_authenticated_visual_conference_pending",
|
||||
"candidate": "332c16ebb555e8d6b244fa519bc777d89c1a8b8f",
|
||||
"expected_installed": "789fffd098fa222c85e1283de07f23ee6f42bd04",
|
||||
"target": "https://teste-investidor.tempo.co.mz/",
|
||||
"coverage": {
|
||||
"IVA": "27 manually editable Modelo A fields; source correspondence reused",
|
||||
"IRPC": "24 manually editable M22 fields from Q10/Q11 general regime/Q12; partial preparation",
|
||||
"flow": [
|
||||
"identification and period",
|
||||
"amounts",
|
||||
"review",
|
||||
"download private recovery file",
|
||||
"explicit recovery confirmation",
|
||||
"print"
|
||||
],
|
||||
"entry": "Documentos e Formulários → IVA or IRPC"
|
||||
},
|
||||
"limits": [
|
||||
"No automatic calculations or eligibility validation",
|
||||
"No AT submission or signature",
|
||||
"No server persistence or automatic dossier link",
|
||||
"Remaining M22 adjustments, other regimes and annexes not covered",
|
||||
"Manual credit entries require parcel conference; existing calculation engines unchanged",
|
||||
"L8 remains partial",
|
||||
"Authenticated visual browser validation not demonstrated"
|
||||
],
|
||||
"preserved": [
|
||||
"installed 789fffd0 features",
|
||||
"accepted Modelo A and M20/M22 proofs",
|
||||
"L8 accepted increments",
|
||||
"all originals, data, roles and internal supply base; no active writes"
|
||||
],
|
||||
"QA": {
|
||||
"frontend_tests": 5,
|
||||
"feature_tests": 1,
|
||||
"feature_assertions": 20,
|
||||
"isolated_database": "proactive_investment_20261027_test",
|
||||
"port": 55441,
|
||||
"types": "passed",
|
||||
"build": "passed",
|
||||
"PHP_syntax": "passed",
|
||||
"diff_check": "passed",
|
||||
"source_visual_check": "M22 three existing page renders inspected; accepted IVA mapping reused"
|
||||
},
|
||||
"schema_changes": false,
|
||||
"role_changes": false,
|
||||
"new_publications": false,
|
||||
"active_changes": "332c16eb installed through normal main Git pipeline",
|
||||
"main_ancestor_verified": true,
|
||||
"delivery_next_steps": [
|
||||
"Authenticated visual conference of filling, review, download and recovery"
|
||||
],
|
||||
"source_code_sha256": {
|
||||
"resources\\js\\pages\\portal\\fiscal-forms.tsx": "d27d16b174f6a9784b2ad0a2f6e46563d75192ebe4064d700b0df59e953317e0",
|
||||
"resources\\js\\lib\\fiscal-form-preparation.ts": "776a563b4ebc1ddc6ceb14e2e8b1e6c9542e8cc9c17053811f6381d83bf8b3ec",
|
||||
"routes\\web.php": "a25b4dccbf64b123117573ea31b83cfcc1ee642db9b0f95ed2f77387696879d9"
|
||||
},
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-fiscal-forms-delivery-20261028/backup",
|
||||
"created_at": "2026-10-28T20:07:20Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 176,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "341662f3c8f6e6c7b42d18aa468f3270d9d6a08bb908b7f52cbb1e132e5bd976",
|
||||
"files_sha256": "c6b242850118003792b420f1e2706633489dc874bef664b2245dfbd5dbb50430",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 176,
|
||||
"container_network": "none",
|
||||
"database": "fiscal_forms_delivery_20261028_test",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "341662f3c8f6e6c7b42d18aa468f3270d9d6a08bb908b7f52cbb1e132e5bd976",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"preservation": {
|
||||
"navigation_asset_and_shared_props_verified": true,
|
||||
"at": "2026-10-28T20:13:13.258269+00:00",
|
||||
"served_commit": "332c16ebb555e8d6b244fa519bc777d89c1a8b8f",
|
||||
"backup_dump_sha256": "341662f3c8f6e6c7b42d18aa468f3270d9d6a08bb908b7f52cbb1e132e5bd976",
|
||||
"prior_public_tables_checked": 176,
|
||||
"prior_domain_rows_preserved": true,
|
||||
"new_migration_registry_rows": 0,
|
||||
"operational_delta": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 119,
|
||||
"checksum": "c98548e1038986975b95a959d469b828"
|
||||
},
|
||||
"after": {
|
||||
"rows": 119,
|
||||
"checksum": "5375b8b28b8af40c8c3ffc891975d6d5"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 25,
|
||||
"checksum": "bcf0421fabf8473d5862941ec18e96af"
|
||||
},
|
||||
"after": {
|
||||
"rows": 28,
|
||||
"checksum": "78066be68c90956a3ac31a90bbeba676"
|
||||
}
|
||||
}
|
||||
},
|
||||
"persistent_files_and_configuration_identical": 369,
|
||||
"private_catalogue": {
|
||||
"observations": 361464,
|
||||
"distinct_administrative_observations": 214299,
|
||||
"preserved_repetitions": 147165,
|
||||
"unmapped_territory": 205608
|
||||
},
|
||||
"preservation_identity": "postgres, matching backup reader; no actor impersonation",
|
||||
"anonymous_query_status": 401,
|
||||
"public_revision_confirmed": true,
|
||||
"actual_team_UI_journey": "pending authenticated browser conference;accepted QA is not repeated",
|
||||
"unique_company_count": null,
|
||||
"publication": false,
|
||||
"national_coverage": "partial",
|
||||
"investment_conclusion": "hypothesis,not proved demand or viability",
|
||||
"L8": "unchanged,partial"
|
||||
},
|
||||
"public_delta": {
|
||||
"at_UTC": "2026-10-28T20:13:02.411009+00:00",
|
||||
"candidate": "332c16ebb555e8d6b244fa519bc777d89c1a8b8f",
|
||||
"public_pages": [
|
||||
{
|
||||
"tax": "iva",
|
||||
"HTTP": 200,
|
||||
"component": "portal/fiscal-forms",
|
||||
"requested_form": "iva"
|
||||
},
|
||||
{
|
||||
"tax": "irpc",
|
||||
"HTTP": 200,
|
||||
"component": "portal/fiscal-forms",
|
||||
"requested_form": "irpc"
|
||||
}
|
||||
],
|
||||
"assets": {
|
||||
"fiscal-forms": {
|
||||
"asset": "assets/fiscal-forms-CQflZEeP.js",
|
||||
"sha256": "f559122ea47ac15d061ed4b2e008beeb0e9815626afd50315bd465ea6109bde0",
|
||||
"expected_labels": 4
|
||||
},
|
||||
"services": {
|
||||
"asset": "assets/services-DOFOHuLj.js",
|
||||
"sha256": "4a9de7c6dd6d1d48adf55e47b6dd8561af2a53163f63eb14b0f8d9d135fd66d7",
|
||||
"expected_labels": 2
|
||||
}
|
||||
},
|
||||
"authenticated_visual_conference": "pending; connector availability not established",
|
||||
"AT_submission": false,
|
||||
"server_draft_persistence": false,
|
||||
"L8": "partial"
|
||||
},
|
||||
"pipeline": {
|
||||
"reports": [
|
||||
{
|
||||
"status": "already_installed",
|
||||
"commit": "332c16ebb555e8d6b244fa519bc777d89c1a8b8f",
|
||||
"requested_commits": [
|
||||
"332c16ebb555e8d6b244fa519bc777d89c1a8b8f"
|
||||
],
|
||||
"finished_at": "2026-10-28T20:12:04.008171+00:00"
|
||||
},
|
||||
{
|
||||
"status": "installed",
|
||||
"commit": "332c16ebb555e8d6b244fa519bc777d89c1a8b8f",
|
||||
"release": "/var/www/investmoz-homologacao/releases/332c16ebb555e8d6b244fa519bc777d89c1a8b8f-f0dfc218",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/789fffd098fa222c85e1283de07f23ee6f42bd04-29ab1f0d",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"332c16ebb555e8d6b244fa519bc777d89c1a8b8f"
|
||||
],
|
||||
"finished_at": "2026-10-28T20:12:02.675406+00:00"
|
||||
}
|
||||
],
|
||||
"build_logs": [
|
||||
{
|
||||
"file": "/var/lib/investmoz-deploy/logs/1793218102227589181.log",
|
||||
"sha256": "670358412945027ec26a2c7e2129a06b0af164aac26990db5d73c9aeb5ba9b6c",
|
||||
"summaries": [
|
||||
"\u001b[30;42mOK (1 test, 3106 assertions)\u001b[0m",
|
||||
"✓ built in 32.91s",
|
||||
"\u001b[30;42mOK (59 tests, 320 assertions)\u001b[0m",
|
||||
"# tests 1176",
|
||||
"# pass 1176",
|
||||
"# fail 0"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"delivery_completed": [
|
||||
"SSH authentication",
|
||||
"capacity and baseline guard",
|
||||
"fresh backup",
|
||||
"isolated restore",
|
||||
"normal Git main delivery",
|
||||
"existing pipeline: 1176 frontend tests passed",
|
||||
"public route/assets delta",
|
||||
"176 table preservation comparison and 369 identical files/configuration"
|
||||
],
|
||||
"verification_notes": [
|
||||
"Initial X-Inertia probe without matching asset version received protocol HTTP409. Normal initial page requests returned200; initial public page payload and installed assets verified. Failed probe receipt retained; no application change needed."
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"status": "QA_passed_not_installed_SSH_authentication_required",
|
||||
"candidate": "332c16ebb555e8d6b244fa519bc777d89c1a8b8f",
|
||||
"expected_installed": "789fffd098fa222c85e1283de07f23ee6f42bd04",
|
||||
"target": "https://teste-investidor.tempo.co.mz/",
|
||||
"coverage": {
|
||||
"IVA": "27 manually editable Modelo A fields; source correspondence reused",
|
||||
"IRPC": "24 manually editable M22 fields from Q10/Q11 general regime/Q12; partial preparation",
|
||||
"flow": [
|
||||
"identification and period",
|
||||
"amounts",
|
||||
"review",
|
||||
"download private recovery file",
|
||||
"explicit recovery confirmation",
|
||||
"print"
|
||||
],
|
||||
"entry": "Documentos e Formulários → IVA or IRPC"
|
||||
},
|
||||
"limits": [
|
||||
"No automatic calculations or eligibility validation",
|
||||
"No AT submission or signature",
|
||||
"No server persistence or automatic dossier link",
|
||||
"Remaining M22 adjustments, other regimes and annexes not covered",
|
||||
"Manual credit entries require parcel conference; existing calculation engines unchanged",
|
||||
"L8 remains partial",
|
||||
"Authenticated visual browser validation not demonstrated"
|
||||
],
|
||||
"preserved": [
|
||||
"installed 789fffd0 features",
|
||||
"accepted Modelo A and M20/M22 proofs",
|
||||
"L8 accepted increments",
|
||||
"all originals, data, roles and internal supply base; no active writes"
|
||||
],
|
||||
"QA": {
|
||||
"frontend_tests": 5,
|
||||
"feature_tests": 1,
|
||||
"feature_assertions": 20,
|
||||
"isolated_database": "proactive_investment_20261027_test",
|
||||
"port": 55441,
|
||||
"types": "passed",
|
||||
"build": "passed",
|
||||
"PHP_syntax": "passed",
|
||||
"diff_check": "passed",
|
||||
"source_visual_check": "M22 three existing page renders inspected; accepted IVA mapping reused"
|
||||
},
|
||||
"schema_changes": false,
|
||||
"role_changes": false,
|
||||
"new_publications": false,
|
||||
"active_changes": false,
|
||||
"main_ancestor_verified": true,
|
||||
"delivery_next_steps": [
|
||||
"authenticate SSH using existing strict host-key bridge",
|
||||
"recheck installed baseline, capacity and schema contract",
|
||||
"fresh backup and isolated restoration",
|
||||
"normal Git main delivery and existing guarded pipeline",
|
||||
"installed route/assets verification and full preservation delta"
|
||||
],
|
||||
"source_code_sha256": {
|
||||
"resources\\js\\pages\\portal\\fiscal-forms.tsx": "d27d16b174f6a9784b2ad0a2f6e46563d75192ebe4064d700b0df59e953317e0",
|
||||
"resources\\js\\lib\\fiscal-form-preparation.ts": "776a563b4ebc1ddc6ceb14e2e8b1e6c9542e8cc9c17053811f6381d83bf8b3ec",
|
||||
"routes\\web.php": "a25b4dccbf64b123117573ea31b83cfcc1ee642db9b0f95ed2f77387696879d9"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
{
|
||||
"date": "2026-10-28",
|
||||
"status": "installed_delta_verified_authenticated_visual_conference_pending",
|
||||
"served_commit": "789fffd098fa222c85e1283de07f23ee6f42bd04",
|
||||
"previous_runtime": "6e8de43ae7fec29b0766d95e209a8cb8baf0d88c",
|
||||
"target": "https://teste-investidor.tempo.co.mz/",
|
||||
"normal_Git_fast_forward": true,
|
||||
"force_used": false,
|
||||
"existing_pipeline_unchanged": true,
|
||||
"scope": [
|
||||
"National provincial catalogue/corridor coverage and territorial summaries",
|
||||
"One searchable territory control at all four levels",
|
||||
"Filtered catalogue results separate from optional educational support",
|
||||
"Adaptive opportunity preparation groups and save-before-resource navigation",
|
||||
"Readable promoter request with explicit searchable proof selection",
|
||||
"Immediate scoped zone search,total counts and complete pagination",
|
||||
"My investments next action and expandable stages/source details",
|
||||
"Direct entries to existing fillable investment/Terra-DUAT preparation;support form separately labelled",
|
||||
"Sector registration CTA uses effective account creation capability;no new permissions",
|
||||
"Readable known document topic/category/language labels"
|
||||
],
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-catalogue-territory-delivery-20261028/backup",
|
||||
"created_at": "2026-10-28T19:25:43Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 176,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "597f73cda14dd47be440136f2e2242d8d7a4e4f3d5d69cabcd44f8fde58c136d",
|
||||
"files_sha256": "7fb639d8351e34ce220c5424c722c223512d139c82b7ff0a1a447136c62041ef",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 176,
|
||||
"container_network": "none",
|
||||
"database": "catalogue_territory_delivery_20261028_test",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "597f73cda14dd47be440136f2e2242d8d7a4e4f3d5d69cabcd44f8fde58c136d",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"failed_candidate_preserved": {
|
||||
"commit": "502e3ec4",
|
||||
"reason": "Corridor explorer Unit mock missing the new public location presentation;unnecessary non-source relation read",
|
||||
"active_runtime_preserved": true,
|
||||
"resolution": "Short-circuit irrelevant source before relation access;represent new dependency and retain old assertions;Unit1/13 passed"
|
||||
},
|
||||
"pipeline": {
|
||||
"reports": [
|
||||
{
|
||||
"status": "already_installed",
|
||||
"commit": "789fffd098fa222c85e1283de07f23ee6f42bd04",
|
||||
"requested_commits": [
|
||||
"789fffd098fa222c85e1283de07f23ee6f42bd04"
|
||||
],
|
||||
"finished_at": "2026-10-28T19:39:46.948539+00:00"
|
||||
},
|
||||
{
|
||||
"status": "installed",
|
||||
"commit": "789fffd098fa222c85e1283de07f23ee6f42bd04",
|
||||
"release": "/var/www/investmoz-homologacao/releases/789fffd098fa222c85e1283de07f23ee6f42bd04-29ab1f0d",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6e8de43ae7fec29b0766d95e209a8cb8baf0d88c-877dabd3",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"789fffd098fa222c85e1283de07f23ee6f42bd04"
|
||||
],
|
||||
"finished_at": "2026-10-28T19:39:45.796038+00:00"
|
||||
}
|
||||
],
|
||||
"build_logs": [
|
||||
{
|
||||
"file": "/var/lib/investmoz-deploy/logs/1793216167091522421.log",
|
||||
"sha256": "af1c3db072b2b354cfef13538a8cb69d07a37ec4b1ddef63d8d68e77ab5d7196",
|
||||
"summaries": [
|
||||
"\u001b[30;42mOK (1 test, 3106 assertions)\u001b[0m",
|
||||
"✓ built in 32.16s",
|
||||
"\u001b[30;42mOK (59 tests, 320 assertions)\u001b[0m",
|
||||
"# tests 1171",
|
||||
"# pass 1171",
|
||||
"# fail 0"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"installed_preservation_delta": {
|
||||
"navigation_asset_and_shared_props_verified": true,
|
||||
"at": "2026-10-28T19:40:32.494557+00:00",
|
||||
"served_commit": "789fffd098fa222c85e1283de07f23ee6f42bd04",
|
||||
"backup_dump_sha256": "597f73cda14dd47be440136f2e2242d8d7a4e4f3d5d69cabcd44f8fde58c136d",
|
||||
"prior_public_tables_checked": 176,
|
||||
"prior_domain_rows_preserved": true,
|
||||
"new_migration_registry_rows": 0,
|
||||
"operational_delta": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 111,
|
||||
"checksum": "1912b955cff09094395336c2137d5ce5"
|
||||
},
|
||||
"after": {
|
||||
"rows": 111,
|
||||
"checksum": "c158d3e941f896ca3997dfe02850d427"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 9,
|
||||
"checksum": "870b1c20d207a9db376633fc5514a3ed"
|
||||
},
|
||||
"after": {
|
||||
"rows": 8,
|
||||
"checksum": "f7737eac7d85ed501fb339d7faabbd8e"
|
||||
}
|
||||
}
|
||||
},
|
||||
"persistent_files_and_configuration_identical": 369,
|
||||
"private_catalogue": {
|
||||
"observations": 361464,
|
||||
"distinct_administrative_observations": 214299,
|
||||
"preserved_repetitions": 147165,
|
||||
"unmapped_territory": 205608
|
||||
},
|
||||
"RLS_without_actor_rows": 0,
|
||||
"anonymous_query_status": 401,
|
||||
"public_revision_confirmed": true,
|
||||
"actual_team_UI_journey": "pending authenticated browser conference;accepted QA is not repeated",
|
||||
"unique_company_count": null,
|
||||
"publication": false,
|
||||
"national_coverage": "partial",
|
||||
"investment_conclusion": "hypothesis,not proved demand or viability",
|
||||
"L8": "unchanged,partial"
|
||||
},
|
||||
"public_installed_delta": {
|
||||
"served_commit": "789fffd098fa222c85e1283de07f23ee6f42bd04",
|
||||
"public_Maputo_agribusiness_total": 5,
|
||||
"public_Tourism_Cabo_Delgado_total": 0,
|
||||
"Cabo_Delgado_zones_total": 2,
|
||||
"all_zones_total": 8,
|
||||
"all_zones_pages": 1,
|
||||
"filtered_scope_and_sector_confirmed": true,
|
||||
"installed_UI_assets_verified": [
|
||||
"Preencher formulários e preparar documentos",
|
||||
"Pesquisar nos meus ficheiros",
|
||||
"O meu acesso e administração",
|
||||
"Consultar situação, documentos e fundamentos"
|
||||
],
|
||||
"public_Tourism_HTTP": 200,
|
||||
"guest_Tourism_registration_action": "/perfil/promotor",
|
||||
"guest_Tourism_registration_label": "Pedir acesso para cadastrar oportunidades",
|
||||
"real_authenticated_Tourism_case": "pending;anonymous200 is not the real session",
|
||||
"pipeline_reports": [
|
||||
{
|
||||
"status": "already_installed",
|
||||
"commit": "789fffd098fa222c85e1283de07f23ee6f42bd04",
|
||||
"requested_commits": [
|
||||
"789fffd098fa222c85e1283de07f23ee6f42bd04"
|
||||
],
|
||||
"finished_at": "2026-10-28T19:39:46.948539+00:00"
|
||||
},
|
||||
{
|
||||
"status": "installed",
|
||||
"commit": "789fffd098fa222c85e1283de07f23ee6f42bd04",
|
||||
"release": "/var/www/investmoz-homologacao/releases/789fffd098fa222c85e1283de07f23ee6f42bd04-29ab1f0d",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6e8de43ae7fec29b0766d95e209a8cb8baf0d88c-877dabd3",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"789fffd098fa222c85e1283de07f23ee6f42bd04"
|
||||
],
|
||||
"finished_at": "2026-10-28T19:39:45.796038+00:00"
|
||||
}
|
||||
],
|
||||
"no_schema_or_publication_changes": true,
|
||||
"source_files_preserved": true
|
||||
},
|
||||
"accepted_QA_reused": {
|
||||
"national_tests": 6,
|
||||
"national_assertions": 617,
|
||||
"selector_tests": 4,
|
||||
"guide_tests": 2,
|
||||
"usability_frontend_tests": 9,
|
||||
"usability_feature_tests": 3,
|
||||
"usability_feature_assertions": 14,
|
||||
"unit_regression_tests": 1,
|
||||
"unit_regression_assertions": 13,
|
||||
"types_build_PHP": "passed"
|
||||
},
|
||||
"remaining": [
|
||||
"Actual authenticated visual conference of responsive menus,free filling navigation,saved resource round-trip and Gurué same-dossier journey",
|
||||
"Tempo clarified Tourism denial followed a button;exact original button unavailable. Concrete creation CTA mismatch corrected and tested;real session still needs confirmation",
|
||||
"Clarify the particular official fiscal form sought;investment preparation adaptations are not a complete implementation of all IVA/IRPC official forms"
|
||||
],
|
||||
"preserved": {
|
||||
"old_release": "retained for existing rollback mechanism",
|
||||
"domain_data_permissions_publications": "unchanged",
|
||||
"persistent_files_and_configuration": 369,
|
||||
"private_supply_observations": 361464,
|
||||
"Gurue_observations": 435,
|
||||
"counts_are_not_unique_companies": true,
|
||||
"lists": "internal",
|
||||
"national_coverage": "partial",
|
||||
"investment_comparison": "hypothesis,not demand or viability proof",
|
||||
"L8": "partial,unchanged"
|
||||
},
|
||||
"proof_limits": "HTTP/API/asset checks do not prove the authenticated UI;prior QA/manual reports remain historical candidate evidence,not installation state",
|
||||
"source_QA_reports": [
|
||||
"catalogue-province-coverage-qa-20261028.json",
|
||||
"investor-usability-qa-20261028.json"
|
||||
],
|
||||
"authorisation": "Tempo requested corrections,authorised normal delivery,and authenticated the existing SSH mechanism;no repeated organisational approval required"
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"date": "2026-10-28",
|
||||
"status": "QA_implemented_and_delta_verified_not_installed",
|
||||
"runtime_baseline": "6e8de43ae7fec29b0766d95e209a8cb8baf0d88c",
|
||||
"prepared_catalogue_parent": "54d1b2a5",
|
||||
"Tempo_requests": [
|
||||
"Readable investor work menu and adaptive filling flow",
|
||||
"ZEE/ZFI/park results must match explicit territory selection;all means the available set",
|
||||
"Promoter request must use readable representation/modality labels and usable evidence selection",
|
||||
"Investigate authenticated denial of public Tourism sector",
|
||||
"Simplify My investments and present useful next actions",
|
||||
"Expose fillable forms rather than a guide or legislative catalogue"
|
||||
],
|
||||
"implemented": {
|
||||
"work_menu": "Investor actions remain primary;existing access/audit/profile setup destinations move into optional administration details;no permission change",
|
||||
"filling": "Schema fields grouped adaptively by task;free navigation,all fields stay mounted,unknown future keys retained;server missing paths and errors point to groups;not mandatory sequential forms",
|
||||
"preservation": "Deliberate values retained between groups;save uses existing endpoints and ETags;resource navigation saves first and returns to the same opportunity/group;only unique promoter context is auto-selected",
|
||||
"profile_request": "Portuguese visible representation/modality labels;owned clean-file criteria unchanged;file search and explicit selected proofs replace the unbounded list;availability does not prove evidentiary suitability",
|
||||
"zones": "Territory and other filter changes apply search;old records hidden while loading/error;all and filtered totals plus pagination explicit;existing public visibility preserved;validated legal coverage includes its child area,while influence is not treated as a site",
|
||||
"my_investments": "Next action remains prominent;other phases/stages expandable;source/code history and internal follow-up remain consultable rather than filling the main page",
|
||||
"forms": "Direct entries to existing private investment preparation fields and Terra/DUAT;support request separately labelled;originals/guides optional;no law is converted into a form or executable calculation",
|
||||
"document_taxonomy": "Known topic/category/language codes have Portuguese display labels;original query values preserved"
|
||||
},
|
||||
"QA": {
|
||||
"frontend_contract_and_SSR_tests": 9,
|
||||
"frontend_failures": 0,
|
||||
"isolated_feature_tests": 3,
|
||||
"feature_assertions": 14,
|
||||
"feature_failures": 0,
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"port": 55441,
|
||||
"transactions_rolled_back": true,
|
||||
"types": "passed",
|
||||
"build": "passed",
|
||||
"PHP_syntax": "passed",
|
||||
"accepted_national_selector_and_catalogue_proofs": "reused",
|
||||
"unit_regression_tests": 1,
|
||||
"unit_regression_assertions": 13
|
||||
},
|
||||
"Tourism_incident": {
|
||||
"reported_by_Tempo": "authenticated session saw access denial at /sectores/turismo",
|
||||
"anonymous_live_HTTP": 200,
|
||||
"isolated_guest_and_no_promoter_account_HTTP": 200,
|
||||
"exact_real_session_cause": "not demonstrated;do not infer missing role or claim correction",
|
||||
"private_permissions_changed": false,
|
||||
"next": "Confer the actual authenticated session and related logs;public read is not real-session proof",
|
||||
"reported_action": "Tempo clarified denial followed a button click;exact label could not be recalled",
|
||||
"bounded_code_finding": "Sector registration action depended on module availability rather than effective account creation capability",
|
||||
"QA_correction": "Reuse ContentManagement effective create destination;otherwise explicitly link to existing promoter request with a readable label;public consultation and idea preparation remain separate",
|
||||
"real_session_reconference": "pending;the exact original button is not demonstrated"
|
||||
},
|
||||
"limits": [
|
||||
"Not installed in this QA report",
|
||||
"SSR and controlled event tests are not browser keyboard/touch/layout evidence",
|
||||
"Existing form adaptations are exposed;this does not implement every official form in the document collection",
|
||||
"No new roles,publications,source edits,schema changes or fiscal activation",
|
||||
"L8 remains partial"
|
||||
],
|
||||
"restriction_origins": {
|
||||
"UX_and_selected_scope": "Tempo current express instructions",
|
||||
"data_and_permissions_preservation": "permanent project instructions",
|
||||
"grouping_and_collapsed_details": "implementation choice,not new organisational requirement",
|
||||
"document_ownership_scan_and_existing_workflows": "prior contracts preserved"
|
||||
},
|
||||
"delivery_gate": {
|
||||
"candidate": "502e3ec4",
|
||||
"result": "failed before runtime switch;6e8de43a preserved",
|
||||
"reason": "Unit mock did not represent new public location presentation;unnecessary relation query on non-source records",
|
||||
"correction": "Short-circuit source applicability before reading relations;mock the new presentation dependency and retain prior identity/count assertions",
|
||||
"unit_regression": "1 test/13 assertions passed",
|
||||
"pipeline_guardrails": "unchanged;no schema migration or test-gate weakening"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
{
|
||||
"date": "2026-10-28",
|
||||
"status": "installed_technical_navigation_delta_verified_authenticated_visual_conference_pending",
|
||||
"served_commit": "6e8de43ae7fec29b0766d95e209a8cb8baf0d88c",
|
||||
"previous_runtime": "6d1476936920dc5715d4493b1f8b22a3d51935f4",
|
||||
"target": "https://teste-investidor.tempo.co.mz/",
|
||||
"authorisation": "Tempo approved the QA menu proposal and authenticated the existing SSH delivery mechanism",
|
||||
"normal_git_fast_forward": true,
|
||||
"force_used": false,
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-navigation-delivery-20261028/backup",
|
||||
"created_at": "2026-10-28T18:18:14Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 176,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "748539aa92cf4a0e22698a3b7651faa7a4452db2517ddb811a924b761ea9dce5",
|
||||
"files_sha256": "946dd8d33903332557639103b8f5ad5bca955fd3ec79f112e3649128fea8c499",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 176,
|
||||
"container_network": "none",
|
||||
"database": "navigation_delivery_20261028_test",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "748539aa92cf4a0e22698a3b7651faa7a4452db2517ddb811a924b761ea9dce5",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"guard": {
|
||||
"ready_for_normal_git_delivery": true,
|
||||
"restore_verified": true,
|
||||
"tables_verified": 176,
|
||||
"pipeline_and_schema_contract_unchanged": true,
|
||||
"candidate": "6e8de43ae7fec29b0766d95e209a8cb8baf0d88c"
|
||||
},
|
||||
"installed_delta": {
|
||||
"navigation_asset_and_shared_props_verified": true,
|
||||
"at": "2026-10-28T18:23:39.508498+00:00",
|
||||
"served_commit": "6e8de43ae7fec29b0766d95e209a8cb8baf0d88c",
|
||||
"backup_dump_sha256": "748539aa92cf4a0e22698a3b7651faa7a4452db2517ddb811a924b761ea9dce5",
|
||||
"prior_public_tables_checked": 176,
|
||||
"prior_domain_rows_preserved": true,
|
||||
"new_migration_registry_rows": 0,
|
||||
"operational_delta": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 111,
|
||||
"checksum": "650ce50f1aa1af7e7025bcbaa7bcd6ba"
|
||||
},
|
||||
"after": {
|
||||
"rows": 111,
|
||||
"checksum": "ea8070b2c9a513485bfb27462e379703"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 4,
|
||||
"checksum": "f0d8b267cdf55c86ba8223d9e1ff3c6a"
|
||||
},
|
||||
"after": {
|
||||
"rows": 5,
|
||||
"checksum": "99071034149a154c7e17acc47e058dae"
|
||||
}
|
||||
}
|
||||
},
|
||||
"persistent_files_and_configuration_identical": 369,
|
||||
"private_catalogue": {
|
||||
"observations": 361464,
|
||||
"distinct_administrative_observations": 214299,
|
||||
"preserved_repetitions": 147165,
|
||||
"unmapped_territory": 205608
|
||||
},
|
||||
"RLS_without_actor_rows": 0,
|
||||
"anonymous_query_status": 401,
|
||||
"public_revision_confirmed": true,
|
||||
"actual_team_UI_journey": "pending authenticated browser conference;accepted QA is not repeated",
|
||||
"unique_company_count": null,
|
||||
"publication": false,
|
||||
"national_coverage": "partial",
|
||||
"investment_conclusion": "hypothesis,not proved demand or viability",
|
||||
"L8": "unchanged,partial"
|
||||
},
|
||||
"existing_pipeline_receipt": {
|
||||
"reports": [
|
||||
{
|
||||
"status": "already_installed",
|
||||
"commit": "6e8de43ae7fec29b0766d95e209a8cb8baf0d88c",
|
||||
"requested_commits": [
|
||||
"6e8de43ae7fec29b0766d95e209a8cb8baf0d88c"
|
||||
],
|
||||
"finished_at": "2026-10-28T18:23:07.685587+00:00"
|
||||
},
|
||||
{
|
||||
"status": "installed",
|
||||
"commit": "6e8de43ae7fec29b0766d95e209a8cb8baf0d88c",
|
||||
"release": "/var/www/investmoz-homologacao/releases/6e8de43ae7fec29b0766d95e209a8cb8baf0d88c-877dabd3",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6d1476936920dc5715d4493b1f8b22a3d51935f4-c9ebfad4",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"6e8de43ae7fec29b0766d95e209a8cb8baf0d88c"
|
||||
],
|
||||
"finished_at": "2026-10-28T18:23:06.355940+00:00"
|
||||
}
|
||||
],
|
||||
"build_log": "/var/lib/investmoz-deploy/logs/1793211570315386207.log",
|
||||
"build_log_sha256": "7b1d78a066ed829cbdabc67549baf4835ab8f911b8c4b178be09539ed434ddde",
|
||||
"summaries": [
|
||||
"\u001b[30;42mOK (1 test, 3106 assertions)\u001b[0m",
|
||||
"✓ built in 31.30s",
|
||||
"\u001b[30;42mOK (59 tests, 317 assertions)\u001b[0m",
|
||||
"# tests 1156",
|
||||
"# pass 1156",
|
||||
"# fail 0"
|
||||
],
|
||||
"last_lines": [
|
||||
"ext-pcre 8.4.27 success ",
|
||||
"ext-session 8.4.27 success ",
|
||||
"ext-tokenizer 8.4.27 success ",
|
||||
"php 8.4.27 success ",
|
||||
"6e8de43ae7fec29b0766d95e209a8cb8baf0d88c",
|
||||
"",
|
||||
" INFO Broadcasting queue restart signal. ",
|
||||
""
|
||||
]
|
||||
},
|
||||
"accepted_QA_reused": {
|
||||
"directed_tests": 16,
|
||||
"types": "passed",
|
||||
"build": "passed",
|
||||
"PHP_syntax": "passed"
|
||||
},
|
||||
"UI_delta": [
|
||||
"Área de trabalho visible in principal navigation; operational entries follow existing effective capabilities",
|
||||
"Sidebar preserves every nested destination and territorial context instead of exposing only the first link",
|
||||
"Existing opportunity analysis form can be opened directly without replacing saved analysis",
|
||||
"Existing account, content, investment and follow-up destinations retained; no new roles or grants"
|
||||
],
|
||||
"remaining": [
|
||||
"Authenticated visual conference on the actual account, including responsive layout and keyboard/touch",
|
||||
"Confirm Gurué → offer consultation → idea comparison → save → recover in the same dossier; technical/QA proofs remain accepted"
|
||||
],
|
||||
"connector_last_known_error": "The browser access host is unavailable",
|
||||
"limitations": {
|
||||
"technical_delivery_is_not_visual_session_evidence": true,
|
||||
"435_Gurue_observations_are_not_435_unique_companies": true,
|
||||
"lists_remain_internal": true,
|
||||
"national_coverage": "partial",
|
||||
"absence_of_records": "insufficient information",
|
||||
"comparison": "investment hypothesis; does not establish demand or viability",
|
||||
"L8": "unchanged,partial"
|
||||
},
|
||||
"restriction_origins": {
|
||||
"delivery": "explicit Tempo authorisation",
|
||||
"preservation_and_restore": "permanent project instructions",
|
||||
"grouping_and_presentation": "implementation choice within the approved QA proposal; no new business authority"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,230 @@
|
||||
{
|
||||
"date": "2026-10-28",
|
||||
"status": "internal_supply_integration_demonstrated_in_isolated_QA_not_installed",
|
||||
"baseline": "150bef4b897de8d0711c1e2bbeedbcaf5ee241d2b",
|
||||
"baseline_runtime": "569a1cd750f3d2a0b87f130e992e73e070bbd1ab",
|
||||
"branch": "codex/proactive-supply-qa-20261028",
|
||||
"active_runtime_unchanged": "569a1cd750f3d2a0b87f130e992e73e070bbd1ab",
|
||||
"accepted_inventory_reused": "existing-supply-lists-audit-20261028.json;13 accessible originals/variants inventoried before source selection;prior proactive acceptance and fiscal delivery preserved",
|
||||
"sources": [
|
||||
{
|
||||
"alias": "companies.xlsx",
|
||||
"name": "EMPRESAS_LIST 2014-2022.xlsx",
|
||||
"sha256": "1ba4c4114b16b407e7746712d00d4f681246bbbc1b42351e96a31f7129acad30",
|
||||
"bytes": 26586267,
|
||||
"period": "2014–2022; data por registo quando disponível"
|
||||
},
|
||||
{
|
||||
"alias": "licensed.xlsx",
|
||||
"name": "Empresas Licenciadas.xlsx",
|
||||
"sha256": "1b5087b464e39e88c42def39655c2391aaaf684b4c832d6a77ff274b98889f00",
|
||||
"bytes": 34940776,
|
||||
"period": "Data por registo; cobertura temporal global não determinada"
|
||||
},
|
||||
{
|
||||
"alias": "tourism.xlsx",
|
||||
"name": "CADASTRO DE EMPREENDIMENTOS TURISTICOS 3, 4 E 5 ESTRELAS 30.10.24 18,00h.xlsx",
|
||||
"sha256": "f02e086ed4973ef17234aa6cc54b98fbb7a6952ffb16ec4dc4f7d0c72af6400c",
|
||||
"bytes": 73955,
|
||||
"period": "30/10/2024 (nome do exemplar); situação actual não confirmada"
|
||||
},
|
||||
{
|
||||
"alias": "cae.xlsx",
|
||||
"name": "CAE eBAU.xlsx",
|
||||
"sha256": "83b4f1200988e99834c2ae3915346fbf237d128308554b67b5a080d4956bf506",
|
||||
"bytes": 75018,
|
||||
"period": "Versão não indicada"
|
||||
}
|
||||
],
|
||||
"source_rows": {
|
||||
"companies.xlsx": 148556,
|
||||
"licensed.xlsx": 212631,
|
||||
"tourism.xlsx": 277
|
||||
},
|
||||
"catalog": {
|
||||
"records": 361464,
|
||||
"repeated_projection": 147165,
|
||||
"identity_conflicts": 113880,
|
||||
"activity_unclassified": 82864,
|
||||
"territory_unmapped": 205608,
|
||||
"province_only": 336,
|
||||
"unnamed_observations": 18423
|
||||
},
|
||||
"duplicate_meaning": "same projected administrative fields including entity identifier, licence/process,date,place,activity,name;all source sightings retained,not a unique-company count or byte-identical-file claim",
|
||||
"classification": {
|
||||
"activity_and_sector": "supplied CAE labels and SELF_ID hierarchy;no invented correspondence to twelve portal navigation sectors",
|
||||
"territory": "unique normalized province+district,otherwise exact unique canonical subordinate name within province;Maputo explicitly distinct from Maputo Cidade;no fuzzy matching;raw source labels retained",
|
||||
"identity": "valid-shaped NUIT only hashed as a possible entity key;different names flagged,not silently merged;unidentified rows remain distinct",
|
||||
"dates": "original date strings and Excel serials retained verbatim;file modification time not a reference date",
|
||||
"tourism": "277 establishment observations across two differently structured sheets;explicit province section preserved;missing district remains unknown;not an exhaustive hotels/restaurants census"
|
||||
},
|
||||
"private_import": {
|
||||
"preview": true,
|
||||
"original_hashes_checked": true,
|
||||
"malware": "Microsoft Defender custom scan on same-hash private copies,exit0,no threats detected,2026-10-28",
|
||||
"idempotency": {
|
||||
"before": 343041,
|
||||
"after": 343041,
|
||||
"sha256": "6a9c820c73a8c535ed3cdfc03db0311edf0300f1f97ade75f0fce3d3c84a02e1",
|
||||
"publication": false,
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"port": 55441
|
||||
},
|
||||
"tables": [
|
||||
"proactive_supply_sources",
|
||||
"proactive_supply_observations"
|
||||
],
|
||||
"RLS": "forced on both;non-owner QA policy proof:0 rows without actor/read context;authorized context recovers row",
|
||||
"contacts_identity_documents_nuit_not_returned_by_query": true,
|
||||
"no_automatic_directory_publication": true,
|
||||
"no_promoters_or_user_organizations_created": true,
|
||||
"extension_first": {
|
||||
"before": 343041,
|
||||
"after": 361464,
|
||||
"sha256": "dec9db62a52a8bac5f1e2675aecbeb4239f2b1f4fa521db01693c32bdfeef01e",
|
||||
"extension": true,
|
||||
"previous_snapshot": "6a9c820c73a8c535ed3cdfc03db0311edf0300f1f97ade75f0fce3d3c84a02e1",
|
||||
"publication": false,
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"port": 55441
|
||||
},
|
||||
"extension_replay": {
|
||||
"before": 361464,
|
||||
"after": 361464,
|
||||
"sha256": "dec9db62a52a8bac5f1e2675aecbeb4239f2b1f4fa521db01693c32bdfeef01e",
|
||||
"extension": true,
|
||||
"previous_snapshot": "6a9c820c73a8c535ed3cdfc03db0311edf0300f1f97ade75f0fce3d3c84a02e1",
|
||||
"publication": false,
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"port": 55441
|
||||
}
|
||||
},
|
||||
"proactive_delta": "private authenticated territory query,CAE sector/activity filters,pagination,source/row/date/hash;select existing observations,compare competition/complementarity/possible partner/uncertain with rationale and limitations;server resolves source lineage,keeps list-derived evidence internal;save/reload and private dossier preserve references",
|
||||
"gurue": {
|
||||
"date": "2026-10-28",
|
||||
"QA_only": true,
|
||||
"operator": 1021,
|
||||
"record_id": 402,
|
||||
"dossier_id": "883c8ec3-59a3-4074-b91c-b7d4a5d88ff0",
|
||||
"prior_version": 1,
|
||||
"offer_query_total": 410,
|
||||
"selected_source_records": 2,
|
||||
"comparison_relationships": [
|
||||
"competition",
|
||||
"complementarity"
|
||||
],
|
||||
"existing_five_evidences_preserved": true,
|
||||
"total_evidence": 7,
|
||||
"idea_preserved": true,
|
||||
"need": "hypothesis",
|
||||
"empty_results": "insufficient_information",
|
||||
"save_reload_recovered": true,
|
||||
"existing_dossier_preview_confirm_replay": true,
|
||||
"anonymous_internal_query_denied": true,
|
||||
"no_publication": true,
|
||||
"no_external_contacts": true,
|
||||
"errors": [],
|
||||
"source_version": 2,
|
||||
"context_revision": 2,
|
||||
"deliberate_dossier_title_and_fields_preserved": true,
|
||||
"prior_source_v1_history_retained": true,
|
||||
"songo_401_unchanged": true,
|
||||
"refreshed_offer_query_total": 435,
|
||||
"initial_browser_proof_retained": true,
|
||||
"dossier_comparisons_visible": {
|
||||
"existing_dossier_comparison_1_visible": true,
|
||||
"existing_dossier_comparison_2_visible": true,
|
||||
"read_only_after_commit": true,
|
||||
"errors": []
|
||||
}
|
||||
},
|
||||
"verification": {
|
||||
"delta_tests": 7,
|
||||
"assertions": 62,
|
||||
"types": "passed",
|
||||
"QA_build": "passed",
|
||||
"accepted_prior_proofs": "reused;no fiscal suites repeated",
|
||||
"browser": "authenticated synthetic operator1021,real supplied source rows,save/reload,existing dossier preview-confirm-replay;not team acceptance",
|
||||
"preservation": {
|
||||
"opportunities": {
|
||||
"baseline_rows": 55,
|
||||
"new_rows": 0,
|
||||
"expected_changes": [
|
||||
"402"
|
||||
]
|
||||
},
|
||||
"desk_cases": {
|
||||
"baseline_rows": 20,
|
||||
"new_rows": 0,
|
||||
"expected_changes": [
|
||||
"883c8ec3-59a3-4074-b91c-b7d4a5d88ff0"
|
||||
]
|
||||
},
|
||||
"projects": {
|
||||
"baseline_rows": 19,
|
||||
"new_rows": 0,
|
||||
"expected_changes": []
|
||||
},
|
||||
"geo_locations": {
|
||||
"baseline_rows": 1921,
|
||||
"new_rows": 0,
|
||||
"expected_changes": []
|
||||
},
|
||||
"sectors": {
|
||||
"baseline_rows": 12,
|
||||
"new_rows": 0,
|
||||
"expected_changes": []
|
||||
},
|
||||
"documents": {
|
||||
"baseline_rows": 64,
|
||||
"new_rows": 0,
|
||||
"expected_changes": []
|
||||
},
|
||||
"value_chains": {
|
||||
"baseline_rows": 0,
|
||||
"new_rows": 0,
|
||||
"expected_changes": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"remaining": [
|
||||
"No installation or import in active portal;there the list-backed use remains not demonstrated until delivery.",
|
||||
"205608 observations lack a unique canonical territorial match,including19 ambiguous names;336 have province only. Raw source territory remains available in private originals.",
|
||||
"82864 observations lack an exact supplied CAE activity label;do not impute sector/activity.",
|
||||
"113880 observations have differing names for a shared valid-shaped identifier;identity needs reconciliation,not automatic merger.",
|
||||
"Historical administrative records do not establish current operating status,capacity,prices,demand,contracts or market vacancy.",
|
||||
"National mapping/classification completeness and actual team use remain partial;Gurué proof does not close all market-study/cluster requirements.",
|
||||
"Active delivery requires capability/compatibility review,fresh backup+restore,authenticated operation and installed delta check through the existing Git procedure."
|
||||
],
|
||||
"restriction_origins": {
|
||||
"internal_analysis_no_auto_publication_no_absence_inference": "explicit Tempo task",
|
||||
"preservation_QA_active_separation_backup_restore": "permanent AGENTS instructions",
|
||||
"canonical_unique_matching_hashed_keys_query_limits_RLS": "implementation choices,not new organizational approval requirements"
|
||||
},
|
||||
"proof_files": [
|
||||
"outputs/proactive-supply-20261028/gurue-ui-proof.json",
|
||||
"outputs/proactive-supply-20261028/preservation-proof.json",
|
||||
"outputs/proactive-supply-20261028/tests-receipt.json",
|
||||
"outputs/proactive-supply-20261028/dossier-visual-proof.json",
|
||||
"outputs/proactive-supply-20261028/supply-extension-preservation.json",
|
||||
"outputs/proactive-supply-20261028/refreshed-gurue-query.json"
|
||||
],
|
||||
"L8": "unchanged,partial;this increment has no fiscal calculation change",
|
||||
"supplement": {
|
||||
"previous_snapshot_records": 343041,
|
||||
"added_unnamed_source_rows": 18423,
|
||||
"placeholder": "Denominação não indicada;never the personal applicant name",
|
||||
"all_previous_observations_unchanged": {
|
||||
"old_observations_unchanged": 343041,
|
||||
"new_observations": 18423
|
||||
},
|
||||
"preview_both_hashes_bound": {
|
||||
"previous_observations_unchanged": 343041,
|
||||
"new_observations": 18423,
|
||||
"no_replacement": true,
|
||||
"previous_sha256": "6a9c820c73a8c535ed3cdfc03db0311edf0300f1f97ade75f0fce3d3c84a02e1",
|
||||
"sha256": "dec9db62a52a8bac5f1e2675aecbeb4239f2b1f4fa521db01693c32bdfeef01e"
|
||||
},
|
||||
"original_source_rows_accounted_for": "148556 companies+212631 licensed nonempty data rows,excluding headers;277 tourism establishment sightings from two structures"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
{
|
||||
"date": "2026-10-27",
|
||||
"status": "prospecting_handoff_ready_and_Gurue_private_hypothesis_in_QA_not_installed",
|
||||
"branch": "codex/proactive-handoff-gurue-qa-20261027",
|
||||
"baseline": "a78abf06d0ca075b18156ae3fd99649b69202481",
|
||||
"technical_candidate_unchanged": "1afab4a2a71f182f260e4d2555d79242261a4d2a",
|
||||
"runtime_unchanged": "3439f35038f15c93224e6cf876bf559135824d13",
|
||||
"songo": {
|
||||
"case_id": "CB-METROLOGIA-20261027",
|
||||
"record_id": 401,
|
||||
"source_version": 3,
|
||||
"context_revision": 3,
|
||||
"unchanged": true,
|
||||
"state": "private_pending_external_commercial_responses",
|
||||
"external_messages_sent": 0,
|
||||
"commercial_responses_received": 0,
|
||||
"partner_quotes_received": 0,
|
||||
"resume_when": "Inventories/programmes/interest and partner quotations for comparable scope received;identify independent buying centres before aggregating demand"
|
||||
},
|
||||
"prospecting_form": {
|
||||
"path": "docs/investmoz/unification/prospeccao-apoio-metrologico-20261027.pdf",
|
||||
"pages": 2,
|
||||
"interactive_fields": 42,
|
||||
"canonical_fields_and_widgets_agree": true,
|
||||
"unique_names": true,
|
||||
"all_fields_in_page": true,
|
||||
"saved_values_recovered": true,
|
||||
"appearance_streams_present": true,
|
||||
"real_form_not_prefilled_with_test_values": true,
|
||||
"delivered_format": "fillable_PDF",
|
||||
"docx_not_delivered": true,
|
||||
"sha256": "abed1dc12a8f635bf4c3aa39ba5823114d2155aaca9b675a8ca1b9fb6248e989",
|
||||
"visual_review": "Both final pages inspected;sample retained values checked separately"
|
||||
},
|
||||
"gurue": {
|
||||
"case_id": "GUR-CHA-20261027",
|
||||
"record_id": 402,
|
||||
"dossier_id": "883c8ec3-59a3-4074-b91c-b7d4a5d88ff0",
|
||||
"source_version": 1,
|
||||
"context_revision": 1,
|
||||
"evidence_count": 5,
|
||||
"need_state": "hypothesis",
|
||||
"private_draft_not_published": true,
|
||||
"created_saved_recovered_through_existing_services": true,
|
||||
"preview_and_confirmation": true,
|
||||
"deliberate_title_preserved": true,
|
||||
"existing_geo_and_sector_reused": true,
|
||||
"no_new_grants_or_business_promoter": true,
|
||||
"QA_operator_1021_only": true,
|
||||
"Songo_record_401_version_3_unchanged": true,
|
||||
"Songo_context_revision_3_unchanged": true,
|
||||
"no_application_code_or_fiscal_changes": true,
|
||||
"accepted_proofs_reused": true,
|
||||
"no_contact_or_server_operations": true,
|
||||
"QA_database": "proactive_investment_20261027_test",
|
||||
"row_preservation": {
|
||||
"opportunities": {
|
||||
"old_rows_unchanged": 53,
|
||||
"new_rows": 1
|
||||
},
|
||||
"desk_cases": {
|
||||
"old_rows_unchanged": 18,
|
||||
"new_rows": 1
|
||||
},
|
||||
"projects": {
|
||||
"old_rows_unchanged": 19,
|
||||
"new_rows": 0
|
||||
},
|
||||
"geo_locations": {
|
||||
"old_rows_unchanged": 1921,
|
||||
"new_rows": 0
|
||||
},
|
||||
"sectors": {
|
||||
"old_rows_unchanged": 12,
|
||||
"new_rows": 0
|
||||
},
|
||||
"documents": {
|
||||
"old_rows_unchanged": 63,
|
||||
"new_rows": 0
|
||||
},
|
||||
"value_chains": {
|
||||
"old_rows_unchanged": 0,
|
||||
"new_rows": 0
|
||||
},
|
||||
"audit_events": {
|
||||
"old_rows_unchanged": 394,
|
||||
"new_rows": 5
|
||||
},
|
||||
"organizations": {
|
||||
"old_rows_unchanged": 3,
|
||||
"new_rows": 0
|
||||
},
|
||||
"users": {
|
||||
"old_rows_unchanged": 40,
|
||||
"new_rows": 0
|
||||
},
|
||||
"investor_journeys": {
|
||||
"old_rows_unchanged": 15,
|
||||
"new_rows": 1
|
||||
},
|
||||
"journey_steps": {
|
||||
"old_rows_unchanged": 285,
|
||||
"new_rows": 19
|
||||
}
|
||||
}
|
||||
},
|
||||
"report": {
|
||||
"record_id": 402,
|
||||
"evidence_rows": 5,
|
||||
"source_version": 1,
|
||||
"context_revision": 1,
|
||||
"source_recovered_without_loss": true,
|
||||
"hypothesis_and_historic_period_visible": true,
|
||||
"commercial_inputs_unknown": true,
|
||||
"existing_report_helper": true,
|
||||
"accepted_suites_not_repeated": true
|
||||
},
|
||||
"source_register": [
|
||||
{
|
||||
"file": "ine-gurue-2020-2024.pdf",
|
||||
"url": "https://ine.gov.mz/documents/20119/337384/2_Gurue-%20Final_Junho2025.pdf/602d05a3-be99-47a4-be68-5277c4ca4a2f?download=true&t=1751024727586&version=1.0",
|
||||
"bytes": 3038756,
|
||||
"sha256": "9f0d3b868cfd3401f8d4f2fcceae0e5be164ba6dab927d1210e247b1711093d4",
|
||||
"accessed": "2026-10-27",
|
||||
"use": "Private read-only source copy;not imported or published"
|
||||
},
|
||||
{
|
||||
"file": "magoma-primary.html",
|
||||
"url": "https://www.asianteagroup.com/foot-gurue.html",
|
||||
"bytes": 5590,
|
||||
"sha256": "5881a5ec9a4b223932508fd48896c8a467a01387fdc7923eda4c4cb192adad9d",
|
||||
"accessed": "2026-10-27",
|
||||
"use": "Private read-only source copy;not imported or published"
|
||||
},
|
||||
{
|
||||
"file": "igc-enterprise-map-2014.pdf",
|
||||
"url": "https://www.theigc.org/wp-content/uploads/2014/06/An-Enterprise-Map-of-Mozambique-English.pdf",
|
||||
"bytes": 1746681,
|
||||
"sha256": "2d02a47c9e806490ba8d0cc016ef23d34bf8818f1b1c2dde5a0806818fa35c67",
|
||||
"accessed": "2026-10-27",
|
||||
"use": "Private read-only source copy;not imported or published"
|
||||
}
|
||||
],
|
||||
"provided_private_workbook": {
|
||||
"sha256": "1b5087b464e39e88c42def39655c2391aaaf684b4c832d6a77ff274b98889f00",
|
||||
"historical_reference_dates": [
|
||||
"2021-09-30",
|
||||
"2023-11-09",
|
||||
"2022-03-17"
|
||||
],
|
||||
"no_personal_data_or_contacts_exported": true,
|
||||
"not_imported_or_published": true
|
||||
},
|
||||
"pilot_limits": [
|
||||
"Activity documented;current unmet need and commercial interest unconfirmed",
|
||||
"2014 source is historical;no current volumes/prices/capacity inferred",
|
||||
"No assumed external green-leaf buyer,new factory,land access or certification",
|
||||
"Beneficiaries are not automatically buyers or payers"
|
||||
],
|
||||
"preserved": {
|
||||
"L8": "14360748194f3658d91a7d7ae5615efd0fcbfbb7",
|
||||
"SGF_TEMPO": "untouched",
|
||||
"accepted_proofs": "reused_without_repeating_suites",
|
||||
"main_last_read": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5"
|
||||
},
|
||||
"installation": "No remote or deployment operation;capacity remains a precondition to next installation",
|
||||
"private_outputs": "outputs/proactive-handoff-gurue-20261027/",
|
||||
"new_application_code": false
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
{
|
||||
"status": "QA_complete_candidate_not_installed",
|
||||
"date": "2026-10-27",
|
||||
"runtime_commit": "3439f35038f15c93224e6cf876bf559135824d13",
|
||||
"baseline_main": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"branch": "codex/proactive-investment-first-qa-20261027",
|
||||
"QA_directory": "C:\\laragon\\www\\portal-investidor-proactive-qa-20261027",
|
||||
"root_checkout": "C:/laragon/www/portal-investidor",
|
||||
"unavailable_local_scope_commit": "fa02c70",
|
||||
"unavailable_commit_is_not_dependency": true,
|
||||
"L8_candidate_preserved": "14360748194f3658d91a7d7ae5615efd0fcbfbb7",
|
||||
"L8_not_integrated_or_modified": true,
|
||||
"server_or_SGF_operations": false,
|
||||
"scope": "territory/sector,evidence,need,structuredidea,existingencryptedDossier;manualeditorialpreparation beforeAI",
|
||||
"existing_models_reused": [
|
||||
"geo_locations",
|
||||
"sectors",
|
||||
"value_chains",
|
||||
"projects",
|
||||
"economic_clusters",
|
||||
"development_corridors",
|
||||
"investment_zones",
|
||||
"Opportunity.management_draft",
|
||||
"audit_events",
|
||||
"portal_resources",
|
||||
"documents",
|
||||
"opportunity_documents",
|
||||
"desk_cases",
|
||||
"InvestorContext",
|
||||
"InvestmentConsumerScope",
|
||||
"InvestorPath"
|
||||
],
|
||||
"new_tables_or_migrations": false,
|
||||
"new_organisational_approvers_or_roles": false,
|
||||
"auth_delta": "Existing internal assignment may prepare/edit proactive drafts with real promoter unknown;all other role and operational checks retained and tested",
|
||||
"checks": {
|
||||
"API_tests": 14,
|
||||
"API_assertions": 139,
|
||||
"frontend_report_tests": 7,
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"clone_source": "simulator_fiscal_delta_20261021_test",
|
||||
"host": "127.0.0.1",
|
||||
"port": 55441,
|
||||
"guarded": true,
|
||||
"API_transaction_rollback": true,
|
||||
"UI_persistent_synthetic_data_only_in_clone": true,
|
||||
"normal_password_and_MFA_UI": true,
|
||||
"UI": {
|
||||
"actualLaravelHTTP": true,
|
||||
"normalPasswordAndMFA": true,
|
||||
"createSaveRecoverEdit": true,
|
||||
"hypothesisAndConfirmedHistory": true,
|
||||
"onlyApplicableGroupsShown": true,
|
||||
"selectedRelationshipsAndAssumptionsTransported": true,
|
||||
"privateRelationshipReferenceNotExposed": true,
|
||||
"noBudgetPromoterCoordinatesRequired": true,
|
||||
"existingTerritoryAndSector": true,
|
||||
"explicitPromotionPreviewConfirm": true,
|
||||
"anonymousOnlyAuthorisedPublicContent": true,
|
||||
"authReturnPreservesSource": true,
|
||||
"existingDossier": true,
|
||||
"deliberateTitlePreserved": true,
|
||||
"reloadAndResumeSession": true,
|
||||
"publicUrl": "http://127.0.0.1:18760/oportunidades/inv-mz-gen-5137141825128895?perspective=ideas§or=energia-especifica",
|
||||
"record_id": 383,
|
||||
"dossier_id": "139e5faf-4979-4e2c-9a92-3e1465431642",
|
||||
"errors": []
|
||||
},
|
||||
"Wayfinder_with_form": "passed",
|
||||
"TypeScript": "passed",
|
||||
"isolated_QA_build": "passed",
|
||||
"build_advisories": [
|
||||
"Existing chunk-size and plugin-timing diagnostics;no buildfailure"
|
||||
],
|
||||
"unaffected_accepted_suites_not_repeated": true
|
||||
},
|
||||
"preservation": {
|
||||
"baseline": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"tracked_files_before": 2830,
|
||||
"changed_existing_files": [
|
||||
"app/Http/Controllers/OpportunityManagementController.php",
|
||||
"app/Models/Opportunity.php",
|
||||
"app/Services/InvestmentCatalogue.php",
|
||||
"app/Services/InvestorContext.php",
|
||||
"app/Services/OpportunityManagement.php",
|
||||
"app/Services/OpportunityPromotion.php",
|
||||
"app/Services/PortalProfileAccess.php",
|
||||
"docs/investmoz/consolidated-review-matrix-2026-10-03.md",
|
||||
"docs/investmoz/unification/traceability-and-manual.md",
|
||||
"docs/investmoz/v2/auditoria-portal/matriz-requisitos.csv",
|
||||
"resources/js/components/opportunity-search-filters.tsx",
|
||||
"resources/js/lib/project-dossier.ts",
|
||||
"resources/js/pages/investment/catalogue.tsx",
|
||||
"resources/js/pages/investment/detail.tsx",
|
||||
"resources/js/pages/investment/shared.tsx",
|
||||
"resources/js/pages/investor-path/show.tsx",
|
||||
"resources/js/pages/management/opportunity-draft.tsx",
|
||||
"resources/js/pages/management/opportunity-promotion.tsx"
|
||||
],
|
||||
"unchanged_existing_files": 2812,
|
||||
"fiscal_engines_unchanged": 89,
|
||||
"fiscal_originals_unchanged": 31,
|
||||
"Rwanda_originals_unchanged": true,
|
||||
"L8_candidate_14360748_unchanged": true,
|
||||
"auth_delta": "Existing internal assignment may prepare/edit proactive drafts with real promoter unknown;all other role and operational checks retained and tested",
|
||||
"source_Database_and_active_environment_not_written": true,
|
||||
"QA_database": "proactive_investment_20261027_test",
|
||||
"clone_source": "simulator_fiscal_delta_20261021_test",
|
||||
"port": 55441,
|
||||
"root_runtime_not_changed": true,
|
||||
"SGF_TEMPO_untouched": true,
|
||||
"accepted_unaffected_suites_not_repeated": true,
|
||||
"no_migrations_config_or_active_grant_changes": true,
|
||||
"QA_synthetic_grants_only_in_isolated_clone": true,
|
||||
"includes_documentation_delta": true
|
||||
},
|
||||
"Rwanda_methodology": {
|
||||
"status": "user_provided_sources_located_and_relevant_passages_read",
|
||||
"date": "2026-10-27",
|
||||
"purpose": "Internal methodology for QA editorial preparation;not local economic evidence",
|
||||
"originals_unchanged": true,
|
||||
"no_source_publication_or_import": true,
|
||||
"no_foreign_tax_or_institutional_rules_imported": true,
|
||||
"sources": [
|
||||
{
|
||||
"path": "c:\\Mac\\Home\\Documents\\Docs pessoais\\Backup\\Documentos – MacBook Pro de Macbook\\Docs\\Rwanda\\20070627_Rwanda_5d0cc43d-c990-4cf1-8ee9-ada71094918f.pdf",
|
||||
"sha256": "18b07a9379a1ad0baa33697d57d6237f15a6fec346db44bfee7506bf1fa27dee",
|
||||
"bytes": 335937,
|
||||
"title": "Creating a Competitive Rwanda",
|
||||
"author": "Professor Michael E. Porter, Harvard Business School",
|
||||
"edition": "Kigali,June2007 (cover)",
|
||||
"pages": 31,
|
||||
"visual_pages_inspected": [
|
||||
1,
|
||||
14,
|
||||
27
|
||||
],
|
||||
"passages": [
|
||||
{
|
||||
"page": 14,
|
||||
"heading": "Improving the Business Environment: The Diamond",
|
||||
"application_pt": "Inventariar factores de produção, condições de procura e fornecedores/actividades de apoio;cada afirmação local depende de fonte e cobertura próprias."
|
||||
},
|
||||
{
|
||||
"page": 27,
|
||||
"heading": "Role of the Private Sector in Economic Development",
|
||||
"application_pt": "Identificar fornecedores, infra-estruturas e competências como relações a investigar;proximidade não cria compromisso ou acesso."
|
||||
}
|
||||
],
|
||||
"extraction": "pypdf;selectedpages rendered withPyMuPDF and visually inspected"
|
||||
},
|
||||
{
|
||||
"path": "c:\\Mac\\Home\\Documents\\Docs pessoais\\Backup\\Documentos – MacBook Pro de Macbook\\Docs\\Rwanda\\Rwanda Competitiveness Briefing_Prof Porter_OTF.ppt",
|
||||
"sha256": "4a9325ad64278cb0ef3c60367a05ee2ed9262e2cd49a48d579061349914aa830",
|
||||
"bytes": 1755648,
|
||||
"title": "How Rwanda Competes Today — Rwanda National Innovation and Competitiveness Program",
|
||||
"edition": "July20,2008;Executive Briefing for Prof.MichaelPorter,slide1",
|
||||
"slides": 50,
|
||||
"native_PowerPoint_read_only": true,
|
||||
"visual_slides_inspected": [
|
||||
17
|
||||
],
|
||||
"passages": [
|
||||
{
|
||||
"slide": 17,
|
||||
"heading": "Tourism Cluster—What the market is telling us",
|
||||
"application_pt": "Conservar origem,período,cobertura e amostra das observações de procura;interesse declarado de um inquirido não equivale a contrato ou encomenda em Moçambique.",
|
||||
"source_note": "OTF Tourism Channel Partner Survey,January2007,n=90,scale1–7 visible in slide;figures not transferred to pilotcases."
|
||||
},
|
||||
{
|
||||
"slide": 20,
|
||||
"heading": "Tea Cluster—Persistent constraints",
|
||||
"application_pt": "Estruturar a análise por etapas de produção,recolha,transformação,transporte e comercialização;as limitações do Ruanda não são lacunas comprovadas do Gurué.",
|
||||
"inspection": "Text extracted in native slide order;not yet visually inspected."
|
||||
},
|
||||
{
|
||||
"slide": 24,
|
||||
"heading": "Mining Cluster – Situation analysis",
|
||||
"application_pt": "Perguntar por competências,informação,fornecedores e serviços relacionados;nenhuma necessidade de Montepuez é inferida desta lista estrangeira.",
|
||||
"inspection": "Native text extracted;not visualproof."
|
||||
}
|
||||
],
|
||||
"extraction": "Legacy OLE exploratoryextraction followed bynativePowerPointreadonly extraction;native50slideorder is authoritative. OldOLE91historicaltextgroups not used as slide count."
|
||||
}
|
||||
],
|
||||
"implementation_mapping": [
|
||||
"evidence.category+purpose+source+locator+period+scope+coverage+verified_on",
|
||||
"methodology evidence cannot by itself confirm localneed",
|
||||
"need.type quantity/quality/logistics/processing/coordination/support",
|
||||
"idea.chain_id+stage+documentedresources+relations",
|
||||
"hypothesis vs confirmedneed vs preparation vs actualavailability separated"
|
||||
],
|
||||
"limitations": [
|
||||
"No actualpilot demand,supply,market_size,profitability or investmentcosts validated",
|
||||
"No direct or indirect disclosure of privatecompanylists or originaldecks",
|
||||
"Copyright/proprietary notices preserved;excerpts and renders remain ignored QA evidence,not public app assets"
|
||||
]
|
||||
},
|
||||
"public_projection_rules": [
|
||||
"No automatic private-to-public field copy",
|
||||
"Only selected public evidence and publictarget relationships",
|
||||
"Private relationship reference omitted",
|
||||
"Internal document classification,rights,scan and ownership link retained",
|
||||
"Literal private evidence reuse blocked;indirect disclosure is explicitly reviewed by existing editor",
|
||||
"Analytical state and publication state separate",
|
||||
"No automatic contract,availability,land,power,viability or taxbenefit"
|
||||
],
|
||||
"pilots": [
|
||||
{
|
||||
"context": "Cahora Bassa",
|
||||
"sector": "Energia",
|
||||
"territory": "bcc9e3cb-2359-524c-af4e-0ebc6f141d3d",
|
||||
"status": "synthetic_QA_only"
|
||||
},
|
||||
{
|
||||
"context": "Montepuez",
|
||||
"sector": "Mineração",
|
||||
"territory": "d4fb92cc-d278-5f69-9490-a98e6dfef18d",
|
||||
"status": "synthetic_QA_only"
|
||||
},
|
||||
{
|
||||
"context": "Gurué",
|
||||
"sector": "Agronegócio/cadeia do chá",
|
||||
"territory": "87a8ba3d-b152-560c-a566-7db4531ad536",
|
||||
"status": "synthetic_QA_only"
|
||||
}
|
||||
],
|
||||
"remaining": {
|
||||
"implemented_demonstrated": "Editorial technical workflow and scoped continuity listed in manual",
|
||||
"partial": "Real local economic analysis and availability of actual participations,not claimed",
|
||||
"documentary_dependencies": "Local evidence,period,coverage,source and specific contract/access/availability claims;onlydependentcase blocked",
|
||||
"resolved_dependency": "Both Rwanda exemplars available and passages inspected",
|
||||
"future": "Automaticintelligence/prioritisation/indicators/AI and economic quantification when data exist;not required for firsteditorial increment",
|
||||
"active_installation": "Out of authorised scope;futurefreshcompatibility/capacity/backuprestore required"
|
||||
},
|
||||
"matrix_ids_updated": [
|
||||
"RF-CLU-003",
|
||||
"MASTER-471012ab-0010",
|
||||
"MASTER-9dee08d0-0067",
|
||||
"MASTER-471012ab-0067"
|
||||
],
|
||||
"documentation_append_only": true,
|
||||
"evidence_directory": "outputs/proactive-investment-20261027/",
|
||||
"no_economic_validation": true,
|
||||
"no_actual_publication_or_homologation_installation": true
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
{
|
||||
"status": "private_opportunity_hypothesis_updated_dossier_v2_technical_delivery_independent",
|
||||
"date": "2026-10-27",
|
||||
"user_direction": "A ideia não é gerir concursos mas sim as oportunidades que geram.",
|
||||
"case_id": "CB-METROLOGIA-20261027",
|
||||
"baseline": "4f9450a71dcc03f17abe953c956956249798d4c0",
|
||||
"technical_candidate_preserved": "1afab4a2a71f182f260e4d2555d79242261a4d2a",
|
||||
"runtime_unchanged": "3439f35038f15c93224e6cf876bf559135824d13",
|
||||
"branch": "codex/proactive-opportunity-model-qa-20261027",
|
||||
"proof": {
|
||||
"case_id": "CB-METROLOGIA-20261027",
|
||||
"record_id": 401,
|
||||
"dossier_id": "894343c7-c33d-452e-a6a5-b6675f77ee23",
|
||||
"previous_source_version": 1,
|
||||
"new_source_version": 2,
|
||||
"before_context_revision": 1,
|
||||
"after_context_revision": 2,
|
||||
"direction": "Investment opportunity generated by demand;not tender management",
|
||||
"need_state": "hypothesis",
|
||||
"evidence_count": 7,
|
||||
"private_draft_not_published": true,
|
||||
"dossier_source_refreshed_through_preview_and_confirmation": true,
|
||||
"deliberate_dossier_fields_unchanged": true,
|
||||
"previous_audit_rows_unchanged": true,
|
||||
"no_new_entities_or_grants": true,
|
||||
"no_new_application_code": true,
|
||||
"accepted_technical_proofs_reused": true,
|
||||
"no_contact_or_server_operations": true,
|
||||
"QA_database": "proactive_investment_20261027_test",
|
||||
"row_preservation": {
|
||||
"opportunities": {
|
||||
"old_rows_unchanged": 52,
|
||||
"updated_case_rows_only": [
|
||||
"401"
|
||||
],
|
||||
"new_rows": 0
|
||||
},
|
||||
"desk_cases": {
|
||||
"old_rows_unchanged": 17,
|
||||
"updated_case_rows_only": [
|
||||
"894343c7-c33d-452e-a6a5-b6675f77ee23"
|
||||
],
|
||||
"new_rows": 0
|
||||
},
|
||||
"projects": {
|
||||
"old_rows_unchanged": 19,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 0
|
||||
},
|
||||
"geo_locations": {
|
||||
"old_rows_unchanged": 1921,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 0
|
||||
},
|
||||
"sectors": {
|
||||
"old_rows_unchanged": 12,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 0
|
||||
},
|
||||
"documents": {
|
||||
"old_rows_unchanged": 63,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 0
|
||||
},
|
||||
"value_chains": {
|
||||
"old_rows_unchanged": 0,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 0
|
||||
},
|
||||
"audit_events": {
|
||||
"old_rows_unchanged": 388,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
"focus": "Recurring complementary service generated by documented demand;customer problem,value,partners and resources",
|
||||
"new_sources": [
|
||||
{
|
||||
"title": "Anúncio HCB17/08/2026,051/2026",
|
||||
"url": "https://www.diarioeconomico.co.mz/wp-content/uploads/2026/08/concurso-hcb-tender-document-docu-mo-ambique-2026-1.pdf",
|
||||
"sha256": "bb4c33064e5d49504d8a85ac88ad1b847cfa6c69e1016e3ab588ff785b205c1f",
|
||||
"pages": 2,
|
||||
"visually_read": [
|
||||
1,
|
||||
2
|
||||
],
|
||||
"role": "Demand evidence and scope;not a new tender workflow"
|
||||
},
|
||||
{
|
||||
"title": "IPAC M0100 INNOQ–LM",
|
||||
"url": "https://www.ipac.pt/pesquisa/ficha_lac.asp?ID=M0100",
|
||||
"consulted": "2026-10-27",
|
||||
"technical_annex": "2026-02-17",
|
||||
"binary_snapshot": null,
|
||||
"binary_download_error": "Connection reset;web reading available",
|
||||
"role": "Potential national laboratory capability by scope;no partnership or full HCB eligibility granted"
|
||||
}
|
||||
],
|
||||
"commercial_questions": [
|
||||
"Que problema operacional recorrente existe no ciclo dos instrumentos e como é resolvido actualmente?",
|
||||
"Quais as famílias/modelos/gamas,quantidades,pontos e periodicidades?Que critérios de aceitação e prazo de devolução?",
|
||||
"O ciclo actual já está coberto?Que necessidade futura permanece e quando?",
|
||||
"Aceitaria serviço local associado?Que parte pode ser prestada fora do laboratório e com que responsabilidades?",
|
||||
"Qual o custo e tempo totais da solução actual e que melhoria justificaria pagar por apoio local?"
|
||||
],
|
||||
"partner_questions": [
|
||||
"Que instrumentos,gamas,pontos,incertezas,locais e prazos consegue cobrir hoje?",
|
||||
"Qual o âmbito acreditado/competência aplicável e que serviços ficam fora dele?",
|
||||
"Tem equipa,meios,disponibilidade e interesse em associação para apoio no Songo?",
|
||||
"Quais as responsabilidades,preços,transporte/embalagem/seguro e condições de custódia e rastreabilidade?"
|
||||
],
|
||||
"decision_paths": [
|
||||
{
|
||||
"condition": "Customer confirms recurring need,actual problem and willingness to consider service",
|
||||
"action": "Match partners and equivalent quotes;quantify business model before qualifying opportunity"
|
||||
},
|
||||
{
|
||||
"condition": "Past purchase satisfied current cycle;documented future need remains",
|
||||
"action": "Prepare future service horizon with actual timing,volume and conditions;do not reopen past tender"
|
||||
},
|
||||
{
|
||||
"condition": "Customer confirms current need fulfilled and no future/recurring need for proposed service",
|
||||
"action": "Archive hypothesis with dated buyer evidence and retain dossier history;do not treat missing information as no demand"
|
||||
},
|
||||
{
|
||||
"condition": "Data insufficient",
|
||||
"action": "Keep private hypothesis;affects only this business case,not technical delivery"
|
||||
}
|
||||
],
|
||||
"economic_comparison": {
|
||||
"basis": "Same instruments,quantity,frequency,quality,place and period;current solution vs proposed associated service",
|
||||
"current_solution_total": null,
|
||||
"proposed_service_total": null,
|
||||
"quantity": null,
|
||||
"period": null,
|
||||
"net_advantage": null,
|
||||
"missing_is_not_zero": true,
|
||||
"inputs": [
|
||||
"Laboratory service quotes",
|
||||
"Total transport/packing/insurance and return",
|
||||
"Local support cost",
|
||||
"Nonduplicated incremental fixed costs for same period",
|
||||
"Instrument turnaround days and substantiated operational impact"
|
||||
],
|
||||
"decision": "No positive advantage assumed;compare cost and time separately until both are measured. No generic wage,distance,tax or downtime assumptions."
|
||||
},
|
||||
"public_search_scope_limit": "No identifiable award/execution or2027commitment located in consulted public sources;absence of result is not proof of no contract. Supplier portal timed out via web and local TLS issuer verification failed;not bypassed. No further repeated search planned without new document or buyer input.",
|
||||
"not_a_tender_management_increment": true,
|
||||
"technical_release_independent_of_commercial_case": true,
|
||||
"no_installation_publication_or_external_messages": true,
|
||||
"L8_preserved": "14360748194f3658d91a7d7ae5615efd0fcbfbb7",
|
||||
"SGF_untouched": true,
|
||||
"evidence_directory": "outputs/proactive-commercial-followup-20261027",
|
||||
"matrix_ids": [
|
||||
"RF-CLU-003",
|
||||
"MASTER-471012ab-0010",
|
||||
"MASTER-9dee08d0-0067",
|
||||
"MASTER-471012ab-0067"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
{
|
||||
"status": "real_source_preliminary_case_demonstrated_private_QA_not_published",
|
||||
"date": "2026-10-27",
|
||||
"case_id": "CB-METROLOGIA-20261027",
|
||||
"baseline_candidate": "1afab4a2a71f182f260e4d2555d79242261a4d2a",
|
||||
"runtime_unchanged": "3439f35038f15c93224e6cf876bf559135824d13",
|
||||
"branch": "codex/proactive-real-pilot-qa-20261027",
|
||||
"new_application_code": false,
|
||||
"QA_database": "proactive_investment_20261027_test",
|
||||
"proof": {
|
||||
"case_id": "CB-METROLOGIA-20261027",
|
||||
"record_id": 401,
|
||||
"dossier_id": "894343c7-c33d-452e-a6a5-b6675f77ee23",
|
||||
"QA_only": true,
|
||||
"real_primary_sources": true,
|
||||
"synthetic_operator_only": true,
|
||||
"created_saved_recovered_via_existing_UI": true,
|
||||
"existing_private_dossier": true,
|
||||
"need_state": "hypothesis",
|
||||
"past_procurement_dates_explicit": true,
|
||||
"client_potential_not_committed": true,
|
||||
"all_five_evidence_entries_retained": true,
|
||||
"internal_workbook_reference_retained_privately": true,
|
||||
"territory_preserved": true,
|
||||
"no_economic_numbers_invented": true,
|
||||
"no_publication_action": true,
|
||||
"no_external_messages": true,
|
||||
"anonymous_dossier_denied": true,
|
||||
"accepted_technical_suites_not_repeated": true,
|
||||
"errors": []
|
||||
},
|
||||
"private_record": {
|
||||
"record_id": 401,
|
||||
"status": "draft",
|
||||
"not_published": true,
|
||||
"unknown_amount_preserved": true,
|
||||
"unknown_real_promoter_preserved": true,
|
||||
"QA_database": "proactive_investment_20261027_test"
|
||||
},
|
||||
"selection": {
|
||||
"selected": "Cahora Bassa",
|
||||
"reason": "Acervo empresarial interno com referências locais + relatório primário HCB2024 + plano primário compras2026 com serviço delimitado. É a combinação de fontes mais directamente utilizável nesta leitura dirigida.",
|
||||
"alternatives": [
|
||||
{
|
||||
"pilot": "Montepuez",
|
||||
"available": "Registos empresariais internos e documentação pública mineira; não se seleccionou um procedimento primário e necessidade tão delimitados nesta ronda.",
|
||||
"limitation": "Não equivale a falta de actividade ou inexistência de necessidades. Sem ranking económico."
|
||||
},
|
||||
{
|
||||
"pilot": "Gurué",
|
||||
"available": "Registos internos com actividades ligadas ao chá e referências públicas territoriais; as fontes de constrangimentos localizadas são antigas ou não delimitam uma procura actual específica.",
|
||||
"limitation": "O piloto continua válido para estudo posterior; não se presume que os constrangimentos antigos persistem."
|
||||
}
|
||||
]
|
||||
},
|
||||
"idea": "Associação de apoio local no Songo com laboratório qualificado para apoio metrológico à HCB; hipótese comercial.",
|
||||
"known_vs_unknown": {
|
||||
"known": "Actividade HCB e necessidade planeada de calibração2026; referências empresariais históricas internas.",
|
||||
"unknown": "Estado/recorrência da contratação,procura por satisfazer,volume,requisitos,oferta e parceiros actuais,preços,meios e viabilidade.",
|
||||
"not_inferred": "Concurso aberto,adjudicação,ausência de oferta,disponibilidade comercial,contrato,acesso,terra,energia ou benefício fiscal."
|
||||
},
|
||||
"source_manifest": [
|
||||
{
|
||||
"alias": "companies.xlsx",
|
||||
"original": "C:\\Mac\\Home\\Documents\\TEMPO\\Portal Tempo\\Dados de empresas\\EMPRESAS_LIST 2014-2022.xlsx",
|
||||
"bytes": 26586267,
|
||||
"sha256": "1ba4c4114b16b407e7746712d00d4f681246bbbc1b42351e96a31f7129acad30",
|
||||
"use": "private analytical read-only working copy; original unchanged"
|
||||
},
|
||||
{
|
||||
"alias": "licensed.xlsx",
|
||||
"original": "C:\\Mac\\Home\\Documents\\TEMPO\\Portal Tempo\\Servicos Tempo\\Relatorios\\novos\\docs\\Empresas Licenciadas.xlsx",
|
||||
"bytes": 34940776,
|
||||
"sha256": "1b5087b464e39e88c42def39655c2391aaaf684b4c832d6a77ff274b98889f00",
|
||||
"use": "private analytical read-only working copy; original unchanged"
|
||||
},
|
||||
{
|
||||
"alias": "tourism.xlsx",
|
||||
"original": "C:\\Mac\\Home\\Documents\\TEMPO\\Portal Tempo\\Servicos Tempo\\Relatorios\\novos\\docs\\CADASTRO DE EMPREENDIMENTOS TURISTICOS 3, 4 E 5 ESTRELAS 30.10.24 18,00h.xlsx",
|
||||
"bytes": 73955,
|
||||
"sha256": "f02e086ed4973ef17234aa6cc54b98fbb7a6952ffb16ec4dc4f7d0c72af6400c",
|
||||
"use": "private analytical read-only working copy; original unchanged"
|
||||
},
|
||||
{
|
||||
"alias": "hcb-concession.pdf",
|
||||
"original": "C:\\Mac\\Home\\Documents\\TEMPO\\Portal Tempo\\Legislacao\\MIREME\\HCB-TERMOS-DO-CONTRATO-DE-CONCESSAO.pdf",
|
||||
"bytes": 142063,
|
||||
"sha256": "f4afc62f140d197cae3bf395674adce2eba37f0436261d52d7eb554f6230a073",
|
||||
"use": "private analytical read-only working copy; original unchanged"
|
||||
},
|
||||
{
|
||||
"alias": "hcb-plan-2026.pdf",
|
||||
"url": "https://igepe.org.mz/wp-content/uploads/2026/06/HCB-Plano-Anual-de-Aquisicoes-2026.pdf",
|
||||
"bytes": 319956,
|
||||
"sha256": "cbc93102fea61a712c193d1c1815e7ec19e7d570ee2703c1b1390d4c05e5bd8e",
|
||||
"accessed": "2026-10-27",
|
||||
"use": "read-only primary source; no portal publication/import"
|
||||
},
|
||||
{
|
||||
"alias": "hcb-report-2024.pdf",
|
||||
"url": "https://hcbadm.mzbusiness.com/wp-content/uploads/2025/08/Relatorio-e-Contas-2024-Bilingue-VF-1.pdf",
|
||||
"bytes": 8215895,
|
||||
"sha256": "d0fed6af0e40fffd6f7f385152fdbfff2a10cae0b66c9d7a59a0a99658758080",
|
||||
"accessed": "2026-10-27",
|
||||
"use": "read-only primary source; no portal publication/import"
|
||||
},
|
||||
{
|
||||
"alias": "hcb-hidroelectricidade.html",
|
||||
"url": "https://www.hcb.co.mz/hidroelectricidade",
|
||||
"bytes": 52772,
|
||||
"sha256": "c5de0e6204909c6cdaea7b249c79897f1cc8539c4f58e4704e4d5844f9542a49",
|
||||
"accessed": "2026-10-27",
|
||||
"use": "read-only primary source; no portal publication/import"
|
||||
},
|
||||
{
|
||||
"alias": "cae.xlsx",
|
||||
"original": "C:/Mac/Home/Documents/TEMPO/Portal Tempo/Dados de empresas/CAE eBAU.xlsx",
|
||||
"bytes": 75018,
|
||||
"sha256": "83b4f1200988e99834c2ae3915346fbf237d128308554b67b5a080d4956bf506",
|
||||
"use": "read-only supplied code labels B857/F857 and B859/F859; not current official-version inference"
|
||||
}
|
||||
],
|
||||
"originals_unchanged": [
|
||||
{
|
||||
"alias": "companies.xlsx",
|
||||
"original_unchanged": true,
|
||||
"sha256": "1ba4c4114b16b407e7746712d00d4f681246bbbc1b42351e96a31f7129acad30"
|
||||
},
|
||||
{
|
||||
"alias": "licensed.xlsx",
|
||||
"original_unchanged": true,
|
||||
"sha256": "1b5087b464e39e88c42def39655c2391aaaf684b4c832d6a77ff274b98889f00"
|
||||
},
|
||||
{
|
||||
"alias": "tourism.xlsx",
|
||||
"original_unchanged": true,
|
||||
"sha256": "f02e086ed4973ef17234aa6cc54b98fbb7a6952ffb16ec4dc4f7d0c72af6400c"
|
||||
},
|
||||
{
|
||||
"alias": "hcb-concession.pdf",
|
||||
"original_unchanged": true,
|
||||
"sha256": "f4afc62f140d197cae3bf395674adce2eba37f0436261d52d7eb554f6230a073"
|
||||
},
|
||||
{
|
||||
"alias": "cae.xlsx",
|
||||
"original_unchanged": true,
|
||||
"sha256": "83b4f1200988e99834c2ae3915346fbf237d128308554b67b5a080d4956bf506"
|
||||
}
|
||||
],
|
||||
"old_QA_rows_unchanged": {
|
||||
"opportunities": {
|
||||
"old_rows_unchanged": 52,
|
||||
"new_rows": 1
|
||||
},
|
||||
"desk_cases": {
|
||||
"old_rows_unchanged": 17,
|
||||
"new_rows": 1
|
||||
},
|
||||
"projects": {
|
||||
"old_rows_unchanged": 19,
|
||||
"new_rows": 0
|
||||
},
|
||||
"geo_locations": {
|
||||
"old_rows_unchanged": 1921,
|
||||
"new_rows": 0
|
||||
},
|
||||
"sectors": {
|
||||
"old_rows_unchanged": 12,
|
||||
"new_rows": 0
|
||||
},
|
||||
"documents": {
|
||||
"old_rows_unchanged": 63,
|
||||
"new_rows": 0
|
||||
},
|
||||
"value_chains": {
|
||||
"old_rows_unchanged": 0,
|
||||
"new_rows": 0
|
||||
}
|
||||
},
|
||||
"technical_accepted_tests_not_repeated": true,
|
||||
"economic_payload_and_recovered_context_private_only": true,
|
||||
"new_publication": false,
|
||||
"external_contact": false,
|
||||
"server_operations": false,
|
||||
"SGF_changes": false,
|
||||
"L8_preserved": "14360748194f3658d91a7d7ae5615efd0fcbfbb7",
|
||||
"matrix_ids": [
|
||||
"RF-CLU-003",
|
||||
"MASTER-471012ab-0010",
|
||||
"MASTER-9dee08d0-0067",
|
||||
"MASTER-471012ab-0067"
|
||||
],
|
||||
"local_proof_directory": "outputs/proactive-real-pilot-20261027",
|
||||
"private_report": "outputs/proactive-real-pilot-20261027/real-case-private-report.html",
|
||||
"next_action": "Preparar reunião exploratória com as perguntas de estado/recorrência,âmbito técnico,oferta,associação e vantagem;nenhuma mensagem enviada."
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"status": "private_regional_opportunity_hypothesis_v3_sustainability_not_demonstrated",
|
||||
"date": "2026-10-27",
|
||||
"baseline": "52f54655d2827e97da2f15d14033e9a2713dddf1",
|
||||
"branch": "codex/proactive-regional-clients-qa-20261027",
|
||||
"runtime_unchanged": "3439f35038f15c93224e6cf876bf559135824d13",
|
||||
"case_id": "CB-METROLOGIA-20261027",
|
||||
"proof": {
|
||||
"case_id": "CB-METROLOGIA-20261027",
|
||||
"record_id": 401,
|
||||
"dossier_id": "894343c7-c33d-452e-a6a5-b6675f77ee23",
|
||||
"previous_source_version": 2,
|
||||
"new_source_version": 3,
|
||||
"before_context_revision": 2,
|
||||
"after_context_revision": 3,
|
||||
"direction": "Regional complementary investment opportunity;three additional prospects,commercial data missing",
|
||||
"need_state": "hypothesis",
|
||||
"evidence_count": 11,
|
||||
"private_draft_not_published": true,
|
||||
"dossier_source_refreshed_through_preview_and_confirmation": true,
|
||||
"deliberate_dossier_fields_unchanged": true,
|
||||
"previous_audit_rows_unchanged": true,
|
||||
"no_new_entities_or_grants": true,
|
||||
"no_new_application_code": true,
|
||||
"accepted_technical_proofs_reused": true,
|
||||
"no_contact_or_server_operations": true,
|
||||
"QA_database": "proactive_investment_20261027_test",
|
||||
"row_preservation": {
|
||||
"opportunities": {
|
||||
"old_rows_unchanged": 52,
|
||||
"updated_case_rows_only": [
|
||||
"401"
|
||||
],
|
||||
"new_rows": 0
|
||||
},
|
||||
"desk_cases": {
|
||||
"old_rows_unchanged": 17,
|
||||
"updated_case_rows_only": [
|
||||
"894343c7-c33d-452e-a6a5-b6675f77ee23"
|
||||
],
|
||||
"new_rows": 0
|
||||
},
|
||||
"projects": {
|
||||
"old_rows_unchanged": 19,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 0
|
||||
},
|
||||
"geo_locations": {
|
||||
"old_rows_unchanged": 1921,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 0
|
||||
},
|
||||
"sectors": {
|
||||
"old_rows_unchanged": 12,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 0
|
||||
},
|
||||
"documents": {
|
||||
"old_rows_unchanged": 63,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 0
|
||||
},
|
||||
"value_chains": {
|
||||
"old_rows_unchanged": 0,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 0
|
||||
},
|
||||
"audit_events": {
|
||||
"old_rows_unchanged": 391,
|
||||
"updated_case_rows_only": [],
|
||||
"new_rows": 3
|
||||
}
|
||||
}
|
||||
},
|
||||
"commercial_data_statement": {
|
||||
"source": "User reply",
|
||||
"date": "2026-10-27",
|
||||
"text": "Ainda não há dados comerciais"
|
||||
},
|
||||
"assessment": "Compatibilidade técnica regional justifica prospecção adicional;procura recorrente,custos,capacidade disponível e sustentabilidade ainda não demonstrados.",
|
||||
"prospects": [
|
||||
{
|
||||
"entity": "HCB",
|
||||
"area": "Songo/Cahora Bassa",
|
||||
"known": "Necessidade metrológica documentada em2026",
|
||||
"status": "Cliente potencial inicial;procura actual/recorrente por confirmar",
|
||||
"quantity": null,
|
||||
"frequency": null,
|
||||
"price": null,
|
||||
"confirmed_order": null,
|
||||
"source": "Fundamento anterior preservado"
|
||||
},
|
||||
{
|
||||
"entity": "Vulcan Mozambique",
|
||||
"area": "Moatize",
|
||||
"known": "Mina,processamento e equipamentos de produção descritos pela própria empresa",
|
||||
"hypothesis": "Instrumentação de processo/manutenção pode beneficiar de apoio metrológico",
|
||||
"status": "Prospecto,não cliente confirmado",
|
||||
"quantity": null,
|
||||
"frequency": null,
|
||||
"price": null,
|
||||
"confirmed_order": null,
|
||||
"related_entity": "Nacala Logistics",
|
||||
"independent_purchase_confirmed": null,
|
||||
"source": "https://www.vulcaninternational.com/products-services/"
|
||||
},
|
||||
{
|
||||
"entity": "EDM",
|
||||
"area": "Tete/Moatize;unidade compradora por identificar",
|
||||
"known": "Plano2025,p68:calibração/teste a nível empresarial;activos deTete/Moatize referenciados",
|
||||
"hypothesis": "Verificar inventário regional e interesse em apoio associado",
|
||||
"status": "Prospecto;sem volume regional atribuído",
|
||||
"quantity": null,
|
||||
"frequency": null,
|
||||
"price": null,
|
||||
"confirmed_order": null,
|
||||
"source": "https://cdn.edm.co.mz/website/imprensa/Plano_Actividades_Orcamento_2025.pdf"
|
||||
},
|
||||
{
|
||||
"entity": "Nacala Logistics",
|
||||
"legal_buyer": null,
|
||||
"area": "Segmento Moatize",
|
||||
"known": "Operação ferroviária/manutenção;concessionárias indicam Vulcan como accionista",
|
||||
"hypothesis": "Verificar instrumentos de manutenção,localização e decisão de compra",
|
||||
"status": "Prospecto ligado àVulcan;diversificação independente não demonstrada",
|
||||
"quantity": null,
|
||||
"frequency": null,
|
||||
"price": null,
|
||||
"confirmed_order": null,
|
||||
"related_entity": "Vulcan Mozambique",
|
||||
"independent_purchase_confirmed": null,
|
||||
"source": "https://www.nacalalogistics.com/quem-somos/"
|
||||
}
|
||||
],
|
||||
"future_excluded_from_base": [
|
||||
{
|
||||
"entity": "Mphanda Nkuwa/GMNK",
|
||||
"status": "Projecto em desenvolvimento",
|
||||
"reason": "Necessidade e datas de operação futuras não demonstradas;sem receitas ou volume na base",
|
||||
"source": "https://www.gmnk.co.mz/en/about-us/project-description/"
|
||||
}
|
||||
],
|
||||
"buyer_data_needed": [
|
||||
"Entidade e centro de decisão/compra;relação com outros prospectos",
|
||||
"Inventário por família/modelo/gama/pontos/critério de aceitação",
|
||||
"Quantidade por janela e periodicidade efectiva de cada instrumento;sem anualizar por defeito",
|
||||
"Solução actual,prestador,prazo fora de serviço,custo total e necessidade ainda não satisfeita",
|
||||
"Interesse e condições de compra para lote/missão ou avença;horizonte de procura"
|
||||
],
|
||||
"partner_capacity_needed": [
|
||||
"Âmbito técnico e local permitido de execução por instrumento,com rastreabilidade",
|
||||
"Capacidade efectivamente disponível e prazo para cada janela;equipa e meios",
|
||||
"Preços por âmbito/lote,embalagem,transporte/seguro,custódia e responsabilidades",
|
||||
"Comprovar capacidade actual dos prestadores locais históricos;licença/CAE não é acreditação de calibração"
|
||||
],
|
||||
"frequency": {
|
||||
"confirmed_programs": null,
|
||||
"confirmed_annual_events": null,
|
||||
"rule": "Usar inventário e programa do proprietário;frequência por família/risco/uso e condições do serviço,não prazo do anúncio nem regra anual presumida."
|
||||
},
|
||||
"economics": {
|
||||
"analysis_unit": "Missão/lote comparável,com famílias e quantidades explícitas;período de análise comum",
|
||||
"mission_contribution": "Receita acordada da missão menos serviço laboratorial,apoio directo,transporte de ida/retorno,embalagem/seguro e outros custos incrementais da mesma missão.",
|
||||
"period_operating_balance": "Soma das contribuições de missões confirmadas menos custos fixos incrementais do mesmo período.",
|
||||
"double_count_prevention": "Transporte partilhado contado uma vez por missão;custos fixos não entram também na contribuição se subtraídos no período. Não somar volumes nacionais à carteira regional ou activos comuns duas vezes.",
|
||||
"sustainability_condition": "Cobertura operacional não basta:avaliar investimento,reposição,fundo de maneio e prazos de recebimento;testar concentração e perda de cliente antes de declarar serviço sustentável.",
|
||||
"numeric_inputs": {
|
||||
"missions": null,
|
||||
"instruments": null,
|
||||
"period": null,
|
||||
"prices": null,
|
||||
"laboratory_cost": null,
|
||||
"local_support_cost": null,
|
||||
"route_cost": null,
|
||||
"fixed_cost": null,
|
||||
"investment": null,
|
||||
"working_capital": null,
|
||||
"net_advantage": null,
|
||||
"break_even": null
|
||||
},
|
||||
"missing_is_not_zero": true,
|
||||
"scenarios_to_compare": [
|
||||
"Atendimento individual no Songo",
|
||||
"Missões agrupadas Songo–Tete/Moatize,apenas com janelas compatíveis",
|
||||
"Organização de apoio em Tete/Moatize com deslocação ao Songo;sem mudança canónica presumida"
|
||||
],
|
||||
"not_used_as_price": "Orçamento2025daEDM,capacidade de produção da mina,tarifas ferroviárias ou preços fictícios."
|
||||
},
|
||||
"source_register": [
|
||||
{
|
||||
"file": "vulcan.html",
|
||||
"url": "https://www.vulcaninternational.com/products-services/",
|
||||
"sha256": "44c92a7a405e7b84f51a6602a487ee4cbcb5e9d3ed42d6c9b2a47f55ba01800e",
|
||||
"bytes": 64512,
|
||||
"accessed": "2026-10-27",
|
||||
"use": "Private source copy;no automatic portal import/publication"
|
||||
},
|
||||
{
|
||||
"file": "nacala-company.html",
|
||||
"url": "https://www.nacalalogistics.com/quem-somos/",
|
||||
"sha256": "4c8c2f98a94f013ab463937c1ac343e26af2ea5fe82226764168b766dfea2c55",
|
||||
"bytes": 246823,
|
||||
"accessed": "2026-10-27",
|
||||
"use": "Private source copy;no automatic portal import/publication"
|
||||
},
|
||||
{
|
||||
"file": "nacala-operations.html",
|
||||
"url": "https://www.nacalalogistics.com/faq/",
|
||||
"sha256": "21f70dbbb8a9ea99f0ca3af728aa3b6a888e361994d78dae5292813437acdd9f",
|
||||
"bytes": 214596,
|
||||
"accessed": "2026-10-27",
|
||||
"use": "Private source copy;no automatic portal import/publication"
|
||||
},
|
||||
{
|
||||
"file": "edm-plan-2025.pdf",
|
||||
"url": "https://cdn.edm.co.mz/website/imprensa/Plano_Actividades_Orcamento_2025.pdf",
|
||||
"sha256": "8e25e3070062e6cad4a39449cb6d494263671506ff7bc71ce100787ae1bd80f1",
|
||||
"bytes": 25468134,
|
||||
"accessed": "2026-10-27",
|
||||
"use": "Private source copy;no automatic portal import/publication"
|
||||
},
|
||||
{
|
||||
"file": "gmnk-project.html",
|
||||
"url": "https://www.gmnk.co.mz/en/about-us/project-description/",
|
||||
"sha256": "705afaaba50074812aaf0884cd8757cfaba1e32dd83f90726d8755869b72d5f8",
|
||||
"bytes": 188060,
|
||||
"accessed": "2026-10-27",
|
||||
"use": "Private source copy;no automatic portal import/publication"
|
||||
}
|
||||
],
|
||||
"technical_delivery_independent": true,
|
||||
"no_publication_installation_or_external_messages": true,
|
||||
"accepted_proofs_reused": true,
|
||||
"L8_preserved": "14360748194f3658d91a7d7ae5615efd0fcbfbb7",
|
||||
"SGF_untouched": true,
|
||||
"evidence_directory": "outputs/proactive-regional-clients-20261027",
|
||||
"matrix_ids": [
|
||||
"RF-CLU-003",
|
||||
"MASTER-471012ab-0010",
|
||||
"MASTER-9dee08d0-0067",
|
||||
"MASTER-471012ab-0067"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,412 @@
|
||||
{
|
||||
"date": "2026-10-28",
|
||||
"status": "installed_technical_delta_verified_authenticated_visual_conference_pending",
|
||||
"served_commit": "6d1476936920dc5715d4493b1f8b22a3d51935f4",
|
||||
"accepted_QA_candidate": "a022ed9848b41ba342b4209414c2bbf2ebd0a7a3",
|
||||
"previous_runtime": "569a1cd750f3d2a0b87f130e992e73e070bbd1ab",
|
||||
"normal_Git_fast_forward": true,
|
||||
"force_used": false,
|
||||
"original_QA_and_history_preserved": true,
|
||||
"scope": "private comparative supply base integrated into existing proactive journey;not automatic public directory",
|
||||
"counts": {
|
||||
"administrative_observations": 361464,
|
||||
"repetitions_preserved": 147165,
|
||||
"distinct_administrative_projections": 214299,
|
||||
"unique_companies": null,
|
||||
"Gurué_distinct_observations": 435,
|
||||
"Gurué_repetitions_excluded": 237,
|
||||
"comparison_API_rejects_preserved_duplicate_as_another_comparison": true
|
||||
},
|
||||
"limits": {
|
||||
"national_coverage": "partial",
|
||||
"missing_records": "insufficient information;never proof of absent supply",
|
||||
"investment_conclusion": "hypothesis only;no automatic proof of demand,capacity,contracts or viability",
|
||||
"unmapped_territory": 205608,
|
||||
"province_only": 336,
|
||||
"activity_unclassified": 82864,
|
||||
"shared_identifier_name_conflicts": 113880,
|
||||
"unnamed_observations_preserved": 18423
|
||||
},
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-proactive-supply-delivery-20261028/backup-install",
|
||||
"created_at": "2026-10-28T17:10:23Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "1a0bc3767062633ba35afe1308c7f29ef441a01dba35551534ed1eef9e8e8509",
|
||||
"files_sha256": "e622cdd04a252740ad1d0c626a9de32aaf1e71f3c986591cdbd94bafd314a1d7",
|
||||
"restore_verified": false
|
||||
},
|
||||
"backup_restore_rehearsal": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "proactive_supply_delivery_20261028_test",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "1a0bc3767062633ba35afe1308c7f29ef441a01dba35551534ed1eef9e8e8509",
|
||||
"active_database_writes": 0,
|
||||
"private_import_first": {
|
||||
"candidate": "a022ed9848b41ba342b4209414c2bbf2ebd0a7a3",
|
||||
"records": 361464,
|
||||
"source_counts": {
|
||||
"1ba4c4114b16b407e7746712d00d4f681246bbbc1b42351e96a31f7129acad30": 148556,
|
||||
"1b5087b464e39e88c42def39655c2391aaaf684b4c832d6a77ff274b98889f00": 212631,
|
||||
"f02e086ed4973ef17234aa6cc54b98fbb7a6952ffb16ec4dc4f7d0c72af6400c": 277,
|
||||
"83b4f1200988e99834c2ae3915346fbf237d128308554b67b5a080d4956bf506": 0
|
||||
},
|
||||
"raw_sha256": "dec9db62a52a8bac5f1e2675aecbeb4239f2b1f4fa521db01693c32bdfeef01e",
|
||||
"sql_bytes": 201634556,
|
||||
"mode": "rehearsal",
|
||||
"unique_company_count": null,
|
||||
"duplicate_suppression": "WHERE duplicate_of IS NULL;retained administrative sightings do not count as separate offers",
|
||||
"national_coverage": "partial",
|
||||
"investment_conclusion": "hypothesis only;does not prove demand or viability",
|
||||
"database": "proactive_supply_delivery_20261028_test|55441",
|
||||
"before": 0,
|
||||
"after": {
|
||||
"records": 361464,
|
||||
"distinct_observations": 214299,
|
||||
"repeated_projections": 147165,
|
||||
"not_unique_companies": true,
|
||||
"published": false
|
||||
},
|
||||
"idempotent_no_overwrite": true,
|
||||
"active_existing_business_data_touched": false
|
||||
},
|
||||
"private_import_replay": {
|
||||
"candidate": "a022ed9848b41ba342b4209414c2bbf2ebd0a7a3",
|
||||
"records": 361464,
|
||||
"source_counts": {
|
||||
"1ba4c4114b16b407e7746712d00d4f681246bbbc1b42351e96a31f7129acad30": 148556,
|
||||
"1b5087b464e39e88c42def39655c2391aaaf684b4c832d6a77ff274b98889f00": 212631,
|
||||
"f02e086ed4973ef17234aa6cc54b98fbb7a6952ffb16ec4dc4f7d0c72af6400c": 277,
|
||||
"83b4f1200988e99834c2ae3915346fbf237d128308554b67b5a080d4956bf506": 0
|
||||
},
|
||||
"raw_sha256": "dec9db62a52a8bac5f1e2675aecbeb4239f2b1f4fa521db01693c32bdfeef01e",
|
||||
"sql_bytes": 201634556,
|
||||
"mode": "rehearsal",
|
||||
"unique_company_count": null,
|
||||
"duplicate_suppression": "WHERE duplicate_of IS NULL;retained administrative sightings do not count as separate offers",
|
||||
"national_coverage": "partial",
|
||||
"investment_conclusion": "hypothesis only;does not prove demand or viability",
|
||||
"database": "proactive_supply_delivery_20261028_test|55441",
|
||||
"before": 361464,
|
||||
"after": {
|
||||
"records": 361464,
|
||||
"distinct_observations": 214299,
|
||||
"repeated_projections": 147165,
|
||||
"not_unique_companies": true,
|
||||
"published": false
|
||||
},
|
||||
"idempotent_no_overwrite": true,
|
||||
"active_existing_business_data_touched": false
|
||||
},
|
||||
"baseline_public_tables_unchanged_after_import": 174,
|
||||
"actual_application_role": "teste_investidor_app",
|
||||
"RLS_without_actor_rows": 0,
|
||||
"Gurue": {
|
||||
"observations": 435,
|
||||
"retained_repetitions": 237,
|
||||
"not_unique_companies": true
|
||||
},
|
||||
"storage": {
|
||||
"private_relations_bytes": 344399872,
|
||||
"database_bytes": 409070739
|
||||
},
|
||||
"catalogue_backup_restore": {
|
||||
"verified": true,
|
||||
"sha256": "7ebb8791d5871bb4752a3e6e964a398c0f8fc094a10aab0e33aaee202dfc62d3",
|
||||
"rows": 361464,
|
||||
"forced_RLS_tables": 2,
|
||||
"row_checksum": "9f9773492aa45f498201ff791726004a"
|
||||
},
|
||||
"import_and_replay_seconds": 67.3371156482026,
|
||||
"no_application_users_or_dossiers_created": true,
|
||||
"no_publication": true,
|
||||
"active_data_writes": 0
|
||||
},
|
||||
"private_base_load": {
|
||||
"at": "2026-10-28T17:14:46.618843+00:00",
|
||||
"baseline": "569a1cd750f3d2a0b87f130e992e73e070bbd1ab",
|
||||
"private_schema_created": 2,
|
||||
"new_migration_registry_rows": 1,
|
||||
"new_grants": "SELECT only on the two new private tables to the existing application role;no employee assignment or public grant",
|
||||
"import": {
|
||||
"candidate": "a022ed9848b41ba342b4209414c2bbf2ebd0a7a3",
|
||||
"records": 361464,
|
||||
"source_counts": {
|
||||
"1ba4c4114b16b407e7746712d00d4f681246bbbc1b42351e96a31f7129acad30": 148556,
|
||||
"1b5087b464e39e88c42def39655c2391aaaf684b4c832d6a77ff274b98889f00": 212631,
|
||||
"f02e086ed4973ef17234aa6cc54b98fbb7a6952ffb16ec4dc4f7d0c72af6400c": 277,
|
||||
"83b4f1200988e99834c2ae3915346fbf237d128308554b67b5a080d4956bf506": 0
|
||||
},
|
||||
"raw_sha256": "dec9db62a52a8bac5f1e2675aecbeb4239f2b1f4fa521db01693c32bdfeef01e",
|
||||
"sql_bytes": 201634556,
|
||||
"mode": "apply",
|
||||
"unique_company_count": null,
|
||||
"duplicate_suppression": "WHERE duplicate_of IS NULL;retained administrative sightings do not count as separate offers",
|
||||
"national_coverage": "partial",
|
||||
"investment_conclusion": "hypothesis only;does not prove demand or viability",
|
||||
"database": "teste_investidor|5432",
|
||||
"before": 0,
|
||||
"after": {
|
||||
"records": 361464,
|
||||
"distinct_observations": 214299,
|
||||
"repeated_projections": 147165,
|
||||
"not_unique_companies": true,
|
||||
"published": false
|
||||
},
|
||||
"idempotent_no_overwrite": true,
|
||||
"active_existing_business_data_touched": false
|
||||
},
|
||||
"schema_contract_delta": "one reviewed migration appended;all90 previous entries unchanged",
|
||||
"pipeline_script_unchanged": true,
|
||||
"publication": false,
|
||||
"code_installation_pending": true,
|
||||
"backup_dump_sha256": "1a0bc3767062633ba35afe1308c7f29ef441a01dba35551534ed1eef9e8e8509"
|
||||
},
|
||||
"capacity": {
|
||||
"at": "2026-10-28T17:13:59.594789+00:00",
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"free_bytes": 86519189504,
|
||||
"free_inodes": 23490190
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"free_bytes": 86519189504,
|
||||
"free_inodes": 23490190
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"free_bytes": 86519189504,
|
||||
"free_inodes": 23490190
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"free_bytes": 86519189504,
|
||||
"free_inodes": 23490190
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"free_bytes": 86519189504,
|
||||
"free_inodes": 23490190
|
||||
}
|
||||
],
|
||||
"required_budget_bytes": 6259143420,
|
||||
"budget_basis": "existing5GiB build guard+twice measured private relations+measured SQL staging;already-created backups/stages included in actual free space",
|
||||
"backup_sha256": "1a0bc3767062633ba35afe1308c7f29ef441a01dba35551534ed1eef9e8e8509",
|
||||
"backup_restore_verified": true,
|
||||
"active_writes": 0
|
||||
},
|
||||
"installed_delta": {
|
||||
"at": "2026-10-28T17:22:03.023596+00:00",
|
||||
"served_commit": "6d1476936920dc5715d4493b1f8b22a3d51935f4",
|
||||
"backup_dump_sha256": "1a0bc3767062633ba35afe1308c7f29ef441a01dba35551534ed1eef9e8e8509",
|
||||
"prior_public_tables_checked": 174,
|
||||
"prior_domain_rows_preserved": true,
|
||||
"new_migration_registry_rows": 1,
|
||||
"operational_delta": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 111,
|
||||
"checksum": "a9dc6868205af2190cee2d2787ee8b66"
|
||||
},
|
||||
"after": {
|
||||
"rows": 111,
|
||||
"checksum": "08c098b3fde0052afa05aae647d18c5f"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 7,
|
||||
"checksum": "ef549836d7a2e0549b1a32f1627c83f4"
|
||||
},
|
||||
"after": {
|
||||
"rows": 8,
|
||||
"checksum": "4a8b547e0552be4da65bcb97d3851a49"
|
||||
}
|
||||
}
|
||||
},
|
||||
"persistent_files_and_configuration_identical": 369,
|
||||
"private_catalogue": {
|
||||
"observations": 361464,
|
||||
"distinct_administrative_observations": 214299,
|
||||
"preserved_repetitions": 147165,
|
||||
"unmapped_territory": 205608
|
||||
},
|
||||
"Gurue": {
|
||||
"observations": 435,
|
||||
"repetitions": 237
|
||||
},
|
||||
"RLS_without_actor_rows": 0,
|
||||
"anonymous_query_status": 401,
|
||||
"public_revision_confirmed": true,
|
||||
"actual_team_UI_journey": "pending authenticated browser conference;accepted QA is not repeated",
|
||||
"unique_company_count": null,
|
||||
"publication": false,
|
||||
"national_coverage": "partial",
|
||||
"investment_conclusion": "hypothesis,not proved demand or viability",
|
||||
"L8": "unchanged,partial"
|
||||
},
|
||||
"application_consumer": {
|
||||
"installed_application_service_read": true,
|
||||
"existing_actor_passes_existing_profile_authorization": true,
|
||||
"application_database_identity": {
|
||||
"database": "teste_investidor",
|
||||
"role": "teste_investidor_app",
|
||||
"port": 5432
|
||||
},
|
||||
"observations": 435,
|
||||
"preserved_repetitions_excluded": 237,
|
||||
"empty_results": "Informação insuficiente nesta base e nestes filtros.",
|
||||
"source_metadata_present": true,
|
||||
"no_new_actor_grant_or_record": true,
|
||||
"read_only": true,
|
||||
"proof_kind": "technical CLI consumer,not authenticated team browser acceptance"
|
||||
},
|
||||
"operational_delta": {
|
||||
"status": "operational_delta_reconciled",
|
||||
"comparison_identity": "postgres before/after;isolated restored baseline;no RLS visibility inference",
|
||||
"cache": "queue:restart;requestthrottle;identical home-sector cached value with refreshed expiry(HomeController remember10min);no deletedcache",
|
||||
"sessions": "anonymous sessions from delivery user-agent or exactUA/time correlated with nginx public request;deleted sessions individually expired beyond configured lifetime,normal database session garbage collection(config/session lottery2/100)",
|
||||
"delta": {
|
||||
"cache": {
|
||||
"before_rows": 111,
|
||||
"after_rows": 111,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "7f7dd83f47f5bf404d55e6e9f1367948721579970b195680645e356031a070ff",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"value",
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-illuminate:queue:restart",
|
||||
"is_queue_restart_key": true,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": false,
|
||||
"same_value_home_cache_expiry_refresh": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"before_rows": 7,
|
||||
"after_rows": 9,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "5cb21cc6c5f36834d39f2aa929d2272b65358654155858bae027abe4ccdf5c4e",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "6fa8f1e07be4cea4d35b9ee67f1e480f35baac9228f33c5161f24e2aac5e33f2",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"business_tables_to_confirm_separately": 172,
|
||||
"active_data_writes_by_comparison": 0,
|
||||
"restore_network": "none"
|
||||
},
|
||||
"installer_and_catalogue_backup": {
|
||||
"at": "2026-10-28T17:24:41.602671+00:00",
|
||||
"installed_commit": "6d1476936920dc5715d4493b1f8b22a3d51935f4",
|
||||
"previous_release_preserved": "/var/www/investmoz-homologacao/releases/569a1cd750f3d2a0b87f130e992e73e070bbd1ab-53a57d6f",
|
||||
"installer_CI": [
|
||||
"\u001b[30;42mOK (1 test, 3106 assertions)\u001b[0m",
|
||||
"✓ built in 31.30s",
|
||||
"\u001b[30;42mOK (59 tests, 317 assertions)\u001b[0m",
|
||||
"# tests 1146",
|
||||
"# pass 1146",
|
||||
"# fail 0"
|
||||
],
|
||||
"accepted_QA_reused": {
|
||||
"tests": 7,
|
||||
"assertions": 62,
|
||||
"Gurue_browser_proof": "accepted earlier;not repeated as a prerequisite"
|
||||
},
|
||||
"delivery_delta_test": {
|
||||
"tests": 1,
|
||||
"assertions": 2,
|
||||
"scope": "repeated source sightings cannot inflate saved comparisons"
|
||||
},
|
||||
"installed_private_catalogue_backup": {
|
||||
"path": "/var/backups/investmoz-proactive-supply-delivery-20261028/catalogue-installed.dump",
|
||||
"bytes": 63461920,
|
||||
"sha256": "18f71d0ad72aae9645a6101c6388c4d7f481e56ef2d41dc64241245314e85d55",
|
||||
"read_grants_and_RLS_in_dump": true
|
||||
},
|
||||
"existing_pipeline_script_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604",
|
||||
"code_branch": "main",
|
||||
"forced_push": false,
|
||||
"automatic_publication": false
|
||||
},
|
||||
"schema_and_access": "two new private tables,forced RLS,one migration registry row;SELECT only to existing application database role;no employee-role assignments changed;ninety earlier migration hashes preserved and one appended to the existing installer contract;installer program unchanged",
|
||||
"accepted_proofs_reused": {
|
||||
"QA_tests": 7,
|
||||
"QA_assertions": 62,
|
||||
"Gurue_saved_reload_dossier_chain": "accepted earlier in isolated QA;not falsely presented as new team acceptance"
|
||||
},
|
||||
"delivery_delta_test": {
|
||||
"tests": 1,
|
||||
"assertions": 2,
|
||||
"reason": "explicit non-inflation requirement;reject a preserved repeated observation as another saved comparison"
|
||||
},
|
||||
"visual_conference": {
|
||||
"status": "pending",
|
||||
"known_blocker": "The browser access host is unavailable",
|
||||
"technical_consumer_is_not_team_UI_acceptance": true,
|
||||
"manual_remaining": "Gurué → consultar oferta → comparar ideia → guardar → recuperar no mesmo dossier,com fontes,datas e incertezas;435 observações,não empresas únicas;listas internas,cobertura parcial e hipótese preservadas.",
|
||||
"blocker_history": [
|
||||
"Windows Computer Use could not determine the current browser URL with enough confidence to enforce policy"
|
||||
],
|
||||
"mechanism": "Browser access connector host unavailable;opening a tab alone does not restore the connector. No documented host-restart operation is exposed in the available browser control API.",
|
||||
"next_action": "Restabelecer o conector por mecanismo suportado ou receber conferência autenticada da equipa;nenhuma reinstalação ou repetição das provas técnicas aceites."
|
||||
},
|
||||
"preservation": "prior domain rows unchanged;369 persistent files/configuration identical;only intended migration row and new private base added;queue restart and2anonymous delivery sessions reconciled separately;no QA user,organisation,opportunity or dossier copied to active",
|
||||
"publication": false,
|
||||
"L8": "unchanged,partial;no fiscal code or calculation delta",
|
||||
"remote_receipts_root": "/var/backups/investmoz-proactive-supply-delivery-20261028",
|
||||
"local_proofs": "C:\\laragon\\www\\portal-investidor\\outputs\\proactive-supply-delivery-20261028",
|
||||
"restriction_origins": {
|
||||
"private_analysis_no_auto_publication_no_false_market_vacancy_no_duplicate_inflation": "explicit Tempo decisions",
|
||||
"backup_restore_QA_isolation_preservation": "AGENTS.md",
|
||||
"exact_hashes_temporary_index_database_identity_contract": "technical implementation choices;not new organisational approvals"
|
||||
},
|
||||
"documentation_correction": {
|
||||
"date": "2026-10-28",
|
||||
"origin": "explicit Tempo correction",
|
||||
"installed_revision_unchanged": "6d147693",
|
||||
"previous_remote_receipt_preserved_sha256": "2e306482a2dc4aea79acd77239309a3307950eddbbd9ea77db9c7f28c47d2110",
|
||||
"scope": "documentation only;no active write,no reinstall,no repeated technical tests"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
{
|
||||
"date": "2026-10-27",
|
||||
"status": "team_UI_delta_demonstrated_consolidated_candidate_not_installed",
|
||||
"branch": "codex/proactive-team-autonomy-qa-20261027",
|
||||
"runtime_commit": "51d536b7ba0d525323200418155459620ec07e41",
|
||||
"previous_candidate": "403c444a3e14e0ed83276ca318ad95083195708f",
|
||||
"accepted_technical_candidate": "1afab4a2a71f182f260e4d2555d79242261a4d2a",
|
||||
"main_checked": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"main_ancestor": true,
|
||||
"delta": "InvestmentComplements:authorised private preparation returns no public offers;public complements and access checks preserved",
|
||||
"new_tests": {
|
||||
"count": 2,
|
||||
"assertions": 18,
|
||||
"result": "passed",
|
||||
"scope": "private complement lookup,mixed public/private sources,unauthorised access",
|
||||
"transaction_rollback": true
|
||||
},
|
||||
"proof": {
|
||||
"record_id": 403,
|
||||
"dossier_id": "5bc28554-a2d1-4e60-9181-93ba0ecede59",
|
||||
"source_version": 4,
|
||||
"previous_context_revision": 1,
|
||||
"context_revision": 2,
|
||||
"same_dossier_continued": true,
|
||||
"private_source": true,
|
||||
"need_state": "hypothesis",
|
||||
"document_id": "19abe9ce-4c3f-4d53-b960-7ce0fc00435e",
|
||||
"resource_id": "d2c76068-3856-420c-8d2d-272684e92b70",
|
||||
"response_sha256": "b6cb6a7b7230a75bf5f4d56a7a2c1ac0dec7bb0fae0b85381eda56e53f0977c5",
|
||||
"scan": "clean",
|
||||
"scan_engine": "ClamAV",
|
||||
"download_matches_original": true,
|
||||
"response_reference_recovered_in_analysis_and_dossier": true,
|
||||
"deliberate_title_preserved": true,
|
||||
"old_source_snapshot_preserved": true,
|
||||
"new_UI_workflow": "normal login/MFA;create private draft;upload/recover original;associate response;revise idea;private dossier preview/confirm;edit again;continue same dossier;preview/confirm/reload",
|
||||
"no_service_or_SQL_writes_for_demonstration": true,
|
||||
"read_only_verification": true,
|
||||
"no_actual_team_training_session_claimed": true,
|
||||
"row_preservation": {
|
||||
"opportunities": {
|
||||
"old_rows_unchanged": 54,
|
||||
"new_rows": 1
|
||||
},
|
||||
"desk_cases": {
|
||||
"old_rows_unchanged": 19,
|
||||
"new_rows": 1
|
||||
},
|
||||
"documents": {
|
||||
"old_rows_unchanged": 63,
|
||||
"new_rows": 1
|
||||
},
|
||||
"opportunity_documents": {
|
||||
"old_rows_unchanged": 0,
|
||||
"new_rows": 1
|
||||
},
|
||||
"projects": {
|
||||
"old_rows_unchanged": 19,
|
||||
"new_rows": 0
|
||||
},
|
||||
"geo_locations": {
|
||||
"old_rows_unchanged": 1921,
|
||||
"new_rows": 0
|
||||
},
|
||||
"sectors": {
|
||||
"old_rows_unchanged": 12,
|
||||
"new_rows": 0
|
||||
},
|
||||
"value_chains": {
|
||||
"old_rows_unchanged": 0,
|
||||
"new_rows": 0
|
||||
},
|
||||
"organizations": {
|
||||
"old_rows_unchanged": 3,
|
||||
"new_rows": 0
|
||||
},
|
||||
"audit_events": {
|
||||
"old_rows_unchanged": 399,
|
||||
"new_rows": 10
|
||||
}
|
||||
},
|
||||
"Songo401_and_Gurue402_unchanged": true,
|
||||
"new_masters_or_grants": false,
|
||||
"publication_or_contact_external": false,
|
||||
"accepted_unaffected_suites_reused": true
|
||||
},
|
||||
"accepted_proofs_reused": [
|
||||
"14 API/139 assertions",
|
||||
"7 frontend report tests",
|
||||
"normal login/MFA and create/edit/history",
|
||||
"explicit publication/anonymous access controls",
|
||||
"Wayfinder --with-form",
|
||||
"TypeScript",
|
||||
"isolated QA frontend build"
|
||||
],
|
||||
"frontend_changed": false,
|
||||
"schema_or_configuration_changed": false,
|
||||
"no_new_roles_or_grants": true,
|
||||
"pilots_not_published_or_modified": [
|
||||
401,
|
||||
402
|
||||
],
|
||||
"commercial_outreach": false,
|
||||
"human_team_training_claimed": false,
|
||||
"L8_preserved": "14360748194f3658d91a7d7ae5615efd0fcbfbb7",
|
||||
"server_operations": false,
|
||||
"installation_conditions": [
|
||||
"fresh capacity/inodes measurement against build and backup requirements",
|
||||
"recheck current main",
|
||||
"fresh backup/restore",
|
||||
"keep active release until new ready",
|
||||
"verify served revision and installed delta only"
|
||||
],
|
||||
"private_outputs": "outputs/proactive-team-autonomy-20261027/"
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"date": "2026-10-27",
|
||||
"status": "exercise_prepared_awaiting_real_team_use",
|
||||
"installed_reference_from_accepted_receipt": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"installation_receipt": "docs/investmoz/unification/sequential-delivery-installed-20261027.json",
|
||||
"guide": "docs/investmoz/unification/traceability-and-manual.md#27102026--avaliação-de-utilização-pela-equipa-sem-codex",
|
||||
"evaluation_scope": [
|
||||
"prepare a private work analysis using an existing authorised source",
|
||||
"record evidence with source,period,coverage and distinction between fact and hypothesis",
|
||||
"structure a complementary idea with clients/payer,conditions and unknowns",
|
||||
"save and recover through the interface",
|
||||
"preview/confirm and recover in the same dossier",
|
||||
"revise a pending point and recover the new version without duplication"
|
||||
],
|
||||
"existing_guide_reused": true,
|
||||
"technical_proofs_reused": true,
|
||||
"new_technical_tests": 0,
|
||||
"new_installations": 0,
|
||||
"active_application_writes": 0,
|
||||
"private_pilots_modified": false,
|
||||
"team_messages_sent": 0,
|
||||
"team_execution_observed": false,
|
||||
"participants": [],
|
||||
"observed_results": [],
|
||||
"Codex_executes_team_exercise": false,
|
||||
"existing_authorised_accounts_only": true,
|
||||
"new_permissions_or_roles": false,
|
||||
"not_a_new_approval_gate": true,
|
||||
"results_to_return": [
|
||||
"date and operational profile",
|
||||
"internal analysis/dossier references in authorised channel",
|
||||
"steps achieved and guide/human help used",
|
||||
"step/field and concrete difficulty",
|
||||
"exact message or behaviour and expected result"
|
||||
],
|
||||
"resume_when": "Real team observations arrive;address only reported usability/access/save-recovery obstacles",
|
||||
"commercial_validation_separate": true,
|
||||
"Songo_and_Gurue": "private;external commercial evidence pending",
|
||||
"L8": "partial;PEC and own credits separate"
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,759 @@
|
||||
{
|
||||
"date": "2026-10-27",
|
||||
"status": "installed_and_verified",
|
||||
"served_commit": "669cb8979b0c372659fc2ad3876aebc919d5df19",
|
||||
"previous_commit": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"remote_backup": "/var/backups/investmoz-sector-navigation-20261027/backup",
|
||||
"remote_receipt": "/var/backups/investmoz-sector-navigation-20261027/installed-receipt.json",
|
||||
"runtime_delta": [
|
||||
{
|
||||
"file": "app/Http/Controllers/PortalServicesController.php",
|
||||
"before_sha256": "512cc1e2a45a62f4164076a77c5b005a507c6f2150c4fbf7f834193b6357e6f8",
|
||||
"after_sha256": "9bf672f584e5012ec5d8b71828c83ea40d6c116619a41f985396d4531d733cdf"
|
||||
},
|
||||
{
|
||||
"file": "resources/js/pages/portal/services.tsx",
|
||||
"before_sha256": "434790ec829e8f6cb012f88da3871746593051eb7fd6034b6e7977eb2bef4e73",
|
||||
"after_sha256": "9621eaec71bbb87157dbe41841ba1c098e2b5603a72bbaa80adf3bceaa14b61c"
|
||||
}
|
||||
],
|
||||
"source_files_verified": 1000,
|
||||
"qa": {
|
||||
"tests": 3,
|
||||
"assertions": 319,
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"port": 55441,
|
||||
"rollback": true,
|
||||
"routes_types_build": "passed",
|
||||
"browser": "10 unique cards;Agronegocio/Turismo isolated;sector filter,back,reload,guest dossier entry preserved",
|
||||
"screenshot": "unavailable (zero width);AX proof retained"
|
||||
},
|
||||
"installer": {
|
||||
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "669cb8979b0c372659fc2ad3876aebc919d5df19",
|
||||
"release": "/var/www/investmoz-homologacao/releases/669cb8979b0c372659fc2ad3876aebc919d5df19-6a2f00c6",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/9fda6d6e12832a3cf25e7314f1f895dd430238c5-88fc859c",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "669cb8979b0c372659fc2ad3876aebc919d5df19",
|
||||
"release": "/var/www/investmoz-homologacao/releases/669cb8979b0c372659fc2ad3876aebc919d5df19-6a2f00c6",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/9fda6d6e12832a3cf25e7314f1f895dd430238c5-88fc859c",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"669cb8979b0c372659fc2ad3876aebc919d5df19"
|
||||
],
|
||||
"finished_at": "2026-10-27T11:53:24.879567+00:00"
|
||||
},
|
||||
"log_file": "1793101792543556387.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 31.42s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 1080",
|
||||
"# pass 1080",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 306104
|
||||
},
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-sector-navigation-20261027/backup",
|
||||
"created_at": "2026-10-27T11:44:59Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "9b2437017495fe449cfe0c869da62870bd0fc4bddde596660a37392b8dbdaaba",
|
||||
"files_sha256": "bf268753549312be793605de294105ac6836ff96a16ab740b1a2c929a15a523a",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "sector_navigation_restore_20261027",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "9b2437017495fe449cfe0c869da62870bd0fc4bddde596660a37392b8dbdaaba",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"capacity_after_backup": {
|
||||
"at": "2026-10-27T11:48:33.493720+00:00",
|
||||
"baseline": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"capacity_after_backup_satisfied": true,
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"free_bytes": 94615425024,
|
||||
"free_inodes": 23762622
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"free_bytes": 94615425024,
|
||||
"free_inodes": 23762622
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"free_bytes": 94615425024,
|
||||
"free_inodes": 23762622
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"free_bytes": 94615425024,
|
||||
"free_inodes": 23762622
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"free_bytes": 94615425024,
|
||||
"free_inodes": 23762622
|
||||
}
|
||||
],
|
||||
"backup_age_seconds": 214.493685,
|
||||
"backup_dump_sha256": "9b2437017495fe449cfe0c869da62870bd0fc4bddde596660a37392b8dbdaaba",
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"files_verified": 369,
|
||||
"backup_paths": {
|
||||
"dump": "/var/backups/investmoz-sector-navigation-20261027/backup/database.dump",
|
||||
"files": "/var/backups/investmoz-sector-navigation-20261027/backup/files-before.tar.gz"
|
||||
},
|
||||
"active_writes": 0
|
||||
},
|
||||
"schema_permissions": {
|
||||
"schema_sha256": "5045b3e51d2185377aa3d9ac7fa07a44fad3ec620cdfa83ffe31c8884ee1601d",
|
||||
"roles_grants_sha256": "1530c33cb016e67bfdc64891ddfce7f185b13b56b2cd87c012871a685e118109",
|
||||
"filesystem_permissions": {
|
||||
".env": {
|
||||
"mode": 416,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage/app": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"bootstrap/cache": {
|
||||
"mode": 1528,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
}
|
||||
},
|
||||
"comparison_identity": "postgres;catalogue read only;no passwords collected",
|
||||
"unchanged": true
|
||||
},
|
||||
"preservation": {
|
||||
"checked_at": "2026-10-27T11:55:17.440349+00:00",
|
||||
"installed": "669cb8979b0c372659fc2ad3876aebc919d5df19",
|
||||
"business_tables_unchanged": 172,
|
||||
"total_tables": 174,
|
||||
"operational_tables_to_reconcile": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 108,
|
||||
"checksum": "0d9184e9b1f30ace1b1da4990b284ed9"
|
||||
},
|
||||
"after": {
|
||||
"rows": 108,
|
||||
"checksum": "6cf70f4b3bfc3a57f18b68080f939a19"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 21,
|
||||
"checksum": "a5144e0ab915427ad1a8dddb70d8beee"
|
||||
},
|
||||
"after": {
|
||||
"rows": 41,
|
||||
"checksum": "261778bcf00473e4d1792749cc5ec6d0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"persistent_files_unchanged": 369,
|
||||
"original_configuration_preserved": true,
|
||||
"synthetic_QA_storage_not_served": true,
|
||||
"QA_storage_saved_outside_active": "/var/lib/investmoz-deploy/qa-runtime/669cb8979b0c372659fc2ad3876aebc919d5df19-6a2f00c6",
|
||||
"fixture_or_content_imports": 0,
|
||||
"migrations": 0,
|
||||
"comparison_identity": "postgres;UTC;consistent before snapshot and after read-only transaction",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"operational_delta": {
|
||||
"status": "operational_delta_reconciled",
|
||||
"comparison_identity": "postgres before/after;isolated restored baseline;no RLS visibility inference",
|
||||
"cache": "queue:restart;requestthrottle;identical home-sector cached value with refreshed expiry(HomeController remember10min);no deletedcache",
|
||||
"sessions": "anonymous sessions from delivery user-agent or exactUA/time correlated with nginx public request;deleted sessions individually expired beyond configured lifetime,normal database session garbage collection(config/session lottery2/100)",
|
||||
"delta": {
|
||||
"cache": {
|
||||
"before_rows": 108,
|
||||
"after_rows": 108,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "7f7dd83f47f5bf404d55e6e9f1367948721579970b195680645e356031a070ff",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"value",
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-illuminate:queue:restart",
|
||||
"is_queue_restart_key": true,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": false,
|
||||
"same_value_home_cache_expiry_refresh": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"before_rows": 21,
|
||||
"after_rows": 41,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "2ad1cb241771733ecdcd4d01332669674850e8c69e092604b4deb80014596094",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "17b9f88494ab475782d0a1a069bd6c3c6154489201d1335fbae9af15530a7231",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "fba4cdd75dd31dbc9d9b38ae207cc10c91cf889ecdbe8e7996059f7d5c94a0ae",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "c2ac41f80cf479eb3c8f024b6140d7c65bb75407f8d92a89102b2424e9c78b81",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "438d48be29b8f94cadc4c0731034c86c65cbf457a422949e3ff8a3af82694313",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "64b01593f650d8ab56f143f5e7dd32647277e9be7ace1a77dba9578c6b5b7501",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": false,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "3bb40945f442a7f0f13c7471b2ede4fad92bb615c5716e5f8cbae29b8cb690f4",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "cad0a1de3861c0491bd01e7f133074335041313d64a0aa4692cf70fa607ba81c",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "a88c70aba8ba526065925b98c73e3a05cab4051d9b298e565bd562080eb19bf1",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "d0c392ca36450e9123f8d5472757d86954f41168448fb512ad1fdda6d7c6dd8b",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "96464d3abc3cbd84145b5d265e1d647b762c4e89afdc8cbccd5f3778940ca7d1",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "cfbc6ad7b813e14d9fb2b805daece5ab8c1ea2bfb42c548be709972b692eee3d",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "3caf5a87cdae5355a8066aa5a2773c3252608403c0b8dc66bbbc657c8029bae8",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "294f5cb374a33087114fbb2e71d8815b366ff4e52057ca8ec381d3998786d4fc",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "2f342bbe74c8109df6d30a2c1d293b36572c4953b80d9ccb18d7c8924642f4d7",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "1e430e81b8fc7238b6cc37d5ef16c8482f1475c15b490fc2a8512a7ec15d1136",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "8c7e4a6a4af2a4e0106a24dc4d6e434baefdb8d0bca551bc8377c34cee667ba5",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "9c23bed34e3ee88810369ce7daef74863f692d5ab0360a4f3ae46cd7f60fac2d",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "810ed909001d96275b1c7f2d3f5fd1843afdc2054c134a7d0e8474a9261d6f85",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "7e025b942486695c1749702b5ca355089121e35d744dcd03220aa7b1f5b4cb08",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"business_tables_to_confirm_separately": 172,
|
||||
"active_data_writes_by_comparison": 0,
|
||||
"restore_network": "none"
|
||||
},
|
||||
"public_delta": {
|
||||
"cards": 10,
|
||||
"index_details_before": true,
|
||||
"index_details_after": false,
|
||||
"sector_pages_unchanged": [
|
||||
"agronegocio",
|
||||
"turismo",
|
||||
"mercado-financeiro/fintech"
|
||||
],
|
||||
"guide_count_per_selected_sector": {
|
||||
"agronegocio": 1,
|
||||
"turismo": 1,
|
||||
"mercado-financeiro/fintech": 1
|
||||
},
|
||||
"filter": "agronegocio",
|
||||
"manifest_sha256": "e8f9e3d19077576db83e80adf3f34a93ca676553ac1f6c69c3f4e715a4bde76a",
|
||||
"manifest_verified": true,
|
||||
"private_writes": 0
|
||||
},
|
||||
"main_delivery": "normal fast-forward Git push;existing webhook/installer;old release preserved until ready",
|
||||
"private_pilots": "No Songo/Gurue publication;no QA data import",
|
||||
"pec": "7fdb6b42 remains separate QA branch, not installed in this delivery",
|
||||
"external_commit": "88b39b5 intent reproduced locally by explicit user instruction;no binary-equivalence claim",
|
||||
"artifacts": [
|
||||
{
|
||||
"file": "after.json",
|
||||
"bytes": 235088,
|
||||
"sha256": "2cbdd93fa921c8d2b1d05e5b7c9cdb896f7ebbda8839abe9d52f4f3728d1826e"
|
||||
},
|
||||
{
|
||||
"file": "backup.py",
|
||||
"bytes": 5452,
|
||||
"sha256": "3d4d549387b3b811f51c47e8da79f75e33d9814fd8ee93a116c7254c62d426ae"
|
||||
},
|
||||
{
|
||||
"file": "backup.txt",
|
||||
"bytes": 822,
|
||||
"sha256": "504f147468d9ffdd9cb773fa7eb7c0e1963f0b14047fbdd208659a78332f29d6"
|
||||
},
|
||||
{
|
||||
"file": "before.json",
|
||||
"bytes": 235089,
|
||||
"sha256": "ae5dd2e81c21bb71d01435e397ddf6d831a7527c5e8e7699ef86ef6f5200056a"
|
||||
},
|
||||
{
|
||||
"file": "capacity-after.py",
|
||||
"bytes": 1610,
|
||||
"sha256": "5fc773a1f74a3f6028c2d190c452c8d58f8b4a2f56afc508c61002d4eb892371"
|
||||
},
|
||||
{
|
||||
"file": "capacity-after.txt",
|
||||
"bytes": 1994,
|
||||
"sha256": "dffb2f7bc0f8a4d46dd76022d3952513b4f029545524b7e2d81e97cebebd9f09"
|
||||
},
|
||||
{
|
||||
"file": "index-served.txt",
|
||||
"bytes": 6663,
|
||||
"sha256": "bea4d0bbb39366a90a6b2c2fd16d14d0bd31bed93595145f1afe2740d59b99a0"
|
||||
},
|
||||
{
|
||||
"file": "inspect.txt",
|
||||
"bytes": 61498,
|
||||
"sha256": "6e66ce6aaeeb67723daa65d3659660aadb14760d365db21dc3a36a8b3cef2d3f"
|
||||
},
|
||||
{
|
||||
"file": "integrated.json",
|
||||
"bytes": 251,
|
||||
"sha256": "5f58ca5aad02394c5d0f8932ce9c3d09c915c16d2299ec76ddd06445f9c3b5e2"
|
||||
},
|
||||
{
|
||||
"file": "matrix-preservation.json",
|
||||
"bytes": 142,
|
||||
"sha256": "3f9eba3a66126091ade7bde897f6ed5be1428ddcb62b610a537ec638007ba2fe"
|
||||
},
|
||||
{
|
||||
"file": "operational-delta.txt",
|
||||
"bytes": 7899,
|
||||
"sha256": "56d9ac3eb9be3069164303d615fc484dedc3c1912a4e422bd340529419cb9c82"
|
||||
},
|
||||
{
|
||||
"file": "pipeline-current.py",
|
||||
"bytes": 21198,
|
||||
"sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604"
|
||||
},
|
||||
{
|
||||
"file": "preflight.py",
|
||||
"bytes": 2337,
|
||||
"sha256": "73484c8e8e811f68799200b87c7f2b58b91b09502afbd64b8f9b3116ab59bbf2"
|
||||
},
|
||||
{
|
||||
"file": "preflight.txt",
|
||||
"bytes": 4446,
|
||||
"sha256": "16d116ab7c673aa836fb5afae74369077b0103028d7972e1cb34bbb0bf9f8afd"
|
||||
},
|
||||
{
|
||||
"file": "preparation.json",
|
||||
"bytes": 245104,
|
||||
"sha256": "bbad8749a58c20e89f40064eee47b53969f85c4e478bcfd65eb73e0666684773"
|
||||
},
|
||||
{
|
||||
"file": "preservation.txt",
|
||||
"bytes": 945,
|
||||
"sha256": "95ed7c2338244ca751fb01e2a92ca5a4e408e23947bc394322970c2bf5eab860"
|
||||
},
|
||||
{
|
||||
"file": "preserve-data.py",
|
||||
"bytes": 2288,
|
||||
"sha256": "9f0c3097467fe171508e741fa1e360df7747aab15f2feb1465adaf38520e69c3"
|
||||
},
|
||||
{
|
||||
"file": "public-after.json",
|
||||
"bytes": 42854,
|
||||
"sha256": "cee7364e130234ca27fea14ad271c0b13d9de68fbecf0910ac4014fec07c498c"
|
||||
},
|
||||
{
|
||||
"file": "public-before.json",
|
||||
"bytes": 42784,
|
||||
"sha256": "cfe084efbf1bf43b3624e4a1b4834857c6673dc32f614fe6a8e57f47882c8b11"
|
||||
},
|
||||
{
|
||||
"file": "public-details-after-diagnostic.json",
|
||||
"bytes": 34496,
|
||||
"sha256": "173fc6ceb4429e4c53a481606efedb3c6738f224d761f43a75dc18cae4b6a1e8"
|
||||
},
|
||||
{
|
||||
"file": "reconcile-operational-delta.py",
|
||||
"bytes": 5338,
|
||||
"sha256": "295501048b897c8506ced3943013058f8bd2c904e8a48b083ecd173759c41cf3"
|
||||
},
|
||||
{
|
||||
"file": "restore.py",
|
||||
"bytes": 2819,
|
||||
"sha256": "4bd143dd278701e08d1878d4011b096d1fb22ecadd995b5b433349d9e4cd36cc"
|
||||
},
|
||||
{
|
||||
"file": "restore.txt",
|
||||
"bytes": 554,
|
||||
"sha256": "2b31f1844444604094dfbaed3e17a62a6e3c8dcac178052632b62780efd063c6"
|
||||
},
|
||||
{
|
||||
"file": "schema-after.txt",
|
||||
"bytes": 526,
|
||||
"sha256": "d5855a7a0a16c1762cce140750c3b8c984e9ea61817bdf02e684cc9ae1c01592"
|
||||
},
|
||||
{
|
||||
"file": "schema-before.txt",
|
||||
"bytes": 1016,
|
||||
"sha256": "0ab7c964792acdd8917bce256c472e55e034b103500a58b49f020b5084823ed7"
|
||||
},
|
||||
{
|
||||
"file": "schema-permissions-after.py",
|
||||
"bytes": 1864,
|
||||
"sha256": "52ddfc9d1a235518e95dedc653eb303866477d52a8b712da75d331cea7ab714f"
|
||||
},
|
||||
{
|
||||
"file": "schema-permissions-before.py",
|
||||
"bytes": 1707,
|
||||
"sha256": "2723b6a4e099f3af2efd333f3f9d8c6937e6cf2255b8448f5f27bc74455af319"
|
||||
},
|
||||
{
|
||||
"file": "source-after.txt",
|
||||
"bytes": 160,
|
||||
"sha256": "e88624cd7f7e72c2dad88fabac95c2dfe6ca9c140d40aecfed238fd46e2a0997"
|
||||
},
|
||||
{
|
||||
"file": "source-before.txt",
|
||||
"bytes": 324,
|
||||
"sha256": "d0211ba30920fd270b5bc3873455067b20cb0078f35991410f26356b70350e2b"
|
||||
},
|
||||
{
|
||||
"file": "source-check.py",
|
||||
"bytes": 669,
|
||||
"sha256": "2ea95b35eb8c2eb950216ab77e2a3127b2400372e5034179953edae058b0eb84"
|
||||
},
|
||||
{
|
||||
"file": "ssh-session.py",
|
||||
"bytes": 3050,
|
||||
"sha256": "51c402acdfb594d8146610a224f03b17369b6641511235a616c84c7e5d688f18"
|
||||
},
|
||||
{
|
||||
"file": "status-a1.txt",
|
||||
"bytes": 1994,
|
||||
"sha256": "1d78e2bf83b402b2108dff42b029fe95753399dfcd3e880263d0cdb2c77f4b85"
|
||||
},
|
||||
{
|
||||
"file": "status-a2.txt",
|
||||
"bytes": 2058,
|
||||
"sha256": "0307b19f4fd764350cac2c839968011516c7c7aa7bb5d80317816a70bc5cd16f"
|
||||
},
|
||||
{
|
||||
"file": "status-a3.txt",
|
||||
"bytes": 2162,
|
||||
"sha256": "ebdec6a635347bcec45d45b3ab182b7a10a22d816cef57709b156e4d2a1e4da7"
|
||||
},
|
||||
{
|
||||
"file": "status-a4.txt",
|
||||
"bytes": 2162,
|
||||
"sha256": "ebdec6a635347bcec45d45b3ab182b7a10a22d816cef57709b156e4d2a1e4da7"
|
||||
},
|
||||
{
|
||||
"file": "status-a5.txt",
|
||||
"bytes": 2244,
|
||||
"sha256": "f6f22631054fa0920a3c897db7bc6e3a00bce5420e4893f08125bd103dc5fb8f"
|
||||
},
|
||||
{
|
||||
"file": "verify-public.py",
|
||||
"bytes": 2470,
|
||||
"sha256": "733a94aa83698de4a5f1f1a79c9d3dbdce8d80c69787b549864f7916810777b4"
|
||||
}
|
||||
],
|
||||
"remote_receipt_sha256": "cd95142b7f85e40a0f86e0f7d3dca513e7bc208c89aa91b8e3ad213191d8465f"
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"date": "2026-10-27",
|
||||
"status": "QA passed; not yet installed",
|
||||
"source_intention": "88b39b527859bd420f2e223a7afea89bea38de54",
|
||||
"reproduced_locally": true,
|
||||
"byte_equivalence_to_external_commit": false,
|
||||
"baseline": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"branch": "codex/sector-navigation-fix-local-20261027",
|
||||
"runtime_delta": [
|
||||
"app/Http/Controllers/PortalServicesController.php",
|
||||
"resources/js/pages/portal/services.tsx"
|
||||
],
|
||||
"tests": {
|
||||
"feature_tests": 3,
|
||||
"assertions": 319,
|
||||
"database": "proactive_investment_20261027_test",
|
||||
"port": 55441,
|
||||
"rollback": true,
|
||||
"routes": "passed",
|
||||
"typescript": "passed",
|
||||
"build": "passed"
|
||||
},
|
||||
"browser": {
|
||||
"index_cards": 10,
|
||||
"separate_sectors": [
|
||||
"agronegocio",
|
||||
"turismo"
|
||||
],
|
||||
"opportunities_isolated": true,
|
||||
"filter": "agronegocio",
|
||||
"back": true,
|
||||
"reload": true,
|
||||
"fintech_url_preserved": true,
|
||||
"dossier_entry": "sector:3; existing guest authentication, no new dossier created",
|
||||
"screenshots": "capture unavailable: zero width; AX proof retained",
|
||||
"editorial_guides": "not loaded in QA sample; consumers unchanged, destination to check"
|
||||
},
|
||||
"protected_files": [
|
||||
{
|
||||
"file": "resources/js/components/sector-content.tsx",
|
||||
"sha256_LF": "4ee55554f8a88ba7db1ac0dc74259d4e66603979c3873f9ec897437830b8e0ae",
|
||||
"unchanged": true
|
||||
},
|
||||
{
|
||||
"file": "resources/js/components/sector-entry.tsx",
|
||||
"sha256_LF": "96672c709b70f840d105c664a92d49a17acb66cd852d43dadaa8f3fef8b3e845",
|
||||
"unchanged": true
|
||||
},
|
||||
{
|
||||
"file": "resources/js/components/public-sector-cards.tsx",
|
||||
"sha256_LF": "858ba6235ef8b46461d416b3264436e4df2c9555b8e6d8c3644dbd8c55463484",
|
||||
"unchanged": true
|
||||
},
|
||||
{
|
||||
"file": "app/Services/SectorInvestment.php",
|
||||
"sha256_LF": "0b8fbc6e3d03ede627e95332703e4749a53d86708bdc0f9579e958caf30e4d17",
|
||||
"unchanged": true
|
||||
},
|
||||
{
|
||||
"file": "app/Services/SectorOrganization.php",
|
||||
"sha256_LF": "f0e54fe6acfe746c6758387f43610232cb51371b0404bcefaf466d8b704f3ae3",
|
||||
"unchanged": true
|
||||
},
|
||||
{
|
||||
"file": "app/Http/Controllers/PublicPortalController.php",
|
||||
"sha256_LF": "cb6abd75533660a52e18148cc5f1ab706d2e08f9c94334510541e6b0e003b461",
|
||||
"unchanged": true
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "d59f3fa4dcb3fade1f967564c972e30932aa095a4e5dd4ba0be8b4e07492ef0a",
|
||||
"unchanged": true
|
||||
},
|
||||
{
|
||||
"file": "resources/js/lib/irpc-annual-settlement.ts",
|
||||
"sha256_LF": "8cca5316259e3ebabfa75be9f64143a8664a447ac30b23b882318edfd70a68f1",
|
||||
"unchanged": true
|
||||
},
|
||||
{
|
||||
"file": "routes/web.php",
|
||||
"sha256_LF": "95930c76977d446b74a422acc4b60869ff6bae5d4567c21cc644484c5f09cbda",
|
||||
"unchanged": true
|
||||
}
|
||||
],
|
||||
"pec_branch_not_integrated": "7fdb6b42",
|
||||
"active_writes": 0,
|
||||
"private_pilots_published": false
|
||||
}
|
||||
@@ -0,0 +1,719 @@
|
||||
{
|
||||
"date": "2026-10-27T10:51:18.002627+00:00",
|
||||
"status": "both_deliveries_installed_in_requested_order",
|
||||
"order": [
|
||||
"l8",
|
||||
"proactive"
|
||||
],
|
||||
"stages": {
|
||||
"l8": {
|
||||
"candidate": "c85e772d2fd2be5182eb4d768ddd34d43962bf59",
|
||||
"previous": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "c85e772d2fd2be5182eb4d768ddd34d43962bf59",
|
||||
"release": "/var/www/investmoz-homologacao/releases/c85e772d2fd2be5182eb4d768ddd34d43962bf59-ae7401aa",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/f8d57bddf96b4610604a013fcc5bdd703c7dc6d5-7a31e8ac",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"served": {
|
||||
"commit": "c85e772d2fd2be5182eb4d768ddd34d43962bf59",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-27T10:32:26.854949+00:00",
|
||||
"manifest_sha256": "f27852b26d53b46f6927ee46c13370db17a4bec1623655552fd8fdca3589005a"
|
||||
},
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-sequential-20261027/l8/backup",
|
||||
"created_at": "2026-10-27T10:25:59Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "11bc7c8f25edc861b18785a9714845384cf29a5da92f58f55ff53f6913e69d42",
|
||||
"files_sha256": "52ffe40bcf943ce580047b55c34b60d3ba876d81dd4bc3ff4fbe1ec97a9c6f56",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "irpc_l8_first_restore_20261027",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "11bc7c8f25edc861b18785a9714845384cf29a5da92f58f55ff53f6913e69d42",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"capacity_after_backup": {
|
||||
"at": "2026-10-27T10:28:35.403687+00:00",
|
||||
"baseline": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"capacity_after_backup_satisfied": true,
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"free_bytes": 98153496576,
|
||||
"free_inodes": 23860325
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"free_bytes": 98153496576,
|
||||
"free_inodes": 23860325
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"free_bytes": 98153496576,
|
||||
"free_inodes": 23860325
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"free_bytes": 98153496576,
|
||||
"free_inodes": 23860325
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"free_bytes": 98153496576,
|
||||
"free_inodes": 23860325
|
||||
}
|
||||
],
|
||||
"backup_age_seconds": 156.403651,
|
||||
"backup_dump_sha256": "11bc7c8f25edc861b18785a9714845384cf29a5da92f58f55ff53f6913e69d42",
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"files_verified": 369,
|
||||
"backup_paths": {
|
||||
"dump": "/var/backups/investmoz-sequential-20261027/l8/backup/database.dump",
|
||||
"files": "/var/backups/investmoz-sequential-20261027/l8/backup/files-before.tar.gz"
|
||||
},
|
||||
"active_writes": 0
|
||||
},
|
||||
"source": {
|
||||
"phase": "after",
|
||||
"installed": "c85e772d2fd2be5182eb4d768ddd34d43962bf59",
|
||||
"files_verified": 996,
|
||||
"source_matches_Git": true,
|
||||
"active_writes": 0
|
||||
},
|
||||
"schema_permissions": {
|
||||
"schema_sha256": "5045b3e51d2185377aa3d9ac7fa07a44fad3ec620cdfa83ffe31c8884ee1601d",
|
||||
"roles_grants_sha256": "1530c33cb016e67bfdc64891ddfce7f185b13b56b2cd87c012871a685e118109",
|
||||
"filesystem_permissions": {
|
||||
".env": {
|
||||
"mode": 416,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage/app": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"bootstrap/cache": {
|
||||
"mode": 1528,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
}
|
||||
},
|
||||
"comparison_identity": "postgres;catalogue read only;no passwords collected",
|
||||
"unchanged": true
|
||||
},
|
||||
"preservation": {
|
||||
"checked_at": "2026-10-27T10:34:53.148104+00:00",
|
||||
"installed": "c85e772d2fd2be5182eb4d768ddd34d43962bf59",
|
||||
"business_tables_unchanged": 172,
|
||||
"total_tables": 174,
|
||||
"operational_tables_to_reconcile": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 106,
|
||||
"checksum": "6c05e12d73079effd52f3add83104de2"
|
||||
},
|
||||
"after": {
|
||||
"rows": 106,
|
||||
"checksum": "a9c2d7df6ecc8cabba35d5c6f1d019c5"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 11,
|
||||
"checksum": "b83d84b3894b8fc6ef42b0b8fd937304"
|
||||
},
|
||||
"after": {
|
||||
"rows": 12,
|
||||
"checksum": "fea9aecf735aa394f40e9a4b6a55e27f"
|
||||
}
|
||||
}
|
||||
},
|
||||
"persistent_files_unchanged": 369,
|
||||
"original_configuration_preserved": true,
|
||||
"synthetic_QA_storage_not_served": true,
|
||||
"QA_storage_saved_outside_active": "/var/lib/investmoz-deploy/qa-runtime/c85e772d2fd2be5182eb4d768ddd34d43962bf59-ae7401aa",
|
||||
"fixture_or_content_imports": 0,
|
||||
"migrations": 0,
|
||||
"comparison_identity": "postgres;UTC;consistent before snapshot and after read-only transaction",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"operational_delta": {
|
||||
"status": "operational_delta_reconciled",
|
||||
"comparison_identity": "postgres before/after;isolated restored baseline;no RLS visibility inference",
|
||||
"cache": "queue:restart;requestthrottle;identical home-sector cached value with refreshed expiry(HomeController remember10min);no deletedcache",
|
||||
"sessions": "anonymous sessions from delivery user-agent or exactUA/time correlated with nginx public request;deleted sessions individually expired beyond configured lifetime,normal database session garbage collection(config/session lottery2/100)",
|
||||
"delta": {
|
||||
"cache": {
|
||||
"before_rows": 106,
|
||||
"after_rows": 106,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "7f7dd83f47f5bf404d55e6e9f1367948721579970b195680645e356031a070ff",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"value",
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-illuminate:queue:restart",
|
||||
"is_queue_restart_key": true,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": false,
|
||||
"same_value_home_cache_expiry_refresh": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"before_rows": 11,
|
||||
"after_rows": 15,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "7a0b0d7c40ef99d4c033c9df695a5cd69d6433f068463fdf9f8baff6835453f6",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "9f06bc9fb6ef8d45fe1c1093b4e54b59ee080463861b8051271597b0ec5e45a4",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "e66f917f9d71192fe17cf2c7c26046afa6bff0db292d0c232a5b59629be030a3",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "a84b009ac5f5358a0452f4a40968a4826e34ced257930b6ecf08a0289aa6684f",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"business_tables_to_confirm_separately": 172,
|
||||
"active_data_writes_by_comparison": 0,
|
||||
"restore_network": "none"
|
||||
},
|
||||
"public_delta": {
|
||||
"stage": "l8",
|
||||
"served_revision": {
|
||||
"commit": "c85e772d2fd2be5182eb4d768ddd34d43962bf59",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-27T10:32:26.854949+00:00",
|
||||
"manifest_sha256": "f27852b26d53b46f6927ee46c13370db17a4bec1623655552fd8fdca3589005a"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"IRPC-annual-settlement/1": [
|
||||
"assets/project-dossier-BNt4O6Rz.js"
|
||||
],
|
||||
"Preparar saldo anual L8": [
|
||||
"assets/services-BvFvahdE.js"
|
||||
],
|
||||
"Calcular e guardar saldo anual L8": [
|
||||
"assets/services-BvFvahdE.js"
|
||||
],
|
||||
"Saldo anual simulado": [
|
||||
"assets/project-dossier-BNt4O6Rz.js"
|
||||
],
|
||||
"PEC e créditos separados": [
|
||||
"assets/project-dossier-BNt4O6Rz.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/simulation-form-zFZ4YNrB.js",
|
||||
"status": 200,
|
||||
"sha256": "338068b86cce1c3215ee71b1328a6cb2f754b903ed78ff1886f8554df506d2d6"
|
||||
},
|
||||
{
|
||||
"file": "assets/services-BvFvahdE.js",
|
||||
"status": 200,
|
||||
"sha256": "97615f0d113746ee5ac1550a1e59c567dd152ef5ddac68f133bd2cee9e9c16d1"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-BNt4O6Rz.js",
|
||||
"status": 200,
|
||||
"sha256": "8cf6a6678c5c9aed0d7b996147bc2fde35d20f86c73ec7bd894df2ae11aae75c"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-Cj4QX7oF.js",
|
||||
"status": 200,
|
||||
"sha256": "302ec6831893f2ef4c09a90273b458c49a6ff281adb01c4594a166a90efe53e2"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"served_component": "portal/services",
|
||||
"private_operations": 0,
|
||||
"QA_fixture_imports": 0,
|
||||
"accepted_QA_proofs_reused": true,
|
||||
"method": "Read-only served revision/manifest/compiled delta;no synthetic active records or publication"
|
||||
},
|
||||
"backup_restore_verified": true
|
||||
},
|
||||
"proactive": {
|
||||
"candidate": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"previous": "c85e772d2fd2be5182eb4d768ddd34d43962bf59",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"release": "/var/www/investmoz-homologacao/releases/9fda6d6e12832a3cf25e7314f1f895dd430238c5-88fc859c",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/c85e772d2fd2be5182eb4d768ddd34d43962bf59-ae7401aa",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"served": {
|
||||
"commit": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-27T10:50:00.471464+00:00",
|
||||
"manifest_sha256": "40de38cbf74b475f73de825bfd16af6fabe339faad4817e2857fd9ae36ec7cc0"
|
||||
},
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-sequential-20261027/proactive/backup",
|
||||
"created_at": "2026-10-27T10:36:28Z",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "45107e48e18ab2b9a78af08374fe3bfa0af216f34433c10fc81f264400e331ce",
|
||||
"files_sha256": "f7196314f915e75975a9e580a69ddc4dffae64597ae05e9ae59cfbcbb0b47731",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "irpc_l8_first_restore_20261027",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "45107e48e18ab2b9a78af08374fe3bfa0af216f34433c10fc81f264400e331ce",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"capacity_after_backup": {
|
||||
"at": "2026-10-27T10:46:06.120042+00:00",
|
||||
"baseline": "c85e772d2fd2be5182eb4d768ddd34d43962bf59",
|
||||
"capacity_after_backup_satisfied": true,
|
||||
"volumes": [
|
||||
{
|
||||
"path": "/var/www/investmoz-homologacao/releases",
|
||||
"free_bytes": 95851429888,
|
||||
"free_inodes": 23794207
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/investmoz-deploy",
|
||||
"free_bytes": 95851429888,
|
||||
"free_inodes": 23794207
|
||||
},
|
||||
{
|
||||
"path": "/var/backups",
|
||||
"free_bytes": 95851429888,
|
||||
"free_inodes": 23794207
|
||||
},
|
||||
{
|
||||
"path": "/tmp",
|
||||
"free_bytes": 95851429888,
|
||||
"free_inodes": 23794207
|
||||
},
|
||||
{
|
||||
"path": "/var/lib/docker",
|
||||
"free_bytes": 95851429888,
|
||||
"free_inodes": 23794207
|
||||
}
|
||||
],
|
||||
"backup_age_seconds": 578.120001,
|
||||
"backup_dump_sha256": "45107e48e18ab2b9a78af08374fe3bfa0af216f34433c10fc81f264400e331ce",
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"files_verified": 369,
|
||||
"backup_paths": {
|
||||
"dump": "/var/backups/investmoz-sequential-20261027/proactive/backup/database.dump",
|
||||
"files": "/var/backups/investmoz-sequential-20261027/proactive/backup/files-before.tar.gz"
|
||||
},
|
||||
"active_writes": 0
|
||||
},
|
||||
"source": {
|
||||
"phase": "after",
|
||||
"installed": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"files_verified": 1000,
|
||||
"source_matches_Git": true,
|
||||
"active_writes": 0
|
||||
},
|
||||
"schema_permissions": {
|
||||
"schema_sha256": "5045b3e51d2185377aa3d9ac7fa07a44fad3ec620cdfa83ffe31c8884ee1601d",
|
||||
"roles_grants_sha256": "1530c33cb016e67bfdc64891ddfce7f185b13b56b2cd87c012871a685e118109",
|
||||
"filesystem_permissions": {
|
||||
".env": {
|
||||
"mode": 416,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"storage/app": {
|
||||
"mode": 1533,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
},
|
||||
"bootstrap/cache": {
|
||||
"mode": 1528,
|
||||
"uid": 1001,
|
||||
"gid": 33
|
||||
}
|
||||
},
|
||||
"comparison_identity": "postgres;catalogue read only;no passwords collected",
|
||||
"unchanged": true
|
||||
},
|
||||
"preservation": {
|
||||
"checked_at": "2026-10-27T10:50:49.400700+00:00",
|
||||
"installed": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"business_tables_unchanged": 172,
|
||||
"total_tables": 174,
|
||||
"operational_tables_to_reconcile": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 106,
|
||||
"checksum": "a9c2d7df6ecc8cabba35d5c6f1d019c5"
|
||||
},
|
||||
"after": {
|
||||
"rows": 106,
|
||||
"checksum": "db78f82003db53db664667b8e6f46088"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 15,
|
||||
"checksum": "4df23659bf65acacc88e1d84d095a243"
|
||||
},
|
||||
"after": {
|
||||
"rows": 20,
|
||||
"checksum": "64d48443c5027a2fc08615f7528126b5"
|
||||
}
|
||||
}
|
||||
},
|
||||
"persistent_files_unchanged": 369,
|
||||
"original_configuration_preserved": true,
|
||||
"synthetic_QA_storage_not_served": true,
|
||||
"QA_storage_saved_outside_active": "/var/lib/investmoz-deploy/qa-runtime/9fda6d6e12832a3cf25e7314f1f895dd430238c5-88fc859c",
|
||||
"fixture_or_content_imports": 0,
|
||||
"migrations": 0,
|
||||
"comparison_identity": "postgres;UTC;consistent before snapshot and after read-only transaction",
|
||||
"active_database_writes": 0
|
||||
},
|
||||
"operational_delta": {
|
||||
"status": "operational_delta_reconciled",
|
||||
"comparison_identity": "postgres before/after;isolated restored baseline;no RLS visibility inference",
|
||||
"cache": "queue:restart;requestthrottle;identical home-sector cached value with refreshed expiry(HomeController remember10min);no deletedcache",
|
||||
"sessions": "anonymous sessions from delivery user-agent or exactUA/time correlated with nginx public request;deleted sessions individually expired beyond configured lifetime,normal database session garbage collection(config/session lottery2/100)",
|
||||
"delta": {
|
||||
"cache": {
|
||||
"before_rows": 106,
|
||||
"after_rows": 106,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "7f7dd83f47f5bf404d55e6e9f1367948721579970b195680645e356031a070ff",
|
||||
"kind": "updated",
|
||||
"fields": [
|
||||
"value",
|
||||
"expiration"
|
||||
],
|
||||
"key_pattern": "investemoz-cache-illuminate:queue:restart",
|
||||
"is_queue_restart_key": true,
|
||||
"expiration_unchanged": false,
|
||||
"throttle_timer_pair": false,
|
||||
"same_value_home_cache_expiry_refresh": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"sessions": {
|
||||
"before_rows": 15,
|
||||
"after_rows": 20,
|
||||
"changes": [
|
||||
{
|
||||
"key_sha256": "f78ee9e6f589e1bbda4730d4e71a90c9ad082cc25776c415b6cc815ce4b4d491",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "7eb58435f5d60610be81945c0da4331a1dbfda680f7da3f107dbbeb6b60c39df",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "1d5026f13ace3894011db54d801f72cd76f9b138d54fe2f7b89f579743282db6",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "56820cc8560f13a2c0962a973bd05624712648c2beffd2058dfbae6c9103c7fa",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
},
|
||||
{
|
||||
"key_sha256": "a91337e37e71b520dd6d621b0ef7bbf68a9a20d099198ecd8edfdc365a9f52f1",
|
||||
"kind": "added",
|
||||
"fields": [
|
||||
"id",
|
||||
"ip_address",
|
||||
"user_agent",
|
||||
"payload",
|
||||
"last_activity"
|
||||
],
|
||||
"anonymous_user": true,
|
||||
"delivery_user_agent": true,
|
||||
"expired_before_comparison": false,
|
||||
"session_lifetime_minutes": 120,
|
||||
"anonymous_public_request_logged": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"business_tables_to_confirm_separately": 172,
|
||||
"active_data_writes_by_comparison": 0,
|
||||
"restore_network": "none"
|
||||
},
|
||||
"public_delta": {
|
||||
"stage": "proactive",
|
||||
"served_revision": {
|
||||
"commit": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-27T10:50:00.471464+00:00",
|
||||
"manifest_sha256": "40de38cbf74b475f73de825bfd16af6fabe339faad4817e2857fd9ae36ec7cc0"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"IRPC-annual-settlement/1": [
|
||||
"assets/project-dossier-DFH3NDYe.js"
|
||||
],
|
||||
"Preparar saldo anual L8": [
|
||||
"assets/services-CV6TWKfT.js"
|
||||
],
|
||||
"Calcular e guardar saldo anual L8": [
|
||||
"assets/services-CV6TWKfT.js"
|
||||
],
|
||||
"Saldo anual simulado": [
|
||||
"assets/project-dossier-DFH3NDYe.js"
|
||||
],
|
||||
"PEC e créditos separados": [
|
||||
"assets/project-dossier-DFH3NDYe.js"
|
||||
],
|
||||
"Território e sector": [
|
||||
"assets/proactive-investment-CPkgrUFY.js"
|
||||
],
|
||||
"Preparar análise e ideia": [
|
||||
"assets/proactive-investment-CPkgrUFY.js"
|
||||
],
|
||||
"Hipótese analítica": [
|
||||
"assets/project-dossier-DFH3NDYe.js",
|
||||
"assets/proactive-investment-CPkgrUFY.js"
|
||||
],
|
||||
"Documento existente associado": [
|
||||
"assets/proactive-investment-CPkgrUFY.js"
|
||||
],
|
||||
"Origem privada autorizada deste dossier": [
|
||||
"assets/proactive-investment-CPkgrUFY.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/project-dossier-DFH3NDYe.js",
|
||||
"status": 200,
|
||||
"sha256": "62f4e47f6efbb7916663604450ee427401080fad6f9332be2cd0dc017866b85a"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-CgBtS4qw.js",
|
||||
"status": 200,
|
||||
"sha256": "fb9aa7e305891719ae49cf8bbcee05b3114c05c8ee1df20238964fddb56721dd"
|
||||
},
|
||||
{
|
||||
"file": "assets/catalogue-DRXXB4Y7.js",
|
||||
"status": 200,
|
||||
"sha256": "66a2ae7c819f1ac36ffd37e8456c3cfd2537c820845b20eddb4dd7bfaf4a32a2"
|
||||
},
|
||||
{
|
||||
"file": "assets/services-CV6TWKfT.js",
|
||||
"status": 200,
|
||||
"sha256": "656da0adacd9141fcd9b1e82ab9959a62ea381a3815e183c5535801c95d92dff"
|
||||
},
|
||||
{
|
||||
"file": "assets/simulation-form-zFZ4YNrB.js",
|
||||
"status": 200,
|
||||
"sha256": "338068b86cce1c3215ee71b1328a6cb2f754b903ed78ff1886f8554df506d2d6"
|
||||
},
|
||||
{
|
||||
"file": "assets/proactive-investment-CPkgrUFY.js",
|
||||
"status": 200,
|
||||
"sha256": "288cd1005a05c82241a1ddd8c5bb446e297ead7b7605060cec80d268726522ac"
|
||||
},
|
||||
{
|
||||
"file": "assets/opportunity-draft-Da2FBHoN.js",
|
||||
"status": 200,
|
||||
"sha256": "ba50f61a39693ebebbe30ba1937d45c92b80f81ab9a98418ef75662f893cdfb2"
|
||||
},
|
||||
{
|
||||
"file": "assets/detail-BfSgTC5d.js",
|
||||
"status": 200,
|
||||
"sha256": "234657a2e5ebad7985d78ea49c5536c31e4aac9a143a02e7682d898e47cee530"
|
||||
},
|
||||
{
|
||||
"file": "assets/show-CJYhqIE4.js",
|
||||
"status": 200,
|
||||
"sha256": "6579df14a154c98235330f550e13bee20e74f19517cc1d166ae26322f56c74f9"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"served_component": "portal/services",
|
||||
"public_catalogue_delta": {
|
||||
"ideas": {
|
||||
"status": 200,
|
||||
"component": "investment/catalogue"
|
||||
},
|
||||
"needs": {
|
||||
"status": 200,
|
||||
"component": "investment/catalogue"
|
||||
},
|
||||
"exists": {
|
||||
"status": 200,
|
||||
"component": "investment/catalogue"
|
||||
}
|
||||
},
|
||||
"private_operations": 0,
|
||||
"QA_fixture_imports": 0,
|
||||
"accepted_QA_proofs_reused": true,
|
||||
"method": "Read-only served revision/manifest/compiled delta;no synthetic active records or publication"
|
||||
},
|
||||
"backup_restore_verified": true
|
||||
}
|
||||
},
|
||||
"main": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"final_served_revision": "9fda6d6e12832a3cf25e7314f1f895dd430238c5",
|
||||
"private_pilots_preserved_no_publication": true,
|
||||
"fixtures_not_imported_into_active_database": true,
|
||||
"QA_runtime_storage_outside_active_release": true,
|
||||
"active_schema_migrations": 0,
|
||||
"new_grants": false,
|
||||
"SGF_TEMPO": "untouched",
|
||||
"accepted_business_proofs": "reused;post-install checks limited to deltas;existing installer automated checks retained",
|
||||
"prior_capacity_GiB": 91.60694122314453,
|
||||
"second_delivery_retry": {
|
||||
"initial_candidate": "56c0c6a7caa65a4cac54e17f9d455739f8eb6198",
|
||||
"initial_candidate_activated": false,
|
||||
"active_L8_preserved": true,
|
||||
"reason": "One frontend test depended on ignored local outputs/proactive-investment-20261027/recovered-context.json",
|
||||
"correction": "9fda6d6e12832a3cf25e7314f1f895dd430238c5 changes only the test and a minimal synthetic public API projection;no profile,pilot,credentials or live records",
|
||||
"application_runtime_identical_to_56c0c6a7": true,
|
||||
"directed_portability_test": "passed;one test;no skipped test",
|
||||
"existing_installer_guards_retained": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"date": "2026-10-27",
|
||||
"status": "authorised_prepared_not_installed_SSH_session_unavailable",
|
||||
"authorization": "User explicitly authorised both deliveries,first L8 then proactive,no new authorisation required",
|
||||
"stage1": {
|
||||
"candidate": "c85e772d2fd2be5182eb4d768ddd34d43962bf59",
|
||||
"includes": "14360748194f3658d91a7d7ae5615efd0fcbfbb7",
|
||||
"runtime": "11a6cee981f0a425b0fceefb6ed85485bb298245",
|
||||
"capacity_notes_reconciled": "c85e772d changes documentation only;historical suspension superseded by current explicit authorisation;capacity must be freshly measured",
|
||||
"runtime_delta_files": [
|
||||
"resources/js/components/simulation-form.tsx",
|
||||
"resources/js/components/simulation-irpc-annual.tsx",
|
||||
"resources/js/lib/irpc-annual-settlement.ts",
|
||||
"resources/js/lib/project-dossier-report.ts",
|
||||
"resources/js/lib/project-dossier.ts"
|
||||
]
|
||||
},
|
||||
"stage2": {
|
||||
"runtime_merge_commit": "74f7f93a750cfb88f9816512ee7add6473a3e34f",
|
||||
"branch": "codex/sequential-delivery-20261027",
|
||||
"includes_proactive_candidate": "0ff402a11dbf8d41c499dccd39184fdc20c833f4",
|
||||
"L8_is_ancestor": true,
|
||||
"shared_report_conflict": "Both imports and both row providers retained",
|
||||
"L8_other_runtime_files_byte_identical": [
|
||||
"resources/js/components/simulation-form.tsx",
|
||||
"resources/js/components/simulation-irpc-annual.tsx",
|
||||
"resources/js/lib/irpc-annual-settlement.ts",
|
||||
"resources/js/lib/project-dossier-report.ts"
|
||||
],
|
||||
"proactive_other_runtime_files_byte_identical": true
|
||||
},
|
||||
"local_verification": {
|
||||
"TypeScript": "passed",
|
||||
"isolated_build": "passed",
|
||||
"shared_report_delta": {
|
||||
"scope": "Only shared dossier report merge integration;accepted business-rule suites reused",
|
||||
"annual_rows": 6,
|
||||
"proactive_rows": 10,
|
||||
"annual_report_preserved": true,
|
||||
"private_idea_report_preserved": true,
|
||||
"inputs_unchanged": true,
|
||||
"no_cross_inference": true,
|
||||
"no_QA_data_written_or_published": true
|
||||
},
|
||||
"accepted_suites": "reused,not repeated",
|
||||
"no_database_or_fixture_operations": true
|
||||
},
|
||||
"server": {
|
||||
"SSH_bridge_state": "closed",
|
||||
"key_authentication": "denied with registered host key verified",
|
||||
"fresh_capacity": "not measured in this passage",
|
||||
"fresh_backup": false,
|
||||
"fresh_restore": false,
|
||||
"installation": false,
|
||||
"public_served_revision_read": {
|
||||
"checked_at_UTC": "2026-10-27T10:14:16.489135+00:00",
|
||||
"http_status": 200,
|
||||
"revision": {
|
||||
"commit": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-26T14:26:51.629481+00:00",
|
||||
"manifest_sha256": "367be71b25b56a83571d610e211ea11beae2af87989d62ef6cc7b9c54eabf580"
|
||||
},
|
||||
"method": "Public revision read only;no SSH,backup or installation executed"
|
||||
}
|
||||
},
|
||||
"main_at_preparation": "f8d57bddf96b4610604a013fcc5bdd703c7dc6d5",
|
||||
"main_push_executed": false,
|
||||
"required_execution_controls": [
|
||||
"Use existing authenticated local SSH session;do not request authorisation again",
|
||||
"Fresh capacity/inodes,backup and restore per existing procedure;keep active release until candidate ready",
|
||||
"Refresh preparation candidate/base/hashes per stage;do not reuse old dated receipts",
|
||||
"Stage1 only,L8;verify actual served revision and onlyL8 delta",
|
||||
"Only after stage1 confirmed,stage2;fresh guards and verify proactive delta and L8 preservation",
|
||||
"Exclude QA fixtures/outputs/test data from deployment inputs;no seed/import;preserve private pilots",
|
||||
"Return actual installed/served hashes and fresh receipt paths;do not label this local preparation as installation"
|
||||
],
|
||||
"actual_remote_changes": 0
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,4 +1,3 @@
|
||||
import { Link } from '@inertiajs/react';
|
||||
import { ArrowRight, Search } from 'lucide-react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import type { FormEvent } from 'react';
|
||||
@@ -128,6 +127,7 @@ type PortalHeroProps = {
|
||||
query: string;
|
||||
setQuery: (value: string) => void;
|
||||
onSearch: (event: FormEvent<HTMLFormElement>) => void;
|
||||
onNavigate: (view: 'opportunities') => void;
|
||||
stats?: HomeResponse['data']['stats'];
|
||||
};
|
||||
|
||||
@@ -136,6 +136,7 @@ export default function PortalHero({
|
||||
query,
|
||||
setQuery,
|
||||
onSearch,
|
||||
onNavigate,
|
||||
stats,
|
||||
}: PortalHeroProps) {
|
||||
const [currentSlide, setCurrentSlide] = useState(0);
|
||||
@@ -260,38 +261,20 @@ export default function PortalHero({
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div className="mt-4 flex flex-wrap items-center justify-center gap-2">
|
||||
<Link
|
||||
href="/porque-investir"
|
||||
className="inline-flex min-h-11 items-center rounded-lg border border-white/50 bg-black/15 px-3 py-1.5 text-sm font-semibold text-white transition-colors hover:bg-white/15 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white sm:min-h-9"
|
||||
<div className="mt-6 flex flex-wrap items-center justify-center gap-3">
|
||||
<button
|
||||
onClick={() => onNavigate('opportunities')}
|
||||
className="inline-flex min-h-11 items-center gap-2 rounded-xl bg-white px-5 py-3 text-sm font-semibold text-[#101820] transition-colors hover:bg-slate-100 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white"
|
||||
>
|
||||
Porquê investir em Moçambique?
|
||||
</Link>
|
||||
<Link
|
||||
href="/investimentos/iniciar"
|
||||
className="inline-flex min-h-11 items-center rounded-lg border border-white/50 bg-black/15 px-3 py-1.5 text-sm font-semibold text-white transition-colors hover:bg-white/15 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white sm:min-h-9"
|
||||
>
|
||||
Partir de uma ideia
|
||||
</Link>
|
||||
<Link
|
||||
href="/oportunidades"
|
||||
className="inline-flex min-h-11 items-center gap-1.5 rounded-lg bg-white px-3 py-1.5 text-sm font-semibold text-[#101820] transition-colors hover:bg-slate-100 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white sm:min-h-9"
|
||||
>
|
||||
Consultar oportunidades
|
||||
Consultar oportunidades{' '}
|
||||
<ArrowRight size={16} aria-hidden="true" />
|
||||
</Link>
|
||||
<Link
|
||||
</button>
|
||||
<a
|
||||
href="/simulador-fiscal"
|
||||
className="inline-flex min-h-11 items-center rounded-lg border border-white/50 bg-black/15 px-3 py-1.5 text-sm font-semibold text-white transition-colors hover:bg-white/15 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white sm:min-h-9"
|
||||
className="inline-flex min-h-11 items-center rounded-xl border border-white/50 bg-black/15 px-5 py-3 text-sm font-semibold text-white transition-colors hover:bg-white/15 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white"
|
||||
>
|
||||
Simulador Fiscal
|
||||
</Link>
|
||||
<Link
|
||||
href="/sectores"
|
||||
className="inline-flex min-h-11 items-center rounded-lg border border-white/50 bg-black/15 px-3 py-1.5 text-sm font-semibold text-white transition-colors hover:bg-white/15 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white sm:min-h-9"
|
||||
>
|
||||
Sectores de investimento
|
||||
</Link>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<dl
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import {SimulationIrpcNormal} from '@/components/simulation-irpc-normal';
|
||||
import {SimulationIrpcWithholdings} from '@/components/simulation-irpc-withholdings';
|
||||
import {SimulationIspcResiduals} from '@/components/simulation-ispc-residuals';
|
||||
import {SimulationIspcWithholding} from '@/components/simulation-ispc-withholding';
|
||||
import {SimulationIspcQuarter} from '@/components/simulation-ispc-quarter';
|
||||
import {SimulationIspcEligibility} from './simulation-ispc-eligibility';
|
||||
@@ -3510,9 +3507,6 @@ export function SimulationForm() {
|
||||
{(current.id === 'financial' || current.id === 'tax') && <SimulationIspcEligibility draft={draft} onChange={change} />}
|
||||
{(current.id === 'financial' || current.id === 'tax') && <SimulationIspcQuarter draft={draft} onChange={change} />}
|
||||
{(current.id === 'financial' || current.id === 'tax') && <SimulationIspcWithholding draft={draft} onChange={change} />}
|
||||
{(current.id === 'financial' || current.id === 'tax') && <SimulationIspcResiduals draft={draft} onChange={change} />}
|
||||
{(current.id === 'financial' || current.id === 'tax') && <SimulationIrpcWithholdings draft={draft} onChange={change} />}
|
||||
{(current.id === 'financial' || current.id === 'tax') && <SimulationIrpcNormal draft={draft} onChange={change} />}
|
||||
{(current.id === 'financial' || current.id === 'tax') && <SimulationMonthlyIva draft={draft} busy={isCalculating} onCalculate={runSimulation} onChange={change} />}
|
||||
{current.id === 'financial' &&
|
||||
(draft.detail_level === 'advanced' ||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import {newNormalAssessmentInput,type NormalAssessmentInput} from '@/lib/irpc-normal-assessment';
|
||||
import type {NormalBook} from '@/lib/irpc-normal';
|
||||
|
||||
export function SimulationIrpcAssessment({book,save}:{book:NormalBook;save:(b:NormalBook)=>void}){
|
||||
if(!book.base)return null;
|
||||
const a=book.assessment,change=(p:Partial<NormalAssessmentInput>)=>save({...book,assessment:{...(a??newNormalAssessmentInput()),...p}});
|
||||
if(!a)return<button type="button" onClick={()=>change({})}>Iniciar cálculo da colecta normal</button>;
|
||||
return<fieldset aria-label="Colecta — regime normal" className="space-y-3 rounded border p-3"><legend>Matéria colectável → colecta</legend><p>Reutiliza a matéria colectável actual. Exercício:{book.year||'por identificar'};período anual correspondente à conferência financeira. A taxa geral identificada para2026 é32%,artigo61(1). Benefícios,taxas reduzidas,tributações autónomas e outros casos especiais permanecem separados.</p>
|
||||
<label className="block">Enquadramento da colecta<select aria-label="Enquadramento da colecta" value={a.treatment} onChange={e=>change({treatment:e.target.value as NormalAssessmentInput['treatment']})}><option value="">Informação em falta</option><option value="general_61_1">Regime normal — taxa geral32%,artigo61(1)</option><option value="other">Benefício ou caso especial — correspondência própria</option></select></label>
|
||||
<label className="block">Suporte ou pressuposto da taxa geral neste caso<input value={a.reference} onChange={e=>change({reference:e.target.value})}/></label>
|
||||
<p>Lucro tributável → matéria colectável → colecta → saldo final a pagar ou recuperar. O saldo final pertence aL8:retenções,pagamentos e créditos anuais não são abatidos aqui. Uma colecta conhecida não significa saldo final conhecido.</p>
|
||||
</fieldset>;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import {useState} from 'react';
|
||||
import {costRules,newNormalCosts,newCostRow,reusableCreditBalance,type CostRow,type NormalCostsInput} from '@/lib/irpc-normal-costs';
|
||||
import {normalFinancialSource,type NormalBook} from '@/lib/irpc-normal';
|
||||
import {fiscalMoney} from '@/lib/irpc-normal-schedules';
|
||||
import {addFractions,subtractFractions,fractionPresentation} from '@/lib/fiscal-rational';
|
||||
import {type ProfitTopic} from '@/lib/irpc-normal-profit';
|
||||
type Field=[string,string,'money'|'text'|'choice'|'method'|'source'];
|
||||
const fields:Record<string,Field[]>={
|
||||
allowance:[['billed','Parcela facturada a clientes','money'],['taxedNotBilled','Parcela tributada emIRPS e não facturada a clientes','money']],
|
||||
advertising:[['campaign','Campanha de lançamento com horizonte superior a um ano','choice']],
|
||||
vehicle:[['passenger','Viatura ligeira de passageiros','choice'],['publicOrRental','Afecta a serviço público de transportes ou aluguer na actividade normal','choice']],
|
||||
fuel:[['supportedNormal','Parcela com activo/locação e consumo normal comprovados','money'],['passenger','Viatura ligeira de passageiros','choice'],['publicOrRental','Afecta a serviço público de transportes ou aluguer na actividade normal','choice']],
|
||||
rental:[['nonAcceptedQuota','Parcela documentada da quota não aceite (36h)','money'],['quotaReference','Documento e regra da quota não aceite','text'],['passenger','Aplicação36(4) — ligeira de passageiros','choice'],['publicOrRental','Afecta a serviço público de transportes ou aluguer na actividade normal','choice']],
|
||||
stock:[['balanceKey','Identificação única do inventário/objecto','text'],['lossObserved','Perda de valor efectivamente observada','choice'],['observedLoss','Perda total observada documentada','money'],['previous','Provisão fiscal anterior que subsiste','money']],
|
||||
litigation:[['balanceKey','Identificação única do processo/objecto','text'],['caseOngoing','Processo judicial em curso','choice'],['chargeDeductible','Obrigação daria lugar a custo fiscal dedutível','choice'],['obligation','Obrigação coberta documentada','money'],['previous','Provisão fiscal anterior que subsiste','money']],
|
||||
provision_reversal:[['balanceKey','Identificação única da provisão/objecto','text'],['previous','Parcela antes fiscalmente deduzida','money'],['eventEnded','Evento não subsiste ou utilização para fim diferente','choice'],['inResult','Reversão já incluída em proveitos do resultado actual','choice']],
|
||||
taxed_reversal:[['balanceKey','Identificação única da provisão/objecto','text'],['previous','Parcela antes tributada e não deduzida','money'],['eventEnded','Evento não subsiste ou utilização para fim diferente','choice'],['inResult','Reversão já incluída em proveitos do resultado actual','choice']],
|
||||
prior_cost:[['originalYear','Exercício de origem','text'],['unknownAtClose','Imprevisível ou manifestamente desconhecido no encerramento anterior','choice'],['closingEvidence','Suporte do conhecimento no encerramento anterior','text']],
|
||||
prior_income:[['originalYear','Exercício de origem','text'],['unknownAtClose','Imprevisível ou manifestamente desconhecido no encerramento anterior','choice'],['closingEvidence','Suporte do conhecimento no encerramento anterior','text']],
|
||||
work:[['projectKey','Identificação única da obra','text'],['method','Critério fiscal da obra','method'],['price','Preço contratual estabelecido','money'],['totalCost','Custo total estimado para concluir','money'],['incurred','Custos efectivamente incorporados acumulados','money'],['priorRevenue','Proveitos fiscais reconhecidos em exercícios anteriores','money'],['priorCost','Custos fiscais reconhecidos em exercícios anteriores','money'],['costSource','Linha de custos da obra no resultado actual','source'],['bookCost','Parcela de custos da obra já contabilizada no exercício','money'],['partialBilling','Facturação parcial com grau de acabamento correspondente','choice'],['ownFractionalDelivery','Obra por conta própria vendida e entregue fraccionadamente','choice'],['consistentMethod','Critério uniforme para obras idênticas e mantido até ao final','choice'],['publicReception','Recepção provisória de obra pública','choice'],['deferredReceipt','Receita antecipada19(5) proposta — zero conhecido se não aplicada','money']],
|
||||
};
|
||||
export function SimulationIrpcCosts({draft,book,save}:{draft:Record<string,unknown>;book:NormalBook;save:(b:NormalBook)=>void}){
|
||||
const[review,setReview]=useState(false),[error,setError]=useState(''),i=book.costs,source=normalFinancialSource(draft);
|
||||
if(!i)return<button type="button" onClick={()=>save({...book,costs:newNormalCosts()})}>Iniciar custos com limites, provisões e periodização</button>;
|
||||
const patch=(p:Partial<NormalCostsInput>)=>{setReview(false);save({...book,costs:{...i,...p}});};
|
||||
const row=(id:string,p:Partial<CostRow>)=>patch({rows:i.rows.map(r=>r.id===id?{...r,...p}:r)});
|
||||
const fact=(r:CostRow,k:string,v:string)=>row(r.id,{facts:{...r.facts,[k]:v}});
|
||||
const summaries=()=>{const groups=new Map<ProfitTopic,string[]>();for(const r of book.schedules?.rows??[]){if(!r.rule)continue;const k=({tax_own:'expenseCorrections',tax_other:'expenseCorrections',undocumented:'expenseCorrections',capital_in:'positivePatrimonial',patrimonial_gain:'positivePatrimonial',capital_out:'negativePatrimonial',patrimonial_cost:'negativePatrimonial',future_cost:'timing',future_income:'timing',current_cost:'timing',current_income:'timing'}as Record<string,ProfitTopic>)[r.rule];groups.set(k,[...(groups.get(k)??[]),r.amount]);}for(const r of i.rows)if(r.rule){const k=costRules[r.rule][1];groups.set(k,[...(groups.get(k)??[]),r.amount]);}return[...groups].map(([key,values])=>({key,amount:fractionPresentation(addFractions(values.map(fiscalMoney))).decimal}));};
|
||||
const reuse=(r:CostRow)=>{try{const code=r.sourceCode,l=source?.accountingLines.find(l=>l.code===code);if(!l)throw Error('Seleccione uma origem.');const claims=[...book.rows,...(book.schedules?.rows??[]),...i.rows.filter(q=>q.id!==r.id),...i.rows.filter(q=>q.rule==='work').map(q=>({sourceCode:q.facts.costSource,amount:q.facts.bookCost}))].filter(q=>q.sourceCode===code);const available=subtractFractions(fiscalMoney(l.total),addFractions(claims.map(q=>fiscalMoney(q.amount))));if(BigInt(available.numerator)<=0n)throw Error('Não há parcela livre conhecida nesta origem.');row(r.id,{amount:fractionPresentation(available).decimal});setError('');}catch(e){setError(String(e));}};
|
||||
return<fieldset aria-label="Custos com limites provisões periodização" className="space-y-3 rounded border p-3"><legend>Custos com limites, provisões e periodização — exercício2026</legend>
|
||||
<p>Reutiliza o resultado e as linhas já declaradas. Identifique só a parcela de cada categoria e os parâmetros em falta. Os limites anuais de publicidade e créditos são partilhados por todas as parcelas; os saldos de provisões não são consumidos. A divergência M20/M22 não bloqueia estes cálculos. Benefícios/casos especiaisL7 e saldo anualL8 mantêm os seus âmbitos.</p>{error&&<p role="alert">{error}</p>}
|
||||
<button type="button" onClick={()=>patch({rows:[...i.rows,newCostRow(crypto.randomUUID())]})}>Acrescentar custo, provisão ou periodização</button>
|
||||
{i.rows.some(r=>r.rule==='advertising')&&<fieldset><legend>Publicidade — limite único anual</legend><p>Volume de vendas da origem: {source?.accountingLines.find(l=>l.code==='revenue')?.total??'Em falta'} MZN. O limite não se repete por factura.</p><label>Correspondência às vendas normais do exercício<select aria-label="Vendas normais para publicidade" value={i.salesOrdinary} onChange={e=>patch({salesOrdinary:e.target.value as ''|'yes'})}><option value="">Informação em falta</option><option value="yes">Toda a receita da origem corresponde a vendas/serviços normais</option></select></label><label className="block">Suporte do volume de vendas e completude da publicidade<input value={i.advertisingReference} onChange={e=>patch({advertisingReference:e.target.value})}/></label><p>Campanhas de lançamento com efeito superior a um ano exigem36-A e articulação própria; permanecem discriminadas, sem dedução ordinária presumida.</p></fieldset>}
|
||||
{i.rows.some(r=>r.rule==='credit')&&<fieldset><legend>Créditos — limites anual e acumulado</legend><label>Regime da provisão de créditos<select aria-label="Regime da provisão de créditos" value={i.creditRegime} onChange={e=>patch({creditRegime:e.target.value as NormalCostsInput['creditRegime']})}><option value="">Por identificar</option><option value="ordinary">Ordinário — fora de supervisão financeira/seguradora</option><option value="regulated">Provisão sujeita a supervisão — correspondência própria</option></select></label><label className="block">Créditos da actividade normal existentes no fim do exercício<input value={i.creditBase} onChange={e=>patch({creditBase:e.target.value})}/></label>{reusableCreditBalance(source)&&<button type="button" onClick={()=>patch({creditBase:fractionPresentation(reusableCreditBalance(source)!).decimal})}>Reutilizar saldo financeiro de créditos: {fractionPresentation(reusableCreditBalance(source)!).decimal} MZN — conferir âmbito</button>}<label className="block">Provisão fiscal anterior que subsiste no termo do exercício<input value={i.creditPrevious} onChange={e=>patch({creditPrevious:e.target.value})}/></label><label className="block">Suporte do saldo de créditos e provisão anterior<input value={i.creditReference} onChange={e=>patch({creditReference:e.target.value})}/></label><p>1,5% anual e6% acumulado; saldo anterior em falta não significa zero. Não aplica regras bancárias/seguradoras nem percentagens de antiguidade presumidas.</p></fieldset>}
|
||||
{i.rows.map((r,n)=>{const income=['provision_reversal','taxed_reversal','prior_income','work'].includes(r.rule),omitted=r.rule==='provision_reversal'&&r.facts.inResult==='no';return<fieldset key={r.id} className="rounded border p-3"><legend>Parcela {n+1} — {r.document||'Por identificar'}</legend><label>Categoria<select aria-label={'Categoria custo '+(n+1)} value={r.rule} onChange={e=>row(r.id,{rule:e.target.value as CostRow['rule']})}><option value="">Por identificar</option>{Object.entries(costRules).map(([k,v])=><option key={k} value={k}>{v[0]} — {v[2]}</option>)}</select></label>
|
||||
{(['document','line','amount','reference']as const).map(k=><label key={k} className="block">{({document:'Documento ou mapa discriminado',line:'Linha distinta',amount:r.rule==='work'?'Proveitos da obra já contabilizados no exercício — zero se conhecido':'Parcela contabilística MZN',reference:'Suporte da classificação, condições e período'})[k]}<input aria-label={'Custo '+(n+1)+' '+k} value={r[k]} onChange={e=>row(r.id,{[k]:e.target.value})}/></label>)}
|
||||
{!omitted&&<><label>Origem contabilística<select aria-label={'Origem custo '+(n+1)} value={r.sourceCode} onChange={e=>row(r.id,{sourceCode:e.target.value})}><option value="">Por corresponder</option>{source?.accountingLines.filter(l=>l.accountingEffect===(income?'income':'expense')).map(l=><option key={l.code} value={l.code}>{l.origin}: {l.total} MZN</option>)}</select></label><button type="button" onClick={()=>reuse(r)}>Reutilizar parcela livre da origem {n+1}</button></>}
|
||||
{(fields[r.rule]??[]).filter(([k])=>!(k==='publicOrRental'&&r.facts.passenger!=='yes')&&!(k==='publicReception'&&r.facts.method!=='closing')&&!(r.rule==='stock'&&r.facts.lossObserved==='no'&&['observedLoss','previous'].includes(k))&&!(r.rule==='litigation'&&r.facts.caseOngoing==='no'&&['obligation','previous','chargeDeductible'].includes(k))).map(([k,label,type])=><label key={k} className="block">{label}{type==='choice'?<select aria-label={'Custo '+(n+1)+' '+k} value={r.facts[k]??''} onChange={e=>fact(r,k,e.target.value)}><option value="">Informação em falta</option><option value="yes">Sim — documentado</option><option value="no">Não — documentado</option></select>:type==='method'?<select aria-label={'Custo '+(n+1)+' '+k} value={r.facts[k]??''} onChange={e=>fact(r,k,e.target.value)}><option value="">Por identificar</option><option value="percentage">Percentagem de acabamento</option><option value="closing">Encerramento da obra</option></select>:type==='source'?<select aria-label={'Custo '+(n+1)+' '+k} value={r.facts[k]??''} onChange={e=>fact(r,k,e.target.value)}><option value="">Por corresponder/zero fora de linha</option>{source?.accountingLines.filter(l=>l.accountingEffect==='expense').map(l=><option key={l.code} value={l.code}>{l.origin}: {l.total} MZN</option>)}</select>:<input aria-label={'Custo '+(n+1)+' '+k} value={r.facts[k]??''} onChange={e=>fact(r,k,e.target.value)}/>}</label>)}
|
||||
<label>Condições ordinárias e inclusão na origem demonstradas<select aria-label={'Condições custo '+(n+1)} value={r.conditions} onChange={e=>row(r.id,{conditions:e.target.value as ''|'yes'})}><option value="">Informação em falta</option><option value="yes">Sim, nos documentos identificados</option></select></label><button type="button" onClick={()=>patch({rows:i.rows.filter(q=>q.id!==r.id)})}>Retirar parcela {n+1} das entradas actuais</button></fieldset>;})}
|
||||
{book.profit&&<><button type="button" onClick={()=>{try{summaries();setReview(true);setError('');}catch(e){setError(String(e));}}}>Conferir correspondência dos temas com os mapas</button>{review&&<div><p>Reveja as somas brutas antes de aplicar; não alteram os factos, o resultado financeiro ou os históricos.</p>{summaries().map(t=><p key={t.key}>{({expenseCorrections:'Correcções aos custos',incomeCorrections:'Correcções aos proveitos',positivePatrimonial:'Variações positivas',negativePatrimonial:'Variações negativas',timing:'Periodização',special:'Casos especiais'})[t.key]}: actual {book.profit!.topics[t.key].amount||book.profit!.topics[t.key].state||'Em falta'} → mapas {t.amount} MZN</p>)}<button type="button" onClick={()=>{const topics=structuredClone(book.profit!.topics);for(const t of summaries())topics[t.key]={state:'known',amount:t.amount,reference:'Correspondência aritmética aos documentos/linhas dos mapas de ajustamentos e custos do exercício.'};save({...book,profit:{...book.profit!,topics}});setReview(false);}}>Aplicar correspondências conferidas dos mapas</button></div>}</>}
|
||||
<p>Ao calcular e guardar, os novos resultados entram numa versão própria; o resultado anterior permanece no histórico. Informação em falta impede apenas os totais que dependem dessa parcela.</p>
|
||||
</fieldset>;
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
import {useState}from'react';
|
||||
import{depreciationCatalog,newNormalDepreciation,newDepreciationAsset,reuseNormalAssets,type DepreciationAsset}from'@/lib/irpc-normal-depreciation';
|
||||
import{normalFinancialSource,type NormalBook}from'@/lib/irpc-normal';
|
||||
import{fiscalMoney}from'@/lib/irpc-normal-schedules';import{addFractions,subtractFractions,fractionPresentation}from'@/lib/fiscal-rational';
|
||||
export function SimulationIrpcDepreciation({draft,book,save}:{draft:Record<string,unknown>;book:NormalBook;save:(b:NormalBook)=>void}){
|
||||
const[error,setError]=useState(''),input=book.depreciation,source=normalFinancialSource(draft);
|
||||
if(!input)return<div><button type="button" onClick={()=>save({...book,depreciation:newNormalDepreciation()})}>Iniciar amortizações — tabelas, métodos e quotas anteriores</button>{!!book.schedules?.assets.length&&<button type="button" onClick={()=>save({...book,depreciation:{...reuseNormalAssets(book.schedules!.assets),completenessReference:book.schedules!.assetsReference}})}>Reutilizar activos e valores do mapa inicial</button>}</div>;
|
||||
const patch=(id:string,p:Partial<DepreciationAsset>)=>save({...book,depreciation:{...input,assets:input.assets.map(a=>a.id===id?{...a,...p}:a)}});
|
||||
const field=(a:DepreciationAsset,n:number,k:keyof DepreciationAsset,label:string)=><label key={k}className="block">{label}<input aria-label={'Activo '+n+' '+k}value={a[k]}onChange={e=>patch(a.id,{[k]:e.target.value})}/></label>;
|
||||
const choice=(a:DepreciationAsset,n:number,k:'specificRate'|'consistentMethod'|'newTangible'|'switchToStraight'|'priorFullQuotas'|'vehicleException'|'limitedRights'|'individual',label:string)=><label key={k}className="block">{label}<select aria-label={'Activo '+n+' '+k}value={a[k]}onChange={e=>patch(a.id,{[k]:e.target.value})}><option value="">Informação em falta</option><option value="yes">Sim — documentado</option><option value="no">Não — documentado</option></select></label>;
|
||||
return<fieldset aria-label="Amortizações ampliadas L6"className="space-y-3 rounded border p-3"><legend>Amortizações — tabelas, métodos, duodécimos e quotas anteriores</legend>
|
||||
<p>Decreto72/2013 eCIRPC26/27. Reutiliza a depreciação financeira e os activos do mapa inicial; os originais/históricos ficam conservados. O novo mapa substitui exclusivamente o cálculo de amortizações, sem somar novamente o mapa inicial. Custo histórico e condições ordinárias documentados; reavaliações, turnos intensivos, concessões e outros casos especiais permanecem separados.</p>
|
||||
<p>Depreciação contabilística a repartir: {source?.accountingLines.find(l=>l.code==='depreciation')?.total??'Em falta'} {source?.currency}. O catálogo apresenta apenas os códigos correspondidos; outra categoria permanece identificada, sem taxa livre.</p>{error&&<p role="alert">{error}</p>}
|
||||
<label className="block">Suporte da reconciliação integral dos activos e quotas anteriores<input value={input.completenessReference}onChange={e=>save({...book,depreciation:{...input,completenessReference:e.target.value}})}/></label>
|
||||
<button type="button"onClick={()=>save({...book,depreciation:{...input,assets:[...input.assets,newDepreciationAsset(crypto.randomUUID())]}})}>Acrescentar activo ao mapa fiscal</button>
|
||||
{input.assets.map((a,index)=>{const n=index+1,entry=Object.hasOwn(depreciationCatalog,a.category)?depreciationCatalog[a.category as keyof typeof depreciationCatalog]:null;return<fieldset key={a.id}className="rounded border p-3"><legend>Activo fiscal {n} — {a.description||'Por identificar'}</legend>
|
||||
{field(a,n,'assetKey','Identificação única do activo')}{field(a,n,'description','Descrição')}{field(a,n,'document','Documento, pressuposto ou mapa de origem')}{field(a,n,'line','Linha distinta do documento/mapa')}
|
||||
<label>Categoria/tabela<select aria-label={'Activo '+n+' category'}value={a.category}onChange={e=>{const category=e.target.value as DepreciationAsset['category'],c=Object.hasOwn(depreciationCatalog,category)?depreciationCatalog[category as keyof typeof depreciationCatalog]:null;patch(a.id,{category,rate:c?.rate??''});}}><option value="">Por identificar</option>{Object.entries(depreciationCatalog).map(([k,c])=><option key={k}value={k}>Tabela{c.table}/{c.code} — {c.label} — {c.rate}%</option>)}<option value="nondepreciable">Elemento comprovadamente não depreciável — exclusão</option><option value="other">Outra categoria — correspondência pendente</option></select></label>
|
||||
{entry&&<p>Taxa máxima: {entry.rate}%; taxas constantes cobertas: {Number(entry.rate)/2}% a{entry.rate}%; vida útil mínima: {100/Number(entry.rate)}anos, máxima: {200/Number(entry.rate)}anos. Coeficiente degressivo máximo: {100/Number(entry.rate)<5?'1,5':100/Number(entry.rate)<=6?'2':'2,5'}, apenas nos activos elegíveis. Fonte:tabela{entry.table}/{entry.code},PDF{entry.page}.</p>}{field(a,n,'cost','Custo histórico documentado MZN')}{field(a,n,'accounting','Depreciação contabilística do exercício MZN')}
|
||||
<button type="button"onClick={()=>{try{const total=fiscalMoney(source?.accountingLines.find(l=>l.code==='depreciation')?.total??''),used=addFractions(input.assets.filter(q=>q.id!==a.id).map(q=>fiscalMoney(q.accounting))),left=subtractFractions(total,used);if(BigInt(left.numerator)<0n)throw Error('Valores repartidos excedem a origem.');patch(a.id,{accounting:fractionPresentation(left).decimal});setError('');}catch(e){setError(String(e));}}}>Reutilizar depreciação financeira ainda não repartida — activo {n}</button>
|
||||
{a.category!=='nondepreciable'&&<>
|
||||
<label>Tipo de aquisição/base<select aria-label={'Activo '+n+' valuation'} value={a.valuation} onChange={e=>patch(a.id,{valuation:e.target.value as DepreciationAsset['valuation']})}><option value="">Por identificar</option><option value="historical_new">Bem adquirido novo/construído ou produzido — custo histórico</option><option value="used">Bem adquirido usado — regra própria7(2)</option><option value="revalued">Bem reavaliado — regra própria15</option><option value="other">Outra base — por corresponder</option></select></label>{entry&&choice(a,n,'specificRate','Existe taxa específica da tabelaI para o activo/actividade')}{field(a,n,'residual','Valor residual MZN')}{entry?.kind==='building'&&field(a,n,'land','Terreno/parte não depreciável incluídos no custo MZN')}
|
||||
<label>Método<select aria-label={'Activo '+n+' method'}value={a.method}onChange={e=>patch(a.id,{method:e.target.value as DepreciationAsset['method']})}><option value="">Por identificar</option><option value="constant">Quotas constantes — artigos5/7</option><option value="declining">Quotas degressivas — artigos6/8</option><option value="low_value">Valor reduzido, opção integral — artigo17</option></select></label>
|
||||
{a.method==='constant'&&field(a,n,'rate','Taxa constante escolhida %')}
|
||||
{a.method==='declining'&&<>{choice(a,n,'newTangible','Activo tangível novo adquirido a terceiros ou construído/produzido')}{field(a,n,'factor','Coeficiente degressivo escolhido (máximo1,5/2/2,5)')}{choice(a,n,'switchToStraight','Aplicar saldo/vida útil restante8(2) quando mais favorável')}{a.switchToStraight==='yes'&&choice(a,n,'priorFullQuotas','Condição de quotas anteriores do artigo8(2) integralmente documentada')}</>}
|
||||
{a.method==='low_value'?<>{choice(a,n,'individual','Activo individual, fora de conjunto depreciado como um todo')}<p>Art17:até20000MZN, sem amortização fiscal anterior e entrada emuso neste período; a dedução não excede o contabilizado e o saldo fiscal.</p></>:<label>Período da quota<select aria-label={'Activo '+n+' timing'}value={a.timing}onChange={e=>patch(a.id,{timing:e.target.value as DepreciationAsset['timing']})}><option value="">Por identificar</option><option value="annual">Quota anual</option><option value="months">Duodécimos em vigor desde o início — artigo9</option></select></label>}
|
||||
{field(a,n,'start','Entrada em funcionamento/utilização AAAA-MM-DD')}
|
||||
<label>Transmissão, inutilização ou termo da vida útil<select aria-label={'Activo '+n+' exitState'}value={a.exitState}onChange={e=>patch(a.id,{exitState:e.target.value as DepreciationAsset['exitState']})}><option value="">Informação em falta</option><option value="absent">Ausência declarada de evento</option><option value="known">Evento/data conhecidos</option></select></label>{(a.exitState==='known'||a.exitDate)&&field(a,n,'exitDate','Data do evento AAAA-MM-DD')}
|
||||
{choice(a,n,'consistentMethod','Método uniforme desde o início, sem mudança ou excepção por corresponder')}{entry?.kind==='vehicle'&&choice(a,n,'vehicleException','Afectação a serviço público de transportes/locação na actividade normal')}{entry?.kind==='software'&&choice(a,n,'limitedRights','Aquisição onerosa e utilização exclusiva por tempo limitado')}
|
||||
{field(a,n,'previousAccounting','Quotas contabilísticas anteriores desde a utilização MZN')}{field(a,n,'previousFiscal','Quotas fiscais anteriormente deduzidas MZN')}{field(a,n,'priorAvailable','Parcela anterior temporariamente tributada, recuperável MZN')}{field(a,n,'previousReference','Suporte das quotas anteriores e da recuperabilidade fiscal')}
|
||||
{['previousAccounting','previousFiscal','priorAvailable'].every(k=>!a[k as 'previousFiscal']||/^0(?:\.0+)?$/.test(a[k as 'previousFiscal']))&&<button type="button"onClick={()=>{if(!a.reference.trim()){setError('Identifique primeiro o suporte da ausência de quotas anteriores.');return;}patch(a.id,{previousAccounting:'0',previousFiscal:'0',priorAvailable:'0',previousReference:'Ausência de quotas anteriores expressamente declarada; '+a.reference});setError('');}}>Declarar ausência de quotas anteriores — activo {n}</button>}
|
||||
<p>Quota anterior recuperável exige contabilização e tributação temporária demonstradas. Não inclui encargos permanentemente excluídos ou quota nunca contabilizada. O cálculo apresenta o saldo posterior aritmético; não consome saldos oficiais.</p></>}
|
||||
{field(a,n,'reference','Suporte do activo, categoria, condições e período')}<label>Condições ordinárias e documentos conferidos<select aria-label={'Activo '+n+' conditions'}value={a.conditions}onChange={e=>patch(a.id,{conditions:e.target.value as ''|'yes'})}><option value="">Informação em falta</option><option value="yes">Sim, no recorte documentado</option></select></label>
|
||||
<button type="button"onClick={()=>save({...book,depreciation:{...input,assets:input.assets.filter(q=>q.id!==a.id)}})}>Retirar activo {n} das entradas actuais</button></fieldset>;})}
|
||||
</fieldset>;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import {normalFinancialSource,type NormalBook} from '@/lib/irpc-normal';
|
||||
import {m20Accounts,newNormalFormPreparation,newFormAllocation,reuseDirectFormAllocations,normalFormAccountsFor,type NormalFormPreparationInput,type FormAllocation} from '@/lib/irpc-normal-form-preparation';
|
||||
export function SimulationIrpcFormPreparation({draft,book,save}:{draft:Record<string,unknown>;book:NormalBook;save:(b:NormalBook)=>void}){
|
||||
const i=book.forms,source=normalFinancialSource(draft);if(!i)return<button type="button" onClick={()=>save({...book,forms:newNormalFormPreparation()})}>Preparar representação dos valores e campos M20/M22</button>;
|
||||
const patch=(p:Partial<NormalFormPreparationInput>)=>save({...book,forms:{...i,...p}}),row=(id:string,p:Partial<FormAllocation>)=>patch({allocations:i.allocations.map(a=>a.id===id?{...a,...p}:a)});
|
||||
return<fieldset aria-label="Preparação de valores M20 M22" className="space-y-3 rounded border p-3"><legend>Representação dos valores e correspondência M20/M22</legend><p>Reutiliza os valores exactos do cálculo e do período/moeda já documentados. A preparação dos campos não altera lucro tributável,matéria colectável ou colecta. M20A.1 exige meticais sem centavos;fracções conservam o valor exacto e ficam pendentes de regra de representação. O transporte201/quadro8 versus200/quadro10 continua identificado,só no resultado afectado. Não gera declaração oficial nem saldo finalL8.</p>
|
||||
<label className="block">Exemplares de preparação<select value={i.edition} onChange={e=>patch({edition:e.target.value as NormalFormPreparationInput['edition']})}><option value="">Por identificar</option><option value="accepted_pdf_and_m20a1">PDF M22 quadros10–12 e M20A.1 inventariados — edições distintas</option></select></label>
|
||||
<label className="block">Suporte da edição e do período<input value={i.reference} onChange={e=>patch({reference:e.target.value})}/></label><label className="block">Completude das contas e discriminação das linhas do plano<input value={i.completenessReference} onChange={e=>patch({completenessReference:e.target.value})}/></label>
|
||||
<button type="button" onClick={()=>patch({allocations:[...i.allocations,...reuseDirectFormAllocations(source).filter(a=>!i.allocations.some(r=>r.sourceCode===a.sourceCode))]})}>Reutilizar contas directas ainda não discriminadas</button><button type="button" onClick={()=>patch({allocations:[...i.allocations,newFormAllocation(crypto.randomUUID())]})}>Acrescentar parcela contabilística M20</button>
|
||||
{i.allocations.map((a,n)=><fieldset key={a.id} className="rounded border p-2"><legend>Parcela M20 {n+1}</legend><label className="block">Linha de origem<select aria-label={'Origem M20 '+(n+1)} value={a.sourceCode} onChange={e=>row(a.id,{sourceCode:e.target.value})}><option value="">Seleccione</option>{source?.accountingLines.map(l=><option key={l.code} value={l.code}>{l.origin}: {l.total} MZN</option>)}</select></label><label className="block">Conta M20A.1<select aria-label={'Conta M20 '+(n+1)} value={a.account} onChange={e=>row(a.id,{account:e.target.value as FormAllocation['account']})}><option value="">Por corresponder</option>{Object.entries(m20Accounts).filter(([k])=>normalFormAccountsFor(a.sourceCode).includes(k)||k===a.account).map(([k,v])=><option key={k}value={k}>{k} — {v}</option>)}</select></label><label className="block">Montante MZN<input aria-label={'Montante M20 '+(n+1)}value={a.amount}onChange={e=>row(a.id,{amount:e.target.value})}/></label><label className="block">Suporte da classificação<input aria-label={'Suporte M20 '+(n+1)}value={a.reference}onChange={e=>row(a.id,{reference:e.target.value})}/></label></fieldset>)}
|
||||
<fieldset className="rounded border p-2"><legend>Imposto contabilizado e resultado líquido</legend><p>Colecta e saldo a pagar não são usados como gasto contabilístico presumido. Indique imposto reconhecido e se já está incluído numa linha do plano,para evitar subtracção duplicada.</p><label className="block">Estado do imposto contabilizado<select aria-label="Estado do imposto contabilizado" value={i.incomeTax.state} onChange={e=>patch({incomeTax:{...i.incomeTax,state:e.target.value as ''|'known'|'absent'}})}><option value="">Informação em falta</option><option value="known">Valor conhecido</option><option value="absent">Ausência declarada com suporte</option></select></label>{(i.incomeTax.state==='known'||i.incomeTax.amount!==''||i.incomeTax.placement!=='')&&<><label className="block">Imposto contabilizado em MZN<input value={i.incomeTax.amount} onChange={e=>patch({incomeTax:{...i.incomeTax,amount:e.target.value}})}/></label><label className="block">Localização do imposto contabilizado<select value={i.incomeTax.placement} onChange={e=>patch({incomeTax:{...i.incomeTax,placement:e.target.value as ''|'included'|'outside'}})}><option value="">Por identificar</option><option value="included">Já incluído no resultado do plano — discriminado na conta8.5</option><option value="outside">Exterior ao resultado antes de imposto do plano</option></select></label></>}<label className="block">Suporte do imposto contabilizado<input value={i.incomeTax.reference}onChange={e=>patch({incomeTax:{...i.incomeTax,reference:e.target.value}})}/></label></fieldset>
|
||||
<label className="block">Parcela de taxa reduzida para a colecta total302<select aria-label="Parcela de taxa reduzida para a colecta total302" value={i.reducedRate.state} onChange={e=>patch({reducedRate:{...i.reducedRate,state:e.target.value as ''|'known'|'absent'}})}><option value="">Informação em falta</option><option value="absent">Ausência declarada — sem parcela reduzida neste sujeito/período</option><option value="known">Situação conhecida — âmbitoL7 por tratar</option></select></label><label className="block">Suporte da situação da taxa reduzida<input value={i.reducedRate.reference}onChange={e=>patch({reducedRate:{...i.reducedRate,reference:e.target.value}})}/></label>
|
||||
</fieldset>;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import {newIrpcInterestRule,type IrpcInterestRule} from '@/lib/irpc-interest';
|
||||
import {mrftaCases,mrftaCaseHtml} from '@/lib/irpc-mrfta-cases';
|
||||
import {useState} from 'react';
|
||||
import {irpcCurrent,type IrpcBook} from '@/lib/irpc-withholdings';
|
||||
import {newMrftaInput,recordMrfta,mrftaHtml,mrftaReportRows,mrftaCurrent,type MrftaInput} from '@/lib/irpc-mrfta';
|
||||
|
||||
export function SimulationIrpcMrfta({draft,book,save}:{draft:Record<string,unknown>;book:IrpcBook;save:(book:IrpcBook)=>void}){
|
||||
const [error,setError]=useState(''),i=book.mrfta??newMrftaInput();
|
||||
const change=(patch:Partial<MrftaInput>)=>save({...book,mrfta:{...i,...patch}});
|
||||
const interestMode=i.interest.mode||(i.interest.calculation==='automatic'?'automatic':'');
|
||||
const interest=(patch:Partial<MrftaInput['interest']>)=>change({interest:{...i.interest,...patch}});
|
||||
const field=(key:'period'|'nuit'|'name'|'commercialName'|'taxArea'|'address'|'contact'|'completenessRef'|'otherRubricsRef',label:string,type='text')=><label className="block">{label}<input className="block rounded border p-2" type={type} value={i[key]} onChange={e=>change({[key]:e.target.value})}/></label>;
|
||||
const select=(key:'declaration'|'timing'|'completeness'|'otherRubrics',label:string,options:Array<[string,string]>)=><label className="block">{label}<select value={i[key]} onChange={e=>change({[key]:e.target.value})}>{options.map(([v,l])=><option key={v} value={v}>{l}</option>)}</select></label>;
|
||||
const periods=[...new Set(book.result?.rows.map(r=>r.period).filter(Boolean)??[])];
|
||||
const identities=Object.entries((JSON.parse(String(draft.modelo_a_snapshot||'{}')).irpcWithholdings??{}) as Record<string,IrpcBook>).filter(([,b])=>b.mrfta?.nuit&&b.mrfta?.name&&(!i.nuit.trim()||i.nuit===b.mrfta.nuit)&&(!i.name.trim()||i.name===b.mrfta.name)&&(['nuit','name','commercialName','taxArea','address','contact'] as const).some(key=>!i[key].trim()&&b.mrfta![key].trim()));
|
||||
return <fieldset aria-label="Preparação MRFTA e juros" className="space-y-3 rounded border p-4"><legend>MRFTA — preenchimento e juros compensatórios</legend><p>Reutiliza o cálculo guardado, documentos e entregas IRPC. Um mês/ano por declaração. A retenção sofrida e as dispensas ficam separadas. Quadros 8/9 reservados à assinatura e aos serviços; não há submissão ou aceitação AT.</p>
|
||||
{identities.map(([scope,b])=><button key={scope} type="button" onClick={()=>{const p:Partial<MrftaInput>={};for(const key of ['nuit','name','commercialName','taxArea','address','contact']as const)if(!i[key].trim())p[key]=b.mrfta![key];change(p);}}>Reutilizar identidade fiscal {b.mrfta!.name} ({scope}) nos campos vazios</button>)}
|
||||
<div className="grid gap-3 md:grid-cols-2">{field('period','Quadro 2 — mês/ano','month')}<label>Período existente<select value="" onChange={e=>{if(e.target.value)change({period:e.target.value});}}><option value="">Seleccione</option>{periods.map(p=><option key={p} value={p}>{p}</option>)}</select></label>{select('declaration','Quadro 1 — retenção na fonte',[['','Por identificar'],['initial','Inicial'],['replacement','Substituição']])}{select('timing','Quadro 2 — situação do prazo',[['','Por esclarecer'],['within','Dentro do prazo'],['late','Fora do prazo']])}{field('nuit','Quadro 3 — NUIT')}{field('taxArea','Quadro 3 — área fiscal')}{field('name','Quadro 4 — nome do sujeito passivo')}{field('commercialName','Quadro 5 — nome comercial')}{field('address','Quadro 6 — domicílio fiscal')}{field('contact','Quadro 6 — contacto')}{select('completeness','Retenções do sujeito passivo neste período conferidas, incluindo demais livros',[['','Por esclarecer'],['yes','Sim'],['no','Ainda não']])}{field('completenessRef','Referência da reconciliação do período')}{select('otherRubrics','IRPS, tributação autónoma e outras rubricas fora deste recorte',[['','Por esclarecer'],['none','Ausência de outros valores devidos documentada'],['pending','Existem ou estão por apurar']])}{field('otherRubricsRef','Documento da situação das outras rubricas')}</div>
|
||||
<h5>Quadro 7 — CER das rubricas correspondidas</h5><p>Base, taxa e imposto vêm do cálculo guardado. O CER é transcrito da referência aplicável; os números de campos da guia antiga não são automaticamente códigos de receita. Códigos introduzidos não são validados por catálogo oficial; códigos provisórios ou de simulação não são correspondências oficiais.</p>
|
||||
{book.result?.inputs.filter(r=>r.direction==='paid'&&book.result?.rows.some(v=>v.id===r.id&&v.period===i.period&&v.status==='calculated'&&v.treatment!=='dispensed')).map(r=>{const code=i.codes.find(c=>c.rowId===r.id)??{rowId:r.id,cer:'',reference:''};const update=(p:Partial<typeof code>)=>change({codes:[...i.codes.filter(c=>c.rowId!==r.id),{...code,...p}]});return <div key={r.id} className="grid gap-2 md:grid-cols-3"><span>{r.documentRef} — {r.counterparty}</span><label>CER<input value={code.cer} onChange={e=>update({cer:e.target.value})}/></label><label>Documento / referência do CER<input value={code.reference} onChange={e=>update({reference:e.target.value})}/></label></div>;})}
|
||||
<h5>Juros compensatórios — separados do principal</h5><p>Regulamento IRPC, artigos 25/35: a taxa refere MAIBOR de 12 meses + 2 pontos. O Banco de Moçambique documenta a descontinuidade da MAIBOR. O portal não adopta MIMO ou Prime como substituto nem calcula juros de mora.</p>
|
||||
<label>Tratamento dos juros<select value={interestMode} onChange={e=>interest(e.target.value==='automatic'?{mode:'',calculation:'automatic'}:{mode:e.target.value as MrftaInput['interest']['mode'],calculation:undefined})}><option value="">Informação insuficiente / cálculo automático por resolver</option><option value="assessment">Transcrever liquidação documentada de juros compensatórios</option><option value="automatic">Cálculo com taxa e regra documentadas — sem parâmetro pré-definido</option><option value="timely">Conferir entrega integral dentro do prazo documentado</option></select></label>
|
||||
{interestMode&&<><label>Período documentado dos juros / entregas<input type="month" value={i.interest.period} onChange={e=>interest({period:e.target.value})}/></label><label>Documento da liquidação / reconciliação<input value={i.interest.reference} onChange={e=>interest({reference:e.target.value})}/></label></>}
|
||||
{['assessment','automatic'].includes(interestMode)&&<>{i.interest.mode==='assessment'&&<label>Montante dos juros em MZN<input value={i.interest.amount} onChange={e=>interest({amount:e.target.value})}/></label>}<label>Data da liquidação<input type="date" value={i.interest.date} onChange={e=>interest({date:e.target.value})}/></label></>}
|
||||
{['timely','automatic'].includes(interestMode)&&<><label>Prazo aplicável documentado<input type="date" value={i.interest.dueDate} onChange={e=>interest({dueDate:e.target.value})}/></label><label>Fonte do prazo, incluindo eventual ajuste de calendário<input value={i.interest.dueReference} onChange={e=>interest({dueReference:e.target.value})}/></label></>}
|
||||
{interestMode==='automatic'&&<fieldset className="space-y-2 rounded border p-2"><legend>Parâmetros documentados do cálculo — sem taxa fiscal de2026 pré-definida</legend><p>Simulação pelos pressupostos introduzidos, sem confirmação fiscal dos juros. Preencha apenas a regra aplicável ao caso. Sem parâmetro completo, os juros continuam indeterminados. A taxa bancária actual não é adoptada por substituição. Imposto por conta não retido e juros de mora mantêm regra própria.</p>{(['annualRate','rateSource','fiscalBasis','validFrom','validTo','dayBasisRef','roundingRef','occurrenceRef']as const).map(k=><label key={k} className="block">{({annualRate:'Taxa anual final (%) documentada, incluindo acréscimos aplicáveis',rateSource:'Documento e citação da taxa',fiscalBasis:'Fundamento da aplicação fiscal ao caso',validFrom:'Parâmetro aplicável desde',validTo:'Parâmetro aplicável até',dayBasisRef:'Documento da base anual e contagem diária',roundingRef:'Documento do arredondamento do total',occurrenceRef:'Documento da retenção e ocorrência'})[k]}<input type={k==='validFrom'||k==='validTo'?'date':'text'} value={i.interest.automatic?.[k]??''} onChange={e=>interest({automatic:{...(i.interest.automatic??newIrpcInterestRule()),[k]:e.target.value}})}/></label>)}{(['dayBasis','rounding','retention']as const).map(k=><label key={k} className="block">{({dayBasis:'Base anual conforme documento',rounding:'Arredondamento do total conforme documento',retention:'Retenção efectuada'})[k]}<select value={i.interest.automatic?.[k]??''} onChange={e=>interest({automatic:{...(i.interest.automatic??newIrpcInterestRule()),[k]:e.target.value} as IrpcInterestRule})}>{(k==='dayBasis'?[['','Por identificar'],['365','365 dias'],['366','366 dias'],['actual_year','Dias efectivos de cada ano']]:k==='rounding'?[['','Por identificar'],['total_cent_half_up','Total aos cêntimos — metade por excesso'],['total_cent_down','Total aos cêntimos — por defeito']]:[['','Por identificar'],['withheld','Sim, documentada'],['not_withheld','Não efectuada, documentado']]).map(([v,l])=><option key={v} value={v}>{l}</option>)}</select></label>)}</fieldset>}
|
||||
<button type="button" className="rounded border p-2" onClick={()=>{try{save(recordMrfta(book,irpcCurrent(draft,book)));setError('');}catch(e){setError(String(e));}}}>Preparar e guardar MRFTA</button><button type="button" className="rounded border p-2" onClick={()=>{try{const html=mrftaHtml(book,irpcCurrent(draft,book)),u=URL.createObjectURL(new Blob([html],{type:'text/html;charset=utf-8'})),a=document.createElement('a');a.href=u;a.download='MRFTA-'+(i.period||'periodo')+'-preparacao.html';a.click();URL.revokeObjectURL(u);setError('');}catch(e){setError(String(e));}}}>Exportar preenchimento MRFTA</button>
|
||||
{book.mrftaResult&&<fieldset className="space-y-2 rounded border p-2"><legend>Casos de trabalho separados por período, rubrica, taxa e CER</legend><p>Estas fichas conservam as pendências do período. Não são declarações autónomas, anexos oficiais ou uma autorização para fundir taxas.</p>{mrftaCases(book.mrftaResult.model).map(c=><div key={c.key}><span>{c.period}; {c.rubric}; {c.rate}%; CER:{c.cer||'por corresponder'}; documentos:{c.documents.join('; ')}.</span><button type="button" onClick={()=>{try{if(!irpcCurrent(draft,book)||!mrftaCurrent(book,true))throw Error('Reprepare as entradas actuais antes de exportar o caso.');const html=mrftaCaseHtml(book.mrftaResult!.model,c.key),u=URL.createObjectURL(new Blob([html],{type:'text/html;charset=utf-8'})),a=document.createElement('a');a.href=u;a.download='MRFTA-caso-'+c.key+'.html';a.click();URL.revokeObjectURL(u);setError('');}catch(e){setError(String(e));}}}>Exportar ficha de trabalho {c.rate}% / {c.cer||'CER pendente'}</button></div>)}</fieldset>}
|
||||
{error&&<p role="alert">{error}</p>}{mrftaReportRows(book,irpcCurrent(draft,book)).map((r,n)=><p key={n}><strong>{r[1]}</strong>: {r[2]}<small>{r[3]}</small></p>)}
|
||||
</fieldset>;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
import {SimulationIrpcSpecial} from '@/components/simulation-irpc-special';
|
||||
import {SimulationIrpcFormPreparation} from '@/components/simulation-irpc-form-preparation';
|
||||
import {SimulationIrpcPeriodFx} from '@/components/simulation-irpc-period-fx';
|
||||
import {SimulationIrpcDepreciation} from '@/components/simulation-irpc-depreciation';
|
||||
import {SimulationIrpcCosts} from '@/components/simulation-irpc-costs';
|
||||
import {SimulationIrpcSchedules} from '@/components/simulation-irpc-schedules';
|
||||
import {SimulationIrpcAssessment} from '@/components/simulation-irpc-assessment';
|
||||
import {useState} from 'react';
|
||||
import {SimulationIrpcTaxableBase} from '@/components/simulation-irpc-taxable-base';
|
||||
import {newNormalProfitInput,profitTopics,type NormalProfitInput,type ProfitEvidence} from '@/lib/irpc-normal-profit';
|
||||
import {normalBook,saveNormalBook,normalFinancialSource,newNormalAdjustment,recordNormal,normalHtml,normalReportRows,type NormalBook,type NormalAdjustment} from '@/lib/irpc-normal';
|
||||
|
||||
export function SimulationIrpcNormal({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}){
|
||||
const[error,setError]=useState('');if(draft.fiscal_component!=='irpc')return null;
|
||||
try{
|
||||
const b=normalBook(draft),source=normalFinancialSource(draft);
|
||||
const save=(next:NormalBook)=>{try{onChange('modelo_a_snapshot',saveNormalBook(draft,next));setError('');}catch(e){setError(String(e));}};
|
||||
const patch=(id:string,p:Partial<NormalAdjustment>)=>save({...b,rows:b.rows.map(r=>r.id===id?{...r,...p}:r)});
|
||||
const profit=(patch:Partial<NormalProfitInput>)=>save({...b,profit:{...(b.profit??newNormalProfitInput()),...patch}});
|
||||
const field=(r:NormalAdjustment,k:'document'|'line'|'amount'|'reference',label:string)=><label className="block">{label}<input value={r[k]} onChange={e=>patch(r.id,{[k]:e.target.value})}/></label>;
|
||||
return<section aria-label="IRPC normal — ajustamentos" className="space-y-3 rounded border p-4"><h4>L6 — IRPC normal: ajustamentos ao resultado financeiro</h4><p>Acréscimos de multas sem origem contratual e juros compensatórios incluídos nos custos do plano, artigo 36(1)c. A conferência anual pode determinar o lucro tributável simulado no recorte ordinário documentado. A matéria colectável exige conferência específica de deduções e perdas; a colecta tem cálculo próprio e o saldo final a pagar ou recuperar pertence aL8. Não reutiliza automaticamente juros simulados de L5.</p>{error&&<p role="alert">{error}</p>}
|
||||
{source?<p>Origem: plano financeiro desta oportunidade; {source.periods} meses; {source.currency}; resultado antes de imposto: {source.accountingProfitBeforeTax}. Cobranças, pagamentos e reembolso de capital ficam fora do resultado.</p>:<p>{b.periodsFx?'Complete a correspondência do período e moeda abaixo para reutilizar o plano existente emMZN.':'Prepare o plano financeiro para reutilizar o resultado e os custos reconciliados.'}</p>}
|
||||
<label className="block">Exercício fiscal<input value={b.year} onChange={e=>save({...b,year:e.target.value})}/></label>
|
||||
<label className="block">{b.periodsFx?'Correspondência do plano ao período documentado':b.schedules?'Correspondência dos12 meses do plano ao período anual documentado':'Correspondência dos 12 meses do plano a Janeiro–Dezembro de 2026'}<input value={b.mappingReference} onChange={e=>save({...b,mappingReference:e.target.value})}/></label>
|
||||
<label className="block">Âmbito<select value={b.scope} onChange={e=>save({...b,scope:e.target.value as NormalBook['scope']})}><option value="">Por identificar</option><option value="resident_general">Sujeito residente — regime geral, fora de transparência e regimes especiais</option><option value="ep_general">Não residente com estabelecimento estável — regime geral, só resultado imputável ao EP (mapas complementares)</option><option value="other">Outro âmbito — por corresponder</option></select></label>
|
||||
<label className="block">Suporte do âmbito e da imputação integral do resultado ao sujeito/EP<input value={b.scopeReference} onChange={e=>save({...b,scopeReference:e.target.value})}/></label>
|
||||
<button type="button" onClick={()=>save({...b,rows:[...b.rows,newNormalAdjustment(crypto.randomUUID())]})}>Acrescentar ajustamento ao resultado</button>
|
||||
{b.rows.map(r=><fieldset key={r.id} className="space-y-2 rounded border p-3"><legend>{r.document||'Ajustamento por identificar'}</legend><label className="block">Custo de origem na ponte<select value={r.sourceCode} onChange={e=>patch(r.id,{sourceCode:e.target.value})}><option value="">Seleccione</option>{source?.accountingLines.filter(l=>l.accountingEffect==='expense').map(l=><option key={l.code} value={l.code}>{l.origin}: {l.total} {source.currency}</option>)}</select></label>{field(r,'document','Documento ou pressuposto identificado')}{field(r,'line','Linha distinta do documento')}{field(r,'amount','Parcela do custo em MZN')}
|
||||
<label className="block">Natureza documentada<select value={r.rule} onChange={e=>patch(r.id,{rule:e.target.value as NormalAdjustment['rule']})}><option value="">Por classificar</option><option value="noncontractual_fine">Multa/encargo por infracção sem origem contratual — 36(1)c</option><option value="compensatory_interest">Juros compensatórios — 36(1)c</option><option value="other">Outro ajustamento — por corresponder</option></select></label>
|
||||
<label className="block">Parcela incluída nos custos do resultado de partida<select value={r.included} onChange={e=>patch(r.id,{included:e.target.value as NormalAdjustment['included']})}><option value="">Por demonstrar</option><option value="yes">Sim, reconciliada com a linha de origem</option><option value="no">Não — não acrescentar novamente</option></select></label>{field(r,'reference','Suporte da qualificação, ocorrência e inclusão contabilística')}<p>Juros bancários e penalidades contratuais não são classificados automaticamente como infracções.</p></fieldset>)}
|
||||
{!b.profit?<button type="button" onClick={()=>profit({})}>Iniciar conferência até ao lucro tributável</button>:<fieldset aria-label="Conferência do lucro tributável" className="space-y-3 rounded border p-3"><legend>Resultado financeiro → ajustamentos → lucro tributável simulado</legend><p>Conferência do sujeito passivo/exercício completo. Cada receita remanescente deve ser ordinária do exercício;cada custo remanescente deve estar documentado e ser indispensável à fonte produtora,sem outras exclusões ou limites. Outras situações conhecidas permanecem discriminadas. Ausência declarada exige suporte e não é informação em falta.</p>
|
||||
<label className="block">Suporte da completude do sujeito passivo no exercício<input value={b.profit.completenessReference} onChange={e=>profit({completenessReference:e.target.value})}/></label>
|
||||
{source?.accountingLines.map(l=>{const review=b.profit!.lines.find(r=>r.code===l.code)??{code:l.code,state:'' as const,reference:''};const change=(p:Partial<typeof review>)=>profit({lines:[...b.profit!.lines.filter(r=>r.code!==l.code),{...review,...p}]});return<fieldset key={l.code} className="rounded border p-2"><legend>{l.origin} — {l.total} {source.currency}</legend><label className="block">Estado fiscal — {l.origin}<select aria-label={'Estado fiscal — '+l.origin} value={review.state} onChange={e=>change({state:e.target.value as ProfitEvidence['state']})}><option value="">Informação em falta</option><option value="known">Valor conhecido e qualificação ordinária documentada</option><option value="absent">Ausência declarada — conferir origem zero</option></select></label><label className="block">Suporte fiscal — {l.origin}<input value={review.reference} onChange={e=>change({reference:e.target.value})}/></label></fieldset>;})}
|
||||
<p>Depreciação positiva e juros financeiros não integralmente acrescidos exigem correspondência própria;uma declaração de ausência não apaga os valores do plano.</p>
|
||||
{profitTopics.map(([k,label])=>{const t=b.profit!.topics[k];const change=(p:Partial<ProfitEvidence>)=>profit({topics:{...b.profit!.topics,[k]:{...t,...p}}});return<fieldset key={k} className="rounded border p-2"><legend>{label}</legend><label className="block">Estado — {label}<select aria-label={'Estado — '+label} value={t.state} onChange={e=>change({state:e.target.value as ProfitEvidence['state']})}><option value="">Informação em falta</option><option value="known">Valor conhecido</option><option value="absent">Ausência declarada com suporte</option></select></label>{(t.state==='known'||t.amount!=='')&&<label className="block">Montante conhecido — {label}<input value={t.amount} onChange={e=>change({amount:e.target.value})}/></label>}<label className="block">Suporte — {label}<input value={t.reference} onChange={e=>change({reference:e.target.value})}/></label></fieldset>;})}
|
||||
</fieldset>}
|
||||
<SimulationIrpcPeriodFx draft={draft} book={b} save={save}/>
|
||||
<SimulationIrpcSchedules book={b} save={save}/>
|
||||
<SimulationIrpcDepreciation draft={draft} book={b} save={save}/>
|
||||
<SimulationIrpcCosts draft={draft} book={b} save={save}/>
|
||||
<SimulationIrpcTaxableBase draft={draft} book={b} save={save}/>
|
||||
<SimulationIrpcAssessment book={b} save={save}/>
|
||||
<SimulationIrpcSpecial draft={draft} book={b} save={save}/>
|
||||
<SimulationIrpcFormPreparation draft={draft} book={b} save={save}/>
|
||||
<button type="button" onClick={()=>{try{save(recordNormal(draft,b));}catch(e){setError(String(e));}}}>Calcular e guardar L6 e tratamentos L7 preparados</button>
|
||||
<button type="button" onClick={()=>{try{const html=normalHtml(draft),url=URL.createObjectURL(new Blob([html],{type:'text/html;charset=utf-8'})),a=document.createElement('a');a.href=url;a.download='IRPC-normal-ajustamentos.html';a.click();URL.revokeObjectURL(url);setError('');}catch(e){setError(String(e));}}}>Exportar mapa parcial L6</button>
|
||||
{normalReportRows(draft).map((r,n)=><p key={n}>{r[1]} — {r[2]} — {r[3]}</p>)}
|
||||
</section>;
|
||||
}catch(e){return<p role="alert">Preparação L6 não recuperável: {String(e)}. Originais e histórico conservados.</p>;}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import {SimulationFxSelection} from '@/components/simulation-fx-selection';
|
||||
import {rawNormalFinancialSource,type NormalBook} from '@/lib/irpc-normal';
|
||||
import {newNormalPeriodFx,mapNormalPeriodFx,type NormalPeriodFxInput} from '@/lib/irpc-normal-period-fx';
|
||||
import {irpcFxSources,irpcFxRow,updateIrpcFx} from '@/lib/irpc-fx';
|
||||
export function SimulationIrpcPeriodFx({draft,book,save}:{draft:Record<string,unknown>;book:NormalBook;save:(b:NormalBook)=>void}){
|
||||
const raw=rawNormalFinancialSource(draft),i=book.periodsFx;
|
||||
if(!i)return<button type="button" onClick={()=>save({...book,periodsFx:newNormalPeriodFx()})}>Preparar período curto ou plano noutra moeda</button>;
|
||||
const patch=(p:Partial<NormalPeriodFxInput>)=>save({...book,periodsFx:{...i,...p}}),model=mapNormalPeriodFx(draft,i,raw),sources=irpcFxSources(draft);
|
||||
const text=(k:'from'|'to'|'planStart'|'reference'|'conversionReference'|'mznMapsReference',label:string)=><label className="block">{label}<input value={i[k]} onChange={e=>patch({[k]:e.target.value})}/></label>;
|
||||
return<fieldset aria-label="Período e moeda L6" className="space-y-3 rounded border p-3"><legend>Período fiscal e conversão do plano — simulação L6</legend><p>Reutiliza os meses e valores originais do plano. Seleccione apenas os meses do período documentado;sem anualizar o resultado. Os mapas,activos e saldos fiscais permanecem emMZN e exigem reconciliação explícita. A conversão cambial para simulação usa o mecanismo existente; não confirma automaticamente a regra fiscal de conversão anual.</p>
|
||||
<label className="block">Tipo de período<select value={i.kind} onChange={e=>patch({kind:e.target.value as NormalPeriodFxInput['kind']})}><option value="">Por identificar</option><option value="annual">Anual documentado — 12meses</option><option value="start">Início de actividade — 7(4)a</option><option value="cessation">Cessação de actividade — 7(4)b</option><option value="same_year">Início e fim de sujeição no mesmo exercício — 7(4)c</option><option value="transition">Transição para período autorizado/comunicado — 7(4)d</option></select></label>
|
||||
{text('from','Início do período fiscal (AAAA-MM-DD)')}{text('to','Fim do período fiscal (AAAA-MM-DD)')}{text('planStart','Primeiro mês civil do plano (AAAA-MM-01)')}{text('reference','Suporte do evento,período e correspondência dos meses')}
|
||||
{book.schedules&&<button type="button" onClick={()=>patch({from:i.from||book.schedules!.period.from,to:i.to||book.schedules!.period.to,reference:i.reference||book.schedules!.period.reference})}>Reutilizar datas e suporte já declarados nos campos vazios</button>}
|
||||
{text('mznMapsReference','Reconciliação dos mapas,parcelas,activos e saldos existentes em MZN para este período')}
|
||||
{raw?.currency!=='MZN'&&<>{text('conversionReference','Pressuposto documentado da conversão mensal para simulação')}
|
||||
{[...new Set(model.rows.map(r=>r.period))].map(period=>{const date=model.rows.find(r=>r.period===period)?.date,entry=i.months.find(m=>m.period===period)??{period,currency:raw?.currency??''};const change=(p:Partial<typeof entry>)=>patch({months:[...i.months.filter(m=>m.period!==period),{...entry,...p}]});return<fieldset key={period} aria-label={'Câmbio do mês '+period} className="rounded border p-2"><legend>Mês{period} — {date} — {raw?.currency}</legend><label>Reutilizar selecção cambial existente<select value={entry.fxLink?.id??''} onChange={e=>{const s=sources.find(s=>s.id===e.target.value);if(s)change({currency:raw?.currency??'',fxSelection:s.selection,fxLink:{id:s.id,fingerprint:s.fingerprint}});}}><option value="">Seleccione uma origem documentada</option>{sources.map(s=><option value={s.id} key={s.id}>{s.label}</option>)}</select></label><SimulationFxSelection row={irpcFxRow('normal-'+period,entry)} onChange={p=>{if(p.fxSelection)change({...updateIrpcFx(entry,p.fxSelection),currency:raw?.currency??''});}}/></fieldset>;})}
|
||||
</>}
|
||||
{i.months.filter(m=>!model.rows.some(r=>r.period===m.period)).map(m=><p key={m.period}>Selecção conservada do mês{m.period},fora do período actual. <button type="button" onClick={()=>patch({months:i.months.filter(x=>x.period!==m.period)})}>Retirar selecção do mês{m.period} deste mapa</button></p>)}
|
||||
<p>{model.months}meses;resultado convertido:{model.source?.accountingProfitBeforeTax??'Indeterminado'} MZN. {model.pending.join(' | ')}</p><p>Meses parciais,limites anuais por corresponder e contagem de perdas41(5) afectam apenas os respectivos casos. Colecta não equivale ao saldo final a pagar.</p>
|
||||
</fieldset>;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
import {newNormalSchedules,newScheduleRow,newNormalAsset,scheduleRules,type NormalSchedules,type ScheduleRow,type NormalAsset} from '@/lib/irpc-normal-schedules';
|
||||
import type {NormalBook} from '@/lib/irpc-normal';
|
||||
export function SimulationIrpcSchedules({book,save}:{book:NormalBook;save:(b:NormalBook)=>void}){
|
||||
const s=book.schedules;if(!s)return<button type="button" onClick={()=>save({...book,schedules:newNormalSchedules()})}>Iniciar mapas complementares L6</button>;
|
||||
const patch=(p:Partial<NormalSchedules>)=>save({...book,schedules:{...s,...p}});
|
||||
const row=(id:string,p:Partial<ScheduleRow>)=>patch({rows:s.rows.map(r=>r.id===id?{...r,...p}:r)});
|
||||
const asset=(id:string,p:Partial<NormalAsset>)=>patch({assets:s.assets.map(a=>a.id===id?{...a,...p}:a)});
|
||||
return<fieldset aria-label="Mapas complementares L6" className="space-y-3 rounded border p-3"><legend>Mapas complementares — regras ordinárias documentadas</legend>
|
||||
<p>Reutiliza o resultado e as linhas do plano. As somas brutas de cada tema devem corresponder à conferência do lucro tributável. Os efeitos com sinal ficam discriminados; uma dúvida não apaga as parcelas independentes. L7 conserva benefícios e casos especiais; L8 conserva o fecho anual.</p>
|
||||
{book.periodsFx&&book.periodsFx.kind!=='annual'?<p>Período actual no mapa «Período fiscal e conversão do plano». O período anual anterior permanece conservado no histórico.</p>:<fieldset><legend>Período anual e correspondência dos meses</legend><label>Tipo de período<select aria-label="Tipo de período L6" value={s.period.kind} onChange={e=>patch({period:{...s.period,kind:e.target.value as NormalSchedules['period']['kind']}})}><option value="">Por identificar</option><option value="calendar">Ano civil — artigo7(1)</option><option value="authorised_annual">Anual diferente — autorização artigo7(2)</option><option value="ep_annual">Anual diferente de EP — comunicação artigo7(3)</option></select></label>{(['from','to','reference']as const).map(k=><label key={k} className="block">{({from:'Início do período AAAA-MM-DD',to:'Termo do período AAAA-MM-DD',reference:'Suporte do período e da correspondência mensal'})[k]}<input aria-label={'Período L6 '+k} value={s.period[k]} onChange={e=>patch({period:{...s.period,[k]:e.target.value}})}/></label>)}<p>Período anual diferente: documente autorização do artigo7(2) ou comunicação do EP do artigo7(3), início de aplicação e manutenção por cinco exercícios. O plano representa o período completo com termo em2026, emMZN. Períodos curtos e conversão fiscal anual de outra moeda ficam por corresponder.</p></fieldset>}
|
||||
<button type="button" onClick={()=>patch({rows:[...s.rows,newScheduleRow(crypto.randomUUID())]})}>Acrescentar regra complementar</button>
|
||||
{s.rows.map((r,n)=><fieldset key={r.id} className="rounded border p-2"><legend>Regra complementar {n+1}</legend>
|
||||
<label>Tratamento<select aria-label={'Tratamento complementar '+(n+1)} value={r.rule} onChange={e=>row(r.id,{rule:e.target.value as ScheduleRow['rule']})}><option value="">Por identificar</option>{Object.entries(scheduleRules).map(([k,v])=><option key={k} value={k}>{v[0]} — {v[2]}</option>)}</select></label>
|
||||
{([['amount','Montante MZN'],['sourceCode','Código da linha de origem (custos/proveitos já incluídos)'],['document','Documento'],['line','Linha distinta'],['reference','Suporte da regra e dos factos'],['fiscalYear','Exercício de imputação (periodização)']]as const).map(([k,label])=><label key={k} className="block">{label}<input aria-label={label+' complementar '+(n+1)} value={r[k]} onChange={e=>row(r.id,{[k]:e.target.value})}/></label>)}
|
||||
<p>Entradas/distribuições de capital e variações patrimoniais são externas ao resultado. Variação negativa ordinária: indispensável à actividade sujeita, sem liberalidade, menos-valia latente ou distribuição; sem gratificações especiais. Periodização: operação ordinária e exercício de realização documentados; sem obra plurianual ou correcção de exercício anterior.</p>
|
||||
<label>Condições demonstradas<select aria-label={'Condições complementar '+(n+1)} value={r.conditions} onChange={e=>row(r.id,{conditions:e.target.value as ''|'yes'})}><option value="">Informação em falta</option><option value="yes">Sim, nos documentos identificados</option></select></label>
|
||||
<button type="button" onClick={()=>patch({rows:s.rows.filter(q=>q.id!==r.id)})}>Retirar regra {n+1} das entradas actuais</button></fieldset>)}
|
||||
<fieldset><legend>Juros financeiros ordinários — artigo22c</legend><p>Somente capitais alheios aplicados na exploração, encargos documentados, não capitalizáveis, sem partes relacionadas, subcapitalização ou outra limitação especial. Identifique o remanescente após os juros compensatórios acrescidos no mapa anterior. Outros juros permanecem pendentes neste caso.</p>
|
||||
<label className="block">Juros ordinários remanescentes MZN<input value={s.interest.amount} onChange={e=>patch({interest:{...s.interest,amount:e.target.value}})}/></label>
|
||||
<label className="block">Suporte dos juros e condições<input value={s.interest.reference} onChange={e=>patch({interest:{...s.interest,reference:e.target.value}})}/></label>
|
||||
<label>Condições dos juros<select aria-label="Condições dos juros ordinários" value={s.interest.conditions} onChange={e=>patch({interest:{...s.interest,conditions:e.target.value as ''|'yes'}})}><option value="">Informação em falta</option><option value="yes">Demonstradas no recorte ordinário</option></select></label></fieldset>
|
||||
{!book.depreciation?<fieldset><legend>Amortizações fiscais — quotas constantes anuais</legend><p>Decreto72/2013, artigos3–7. Activo próprio sujeito a deperecimento, custo histórico, uso no início de2026, método uniforme, vida útil fiscal não excedida. Documente que não há regra sectorial específica prevalecente ou limitação especial. A categoria exige qualificação documentada; os itens genéricos9/9.1 só se aplicam quando não há taxa específica da tabelaI. Duodécimos, reavaliação, bens usados e recuperação de quotas antes tributadas ficam separados.</p>
|
||||
<label className="block">Reconciliação de todos os activos com a depreciação do plano<input value={s.assetsReference} onChange={e=>patch({assetsReference:e.target.value})}/></label>
|
||||
<button type="button" onClick={()=>patch({assets:[...s.assets,newNormalAsset(crypto.randomUUID())]})}>Acrescentar activo fiscal</button>
|
||||
{s.assets.map((a,n)=><fieldset key={a.id} className="rounded border p-2"><legend>Activo {n+1}</legend><label>Categoria fiscal<select aria-label={'Categoria activo '+(n+1)} value={a.category} onChange={e=>asset(a.id,{category:e.target.value as NormalAsset['category'],rate:e.target.value==='computer'?'25':e.target.value==='server'?'20':'',tableReference:e.target.value==='computer'?'Decreto72/2013 tabelaII grupo3 item9':e.target.value==='server'?'Decreto72/2013 tabelaII grupo3 item9.1':''})}><option value="">Por identificar</option><option value="computer">Computador, impressora, UPS — II/3/9 — 25%</option><option value="server">Servidor — II/3/9.1 — 20%</option><option value="other">Outra categoria — correspondência pendente</option></select></label>{([['description','Descrição'],['cost','Custo fiscal documentado MZN'],['residual','Valor residual MZN'],['rate','Taxa anual documentada %'],['accounting','Depreciação contabilística de2026 MZN'],['previousFiscal','Amortização fiscal acumulada anterior MZN'],['inUseFrom','Data de entrada em uso AAAA-MM-DD'],['tableReference','Diploma, tabela, código e taxa aplicáveis'],['reference','Documentos e condições do activo']]as const).map(([k,label])=><label key={k} className="block">{label}<input aria-label={label+' activo '+(n+1)} value={a[k]} onChange={e=>asset(a.id,{[k]:e.target.value})}/></label>)}
|
||||
<label>Condições do activo<select aria-label={'Condições activo '+(n+1)} value={a.conditions} onChange={e=>asset(a.id,{conditions:e.target.value as ''|'yes'})}><option value="">Informação em falta</option><option value="yes">Demonstradas no recorte anual constante</option></select></label><button type="button" onClick={()=>patch({assets:s.assets.filter(q=>q.id!==a.id)})}>Retirar activo {n+1} das entradas actuais</button></fieldset>)}</fieldset>:<p>Activos do mapa inicial conservados; a depreciação é agora reconciliada exclusivamente pelo mapa de tabelas, métodos, duodécimos e quotas anteriores abaixo.</p>}
|
||||
<label className="block">Suporte da perda fiscal do próprio exercício, se apurada<input value={s.currentLossReference} onChange={e=>patch({currentLossReference:e.target.value})}/></label><p>Perda actual conhecida: matéria colectável e colecta zero apenas depois de conferidas as restantes condições. Não é dedução a si própria nem saldo oficial de reporte. Informação insuficiente mantém os totais dependentes indeterminados.</p>
|
||||
</fieldset>;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,30 +0,0 @@
|
||||
import {irpcBook} from '@/lib/irpc-withholdings';
|
||||
import {newNormalBaseInput,newNormalLoss,type NormalBaseInput,type NormalLoss} from '@/lib/irpc-normal-base';
|
||||
import type {NormalBook} from '@/lib/irpc-normal';
|
||||
|
||||
export function SimulationIrpcTaxableBase({draft,book,save}:{draft:Record<string,unknown>;book:NormalBook;save:(b:NormalBook)=>void}){
|
||||
if(!book.profit)return null;
|
||||
const b=book.base;const change=(p:Partial<NormalBaseInput>)=>save({...book,base:{...(b??newNormalBaseInput()),...p}});
|
||||
let identity:{nuit:string;name:string}|null=null;try{const m=irpcBook(draft).mrfta;if(m&&/^\d{9}$/.test(m.nuit))identity={nuit:m.nuit,name:m.name};}catch{/* A missing withholding book does not block this independent path. */}
|
||||
if(!b)return<button type="button" onClick={()=>change({})}>Iniciar determinação da matéria colectável</button>;
|
||||
const loss=(id:string,p:Partial<NormalLoss>)=>change({losses:b.losses.map(l=>l.id===id?{...l,...p}:l)});
|
||||
const choices:Array<[string,string]>=[['','Por esclarecer'],['yes','Sim, documentado'],['no','Não, documentado']];
|
||||
return<fieldset aria-label="Matéria colectável — perdas e deduções" className="space-y-3 rounded border p-3"><legend>Lucro tributável → matéria colectável simulada</legend><p>Reutiliza o lucro tributável do cálculo actual, sem introduzir novamente os montantes. Esse lucro e a matéria colectável não são imposto a pagar. Recorte: regime geral, método declarativo, perdas fiscais próprias em exercícios anuais ordinários, com saldo e utilização propostos expressos. Não aplica benefícios positivos sem regra específica nem créditos de retenção.</p>
|
||||
{identity&&(!b.subjectNuit||b.subjectNuit===identity.nuit)&&<button type="button" onClick={()=>{if(!b.subjectNuit||b.subjectNuit===identity!.nuit)change({subjectNuit:identity!.nuit,identityReference:b.identityReference||'Identidade reutilizada da preparação MRFTA desta oportunidade: '+identity!.name});}}>Reutilizar NUIT da preparação existente {identity.nuit}</button>}
|
||||
<label className="block">NUIT do sujeito passivo da matéria colectável<input value={b.subjectNuit} onChange={e=>change({subjectNuit:e.target.value})}/></label>
|
||||
<label className="block">Suporte da identidade e correspondência com o lucro<input value={b.identityReference} onChange={e=>change({identityReference:e.target.value})}/></label>
|
||||
<label className="block">Método de determinação<select aria-label="Método de determinação" value={b.method} onChange={e=>change({method:e.target.value as NormalBaseInput['method']})}><option value="">Por esclarecer</option><option value="direct">Declarativo/directo, documentado</option><option value="indirect">Métodos indirectos — fora deste recorte</option></select></label>
|
||||
<label className="block">Suporte do método de determinação<input value={b.methodReference} onChange={e=>change({methodReference:e.target.value})}/></label>
|
||||
<label className="block">Situação das perdas fiscais anteriores<select aria-label="Situação das perdas fiscais anteriores" value={b.lossesState} onChange={e=>change({lossesState:e.target.value as NormalBaseInput['lossesState']})}><option value="">Informação em falta</option><option value="known">Perdas/saldos conhecidos — discriminar</option><option value="absent">Ausência declarada com suporte</option></select></label>
|
||||
<label className="block">Suporte e completude dos saldos de perdas<input value={b.lossesReference} onChange={e=>change({lossesReference:e.target.value})}/></label>
|
||||
{(b.lossesState==='known'||b.losses.length>0)&&<><button type="button" onClick={()=>change({losses:[...b.losses,{...newNormalLoss(crypto.randomUUID()),subjectNuit:b.subjectNuit}]})}>Acrescentar perda fiscal por exercício</button>
|
||||
<label className="block">Objecto social e natureza da actividade mantidos no termo do exercício<select aria-label="Objecto social e natureza da actividade mantidos no termo do exercício" value={b.unchangedObject} onChange={e=>change({unchangedObject:e.target.value as NormalBaseInput['unchangedObject']})}>{choices.map(([v,l])=><option key={v} value={v}>{l}</option>)}</select></label><label className="block">Suporte da manutenção ou alteração da actividade<input value={b.objectReference} onChange={e=>change({objectReference:e.target.value})}/></label>
|
||||
{b.losses.map((l,n)=><fieldset key={l.id} className="space-y-2 rounded border p-2"><legend>Perda {n+1} — {l.year||'exercício por identificar'}</legend>{(['year','subjectNuit','assessed','previouslyUsed','requested','reference']as const).map(k=><label className="block" key={k}>{({year:'Exercício da perda',subjectNuit:'NUIT da perda',assessed:'Perda fiscal apurada ou corrigida em MZN',previouslyUsed:'Utilizações anteriores em MZN, incluindo zero conhecido',requested:'Utilização proposta neste exercício em MZN',reference:'Documento do apuramento fiscal, correcções e saldo'})[k]}<input value={l[k]} onChange={e=>loss(l.id,{[k]:e.target.value})}/></label>)}
|
||||
<label className="block">Origem da perda<select aria-label={'Origem da perda '+(n+1)} value={l.kind} onChange={e=>loss(l.id,{kind:e.target.value as NormalLoss['kind']})}><option value="">Por esclarecer</option><option value="ordinary">Perda própria ordinária do mesmo sujeito</option><option value="transfer">Transmitida/fusão — tratamento próprio</option><option value="other">Outra origem — por corresponder</option></select></label>
|
||||
{(['annualPeriods','generalActivity','balanceConfirmed']as const).map(k=><label className="block" key={k}>{({annualPeriods:'Exercícios anuais ordinários, sem períodos curtos especiais',generalActivity:'Perda do regime geral, fora de transparência/isenção parcial/actividade reduzida',balanceConfirmed:'Saldo fiscal, correcções e utilizações anteriores reconciliados'})[k]}<select aria-label={k+' '+(n+1)} value={l[k]} onChange={e=>loss(l.id,{[k]:e.target.value as NormalLoss['annualPeriods']})}>{choices.map(([v,label])=><option key={v} value={v}>{label}</option>)}</select></label>)}
|
||||
</fieldset>)}<p>A utilização é escolhida explicitamente. O portal não presume ordem FIFO, não ultrapassa saldo ou lucro e não consome o saldo oficial ao simular ou guardar.</p></>}
|
||||
<label className="block">Benefícios/deduções à matéria colectável<select aria-label="Benefícios/deduções à matéria colectável" value={b.benefits.state} onChange={e=>change({benefits:{...b.benefits,state:e.target.value as NormalBaseInput['benefits']['state']}})}><option value="">Informação em falta</option><option value="known">Valor conhecido — identificar</option><option value="absent">Ausência declarada com suporte</option></select></label>
|
||||
{(b.benefits.state==='known'||b.benefits.amount!=='')&&<label className="block">Montante conhecido de benefícios/deduções em MZN<input value={b.benefits.amount} onChange={e=>change({benefits:{...b.benefits,amount:e.target.value}})}/></label>}
|
||||
<label className="block">Suporte dos benefícios/deduções, regra e exercício<input value={b.benefits.reference} onChange={e=>change({benefits:{...b.benefits,reference:e.target.value}})}/></label><p>Um benefício positivo conhecido permanece por corresponder; a referência não autoriza subtracção livre. Créditos à colecta, retenções sofridas e imposto a pagar seguem etapa própria.</p>
|
||||
</fieldset>;
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
import {SimulationIrpcMrfta} from '@/components/simulation-irpc-mrfta';
|
||||
import {irpcReliefRules,newIrpcReliefPreparation,prepareIrpcRelief} from '@/lib/irpc-relief-preparation';
|
||||
import {SimulationFxSelection} from '@/components/simulation-fx-selection';
|
||||
import {irpcFxSources,irpcFxRow,updateIrpcFx,type IrpcFxAmount} from '@/lib/irpc-fx';
|
||||
import {useState} from 'react';
|
||||
import {irpcBook,saveIrpcBook,reuseIrpcSources,irpcSources,newIrpcRow,recordIrpc,irpcKinds,emptyIrpcOrdinaryFacts,irpcReportRows,irpcPreparationHtml,type IrpcBook,type IrpcRow,type IrpcEvent,type IrpcPayment,type IrpcOrdinaryFacts} from '@/lib/irpc-withholdings';
|
||||
export function SimulationIrpcWithholdings({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}){
|
||||
const[error,setError]=useState('');if(draft.fiscal_component!=='irpc'&&draft.fiscal_component!=='withholding')return null;
|
||||
try{const book=irpcBook(draft),sources=irpcSources(draft),save=(b:IrpcBook)=>{try{onChange('modelo_a_snapshot',saveIrpcBook(draft,b));setError('');}catch(e){setError(String(e));}},change=(id:string,p:Partial<IrpcRow>)=>save({...book,rows:book.rows.map(r=>r.id===id?{...r,...p}:r)}),uid=()=>crypto.randomUUID();
|
||||
const field=(r:IrpcRow,k:keyof IrpcRow,label:string,type='text')=><label className="block">{label}<input className="block rounded border p-2" type={type} value={String(r[k]??'')} onChange={e=>change(r.id,{[k]:e.target.value})}/></label>;
|
||||
const select=(r:IrpcRow,k:keyof IrpcRow,label:string,options:Array<[string,string]>)=><label className="block">{label}<select className="block rounded border p-2" value={String(r[k]??'')} onChange={e=>change(r.id,{[k]:e.target.value})}>{options.map(([v,l])=><option key={v} value={v}>{l}</option>)}</select></label>;
|
||||
const yn:Array<[string,string]>=[['','Por esclarecer'],['yes','Sim'],['no','Não']];
|
||||
const eventLabels:Array<[IrpcEvent['kind'],string]>=[['cost','Reconhecimento do custo'],['payment','Pagamento do rendimento'],['maturity','Vencimento, ainda que presumido'],['availability','Colocação à disposição'],['liquidation','Liquidação'],['quantification','Apuramento do quantitativo']];
|
||||
const fxSources=irpcFxSources(draft);
|
||||
const renderFx=(id:string,input:IrpcFxAmount,apply:(patch:Partial<IrpcFxAmount>)=>void)=><div className="space-y-2"><p>A base/comprovativo conserva a moeda e o montante originais. A conversão reutiliza o selector e a aritmética entregues; a data cambial fica distinta do evento da retenção.</p>{fxSources.map(src=><div key={src.id}><span>{src.label};data:{src.selection.applied?.date||'por confirmar'};selecção actual:{input.fxSelection?.applied?.rate||'nenhuma'}.</span><button type="button" className="rounded border p-2" onClick={()=>{if(window.confirm(`Substituir a selecção cambial desta linha (${input.fxSelection?.applied?.rate||'vazia'}) pela origem ${src.label},data ${src.selection.applied?.date||'por confirmar'}? O montante e a moeda originais são conservados;resultado anterior permanece no histórico até novo cálculo.`))apply({fxSelection:structuredClone(src.selection),fxLink:{id:src.id,fingerprint:src.fingerprint}});}}>Reutilizar selecção cambial {src.id}</button></div>)}<SimulationFxSelection row={irpcFxRow(id,input)} onChange={patch=>{if(patch.fxSelection)apply(updateIrpcFx(input,patch.fxSelection));}}/></div>;
|
||||
const ordinarySelect=(r:IrpcRow,k:keyof IrpcOrdinaryFacts,label:string,options:Array<[string,string]>)=><label className="block">{label}<select value={String((r.ordinary??emptyIrpcOrdinaryFacts())[k]??'')} onChange={e=>change(r.id,{ordinary:{...(r.ordinary??emptyIrpcOrdinaryFacts()),[k]:e.target.value}})}>{options.map(([v,l])=><option key={v} value={v}>{l}</option>)}</select></label>;
|
||||
const paymentChange=(id:string,p:Partial<IrpcPayment>)=>save({...book,payments:book.payments.map(v=>v.id===id?{...v,...p}:v)});
|
||||
return<section aria-label="Retenções de IRPC" className="space-y-4 rounded border p-4"><h4>IRPC — retenções e preparação documental</h4><p>Reutilize documentos e contrapartes existentes. Classifique o rendimento e o evento aplicável:facturar,pagar e reconhecer o custo são factos distintos. O conjunto calcula os casos digitais de 10%, as taxas normais de 20% e as taxas especiais do artigo 62(4) nos âmbitos identificados. Dispensas dos artigos 68(d/f) e limite convencional de royalties Portugal–Moçambique são calculados nos casos documentados. Informação insuficiente condiciona apenas o respectivo rendimento.</p>{error&&<p role="alert">{error}</p>}
|
||||
<button type="button" className="rounded border p-2" onClick={()=>{try{save(reuseIrpcSources(draft,book));}catch(e){setError(String(e));}}}>Reutilizar contrapartes e documentos existentes</button><button type="button" className="rounded border p-2" onClick={()=>save({...book,rows:[...book.rows,newIrpcRow(uid())]})}>Acrescentar rendimento IRPC</button>
|
||||
{book.rows.map(r=><fieldset key={r.id} className="space-y-3 rounded border p-3"><legend>{r.description||r.documentRef||'Rendimento por identificar'}</legend>{r.source&&<p>Origem:{r.source.id}. Entradas deliberadamente editadas são conservadas. {sources.find(s=>s.id===r.source!.id)?.key!==r.source.key&&<><strong>Origem alterada ou indisponível.</strong>{sources.find(s=>s.id===r.source!.id)&&<><span> Base actual:{r.base};base na origem:{sources.find(s=>s.id===r.source!.id)?.amount||'desconhecida'};documento actual:{r.documentRef};origem:{sources.find(s=>s.id===r.source!.id)?.documentRef||'desconhecido'}.</span><button type="button" className="rounded border p-2" onClick={()=>{const s=sources.find(s=>s.id===r.source!.id)!;if(window.confirm('Confirma a reconciliação da origem indicada, conservando as entradas deliberadas e os resultados anteriores no histórico?'))change(r.id,{source:{...r.source!,key:s.key}});}}>Conservar edições e reconciliar origem</button></>}</>}</p>}
|
||||
<div className="grid gap-3 md:grid-cols-2">{select(r,'direction','Perspectiva',[['paid','Rendimento pago — retenção a entregar'],['received','Rendimento recebido — retenção sofrida']])}{field(r,'counterparty','Contraparte')}{field(r,'documentRef','Documento / operação / linha distinta')}{field(r,'description','Descrição')}{select(r,'origin','Origem',[['projected','Projecção com pressupostos'],['effective','Factos documentados']])}{select(r,'kind','Natureza do rendimento',irpcKinds)}{field(r,'base','Base do rendimento, separada do IVA')}{field(r,'currency','Moeda da base')}{select(r,'recipientIrpc','Titular sujeito a IRPC neste rendimento',yn)}{select(r,'payerIrpc','Devedor sujeito a IRPC',yn)}{select(r,'residence','Residência do titular',[['','Por esclarecer'],['resident','Residente'],['nonresident','Não residente']])}{r.residence==='nonresident'&&<>{select(r,'permanentEstablishment','Existe estabelecimento estável em Moçambique',yn)}{r.permanentEstablishment==='yes'&&select(r,'attributable','Rendimento imputável ao estabelecimento',yn)}</>}{select(r,'mozambique','Rendimento obtido em Moçambique, conforme qualificação legal',yn)}{field(r,'qualificationRef','Suporte / pressuposto da qualificação, residência e incidência')}{select(r,'specialRelief','Convenção, isenção ou dispensa aplicável',[['','Por esclarecer'],['none','Não invocada neste caso qualificado'],['claimed','Invocada — identificar regra e condições']])}{r.specialRelief==='claimed'&&field(r,'reliefRef','Artigo, condições, período e prova invocados')}</div>
|
||||
{r.specialRelief==='claimed'&&<fieldset className="space-y-2 rounded border p-2"><legend>Preparação de dispensa ou convenção</legend><p>Reutiliza contraparte, residência, estabelecimento estável e documento deste rendimento.</p><label>Enquadramento<select value={r.reliefPreparation?.kind??'dispensation'} onChange={e=>change(r.id,{reliefPreparation:{...(r.reliefPreparation??newIrpcReliefPreparation()),kind:e.target.value as 'dispensation'|'exemption'|'treaty'}})}><option value="dispensation">Dispensa de retenção</option><option value="exemption">Isenção</option><option value="treaty">Convenção</option></select></label>{(['instrument','article','country','residenceDocument','validFrom','validTo','conditions','evidence'] as const).filter(k=>!['country','residenceDocument'].includes(k)||r.reliefPreparation?.kind==='treaty').map(k=><label key={k} className="block">{({instrument:'Diploma / convenção',article:'Artigo',country:'Estado contratante',residenceDocument:'Referência do documento de residência fiscal',validFrom:'Aplicável desde',validTo:'Aplicável até',conditions:'Condições do benefício',evidence:'Referências dos documentos existentes'})[k]}<input type={k==='validFrom'||k==='validTo'?'date':'text'} value={r.reliefPreparation?.[k]??''} onChange={e=>change(r.id,{reliefPreparation:{...(r.reliefPreparation??newIrpcReliefPreparation()),[k]:e.target.value}})}/></label>)}<label>Regra aplicável<select value={r.reliefPreparation?.rule??''} onChange={e=>change(r.id,{reliefPreparation:{...(r.reliefPreparation??newIrpcReliefPreparation()),rule:e.target.value as NonNullable<IrpcRow['reliefPreparation']>['rule']}})}>{irpcReliefRules.map(([v,l])=><option key={v} value={v}>{l}</option>)}</select></label>{(r.reliefPreparation?.rule==='ptMz12'?(['treatyResident','beneficialOwner','payerResidentMz','armLength','royaltyDefinition'] as const):r.reliefPreparation?.rule==='cirpc68f'?(['subjectToIrpc','notTransparent'] as const):r.reliefPreparation?.rule==='cirpc68d'?(['subjectToIrpc'] as const):[]).map(k=><label key={k} className="block">{({subjectToIrpc:'Titular sujeito a IRPC relativamente a este rendimento (ainda que isento)',notTransparent:'Sociedade fora da transparência fiscal — 6(1)c',treatyResident:'Residência em Portugal nos termos do artigo 4 documentada',beneficialOwner:'Titular é beneficiário efectivo das royalties',payerResidentMz:'Devedor residente em Moçambique; origem do rendimento conforme 12(5)',armLength:'Montante sem excesso por relações especiais — 12(6)',royaltyDefinition:'Rendimento corresponde à definição de royalties — 12(3), versão 2009'})[k]}<select value={r.reliefPreparation?.facts?.[k]??''} onChange={e=>change(r.id,{reliefPreparation:{...(r.reliefPreparation??newIrpcReliefPreparation()),facts:{...r.reliefPreparation?.facts,[k]:e.target.value as ''|'yes'|'no'}}})}>{yn.map(([v,l])=><option key={v} value={v}>{l}</option>)}</select></label>)}<p>{prepareIrpcRelief(r,r.reliefPreparation??newIrpcReliefPreparation()).missing.length?'Faltam elementos documentais; confira artigo, período e provas.':'Documentos registados; calcule para conferir as condições da regra seleccionada.'}</p></fieldset>}
|
||||
{r.currency!=='MZN'&&renderFx(r.id,r,patch=>change(r.id,patch))}
|
||||
{r.kind&&!['digital_goods','digital_services','emoney_commission','other'].includes(r.kind)&&<fieldset className="space-y-2 rounded border p-2"><legend>Factos específicos do rendimento</legend>{ordinarySelect(r,'nonDigital','Rendimento fora do âmbito digital/moeda electrónica do artigo62(5)',yn)}{r.kind==='capital'&&ordinarySelect(r,'capitalType','Categoria dos capitais',[['','Por esclarecer'],['unlisted_interest','Juros não cotados, fora das permutas de liquidez'],['unlisted_dividend','Dividendos não cotados'],['listed_debt_mz','Juros de bilhetes do Tesouro/títulos de dívida cotados em bolsa —62(3)a'],['listed_other_mz','Outros títulos cotados na Bolsa de Valores de Moçambique —62(4)d'],['liquidity_repo','Juros de permutas de liquidez em bancos,com ou sem garantia —62(3)b'],['other','Outra categoria']])}{r.kind==='capital'&&r.residence==='resident'&&['listed_debt_mz','liquidity_repo'].includes(r.ordinary?.capitalType??'')&&ordinarySelect(r,'capitalSeatAndManagement','Titular com sede e direcção efectiva nacionais —62(3)',yn)}{r.kind==='rent'&&ordinarySelect(r,'rentOwnPropertyManagement','Titular é sociedade com objecto de gestão de imóveis próprios',yn)}{(['telecom','international_transport','connected_installation','aircraft_maintenance_charter','rural_public_electrification','maritime_fishing_cabotage'].includes(r.kind)||r.kind==='capital'&&r.ordinary?.capitalType==='listed_other_mz')&&ordinarySelect(r,'specialFacts','Factos exactos da categoria62(4) identificados no suporte — não apenas actividade semelhante',yn)}<label className="block">Suporte ou pressuposto específico da classificação<input value={r.ordinary?.reference??''} onChange={e=>change(r.id,{ordinary:{...(r.ordinary??emptyIrpcOrdinaryFacts()),reference:e.target.value}})}/></label></fieldset>}
|
||||
<h5>Eventos aplicáveis — artigo67(5), versão2026</h5>{r.events.map((e,n)=><div key={n} className="grid gap-2 md:grid-cols-3"><label>Evento<select value={e.kind} onChange={ev=>change(r.id,{events:r.events.map((v,j)=>j===n?{...v,kind:ev.target.value as IrpcEvent['kind']}:v)})}>{eventLabels.map(([k,l])=><option key={k} value={k}>{l}</option>)}</select></label><label>Data<input type="date" value={e.date} onChange={ev=>change(r.id,{events:r.events.map((v,j)=>j===n?{...v,date:ev.target.value}:v)})}/></label><label>Suporte / pressuposto<input value={e.reference} onChange={ev=>change(r.id,{events:r.events.map((v,j)=>j===n?{...v,reference:ev.target.value}:v)})}/></label></div>)}<button type="button" onClick={()=>change(r.id,{events:[...r.events,{kind:'cost',date:'',reference:''}]})}>Acrescentar evento aplicável</button>{select(r,'eventsComplete','Todos os eventos aplicáveis identificados, incluindo custo quando aplicável',yn)}
|
||||
{select(r,'settlement','Reconciliação da entrega / prova de retenção sofrida',[['','Por esclarecer'],['none','Ainda sem entrega / prova'],['complete','Pagamentos / provas associados completos']])}{field(r,'settlementRef','Referência da situação declarada')}
|
||||
{r.allocations.map((a,n)=><div key={n}><label>Pagamento / prova existente<select value={a.paymentId} onChange={e=>change(r.id,{allocations:r.allocations.map((v,j)=>j===n?{...v,paymentId:e.target.value}:v)})}><option value="">Seleccione</option>{book.payments.map(p=><option key={p.id} value={p.id}>{p.reference} — {p.amount} {p.currency} — {p.kind}</option>)}</select></label><label>Parcela usada em MZN<input value={a.amount} onChange={e=>change(r.id,{allocations:r.allocations.map((v,j)=>j===n?{...v,amount:e.target.value}:v)})}/></label></div>)}{r.settlement==='complete'&&<button type="button" onClick={()=>change(r.id,{allocations:[...r.allocations,{paymentId:'',amount:''}]})}>Associar pagamento/prova existente</button>}
|
||||
</fieldset>)}
|
||||
<h5>Pagamentos e comprovativos reutilizáveis neste livro</h5><p>Uma referência é registada uma vez e repartida entre rendimentos sem exceder o montante. Pagamento ao fornecedor não é entrega à AT; pagamentos de IVA conservam o seu vínculo anterior e não são automaticamente usados em IRPC.</p>{book.payments.map(p=><fieldset key={p.id} className="grid gap-2 rounded border p-2 md:grid-cols-3"><label>Natureza<select value={p.kind} onChange={e=>paymentChange(p.id,{kind:e.target.value as IrpcPayment['kind']})}><option value="remittance">Entrega IRPC à AT</option><option value="withholding_proof">Comprovativo de retenção sofrida</option><option value="beneficiary">Pagamento ao beneficiário</option></select></label>{(['reference','date','amount','currency']as const).map(k=><label key={k}>{({reference:'Referência',date:'Data',amount:'Montante',currency:'Moeda'})[k]}<input type={k==='date'?'date':'text'} value={p[k]} onChange={e=>paymentChange(p.id,{[k]:e.target.value})}/></label>)}{p.currency!=='MZN'&&(p.kind==='withholding_proof'?renderFx(p.id,p,patch=>paymentChange(p.id,patch)):<p>A entrega IRPC à AT requer o montante MZN do comprovativo; converter o pagamento ao beneficiário não prova entrega do imposto.</p>)}</fieldset>)}<button type="button" onClick={()=>save({...book,payments:[...book.payments,{id:uid(),kind:'remittance',reference:'',date:'',amount:'',currency:'MZN'}]})}>Registar pagamento/prova para reutilização</button>
|
||||
<div className="space-x-3"><button type="button" className="rounded border p-2" onClick={()=>{try{save(recordIrpc(draft,book));}catch(e){setError(String(e));}}}>Calcular e guardar retenções IRPC</button><button type="button" className="rounded border p-2" onClick={()=>{try{const html=irpcPreparationHtml(draft),u=URL.createObjectURL(new Blob([html],{type:'text/html;charset=utf-8'})),a=document.createElement('a');a.href=u;a.download='IRPC-L5-preparacao.html';a.click();URL.revokeObjectURL(u);setError('');}catch(e){setError(String(e));}}}>Exportar preparação IRPC</button></div>
|
||||
<SimulationIrpcMrfta draft={draft} book={book} save={save}/>
|
||||
{irpcReportRows(draft).slice(0,book.result?.rows.length??0).map((r,n)=><p key={n}><strong>{r[1]}</strong>: {r[2]}<small className="block">{r[3]}</small></p>)}<p>Formalidades externas:MRFTA19/39 e guia M/39 preservados. CER/rubricas digitais e remissão67(7)→62(6) por corresponder. Exportar não submete nem obtém aceitação AT. L5 continua aberto;ISPC e IRPS conservam os seus limites anteriores.</p></section>;
|
||||
}catch(e){return<p role="alert">{String(e)}</p>;}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ import {ispcEligibilityBook,ispcEligibilityCurrent} from '@/lib/ispc-eligibility
|
||||
import {ispcQuarterBook,saveIspcQuarterBook,recordIspcQuarter,ispcQuarterReportRows,type IspcQuarterInput,type IspcQuarterBook} from '@/lib/ispc-quarter';
|
||||
export function SimulationIspcQuarter({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}){
|
||||
const[error,setError]=useState('');if(draft.fiscal_component!=='ispc')return null;
|
||||
try{if(ispcEligibilityBook(draft).input.mode==='occasional')return<p>Actividade habitual:campos trimestrais conservados no histórico. Use o percurso de operações ocasionais próprias abaixo.</p>;}catch{/* Preserve the existing explicit recovery error below. */}
|
||||
let book:IspcQuarterBook;try{book=ispcQuarterBook(draft);}catch(e){return<p role="alert">{String(e)}</p>;}
|
||||
const i=book.input,save=(b:IspcQuarterBook)=>{try{onChange('modelo_a_snapshot',saveIspcQuarterBook(draft,b));setError('');}catch(e){setError(String(e));}},change=(patch:Partial<IspcQuarterInput>)=>save({...book,input:{...i,...patch}});
|
||||
let service=false,ready=false;try{const e=ispcEligibilityBook(draft);ready=ispcEligibilityCurrent(draft,e)&&e.result?.status==='compatible';service=e.input.activities.some(a=>['services12','liberal15'].includes(a));}catch{/* Show explicit preparation issue below, never fabricate eligibility. */}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import {useState} from 'react';
|
||||
import {ispcEligibilityBook} from '@/lib/ispc-eligibility';
|
||||
import {ispcWithholdingBook} from '@/lib/ispc-withholding';
|
||||
import {decimalFraction,addFractions} from '@/lib/fiscal-rational';
|
||||
import {ispcResidualBook,saveIspcResidualBook,recordIspcResidual,priorOccasionalSettlement,ispcResidualReportRows,ispcFormalPreparationHtml,type ResidualKind} from '@/lib/ispc-residuals';
|
||||
export function SimulationIspcResiduals({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}){
|
||||
const[error,setError]=useState('');if(draft.fiscal_component!=='ispc')return null;
|
||||
try{
|
||||
const own=ispcResidualBook(draft,'occasional'),acq=ispcResidualBook(draft,'acquisitions'),formal=ispcResidualBook(draft,'formalities'),e=ispcEligibilityBook(draft),w=ispcWithholdingBook(draft);let above=false;try{const sum=addFractions([decimalFraction(w.input.base),decimalFraction(w.input.priorAnnualPurchases)]);above=BigInt(sum.numerator)>2500000n*BigInt(sum.denominator);}catch{/* Unknown is still handled in existing acquisition panel. */}
|
||||
const book=(k:ResidualKind)=>k==='occasional'?own:k==='acquisitions'?acq:formal;
|
||||
const change=(k:ResidualKind,p:Record<string,string>)=>{const b=book(k);onChange('modelo_a_snapshot',saveIspcResidualBook(draft,{...b,input:{...b.input,...p}}));};
|
||||
const field=(k:ResidualKind,n:string,label:string,type='text')=><label key={n} className="block">{label}<input className="block rounded border p-2" type={type} value={book(k).input[n]??''} onChange={ev=>change(k,{[n]:ev.target.value})}/></label>;
|
||||
const select=(k:ResidualKind,n:string,label:string,options:Array<[string,string]>)=><label key={n} className="block">{label}<select className="block rounded border p-2" value={book(k).input[n]??''} onChange={ev=>change(k,{[n]:ev.target.value})}>{options.map(([v,l])=><option key={v} value={v}>{l}</option>)}</select></label>;
|
||||
const yesno=(k:ResidualKind,n:string,label:string)=>select(k,n,label,[['','Por esclarecer'],['yes','Sim'],['no','Não']]);
|
||||
const save=(k:ResidualKind)=>{try{onChange('modelo_a_snapshot',saveIspcResidualBook(draft,recordIspcResidual(draft,book(k))));setError('');}catch(err){setError(String(err));}};
|
||||
const activities:Array<[string,string]>=[['','Por identificar'],['forestry','Silvícola'],['fishery','Pesqueira'],['livestock','Pecuária'],['agriculture','Agrícola'],['poultry','Avícola'],['beekeeping','Apícola'],['other','Outra—fora do recorte ocasional']];
|
||||
return<section aria-label="ISPC — operações ocasionais, limite e formalidades" className="space-y-4">{error&&<p role="alert">{error}</p>}
|
||||
{e.input.mode==='occasional'&&<section className="space-y-3 rounded border p-4"><h4>Operações ocasionais próprias</h4><p>Percurso do vendedor ocasional, distinto da retenção feita pelo comprador. Uma retenção liberatória comprovada não gera segunda liquidação própria.</p>{select('occasional','personType','Tipo de pessoa destas operações',[['','Por identificar'],['singular','Pessoa singular'],['collective','Pessoa colectiva']])}{select('occasional','origin','Natureza dos dados',[['projected','Pressupostos de simulação'],['effective','Factos efectivos declarados']])}{field('occasional','currency','Moeda—MZN')}{field('occasional','operationDate','Data das operações','date')}{select('occasional','quarter','Trimestre2026',[['','Por identificar'],['1','1'],['2','2'],['3','3'],['4','4']])}{yesno('occasional','territory','Operação realizada em território nacional')}{yesno('occasional','noHabitual','Não exerce actividade habitual')}{yesno('occasional','sporadic','Acto não previsível nem reiterado')}{select('occasional','activity','Natureza da operação',activities)}{field('occasional','reference','Documentos ou pressupostos da operação')}{field('occasional','amount','Volume de todas estas operações do trimestre em MZN')}{select('occasional','settlement','Via aplicável',[['','Por identificar'],['self','Liquidação própria por opção ISPC'],['withheld','Retenção liberatória documentada pelo adquirente']])}
|
||||
{own.input.settlement==='self'&&<>{yesno('occasional','allQuarterOperations','Inclui todas as operações ocasionais do sujeito passivo no trimestre')}{field('occasional','priorYearTurnover','Volume de referência2025 para acesso, incluindo zero expresso')}{field('occasional','priorYearRef','Suporte da referência2025')}{yesno('occasional','organizedRequired','Obrigado a contabilidade organizada para impostos sobre rendimento')}{select('occasional','option','Opção para estas operações',[['preparation','Em preparação—apenas cenário'],['opted','Opção documentada'],['not_opted','Não optou']])}{own.input.option==='opted'&&<>{field('occasional','optionRef','Referência da opção')}{field('occasional','optionDate','Data da opção','date')}</>}{field('occasional','annual2026','Volume anual2026 para escalão')}{select('occasional','annualOrigin','Origem do volume anual2026',[['','Por identificar'],['forecast','Previsão—cenário'],['closed_year','Volume anual encerrado documentado']])}{field('occasional','annualRef','Suporte ou pressuposto do volume anual2026')}{field('occasional','priorInYear','Volume de operações anteriores no ano2026')}{priorOccasionalSettlement(own)&&<><p>Existe retenção liberatória guardada para esta operação. A mudança de via não a apaga nem gera uma segunda prestação.</p>{yesno('occasional','withholdingCorrected','Retenção anterior corrigida/anulada segundo documento externo')}{field('occasional','withholdingCorrectionRef','Referência externa da correcção da retenção anterior')}</>}</>}
|
||||
{own.input.settlement==='withheld'&&<>{yesno('occasional','buyerIspc','Adquirente sujeito passivo ISPC')}{yesno('occasional','unregistered','Vendedor não inscrito para tributação')}{field('occasional','buyerAnnualPurchases','Aquisições globais anuais do adquirente, incluindo estas operações')}{field('occasional','withheldActual','Montante efectivamente retido em MZN')}{field('occasional','withheldRef','Documento da retenção liberatória')}</>}
|
||||
<button type="button" className="rounded border p-2" onClick={()=>save('occasional')}>Calcular e guardar operações ocasionais</button></section>}
|
||||
{(above||acq.result)&&<section className="space-y-3 rounded border p-4"><h4>Aquisições acima do limite global</h4><p>Reutiliza a aquisição, os seus documentos e o acumulado global guardados acima. A parcela excedente não recebe automaticamente a taxa de 5% nem a taxa de 20% do excesso de vendas ISPC.</p>{select('acquisitions','route','Tratamento próprio da parcela excedente',[['unknown','Por identificar—mostrar parcelas sem total presumido'],['ispc_supplier','Fornecedor com opção ISPC aplicável'],['irps_isolated','Acto isolado sujeito a IRPS57(2)k']])}{acq.input.route==='ispc_supplier'&&field('acquisitions','supplierOptionRef','Referência da opção/registo do fornecedor e operações abrangidas')}{acq.input.route==='irps_isolated'&&<>{yesno('acquisitions','noIspcOnExcess','Sem opção ISPC aplicável a esta parcela, segundo documento indicado')}{yesno('acquisitions','isolatedAct','Acto isolado qualificado pelo artigo8(3h,4)doIRPS')}{yesno('acquisitions','incomeInMoz','Rendimento obtido em Moçambique')}{field('acquisitions','grossExcess','Rendimento ilíquido da parcela excedente em MZN—sem dedução de custos ou IVA')}{field('acquisitions','grossRef','Suporte da base ilíquida')}{field('acquisitions','reference','Suporte da classificação IRPS desta parcela')}</>}<button type="button" className="rounded border p-2" onClick={()=>save('acquisitions')}>Calcular e guardar parcela excedente</button></section>}
|
||||
<section className="space-y-3 rounded border p-4"><h4>Formalidades de2026—preparação do B–Geral</h4><p>O Comunicado AT9/2026indica o B–Geral durante a adaptação do sistema, com pagamentos em Janeiro, Abril, Julho e Outubro. O Modelo30disponível conserva campos antigos; não os aplicamos a2026. Esta preparação não submete nem paga à AT.</p>{select('formalities','sourceKind','Cálculo a preparar',[['quarter','Trimestral habitual'],['occasional','Operações ocasionais próprias'],['acquisitions','Retenção da parcela excedente qualificada']])}{formal.input.sourceKind==='acquisitions'&&field('formalities','retentionFormRef','Modelo/código e instrução para entrega das retenções ISPC/IRPS, separados do imposto próprio')}{field('formalities','name','Nome/designação social—quadro5')}{field('formalities','nuit','NUIT—quadro3')}{field('formalities','fiscalArea','Área Fiscal/UGC—quadro3')}{field('formalities','address','Domicílio fiscal—quadro6')}{select('formalities','declaration','Tipo de declaração—quadro1',[['initial','Inicial'],['substitution','Substituição']])}{field('formalities','formMonth','Mês a inscrever no quadro2—não presumido pelo mês de pagamento')}{field('formalities','formYear','Ano a inscrever no quadro2')}{field('formalities','formPeriodRef','Instrução/correspondência usada para o período do quadro2')}{select('formalities','interestSituation','Juros compensatórios—quadro10',[['','Por esclarecer'],['none','Sem juros, segundo suporte indicado'],['amount','Montante documentado']])}{formal.input.interestSituation==='amount'&&field('formalities','interestAmount','Montante de juros documentado')}{field('formalities','interestRef','Suporte da situação dos juros')}{select('formalities','externalStatus','Histórico externo declarado',[['preparation','Em preparação'],['submitted','Submetido'],['received','Recebido pela AT'],['paid','Pagamento efectuado']])}{formal.input.externalStatus!=='preparation'&&<>{field('formalities','externalRef','Referência externa')}{field('formalities','externalDate','Data do acto externo','date')}</>}
|
||||
<button type="button" className="rounded border p-2" onClick={()=>save('formalities')}>Preparar e guardar campos B–Geral</button><button type="button" className="rounded border p-2" onClick={()=>{try{const html=ispcFormalPreparationHtml(draft),url=URL.createObjectURL(new Blob([html],{type:'text/html;charset=utf-8'})),a=document.createElement('a');a.href=url;a.download='ISPC-preparacao-B-Geral.html';a.click();URL.revokeObjectURL(url);setError('');}catch(err){setError(String(err));}}}>Descarregar preparação B–Geral</button></section>
|
||||
{ispcResidualReportRows(draft).map((r,n)=><p key={n}><strong>{r[1]}:</strong> {r[2]}<small className="block">{r[3]}</small></p>)}
|
||||
</section>;
|
||||
}catch(err){return<p role="alert">{String(err)}</p>;}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
import {ispcEligibilityBook} from '@/lib/ispc-eligibility';
|
||||
import {ispcWithholdingBook,saveIspcWithholdingBook,recordIspcWithholding,ispcWithholdingReportRows,type IspcWithholdingInput} from '@/lib/ispc-withholding';
|
||||
export function SimulationIspcWithholding({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}){
|
||||
if(draft.fiscal_component!=='ispc')return null;
|
||||
try{if(ispcEligibilityBook(draft).input.mode==='occasional')return<p>Retenções do adquirente:entradas preservadas. Neste percurso de vendedor ocasional,registe a retenção recebida no quadro próprio abaixo.</p>;}catch{/* Existing recovery error stays explicit. */}
|
||||
try{const b=ispcWithholdingBook(draft),i=b.input,change=(p:Partial<IspcWithholdingInput>)=>onChange('modelo_a_snapshot',saveIspcWithholdingBook(draft,{...b,input:{...i,...p}}));return<section aria-label="Retenções ISPC" className="space-y-3 rounded border p-4"><h4>ISPC — retenção em aquisições ocasionais</h4><label className="block">Existem aquisições abrangidas pelo artigo 12(3–4)?<select value={i.applicable} onChange={e=>change({applicable:e.target.value as IspcWithholdingInput['applicable']})}><option value="">Por esclarecer</option><option value="no">Não</option><option value="yes">Sim — conferir condições</option></select></label>{i.applicable==='yes'&&<><p>Registe apenas aquisições do mesmo trimestre. O acumulado anterior cobre todas as aquisições desta via no ano e evita reutilizar o limite por fornecedor ou oportunidade.</p>{(['quarter','base','priorAnnualPurchases','reference'] as const).map(k=><label className="block" key={k}>{{quarter:'Trimestre de 2026',base:'Base de aquisições deste trimestre em MZN',priorAnnualPurchases:'Aquisições globais anteriores de 2026 em MZN',reference:'Suporte das aquisições e condições'}[k]}<input className="block rounded border p-2" value={i[k]} onChange={e=>change({[k]:e.target.value})}/></label>)}{(['naturalOccasional','unregistered','related']as const).map(k=><label className="block" key={k}>{{naturalOccasional:'Fornecedor pessoa singular ocasional abrangido por 3(3–4)',unregistered:'Fornecedor não inscrito para tributação',related:'Bens relacionados com a actividade do adquirente'}[k]}<select value={i[k]} onChange={e=>change({[k]:e.target.value})}><option value="">Por esclarecer</option><option value="yes">Sim</option><option value="no">Não</option></select></label>)}<label className="block">Actividade da operação ocasional<select value={i.activity} onChange={e=>change({activity:e.target.value as IspcWithholdingInput['activity']})}>{[['','Por identificar'],['forestry','Silvícola'],['fishery','Pesqueira'],['livestock','Pecuária'],['agriculture','Agrícola'],['poultry','Avícola'],['beekeeping','Apícola'],['other','Outra']].map(([v,l])=><option key={v} value={v}>{l}</option>)}</select></label></>}<button type="button" className="rounded border p-2" onClick={()=>onChange('modelo_a_snapshot',saveIspcWithholdingBook(draft,recordIspcWithholding(draft,b)))}>Conferir e guardar retenção ISPC</button>{ispcWithholdingReportRows(draft).map((r,n)=><p key={n}><strong>{r[1]}:</strong> {r[2]}<small className="block">{r[3]}</small></p>)}</section>;}catch(e){return<p role="alert">{String(e)}</p>;}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export function SimulationOperations({draft,onChange}:{draft:Record<string,unkno
|
||||
<h4 className="font-semibold">Operações de IVA — enquadramento das vendas</h4>
|
||||
<p>Oportunidade {String(draft.context_opportunity||'entrada geral')}; moeda original {book.currency||'por indicar'}. Cobertura2026/MZN. Reutilize as vendas e complete apenas o enquadramento. Este bloco classifica as operações; não substitui nem soma novamente a execução mensal geral acima.</p>
|
||||
<p>Uma empresa pode ter operações com tratamentos diferentes. Os valores são projecções sob pressupostos declarados, sem certificar facturas, reconhecer créditos ou submeter uma declaração à AT.</p>
|
||||
<details><summary>Campo06 — limitação residualP001</summary><p>{modeloA06Correspondence}</p></details>
|
||||
<details><summary>Correspondência dos campos05/06/07 e contagem única</summary><p>{modeloA06Correspondence}</p></details>
|
||||
{error&&<p role="alert">{error}</p>}
|
||||
<button type="button" className="underline" onClick={()=>run(()=>save(reuseSales(draft,book)))}>Reutilizar vendas e períodos existentes</button>
|
||||
<button type="button" className="ml-3 underline" disabled={!book.periods.length} onClick={()=>run(()=>save({...book,rows:[...book.rows,newSalesOperation(crypto.randomUUID(),book.periods[0].period,book.currency)]}))}>Acrescentar operação em falta</button>
|
||||
@@ -98,7 +98,7 @@ export function SimulationOperations({draft,onChange}:{draft:Record<string,unkno
|
||||
<button type="button" className="underline" onClick={()=>run(()=>save({...book,rows:book.rows.filter(r=>r.id!==row.id),periods:book.periods.map(p=>p.period===row.period?{...p,complete:false}:p)}))}>Remover esta linha do preenchimento (resultado anterior conservado)</button>
|
||||
</details>;})}
|
||||
{book.periods.map(p=><label className="block" key={p.period}><input type="checkbox" checked={p.complete} onChange={e=>run(()=>save({...book,periods:book.periods.map(v=>v.period===p.period?{...v,complete:e.target.checked}:v)}))}/> {p.period}: incluí todas as operações deste período; lista vazia significa ausência expressamente confirmada.</label>)}
|
||||
<p>P001mantém-se residual,sem atribuição automática06;retoma apenas com novo esclarecimento concreto. Os tratamentos independentes mantêm-se disponíveis. IVA incluído a5% conserva a fracção exacta e apresenta um decimal a6casas; a aproximação de apresentação não constitui regra declarativa. O desconhecido nunca é assumido como zero.</p>
|
||||
<p>A correspondência05/06/07 está identificada no exemplar. Tratamentos ainda não implementados conservam o seu fundamento por determinar;localização estrangeira não determina06. IVA incluído a5% conserva a fracção exacta e apresenta um decimal a6casas; a aproximação de apresentação não constitui regra declarativa. O desconhecido nunca é assumido como zero.</p>
|
||||
<button type="button" disabled={!book.periods.length} className="rounded bg-emerald-800 p-2 text-white disabled:opacity-50" onClick={()=>run(()=>save(recordSales(draft,book)))}>Calcular e guardar operações IVA</button>
|
||||
{book.result&&<><p role="status">{salesCurrent(draft,book)?'Resultado correspondente às entradas.':'Resultado histórico conservado; reveja as alterações antes de recalcular.'}</p><dl>{salesReportRows(draft).map(([,label,value,origin],index)=><div className="break-inside-avoid border-t py-2" key={index}><dt className="font-semibold">{label}</dt><dd>{value}<small className="block">{origin}</small></dd></div>)}</dl></>}
|
||||
</section>;
|
||||
|
||||
@@ -58,28 +58,10 @@ const menuTranslations = [
|
||||
'solicitudes recibidas',
|
||||
],
|
||||
[
|
||||
'Porquê investir em Moçambique?',
|
||||
'Why invest in Mozambique?',
|
||||
'Pourquoi investir au Mozambique ?',
|
||||
'Por qué invertir en Mozambique?',
|
||||
],
|
||||
[
|
||||
'Partir de uma ideia',
|
||||
'Start with an idea',
|
||||
'Partir d’une idée',
|
||||
'Partir de una idea',
|
||||
],
|
||||
[
|
||||
'Consultar oportunidades',
|
||||
'Browse opportunities',
|
||||
'Consulter les opportunités',
|
||||
'Consultar oportunidades',
|
||||
],
|
||||
[
|
||||
'Simulador Fiscal',
|
||||
'Tax simulator',
|
||||
'Simulateur fiscal',
|
||||
'Simulador fiscal',
|
||||
'Porquê investir em Moçambique',
|
||||
'Why invest in Mozambique',
|
||||
'Pourquoi investir au Mozambique',
|
||||
'Por qué invertir en Mozambique',
|
||||
],
|
||||
[
|
||||
'Oportunidades de investimento',
|
||||
|
||||
@@ -30,7 +30,7 @@ const names: Record<string, string> = {
|
||||
'/contacto': 'Contacto',
|
||||
'/politica-de-privacidade': 'Política de Privacidade',
|
||||
'/termos-de-uso': 'Termos de Uso',
|
||||
'/porque-investir': 'Porquê investir em Moçambique?',
|
||||
'/porque-investir': 'Porquê investir em Moçambique',
|
||||
'/investimentos/iniciar': 'Iniciar ou continuar investimento',
|
||||
'/explorar/agronegocio': 'Explorar agronegócio',
|
||||
'/agronegocio': 'Artigo de agronegócio',
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
import {selectFx,fxSelectionKey,type FxSelection} from './iva-fx-selection.ts';
|
||||
import {currencyEventBook,newCurrencyEvent} from './iva-currency-events.ts';
|
||||
import {convertCents} from './business-financial-plan.ts';
|
||||
import {decimalFraction,fraction,type FiscalFraction} from './fiscal-rational.ts';
|
||||
import {closureFingerprint} from './iva-closure.ts';
|
||||
|
||||
export type IrpcFxLink={id:string;fingerprint:string};
|
||||
export type IrpcFxAmount={currency:string;fxSelection?:FxSelection;fxLink?:IrpcFxLink};
|
||||
export type IrpcFxEvidence={originalAmount:string;originalCurrency:string;convertedCurrency:'MZN';column:string;rate:string;date:string;direction:string;source:string;selectionKey:string;rounding:string};
|
||||
export function irpcFxSources(d:Record<string,unknown>){return currencyEventBook(d).rows.filter(r=>r.fxSelection).map(r=>({id:r.id,label:`${r.description||r.id} — ${r.sourceCurrency} — ${r.fxSelection?.applied?.rate??'por aplicar'}`,fingerprint:closureFingerprint(r),selection:structuredClone(r.fxSelection!)}));}
|
||||
export function irpcFxDependency(d:Record<string,unknown>,input:IrpcFxAmount):string{
|
||||
if(input.currency==='MZN'||!input.fxLink)return'';
|
||||
const source=irpcFxSources(d).find(s=>s.id===input.fxLink!.id);
|
||||
return !source?'Selecção cambial de origem indisponível;vínculo e histórico conservados.':source.fingerprint!==input.fxLink.fingerprint?'Selecção cambial de origem alterada;compare a nova selecção antes de a aplicar às retenções.':'';
|
||||
}
|
||||
export function irpcFxRow(id:string,input:IrpcFxAmount){const s=input.fxSelection,a=s?.applied;return{...newCurrencyEvent(id,'MZN'),sourceCurrency:input.currency,fxSelection:s,fxDirection:s?.direction??'',fxRate:a?.rate??'',fxDate:a?.date??'',fxSource:a?.source??''};}
|
||||
export function convertIrpcAmount(d:Record<string,unknown>,amount:string,input:IrpcFxAmount):{value:FiscalFraction;evidence:IrpcFxEvidence|null}{
|
||||
const original=decimalFraction(amount);if(input.currency==='MZN')return{value:original,evidence:null};
|
||||
const issue=irpcFxDependency(d,input);if(issue)throw Error(issue);
|
||||
const s=input.fxSelection;if(!s)throw Error('Reutilize ou aplique a selecção cambial já entregue:moeda original,boletim,coluna,data e sentido;sem taxa actual por defeito.');
|
||||
const selected=selectFx(s),a=s.applied;
|
||||
if(!a||a.selectionKey!==fxSelectionKey(s)||a.rate!==selected.rate||a.date!==selected.date||a.source!==selected.source||a.column!==selected.column||s.sourceCurrency!==input.currency)throw Error('Selecção cambial alterada,não confirmada ou de outra moeda;use a conferência e confirmação existentes,sem recalcular históricos.');
|
||||
const [whole,places='']=selected.rate.split('.'),rate=BigInt(whole+places.padEnd(8,'0')),scale=100000000n;
|
||||
const micro=BigInt(original.numerator)*1000000n/BigInt(original.denominator);
|
||||
const converted=s.direction==='mzn_per_unit'?convertCents(micro,rate,scale):convertCents(micro,scale,rate);
|
||||
return{value:fraction(converted,1000000n),evidence:{originalAmount:amount,originalCurrency:input.currency,convertedCurrency:'MZN',column:selected.column,rate:selected.rate,date:selected.date,direction:s.direction,source:selected.source,selectionKey:a.selectionKey,rounding:'Mesmo convertCents entregue;conversão à unidade de0,000001MZN;apresentação separada,não regra nova de arredondamento do imposto.'}};
|
||||
}
|
||||
|
||||
export function irpcFxEvidenceLabel(e:IrpcFxEvidence):string{const column=({buy:'Compra',sell:'Venda',mean:'Média de referência BM',exception:'Excepção fiscal identificada'} as Record<string,string>)[e.column]??e.column;const direction=e.direction==='mzn_per_unit'?'MZN por '+e.originalCurrency:e.originalCurrency+' por MZN';return`Original: ${e.originalAmount} ${e.originalCurrency}; coluna: ${column}; taxa: ${e.rate}; cotação: ${direction}; data cambial: ${e.date}; fonte: ${e.source.split(';perspectiva:')[0]}. Montante e selecção originais conservados.`;}
|
||||
|
||||
export function updateIrpcFx(input:IrpcFxAmount,selection:FxSelection):Partial<IrpcFxAmount>{return{fxSelection:selection,fxLink:input.fxSelection&&fxSelectionKey(input.fxSelection)===fxSelectionKey(selection)?input.fxLink:undefined};}
|
||||
@@ -1,69 +0,0 @@
|
||||
import type {IrpcBook} from './irpc-withholdings.ts';
|
||||
import {addFractions,decimalFraction,fraction,subtractFractions,type FiscalFraction} from './fiscal-rational.ts';
|
||||
|
||||
export type IrpcInterestRule={
|
||||
annualRate:string;rateSource:string;fiscalBasis:string;validFrom:string;validTo:string;
|
||||
dayBasis:''|'365'|'366'|'actual_year';dayBasisRef:string;
|
||||
rounding:''|'total_cent_half_up'|'total_cent_down';roundingRef:string;
|
||||
retention:''|'withheld'|'not_withheld';occurrenceRef:string;
|
||||
};
|
||||
export const newIrpcInterestRule=():IrpcInterestRule=>({annualRate:'',rateSource:'',fiscalBasis:'',validFrom:'',validTo:'',dayBasis:'',dayBasisRef:'',rounding:'',roundingRef:'',retention:'',occurrenceRef:''});
|
||||
export const irpcInterestVersion='IRPC-interest/1';
|
||||
export type IrpcInterestSegment={from:string;to:string;days:number;denominator:number;principal:FiscalFraction;interest:FiscalFraction};
|
||||
export type IrpcInterestCalculation={version:string;rows:Array<{id:string;document:string;segments:IrpcInterestSegment[];exact:FiscalFraction}>;pending:string[];exact:FiscalFraction|null;total:FiscalFraction|null;rule:IrpcInterestRule;dueDate:string;liquidationDate:string;source:string};
|
||||
const validDate=(s:string)=>/^20\d{2}-\d{2}-\d{2}$/.test(s)&&Number.isFinite(Date.parse(s))&&new Date(s).toISOString().slice(0,10)===s;
|
||||
const next=(s:string)=>new Date(Date.parse(s)+86400000).toISOString().slice(0,10);
|
||||
const less=(a:FiscalFraction,b:FiscalFraction)=>BigInt(a.numerator)*BigInt(b.denominator)<BigInt(b.numerator)*BigInt(a.denominator);
|
||||
const zero=()=>fraction(0n,1n);
|
||||
export function validateIrpcInterestRule(r:IrpcInterestRule){
|
||||
if(!r||Object.keys(newIrpcInterestRule()).some(k=>typeof r[k as keyof IrpcInterestRule]!=='string')||!['','365','366','actual_year'].includes(r.dayBasis)||!['','total_cent_half_up','total_cent_down'].includes(r.rounding)||!['','withheld','not_withheld'].includes(r.retention))throw Error('Parâmetros de juros não recuperáveis;originais conservados.');
|
||||
}
|
||||
// No fiscal rate, annual day basis or rounding convention is supplied by default.
|
||||
// Complete references describe the parameters of this case, not a global 2026 rate.
|
||||
export function calculateIrpcInterest(b:IrpcBook,current:boolean,period:string,dueDate:string,dueReference:string,liquidationDate:string,r:IrpcInterestRule):IrpcInterestCalculation{
|
||||
validateIrpcInterestRule(r);
|
||||
const pending:string[]=[],rows:IrpcInterestCalculation['rows']=[];
|
||||
const result=(exact:FiscalFraction|null=null,total:FiscalFraction|null=null):IrpcInterestCalculation=>({version:irpcInterestVersion,rows,pending,exact,total,rule:structuredClone(r),dueDate,liquidationDate,source:'Decreto9/2008 art35(1/2):dia imediato ao prazo até pagamento/liquidação;25(1):parâmetro na data da liquidação. Taxa,base anual e arredondamento apenas conforme referências do caso. Sem parâmetro fiscal2026 pré-definido,sem MIMO/Prime presumidos. Mora e retenção por conta não efectuada conservam regra própria.'});
|
||||
if(!current||!b.result)pending.push('Retenções sem cálculo actual.');
|
||||
if(!/^2026-(0[1-9]|1[0-2])$/.test(period)||!validDate(dueDate)||!dueReference.trim()||!validDate(liquidationDate)||liquidationDate<=dueDate||dueDate<period+'-01')pending.push('Identifique período,prazo documentado e data de liquidação posterior ao prazo;sem prazo/calendário presumidos.');
|
||||
if(!validDate(r.validFrom)||!validDate(r.validTo)||r.validFrom>r.validTo||liquidationDate<r.validFrom||liquidationDate>r.validTo)pending.push('Parâmetro fora da versão/período aplicável à data de liquidação.');
|
||||
const labels:Record<string,string>={rateSource:'fonte da taxa anual final',fiscalBasis:'fundamento fiscal aplicável',dayBasisRef:'fonte da base anual',roundingRef:'fonte do arredondamento',occurrenceRef:'documento da retenção/ocorrência'};
|
||||
for(const[k,label]of Object.entries(labels))if(!r[k as keyof IrpcInterestRule].trim())pending.push('Falta '+label+'.');
|
||||
if(!r.dayBasis||!r.rounding||!r.retention)pending.push('Regra de base anual,arredondamento e situação da retenção por identificar.');
|
||||
let rate:FiscalFraction;
|
||||
try{rate=decimalFraction(r.annualRate);if(!less(zero(),rate))throw Error();}catch{pending.push('Taxa anual final aplicável por identificar;sem zero ou taxa bancária de substituição.');return result();}
|
||||
if(pending.length)return result();
|
||||
const selected=b.result!.rows.filter(v=>v.direction==='paid'&&v.period===period&&v.treatment!=='dispensed');
|
||||
if(!selected.length){pending.push('Sem retenções a entregar seleccionadas para este período.');return result();}
|
||||
for(const v of selected){
|
||||
const input=b.result!.inputs.find(i=>i.id===v.id);
|
||||
if(!input||v.status!=='calculated'||!v.tax||less(v.tax,zero())||v.settled===null||!['none','complete'].includes(input.settlement)||!input.settlementRef.trim()||!v.nature){pending.push(v.id+': retenção/entregas não reconciliadas.');continue;}
|
||||
if(v.nature==='on_account'&&r.retention!=='withheld'){pending.push(input.documentRef+': imposto por conta não retido exige o termo da declaração anual e responsabilidade correspondentes;fora deste cálculo.');continue;}
|
||||
let payments:Array<{date:string;amount:FiscalFraction}>=[];
|
||||
try{
|
||||
const seen=new Set<string>();
|
||||
payments=input.allocations.map(a=>{const p=b.result!.payments.find(p=>p.id===a.paymentId);if(!p||seen.has(p.id)||p.kind!=='remittance'||p.currency!=='MZN'||!validDate(p.date)||p.date<v.eventDate||!p.reference.trim()||p.date>liquidationDate)throw Error();seen.add(p.id);const amount=decimalFraction(a.amount);if(!less(zero(),amount))throw Error();return{date:p.date,amount};});
|
||||
const allocated=addFractions(payments.map(p=>p.amount));if(less(v.tax,allocated)||!isEqual(allocated,v.settled))throw Error();
|
||||
}catch{pending.push(input.documentRef+': comprovativos incoerentes ou posteriores à data de liquidação;conserve e reconcilie.');continue;}
|
||||
let principal=subtractFractions(v.tax,addFractions(payments.filter(p=>p.date<=dueDate).map(p=>p.amount))),cursor=next(dueDate);
|
||||
const segments:IrpcInterestSegment[]=[];
|
||||
const charge=(to:string)=>{
|
||||
if(cursor>to||!less(zero(),principal))return;
|
||||
while(cursor<=to){
|
||||
const year=Number(cursor.slice(0,4)),yearEnd=year+'-12-31',end=r.dayBasis==='actual_year'&&yearEnd<to?yearEnd:to;
|
||||
const denominator=r.dayBasis==='actual_year'?(year%4===0&&(year%100!==0||year%400===0)?366:365):Number(r.dayBasis);
|
||||
const days=(Date.parse(end)-Date.parse(cursor))/86400000+1;
|
||||
const interest=fraction(BigInt(principal.numerator)*BigInt(rate.numerator)*BigInt(days),BigInt(principal.denominator)*BigInt(rate.denominator)*100n*BigInt(denominator));
|
||||
segments.push({from:cursor,to:end,days,denominator,principal,interest});cursor=next(end);
|
||||
}
|
||||
};
|
||||
const grouped=new Map<string,FiscalFraction[]>();for(const p of payments.filter(p=>p.date>dueDate))grouped.set(p.date,[...(grouped.get(p.date)??[]),p.amount]);
|
||||
for(const[day,parts]of [...grouped].sort(([a],[c])=>a.localeCompare(c))){charge(day);principal=subtractFractions(principal,addFractions(parts));cursor=next(day);}
|
||||
charge(liquidationDate);rows.push({id:v.id,document:input.documentRef,segments,exact:addFractions(segments.map(s=>s.interest))});
|
||||
}
|
||||
if(pending.length)return result();
|
||||
const exact=addFractions(rows.map(r=>r.exact)),scaled=BigInt(exact.numerator)*100n,d=BigInt(exact.denominator);
|
||||
let cents=scaled/d;if(r.rounding==='total_cent_half_up'&&scaled%d*2n>=d)cents++;
|
||||
return result(exact,fraction(cents,100n));
|
||||
}
|
||||
function isEqual(a:FiscalFraction,b:FiscalFraction){return BigInt(a.numerator)*BigInt(b.denominator)===BigInt(b.numerator)*BigInt(a.denominator);}
|
||||
@@ -1,18 +0,0 @@
|
||||
import type {MrftaModel} from './irpc-mrfta.ts';
|
||||
import {closureFingerprint} from './iva-closure.ts';
|
||||
import {fractionPresentation,type FiscalFraction} from './fiscal-rational.ts';
|
||||
|
||||
// Groups are working sheets, never a decision to split an official declaration.
|
||||
export function mrftaCases(m:MrftaModel){return m.lines.map(line=>({
|
||||
key:closureFingerprint([m.period,line.rubric,line.rate,line.cer]),period:m.period,
|
||||
rubric:line.rubric,rate:line.rate,cer:line.cer,ids:[...line.ids],documents:[...line.documents],references:[...line.references],
|
||||
base:structuredClone(line.base),tax:structuredClone(line.tax),paid:structuredClone(line.paid),
|
||||
pending:!line.cer||!/^\d+$/.test(line.cer)||!line.ids.every(id=>m.input.codes.find(c=>c.rowId===id)?.reference.trim())?'CER ou referência por corresponder;sem preenchimento presumido.':'CER transcrito com referência do caso;sem validação por catálogo oficial. Código provisório ou de simulação não é correspondência oficial.',
|
||||
officialSeparation:'A correspondência de linhas/anexos/declaração oficial permanece por resolver quando há taxas/CER distintos na mesma rubrica.',
|
||||
}));}
|
||||
export function mrftaCaseHtml(m:MrftaModel,key:string):string{
|
||||
const c=mrftaCases(m).find(c=>c.key===key);if(!c)throw Error('Caso MRFTA não encontrado;reprepare as entradas actuais.');
|
||||
const esc=(v:unknown)=>String(v).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]!));
|
||||
const money=(v:FiscalFraction|null)=>{if(!v)return'Indeterminado';const p=fractionPresentation(v);return(p.approximate?'≈':'')+p.decimal+' MZN';};
|
||||
return `<!doctype html><html lang="pt"><meta charset="utf-8"><title>MRFTA — ficha de caso</title><body><h1>MRFTA — ficha de trabalho por caso</h1><p>Não é uma declaração autónoma,guia,anexo oficial ou submissão. Não funde taxas nem substitui o total do período.</p><p>Período:${esc(c.period)};rubrica:${esc(c.rubric)};taxa:${c.rate}%;CER:${esc(c.cer||'Por corresponder')}.</p><p>Base:${esc(money(c.base))};imposto:${esc(money(c.tax))};entregas:${esc(money(c.paid))}.</p><p>Documentos:${esc(c.documents.join(';'))};origens:${esc(c.ids.join(';'))}.</p><p>${esc(c.references.join(' | '))}</p><p>${esc(c.pending)}</p><p>${esc(c.officialSeparation)}</p><h2>Pendências do período — conservadas</h2><ul>${m.pending.map(p=>'<li>'+esc(p)+'</li>').join('')}</ul><small>${esc(m.source)}</small></body></html>`;
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
import {irpcInterestVersion,calculateIrpcInterest,validateIrpcInterestRule,type IrpcInterestRule,type IrpcInterestCalculation} from './irpc-interest.ts';
|
||||
import type {IrpcBook, IrpcResult, IrpcRow} from './irpc-withholdings.ts';
|
||||
import {addFractions,decimalFraction,fraction,fractionPresentation,subtractFractions,type FiscalFraction} from './fiscal-rational.ts';
|
||||
|
||||
export type MrftaInput = {
|
||||
version:1; period:string; declaration:''|'initial'|'replacement'; timing:''|'within'|'late';
|
||||
nuit:string; name:string; commercialName:string; taxArea:string; address:string; contact:string;
|
||||
completeness:''|'yes'|'no'; completenessRef:string;
|
||||
otherRubrics:''|'none'|'pending'; otherRubricsRef:string;
|
||||
codes:Array<{rowId:string;cer:string;reference:string}>;
|
||||
interest:{mode:''|'assessment'|'timely';calculation?:'automatic';automatic?:IrpcInterestRule;period:string;amount:string;reference:string;date:string;dueDate:string;dueReference:string};
|
||||
};
|
||||
type MrftaLine={ids:string[];documents:string[];references:string[];rubric:string;cer:string;rate:number;base:FiscalFraction;tax:FiscalFraction;paid:FiscalFraction|null};
|
||||
export type MrftaModel={automatic?:IrpcInterestCalculation;period:string;input:MrftaInput;lines:MrftaLine[];excluded:Array<{id:string;reason:string}>;pending:string[];principal:FiscalFraction;paid:FiscalFraction|null;interest:FiscalFraction|null;total:FiscalFraction|null;interestReason:string;source:string};
|
||||
export type MrftaRecord={key:string;createdAt:string;model:MrftaModel};
|
||||
export type MrftaStore={mrfta?:MrftaInput;mrftaResult?:MrftaRecord;mrftaHistory?:MrftaRecord[]};
|
||||
export const newMrftaInput=():MrftaInput=>({version:1,period:'',declaration:'',timing:'',nuit:'',name:'',commercialName:'',taxArea:'',address:'',contact:'',completeness:'',completenessRef:'',otherRubrics:'',otherRubricsRef:'',codes:[],interest:{mode:'',period:'',amount:'',reference:'',date:'',dueDate:'',dueReference:''}});
|
||||
export const mrftaSource='AT MRFTA19/39,PDF1–2:quadros1–7;um mês/ano por declaração. Decreto9/2008 arts25/35,PDF6/8,p121/123:juros compensatórios separados. MAIBOR12meses+2p.p.na data da liquidação;publicação MAIBOR descontinuada segundo BM. Sem substituir por MIMO/Prime nem presumir zero. CER exige referência específica;remissões antigas do M/39 não renumeradas no original.';
|
||||
const date=(s:string)=>/^20\d{2}-\d{2}-\d{2}$/.test(s)&&Number.isFinite(Date.parse(s))&&new Date(s).toISOString().slice(0,10)===s;
|
||||
const zero=()=>fraction(0n,1n);
|
||||
const isZero=(v:FiscalFraction)=>BigInt(v.numerator)===0n;
|
||||
const negative=(v:FiscalFraction)=>BigInt(v.numerator)<0n;
|
||||
const labels:Record<string,string>={period:'mês/ano',declaration:'tipo de declaração',timing:'dentro/fora do prazo',nuit:'NUIT',name:'nome do sujeito passivo',taxArea:'área fiscal',address:'domicílio fiscal'};
|
||||
|
||||
export function validateMrfta(b:MrftaStore){
|
||||
const i=b.mrfta;
|
||||
if(i?.interest?.calculation!==undefined&&i.interest.calculation!=='automatic')throw Error('Método de cálculo de juros não recuperável.');
|
||||
if(i?.interest?.automatic!==undefined)validateIrpcInterestRule(i.interest.automatic);
|
||||
if(i&&(!['','none','pending'].includes(i.otherRubrics)||typeof i.otherRubricsRef!=='string'))throw Error('Âmbito de outras rubricas MRFTA não recuperável.');
|
||||
if(i&&(i.version!==1||!['','initial','replacement'].includes(i.declaration)||!['','within','late'].includes(i.timing)||!['','yes','no'].includes(i.completeness)||['period','nuit','name','commercialName','taxArea','address','contact','completenessRef'].some(k=>typeof i[k as keyof MrftaInput]!=='string')||!Array.isArray(i.codes)||i.codes.some(c=>!c||['rowId','cer','reference'].some(k=>typeof c[k as keyof typeof c]!=='string'))||new Set(i.codes.map(c=>c.rowId)).size!==i.codes.length||!i.interest||!['','assessment','timely'].includes(i.interest.mode)||['period','amount','reference','date','dueDate','dueReference'].some(k=>typeof i.interest[k as keyof typeof i.interest]!=='string')))throw Error('Preparação MRFTA não recuperável;originais conservados.');
|
||||
if(b.mrftaResult&&(!b.mrftaResult.model||typeof b.mrftaResult.key!=='string'||!Array.isArray(b.mrftaResult.model.lines)||!Array.isArray(b.mrftaResult.model.pending))||b.mrftaHistory!==undefined&&!Array.isArray(b.mrftaHistory))throw Error('Histórico MRFTA não recuperável.');
|
||||
}
|
||||
function rubric(r:IrpcRow,v:IrpcResult){
|
||||
if(v.nature==='on_account')return r.kind==='rent'?'Taxa normal — Rendimentos prediais':r.kind==='capital'?'Taxa normal — Rendimentos de capitais e mais valias':null;
|
||||
if(v.nature!=='definitive')return null;
|
||||
return ({royalty:'IRPC liberatório — Actividade intelectual ou industrial / prestação de informações',equipment:'IRPC liberatório — Uso ou concessão do uso de equipamento',capital:'IRPC liberatório — Aplicação de capitais e rendimentos prediais',services:'IRPC liberatório — Comissões por intermediação de contratos ou prestação de serviços'} as Record<string,string>)[r.kind]??null;
|
||||
}
|
||||
function key(b:IrpcBook&MrftaStore,current:boolean){return JSON.stringify(['MRFTA-L5/1',b.result,b.mrfta,current,...(b.mrfta?.interest.mode===''&&b.mrfta?.interest.calculation==='automatic'?[irpcInterestVersion]:[])]);}
|
||||
export function mrftaCurrent(b:IrpcBook&MrftaStore,current:boolean){return !!b.mrftaResult&&b.mrftaResult.key===key(b,current);}
|
||||
export function prepareMrfta(b:IrpcBook&MrftaStore,current:boolean):MrftaModel{
|
||||
validateMrfta(b);const i=b.mrfta??newMrftaInput(),pending:string[]=[],excluded:MrftaModel['excluded']=[],lines:MrftaLine[]=[];
|
||||
for(const k of Object.keys(labels))if(!String(i[k as keyof MrftaInput]).trim())pending.push('Falta '+labels[k]+'.');
|
||||
if(!/^2026-(0[1-9]|1[0-2])$/.test(i.period))pending.push('Mês/ano inválido ou fora do recorte2026.');
|
||||
if(i.nuit&&!/^\d{9}$/.test(i.nuit))pending.push('NUIT deve ter nove algarismos;confira a identidade fiscal.');
|
||||
if(i.completeness!=='yes'||!i.completenessRef.trim())pending.push('Conferir completude das retenções deste sujeito passivo/período, incluindo os demais livros;este contexto não é automaticamente a declaração completa.');
|
||||
if(i.otherRubrics!=='none'||!i.otherRubricsRef.trim())pending.push('IRPS,tributação autónoma e outras rubricas fora deste recorte não são zero presumido;documente a ausência de outros valores devidos ou mantenha o total indeterminado.');
|
||||
if(!current||!b.result)pending.push('Cálculo das retenções desactualizado ou inexistente;guarde o cálculo actual antes da preparação.');
|
||||
for(const v of b.result?.rows??[]){
|
||||
const r=b.result!.inputs.find(r=>r.id===v.id);
|
||||
if(!r){pending.push('Entrada do resultado ausente: '+v.id);continue;}
|
||||
if(r.direction==='received'){excluded.push({id:r.id,reason:'Retenção sofrida; não é imposto a entregar pelo titular.'});continue;}
|
||||
if(v.period&&v.period!==i.period){excluded.push({id:r.id,reason:'Outro período: '+v.period});continue;}
|
||||
if(v.treatment==='dispensed'&&v.status==='calculated'){excluded.push({id:r.id,reason:'Dispensa documentada;sem imposto a transcrever.'});continue;}
|
||||
if(v.status!=='calculated'||!v.tax||!v.base||v.rate===null||!v.period){pending.push(`${r.documentRef}: rendimento indeterminado;${v.reason}`);continue;}
|
||||
const name=rubric(r,v);if(!name){pending.push(`${r.documentRef}: rubrica MRFTA por corresponder;categoria digital/especial não copiada para serviços comuns.`);continue;}
|
||||
const code=i.codes.find(c=>c.rowId===r.id);if(!code?.cer.trim()||!/^\d+$/.test(code.cer.trim())||!code.reference.trim())pending.push(`${r.documentRef}: CER numérico e referência aplicável por identificar;sem código presumido.`);
|
||||
const cer=code?.cer.trim()??'',line=lines.find(l=>l.rubric===name&&l.rate===v.rate&&l.cer===cer);
|
||||
const reference=`CER:${code?.reference??''};contraparte:${r.counterparty};qualificação:${r.qualificationRef};benefício:${r.reliefPreparation?.evidence??r.reliefRef};residência fiscal:${r.reliefPreparation?.residenceDocument??''}`;
|
||||
if(line){line.ids.push(r.id);line.documents.push(r.documentRef);line.references.push(reference);line.base=addFractions([line.base,v.base]);line.tax=addFractions([line.tax,v.tax]);line.paid=line.paid&&v.settled?addFractions([line.paid,v.settled]):null;}
|
||||
else lines.push({ids:[r.id],documents:[r.documentRef],references:[reference],rubric:name,cer,rate:v.rate,base:v.base,tax:v.tax,paid:v.settled});
|
||||
}
|
||||
for(const line of lines)if(lines.some(other=>other!==line&&other.rubric===line.rubric))pending.push(line.rubric+': taxas ou CER distintos na mesma rubrica;conferir transcrição sem fundir taxas nem perder parcelas.');
|
||||
const principal=addFractions(lines.map(l=>l.tax)),paid=lines.every(l=>l.paid!==null)?addFractions(lines.map(l=>l.paid!)):null;
|
||||
if(paid===null)pending.push('Valor já pago não reconciliado;pagamento ao fornecedor não é entrega à AT.');
|
||||
let interest:FiscalFraction|null=null,interestReason='Juros compensatórios indeterminados: taxa aplicável, âmbito e período por resolver;sem MAIBOR2026 nem substituição automática por MIMO/Prime. Juros de mora e tributação autónoma não apurados.';
|
||||
if(i.interest.mode==='assessment'){
|
||||
try{const a=decimalFraction(i.interest.amount);if(negative(a)||i.interest.period!==i.period||!i.interest.reference.trim()||!date(i.interest.date)||i.interest.date.slice(0,7)<i.period)throw Error();interest=a;interestReason=`Juros compensatórios transcritos de liquidação documentada:${i.interest.reference};data:${i.interest.date};período:${i.interest.period};montante original em MZN:${i.interest.amount}. Não são juros calculados pelo portal.`;}catch{interestReason='Liquidação de juros incompleta,negativa ou incoerente;identifique montante,data e documento do mesmo período.';}
|
||||
}else if(i.interest.mode==='timely'){
|
||||
const ids=lines.flatMap(l=>l.ids),inputs=(b.result?.inputs??[]).filter(r=>ids.includes(r.id));
|
||||
const dates=inputs.flatMap(r=>r.allocations.map(a=>b.result?.payments.find(p=>p.id===a.paymentId)?.date??''));
|
||||
if(i.interest.period===i.period&&date(i.interest.dueDate)&&i.interest.dueReference.trim()&&i.interest.reference.trim()&&paid!==null&&isZero(subtractFractions(principal,paid))&&inputs.length>0&&inputs.every(r=>r.settlement==='complete'&&r.allocations.length>0)&&dates.every(d=>date(d)&&d<=i.interest.dueDate)&&i.interest.dueDate>=i.period+'-01'){
|
||||
interest=zero();interestReason=`Entregas integralmente reconciliadas até ao prazo documentado:${i.interest.dueDate};${i.interest.dueReference};${i.interest.reference}. Sem atraso neste recorte;sem declarar cumprimento global de obrigações.`;
|
||||
}else interestReason='Ausência de atraso não demonstrada: confira prazo aplicável, comprovativos completos, datas e montante entregue. Sem zero de juros presumido.';
|
||||
}
|
||||
let automatic:IrpcInterestCalculation|undefined;
|
||||
if(i.interest.mode===''&&i.interest.calculation==='automatic'){
|
||||
if(!i.interest.automatic||i.interest.period!==i.period||!i.interest.reference.trim())interestReason='Cálculo automático sem parâmetros/ocorrência e período documentados;juros continuam indeterminados.';
|
||||
else{automatic=calculateIrpcInterest(b,current,i.period,i.interest.dueDate,i.interest.dueReference,i.interest.date,i.interest.automatic);interest=automatic.total;interestReason=automatic.pending.length?automatic.pending.join(' | '):'Juros calculados por parâmetros documentados deste caso — simulação pelos pressupostos introduzidos, sem confirmação fiscal;sem taxa fiscal2026 pré-definida. Taxa anual:'+automatic.rule.annualRate+'%;fonte:'+automatic.rule.rateSource+';fundamento:'+automatic.rule.fiscalBasis+';vigência:'+automatic.rule.validFrom+'–'+automatic.rule.validTo+';base anual:'+(automatic.rule.dayBasis==='actual_year'?'dias efectivos de cada ano':automatic.rule.dayBasis+' dias')+';fonte:'+automatic.rule.dayBasisRef+';arredondamento do total aos cêntimos:'+(automatic.rule.rounding==='total_cent_half_up'?'metade por excesso':'por defeito')+';fonte:'+automatic.rule.roundingRef+';ocorrência:'+automatic.rule.occurrenceRef+';'+automatic.rows.map(r=>r.document+':'+r.segments.map(s=>s.from+'–'+s.to+':'+s.days+'dias/'+s.denominator+';principal '+money(s.principal)+';juros '+money(s.interest)).join(',')).join(' | ');}
|
||||
}
|
||||
if(!interest)pending.push(interestReason);
|
||||
let total:FiscalFraction|null=null;
|
||||
if(pending.length===0&&interest&&paid){const balance=subtractFractions(addFractions([principal,interest]),paid);if(negative(balance))pending.push('Valor já pago excede imposto e juros;reconcilie sem crédito/reembolso automático.');else total=balance;}
|
||||
return {...(automatic?{automatic}:{}),period:i.period,input:structuredClone(i),lines,excluded,pending:[...new Set(pending)],principal,paid,interest,total,interestReason,source:mrftaSource};
|
||||
}
|
||||
export function recordMrfta(b:IrpcBook&MrftaStore,current:boolean,now=new Date().toISOString()):IrpcBook&MrftaStore{
|
||||
const model=prepareMrfta(b,current);return{...b,mrftaHistory:b.mrftaResult?[...(b.mrftaHistory??[]),structuredClone(b.mrftaResult)]:b.mrftaHistory??[],mrftaResult:{key:key(b,current),createdAt:now,model}};
|
||||
}
|
||||
const money=(f:FiscalFraction|null)=>{if(!f)return'Indeterminado';const p=fractionPresentation(f);return(p.approximate?'≈':'')+p.decimal+' MZN';};
|
||||
export function mrftaReportRows(b:IrpcBook&MrftaStore,current:boolean):Array<[string,string,string,string]>{
|
||||
const r=b.mrftaResult;if(!r)return[];const m=r.model;return[['IRPC — retenções','MRFTA — '+m.period,`Subtotal das retenções correspondidas:${money(m.principal)};juros:${money(m.interest)};valor já pago:${money(m.paid)};total a pagar:${money(m.total)};${m.interestReason};pendências:${m.pending.join(' | ')}`,`${mrftaCurrent(b,current)?'Preparação correspondente':'Histórico;preparação desactualizada'};${r.createdAt};completude:${m.input.completenessRef};outras rubricas:${m.input.otherRubricsRef};${m.source}`],...m.lines.map(l=>['IRPC — retenções',l.rubric,`${l.documents.join(';')};base:${money(l.base)};taxa:${l.rate}%;imposto:${money(l.tax)};CER:${l.cer||'por corresponder'};código introduzido,sem validação por catálogo oficial`,`Período:${m.period};apenas rendimento pago;sem assinatura ou uso dos serviços;documentos:${l.ids.join(',')};suporte:${l.references.join(' | ')}`] as [string,string,string,string])];
|
||||
}
|
||||
export function mrftaHtml(b:IrpcBook&MrftaStore,current:boolean):string{
|
||||
if(!current||!mrftaCurrent(b,current))throw Error('Calcule as retenções e prepare o MRFTA com as entradas actuais antes de exportar.');
|
||||
const m=b.mrftaResult!.model,esc=(v:unknown)=>String(v).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]!));
|
||||
return `<!doctype html><html lang="pt"><meta charset="utf-8"><title>MRFTA — preparação</title><body><h1>MRFTA — preenchimento de preparação</h1><p>Quadro1:retenção na fonte;${esc(m.input.declaration==='initial'?'Inicial':m.input.declaration==='replacement'?'Substituição':'Tipo por identificar')}. Quadro2:${esc(m.period)};${esc(m.input.timing==='within'?'Dentro do prazo':m.input.timing==='late'?'Fora do prazo':'Prazo por identificar')}.</p><p>Quadro3 NUIT:${esc(m.input.nuit)};área fiscal:${esc(m.input.taxArea)}. Quadro4:${esc(m.input.name)}. Quadro5:${esc(m.input.commercialName)}. Quadro6:${esc(m.input.address)};${esc(m.input.contact)}.</p><p>Conferência do período:${esc(m.input.completenessRef)}. Outras rubricas:${esc(m.input.otherRubricsRef)}.</p><p>CER introduzidos com referência do caso; sem validação automática por catálogo oficial. Códigos provisórios ou de simulação não são correspondências oficiais.</p><h2>Quadro7</h2><table><thead><tr><th>CER</th><th>Rubrica</th><th>Base</th><th>Taxa</th><th>Imposto</th><th>Documentos</th></tr></thead><tbody>${m.lines.map(l=>`<tr><td>${esc(l.cer||'Por corresponder')}</td><td>${esc(l.rubric)}</td><td>${esc(money(l.base))}</td><td>${l.rate}%</td><td>${esc(money(l.tax))}</td><td>${esc(l.documents.join(';')+';'+l.references.join(' | '))}</td></tr>`).join('')}</tbody></table><p>Subtotal correspondido:${esc(money(m.principal))};JUROS COMPENSATÓRIOS:${esc(money(m.interest))};VALOR JÁ PAGO:${esc(money(m.paid))};TOTAL A PAGAR:${esc(money(m.total))}.</p><p>${esc(m.interestReason)}</p><h2>Casos pendentes</h2><ul>${m.pending.map(p=>'<li>'+esc(p)+'</li>').join('')}</ul><h2>Casos separados</h2><ul>${m.excluded.map(p=>'<li>'+esc(p.id+':'+p.reason)+'</li>').join('')}</ul><p>Quadros8/9 reservados,sem assinatura,carimbo,número de entrada ou aceitação AT. Tributação autónoma e juros de mora não apurados. Este documento de preparação não substitui o original oficial nem submete uma declaração.</p><small>${esc(m.source)}</small></body></html>`;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import {fraction,type FiscalFraction} from './fiscal-rational.ts';
|
||||
|
||||
export const normalAssessmentVersion='IRPC-normal-adjustments/4';
|
||||
export type NormalAssessmentInput={version:1;treatment:''|'general_61_1'|'other';reference:string};
|
||||
export const newNormalAssessmentInput=():NormalAssessmentInput=>({version:1,treatment:'',reference:''});
|
||||
export function validateNormalAssessment(i:NormalAssessmentInput){if(!i||i.version!==1||!['','general_61_1','other'].includes(i.treatment)||typeof i.reference!=='string')throw Error('Enquadramento da colecta não recuperável;original conservado.');}
|
||||
export type NormalAssessmentModel={input:NormalAssessmentInput;period:{year:string;from:string;to:string};classification:string;rate:FiscalFraction|null;taxableBase:FiscalFraction|null;colecta:FiscalFraction|null;centExact:boolean|null;pending:string[];rule:string;source:string;finalBalance:{scope:'L8';status:'not_calculated';payable:null;recoverable:null;reason:string}};
|
||||
export function calculateNormalAssessment(input:NormalAssessmentInput,base:FiscalFraction|null,context:{year:string;scope:string;currency:string;extended?:boolean;short?:boolean;period?:{from:string;to:string}}):NormalAssessmentModel{
|
||||
validateNormalAssessment(input);const pending:string[]=[],period={year:context.year,from:/^20\d{2}$/.test(context.year)?context.year+'-01-01':'',to:/^20\d{2}$/.test(context.year)?context.year+'-12-31':''};
|
||||
if(context.year!=='2026')pending.push('Taxa geral correspondida neste incremento apenas ao exercício2026;sem taxa transportada para outro período.');
|
||||
if(!(context.scope==='resident_general'||context.extended&&context.scope==='ep_general')||context.currency!=='MZN')pending.push('Colecta delimitada ao sujeito residente no regime geral emMZN;outros âmbitos por corresponder.');
|
||||
if(input.treatment!=='general_61_1')pending.push(input.treatment==='other'?'Benefício,taxa reduzida,tributação autónoma ou outro caso especial:tratamento próprio;sem taxa geral aplicada por aproximação.':'Enquadramento da taxa geral por identificar;sem escolha presumida.');
|
||||
if(!input.reference.trim())pending.push('Identifique suporte ou pressuposto da aplicação da taxa geral ao caso;uma actividade semelhante não prova o regime.');
|
||||
if(base===null)pending.push('Matéria colectável actual indeterminada;lucro tributável não é substituto da base.');
|
||||
else if(!/^-?\d{1,80}$/.test(base.numerator)||!/^\d{1,80}$/.test(base.denominator)||BigInt(base.denominator)===0n||BigInt(base.numerator)<0n)pending.push('Matéria colectável deve ser um valor conhecido não negativo e reconciliado.');
|
||||
if(context.period){period.from=context.period.from;period.to=context.period.to;const start=new Date(period.from+'T00:00:00Z'),end=new Date(period.to+'T00:00:00Z');if(!Number.isFinite(+start)||!Number.isFinite(+end)||start.toISOString().slice(0,10)!==period.from||end.toISOString().slice(0,10)!==period.to||!period.from.endsWith('-01')||!period.to.startsWith('2026-'))pending.push('Período fiscal anual não reconciliado.');else if(context.short){if(period.from>period.to||!period.from.startsWith('2026-')||period.from===context.year+'-01-01'&&period.to===context.year+'-12-31')pending.push('Período curto por reconciliar.');}else{start.setUTCFullYear(start.getUTCFullYear()+1);start.setUTCDate(start.getUTCDate()-1);if(start.toISOString().slice(0,10)!==period.to)pending.push('Colecta anual: período de12 meses por reconciliar.');}}
|
||||
const rate=input.treatment==='general_61_1'&&context.year==='2026'?fraction(32n):null;
|
||||
const colecta=pending.length===0&&base!==null&&rate?fraction(BigInt(base.numerator)*32n,BigInt(base.denominator)*100n):null;
|
||||
return{input:structuredClone(input),period,classification:input.treatment==='general_61_1'?'Regime normal — taxa geral do artigo61(1)':input.treatment==='other'?'Caso especial fora deste recorte':'Enquadramento por identificar',rate,taxableBase:base,colecta,centExact:colecta?(BigInt(colecta.numerator)*100n)%BigInt(colecta.denominator)===0n:null,pending,rule:'CIRPC61(1)-general-2026/1',source:context.short?'CIRPC7(4)/61(1):período curto documentado em2026,matéria colectável efectiva ×32%;sem anualizar lucro/base ou proporcionalizar a taxa;saldo finalL8 indeterminado.':context.extended?'CIRPC61(1), taxa geral32% mantida pelos diplomas inventariados até Lei12/2025; período anual documentado com termo em2026. CIRPC15(1)a/c,7(1–3): sujeito residente ou resultado imputável aEP no regime geral; ano civil, autorização ou comunicação expressamente identificadas. Sem arredondamento fiscal ou saldoL8 presumidos.':'CIRPC Lei34/2007 art61(1),PDF17/p768(71):taxa geral32%. Lei4/2012 altera61(2);Lei20/2022 PDF1/p2731 mantém61(1),altera61(2) com termo31/12/2025;Lei12/2025 PDF18/20 não altera61(1),adita61-A para mais-valias,fora deste recorte. Exercício anual2026/MZN/residente geral,matéria colectável actual×32/100 em aritmética racional exacta. Sem arredondamento fiscal ou transcriçãoM20/M22 presumidos.',finalBalance:{scope:'L8',status:'not_calculated',payable:null,recoverable:null,reason:'Saldo final a pagar ou recuperar por determinar emL8:retenções,pagamentos e créditos do fecho anual não apurados nem abatidos à colecta neste incremento. Colecta não equivale ao saldo final.'}};
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
import {addFractions,decimalFraction,fraction,subtractFractions,type FiscalFraction} from './fiscal-rational.ts';
|
||||
import type {ProfitEvidence} from './irpc-normal-profit.ts';
|
||||
|
||||
export const normalBaseVersion='IRPC-normal-adjustments/3';
|
||||
type Choice=''|'yes'|'no';
|
||||
export type NormalLoss={id:string;year:string;subjectNuit:string;assessed:string;previouslyUsed:string;requested:string;reference:string;kind:''|'ordinary'|'transfer'|'other';annualPeriods:Choice;generalActivity:Choice;balanceConfirmed:Choice};
|
||||
export type NormalBaseInput={version:1;subjectNuit:string;identityReference:string;method:''|'direct'|'indirect';methodReference:string;lossesState:''|'known'|'absent';lossesReference:string;unchangedObject:Choice;objectReference:string;losses:NormalLoss[];benefits:ProfitEvidence};
|
||||
export const newNormalBaseInput=():NormalBaseInput=>({version:1,subjectNuit:'',identityReference:'',method:'',methodReference:'',lossesState:'',lossesReference:'',unchangedObject:'',objectReference:'',losses:[],benefits:{state:'',amount:'',reference:''}});
|
||||
export const newNormalLoss=(id:string):NormalLoss=>({id,year:'',subjectNuit:'',assessed:'',previouslyUsed:'',requested:'',reference:'',kind:'',annualPeriods:'',generalActivity:'',balanceConfirmed:''});
|
||||
export function validateNormalBase(i:NormalBaseInput){
|
||||
if(!i||i.version!==1||['subjectNuit','identityReference','methodReference','lossesReference','objectReference'].some(k=>typeof i[k as 'subjectNuit']!=='string')||!['','direct','indirect'].includes(i.method)||!['','known','absent'].includes(i.lossesState)||!['','yes','no'].includes(i.unchangedObject)||!Array.isArray(i.losses)||new Set(i.losses.map(l=>l.id)).size!==i.losses.length||!i.benefits||!['','known','absent'].includes(i.benefits.state)||typeof i.benefits.amount!=='string'||typeof i.benefits.reference!=='string')throw Error('Preparação da matéria colectável não recuperável.');
|
||||
for(const l of i.losses)if(!l||Object.keys(newNormalLoss('')).some(k=>typeof l[k as keyof NormalLoss]!=='string')||!['','ordinary','transfer','other'].includes(l.kind)||['annualPeriods','generalActivity','balanceConfirmed'].some(k=>!['','yes','no'].includes(l[k as 'annualPeriods'])))throw Error('Perda fiscal não recuperável;originais conservados.');
|
||||
}
|
||||
export type NormalBaseModel={input:NormalBaseInput;taxableProfit:FiscalFraction|null;requestedLosses:FiscalFraction;deductedLosses:FiscalFraction|null;benefitDeduction:FiscalFraction|null;taxableBase:FiscalFraction|null;losses:Array<NormalLoss&{available:FiscalFraction|null;requestedAmount:FiscalFraction|null;deducted:FiscalFraction|null;remaining:FiscalFraction|null;lastOrdinaryYear:number|null;status:'eligible'|'excluded'|'indeterminate';reason:string}>;pending:string[];source:string};
|
||||
const zero=()=>fraction(0n);
|
||||
function amount(s:string){if(!/^\d{1,18}(?:\.\d{1,2})?$/.test(s))throw Error();return decimalFraction(s);}
|
||||
const units=(f:FiscalFraction)=>BigInt(f.numerator)*100n/BigInt(f.denominator);
|
||||
export function calculateNormalBase(input:NormalBaseInput,profit:FiscalFraction|null,year:string,currentLossReference?:string,short=false):NormalBaseModel{
|
||||
validateNormalBase(input);const i=structuredClone(input),pending:string[]=[],losses:NormalBaseModel['losses']=[];
|
||||
if(year!=='2026')pending.push('Matéria colectável delimitada ao exercício2026.');
|
||||
if(!/^\d{9}$/.test(i.subjectNuit)||!i.identityReference.trim())pending.push('Identifique NUIT e suporte do sujeito passivo do lucro e das perdas.');
|
||||
if(i.method!=='direct'||!i.methodReference.trim())pending.push('Método declarativo/directo e suporte por identificar;apuramento indirecto fora deste recorte (15(2),41(2)).');
|
||||
if(!profit)pending.push('Lucro tributável actual indeterminado;nenhuma dedução transforma informação em falta em zero.');
|
||||
else if(BigInt(profit.numerator)<0n&&!currentLossReference?.trim())pending.push('Resultado fiscal negativo conhecido;tratamento da perda do próprio exercício fora deste recorte,sem matéria colectável zero ou reporte automático.');
|
||||
if(!i.lossesState||!i.lossesReference.trim())pending.push('Situação e completude das perdas anteriores em falta;sem ausência presumida.');
|
||||
if(i.lossesState==='absent'&&i.losses.length)pending.push('Ausência declarada de perdas contradiz os registos existentes;reconcilie sem apagar histórico.');
|
||||
if(i.lossesState==='known'&&!i.losses.length)pending.push('Perdas declaradas conhecidas sem discriminação por exercício.');
|
||||
if(i.losses.some(l=>!/^20\d{2}$/.test(l.year)||Number(l.year)+5>=Number(year))&&(!i.unchangedObject||!i.objectReference.trim()))pending.push('Documente manutenção ou alteração do objecto/natureza da actividade no termo do exercício (41(7)).');
|
||||
for(const l of i.losses){const r:NormalBaseModel['losses'][number]={...l,available:null,requestedAmount:null,deducted:null,remaining:null,lastOrdinaryYear:null,status:'indeterminate',reason:''};const issues:string[]=[];
|
||||
if(!l.reference.trim())issues.push('Documento de apuramento/saldo fiscal por identificar.');
|
||||
if(l.subjectNuit!==i.subjectNuit||!/^\d{9}$/.test(l.subjectNuit))issues.push('Perda não reconciliada com o mesmo sujeito passivo.');
|
||||
if(!/^20\d{2}$/.test(l.year)||Number(l.year)>=Number(year))issues.push('Exercício da perda deve ser anterior ao exercício de utilização;perda actual não é dedução a si própria.');
|
||||
if(i.losses.some(q=>q.id!==l.id&&q.year===l.year&&q.subjectNuit===l.subjectNuit))issues.push('Saldo anual duplicado;reconcilie um saldo por sujeito/exercício.');
|
||||
if(l.kind!=='ordinary')issues.push('Transmissão/fusão ou outra origem exige correspondência própria;sem aplicação automática de41-A.');
|
||||
if(l.annualPeriods!=='yes')issues.push('Contagem por exercícios anuais ordinários não demonstrada;períodos especiais/curtos (41(5)) fora deste recorte.');
|
||||
if(l.generalActivity!=='yes')issues.push('Origem no regime geral,fora de transparência/isenção parcial ou actividade com redução,por demonstrar (41(4/6)).');
|
||||
if(l.balanceConfirmed!=='yes')issues.push('Saldo fiscal corrigido e utilizações anteriores por reconciliar (41(3));não usar perda contabilística como fiscal.');
|
||||
try{const assessed=amount(l.assessed),used=amount(l.previouslyUsed);if(units(used)>units(assessed))throw Error();r.available=subtractFractions(assessed,used);}catch{issues.push('Apuramento fiscal e utilização anterior devem ser montantes conhecidos não negativos e coerentes.');}
|
||||
try{r.requestedAmount=amount(l.requested);if(r.available&&units(r.requestedAmount)>units(r.available))issues.push('Utilização proposta excede saldo fiscal disponível.');}catch{issues.push('Identifique utilização proposta,não negativa,mesmo quando zero.');}
|
||||
if(l.annualPeriods==='yes'&&/^20\d{2}$/.test(l.year))r.lastOrdinaryYear=Number(l.year)+5;
|
||||
if(!issues.length){if((r.lastOrdinaryYear!<Number(year))||i.unchangedObject==='no'){
|
||||
r.status='excluded';r.reason=r.lastOrdinaryYear!<Number(year)?'Prazo dos cinco exercícios ordinários posteriores expirado (41(1));saldo não utilizável neste exercício.':'Objecto/natureza alterados conforme declaração;dedução41(1)não aplicável (41(7)).';
|
||||
if(units(r.requestedAmount!)!==0n)issues.push('Perda excluída com utilização positiva proposta;corrija a proposta sem dedução presumida.');
|
||||
}else{r.status='eligible';r.reason='Saldo fiscal ordinário documentado,mesmo sujeito,cinco exercícios posteriores;utilização escolhida explicitamente,sem ordemFIFO ou percentagem presumida.';}}
|
||||
if(issues.length){r.status='indeterminate';r.reason=issues.join(' ');pending.push(l.year+': '+r.reason);}
|
||||
losses.push(r);
|
||||
}
|
||||
if(short&&losses.some(l=>l.requestedAmount&&BigInt(l.requestedAmount.numerator)>0n))pending.push('Período curto:sequência dos períodos posteriores por reconciliar;41(5) exclui da contagem o período de transição7(4)d inferior a6meses,sem agregar todos os períodos curtos ou presumir prazo por ano civil.');
|
||||
const requestedLosses=addFractions(losses.filter(l=>l.status==='eligible').map(l=>l.requestedAmount!));
|
||||
if(profit&&BigInt(requestedLosses.numerator)*BigInt(profit.denominator)>(BigInt(profit.numerator)>0n?BigInt(profit.numerator)*BigInt(requestedLosses.denominator):0n))pending.push('Utilizações propostas excedem o lucro tributável disponível;reparta explicitamente sem criar base negativa ou escolher uma ordem de perdas.');
|
||||
let benefitDeduction:FiscalFraction|null=null;const benefit=i.benefits;
|
||||
if(!benefit.state||!benefit.reference.trim())pending.push('Benefícios/deduções à matéria colectável por identificar (15(4));créditos à colecta e retenções não são esta dedução.');
|
||||
else if(benefit.state==='absent'){if(benefit.amount.trim())pending.push('Ausência de benefícios contradiz montante preenchido.');else benefitDeduction=zero();}
|
||||
else{try{const value=amount(benefit.amount);if(units(value)!==0n)pending.push('Benefício de montante conhecido:regra,condições,limite e ordem próprios por implementar;sem subtracção livre do valor.');else benefitDeduction=value;}catch{pending.push('Montante conhecido das deduções por preencher ou inválido.');}}
|
||||
const ready=pending.length===0&&profit!==null,deductedLosses=ready?requestedLosses:null,taxableBase=ready?subtractFractions(subtractFractions(BigInt(profit!.numerator)<0n?zero():profit!,requestedLosses),benefitDeduction!):null;
|
||||
for(const l of losses){if(l.available){l.deducted=ready?(l.status==='eligible'?l.requestedAmount!:zero()):null;l.remaining=l.deducted?subtractFractions(l.available,l.deducted):null;}}
|
||||
return{input:i,taxableProfit:profit,requestedLosses,deductedLosses,benefitDeduction,taxableBase,losses,pending,source:'CIRPC15(1)a/15(2–4),41(1–7),Lei34/2007 PDF5/p768(59),PDF12/p768(66). Recorte2026,residente geral,método declarativo,perdas próprias em exercícios anuais ordinários;cinco exercícios posteriores,sem transferência41-A,regimes especiais ou benefícios positivos implementados. Pedido de utilização expresso e limitado ao saldo/lucro;semFIFO obrigatório ou limite percentual inventado. Matéria colectável simulada,não colecta/imposto a pagar,semM20/M22/submissão ou consumo persistente do saldo oficial.'};
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
import {addFractions,fraction,subtractFractions,fractionPresentation,type FiscalFraction} from './fiscal-rational.ts';
|
||||
import {fiscalMoney} from './irpc-normal-schedules.ts';
|
||||
export const normalCostsVersion='IRPC-normal-adjustments/6';
|
||||
export const costRules={
|
||||
allowance:['Ajudas de custo/deslocação em viatura própria','expenseCorrections','36(1)e'],
|
||||
representation:['Despesas de representação','expenseCorrections','36(1)f/36(3)'],
|
||||
advertising:['Publicidade ordinária — limite anual partilhado','expenseCorrections','36(1)n,Lei20/2009'],
|
||||
vehicle:['Outros encargos com viatura ligeira de passageiros','expenseCorrections','36(4)'],
|
||||
fuel:['Combustível — prova do activo/locação e consumo normal','expenseCorrections','36(1)i/36(4)'],
|
||||
rental:['Aluguer sem condutor — parcela de quota não aceite documentada','expenseCorrections','36(1)h/36(4)'],
|
||||
credit:['Provisão/perda por imparidade de créditos ordinários','expenseCorrections','28(1)a/29'],
|
||||
stock:['Provisão/perda por imparidade de existências','expenseCorrections','28(1)b'],
|
||||
litigation:['Provisão para processo judicial em curso','expenseCorrections','28(1)c'],
|
||||
provision_reversal:['Reversão de provisão antes deduzida','incomeCorrections','28(2)'],
|
||||
taxed_reversal:['Reversão contabilística de provisão antes tributada','incomeCorrections','17/28;sem dupla tributação da parcela comprovada'],
|
||||
prior_cost:['Custo de exercício anterior incluído no resultado actual','timing','18(2)'],
|
||||
prior_income:['Proveito de exercício anterior incluído no resultado actual','timing','18(2)'],
|
||||
estimated_work_loss:['Perda estimada em obra plurianual em curso','expenseCorrections','36(1)m,Lei20/2009'],
|
||||
work:['Resultado de obra plurianual — percentagem/encerramento','timing','19(1–6)'],
|
||||
}as const;
|
||||
export type CostRule=keyof typeof costRules;
|
||||
export type CostRow={id:string;rule:''|CostRule;document:string;line:string;amount:string;sourceCode:string;reference:string;conditions:''|'yes';facts:Record<string,string>};
|
||||
export type NormalCostsInput={version:1;rows:CostRow[];advertisingReference:string;salesOrdinary:''|'yes';creditBase:string;creditPrevious:string;creditReference:string;creditRegime:''|'ordinary'|'regulated'};
|
||||
export const newNormalCosts=():NormalCostsInput=>({version:1,rows:[],advertisingReference:'',salesOrdinary:'',creditBase:'',creditPrevious:'',creditReference:'',creditRegime:''});
|
||||
export const newCostRow=(id:string):CostRow=>({id,rule:'',document:'',line:'',amount:'',sourceCode:'',reference:'',conditions:'',facts:{}});
|
||||
export function validateNormalCosts(i:NormalCostsInput){
|
||||
if(!i||i.version!==1||!Array.isArray(i.rows)||['advertisingReference','creditBase','creditPrevious','creditReference'].some(k=>typeof i[k as 'creditBase']!=='string')||!['','yes'].includes(i.salesOrdinary)||!['','ordinary','regulated'].includes(i.creditRegime))throw Error('Mapa de custos/provisões/periodização não recuperável.');
|
||||
if(new Set(i.rows.map(r=>r.id)).size!==i.rows.length)throw Error('Identificador repetido no mapa de custos.');
|
||||
for(const r of i.rows)if(!r||['id','rule','document','line','amount','sourceCode','reference','conditions'].some(k=>typeof r[k as 'id']!=='string')||r.rule!==''&&!Object.hasOwn(costRules,r.rule)||!['','yes'].includes(r.conditions)||!r.facts||typeof r.facts!=='object'||Array.isArray(r.facts)||Object.values(r.facts).some(v=>typeof v!=='string'))throw Error('Linha de custos/provisões/periodização não recuperável.');
|
||||
}
|
||||
type Source={currency:string;accountingLines:Array<{code:string;total:string;accountingEffect:string}>;cashSchedule?:Array<{salesReceivablesBalance:string|null;openingReceivablesBalance:string}>};
|
||||
export type CostClaim={document:string;line:string;sourceCode:string;amount:string};
|
||||
const z=()=>fraction(0n),cmp=(a:FiscalFraction,b:FiscalFraction)=>BigInt(a.numerator)*BigInt(b.denominator)-BigInt(b.numerator)*BigInt(a.denominator);
|
||||
const mul=(a:FiscalFraction,n:bigint,d=1n)=>fraction(BigInt(a.numerator)*n,BigInt(a.denominator)*d);
|
||||
const min=(...v:FiscalFraction[])=>v.reduce((a,b)=>cmp(a,b)<0n?a:b),max0=(v:FiscalFraction)=>cmp(v,z())<0n?z():v;
|
||||
const costMoney=(v:FiscalFraction|null)=>{if(!v)return'Indeterminado';const p=fractionPresentation(v);return(p.approximate?'≈':'')+p.decimal+' MZN'+(p.approximate?' (exacto '+v.numerator+'/'+v.denominator+')':'');};
|
||||
const identity=(r:{document:string;line:string})=>r.document.trim()+'\u0000'+r.line.trim();
|
||||
export function reusableCreditBalance(source:Source|null){const l=source?.cashSchedule?.at(-1);if(!l||l.salesReceivablesBalance===null)return null;try{return addFractions([fiscalMoney(l.salesReceivablesBalance),fiscalMoney(l.openingReceivablesBalance)]);}catch{return null;}}
|
||||
export function calculateNormalCosts(input:NormalCostsInput,source:Source|null,existing:CostClaim[],period:{from:string;to:string},short=false){
|
||||
validateNormalCosts(input);const rows=input.rows,claims=rows.flatMap(r=>[{...r},...(r.rule==='work'?[{id:r.id,document:r.document,line:r.line+'/custos',sourceCode:r.facts.costSource??'',amount:r.facts.bookCost??''}]:[])]),pending:string[]=[];
|
||||
const sourceAmount=(code:string,effect:string)=>{const l=source?.accountingLines.find(l=>l.code===code);if(!l||l.accountingEffect!==effect)throw Error('Seleccione uma linha contabilística compatível.');return fiscalMoney(l.total);};
|
||||
const pool=(rule:CostRule)=>addFractions(rows.filter(r=>r.rule===rule).map(r=>fiscalMoney(r.amount)));
|
||||
const pools:Record<string,{label:string;base:FiscalFraction;previous:FiscalFraction|null;annualLimit:FiscalFraction;accumulatedLimit:FiscalFraction|null;reference:string}>={};
|
||||
const results=rows.map(r=>{const issues:string[]=[],rule=r.rule?costRules[r.rule]:null,topic=rule?.[1]??'',f=r.facts;let amount:FiscalFraction|null=null,accepted:FiscalFraction|null=null,adjustment:FiscalFraction|null=null,limit:FiscalFraction|null=null;const details:string[]=[];
|
||||
const a=(key:string)=>{if(!f[key]?.trim())throw Error('Falta parâmetro: '+(factLabels[key]??key));return fiscalMoney(f[key]);};
|
||||
const yesno=(key:string)=>{if(!['yes','no'].includes(f[key]))throw Error('Falta condição documentada: '+(factLabels[key]??key));return f[key]==='yes';};
|
||||
const ref=(key:string)=>{if(!f[key]?.trim())throw Error('Falta suporte: '+(factLabels[key]??key));};
|
||||
const balance=()=>{ref('balanceKey');if(rows.some(q=>q!==r&&q.facts.balanceKey===f.balanceKey))throw Error('Saldo/objecto fiscal repetido entre linhas; agregue as parcelas no mesmo mapa para não reutilizar o limite.');return a('previous');};
|
||||
const checkOrigin=(code:string,value:FiscalFraction,effect:string)=>{if(cmp(value,z())===0n&&!code)return;if(['depreciation','interest_expense'].includes(code))throw Error('Parcela de amortização/juros exige reconciliação própria com o mapa existente; sem dupla qualificação neste incremento.');const total=sourceAmount(code,effect);const allocated=addFractions([...existing,...claims].filter(c=>c.sourceCode===code).map(c=>fiscalMoney(c.amount)));if(cmp(allocated,total)>0n)throw Error('Parcelas dos mapas excedem a linha de origem; reconcilie sem duplicar ajustamentos.');};
|
||||
if(!rule||!r.document.trim()||!r.line.trim()||!r.reference.trim()||r.conditions!=='yes')issues.push('Regra, documento/linha, condições e suporte em falta.');
|
||||
if([...existing,...claims.filter(c=>c!==r&&c.id!==r.id)].some(c=>identity(c)===identity(r)))issues.push('Documento/linha repetidos entre mapas.');
|
||||
if(claims.filter(c=>identity(c)===identity(r)).length>1)issues.push('Documento/linha repetidos no mapa.');
|
||||
if(short&&['credit','advertising'].includes(r.rule))issues.push('Limite anual neste período curto por corresponder;sem proporcionalização ou anualização presumida.');
|
||||
if(source?.currency!=='MZN'||!period.to.startsWith('2026-'))issues.push('Recorte anual emMZN com termo em2026 por reconciliar.');
|
||||
try{amount=fiscalMoney(r.amount);if(cmp(amount,z())<=0n&&r.rule!=='work')throw Error('Identifique parcela positiva conhecida.');
|
||||
const isIncome=['provision_reversal','taxed_reversal','prior_income','work'].includes(r.rule);const omitted=r.rule==='provision_reversal'&&f.inResult==='no';if(!omitted)checkOrigin(r.sourceCode,amount,isIncome?'income':'expense');else if(r.sourceCode)throw Error('Reversão não incluída no resultado não deve repetir uma linha de proveitos.');
|
||||
switch(r.rule){
|
||||
case 'allowance':{const billed=a('billed'),taxed=a('taxedNotBilled');if(cmp(addFractions([billed,taxed]),amount)>0n)throw Error('Parcelas facturadas e tributadas emIRPS não podem sobrepor-se ou exceder o encargo.');const limited=subtractFractions(subtractFractions(amount,billed),taxed);adjustment=mul(limited,1n,2n);accepted=subtractFractions(amount,adjustment);limit=mul(limited,1n,2n);details.push('50% só da parcela não facturada a clientes nem tributada emIRPS; parcelas mutuamente exclusivas.');break;}
|
||||
case 'representation':accepted=mul(amount,1n,5n);adjustment=subtractFractions(amount,accepted);details.push('20% aceite;80% acrescido. Eventual tributação autónoma não calculada, âmbitoL7.');break;
|
||||
case 'advertising':{if(f.campaign!=='no')throw Error('Campanha de lançamento com horizonte superior a um ano: periodização36-A e articulação do limite não correspondidas; não tratar como publicidade ordinária.');if(input.salesOrdinary!=='yes'||!input.advertisingReference.trim())throw Error('Confirme completude da publicidade e correspondência do volume de vendas normal do exercício à receita declarada.');const total=pool('advertising');limit=mul(sourceAmount('revenue','income'),1n,100n);pools.advertising={label:'Publicidade — limite anual partilhado',base:sourceAmount('revenue','income'),previous:null,annualLimit:limit,accumulatedLimit:null,reference:input.advertisingReference};const eligible=min(total,limit);accepted=fraction(BigInt(amount.numerator)*BigInt(eligible.numerator)*BigInt(total.denominator),BigInt(amount.denominator)*BigInt(eligible.denominator)*BigInt(total.numerator));adjustment=subtractFractions(amount,accepted);details.push('Limite único anual1% das vendas normais; repartição aritmética proporcional entre parcelas para a simulação, sem ordem fiscal obrigatória.');break;}
|
||||
case 'vehicle':{if(!yesno('passenger')){accepted=amount;details.push('Viatura fora da categoria ligeira de passageiros;36(4)não aplicado, restantes condições ordinárias documentadas.');}else{accepted=yesno('publicOrRental')?amount:mul(amount,1n,2n);details.push('50% dos outros encargos de passageiros, excepto serviço público de transportes/locação na actividade normal; não inclui quotas, aluguer sem condutor ou combustível já discriminados.');}adjustment=subtractFractions(amount,accepted);break;}
|
||||
case 'fuel':case 'rental':{let eligible:FiscalFraction;if(r.rule==='fuel'){eligible=a('supportedNormal');if(cmp(eligible,amount)>0n)throw Error('Consumo normal comprovado excede o encargo.');details.push('36i: parcela ligada a activo próprio/locado e consumo normal comprovados.');}else{const excluded=a('nonAcceptedQuota');ref('quotaReference');if(cmp(excluded,amount)>0n)throw Error('Parcela de quota não aceite excede a renda.');eligible=subtractFractions(amount,excluded);details.push('36h: reutiliza parcela de quota não aceite documentada; o portal não apura automaticamente essa quota de viatura.');}if(yesno('passenger')&&!yesno('publicOrRental')){if(cmp(eligible,amount)!==0n)throw Error('Articulação da parcela excluída por36h/i com os50% de36(4) ainda não correspondida; este caso combinado fica pendente, sem somar nem repartir correcções por presunção.');eligible=mul(eligible,1n,2n);details.push('36(4):50% do encargo; sem parcela excluída concorrente porh/i.');}accepted=eligible;adjustment=subtractFractions(amount,accepted);break;}
|
||||
case 'credit':{if(input.creditRegime!=='ordinary')throw Error('Regime das provisões por identificar ou sujeito a supervisão financeira/seguradora28d; sem limites29 aplicados por aproximação.');if(!input.creditReference.trim())throw Error('Saldo de créditos ordinários e provisão fiscal anterior por documentar.');if(!input.creditBase.trim())throw Error('Créditos ordinários existentes no fim do exercício em falta.');if(!input.creditPrevious.trim())throw Error('Provisão fiscal anterior dos créditos em falta; não presumir zero.');const base=fiscalMoney(input.creditBase),previous=fiscalMoney(input.creditPrevious),total=pool('credit'),annual=mul(base,15n,1000n),accumulated=mul(base,6n,100n);pools.credit={label:'Créditos — limites anual e acumulado',base,previous,annualLimit:annual,accumulatedLimit:accumulated,reference:input.creditReference};if(cmp(previous,accumulated)>0n)throw Error('Provisão fiscal anterior excede6% dos créditos finais; reconcilie subsistência/reversão28(2), sem saldo presumido.');limit=min(annual,subtractFractions(accumulated,previous));const eligible=min(total,limit);accepted=fraction(BigInt(amount.numerator)*BigInt(eligible.numerator)*BigInt(total.denominator),BigInt(amount.denominator)*BigInt(eligible.denominator)*BigInt(total.numerator));adjustment=subtractFractions(amount,accepted);details.push('29:1,5% anual,6% acumulado sobre créditos da actividade normal existentes no fim; saldo fiscal anterior conhecido. Repartição proporcional do limite único, sem consumir saldo oficial.');break;}
|
||||
case 'stock':case 'litigation':{let previous:FiscalFraction;if(r.rule==='litigation'){if(!yesno('caseOngoing')){accepted=z();adjustment=amount;details.push('Não há processo judicial em curso; provisão não elegível por28c.');break;}if(!yesno('chargeDeductible')){accepted=z();adjustment=amount;details.push('Obrigação não daria lugar a custo dedutível; provisão não aceite por28c.');break;}}else if(!yesno('lossObserved')){accepted=z();adjustment=amount;details.push('Perda de valor não efectivamente observada; estimativa não aceite por28b.');break;}previous=balance();limit=a(r.rule==='stock'?'observedLoss':'obligation');if(cmp(previous,limit)>0n)throw Error('Saldo fiscal anterior excede a cobertura actual; reconcilie a reversão28(2).');accepted=min(amount,subtractFractions(limit,previous));adjustment=subtractFractions(amount,accepted);details.push(r.rule==='stock'?'28b:limite das perdas efectivamente observadas, incluindo saldo anterior.':'28c:obrigações de processo judicial em curso que seriam custos dedutíveis, com saldo anterior reconciliado.');break;}
|
||||
case 'provision_reversal':case 'taxed_reversal':{const previous=balance();if(cmp(amount,previous)>0n)throw Error('Reversão excede a parcela fiscal anterior demonstrada.');if(!yesno('eventEnded'))throw Error('Evento não cessou/não houve utilização diferente; fundamento da reversão por corresponder.');const inResult=yesno('inResult');if(r.rule==='taxed_reversal'&&!inResult)throw Error('Só excluir proveito de reversão já incluído na contabilidade e antes não deduzido.');accepted=amount;adjustment=r.rule==='taxed_reversal'?mul(amount,-1n):inResult?z():amount;details.push(r.rule==='taxed_reversal'?'Parcela antes tributada comprovada; exclui a reversão contabilística sem duplicar dedução.':'28(2):proveito da provisão antes deduzida; só acresce quando ainda não incluído no resultado.');break;}
|
||||
case 'prior_cost':case 'prior_income':{if(!/^20\d{2}$/.test(f.originalYear)||Number(f.originalYear)>=2026)throw Error('Exercício de origem deve ser anterior ao exercício actual.');ref('closingEvidence');const unknown=yesno('unknownAtClose');accepted=unknown?amount:z();adjustment=unknown?z():r.rule==='prior_cost'?amount:mul(amount,-1n);details.push(unknown?'18(2):imprevisível ou manifestamente desconhecido no encerramento anterior; imputável ao actual.':'18(2):conhecido/previsível no encerramento anterior; excluído do actual, sem alterar declarações/históricos anteriores.');break;}
|
||||
case 'estimated_work_loss':accepted=z();adjustment=amount;details.push('36m:perda meramente estimada em obra em curso não dedutível; custo efectivo não confundido com estimativa.');break;
|
||||
case 'work':{const price=a('price'),totalCost=a('totalCost'),incurred=a('incurred'),priorRevenue=a('priorRevenue'),priorCost=a('priorCost'),bookCost=a('bookCost');ref('projectKey');if(rows.some(q=>q!==r&&q.facts.projectKey===f.projectKey))throw Error('Obra repetida; agregue os valores acumulados sem duplicar resultados.');checkOrigin(f.costSource??'',bookCost,'expense');if(cmp(totalCost,z())<=0n||cmp(incurred,totalCost)>0n||cmp(priorCost,incurred)>0n||cmp(priorRevenue,price)>0n)throw Error('Preço, custo total, incorrido e valores fiscais anteriores incoerentes.');if(!yesno('consistentMethod'))throw Error('Mudança de critério exige correspondência à autorização19(6).');const mandatory=yesno('partialBilling')||yesno('ownFractionalDelivery');let revenue:FiscalFraction,cost:FiscalFraction;
|
||||
if(f.method==='percentage'){revenue=fraction(BigInt(price.numerator)*BigInt(incurred.numerator)*BigInt(totalCost.denominator),BigInt(price.denominator)*BigInt(incurred.denominator)*BigInt(totalCost.numerator));cost=incurred;}
|
||||
else if(f.method==='closing'){if(mandatory)throw Error('Facturação parcial com acabamento correspondente/entrega fraccionada: critério da percentagem obrigatório19(2).');const concluded=cmp(mul(incurred,100n),mul(totalCost,95n))>=0n||yesno('publicReception');revenue=concluded?price:z();cost=concluded?incurred:z();}
|
||||
else throw Error('Seleccione percentagem de acabamento ou encerramento.');if(cmp(priorRevenue,revenue)>0n||cmp(priorCost,cost)>0n)throw Error('Acumulados fiscais anteriores excedem o resultado reconhecível pelo critério; reconcilie sem correcção retrospectiva presumida.');const deferred=a('deferredReceipt');if(cmp(deferred,z())!==0n)throw Error('Receita antecipada19(5) de montante não zero exige correspondência própria.');const currentRevenue=subtractFractions(revenue,priorRevenue),currentCost=subtractFractions(cost,priorCost);accepted=currentCost;adjustment=addFractions([subtractFractions(currentRevenue,amount),subtractFractions(bookCost,currentCost)]);limit=currentRevenue;details.push('19:grau=incorrido/custo total;valores fiscais do exercício obtidos dos acumulados menos o já reconhecido. Proveito fiscal corrente:'+costMoney(currentRevenue)+';custo fiscal corrente:'+costMoney(currentCost)+';sem imposto/pagamento ou perda estimada presumidos.');break;}
|
||||
default:throw Error('Categoria por identificar.');
|
||||
}
|
||||
}catch(e){issues.push(e instanceof Error?e.message:String(e));accepted=null;adjustment=null;}
|
||||
if(issues.length){accepted=null;adjustment=null;pending.push((r.document||r.id)+': '+issues.join(' '));}return{...structuredClone(r),topic,amountValue:amount,accepted,adjustment,limit,status:issues.length?'indeterminate' as const:'calculated' as const,reason:issues.join(' ')||details.join(' '),ruleSource:rule?'CIRPC'+rule[2]:''};
|
||||
});
|
||||
return{input:structuredClone(input),rows:results,pools,pending,effects:results.map(r=>({id:r.id,topic:r.topic,amount:r.amountValue,effect:r.adjustment,reason:r.reason})),net:addFractions(results.flatMap(r=>r.adjustment?[r.adjustment]:[])),source:'CIRPC18(2)/19/28/29/36;Lei34/2007,Lei20/2009,alterações4/2012 e19/2013 e diplomas posteriores inventariados. Recorte2026/MZN,condições documentadas,sem efeitos retroactivos ou consumo de saldos oficiais;L7/L8 separados.'};
|
||||
}
|
||||
export type NormalCostsModel=ReturnType<typeof calculateNormalCosts>;
|
||||
const factLabels:Record<string,string>={billed:'Facturado a clientes',taxedNotBilled:'Tributado emIRPS e não facturado',campaign:'Campanha plurianual',passenger:'Ligeira de passageiros',publicOrRental:'Serviço público/locação na actividade normal',supportedNormal:'Consumo normal comprovado',nonAcceptedQuota:'Quota não aceite documentada',quotaReference:'Suporte da quota',balanceKey:'Identificação do saldo/objecto',previous:'Parcela fiscal anterior',lossObserved:'Perda efectivamente observada',observedLoss:'Perda total observada',caseOngoing:'Processo judicial em curso',chargeDeductible:'Obrigação fiscalmente dedutível',obligation:'Obrigação coberta',eventEnded:'Evento cessou/utilização diferente',inResult:'Incluído no resultado',originalYear:'Exercício de origem',unknownAtClose:'Imprevisível/desconhecido no encerramento',closingEvidence:'Suporte do encerramento',projectKey:'Obra',method:'Critério',price:'Preço',totalCost:'Custo total estimado',incurred:'Custos incorporados acumulados',priorRevenue:'Proveitos fiscais anteriores',priorCost:'Custos fiscais anteriores',costSource:'Origem dos custos',bookCost:'Custo contabilizado corrente',partialBilling:'Facturação parcial com acabamento correspondente',ownFractionalDelivery:'Venda/entrega fraccionada por conta própria',consistentMethod:'Critério uniforme e mantido',publicReception:'Recepção provisória pública',deferredReceipt:'Receita antecipada proposta'};
|
||||
const originLabels:Record<string,string>={revenue:'Receitas do plano',cost_of_sales:'Custo das vendas',operating_expenses:'Despesas operacionais',personnel:'Pessoal',depreciation:'Depreciação contabilística',interest_expense:'Juros financeiros'};
|
||||
export function normalCostReport(m:NormalCostsModel):Array<[string,string,string,string]>{const money=costMoney;return[['IRPC normal — L6','Custos com limites, provisões e periodização',`Efeito líquido das parcelas resolvidas:${money(m.net)};${m.pending.join(' | ')}`,m.source],...Object.values(m.pools).map(p=>['IRPC normal — L6',p.label,`Base documentada:${money(p.base)};limite anual:${money(p.annualLimit)};saldo fiscal anterior:${p.previous?money(p.previous):'Não aplicável'};limite acumulado:${p.accumulatedLimit?money(p.accumulatedLimit):'Não aplicável'};limite partilhado entre todas as parcelas, sem consumo do saldo oficial.`,p.reference]as[string,string,string,string]),...m.rows.map(r=>['IRPC normal — L6',(r.rule?costRules[r.rule][0]:'Categoria por identificar')+' — '+r.document+'/'+r.line,`Estado:${r.status==='calculated'?'Calculado no recorte':'Informação insuficiente'};montante identificado:${money(r.amountValue)};parcela aceite/custo fiscal ou reversão:${money(r.accepted)};limite/base ou proveito fiscal:${r.limit?money(r.limit):r.status==='calculated'?'Sem limite monetário próprio; ver regra':'Em falta/não aplicável à parcela'};ajustamento com sinal:${money(r.adjustment)};${r.reason}`,`${r.ruleSource};${r.reference};origem:${originLabels[r.sourceCode]??'Fora do resultado, documentado'};parâmetros:${Object.entries(r.facts).filter(([k])=>factLabels[k]).map(([k,v])=>factLabels[k]+': '+(v==='yes'?'Sim':v==='no'?'Não':v==='percentage'?'Percentagem de acabamento':v==='closing'?'Encerramento':originLabels[v]??(v||'Em falta'))).join('; ')};sem alteração do histórico ou saldo oficial.`]as[string,string,string,string])];}
|
||||
@@ -1,84 +0,0 @@
|
||||
import {addFractions,decimalFraction,fraction,subtractFractions,fractionPresentation,type FiscalFraction} from './fiscal-rational.ts';
|
||||
import {fiscalMoney,type NormalAsset} from './irpc-normal-schedules.ts';
|
||||
export const normalDepreciationVersion='IRPC-normal-adjustments/7';
|
||||
export const depreciationCatalog={
|
||||
computer:{label:'Computadores, impressoras, UPS e material informático',table:'II',code:'3/9',rate:'25',kind:'equipment',page:17},
|
||||
server:{label:'Servidores',table:'II',code:'3/9.1',rate:'20',kind:'equipment',page:17},
|
||||
security:{label:'Equipamento de vigilância e segurança',table:'II',code:'3/23',rate:'20',kind:'equipment',page:18},
|
||||
machine:{label:'Máquinas não especificadas',table:'II',code:'3/22',rate:'10',kind:'equipment',page:18},
|
||||
furniture:{label:'Mobiliário',table:'II',code:'5/7',rate:'10',kind:'furniture',page:18},
|
||||
commercial_building:{label:'Edifícios comerciais e administrativos',table:'II',code:'1/2.2',rate:'2',kind:'building',page:16},
|
||||
passenger_vehicle:{label:'Veículos automóveis ligeiros e mistos',table:'II',code:'4/9.2',rate:'25',kind:'vehicle',page:18},
|
||||
software:{label:'Programas de computadores',table:'II',code:'5/8',rate:'25',kind:'software',page:18},
|
||||
hotel_decoration:{label:'Decorações interiores — hotéis e actividades similares, classe84.2',table:'I',code:'84.2/B',rate:'20',kind:'furniture',page:16},
|
||||
laundry_machine:{label:'Maquinaria específica de lavandarias/tinturarias',table:'I',code:'84.3/A',rate:'12.5',kind:'equipment',page:16},
|
||||
}as const;
|
||||
export type DepreciationCategory=keyof typeof depreciationCatalog;
|
||||
export type DepreciationAsset={id:string;assetKey:string;description:string;document:string;line:string;category:''|DepreciationCategory|'other'|'nondepreciable';valuation:''|'historical_new'|'used'|'revalued'|'other';specificRate:''|'yes'|'no';method:''|'constant'|'declining'|'low_value';rate:string;factor:string;timing:''|'annual'|'months';start:string;exitState:''|'absent'|'known';exitDate:string;cost:string;land:string;residual:string;accounting:string;previousAccounting:string;previousFiscal:string;priorAvailable:string;previousReference:string;newTangible:''|'yes'|'no';consistentMethod:''|'yes'|'no';switchToStraight:''|'yes'|'no';priorFullQuotas:''|'yes'|'no';vehicleException:''|'yes'|'no';limitedRights:''|'yes'|'no';individual:''|'yes'|'no';conditions:''|'yes';reference:string};
|
||||
export type NormalDepreciationInput={version:1;completenessReference:string;assets:DepreciationAsset[]};
|
||||
export const newNormalDepreciation=():NormalDepreciationInput=>({version:1,completenessReference:'',assets:[]});
|
||||
export const newDepreciationAsset=(id:string):DepreciationAsset=>({id,assetKey:'',description:'',document:'',line:'',category:'',valuation:'',specificRate:'',method:'',rate:'',factor:'',timing:'',start:'',exitState:'',exitDate:'',cost:'',land:'',residual:'',accounting:'',previousAccounting:'',previousFiscal:'',priorAvailable:'',previousReference:'',newTangible:'',consistentMethod:'',switchToStraight:'',priorFullQuotas:'',vehicleException:'',limitedRights:'',individual:'',conditions:'',reference:''});
|
||||
export function reuseNormalAssets(assets:NormalAsset[]):NormalDepreciationInput{return{version:1,completenessReference:'',assets:assets.map(a=>({...newDepreciationAsset(a.id),assetKey:a.id,description:a.description,category:a.category,document:a.reference,line:a.id,method:'constant',timing:'annual',specificRate:'no',consistentMethod:'yes',conditions:a.conditions,rate:a.rate,cost:a.cost,residual:a.residual,accounting:a.accounting,previousFiscal:a.previousFiscal,start:a.inUseFrom,reference:a.reference}))};}
|
||||
export function validateNormalDepreciation(i:NormalDepreciationInput){
|
||||
if(!i||i.version!==1||typeof i.completenessReference!=='string'||!Array.isArray(i.assets)||new Set(i.assets.map(a=>a.id)).size!==i.assets.length)throw Error('Mapa de amortizações não recuperável.');
|
||||
for(const a of i.assets){if(!a||Object.keys(newDepreciationAsset('')).some(k=>typeof a[k as keyof DepreciationAsset]!=='string')||!['','other','nondepreciable',...Object.keys(depreciationCatalog)].includes(a.category)||!['','historical_new','used','revalued','other'].includes(a.valuation)||!['','constant','declining','low_value'].includes(a.method)||!['','annual','months'].includes(a.timing)||!['','absent','known'].includes(a.exitState)||!['','yes'].includes(a.conditions)||['specificRate','newTangible','consistentMethod','switchToStraight','priorFullQuotas','vehicleException','limitedRights','individual'].some(k=>!['','yes','no'].includes(a[k as 'specificRate'])))throw Error('Activo ou parâmetros de amortização não recuperáveis.');}
|
||||
}
|
||||
const zero=()=>fraction(0n),cmp=(a:FiscalFraction,b:FiscalFraction)=>BigInt(a.numerator)*BigInt(b.denominator)-BigInt(b.numerator)*BigInt(a.denominator);
|
||||
const min=(...a:FiscalFraction[])=>a.reduce((v,w)=>cmp(v,w)<0n?v:w),positive=(a:FiscalFraction)=>cmp(a,zero())<0n?zero():a;
|
||||
const multiply=(a:FiscalFraction,b:FiscalFraction)=>fraction(BigInt(a.numerator)*BigInt(b.numerator),BigInt(a.denominator)*BigInt(b.denominator));
|
||||
const ratio=(a:FiscalFraction,b:FiscalFraction)=>fraction(BigInt(a.numerator)*BigInt(b.denominator),BigInt(a.denominator)*BigInt(b.numerator));
|
||||
const date=(v:string)=>/^20\d{2}-\d{2}-\d{2}$/.test(v)&&Number.isFinite(Date.parse(v))&&new Date(v).toISOString().slice(0,10)===v;
|
||||
const month=(v:string)=>Number(v.slice(0,4))*12+Number(v.slice(5,7))-1;
|
||||
const show=(v:FiscalFraction|null)=>{if(!v)return'Indeterminado';const p=fractionPresentation(v);return(p.approximate?'≈':'')+p.decimal+' MZN'+(p.approximate?' (exacto '+v.numerator+'/'+v.denominator+')':'');};
|
||||
export function calculateNormalDepreciation(input:NormalDepreciationInput,source:{currency:string;accountingLines:Array<{code:string;total:string}>}|null,period:{from:string;to:string},claims:Array<{sourceCode:string;document:string;line:string;amount:string}>,short=false,acceleratedIds:ReadonlySet<string>=new Set()){
|
||||
validateNormalDepreciation(input);const pending:string[]=[];
|
||||
if(!input.completenessReference.trim())pending.push('Reconciliação integral dos activos e quotas anteriores com a depreciação da origem em falta.');
|
||||
if(source?.currency!=='MZN'||!date(period.from)||!date(period.to)||!period.to.startsWith('2026-')||(!short&&month(period.to)-month(period.from)!==11||short&&(month(period.to)<month(period.from)||month(period.to)-month(period.from)>=11)))pending.push('Período anual emMZN com termo em2026 por reconciliar; períodos curtos permanecem separados.');
|
||||
const assets=input.assets.map(a=>{const issues:string[]=[],notes:string[]=[];let accounting:FiscalFraction|null=null,basis:FiscalFraction|null=null,taxBasis:FiscalFraction|null=null,quota:FiscalFraction|null=null,deduction:FiscalFraction|null=null,adjustment:FiscalFraction|null=null,priorUsed:FiscalFraction|null=null,priorRemaining:FiscalFraction|null=null,remainingFiscal:FiscalFraction|null=null,eligibleCurrent:FiscalFraction|null=null,months:number|null=null;const entry=Object.hasOwn(depreciationCatalog,a.category)?depreciationCatalog[a.category as DepreciationCategory]:null;
|
||||
if(short&&a.category!=='nondepreciable'&&(a.timing!=='months'||a.method==='low_value'))issues.push('Período curto exige duodécimos;opção integral art17 neste período por corresponder.');
|
||||
const money=(s:string,label:string)=>{if(!s.trim())throw Error(label+' em falta; não presumir zero.');return fiscalMoney(s);};
|
||||
const yesno=(v:string,label:string)=>{if(!['yes','no'].includes(v))throw Error(label+' por documentar.');return v==='yes';};
|
||||
if(!a.assetKey.trim()||!a.description.trim()||!a.document.trim()||!a.line.trim()||!a.reference.trim()||a.conditions!=='yes')issues.push('Identificação do activo, documento/linha, condições ordinárias e suporte em falta.');
|
||||
if(input.assets.some(b=>b!==a&&(b.assetKey.trim()===a.assetKey.trim()||b.document.trim()===a.document.trim()&&b.line.trim()===a.line.trim()))||claims.some(c=>c.document.trim()===a.document.trim()&&c.line.trim()===a.line.trim()))issues.push('Activo ou documento/linha repetido entre mapas; reconcilie sem dedução duplicada.');
|
||||
try{accounting=money(a.accounting,'Depreciação contabilística corrente');const cost=money(a.cost,'Custo histórico');
|
||||
if(a.category==='nondepreciable'){basis=cost;taxBasis=zero();quota=zero();deduction=zero();adjustment=accounting;notes.push('CIRPC26/27:elemento expressamente qualificado como não sujeito a deperecimento; depreciação contabilística integralmente acrescida.');}
|
||||
else{
|
||||
if(a.valuation!=='historical_new')throw Error('Tipo de aquisição/base por identificar ou fora do recorte de bens novos a custo histórico; usados/abertura de escrita7(2) e reavaliados15 exigem regra própria.');
|
||||
if(!entry)throw Error('Categoria/tabela ainda não correspondida; sem taxa livre ou código provisório.');
|
||||
if(entry){const specific=yesno(a.specificRate,'Existência de taxa específica da tabelaI');if(entry.table==='II'&&specific)throw Error('Taxa específica da tabelaI prevalece; seleccione a categoria específica correspondente.');if(entry.table==='I'&&!specific)throw Error('Categoria específica da tabelaI sem enquadramento documentado.');}
|
||||
if(!date(a.start)||a.start<'2014-01-01')throw Error('Entrada em funcionamento/utilização desde2014 por identificar; activos anteriores exigem correspondência histórica própria.');
|
||||
if(!yesno(a.consistentMethod,'Método uniforme desde o início'))throw Error('Mudança de método/razão excepcional requer correspondência própria do artigo10.');
|
||||
if(a.exitState==='known'&&(!date(a.exitDate)||a.exitDate<a.start)||!a.exitState||a.exitState==='absent'&&a.exitDate.trim())throw Error('Estado/data de transmissão,inutilização ou termo de vida útil incoerente ou em falta.');
|
||||
if(!a.previousReference.trim())throw Error('Suporte das quotas contabilísticas/fiscais anteriores e da parcela temporariamente tributada em falta.');
|
||||
const priorBook=money(a.previousAccounting,'Quotas contabilísticas anteriores'),priorFiscal=money(a.previousFiscal,'Quotas fiscais anteriores'),available=money(a.priorAvailable,'Parcela anterior temporariamente tributada recuperável');
|
||||
if(cmp(priorFiscal,priorBook)>0n||cmp(available,subtractFractions(priorBook,priorFiscal))>0n)throw Error('Quotas anteriores incoerentes; parcela recuperável não pode exceder a diferença contabilizada e não deduzida, excluindo encargos permanentemente não aceites.');
|
||||
const residual=money(a.residual,'Residual'),land=entry?.kind==='building'?money(a.land,'Terreno/parte não depreciável'):zero();if(entry?.kind!=='building'&&a.land.trim()&&cmp(fiscalMoney(a.land),zero())!==0n)throw Error('Terreno não corresponde a esta categoria de activo.');basis=subtractFractions(subtractFractions(cost,residual),land);if(cmp(basis,zero())<=0n)throw Error('Base depreciável positiva por reconciliar.');if(entry?.kind!=='building'&&cmp(land,zero())!==0n)throw Error('Terreno só deve ser separado no imóvel correspondente.');taxBasis=basis;
|
||||
if(entry?.kind==='vehicle'&&!yesno(a.vehicleException,'Afectação a serviço público de transportes/locação na actividade normal')){taxBasis=min(basis,positive(subtractFractions(fraction(800000n),residual)));notes.push('CIRPC27e:limite de aquisição800000MZN,sem afectar a depreciação contabilística de origem.');}
|
||||
if(entry?.kind==='software'&&!yesno(a.limitedRights,'Aquisição onerosa e direitos de utilização exclusiva por tempo limitado'))throw Error('Direitos de software/intangível sem condições do artigo16 documentadas.');
|
||||
if(cmp(priorFiscal,taxBasis)>0n)throw Error('Quotas fiscais anteriores excedem a base fiscal; reconcilie o saldo anterior.');const remaining=subtractFractions(taxBasis,priorFiscal),priorEligibleBook=min(taxBasis,multiply(priorBook,ratio(taxBasis,basis)));if(cmp(available,positive(subtractFractions(priorEligibleBook,priorFiscal)))>0n)throw Error('Parcela anterior recuperável inclui quota permanentemente não aceite ou excede a contabilização fiscalmente elegível.');eligibleCurrent=min(multiply(accounting,ratio(taxBasis,basis)),positive(subtractFractions(taxBasis,priorEligibleBook)));
|
||||
let maxRate:FiscalFraction|null=entry?decimalFraction(entry.rate):null,maxLifeMonths:FiscalFraction|null=maxRate?ratio(fraction(2400n),maxRate):null;
|
||||
if(a.method==='low_value'){if(cmp(cost,fraction(20000n))>0n||!yesno(a.individual,'Activo individual fora de conjunto depreciado como um todo')||cmp(priorFiscal,zero())!==0n||a.start<period.from||a.start>period.to)throw Error('Art17:valor unitário até20000MZN,activo individual e início no período,sem amortização fiscal anterior; condições em falta/incompatíveis.');quota=remaining;months=month(period.to)-month(a.start)+1;notes.push('Art17:opção de depreciação integral em um período,limitada ao que está contabilizado e ao saldo fiscal.');}
|
||||
else{
|
||||
if(!entry||!maxRate||!maxLifeMonths)throw Error('Taxa aplicável não identificada.');
|
||||
if(a.method==='constant'){if(!/^\d+(?:\.\d{1,6})?$/.test(a.rate))throw Error('Taxa constante escolhida por identificar.');const selected=decimalFraction(a.rate);if(cmp(selected,multiply(maxRate,fraction(1n,2n)))<0n||cmp(selected,maxRate)>0n)throw Error('Taxa constante fora do recorte entre metade da máxima e a máxima;quotas inferiores exigem correspondência própria dos limites de vida útil, artigos5/7.');quota=multiply(taxBasis,multiply(selected,fraction(acceleratedIds.has(a.id)?3n:1n,acceleratedIds.has(a.id)?200n:100n)));if(acceleratedIds.has(a.id))notes.push('CBF16:L7 qualificado,incremento50% da taxa normal;mantidos contabilização e saldo fiscal.');notes.push('Quota constante pela taxa escolhida:'+a.rate+'%;tabela'+entry.table+'/'+entry.code+'.');}
|
||||
else if(a.method==='declining'){if(!yesno(a.newTangible,'Activo tangível novo adquirido a terceiros/construído')||['building','furniture','software'].includes(entry.kind)||entry.kind==='vehicle'&&a.vehicleException!=='yes')throw Error('Art6:quotas degressivas só nos activos tangíveis novos elegíveis;edifícios,mobiliário/equipamento social,intangíveis e veículos sem excepção ficam separados.');const life=ratio(fraction(100n),maxRate),maxFactor=cmp(life,fraction(5n))<0n?fraction(3n,2n):cmp(life,fraction(6n))<=0n?fraction(2n):fraction(5n,2n);if(!/^\d+(?:\.\d{1,6})?$/.test(a.factor))throw Error('Coeficiente degressivo escolhido em falta.');const factor=decimalFraction(a.factor);if(cmp(factor,zero())<=0n||cmp(factor,maxFactor)>0n)throw Error('Coeficiente degressivo excede o máximo do artigo8:1,5/2/2,5 conforme vida útil mínima.');quota=multiply(remaining,multiply(maxRate,multiply(factor,fraction(1n,100n))));notes.push('Art8:saldo fiscal por amortizar ×taxa máxima'+entry.rate+'% ×coeficiente'+a.factor+';máximo'+fractionPresentation(maxFactor).decimal+'.');
|
||||
if(yesno(a.switchToStraight,'Opção pela regra de saldo/vida útil restante8(2)')){if(!yesno(a.priorFullQuotas,'Condição das quotas anteriores8(2)')||!a.start.endsWith('-01-01')||period.from!=='2026-01-01'||a.timing!=='annual')throw Error('Art8(2):condição das quotas anteriores por documentar;este recorte da opção exige início emJaneiro e período anual civil.');const remainingYears=subtractFractions(life,fraction(BigInt(2026-Number(a.start.slice(0,4)))));if(cmp(remainingYears,zero())<=0n)throw Error('Art8(2):vida útil mínima esgotada;sem dividir por anos inexistentes.');const linear=ratio(remaining,remainingYears);if(cmp(quota,linear)<0n){quota=linear;notes.push('Art8(2):usado saldo/número de anos de vida útil mínima restantes,com condições anteriores documentadas.');}}
|
||||
}else throw Error('Método de amortização por identificar.');
|
||||
if(!a.timing)throw Error('Opção anual/duodécimos por identificar.');
|
||||
if(a.timing==='annual'){if(a.exitState==='known'&&a.exitDate<=period.to)throw Error('Evento de saída em período anual:seleccione duodécimos e reconcilie a regra aplicável;sem quota anual presumida.');const lifeEnd=month(a.start)+Number(BigInt(maxLifeMonths.numerator)/BigInt(maxLifeMonths.denominator));if(lifeEnd>month(period.from)&&lifeEnd<=month(period.to)&&cmp(remaining,zero())>0n)throw Error('Vida útil máxima termina dentro do período;opção anual e quotas anteriores exigem correspondência própria. Duodécimos em vigor são calculados até ao limite temporal.');months=a.start>period.to?0:12;}
|
||||
else{const start=Math.max(month(period.from),month(a.start)),end=Math.min(month(period.to)+1,a.exitState==='known'?month(a.exitDate):month(period.to)+1,month(a.start)+Number(BigInt(maxLifeMonths.numerator)/BigInt(maxLifeMonths.denominator)));months=Math.max(0,end-start);quota=multiply(quota,fraction(BigInt(months),12n));notes.push('Art9:entrada incluída desde o mês da utilização;saída exclui o mês do evento;'+months+'duodécimos.');}
|
||||
const elapsed=Math.max(0,month(period.from)-month(a.start));if(cmp(fraction(BigInt(elapsed)),maxLifeMonths)>=0n){quota=zero();notes.push('Art5:vida útil máxima esgotada,sem excepção aplicada;nenhuma recuperação de quota fora desse limite.');}else if(a.start>period.to){quota=zero();notes.push('Art3:activo ainda não entrou emuso no período;sem amortização fiscal.');}
|
||||
}
|
||||
deduction=min(quota!,remaining,addFractions([eligibleCurrent,available]));priorUsed=positive(subtractFractions(deduction,eligibleCurrent));priorRemaining=subtractFractions(available,priorUsed);remainingFiscal=subtractFractions(remaining,deduction);adjustment=subtractFractions(accounting,deduction);notes.push('Art3(3):dedução limitada ao contabilizado no período ou antes desde o uso;quotas anteriores recuperáveis usadas:'+show(priorUsed)+';saldo anterior aritmético:'+show(priorRemaining)+'. Sem consumo oficial nem recuperação de quota não contabilizada/permanentemente excluída.');
|
||||
}
|
||||
}catch(e){issues.push(e instanceof Error?e.message:String(e));}
|
||||
if(issues.length){deduction=null;adjustment=null;priorUsed=null;priorRemaining=null;remainingFiscal=null;pending.push((a.description||a.id)+': '+issues.join(' '));}
|
||||
return{...structuredClone(a),catalog:entry,accountingValue:accounting,basis,taxBasis,quota,deduction,adjustment,eligibleCurrent,priorUsed,priorRemaining,remainingFiscal,months,status:issues.length?'indeterminate' as const:'calculated' as const,reason:issues.join(' ')||notes.join(' ')};
|
||||
});
|
||||
let accountingTotal:FiscalFraction|null=null;try{accountingTotal=addFractions(assets.map(a=>{if(!a.accountingValue)throw Error();return a.accountingValue;}));const origin=fiscalMoney(source?.accountingLines.find(l=>l.code==='depreciation')?.total??'');if(cmp(accountingTotal,origin)!==0n)pending.push('Soma das quotas contabilísticas dos activos não corresponde à depreciação financeira declarada.');}catch{pending.push('Depreciação contabilística da origem por reconciliar.');}
|
||||
if(claims.some(c=>c.sourceCode==='depreciation'))pending.push('Depreciação partilhada com outros ajustamentos de origem;reconcilie as parcelas para não duplicar o mesmo encargo.');
|
||||
const knownAdjustment=addFractions(assets.flatMap(a=>a.adjustment?[a.adjustment]:[])),adjustment=pending.length===0?knownAdjustment:null;
|
||||
return{input:structuredClone(input),assets,accountingTotal,knownAdjustment,adjustment,pending,source:'Decreto72/2013,art3–10/16/17,tabelasI/II;CIRPC26/27. Recorte anualMZN com termo2026,custo histórico,sem reavaliação,turnos intensivos,concessões/fusões ou excepções presumidas. Fotografia7;mapa interno,não formulário oficial de amortizações.'};
|
||||
}
|
||||
export type NormalDepreciationModel=ReturnType<typeof calculateNormalDepreciation>;
|
||||
export function normalDepreciationReport(m:NormalDepreciationModel):Array<[string,string,string,string]>{return[['IRPC normal — L6','Amortizações — tabelas, métodos, duodécimos e quotas anteriores',`Quotas contabilísticas:${show(m.accountingTotal)};ajustamento das parcelas conhecidas:${show(m.knownAdjustment)};ajustamento reconciliado:${show(m.adjustment)};${m.pending.join(' | ')}`,m.source],...m.assets.map(a=>['IRPC normal — L6',a.description+' — '+a.document+'/'+a.line,`Estado:${a.status==='calculated'?'Calculado no recorte':'Informação insuficiente'};contabilístico:${show(a.accountingValue)};parcela contabilística elegível:${show(a.eligibleCurrent)};base fiscal:${show(a.taxBasis)};quota calculada:${show(a.quota)};dedução fiscal:${show(a.deduction)};ajustamento com sinal:${show(a.adjustment)};duodécimos:${a.months??'Não aplicável'};quota anterior utilizada:${show(a.priorUsed)};saldo anterior aritmético:${show(a.priorRemaining)};${a.reason}`,`${a.catalog?'Decreto72/2013,tabela'+a.catalog.table+',código'+a.catalog.code+',PDF'+a.catalog.page:'Categoria sem código de tabela aplicado'};${a.reference};quotas anteriores:${a.previousReference};método:${a.method==='constant'?'Constante':a.method==='declining'?'Degressivo':a.method==='low_value'?'Valor reduzido':'Por identificar'};sem alteração dos documentos/saldos oficiais ou históricos.`]as[string,string,string,string])];}
|
||||
@@ -1,84 +0,0 @@
|
||||
import {addFractions,decimalFraction,fraction,fractionPresentation,subtractFractions,type FiscalFraction} from './fiscal-rational.ts';
|
||||
import type {normalFinancialSource} from './irpc-normal.ts';
|
||||
import type {SchedulesModel} from './irpc-normal-schedules.ts';
|
||||
import type {NormalCostsModel} from './irpc-normal-costs.ts';
|
||||
import type {NormalDepreciationModel} from './irpc-normal-depreciation.ts';
|
||||
import type {NormalBaseModel} from './irpc-normal-base.ts';
|
||||
export const normalFormPreparationVersion='IRPC-normal-adjustments/9';
|
||||
export const m20Accounts={
|
||||
'7.1':'Venda de bens','7.2':'Prestação de serviços','7.3':'Investimentos realizados pela própria empresa','7.4':'Reversões do período','7.5':'Rendimentos suplementares','7.6':'Outros rendimentos e ganhos operacionais','7.8':'Rendimentos e ganhos financeiros','7.9':'Ganho por aumento do justo valor',
|
||||
'6.1.1':'Custos dos inventários vendidos ou consumidos','6.2':'Gastos com pessoal','6.3':'Fornecimentos e serviços de terceiros','6.4':'Perda por imparidade / ajustamento','6.5':'Amortizações do período','6.6':'Provisões do período','6.7':'Perda por redução do justo valor','6.8':'Outros gastos e perdas operacionais','6.9':'Gastos e perdas financeiras','8.5':'Imposto sobre o rendimento',
|
||||
}as const;
|
||||
export type FormAllocation={id:string;sourceCode:string;account:''|keyof typeof m20Accounts;amount:string;reference:string};
|
||||
export type NormalFormPreparationInput={version:1;edition:''|'accepted_pdf_and_m20a1';reference:string;completenessReference:string;allocations:FormAllocation[];incomeTax:{state:''|'known'|'absent';amount:string;placement:''|'included'|'outside';reference:string};reducedRate:{state:''|'known'|'absent';reference:string}};
|
||||
export const newNormalFormPreparation=():NormalFormPreparationInput=>({version:1,edition:'',reference:'',completenessReference:'',allocations:[],incomeTax:{state:'',amount:'',placement:'',reference:''},reducedRate:{state:'',reference:''}});
|
||||
export const newFormAllocation=(id:string):FormAllocation=>({id,sourceCode:'',account:'',amount:'',reference:''});
|
||||
const allowed:Record<string,string[]>={revenue:['7.1','7.2','7.3','7.4','7.5','7.6','7.8','7.9'],cost_of_sales:['6.1.1'],personnel:['6.2'],depreciation:['6.5'],interest_expense:['6.9'],operating_expenses:['6.3','6.4','6.6','6.7','6.8','8.5']};
|
||||
export const normalFormAccountsFor=(source:string)=>allowed[source]??[];
|
||||
export function validateNormalFormPreparation(i:NormalFormPreparationInput){
|
||||
if(!i||i.version!==1||!['','accepted_pdf_and_m20a1'].includes(i.edition)||typeof i.reference!=='string'||typeof i.completenessReference!=='string'||!Array.isArray(i.allocations)||new Set(i.allocations.map(a=>a.id)).size!==i.allocations.length||i.allocations.some(a=>!a||Object.keys(newFormAllocation('')).some(k=>typeof a[k as keyof FormAllocation]!=='string')||a.account!==''&&!Object.hasOwn(m20Accounts,a.account))||!i.incomeTax||!['','known','absent'].includes(i.incomeTax.state)||!['','included','outside'].includes(i.incomeTax.placement)||typeof i.incomeTax.amount!=='string'||typeof i.incomeTax.reference!=='string'||!i.reducedRate||!['','known','absent'].includes(i.reducedRate.state)||typeof i.reducedRate.reference!=='string')throw Error('Preparação M20/M22 não recuperável;originais conservados.');
|
||||
}
|
||||
const zero=()=>fraction(0n),neg=(v:FiscalFraction)=>fraction(-BigInt(v.numerator),BigInt(v.denominator)),positive=(v:FiscalFraction)=>BigInt(v.numerator)>=0n;
|
||||
const eq=(a:FiscalFraction,b:FiscalFraction)=>BigInt(a.numerator)*BigInt(b.denominator)===BigInt(b.numerator)*BigInt(a.denominator);
|
||||
function money(s:string){if(!/^\d{1,18}(?:\.\d{1,6})?$/.test(s))throw Error('Montante não negativo conhecido em falta;zero não é presumido.');return decimalFraction(s);}
|
||||
export function normalFormRepresentation(v:FiscalFraction|null,unit:'whole'|'cent'='cent',parentheses=false){
|
||||
if(!v)return{exact:null,display:'Indeterminado',represented:null,ready:false,reason:'Valor em falta;sem zero presumido.'};
|
||||
const n=BigInt(v.numerator),d=BigInt(v.denominator);if(d<=0n)throw Error('Representação racional inválida.');const p=fractionPresentation(v),whole=n%d===0n,cent=n*100n%d===0n;
|
||||
const abs=n<0n?-n:n,scaled=abs*100n/d;const exact=n+'/'+d+' MZN',value=whole?(parentheses&&n<0n?'('+String(-n/d)+')':String(n/d)):unit==='cent'&¢?(n<0n?'-':'')+scaled/100n+'.'+String(scaled%100n).padStart(2,'0'):null;
|
||||
return{exact,display:whole?(value+' MZN'):(p.approximate?'≈':'')+p.decimal+' MZN (exacto '+n+'/'+d+')',represented:value,ready:value!==null,reason:whole?'Valor exacto em meticais inteiros,sem arredondamento.':unit==='whole'?'Exemplar M20 exige meticais sem centavos;regra de representação da fracção por corresponder.':cent?'Valor exacto ao cêntimo na preparação M22 já demonstrada;sem arredondamento fiscal ou declaração oficial presumidos.':'Fracção de cêntimo conservada;regra de representação fiscal por corresponder.'};
|
||||
}
|
||||
type Financial=ReturnType<typeof normalFinancialSource>;
|
||||
export function reuseDirectFormAllocations(source:Financial){return(source?.accountingLines??[]).filter(l=>['cost_of_sales','personnel','depreciation','interest_expense'].includes(l.code)).map(l=>({id:'source-'+l.code,sourceCode:l.code,account:allowed[l.code][0]as keyof typeof m20Accounts,amount:l.total,reference:'Reutilizado da linha financeira '+l.origin+';conferir completude da conta no suporte da preparação.'}));}
|
||||
type Model={accountingProfit:FiscalFraction|null;taxableProfit:FiscalFraction|null;taxableBase:FiscalFraction|null;colecta?:FiscalFraction|null;rows:Array<{rule:string;document:string;line:string;adjustment:FiscalFraction|null}>;schedules?:SchedulesModel;depreciation?:NormalDepreciationModel;costs?:NormalCostsModel;base?:NormalBaseModel};
|
||||
export function prepareNormalForms(input:NormalFormPreparationInput,m:Model,source:Financial){
|
||||
validateNormalFormPreparation(input);const pending:string[]=[],edition=input.edition==='accepted_pdf_and_m20a1'&&!!input.reference.trim();
|
||||
if(!edition)pending.push('Identifique os exemplares M22 PDF e M20A.1 inventariados;sem equivalência automática com as outras edições.');
|
||||
if(!input.completenessReference.trim())pending.push('Suporte da completude contabilística e discriminação da origem em falta.');
|
||||
const allocations=input.allocations.map(a=>{let value:FiscalFraction|null=null;const issues:string[]=[];try{value=money(a.amount);}catch(e){issues.push(String(e));}if(!normalFormAccountsFor(a.sourceCode).includes(a.account)||!source?.accountingLines.some(l=>l.code===a.sourceCode)||!a.reference.trim())issues.push('Origem/conta e suporte compatíveis por identificar.');return{...structuredClone(a),value:issues.length?null:value,reason:issues.join(' ')};});
|
||||
const lines=(source?.accountingLines??[]).map(l=>{const rows=allocations.filter(a=>a.sourceCode===l.code),sum=addFractions(rows.flatMap(a=>a.value?[a.value]:[])),ready=rows.length>0&&rows.every(a=>a.value!==null)&&eq(sum,money(l.total));const reason=ready?'Parcelas reconciliadas exactamente com a linha de origem.':'Discriminação em falta,incompleta ou superior à origem;sem duplicar montantes.';if(!ready)pending.push(l.origin+': '+reason);return{code:l.code,total:l.total,allocated:sum,ready,reason};});
|
||||
for(const a of allocations)if(a.reason)pending.push(a.id+': '+a.reason);
|
||||
if(!source)pending.push('Resultado financeiro do período/moeda em falta;preparação não cria um resultado substituto.');
|
||||
const tax=input.incomeTax;let bookTax:FiscalFraction|null=null;
|
||||
if(!tax.reference.trim()||!tax.state)pending.push('Imposto sobre rendimento contabilizado:valor/ausência e suporte por identificar;colecta não substitui gasto contabilístico.');
|
||||
else if(tax.state==='absent'){if(tax.amount.trim()||tax.placement)pending.push('Ausência de imposto contabilizado contradiz montante/localização preenchidos.');else bookTax=zero();}
|
||||
else{try{bookTax=money(tax.amount);if(!tax.placement)throw Error();}catch{bookTax=null;pending.push('Imposto contabilizado conhecido exige montante e indicação se já incluído ou exterior ao resultado do plano.');}}
|
||||
const allocatedTax=addFractions(allocations.filter(a=>a.account==='8.5'&&a.value).map(a=>a.value!));
|
||||
if(bookTax&&(!eq(allocatedTax,tax.placement==='included'?bookTax:zero()))){pending.push('Conta8.5 não reconciliada com imposto já incluído/exterior ao plano;sem subtracção duplicada.');bookTax=null;}
|
||||
const includedTaxEvidence=(m.schedules?.effects??[]).filter(e=>m.schedules!.input.rows.find(r=>r.id===e.id)?.rule==='tax_own');
|
||||
if(bookTax&&tax.placement!=='included'&&includedTaxEvidence.some(e=>e.effect&&BigInt(e.effect.numerator)>0n)){pending.push(tax.state==='absent'?'Ausência de imposto contabilizado contradiz imposto próprio já identificado nos custos do plano.':'Imposto incluído e exterior coexistem:discriminação das duas componentes ainda por corresponder;sem misturar ou subtrair duas vezes.');bookTax=null;}
|
||||
const classificationReady=edition&&!!input.completenessReference.trim()&&source!==null&&lines.length>0&&lines.every(l=>l.ready)&&allocations.every(a=>a.value!==null),outsideTax=bookTax&&tax.placement==='outside'?bookTax:zero();
|
||||
const m20=Object.entries(m20Accounts).map(([account,label])=>{const related=allocations.filter(a=>a.account===account),categorySources=Object.keys(allowed).filter(k=>allowed[k].includes(account));const complete=edition&&!!input.completenessReference.trim()&&source!==null&&categorySources.every(k=>lines.some(l=>l.code===k&&l.ready));let value=complete?addFractions(related.flatMap(a=>a.value?[a.value]:[])):null;if(account==='8.5')value=complete&&bookTax?bookTax:null;return{account,label,value,representation:normalFormRepresentation(value,'whole'),reference:related.map(a=>a.reference).join(' | '),reason:complete?'Classificação documentada e reconciliada no M20A.1/quadro4.':'Campo dependente da discriminação contabilística;sem zero por falta de parcelas.'};});
|
||||
const netResult=classificationReady&&bookTax&&m.accountingProfit?subtractFractions(m.accountingProfit,outsideTax):null;
|
||||
const entries:Array<{code:string|null;origin:string;value:FiscalFraction|null;reason:string}>=[];
|
||||
const add=(code:string|null,origin:string,value:FiscalFraction|null,reason='')=>entries.push({code,origin,value,reason});
|
||||
for(const r of m.rows)add(r.rule==='noncontractual_fine'||r.rule==='compensatory_interest'?'215':null,r.document+'/'+r.line,r.adjustment,'CIRPC36(1)c;PDF M22/quadro10 campo215.');
|
||||
for(const e of m.schedules?.effects??[]){const r=m.schedules!.input.rows.find(r=>r.id===e.id)!;if(['capital_in','capital_out'].includes(r.rule)&&e.effect&&eq(e.effect,zero()))continue;const code=({patrimonial_gain:'201',patrimonial_cost:'202',tax_other:'213',undocumented:'223'}as Record<string,string>)[r.rule]??null;add(code,r.document+'/'+r.line,e.effect,code?'Correspondência do rótulo do PDF M22.':r.rule==='tax_own'?'Imposto próprio36(1)a:campo específico por corresponder;campo213 do PDF refere apenas responsabilidade de outrem.':'Periodização/variação sem campo correspondido neste recorte;efeito preservado no cálculo.');}
|
||||
if(m.depreciation)for(const asset of m.depreciation.assets){const a=asset.adjustment;add(a&&positive(a)?'206':null,'Mapa de amortizações — '+asset.description,a,a&&positive(a)?'Reintegrações/amortizações não aceites:PDF campo206.':'Recuperação de quota anterior/ajustamento negativo:campo de dedução específico ainda por corresponder.');}
|
||||
else if(m.schedules?.depreciation){const a=m.schedules.depreciation;add(positive(a)?'206':null,'Amortizações do mapa inicial',a);}
|
||||
for(const r of m.costs?.rows??[]){const code=({allowance:'219',representation:'220',advertising:'221',vehicle:'226',fuel:'225',rental:'224',credit:'209',stock:'209',litigation:'209',taxed_reversal:'239'}as Record<string,string>)[r.rule]??null;add(code,r.document+'/'+r.line,r.adjustment,code?'Correspondência do tratamento demonstrado ao rótulo do PDF M22.':'Tratamento demonstrado sem campo específico correspondido;não usar campo livre por presunção.');}
|
||||
if(bookTax&&tax.placement==='outside')add(null,'Imposto contabilístico exterior ao plano',bookTax,'Imposto próprio36(1)a:campo específico por corresponder;213 do exemplar é de outrem. Resultado líquido conhecido,sem código presumido ou alteração do motor fiscal.');
|
||||
const ownTaxEffects=(m.schedules?.effects??[]).filter(e=>m.schedules!.input.rows.find(r=>r.id===e.id)?.rule==='tax_own');
|
||||
const includedTaxCorresponds=!bookTax||tax.placement!=='included'||ownTaxEffects.every(e=>e.effect!==null)&&eq(addFractions(ownTaxEffects.flatMap(e=>e.effect?[e.effect]:[])),bookTax);
|
||||
if(!includedTaxCorresponds)pending.push('Imposto já incluído agora discriminado não corresponde ao ajustamento tax_own existente;conferir esse caso sem alterar cálculos ou históricos.');
|
||||
const unmapped=entries.filter(e=>!e.code&&(!e.value||!eq(e.value,zero())));for(const e of unmapped)pending.push(e.origin+': '+e.reason);
|
||||
const field=(code:string,label:string,value:FiscalFraction|null,reason:string,notApplicable=false)=>({code,label,value,application:notApplicable?'not_applicable':value?'known':'missing',representation:notApplicable?{...normalFormRepresentation(null),display:'Sem aplicação',reason:'Lucro/perda conhecido:não preencher o campo de sinal oposto.'}:normalFormRepresentation(value),reason,transcriptionReady:edition&&code!=='200'&&normalFormRepresentation(value).ready});
|
||||
const mappedValue=(code:string,negative=false)=>{if(code==='206'&&m.depreciation?.adjustment===null)return null;const es=entries.filter(e=>e.code===code);if(es.some(e=>e.value===null)||!es.length&&m.taxableProfit===null)return null;const value=addFractions(es.flatMap(e=>e.value?[negative?neg(e.value):e.value]:[]));return positive(value)?value:null;};
|
||||
const fields=[field('200','Resultado do exercício',netResult,'Valor contabilístico reconciliado próprio;transporte automático M20→M22 impedido só pela divergência201/Q8 versus200/Q10.')];
|
||||
const labels:Record<string,string>={'201':'Variações patrimoniais positivas','202':'Variações patrimoniais negativas','206':'Amortizações não aceites','209':'Provisões/imparidade além dos limites','213':'Impostos e encargos da responsabilidade de outrem','215':'Multas e juros compensatórios','219':'Parcela não aceite de ajudas de custo','220':'Parcela não aceite de representação','221':'Publicidade além do limite','223':'Despesas não documentadas','224':'Parcela não aceite de aluguer','225':'Combustíveis sem prova/consumo normal','226':'Encargos não aceites com viaturas','239':'Reposição/redução de provisões tributadas'};
|
||||
for(const[code,label]of Object.entries(labels))fields.push(field(code,label,mappedValue(code,['202','239'].includes(code)),'PDF M22/quadro10;valor do ajustamento demonstrado,sem reaplicar percentagens do rótulo.'));
|
||||
const v=(code:string)=>fields.find(f=>f.code===code)!.value,patrimonial=netResult&&v('201')&&v('202')?subtractFractions(addFractions([netResult,v('201')!]),v('202')!):null;
|
||||
fields.push(field('203','Resultado após variações patrimoniais',patrimonial,'200+201−202,sem transferência entre edições.'));
|
||||
const up=entries.filter(e=>!['201','202'].includes(e.code??'')&&e.value&&positive(e.value)&&!eq(e.value,zero())),down=entries.filter(e=>!['201','202'].includes(e.code??'')&&e.value&&!positive(e.value));
|
||||
const sumsReady=includedTaxCorresponds&&m.taxableProfit!==null&&entries.every(e=>e.value!==null)&&unmapped.length===0&&patrimonial!==null;
|
||||
const additions=sumsReady?addFractions([patrimonial!,...up.map(e=>e.value!)]):null,deductions=sumsReady?addFractions(down.map(e=>neg(e.value!))):null,reconstructed=additions&&deductions?subtractFractions(additions,deductions):null;
|
||||
const matches=reconstructed!==null&&m.taxableProfit!==null&&eq(reconstructed,m.taxableProfit);if(reconstructed&&!matches)pending.push('Percurso M22 não reconcilia com o lucro tributável existente;rever localização do imposto e campos,sem alterar os cálculos demonstrados.');
|
||||
fields.push(field('238','Soma após acréscimos',additions,'Campo203+campos204–237;indeterminado se há efeito sem correspondência.'),field('258','Soma das deduções',deductions,'Campos239–257;sem presumir campo para dedução não correspondida.'));
|
||||
const p=m.taxableProfit,loss=p&&!positive(p)?neg(p):null,profit=p&&positive(p)?p:null;
|
||||
for(const[code,label,value]of [['259','Prejuízo fiscal',loss],['260','Lucro tributável',profit],['269','Prejuízo fiscal — regime geral',loss],['270','Lucro tributável — regime geral',profit],['276','Prejuízos fiscais deduzidos',m.base?.deductedLosses??null],['277','Benefícios fiscais a deduzir',m.base?.benefitDeduction??null],['278','Matéria colectável — regime geral',m.taxableBase],['300','Imposto à taxa normal',m.colecta??null]]as const)fields.push(field(code,label,value,'Reutiliza o cálculo demonstrado;campos independentes da divergência de transporte.',p!==null&&value===null&&['259','260','269','270'].includes(code)));
|
||||
const reducedAbsent=input.reducedRate.state==='absent'&&!!input.reducedRate.reference.trim();fields.push(field('301','Imposto à taxa reduzida',reducedAbsent?zero():null,'Ausência declarada com suporte;caso conhecido pertence aL7.'),field('302','Colecta total',reducedAbsent?m.colecta??null:null,'300+301 apenas com ausência de taxa reduzida demonstrada;sem saldoL8.'));
|
||||
if(!reducedAbsent)pending.push('Parcela de taxa reduzida em falta ou conhecida:colecta total302 depende desse âmbitoL7;colecta normal300 preservada.');
|
||||
fields.push(field('309–316','Liquidação e saldo final',null,'L8:retenções,pagamentos,créditos e saldo final não apurados.'));
|
||||
return{input:structuredClone(input),allocations,lines,m20,netResult,netRepresentation:normalFormRepresentation(netResult,'whole',true),entries,unmapped,fields,reconciliation:{reconstructedProfit:reconstructed,existingProfit:m.taxableProfit,matches},pending,source:'PDF M22 SHA2564b61bd83d1fbcfd3b7b5c5523cea5923f7d0f65dc4c004eff58e5db38f763c88,Q10–12;M20A.1 SHA2561ceca6f4c6d77853c1b2b445876599b42093175fa89eecf40590180956d83a9e,Q4/M12/D13–D35. Rótulos e estrutura reutilizados;sem valores de terceiros,fórmulas do exemplar ou submissão.',transport:{ready:false,reason:'M20A.1 D35 remete paraM22 campo201/quadro8;PDF M22 usa200/quadro10. Impedimento restrito ao transporte deste resultado;campos independentes continuam preparados.'}};
|
||||
}
|
||||
export type NormalFormPreparationModel=ReturnType<typeof prepareNormalForms>;
|
||||
export function normalFormPreparationReport(m:NormalFormPreparationModel):Array<[string,string,string,string]>{return[['IRPC normal — L6','Representação e preparação M20/M22',m.pending.join(' | ')||'Preparação parcial dos campos correspondidos;sem declaração oficial ou submissão.',m.source],...m.m20.map(f=>['IRPC normal — L6','M20 A.1 conta'+f.account+' — '+f.label,`${f.representation.display};exacto:${f.representation.exact??'Indeterminado'};representável:${f.representation.ready?'Sim':'Pendente'};${f.representation.reason}`,`${f.reference};${f.reason}`]as[string,string,string,string]),['IRPC normal — L6','Resultado líquido M20',m.netRepresentation.display+';'+m.netRepresentation.reason,'Imposto contabilístico identificado;sem usar colecta como despesa presumida.'],...m.fields.map(f=>['IRPC normal — L6','M22 PDF campo'+f.code+' — '+f.label,`${f.representation.display};exacto:${f.representation.exact??'Indeterminado'};preparação de transcrição:${f.transcriptionReady?'Exacta neste recorte':'Pendente/sem aplicação'};${f.representation.reason}`,f.reason]as[string,string,string,string]),...m.unmapped.map(e=>['IRPC normal — L6','Ajustamento sem campo correspondido — '+e.origin,normalFormRepresentation(e.value).display,e.reason]as[string,string,string,string]),['IRPC normal — L6','Transporte entre edições',m.transport.reason,`Lucro reconstruído:${normalFormRepresentation(m.reconciliation.reconstructedProfit).display};lucro existente:${normalFormRepresentation(m.reconciliation.existingProfit).display};reconciliação:${m.reconciliation.matches?'Exacta':'Pendente'};sem alteração de cálculos.`]];}
|
||||
@@ -1,20 +0,0 @@
|
||||
import {fraction,fractionPresentation,type FiscalFraction} from './fiscal-rational.ts';
|
||||
export const normalFormSource='M/22, exemplar inventariado IRPC M-22- DECLARACAO DE RENDIMENTOS.pdf, SHA256 4b61bd83d1fbcfd3b7b5c5523cea5923f7d0f65dc4c004eff58e5db38f763c88, quadros10/11/12, três páginas conferidas. Correspondência parcial de preparação, sem ficheiro oficial ou submissão.';
|
||||
export function normalFormFields(m:{profit?:{lines:Array<{code:string;amount:string;reference:string}>};taxableProfit:FiscalFraction|null;taxableBase:FiscalFraction|null;colecta?:FiscalFraction|null;base?:{deductedLosses:FiscalFraction|null;benefitDeduction:FiscalFraction|null}}){
|
||||
const p=m.taxableProfit,negative=p!==null&&BigInt(p.numerator)<0n;
|
||||
const values:Array<[string,string,FiscalFraction|null,string]>= [
|
||||
['259','Prejuízo fiscal',negative?fraction(-BigInt(p!.numerator),BigInt(p!.denominator)):null,'Quadro10; apenas quando há perda conhecida.'],
|
||||
['260','Lucro tributável',p&&!negative?p:null,'Quadro10; não preencher o campo de lucro com uma perda.'],
|
||||
['269','Prejuízo fiscal — regime geral',negative?fraction(-BigInt(p!.numerator),BigInt(p!.denominator)):null,'Quadro11; não é uma perda anterior dedutível.'],
|
||||
['270','Lucro tributável — regime geral',p&&!negative?p:null,'Quadro11; manter separados regimes reduzido/isento.'],
|
||||
['276','Prejuízos fiscais deduzidos',m.base?.deductedLosses??null,'Quadro11; utilização simulada expressa.'],
|
||||
['277','Benefícios fiscais a deduzir',m.base?.benefitDeduction??null,'Quadro11; benefícios positivos pertencem aL7.'],
|
||||
['278','Matéria colectável — regime geral',m.taxableBase,'Quadro11; não é colecta.'],
|
||||
['300','Imposto à taxa normal',m.colecta??null,'Quadro12; não é saldo final.'],
|
||||
['200','Resultado do exercício',null,'Resultado financeiro antes de imposto não preenche automaticamente o resultado líquido do formulário; falta reconciliação própria.'],
|
||||
['302','Colecta total',null,'Inclui eventual parcela de taxa reduzida; não presumir a ausência deL7.'],
|
||||
['309–316','Liquidação e saldo final',null,'ÂmbitoL8; retenções, pagamentos, créditos e juros não preenchidos porL6.'],
|
||||
];
|
||||
const m20Fields=([['cost_of_sales','6.1.1','Custo dos inventários vendidos/consumidos'],['personnel','6.2','Gastos com pessoal'],['depreciation','6.5','Amortizações do período'],['interest_expense','6.9','Gastos financeiros — apenas juros da origem']]as const).map(([key,account,label])=>{const l=m.profit?.lines.find(l=>l.code===key);let value:FiscalFraction|null=null;if(l&&/^\d+(?:\.\d{1,2})?$/.test(l.amount)){const[n,f='']=l.amount.split('.');value=fraction(BigInt(n)*100n+BigInt(f.padEnd(2,'0')),100n);}return{account,label,value,display:value?fractionPresentation(value).decimal+' MZN':'Não preenchido',transcriptionReady:value!==null&&BigInt(value.numerator)%BigInt(value.denominator)===0n,reference:l?.reference??'',reason:'M20 A.1 quadro4, código contabilístico do exemplar, sem inventar número de campo. Valor contabilístico da origem; não é dedução fiscal. Exemplar exige meticais sem centavos; fracções conservadas, sem arredondamento presumido.'};});
|
||||
return{source:normalFormSource,m20:{status:'partial',fields:m20Fields,source:'Cópia de IRPS-IMOP.xlsx, SHA256 1ceca6f4c6d77853c1b2b445876599b42093175fa89eecf40590180956d83a9e, folhas M,20 e M20A.1; rótulos reutilizados, sem valores de terceiros ou execução das fórmulas do exemplar.',reason:'M20 A.1: correspondência parcial dos custos contabilísticos. Vendas/serviços, fornecimentos/outros gastos, imposto sobre o rendimento e resultado líquido exigem discriminação própria. Divergência concreta: M20A.1 remete resultado para M22 campo201/quadro8; PDF M22 inventariado usa campo200/quadro10. Sem transporte automático entre essas edições; restantes campos independentes conservados.'},fields:values.map(([code,label,value,reason])=>{const centExact=value?(BigInt(value.numerator)*100n)%BigInt(value.denominator)===0n:null;return{code,label,value,centExact,display:value?fractionPresentation(value).decimal+' MZN':'Não preenchido',transcriptionReady:value!==null&¢Exact===true,reason:reason+(centExact===false?' Fracção de cêntimo conservada exactamente; regra de representação fiscal por corresponder, sem arredondamento presumido.':'')};})};
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
import {addFractions,fraction,type FiscalFraction} from './fiscal-rational.ts';
|
||||
import {convertIrpcAmount,irpcFxDependency,type IrpcFxAmount,type IrpcFxEvidence,irpcFxEvidenceLabel} from './irpc-fx.ts';
|
||||
import type {rawNormalFinancialSource} from './irpc-normal.ts';
|
||||
export const normalPeriodFxVersion='IRPC-normal-adjustments/8';
|
||||
export type NormalPeriodFxInput={version:1;kind:''|'annual'|'start'|'cessation'|'same_year'|'transition';from:string;to:string;planStart:string;reference:string;conversionReference:string;mznMapsReference:string;months:Array<IrpcFxAmount&{period:number}>};
|
||||
export const newNormalPeriodFx=():NormalPeriodFxInput=>({version:1,kind:'',from:'',to:'',planStart:'',reference:'',conversionReference:'',mznMapsReference:'',months:[]});
|
||||
export function validateNormalPeriodFx(i:NormalPeriodFxInput){
|
||||
if(!i||i.version!==1||!['','annual','start','cessation','same_year','transition'].includes(i.kind)||['from','to','planStart','reference','conversionReference','mznMapsReference'].some(k=>typeof i[k as 'from']!=='string')||!Array.isArray(i.months)||new Set(i.months.map(m=>m.period)).size!==i.months.length||i.months.some(m=>!Number.isSafeInteger(m.period)||m.period<1||typeof m.currency!=='string'||m.fxSelection!==undefined&&(!m.fxSelection||typeof m.fxSelection!=='object')||m.fxLink!==undefined&&(!m.fxLink||typeof m.fxLink.id!=='string'||typeof m.fxLink.fingerprint!=='string')))throw Error('Correspondência do período/moeda não recuperável;originais preservados.');
|
||||
}
|
||||
const iso=(s:string)=>/^20\d{2}-\d{2}-\d{2}$/.test(s)&&Number.isFinite(Date.parse(s))&&new Date(s).toISOString().slice(0,10)===s;
|
||||
const month=(s:string)=>Number(s.slice(0,4))*12+Number(s.slice(5,7))-1;
|
||||
const monthEnd=(s:string)=>{const d=new Date(s+'T00:00:00Z');d.setUTCMonth(d.getUTCMonth()+1,0);return d.toISOString().slice(0,10);};
|
||||
const amount=(v:FiscalFraction)=>{const n=BigInt(v.numerator)*100n,d=BigInt(v.denominator);if(n%d!==0n)throw Error('Conversão com fracção de cêntimo: representação fiscal por corresponder,sem arredondamento novo.');const c=n/d,a=c<0n?-c:c;return(c<0n?'-':'')+a/100n+'.'+String(a%100n).padStart(2,'0');};
|
||||
type Source=NonNullable<ReturnType<typeof rawNormalFinancialSource>>;
|
||||
export function mapNormalPeriodFx(d:Record<string,unknown>,input:NormalPeriodFxInput,raw:Source|null){
|
||||
validateNormalPeriodFx(input);const pending:string[]=[],short=input.kind!==''&&input.kind!=='annual';let count=0;
|
||||
if(!input.kind||!input.reference.trim())pending.push('Tipo,evento e suporte da correspondência do período por identificar.');
|
||||
if(!iso(input.from)||!iso(input.to)||input.from>input.to||!input.from.endsWith('-01')||monthEnd(input.to.slice(0,7)+'-01')!==input.to||!input.to.startsWith('2026-'))pending.push('Recorte:meses completos,termo em2026;datas parciais ou inválidas permanecem por corresponder.');
|
||||
else{count=month(input.to)-month(input.from)+1;if(count<1||count>12||short&&count>=12||!short&&count!==12)pending.push('Número de meses incompatível com o tipo de período.');}
|
||||
if(short&&(!input.from.startsWith('2026-')||input.kind==='start'&&input.to!=='2026-12-31'||['cessation','transition'].includes(input.kind)&&input.from!=='2026-01-01'))pending.push('Datas incompatíveis com início,cessação ou transição no ano civil2026.');
|
||||
if(!iso(input.planStart)||!input.planStart.endsWith('-01'))pending.push('Identifique o primeiro mês civil do plano;meses orçamentais não têm data fiscal presumida.');
|
||||
if(!input.mznMapsReference.trim())pending.push('Confirme que parcelas,activos,quotas,saldos e mapas fiscais existentes estão reconciliados emMZN com este período;sem converter novamente esses dados.');
|
||||
if(!raw)pending.push('Plano financeiro reconciliado em falta.');
|
||||
const selected=raw?.accountingLines[0]?.monthlyAmounts.filter(m=>iso(input.planStart)&&month(input.planStart)+m.period-1>=month(input.from)&&month(input.planStart)+m.period-1<=month(input.to))??[];
|
||||
if(selected.length!==count||!count)pending.push('Meses do plano não cobrem integralmente o período indicado;sem anualização ou preenchimento de meses em falta.');
|
||||
if(raw?.currency!=='MZN'&&!input.conversionReference.trim())pending.push('Identifique pressuposto documentado da conversão mensal para a simulação;selecção cambial não confirma,por si,a regra fiscal de conversão anual.');
|
||||
for(const m of input.months)if(!selected.some(x=>x.period===m.period))pending.push('Selecção cambial sem mês seleccionado no período: '+m.period);
|
||||
const rows:Array<{code:string;period:number;date:string;originalAmount:string;originalCurrency:string;value:FiscalFraction|null;evidence:IrpcFxEvidence|null;reason:string}>=[];
|
||||
const lines=raw?.accountingLines.map(l=>{const monthlyAmounts=l.monthlyAmounts.filter(m=>selected.some(x=>x.period===m.period)).map(m=>{let value:FiscalFraction|null=null,evidence:IrpcFxEvidence|null=null,reason='';const day=iso(input.planStart)?new Date(Date.UTC(Number(input.planStart.slice(0,4)),Number(input.planStart.slice(5,7))-1+m.period-1,1)).toISOString().slice(0,10):'';
|
||||
try{const sign=m.amount.startsWith('-')?-1n:1n,original=sign<0n?m.amount.slice(1):m.amount;const selection=input.months.find(x=>x.period===m.period);if(raw.currency!=='MZN'&&(!selection||selection.currency!==raw.currency))throw Error('Selecção cambial deste mês/moeda em falta;sem usar taxa de outro mês por defeito.');const converted=convertIrpcAmount(d,original,selection??{currency:'MZN'});value=fraction(BigInt(converted.value.numerator)*sign,BigInt(converted.value.denominator));evidence=converted.evidence;amount(value);}catch(e){value=null;reason=String(e);pending.push(l.code+'/mês'+m.period+': '+reason);}
|
||||
rows.push({code:l.code,period:m.period,date:day,originalAmount:m.amount,originalCurrency:raw.currency,value,evidence,reason});return{period:m.period,amount:value?amount(value):'0.00'};});
|
||||
const total=addFractions(rows.filter(r=>r.code===l.code&&r.value).map(r=>r.value!));return{...l,monthlyAmounts,total:amount(total)};
|
||||
})??[];
|
||||
const ready=pending.length===0;const profit=addFractions(lines.map(l=>{const f=rows.filter(r=>r.code===l.code&&r.value).map(r=>r.value!);const sum=addFractions(f);return l.accountingEffect==='income'?sum:fraction(-BigInt(sum.numerator),BigInt(sum.denominator));}));
|
||||
return{input:structuredClone(input),short,months:count,originalCurrency:raw?.currency??'',rows,pending,source:ready&&raw?{...raw,currency:'MZN',cashSchedule:raw.currency==='MZN'?raw.cashSchedule.filter(r=>selected.some(m=>m.period===r.period)):[],periods:count,accountingLines:lines,accountingProfitBeforeTax:amount(profit)}:null,rule:'CIRPC7(4)a–d;Decreto72/2013 art9(3)a–c para os casos correspondidos. Meses completos do plano,sem anualização. Conversão para simulação reutiliza mecanismo cambial entregue e pressupostos explícitos;sem confirmação fiscal anual presumida.'};
|
||||
}
|
||||
export type NormalPeriodFxModel=ReturnType<typeof mapNormalPeriodFx>;
|
||||
export function normalPeriodFxDependency(d:Record<string,unknown>,i:NormalPeriodFxInput){return i.months.map(m=>irpcFxDependency(d,m)).filter(Boolean).join(' | ');}
|
||||
export function normalPeriodFxReport(m:NormalPeriodFxModel):Array<[string,string,string,string]>{return[['IRPC normal — L6','Período e moeda do plano',`${m.input.from}–${m.input.to};${m.months}meses;origem:${m.originalCurrency};resultado emMZN:${m.source?.accountingProfitBeforeTax??'Indeterminado'};${m.originalCurrency!=='MZN'?'Conversão para simulação com pressupostos documentados;regra fiscal anual não confirmada automaticamente.':''}${m.pending.join(' | ')}`,`${m.input.reference};${m.input.conversionReference};${m.input.mznMapsReference};${m.rule}`],...m.rows.map(r=>['IRPC normal — L6',`${({revenue:'Receitas',cost_of_sales:'Custo das vendas',operating_expenses:'Despesas operacionais',personnel:'Pessoal',depreciation:'Depreciação contabilística',interest_expense:'Juros reconhecidos'}as Record<string,string>)[r.code]??r.code}/mês${r.period} (${r.date})`,`Original:${r.originalAmount} ${r.originalCurrency};MZN:${r.value?amount(r.value):'Indeterminado'};${r.reason}`,r.evidence?irpcFxEvidenceLabel(r.evidence):'OrigemMZN;sem conversão']as[string,string,string,string])];}
|
||||
@@ -1,64 +0,0 @@
|
||||
import type {NormalDepreciationModel} from './irpc-normal-depreciation.ts';
|
||||
import type {NormalCostsModel} from './irpc-normal-costs.ts';
|
||||
import type {SchedulesModel} from './irpc-normal-schedules.ts';
|
||||
import {addFractions,decimalFraction,fraction,type FiscalFraction} from './fiscal-rational.ts';
|
||||
|
||||
export const normalProfitVersion='IRPC-normal-adjustments/2';
|
||||
export type ProfitEvidence={state:''|'known'|'absent';amount:string;reference:string};
|
||||
export const profitTopics=[
|
||||
['positivePatrimonial','Variações patrimoniais positivas fora do resultado'],
|
||||
['negativePatrimonial','Variações patrimoniais negativas fora do resultado'],
|
||||
['incomeCorrections','Outras correcções aos proveitos, incluindo exclusões'],
|
||||
['expenseCorrections','Outras correcções aos custos, além dos acréscimos registados'],
|
||||
['timing','Diferenças de periodização e de critérios contabilísticos/fiscais'],
|
||||
['special','Operações especiais, benefícios e regimes fora deste recorte'],
|
||||
]as const;
|
||||
export type ProfitTopic=typeof profitTopics[number][0];
|
||||
export type NormalProfitInput={version:1;completenessReference:string;lines:Array<{code:string;state:''|'known'|'absent';reference:string}>;topics:Record<ProfitTopic,ProfitEvidence>};
|
||||
export const newNormalProfitInput=():NormalProfitInput=>({version:1,completenessReference:'',lines:[],topics:Object.fromEntries(profitTopics.map(([k])=>[k,{state:'',amount:'',reference:''}]))as NormalProfitInput['topics']});
|
||||
export function validateNormalProfit(i:NormalProfitInput){
|
||||
if(!i||i.version!==1||typeof i.completenessReference!=='string'||!Array.isArray(i.lines)||i.lines.some(l=>!l||typeof l.code!=='string'||typeof l.reference!=='string'||!['','known','absent'].includes(l.state))||new Set(i.lines.map(l=>l.code)).size!==i.lines.length||!i.topics||typeof i.topics!=='object'||Array.isArray(i.topics))throw Error('Conferência do lucro tributável não recuperável.');
|
||||
for(const[k]of profitTopics){const t=i.topics[k];if(!t||!['','known','absent'].includes(t.state)||typeof t.amount!=='string'||typeof t.reference!=='string')throw Error('Estado documental do lucro tributável não recuperável.');}
|
||||
}
|
||||
type Source={currency:string;periods:number;accountingLines:Array<{code:string;origin:string;accountingEffect:'income'|'expense';total:string}>};
|
||||
export type NormalProfitModel={input:NormalProfitInput;lines:Array<{code:string;label:string;amount:string;addedBack:FiscalFraction;remainder:FiscalFraction|null;state:ProfitEvidence['state'];reference:string;reason:string}>;topics:Array<ProfitEvidence&{key:ProfitTopic;label:string;value:FiscalFraction|null;reason:string}>;pending:string[];taxableProfit:FiscalFraction|null;source:string};
|
||||
const zero=()=>fraction(0n,1n);
|
||||
function money(s:string){if(!/^-?\d+(?:\.\d{1,2})?$/.test(s))throw Error('Montante inválido');const v=decimalFraction(s.startsWith('-')?s.slice(1):s);return s.startsWith('-')?fraction(-BigInt(v.numerator),BigInt(v.denominator)):v;}
|
||||
const units=(f:FiscalFraction)=>BigInt(f.numerator)*100n/BigInt(f.denominator);
|
||||
const difference=(a:FiscalFraction,b:FiscalFraction)=>fraction(BigInt(a.numerator)*BigInt(b.denominator)-BigInt(b.numerator)*BigInt(a.denominator),BigInt(a.denominator)*BigInt(b.denominator));
|
||||
export function closeNormalProfit(input:NormalProfitInput,source:Source|null,rows:Array<{sourceCode:string;adjustment:FiscalFraction|null;status:string}>,accounting:FiscalFraction|null,additions:FiscalFraction,contextReady:boolean,schedules?:SchedulesModel,costs?:NormalCostsModel,depreciation?:NormalDepreciationModel):NormalProfitModel{
|
||||
validateNormalProfit(input);const pending:string[]=[],lines:NormalProfitModel['lines']=[],topics:NormalProfitModel['topics']=[];
|
||||
if(!contextReady)pending.push('Âmbito,exercício,moeda ou correspondência anual ainda insuficientes.');
|
||||
if(!input.completenessReference.trim())pending.push('Documente que o plano e os ajustamentos abrangem o sujeito passivo/exercício completo;uma oportunidade isolada não equivale automaticamente ao conjunto da empresa.');
|
||||
if(rows.some(r=>r.status!=='calculated'))pending.push('Existem ajustamentos registados por resolver;acréscimos independentes conservados.');
|
||||
if(!source)pending.push('Falta resultado financeiro reconciliado.');
|
||||
for(const l of source?.accountingLines??[]){
|
||||
const review=input.lines.find(r=>r.code===l.code),state=review?.state??'',reference=review?.reference??'';
|
||||
const addedBack=addFractions(rows.filter(r=>r.sourceCode===l.code&&r.adjustment).map(r=>r.adjustment!));let remainder:FiscalFraction|null=null;const issues:string[]=[];
|
||||
try{const amount=money(l.total);remainder=difference(amount,addedBack);if(units(amount)<0n||units(remainder)<0n)issues.push('Valor negativo ou acréscimos superiores à origem;reconcilie a linha sem compensação presumida.');
|
||||
if(!state||!reference.trim())issues.push('Conferência fiscal e suporte da linha em falta.');
|
||||
if(state==='absent'&&(units(amount)!==0n||units(addedBack)!==0n))issues.push('Ausência declarada contradiz o montante conhecido da origem.');
|
||||
if(state==='known'&&l.code==='depreciation'&&units(amount)!==0n&&(depreciation?depreciation.adjustment:schedules?.depreciation)==null)issues.push('Depreciação contabilística conhecida;amortização fiscal por corresponder,não presumir igualdade.');
|
||||
if(state==='known'&&l.code==='interest_expense'&&units(remainder)!==0n&&schedules?.interest==null)issues.push('Juros financeiros remanescentes conhecidos;dedutibilidade e eventuais limites por corresponder. Só os juros compensatórios já acrescidos estão cobertos.');
|
||||
if(!['revenue','cost_of_sales','operating_expenses','personnel','depreciation','interest_expense'].includes(l.code))issues.push('Linha financeira sem correspondência neste recorte.');
|
||||
}catch{issues.push('Montante da linha por reconciliar.');}
|
||||
const reason=issues.join(' ')|| (state==='absent'?'Ausência expressamente declarada e compatível com a origem zero.':units(remainder??zero())===0n?'Valor conhecido,integralmente corrigido ou igual a zero;sem presumir ausência.':l.accountingEffect==='income'?'Proveito ordinário reconhecido no exercício,qualificado e documentado nos termos dos artigos18/20.':'Parcela remanescente qualificada como custo ordinário indispensável e documentado do artigo22,sem exclusões/limites adicionais declarados.');
|
||||
if(issues.length)pending.push(l.origin+': '+reason);
|
||||
lines.push({code:l.code,label:l.origin,amount:l.total,addedBack,remainder,state,reference,reason});
|
||||
}
|
||||
for(const l of input.lines)if(!source?.accountingLines.some(s=>s.code===l.code))pending.push('Conferência sem linha de origem actual: '+l.code);
|
||||
for(const[key,label]of profitTopics){const t=input.topics[key];let value:FiscalFraction|null=null,reason='';
|
||||
if(!t.state||!t.reference.trim())reason='Informação em falta;sem zero presumido.';
|
||||
else if(t.state==='absent'){if(t.amount.trim())reason='Ausência declarada com montante preenchido;reconcilie os dois estados.';else{value=zero();reason='Ausência expressamente declarada com suporte;parcela zero apenas por esta declaração.';}}
|
||||
else{try{value=money(t.amount);if(units(value)!==0n)reason='Montante conhecido,mas tratamento específico ainda por corresponder;conservado sem aplicação presumida.';else reason='Valor conhecido zero com suporte;distinto de ausência declarada.';}catch{reason='Montante conhecido por preencher ou inválido.';}}
|
||||
const mapped=[...(schedules?.effects??[]),...(costs?.effects??[])].filter(e=>e.topic===key);
|
||||
const covered=(schedules||costs)&&mapped.length>0&&mapped.every(e=>e.effect!==null)&&value!==null&&t.state==='known'&&units(addFractions(mapped.flatMap(e=>e.amount?[e.amount]:[])))===units(value);
|
||||
if(covered)reason='Montante reconciliado com as regras do mapa complementar; efeito fiscal discriminado por linha.';
|
||||
if(value===null||units(value)!==0n&&!covered||t.state==='absent'&&!!t.amount.trim()||mapped.length>0&&!covered)pending.push(label+': '+(mapped.length&&!covered?'Mapa complementar não reconciliado com este estado/montante. ': '')+reason);
|
||||
topics.push({...structuredClone(t),key,label,value,reason});
|
||||
}
|
||||
if(schedules)pending.push(...schedules.pending);
|
||||
if(costs)pending.push(...costs.pending);
|
||||
if(depreciation&&!schedules)pending.push(...depreciation.pending);
|
||||
return{input:structuredClone(input),lines,topics,pending,taxableProfit:pending.length===0&&accounting?addFractions([accounting,additions,...(schedules?[schedules.net]:[]),...(costs?[costs.net]:[]),...(depreciation&&!schedules&&depreciation.adjustment?[depreciation.adjustment]:[])]):null,source:schedules?'CIRPC17/18/20/21/22/24/36; Decreto72/2013 art3–7. Mapa complementar de efeitos com sinal reconciliado por tema, juros financeiros ordinários e quotas anuais constantes documentadas. Simulação emMZN/2026; benefícios e casos especiais separados emL7, saldo anual emL8.':'CIRPC17(1)/18/20/22/36(1)c;recorte anual2026,residente geral,MZN. Resultado antes de imposto + acréscimos36(1)c;demais correcções/variações sem efeito apenas quando ausência ou zero conhecidos expressamente suportados. Receita/custos ordinários classificados pelo utilizador;depreciação fiscal e juros financeiros remanescentes fora deste percurso. Lucro tributável simulado,não matéria colectável,colecta ou declaraçãoM20/22.'};
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
import {addFractions,decimalFraction,fraction,subtractFractions,type FiscalFraction} from './fiscal-rational.ts';
|
||||
export const normalSchedulesVersion='IRPC-normal-adjustments/5';
|
||||
export const scheduleRules={
|
||||
tax_own:['IRPC e impostos sobre o lucro contabilizados','expenseCorrections','36(1)a',1],
|
||||
tax_other:['Impostos da responsabilidade de outrem','expenseCorrections','36(1)b',1],
|
||||
undocumented:['Despesa não documentada','expenseCorrections','36(1)g',1],
|
||||
capital_in:['Entrada de capital fora do resultado','positivePatrimonial','21(1)a',0],
|
||||
patrimonial_gain:['Variação positiva ordinária fora do resultado','positivePatrimonial','21',1],
|
||||
capital_out:['Distribuição aos titulares fora do resultado','negativePatrimonial','24(1)c',0],
|
||||
patrimonial_cost:['Variação negativa indispensável, sem exclusões do artigo24','negativePatrimonial','22/24(1)',-1],
|
||||
future_cost:['Custo contabilizado em2026 imputável ao exercício seguinte','timing','18(1)',1],
|
||||
future_income:['Proveito contabilizado em2026 imputável ao exercício seguinte','timing','18(1)',-1],
|
||||
current_cost:['Custo de2026 ainda não reflectido no resultado','timing','18(1)',-1],
|
||||
current_income:['Proveito de2026 ainda não reflectido no resultado','timing','18(1)',1],
|
||||
} as const;
|
||||
export type ScheduleRule=keyof typeof scheduleRules;
|
||||
export type ScheduleRow={id:string;rule:''|ScheduleRule;amount:string;sourceCode:string;document:string;line:string;reference:string;fiscalYear:string;conditions:''|'yes'};
|
||||
export type NormalAsset={id:string;category:''|'computer'|'server'|'other';description:string;cost:string;residual:string;rate:string;accounting:string;previousFiscal:string;inUseFrom:string;tableReference:string;reference:string;conditions:''|'yes'};
|
||||
export type NormalSchedules={version:1;period:{kind:''|'calendar'|'authorised_annual'|'ep_annual';from:string;to:string;reference:string};rows:ScheduleRow[];interest:{amount:string;reference:string;conditions:''|'yes'};assets:NormalAsset[];assetsReference:string;currentLossReference:string};
|
||||
export const newNormalSchedules=():NormalSchedules=>({version:1,period:{kind:'',from:'',to:'',reference:''},rows:[],interest:{amount:'',reference:'',conditions:''},assets:[],assetsReference:'',currentLossReference:''});
|
||||
export const newScheduleRow=(id:string):ScheduleRow=>({id,rule:'',amount:'',sourceCode:'',document:'',line:'',reference:'',fiscalYear:'',conditions:''});
|
||||
export const newNormalAsset=(id:string):NormalAsset=>({id,category:'',description:'',cost:'',residual:'',rate:'',accounting:'',previousFiscal:'',inUseFrom:'',tableReference:'',reference:'',conditions:''});
|
||||
export function validateSchedules(s:NormalSchedules){
|
||||
if(!s||s.version!==1||!Array.isArray(s.rows)||!Array.isArray(s.assets)||!s.interest||typeof s.assetsReference!=='string'||typeof s.currentLossReference!=='string'||['amount','reference','conditions'].some(k=>typeof s.interest[k as 'amount']!=='string')||!['','yes'].includes(s.interest.conditions))throw Error('Mapas L6 não recuperáveis.');
|
||||
for(const [rows,empty]of [[s.rows,newScheduleRow('')],[s.assets,newNormalAsset('')]]as const){if(new Set(rows.map(r=>r.id)).size!==rows.length)throw Error('Identificador duplicado no mapa L6.');for(const r of rows)if(!r||Object.keys(empty).some(k=>typeof (r as unknown as Record<string,unknown>)[k]!=='string')||!['','yes'].includes(r.conditions))throw Error('Linha L6 não recuperável.');}
|
||||
if(s.rows.some(r=>r.rule!==''&&!Object.hasOwn(scheduleRules,r.rule)))throw Error('Regra L6 desconhecida.');
|
||||
if(s.assets.some(a=>!['','computer','server','other'].includes(a.category)))throw Error('Categoria de activo desconhecida.');
|
||||
if(!s.period||!['','calendar','authorised_annual','ep_annual'].includes(s.period.kind)||['from','to','reference'].some(k=>typeof s.period[k as 'from']!=='string'))throw Error('Período complementar não recuperável.');
|
||||
}
|
||||
export function normalSchedulePeriod(s:NormalSchedules,scope:string){
|
||||
const p=s.period,pending:string[]=[];
|
||||
const iso=(v:string)=>/^20\d{2}-\d{2}-\d{2}$/.test(v)&&Number.isFinite(Date.parse(v))&&new Date(v).toISOString().slice(0,10)===v;
|
||||
if(!iso(p.from)||!iso(p.to)||!p.from.endsWith('-01')||!p.to.startsWith('2026-'))pending.push('Período anual por identificar: início no primeiro dia do mês e termo em2026, sem período curto ou alinhamento mensal presumido.');
|
||||
else{const end=new Date(p.from+'T00:00:00Z');end.setUTCFullYear(end.getUTCFullYear()+1);end.setUTCDate(end.getUTCDate()-1);if(end.toISOString().slice(0,10)!==p.to)pending.push('Os12 meses do plano não correspondem ao período anual indicado.');}
|
||||
if(!p.kind||!p.reference.trim())pending.push('Identifique tipo de período e correspondência dos12 meses; ausência de informação não é ano civil presumido.');
|
||||
if(p.kind==='calendar'&&(p.from!=='2026-01-01'||p.to!=='2026-12-31'))pending.push('Datas incompatíveis com o ano civil2026.');
|
||||
if(p.kind==='ep_annual'&&scope!=='ep_general')pending.push('Período do artigo7(3) exige EP e comunicação documentada; não aplicar a um residente.');
|
||||
return{...structuredClone(p),pending};
|
||||
}
|
||||
const z=()=>fraction(0n);
|
||||
export const fiscalMoney=(s:string)=>{if(!/^\d{1,18}(?:\.\d{1,2})?$/.test(s))throw Error('Montante não negativo com até dois decimais necessário.');return decimalFraction(s);};
|
||||
const cmp=(a:FiscalFraction,b:FiscalFraction)=>BigInt(a.numerator)*BigInt(b.denominator)-BigInt(b.numerator)*BigInt(a.denominator);
|
||||
export type SchedulesModel=ReturnType<typeof calculateSchedules>;
|
||||
export function calculateSchedules(s:NormalSchedules,source:{accountingLines:Array<{code:string;total:string;accountingEffect:string}>}|null,oldRows:Array<{sourceCode:string;document:string;line:string;amount:string;adjustment:FiscalFraction|null}>,depreciationOverride?:{value:FiscalFraction|null;pending:string[]}){
|
||||
validateSchedules(s);const pending:string[]=[],effects:Array<{id:string;topic:string;amount:FiscalFraction|null;effect:FiscalFraction|null;reason:string}>=[];
|
||||
for(const r of s.rows){const issues:string[]=[],rule=r.rule?scheduleRules[r.rule]:null;let amount:FiscalFraction|null=null,effect:FiscalFraction|null=null;
|
||||
if(!rule||!r.reference.trim()||!r.document.trim()||!r.line.trim()||r.conditions!=='yes')issues.push('Regra, documento/linha, suporte e condições por identificar.');
|
||||
if(s.rows.some(q=>q!==r&&q.document.trim()===r.document.trim()&&q.line.trim()===r.line.trim())||oldRows.some(q=>q.document.trim()===r.document.trim()&&q.line.trim()===r.line.trim()))issues.push('Documento/linha duplicados entre mapas; sem dupla contagem.');
|
||||
try{amount=fiscalMoney(r.amount);if(cmp(amount,z())<=0n)throw Error();}catch{issues.push('Parcela positiva por identificar.');}
|
||||
const topic=rule?.[1]??'';const needsOrigin=topic==='expenseCorrections'||['future_cost','future_income'].includes(r.rule);
|
||||
if(needsOrigin){const line=source?.accountingLines.find(l=>l.code===r.sourceCode);const wanted=r.rule==='future_income'?'income':'expense';if(!line||line.accountingEffect!==wanted)issues.push('Parcela deve estar incluída numa linha de origem compatível.');else try{const allocated=addFractions([...s.rows.filter(q=>(q.rule&&(['expenseCorrections'].includes(scheduleRules[q.rule][1])||['future_cost','future_income'].includes(q.rule)))&&q.sourceCode===r.sourceCode).map(q=>fiscalMoney(q.amount)),...oldRows.filter(q=>q.sourceCode===r.sourceCode).map(q=>fiscalMoney(q.amount))]);if(cmp(allocated,fiscalMoney(line.total))>0n)issues.push('Parcelas excedem a origem contabilística.');}catch{issues.push('Reconciliação da origem incompleta.');}}
|
||||
else if(r.sourceCode)issues.push('Variação fora do resultado/custo ou proveito omitido não deve repetir linha já contabilizada.');
|
||||
if(topic==='timing'&&r.fiscalYear!==(r.rule.startsWith('future_')?'2027':'2026'))issues.push('Exercício de imputação incompatível; este recorte cobre2026/seguinte, sem resolver exercícios anteriores.');
|
||||
if(!issues.length&&amount&&rule)effect=fraction(BigInt(amount.numerator)*BigInt(rule[3]),BigInt(amount.denominator));
|
||||
const reason=issues.join(' ')||'CIRPC'+rule?.[2]+'; classificação e condições documentadas pelo utilizador; projecção, sem alteração da contabilidade de origem.';if(issues.length)pending.push(r.document+': '+reason);effects.push({id:r.id,topic,amount,effect,reason});
|
||||
}
|
||||
let interest:FiscalFraction|null=null;const interestOrigin=source?.accountingLines.find(l=>l.code==='interest_expense');
|
||||
try{const corrected=s.rows.filter(r=>r.sourceCode==='interest_expense'&&r.rule&&(scheduleRules[r.rule][1]==='expenseCorrections'||r.rule==='future_cost'));const corrections=corrected.map(r=>{const e=effects.find(e=>e.id===r.id);if(!e?.effect)throw Error();return e.effect;});const remaining=subtractFractions(fiscalMoney(interestOrigin?.total??''),addFractions([...oldRows.filter(r=>r.sourceCode==='interest_expense').flatMap(r=>r.adjustment?[r.adjustment]:[]),...corrections]));interest=fiscalMoney(s.interest.amount);if(cmp(interest,remaining)!==0n||!s.interest.reference.trim()||s.interest.conditions!=='yes')throw Error();}catch{interest=null;}
|
||||
const assets=(depreciationOverride?[]:s.assets).map(a=>{const issues:string[]=[];let accounting:FiscalFraction|null=null,fiscal:FiscalFraction|null=null,adjustment:FiscalFraction|null=null;
|
||||
try{const cost=fiscalMoney(a.cost),residual=fiscalMoney(a.residual),previous=fiscalMoney(a.previousFiscal),rate=fiscalMoney(a.rate);accounting=fiscalMoney(a.accounting);const depreciable=subtractFractions(cost,residual);if(cmp(depreciable,z())<0n||cmp(previous,depreciable)>0n||cmp(rate,z())<=0n||cmp(rate,fraction(100n))>0n)throw Error();const annual=fraction(BigInt(depreciable.numerator)*BigInt(rate.numerator),BigInt(depreciable.denominator)*BigInt(rate.denominator)*100n);const available=subtractFractions(depreciable,previous);fiscal=cmp(annual,available)>0n?available:annual;
|
||||
if(cmp(fiscal,accounting)>0n)issues.push('Quota fiscal superior à contabilizada neste exercício; dedução de quotas anteriormente tributadas exige mapa próprio, sem presunção.');
|
||||
}catch{issues.push('Custo, residual, taxa, acumulado fiscal e depreciação contabilizada por reconciliar.');}
|
||||
if(!['computer','server'].includes(a.category)||a.rate!==(a.category==='computer'?'25':'20'))issues.push('Categoria/taxa não correspondida: este recorte cobre tabelaII, grupo3, itens9 (25%) e9.1 (20%), sem regra específica da tabelaI prevalecente.');
|
||||
if(!/^20\d{2}-\d{2}-\d{2}$/.test(a.inUseFrom)||!Number.isFinite(Date.parse(a.inUseFrom))||new Date(a.inUseFrom).toISOString().slice(0,10)!==a.inUseFrom||a.inUseFrom>(s.period.from||'2026-01-01')||a.inUseFrom<'2014-01-01'||!a.description.trim()||!a.tableReference.trim()||!a.reference.trim()||a.conditions!=='yes')issues.push('Identifique activo próprio, em uso no início do período, tabela/taxa aplicável, vida útil e condições do método constante anual; casos especiais/duodécimos separados.');
|
||||
if(['computer','server'].includes(a.category)&&/^20\d{2}-\d{2}-\d{2}$/.test(a.inUseFrom)){const limit=new Date(a.inUseFrom+'T00:00:00Z');if(Number.isFinite(+limit)){limit.setUTCFullYear(limit.getUTCFullYear()+(a.category==='computer'?8:10));if((s.period.from||'2026-01-01')>=limit.toISOString().slice(0,10))issues.push('Período máximo de vida útil excedido, artigo5; excepção específica não implementada.');}}
|
||||
if(!issues.length&&accounting&&fiscal)adjustment=subtractFractions(accounting,fiscal);if(issues.length)pending.push(a.description+': '+issues.join(' '));return{...structuredClone(a),accountingValue:accounting,fiscal,adjustment,reason:issues.join(' ')||'Decreto72/2013 art3–7; quota constante anual documentada, limitada ao saldo fiscal depreciável; diferença para a depreciação contabilística.'};});
|
||||
let depreciation:FiscalFraction|null=depreciationOverride?.value??null;if(!depreciationOverride)try{const total=addFractions(assets.map(a=>a.accountingValue??z()));if(s.assetsReference.trim()&&assets.every(a=>a.adjustment!==null)&&cmp(total,fiscalMoney(source?.accountingLines.find(l=>l.code==='depreciation')?.total??''))===0n)depreciation=addFractions(assets.map(a=>a.adjustment!));}catch{/* linha de origem desconhecida */}
|
||||
if(assets.length&&(oldRows.some(r=>r.sourceCode==='depreciation')||s.rows.some(r=>r.sourceCode==='depreciation'))){depreciation=null;pending.push('Depreciação repartida entre mapas de ajustamentos e activos: reconcilie as parcelas sem sobreposição antes de aplicar a quota fiscal.');}
|
||||
if(assets.length&&depreciation===null)pending.push('Mapa de activos sem reconciliação integral com a depreciação da origem; efeito fiscal não aplicado.');
|
||||
if(depreciationOverride)pending.push(...depreciationOverride.pending);
|
||||
return{input:structuredClone(s),effects,interest,depreciation,assets,pending,net: addFractions([...effects.flatMap(r=>r.effect?[r.effect]:[]),...(depreciation?[depreciation]:[])]),source:'CIRPC18/21/22/24/36; Decreto72/2013 art3–7. Entradas documentadas, sem taxas de activos sugeridas nem casos especiais presumidos.'};
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
import {irpcSpecialVersion,irpcSpecialMonthlyVersion,irpcSpecialStartPeriodVersion,irpcSpecialCessationPriorVersion,specialCalculationVersion,validateSpecial,calculateSpecial,specialReportRows,specialDependency,type SpecialInput,type SpecialModel} from './irpc-special.ts';
|
||||
import {normalFormPreparationVersion,validateNormalFormPreparation,prepareNormalForms,normalFormPreparationReport,type NormalFormPreparationInput,type NormalFormPreparationModel} from './irpc-normal-form-preparation.ts';
|
||||
import {normalPeriodFxVersion,validateNormalPeriodFx,mapNormalPeriodFx,normalPeriodFxDependency,normalPeriodFxReport,type NormalPeriodFxInput,type NormalPeriodFxModel} from './irpc-normal-period-fx.ts';
|
||||
import {normalDepreciationVersion,validateNormalDepreciation,calculateNormalDepreciation,normalDepreciationReport,type NormalDepreciationInput,type NormalDepreciationModel} from './irpc-normal-depreciation.ts';
|
||||
import {normalCostsVersion,validateNormalCosts,calculateNormalCosts,normalCostReport,type NormalCostsInput,type NormalCostsModel} from './irpc-normal-costs.ts';
|
||||
import {normalFormFields} from './irpc-normal-forms.ts';
|
||||
import {normalSchedulesVersion,normalSchedulePeriod,validateSchedules,calculateSchedules,type NormalSchedules,type SchedulesModel} from './irpc-normal-schedules.ts';
|
||||
import {normalAssessmentVersion,validateNormalAssessment,calculateNormalAssessment,type NormalAssessmentInput,type NormalAssessmentModel} from './irpc-normal-assessment.ts';
|
||||
import {normalBaseVersion,validateNormalBase,calculateNormalBase,type NormalBaseInput,type NormalBaseModel} from './irpc-normal-base.ts';
|
||||
import {normalProfitVersion,validateNormalProfit,closeNormalProfit,type NormalProfitInput,type NormalProfitModel} from './irpc-normal-profit.ts';
|
||||
import {forecastBusinessPlan,restoreBusinessPlanSnapshot} from './business-financial-plan.ts';
|
||||
import {buildFinancialFiscalBridge} from './financial-fiscal-bridge.ts';
|
||||
import {acquisitionScope} from './iva-acquisitions.ts';
|
||||
import {addFractions,decimalFraction,fraction,fractionPresentation,type FiscalFraction} from './fiscal-rational.ts';
|
||||
|
||||
export const irpcNormalVersion='IRPC-normal-adjustments/1';
|
||||
export const irpcNormalSource='CIRPC Lei34/2007 art17(1),PDF6/p768(60):resultado e correcções;art36(1)c,PDF10/p768(64):multas e encargos por infracções sem origem contratual,incluindo juros compensatórios. Lei4/2012 PDF2 altera17(6)/acrescenta36(1)o;Lei19/2013 PDF2 mantém36(1)a–o e acrescenta p/q. Lei12/2025 altera3/5/20/62/67/75,adita61-A e revoga39/47/75(2)/76;sem alteração deste recorte36(1)c. Não é apuramento integral nem Modelo20/22.';
|
||||
export type NormalAdjustment={id:string;sourceCode:string;document:string;line:string;amount:string;rule:''|'noncontractual_fine'|'compensatory_interest'|'other';included:''|'yes'|'no';reference:string};
|
||||
export type NormalBook={version:1;year:string;mappingReference:string;scope:''|'resident_general'|'ep_general'|'other';scopeReference:string;rows:NormalAdjustment[];special?:SpecialInput;profit?:NormalProfitInput;base?:NormalBaseInput;assessment?:NormalAssessmentInput;schedules?:NormalSchedules;costs?:NormalCostsInput;depreciation?:NormalDepreciationInput;forms?:NormalFormPreparationInput;periodsFx?:NormalPeriodFxInput;result?:NormalRecord;history?:NormalRecord[]};
|
||||
export type NormalModel={special?:SpecialModel;formPreparation?:NormalFormPreparationModel;periodsFx?:NormalPeriodFxModel;depreciation?:NormalDepreciationModel;costs?:NormalCostsModel;fiscalPeriod?:{kind:string;from:string;to:string;reference:string;pending:string[]};schedules?:SchedulesModel;currentLoss?:FiscalFraction|null;assessment?:NormalAssessmentModel;colecta?:FiscalFraction|null;base?:NormalBaseModel;profit?:NormalProfitModel;version:string;year:string;currency:string;origin:'projected';accountingProfit:FiscalFraction|null;additions:FiscalFraction;partialAdjustedResult:FiscalFraction|null;taxableProfit:FiscalFraction|null;taxableBase:FiscalFraction|null;tax:null;rows:Array<NormalAdjustment&{status:'calculated'|'indeterminate'|'outside_scope';adjustment:FiscalFraction|null;reason:string}>;pending:string[];source:string};
|
||||
type NormalRecord={key:string;createdAt:string;model:NormalModel};
|
||||
export const newNormalBook=():NormalBook=>({version:1,year:'',mappingReference:'',scope:'',scopeReference:'',rows:[]});
|
||||
export const newNormalAdjustment=(id:string):NormalAdjustment=>({id,sourceCode:'',document:'',line:'',amount:'',rule:'',included:'',reference:''});
|
||||
export function rawNormalFinancialSource(d:Record<string,unknown>){
|
||||
const p=restoreBusinessPlanSnapshot(String(d.business_plan_snapshot??''));if(!p)return null;
|
||||
const forecast=forecastBusinessPlan(p),bridge=buildFinancialFiscalBridge(forecast);
|
||||
return{...bridge,periods:forecast.rows.length,origin:'projected' as const,scope:acquisitionScope(d)};
|
||||
}
|
||||
export function normalFinancialSource(d:Record<string,unknown>){const raw=rawNormalFinancialSource(d),input=normalBook(d).periodsFx;return input?mapNormalPeriodFx(d,input,raw).source:raw;}
|
||||
function store(d:Record<string,unknown>){const s=JSON.parse(String(d.modelo_a_snapshot||'{"version":1,"books":{}}'));if(s.version!==1||!s.books||typeof s.books!=='object'||Array.isArray(s.books))throw Error('Livros fiscais não recuperáveis;originais preservados.');return s;}
|
||||
export function validateNormal(b:NormalBook){
|
||||
if(b?.special!==undefined)validateSpecial(b.special);
|
||||
if(b?.forms!==undefined)validateNormalFormPreparation(b.forms);
|
||||
if(b?.periodsFx!==undefined)validateNormalPeriodFx(b.periodsFx);
|
||||
if(b?.depreciation!==undefined)validateNormalDepreciation(b.depreciation);
|
||||
if(b?.costs!==undefined)validateNormalCosts(b.costs);
|
||||
if(b?.schedules!==undefined)validateSchedules(b.schedules);
|
||||
if(b?.assessment!==undefined)validateNormalAssessment(b.assessment);
|
||||
if(b?.base!==undefined)validateNormalBase(b.base);
|
||||
if(b?.profit!==undefined)validateNormalProfit(b.profit);
|
||||
if(!b||b.version!==1||['year','mappingReference','scopeReference'].some(k=>typeof b[k as 'year']!=='string')||!['','resident_general','ep_general','other'].includes(b.scope)||!Array.isArray(b.rows)||b.history!==undefined&&!Array.isArray(b.history))throw Error('Preparação IRPC normal não recuperável.');
|
||||
for(const r of b.rows)if(!r||Object.keys(newNormalAdjustment('')).some(k=>typeof r[k as keyof NormalAdjustment]!=='string')||!['','noncontractual_fine','compensatory_interest','other'].includes(r.rule)||!['','yes','no'].includes(r.included))throw Error('Ajustamento IRPC não recuperável;original conservado.');
|
||||
if(new Set(b.rows.map(r=>r.id)).size!==b.rows.length)throw Error('Identificador de ajustamento duplicado.');
|
||||
for(const r of [b.result,...(b.history??[])])if(r&&(!r.model||![irpcSpecialStartPeriodVersion,irpcSpecialCessationPriorVersion,irpcSpecialMonthlyVersion,irpcSpecialVersion,irpcNormalVersion,normalProfitVersion,normalBaseVersion,normalAssessmentVersion,normalSchedulesVersion,normalCostsVersion,normalDepreciationVersion,normalPeriodFxVersion,normalFormPreparationVersion].includes(r.model.version)||typeof r.key!=='string'||typeof r.createdAt!=='string'||!Array.isArray(r.model.rows)||!Array.isArray(r.model.pending)))throw Error('Histórico IRPC normal não recuperável.');
|
||||
}
|
||||
export function normalBook(d:Record<string,unknown>):NormalBook{
|
||||
const m=store(d).irpcNormal;if(m===undefined)return newNormalBook();if(!m||typeof m!=='object'||Array.isArray(m))throw Error('Mapa IRPC normal não recuperável.');const b=m[acquisitionScope(d)]??newNormalBook();validateNormal(b);return b;
|
||||
}
|
||||
export function saveNormalBook(d:Record<string,unknown>,b:NormalBook){validateNormal(b);const s=store(d);if(s.irpcNormal!==undefined&&(!s.irpcNormal||typeof s.irpcNormal!=='object'||Array.isArray(s.irpcNormal)))throw Error('Mapa IRPC normal não recuperável.');return JSON.stringify({...s,irpcNormal:{...s.irpcNormal,[acquisitionScope(d)]:b}});}
|
||||
function key(d:Record<string,unknown>,b:NormalBook){return JSON.stringify([b.special?specialCalculationVersion(b.special):b.forms?normalFormPreparationVersion:b.periodsFx?normalPeriodFxVersion:b.depreciation?normalDepreciationVersion:b.costs?normalCostsVersion:b.schedules?normalSchedulesVersion:b.assessment?normalAssessmentVersion:b.base?normalBaseVersion:b.profit?normalProfitVersion:irpcNormalVersion,acquisitionScope(d),d.business_plan_snapshot??'',b.year,b.mappingReference,b.scope,b.scopeReference,b.rows,...(b.profit?[b.profit]:[]),...(b.base?[b.base]:[]),...(b.assessment?[b.assessment]:[]),...(b.schedules?[b.schedules]:[]),...(b.costs?[b.costs]:[]),...(b.depreciation?[b.depreciation]:[]),...(b.periodsFx?[b.periodsFx,normalPeriodFxDependency(d,b.periodsFx)]:[]),...(b.forms?[b.forms]:[]),...(b.special?[b.special,specialDependency(d)]:[])]);}
|
||||
export function normalCurrent(d:Record<string,unknown>,b:NormalBook){return !!b.result&&b.result.key===key(d,b);}
|
||||
const zero=()=>fraction(0n,1n);
|
||||
const cents=(s:string)=>{if(!/^-?\d+(?:\.\d{1,2})?$/.test(s))throw Error('Montante MZN inválido;máximo dois decimais.');const v=decimalFraction(s.startsWith('-')?s.slice(1):s);return s.startsWith('-')?fraction(-BigInt(v.numerator),BigInt(v.denominator)):v;};
|
||||
const integerCents=(v:FiscalFraction)=>BigInt(v.numerator)*100n/BigInt(v.denominator);
|
||||
export function calculateNormal(d:Record<string,unknown>,b:NormalBook):NormalModel{
|
||||
validateNormal(b);const pending:string[]=[],raw=rawNormalFinancialSource(d),periodsFx=b.periodsFx?mapNormalPeriodFx(d,b.periodsFx,raw):undefined,source=periodsFx?periodsFx.source:raw,fiscalPeriod=periodsFx?{kind:b.periodsFx!.kind,from:b.periodsFx!.from,to:b.periodsFx!.to,reference:b.periodsFx!.reference,pending:periodsFx.pending}:b.schedules?normalSchedulePeriod(b.schedules,b.scope):undefined;
|
||||
if(periodsFx&&b.periodsFx!.kind==='annual'&&b.periodsFx!.from!=='2026-01-01'){
|
||||
const formal=b.schedules?normalSchedulePeriod(b.schedules,b.scope):null;
|
||||
if(!formal||formal.pending.length||formal.from!==b.periodsFx!.from||formal.to!==b.periodsFx!.to)fiscalPeriod!.pending.push('Ano diferente do civil exige o período autorizado/comunicado já documentado nos mapas,com as mesmas datas.');
|
||||
}
|
||||
if(fiscalPeriod)pending.push(...fiscalPeriod.pending);
|
||||
if(!source)pending.push('Falta plano financeiro reconciliado.');
|
||||
if(source?.currency!=='MZN')pending.push('Ponte em MZN necessária;sem conversão fiscal anual presumida.');
|
||||
if(!/^2026$/.test(b.year)||!b.mappingReference.trim()||source?.periods!==(periodsFx?.months??12))pending.push('Documente correspondência dos 12 meses do plano ao exercício2026;outros exercícios/horizontes permanecem separados.');
|
||||
if(!(b.scope==='resident_general'||b.schedules&&b.scope==='ep_general')||!b.scopeReference.trim())pending.push('Identifique sujeito residente no regime geral,fora de transparência/regimes especiais;EP e outros âmbitos não abrangidos.');
|
||||
const rows:NormalModel['rows']=b.rows.map(r=>({...structuredClone(r),status:'indeterminate',adjustment:null,reason:''}));
|
||||
const amounts=new Map<string,FiscalFraction>(),groups=new Map<string,NormalModel['rows']>();
|
||||
for(const r of rows){
|
||||
const line=source?.accountingLines.find(l=>l.code===r.sourceCode);
|
||||
const issue:string[]=[];
|
||||
if(!r.document.trim()||!r.line.trim()||!r.reference.trim())issue.push('Identifique documento,linha e suporte da qualificação.');
|
||||
if(!line||line.accountingEffect!=='expense')issue.push('Seleccione linha de custo existente na ponte.');
|
||||
if(r.included!=='yes')issue.push('Custo incluído no resultado de partida por demonstrar;sem acréscimo duplicado de montante já excluído.');
|
||||
try{const a=cents(r.amount);if(integerCents(a)<=0n)throw Error();amounts.set(r.id,a);}catch{issue.push('Montante positivo MZN,até dois decimais,por identificar.');}
|
||||
if(r.rule==='other'){r.status='outside_scope';issue.push('Outro ajustamento por corresponder;sem regra inventada.');}
|
||||
else if(!r.rule)issue.push('Seleccione natureza da multa não contratual ou dos juros compensatórios;juros comerciais/penalidades contratuais não equiparados.');
|
||||
if(rows.some(q=>q!==r&&q.document.trim()===r.document.trim()&&q.line.trim()===r.line.trim()&&r.document.trim()&&r.line.trim()))issue.push('Documento/linha repetidos;reconcilie sem duplicar o encargo.');
|
||||
if(line){const g=groups.get(line.code)??[];g.push(r);groups.set(line.code,g);}
|
||||
r.reason=issue.join(' ');
|
||||
}
|
||||
for(const [code,group]of groups){const line=source!.accountingLines.find(l=>l.code===code)!;const requested=addFractions(group.map(r=>amounts.get(r.id)??zero()));if(integerCents(requested)>integerCents(cents(line.total)))for(const r of group)r.reason+=' Parcelas excedem o custo da linha de origem;sem dupla contagem.';}
|
||||
for(const r of rows){if(!r.reason){r.status='calculated';r.adjustment=amounts.get(r.id)!;r.reason='Acréscimo integral de custo incluído no resultado de partida,qualificado pelo utilizador como '+(r.rule==='noncontractual_fine'?'multa/encargo de infracção sem origem contratual':'juros compensatórios')+';CIRPC36(1)c. Projecção pelos pressupostos do plano.';}else pending.push(r.document+': '+r.reason);}
|
||||
const additions=addFractions(rows.flatMap(r=>r.adjustment?[r.adjustment]:[]));
|
||||
const accountingProfit=source?.currency==='MZN'?cents(source.accountingProfitBeforeTax):null;
|
||||
const contextReady=(!fiscalPeriod||fiscalPeriod.pending.length===0)&&!!source&&source.currency==='MZN'&&source.periods===(periodsFx?.months??12)&&b.year==='2026'&&!!b.mappingReference.trim()&&(b.scope==='resident_general'||!!b.schedules&&b.scope==='ep_general')&&!!b.scopeReference.trim();
|
||||
if(rows.length===0&&!b.profit)pending.push('Sem ajustamentos documentados;ausência de registos não prova inexistência de correcções.');
|
||||
if(!b.profit)pending.push('L6 parcial:resultado ajustado apenas destes acréscimos;restantes custos/variações patrimoniais,amortizações,perdas,deduções e colecta por tratar. Lucro tributável,matéria colectável e imposto indeterminados.');
|
||||
const depreciation=b.depreciation?calculateNormalDepreciation(b.depreciation,source,fiscalPeriod??{from:b.year+'-01-01',to:b.year+'-12-31'},[...b.rows,...(b.schedules?.rows??[]),...(b.costs?.rows??[])],!!periodsFx?.short):undefined;
|
||||
const schedules=b.schedules?calculateSchedules(b.schedules,source,rows,depreciation?{value:depreciation.adjustment,pending:depreciation.pending}:undefined):undefined;
|
||||
const costs=b.costs?calculateNormalCosts(b.costs,source,[...b.rows,...(b.schedules?.rows??[])],fiscalPeriod??{from:'2026-01-01',to:b.year+'-12-31'},!!periodsFx?.short):undefined;
|
||||
const profit=b.profit?closeNormalProfit(b.profit,source,rows,accountingProfit,additions,contextReady,schedules,costs,depreciation):undefined;
|
||||
if(profit&&periodsFx)profit.source='CIRPC17/18/20/21/22/24/36;'+periodsFx.rule+' L7 mantém benefícios/casos especiais;L8 mantém saldo final.';
|
||||
if(profit)pending.push(...profit.pending,...(!b.base?['Matéria colectável,perdas reportadas,deduções e imposto não apurados neste percurso.']:[]));
|
||||
const base=b.base?calculateNormalBase(b.base,profit?.taxableProfit??null,b.year,b.schedules?.currentLossReference,!!periodsFx?.short):undefined;
|
||||
if(base)pending.push(...base.pending,...(!b.assessment?['Colecta/imposto a pagar,créditos anuais eM20/M22 não determinados;matéria colectável não é imposto.']:[]));
|
||||
const assessment=b.assessment?calculateNormalAssessment(b.assessment,base?.taxableBase??null,{year:b.year,scope:b.scope,extended:!!b.schedules||!!periodsFx,short:!!periodsFx?.short,currency:source?.currency??'',...(fiscalPeriod?{period:{from:fiscalPeriod.from,to:fiscalPeriod.to}}:{})}):undefined;
|
||||
if(assessment)pending.push(...assessment.pending,assessment.finalBalance.reason);
|
||||
const currentLoss=b.schedules&&profit?.taxableProfit&&BigInt(profit.taxableProfit.numerator)<0n?fraction(-BigInt(profit.taxableProfit.numerator),BigInt(profit.taxableProfit.denominator)):null;
|
||||
const model:NormalModel={...(periodsFx?{periodsFx}:{}),...(depreciation?{depreciation}:{}),...(costs?{costs}:{}),...(schedules?{schedules,currentLoss,fiscalPeriod}:{}),...(assessment?{assessment,colecta:assessment.colecta}:{}),...(base?{base}:{}),...(profit?{profit}:{}),version:b.special?specialCalculationVersion(b.special):b.forms?normalFormPreparationVersion:b.periodsFx?normalPeriodFxVersion:b.depreciation?normalDepreciationVersion:b.costs?normalCostsVersion:b.schedules?normalSchedulesVersion:b.assessment?normalAssessmentVersion:b.base?normalBaseVersion:b.profit?normalProfitVersion:irpcNormalVersion,year:b.year,currency:source?.currency??'',origin:'projected',accountingProfit,additions,partialAdjustedResult:contextReady&&rows.length>0&&rows.every(r=>r.status==='calculated')&&accountingProfit?addFractions([accountingProfit,additions]):null,taxableProfit:profit?.taxableProfit??null,taxableBase:base?.taxableBase??null,tax:null,rows,pending,source:irpcNormalSource+(periodsFx?' '+periodsFx.rule:b.schedules?' Mapas complementares: CIRPC18/21/22/24/36; Decreto72/2013 art3–7. EP: CIRPC15(1)c, apenas resultado imputável ao estabelecimento no regime geral, anual2026/MZN.':'')};
|
||||
if(b.special)model.special=calculateSpecial(d,b,model,source);
|
||||
if(b.forms){model.formPreparation=prepareNormalForms(b.forms,model,source);model.pending.push(...model.formPreparation.pending.map(p=>'Preparação M20/M22: '+p));}
|
||||
return model;
|
||||
}
|
||||
export function recordNormal(d:Record<string,unknown>,b:NormalBook,now=new Date().toISOString()):NormalBook{return{...b,history:b.result?[...(b.history??[]),structuredClone(b.result)]:b.history??[],result:{key:key(d,b),createdAt:now,model:calculateNormal(d,b)}};}
|
||||
const money=(v:FiscalFraction|null)=>v?fractionPresentation(v).decimal+' MZN':'Indeterminado';
|
||||
function normalBaseReport(m:NormalBaseModel):Array<[string,string,string,string]>{return[['IRPC normal — L6','Matéria colectável — deduções/perdas',`Lucro tributável:${money(m.taxableProfit)};perdas propostas elegíveis:${money(m.requestedLosses)};perdas deduzidas nesta simulação:${money(m.deductedLosses)};benefícios deduzidos:${money(m.benefitDeduction)};matéria colectável simulada:${money(m.taxableBase)};imposto a pagar:Indeterminado. ${m.pending.join(' | ')}`,`NUIT:${m.input.subjectNuit};${m.input.identityReference};método:${m.input.method==='direct'?'Declarativo/directo':m.input.method==='indirect'?'Indirecto':'Por identificar'};${m.input.methodReference};perdas:${m.input.lossesState==='absent'?'Ausência declarada':m.input.lossesState==='known'?'Conhecidas':'Informação em falta'};${m.input.lossesReference};objecto:${m.input.unchangedObject==='yes'?'Sem alteração declarada':m.input.unchangedObject==='no'?'Alteração declarada':'Por esclarecer'};${m.input.objectReference};${m.source}`],['IRPC normal — L6','Benefícios à matéria colectável',`Estado:${m.input.benefits.state==='known'?'Valor conhecido':m.input.benefits.state==='absent'?'Ausência declarada':'Informação em falta'};montante original:${m.input.benefits.amount||'Não preenchido'};dedução:${money(m.benefitDeduction)};não inclui créditos à colecta ou retenções sofridas.`,m.input.benefits.reference],...m.losses.map(l=>['IRPC normal — L6','Perda fiscal de '+l.year,`Estado:${l.status==='eligible'?'Elegível neste recorte':l.status==='excluded'?'Excluída neste exercício':'Indeterminada'};apurada:${l.assessed};utilizada antes:${l.previouslyUsed};saldo:${money(l.available)};utilização proposta:${l.requested};dedução nesta simulação:${money(l.deducted)};saldo aritmético posterior:${money(l.remaining)};último exercício ordinário:${l.lastOrdinaryYear??'Por determinar'};${l.reason}`,`NUIT:${l.subjectNuit};${l.reference};sem consumo do saldo oficial nem reporte automático.`]as[string,string,string,string])];}
|
||||
function normalAssessmentReport(m:NormalAssessmentModel):Array<[string,string,string,string]>{return[['IRPC normal — L6','Colecta — regime normal',`Matéria colectável:${money(m.taxableBase)};taxa:${m.rate?m.rate.numerator+'%':'Por identificar'};colecta simulada:${money(m.colecta)};${m.classification};${m.centExact===false?'Valor racional exacto com fracção de cêntimo;sem arredondamento fiscal aplicado.':''}${m.pending.join(' | ')}`,`Exercício:${m.period.year};período:${m.period.from}–${m.period.to};${m.input.reference};${m.rule};${m.source}`],['IRPC normal — L6','Saldo final — âmbito L8','A pagar:Indeterminado;a recuperar:Indeterminado. '+m.finalBalance.reason,'Sequência:lucro tributável → matéria colectável → colecta → saldo final;retenções,pagamentos e créditos anuais reservados aL8.']];}
|
||||
export function normalReportRows(d:Record<string,unknown>):Array<[string,string,string,string]>{try{const b=normalBook(d),r=b.result;if(!r)return[];const m=r.model;return[['IRPC normal — L6','Ajustamentos ao resultado financeiro',`Exercício:${m.year};resultado contabilístico antes de imposto:${money(m.accountingProfit)};acréscimos demonstrados:${money(m.additions)};resultado parcial ajustado:${money(m.partialAdjustedResult)};${m.profit?'lucro tributável simulado:'+money(m.taxableProfit)+(m.base?';matéria colectável simulada:'+money(m.taxableBase)+(m.assessment?';colecta simulada:'+money(m.colecta??null)+';saldo final a pagar ou recuperar:Indeterminado (L8).':';imposto a pagar:Indeterminado.'):';matéria colectável/imposto:Indeterminados.'):'lucro tributável/matéria colectável/imposto:Indeterminados.'} Projecção com pressupostos;${m.pending.join(' | ')}`,`${normalCurrent(d,b)?'Entradas correspondentes':'Histórico;origem ou entradas alteradas'};${r.createdAt};${m.source}`],...(m.special?specialReportRows(m.special):[]),...(m.formPreparation?normalFormPreparationReport(m.formPreparation):[]),...(m.periodsFx?normalPeriodFxReport(m.periodsFx):[]),...(m.depreciation?normalDepreciationReport(m.depreciation):[]),...(m.costs?normalCostReport(m.costs):[]),...(m.base?normalBaseReport(m.base):[]),...(m.assessment?normalAssessmentReport(m.assessment):[]),...(m.schedules?[['IRPC normal — L6','Mapas complementares',`Efeito líquido adicional:${money(m.schedules.net)};perda fiscal do próprio exercício:${money(m.currentLoss??null)};sem reporte ou consumo automático. ${m.schedules.pending.join(' | ')}`,m.schedules.source]as[string,string,string,string],...m.schedules.effects.map(e=>{const i=m.schedules!.input.rows.find(r=>r.id===e.id)!;return['IRPC normal — L6',i.document+'/'+i.line,`Montante:${money(e.amount)};efeito:${money(e.effect)};${e.reason}`,`${i.reference};exercício de imputação:${i.fiscalYear||'Não aplicável'}`]as[string,string,string,string];}),...m.schedules.assets.map(a=>['IRPC normal — L6',a.description,`Depreciação contabilística:${money(a.accountingValue)};quota fiscal:${money(a.fiscal)};acréscimo:${money(a.adjustment)};${a.reason}`,`${a.tableReference};${a.reference}`]as[string,string,string,string]),['IRPC normal — L6','Juros financeiros ordinários',`Remanescente aceite no recorte:${money(m.schedules.interest)};não corresponde a juros de mora/compensatórios L5.`,m.schedules.input.interest.reference]as[string,string,string,string]]:[]),...(m.schedules&&!m.formPreparation?[...normalFormFields(m).fields.map(f=>['IRPC normal — L6','M22 campo '+f.code+' — '+f.label,`${f.display};exacto:${f.value?f.value.numerator+'/'+f.value.denominator:'Indeterminado'};transcrição:${f.transcriptionReady?'Preparação parcial com valor exacto ao cêntimo':'Pendente ou sem aplicação'};${f.reason}`,normalFormFields(m).source]as[string,string,string,string]),...normalFormFields(m).m20.fields.map(f=>['IRPC normal — L6','M20 A.1 — conta '+f.account+' — '+f.label,`${f.display};representação em meticais inteiros:${f.transcriptionReady?'Exacta':'Pendente'};${f.reason}`,`${f.reference};${normalFormFields(m).m20.source}`]as[string,string,string,string]),['IRPC normal — L6','M20 — correspondência',normalFormFields(m).m20.reason,normalFormFields(m).m20.source]as[string,string,string,string]]:[]),...m.rows.map(r=>['IRPC normal — L6',r.document+'/'+r.line,`${({calculated:'Calculado neste recorte',indeterminate:'Indeterminado',outside_scope:'Fora deste recorte'})[r.status]};montante:${r.amount};acréscimo:${money(r.adjustment)};${r.reason}`,`Origem:${({revenue:'Receitas',cost_of_sales:'Custo das vendas',operating_expenses:'Despesas operacionais',personnel:'Pessoal',depreciation:'Depreciação contabilística',interest_expense:'Juros reconhecidos'}as Record<string,string>)[r.sourceCode]??'Por corresponder'};incluído:${r.included==='yes'?'Sim':r.included==='no'?'Não':'Por demonstrar'};suporte:${r.reference}`]as[string,string,string,string]),...(m.profit?[...m.profit.lines.map(l=>['IRPC normal — L6','Conferência: '+l.label,`Estado:${l.state==='known'?'Valor conhecido':l.state==='absent'?'Ausência declarada':'Informação em falta'};origem:${l.amount};acréscimos:${money(l.addedBack)};remanescente:${money(l.remainder)};${l.reason}`,l.reference]as[string,string,string,string]),...m.profit.topics.map(t=>['IRPC normal — L6',t.label,`Estado:${t.state==='known'?'Valor conhecido':t.state==='absent'?'Ausência declarada':'Informação em falta'};montante:${money(t.value)};${t.reason}`,t.reference]as[string,string,string,string]),['IRPC normal — L6','Âmbito da conferência',m.profit.input.completenessReference,m.profit.source]as[string,string,string,string]]:[])];}catch(e){return[['IRPC normal — L6','Não recuperável',String(e),'Originais conservados.']];}}
|
||||
export function normalHtml(d:Record<string,unknown>){const b=normalBook(d);if(!normalCurrent(d,b))throw Error('Calcule e guarde as entradas actuais antes de exportar.');const esc=(s:string)=>s.replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]!));return'<!doctype html><html lang="pt"><meta charset="utf-8"><title>IRPC normal — ajustamentos</title><h1>IRPC — L6 de referência e tratamentos L7 quando qualificados</h1><p>Projecção pelos pressupostos do plano. Não é demonstração contabilística,liquidação ou Modelo20/22.</p>'+normalReportRows(d).map(r=>'<section><h2>'+esc(r[1])+'</h2><p>'+esc(r[2])+'</p><small>'+esc(r[3])+'</small></section>').join('')+'</html>';}
|
||||
@@ -1,96 +0,0 @@
|
||||
import type {IrpcRow} from './irpc-withholdings.ts';
|
||||
|
||||
export const irpcReliefVersion = 'IRPC-L5-reliefs/1';
|
||||
|
||||
export type IrpcReliefPreparation = {
|
||||
rule?: '' | 'cirpc68d' | 'cirpc68f' | 'ptMz12';
|
||||
facts?: Partial<Record<'subjectToIrpc' | 'notTransparent' | 'treatyResident' | 'beneficialOwner' | 'payerResidentMz' | 'armLength' | 'royaltyDefinition', '' | 'yes' | 'no'>>;
|
||||
kind: 'dispensation' | 'exemption' | 'treaty';
|
||||
instrument: string;
|
||||
article: string;
|
||||
country: string;
|
||||
residenceDocument: string;
|
||||
validFrom: string;
|
||||
validTo: string;
|
||||
conditions: string;
|
||||
evidence: string;
|
||||
};
|
||||
|
||||
export const irpcReliefRules = [
|
||||
['', 'Correspondência por identificar'],
|
||||
['cirpc68d', 'Dispensa — artigo 68(d), serviços / uso de equipamento'],
|
||||
['cirpc68f', 'Dispensa — artigo 68(f), gestão de imóveis próprios'],
|
||||
['ptMz12', 'Portugal–Moçambique — royalties, artigo 12'],
|
||||
] as const;
|
||||
|
||||
const documentLabels: Record<string,string> = {instrument:'diploma/convenção',article:'artigo',validFrom:'início do período',validTo:'fim do período',conditions:'condições',evidence:'documentos',country:'Estado contratante',residenceDocument:'prova de residência'};
|
||||
const factLabels: Record<string,string> = {subjectToIrpc:'Titular sujeito a IRPC neste rendimento',notTransparent:'Fora da transparência fiscal',treatyResident:'Residência convencional em Portugal',beneficialOwner:'Beneficiário efectivo',payerResidentMz:'Devedor residente em Moçambique',armLength:'Sem excesso por relações especiais',royaltyDefinition:'Definição convencional de royalties'};
|
||||
|
||||
export function evaluateIrpcRelief(row: IrpcRow, eventDate: string):
|
||||
{applied: false; reason: string} | {applied: true; treatment: 'dispensed' | 'treaty'; rate: number; reason: string; rule: string} {
|
||||
const e = row.reliefPreparation;
|
||||
if (!e) return {applied: false, reason: 'Identifique a regra da dispensa/convenção e os documentos aplicáveis.'};
|
||||
const preparation = prepareIrpcRelief(row, e);
|
||||
if (preparation.missing.length || !preparation.validPeriod || eventDate < e.validFrom || eventDate > e.validTo)
|
||||
return {applied: false, reason: 'Informação insuficiente ou período incompatível na dispensa/convenção: ' + preparation.missing.map(k=>documentLabels[k]).join(', ') + '. Confira o período e a prova aplicáveis ao primeiro evento.'};
|
||||
const f = e.facts ?? {};
|
||||
const article = e.article.toLowerCase().replace(/[^a-z0-9]/g, '');
|
||||
if (e.rule === 'cirpc68d' && article !== '68d' || e.rule === 'cirpc68f' && article !== '68f' || e.rule === 'ptMz12' && article !== '12')
|
||||
return {applied: false, reason: 'O artigo invocado diverge da regra seleccionada; reconcilie a referência sem apagar a prova.'};
|
||||
const onAccount = row.residence === 'resident' || row.residence === 'nonresident' && row.permanentEstablishment === 'yes' && row.attributable === 'yes';
|
||||
if (e.rule === 'cirpc68d' || e.rule === 'cirpc68f') {
|
||||
if (e.kind !== 'dispensation' || f.subjectToIrpc !== 'yes' || row.recipientIrpc !== 'yes' || !row.ordinary || row.ordinary.nonDigital !== 'yes' || !row.ordinary.reference.trim())
|
||||
return {applied: false, reason: 'Dispensa: identifique o titular sujeito a IRPC relativamente a este rendimento e a classificação não digital, com suporte.'};
|
||||
if (e.rule === 'cirpc68d' && (!onAccount || !['equipment', 'services'].includes(row.kind)))
|
||||
return {applied: false, reason: 'Artigo 68(d) exige rendimento 67(1)b/g com natureza de imposto por conta; não dispensa retenções definitivas.'};
|
||||
if (e.rule === 'cirpc68f' && (row.kind !== 'rent' || row.ordinary.rentOwnPropertyManagement !== 'yes' || f.notTransparent !== 'yes'))
|
||||
return {applied: false, reason: 'Artigo 68(f): faltam rendas de sociedade de gestão de imóveis próprios e exclusão documentada da transparência fiscal (6(1)c).'};
|
||||
return {applied: true, treatment: 'dispensed', rate: 0, rule: e.rule,
|
||||
reason: `Dispensa de retenção ${e.rule === 'cirpc68d' ? '68(d), rendimentos 67(1)b/g' : '68(f), rendimentos prediais 67(1)c e 6(1)c'}; CIRPC Lei 34/2007, PDF19/p768(73). Sem retenção nesta operação; não é isenção do rendimento nem crédito anual.`};
|
||||
}
|
||||
if (e.rule === 'ptMz12') {
|
||||
if (e.kind !== 'treaty' || !['PT', 'PORTUGAL'].includes(e.country.trim().toUpperCase()) || row.residence !== 'nonresident' || row.permanentEstablishment !== 'no' || !['royalty', 'equipment'].includes(row.kind) || row.ordinary?.nonDigital !== 'yes' || !row.ordinary.reference.trim())
|
||||
return {applied: false, reason: 'Convenção PT–MZ, artigo 12: este recorte exige titular residente em Portugal, sem EP em Moçambique e royalties/uso de equipamento qualificados não digitais. Outros casos conservam correspondência própria.'};
|
||||
if (['treatyResident', 'beneficialOwner', 'payerResidentMz', 'armLength', 'royaltyDefinition'].some(k => f[k as keyof typeof f] !== 'yes'))
|
||||
return {applied: false, reason: 'Informação insuficiente: documente residência convencional (art.4), beneficiário efectivo, devedor residente em Moçambique, definição de royalties e ausência de excesso por relações especiais (art.12(2–6)).'};
|
||||
return {applied: true, treatment: 'treaty', rate: 10, rule: e.rule,
|
||||
reason: 'Limite convencional de 10% sobre royalties brutas: CDT PT–MZ artigo12(2–6), RAR36/1992; definição12(3) e IRPC actualizados pelo Protocolo/RAR36/2009 arts1/7. Cálculo da retenção; formalidades de accionamento e MRFTA não equivalem a submissão ou aceitação AT.'};
|
||||
}
|
||||
return {applied: false, reason: 'Dispensa, isenção ou convenção sem correspondência executável neste recorte; conserve os documentos e identifique a regra específica.'};
|
||||
}
|
||||
|
||||
export const newIrpcReliefPreparation = (): IrpcReliefPreparation => ({
|
||||
kind: 'dispensation', instrument: '', article: '', country: '',
|
||||
residenceDocument: '', validFrom: '', validTo: '', conditions: '', evidence: '',
|
||||
});
|
||||
|
||||
// A preparation records an invocation; it does not activate a tax rule.
|
||||
export function prepareIrpcRelief(row: IrpcRow, evidence: IrpcReliefPreparation) {
|
||||
const missing = (['instrument', 'article', 'validFrom', 'validTo', 'conditions', 'evidence'] as const)
|
||||
.filter(key => !evidence[key].trim()).map(String);
|
||||
if (evidence.kind === 'treaty') {
|
||||
if (!evidence.country.trim()) missing.push('country');
|
||||
if (!evidence.residenceDocument.trim()) missing.push('residenceDocument');
|
||||
}
|
||||
const validDate = (s: string) => /^\d{4}-\d{2}-\d{2}$/.test(s) &&
|
||||
Number.isFinite(Date.parse(s)) && new Date(s).toISOString().slice(0, 10) === s;
|
||||
const validPeriod = validDate(evidence.validFrom) && validDate(evidence.validTo) && evidence.validFrom <= evidence.validTo;
|
||||
const outsidePeriod = validPeriod && row.events.some(event => validDate(event.date) &&
|
||||
(event.date < evidence.validFrom || event.date > evidence.validTo));
|
||||
return {
|
||||
counterparty: row.counterparty, residence: row.residence,
|
||||
permanentEstablishment: row.permanentEstablishment, attributable: row.attributable,
|
||||
documentRef: row.documentRef, qualificationRef: row.qualificationRef,
|
||||
previousReference: row.reliefRef, evidence: structuredClone(evidence),
|
||||
missing, validPeriod, outsidePeriod,
|
||||
status: 'preparation' as const,
|
||||
notice: 'Condições e documentos invocados; o cálculo verifica apenas a regra seleccionada e o período aplicável.',
|
||||
};
|
||||
}
|
||||
|
||||
export function irpcReliefEvidenceLabel(row: IrpcRow): string {
|
||||
const e = row.reliefPreparation;
|
||||
if (!e) return row.reliefRef || 'Sem benefício invocado';
|
||||
const p = prepareIrpcRelief(row, e);
|
||||
return `${irpcReliefRules.find(([rule])=>rule===e.rule)?.[1]??'Regra por corresponder'};${e.instrument};artigo:${e.article};período:${e.validFrom}–${e.validTo};Estado:${e.country};residência fiscal:${e.residenceDocument};condições:${e.conditions};provas:${e.evidence};${Object.entries(e.facts??{}).map(([k,v])=>`${factLabels[k]??k}:${v==='yes'?'Sim':v==='no'?'Não':'Por esclarecer'}`).join(';')};${p.missing.length?'Falta: '+p.missing.map(k=>documentLabels[k]).join(', '):'Elementos documentais registados'};${p.validPeriod?'Período válido':'Período por resolver'};referência anterior:${row.reliefRef}`;
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
import type {NormalBook,NormalModel} from './irpc-normal.ts';
|
||||
import {calculateNormalBase} from './irpc-normal-base.ts';
|
||||
import {calculateNormalAssessment} from './irpc-normal-assessment.ts';
|
||||
import {calculateNormalDepreciation,type NormalDepreciationModel} from './irpc-normal-depreciation.ts';
|
||||
import {addFractions,subtractFractions,decimalFraction,fraction,fractionPresentation,type FiscalFraction} from './fiscal-rational.ts';
|
||||
|
||||
export const irpcSpecialVersion='IRPC-normal-adjustments/10';
|
||||
export const irpcSpecialMonthlyVersion='IRPC-normal-adjustments/11';
|
||||
export const irpcSpecialStartPeriodVersion='IRPC-normal-adjustments/12';
|
||||
export const irpcSpecialCessationPriorVersion='IRPC-normal-adjustments/13';
|
||||
export const specialCessationPriorSource='CBF3/9/10/16;CIRPC7(4);Decreto72/2013 art3(3),9(1–3) e10:residente,ano civil2026 ou período curto de cessação com meses completosL6. Activo novo a custo histórico,entrada2025/2026,método constante/taxa normal máxima e duodécimos desde a entrada. Taxa ×1,5,limites contabilizado elegível e saldo fiscal;quotas anteriores e parcela temporariamente tributada documentadas emL6,sem recalcular o passado nem consumir saldos oficiais. Saída do activo só quando declarada,excluindo o mês do evento;cessação não presume transmissão. Sem cumulação.';
|
||||
export const specialStartPeriodSource='CBF3/9/10/16;CIRPC7(4);Decreto72/2013 art3(3)/9(3):período curto por início de actividade de residente em2026. Taxa normal máxima ×1,5 ×meses efectivos/12 reutilizados de L6,sem anualização;activo novo emuso no período,método constante,sem saída/quotas anteriores/cumulação. Limites contabilizado elegível e saldo fiscal;apenas diferença adicional.';
|
||||
export const specialMonthlySource='CBF16 com Decreto72/2013 art9:taxa normal máxima ×1,5 ×duodécimos/12,meses reutilizados do mapaL6. Exercício anual civil2026,entrada emuso no ano,método constante,sem saída/quotas anteriores/cumulação. Dedução limitada ao contabilizado elegível e saldo fiscal;apenas diferença adicional,não nova amortização contabilística.';
|
||||
export const specialSources={expenses:'CIRPC,Lei34/2007,art61(4),PDF17/p768(71):35% sobre encargos não devidamente documentados e despesas confidenciais/ilícitas,sem prejuízo do36(1)g. Exercício2026;sem regra inferida da falta de anexo.',cooperative:'CIRPC,Lei34/2007,art12/14,PDF5/p768(59),e61(1):cooperativas agrárias,de artesanato e culturais;redução de50% da taxa geral32%=16%;rendimentos sujeitos a retenção excluídos deste benefício. Recorte2026,residente,parcela ordinária integralmente elegível.',acceleration:'CBF,Lei4/2009,art3/4/9/10/16;compilação oficial APIEX pp66–68/72:incremento50% das taxas normais nos imóveis novos do projecto e,nas mesmas condições,imóveis reabilitados/máquinas e equipamentos industriais ou agro-industriais. Decreto72/2013 art3(3):limite contabilizado e saldo fiscal. Recorte constante pela taxa normal máxima da tabela,primeiro exercício anual2026,sem cumulação presumida.'}as const;
|
||||
export type Qualification={state:''|'known'|'absent'|'not_applicable';eligible:''|'yes'|'no';from:string;to:string;reference:string;periodReference:string};
|
||||
export const newQualification=():Qualification=>({state:'',eligible:'',from:'',to:'',reference:'',periodReference:''});
|
||||
export type SpecialExpense={id:string;scheduleId:string;nature:''|'undocumented'|'confidential'|'illicit'|'other';eligible:''|'yes'|'no';reference:string};
|
||||
export type AcceleratedAsset={id:string;assetId:string;kind:''|'new_project_building'|'rehabilitated_project_building'|'industrial_equipment'|'agroindustrial_equipment'|'other';eligible:''|'yes'|'no';reference:string};
|
||||
export type SpecialContinuationInput={version:1;period:''|'annual'|'cessation';reference:string;historyReference:string;monthlyFromStart:''|'yes'|'no'};
|
||||
export type SpecialMonthlyInput={version:1;reference:string;startPeriod?:{version:1;reference:string};continuation?:SpecialContinuationInput};
|
||||
export type SpecialInput={version:1;expenses:{qualification:Qualification;rows:SpecialExpense[]};cooperative:{qualification:Qualification;kind:''|'agrarian'|'craft'|'cultural'|'other';allIncomeEligible:''|'yes'|'no';withheldIncome:''|'absent'|'known'};acceleration:{qualification:Qualification;cbfRequirements:''|'yes'|'no';recognition:''|'documented'|'not_required';recognitionReference:string;noOtherBenefits:''|'yes'|'no';rows:AcceleratedAsset[];monthly?:SpecialMonthlyInput}};
|
||||
export const specialCalculationVersion=(i:SpecialInput)=>i.acceleration.monthly?.continuation?irpcSpecialCessationPriorVersion:i.acceleration.monthly?.startPeriod?irpcSpecialStartPeriodVersion:i.acceleration.monthly?irpcSpecialMonthlyVersion:irpcSpecialVersion;
|
||||
export const newSpecialInput=():SpecialInput=>({version:1,expenses:{qualification:newQualification(),rows:[]},cooperative:{qualification:newQualification(),kind:'',allIncomeEligible:'',withheldIncome:''},acceleration:{qualification:newQualification(),cbfRequirements:'',recognition:'',recognitionReference:'',noOtherBenefits:'',rows:[]}});
|
||||
export const newSpecialExpense=(id:string):SpecialExpense=>({id,scheduleId:'',nature:'',eligible:'',reference:''});
|
||||
export const newAcceleratedAsset=(id:string):AcceleratedAsset=>({id,assetId:'',kind:'',eligible:'',reference:''});
|
||||
const choices=(v:unknown,allowed:string[])=>typeof v==='string'&&allowed.includes(v);
|
||||
export function validateSpecial(i:SpecialInput){
|
||||
if(!i||i.version!==1||!i.expenses||!i.cooperative||!i.acceleration)throw Error('Qualificação L7 não recuperável;originais conservados.');
|
||||
if(i.acceleration.monthly!==undefined&&(!i.acceleration.monthly||i.acceleration.monthly.version!==1||typeof i.acceleration.monthly.reference!=='string'))throw Error('Preparação CBF16 por duodécimos não recuperável;históricos conservados.');
|
||||
if(i.acceleration.monthly?.startPeriod!==undefined&&(!i.acceleration.monthly.startPeriod||i.acceleration.monthly.startPeriod.version!==1||typeof i.acceleration.monthly.startPeriod.reference!=='string'))throw Error('Preparação CBF16 para início de actividade não recuperável;históricos conservados.');
|
||||
const continuation=i.acceleration.monthly?.continuation;
|
||||
if(continuation!==undefined&&(!continuation||continuation.version!==1||!choices(continuation.period,['','annual','cessation'])||typeof continuation.reference!=='string'||typeof continuation.historyReference!=='string'||!choices(continuation.monthlyFromStart,['','yes','no'])||i.acceleration.monthly?.startPeriod!==undefined))throw Error('Preparação CBF16 de cessação/quotas anteriores não recuperável ou incompatível com início de actividade;históricos conservados.');
|
||||
for(const q of[i.expenses.qualification,i.cooperative.qualification,i.acceleration.qualification])if(!q||!choices(q.state,['','known','absent','not_applicable'])||!choices(q.eligible,['','yes','no'])||['from','to','reference','periodReference'].some(k=>typeof q[k as 'from']!=='string'))throw Error('Condição/período L7 não recuperável.');
|
||||
for(const [rows,keys]of [[i.expenses.rows,Object.keys(newSpecialExpense(''))],[i.acceleration.rows,Object.keys(newAcceleratedAsset(''))]]as const){if(!Array.isArray(rows)||new Set(rows.map(r=>r.id)).size!==rows.length||rows.some(r=>!r||keys.some(k=>typeof(r as unknown as Record<string,unknown>)[k]!=='string')||!choices(r.eligible,['','yes','no'])))throw Error('Parcela L7 não recuperável ou identificador repetido.');}
|
||||
if(i.expenses.rows.some(r=>!choices(r.nature,['','undocumented','confidential','illicit','other']))||i.acceleration.rows.some(r=>!choices(r.kind,['','new_project_building','rehabilitated_project_building','industrial_equipment','agroindustrial_equipment','other'])))throw Error('Natureza L7 desconhecida.');
|
||||
if(!choices(i.cooperative.kind,['','agrarian','craft','cultural','other'])||!choices(i.cooperative.allIncomeEligible,['','yes','no'])||!choices(i.cooperative.withheldIncome,['','absent','known'])||!choices(i.acceleration.cbfRequirements,['','yes','no'])||!choices(i.acceleration.noOtherBenefits,['','yes','no'])||!choices(i.acceleration.recognition,['','documented','not_required'])||typeof i.acceleration.recognitionReference!=='string')throw Error('Parâmetro L7 não recuperável.');
|
||||
}
|
||||
type Status='calculated'|'absent'|'not_applicable'|'indeterminate';
|
||||
type Decision={status:Status;reason:string;pending:string[]};
|
||||
const z=()=>fraction(0n),mul=(v:FiscalFraction,n:bigint,d=1n)=>fraction(BigInt(v.numerator)*n,BigInt(v.denominator)*d);
|
||||
const cmp=(a:FiscalFraction,b:FiscalFraction)=>BigInt(a.numerator)*BigInt(b.denominator)-BigInt(b.numerator)*BigInt(a.denominator);
|
||||
const iso=(s:string)=>/^20\d{2}-\d{2}-\d{2}$/.test(s)&&Number.isFinite(Date.parse(s))&&new Date(s).toISOString().slice(0,10)===s;
|
||||
export function specialContext(d:Record<string,unknown>){return Object.fromEntries(['context_opportunity','context_opportunity_snapshot','context_applicability_snapshot','context_reuse','sector_id','sector_id_label','province_id','province_id_label','district_id','district_id_label','admin_post_id','admin_post_id_label','locality_id','locality_id_label','selection_labels'].map(k=>[k,d[k]??null]));}
|
||||
export const specialDependency=(d:Record<string,unknown>)=>JSON.stringify(specialContext(d));
|
||||
const specialPeriod=(b:NormalBook,m:NormalModel)=>b.periodsFx?{from:b.periodsFx.from,to:b.periodsFx.to,pending:m.periodsFx?.pending??[]}:m.fiscalPeriod??{from:b.year+'-01-01',to:b.year+'-12-31',pending:[]};
|
||||
function qualify(q:Qualification,b:NormalBook,m:NormalModel):Decision{
|
||||
const pending:string[]=[],p=specialPeriod(b,m);
|
||||
if(!q.state)pending.push('Informação em falta:identifique o estado do tratamento.');
|
||||
if(!q.reference.trim())pending.push('Falta prova/declaração das condições ou da ausência/não aplicação.');
|
||||
if(!iso(q.from)||!iso(q.to)||q.from!==p.from||q.to!==p.to||!q.periodReference.trim())pending.push('Período do tratamento deve corresponder ao período fiscal documentado,com suporte próprio;sem transpor vigência.');
|
||||
if(b.year!=='2026'||m.currency!=='MZN'||!b.base?.subjectNuit.match(/^\d{9}$/)||!b.base.identityReference.trim()||!b.scopeReference.trim()||!['resident_general','ep_general'].includes(b.scope)||p.pending.length)pending.push('Sujeito/NUIT,âmbito ou período2026 emMZN por reconciliar na base existente.');
|
||||
if(q.state==='known'&&!q.eligible)pending.push('Condições documentadas por qualificar:sim,não ou informação em falta.');
|
||||
if(q.state!=='known'&&q.eligible)pending.push('Estado de ausência/não aplicação/informação em falta não admite condição de benefício preenchida.');
|
||||
if(pending.length)return{status:'indeterminate',pending,reason:pending.join(' ')};
|
||||
const status=q.state==='absent'?'absent':q.state==='not_applicable'||q.eligible==='no'?'not_applicable':'calculated';
|
||||
return{status,pending,reason:status==='absent'?'Ausência declarada com suporte;efeito zero neste período.':status==='not_applicable'?'Tratamento não aplicável/condição negativa documentada;percurso normal conservado.':'Condições e período documentados no recorte.'};
|
||||
}
|
||||
function fail(d:Decision,reason:string){d.status='indeterminate';d.pending.push(reason);d.reason=d.pending.join(' ');}
|
||||
export function calculateSpecial(draft:Record<string,unknown>,b:NormalBook,m:NormalModel,source:Parameters<typeof calculateNormalDepreciation>[1]){
|
||||
const i=b.special!;validateSpecial(i);const expenseDecision=qualify(i.expenses.qualification,b,m),coopDecision=qualify(i.cooperative.qualification,b,m),accDecision=qualify(i.acceleration.qualification,b,m);
|
||||
const existing=(b.schedules?.rows??[]).filter(r=>r.rule==='undocumented');
|
||||
if(expenseDecision.status==='absent'&&(existing.length||i.expenses.rows.length))fail(expenseDecision,'Ausência declarada contradiz despesas36g ou linhasL7 presentes;reconcilie sem apagar o ajustamento.');
|
||||
if(expenseDecision.status!=='calculated'&&i.expenses.rows.length&&expenseDecision.status!=='indeterminate')fail(expenseDecision,'Estado global e parcelas da despesa contraditórios;qualifique as parcelas ou conserve apenas a declaração.');
|
||||
const expenses=i.expenses.rows.map(r=>{
|
||||
const origin=existing.find(x=>x.id===r.scheduleId),effect=m.schedules?.effects.find(x=>x.id===r.scheduleId);let amount:FiscalFraction|null=effect?.amount??null,tax:FiscalFraction|null=null,status:Status='indeterminate';const reasons:string[]=[];
|
||||
if(expenseDecision.status!=='calculated')reasons.push(expenseDecision.reason);
|
||||
if(!origin||!effect?.effect||!effect.amount||cmp(effect.effect,effect.amount)!==0n)reasons.push('Seleccione ajustamento36g calculado emL6;imposto autónomo não acrescenta novamente a despesa.');
|
||||
if(i.expenses.rows.filter(x=>x.scheduleId===r.scheduleId).length!==1)reasons.push('Despesa L6 repetida no imposto autónomo;uma referência por parcela.');
|
||||
if(!r.reference.trim()||!r.eligible||!r.nature)reasons.push('Falta classificação legal documentada da despesa;ausência de anexo não prova61(4).');
|
||||
if(!reasons.length){status=r.eligible==='no'?'not_applicable':r.nature==='other'?'indeterminate':'calculated';if(status==='indeterminate')reasons.push('Outra natureza por corresponder;sem taxa provisória.');else tax=status==='calculated'?mul(amount!,35n,100n):z();}
|
||||
return{...structuredClone(r),document:origin?.document??'',line:origin?.line??'',sourceCode:origin?.sourceCode??'',amount,l6Adjustment:effect?.effect??null,additionalProfitAdjustment:z(),rate:status==='calculated'?fraction(35n):null,tax,status,reason:reasons.join(' ')||(status==='calculated'?'CIRPC61(4):despesa ×35%;ajustamento36g reutilizado,sem duplicação.':'Condição negativa documentada;sem imposto autónomo aplicado à parcela.')};
|
||||
});
|
||||
if(expenseDecision.status==='calculated'){
|
||||
if(!existing.length&&!expenses.length)fail(expenseDecision,'Não há parcelas conhecidas;declare ausência com suporte ou seleccione despesas36g.');
|
||||
if(existing.some(r=>!expenses.some(x=>x.scheduleId===r.id)))fail(expenseDecision,'Há despesa36g sem qualificação autónoma;corresponda cada parcela ou justifique a sua não aplicação.');
|
||||
for(const r of expenses)if(r.status==='indeterminate')fail(expenseDecision,(r.document||r.id)+': '+r.reason);
|
||||
}
|
||||
const knownAutonomous=addFractions(expenses.flatMap(r=>r.tax?[r.tax]:[])),autonomousTax=expenseDecision.status==='indeterminate'?null:expenseDecision.status==='calculated'?knownAutonomous:z();
|
||||
if(coopDecision.status==='absent'&&['agrarian','craft','cultural'].includes(i.cooperative.kind)&&i.cooperative.allIncomeEligible==='yes'&&i.cooperative.withheldIncome==='absent')fail(coopDecision,'Ausência de redução contradiz os dados positivos de cooperativa integralmente elegível;reconcilie a declaração sem apagar os dados.');
|
||||
if(coopDecision.status==='calculated'){
|
||||
if(b.scope!=='resident_general'||!['agrarian','craft','cultural'].includes(i.cooperative.kind))fail(coopDecision,'Art12:tipo de cooperativa abrangida e residência por documentar;outras entidades têm correspondência própria.');
|
||||
if(i.cooperative.allIncomeEligible!=='yes'||i.cooperative.withheldIncome!=='absent')fail(coopDecision,'Recorte exige base ordinária integralmente elegível e ausência documentada de rendimentos sujeitos a retenção;parcelas mistas/retidas exigem segregação própria,sem redução global presumida.');
|
||||
}
|
||||
if(accDecision.status==='absent'&&i.acceleration.rows.length)fail(accDecision,'Ausência de amortização acelerada contradiz activos seleccionados.');
|
||||
if(accDecision.status!=='calculated'&&i.acceleration.rows.length&&accDecision.status!=='indeterminate')fail(accDecision,'Não aplicação global com activos seleccionados:reconcilie o estado e as parcelas.');
|
||||
if(accDecision.status==='calculated'){
|
||||
if(i.acceleration.monthly&&!i.acceleration.monthly.reference.trim())fail(accDecision,'Falta suporte da reutilização dos meses e da opção por duodécimosCBF16 no mapaL6.');
|
||||
if(i.acceleration.monthly?.startPeriod&&!i.acceleration.monthly.startPeriod.reference.trim())fail(accDecision,'Falta suporte do período curto por início de actividadeCBF16;período e activosL6 conservados.');
|
||||
const continuation=i.acceleration.monthly?.continuation;
|
||||
if(continuation?.monthlyFromStart==='no')fail(accDecision,'Duodécimos desde a entrada emuso não aplicados:esta combinação de quotas/saída exige correspondência própria;L6 e os saldos declarados ficam preservados.');
|
||||
if(continuation&&(!continuation.period||!continuation.reference.trim()||!continuation.historyReference.trim()||!continuation.monthlyFromStart))fail(accDecision,'CBF16 cessação/quotas anteriores:identifique período,suporte da vigência/condições e das quotas anteriores ou ausência;duodécimos desde a entrada emuso por documentar. Sem recalcular ou presumir saldos anteriores.');
|
||||
if(i.acceleration.cbfRequirements!=='yes'||!i.acceleration.recognition||!i.acceleration.recognitionReference.trim())fail(accDecision,'Falta enquadramentoCBF3/9 e reconhecimento10 quando exigido;excepção deve ter norma/suporte,não localização.');
|
||||
if(i.acceleration.noOtherBenefits!=='yes')fail(accDecision,'CumulaçãoCBF4 por corresponder;este recorte não combina outros benefícios positivos.');
|
||||
if(coopDecision.status==='calculated')fail(accDecision,'Combinação de redução cooperativa comCBF16 ainda não correspondida;cada caso independente continua demonstrável.');
|
||||
if(!b.depreciation||!m.depreciation||!i.acceleration.rows.length)fail(accDecision,'Seleccione activos do mapaL6 já reconciliado;sem criar activo ou quota paralelos.');
|
||||
}
|
||||
const accelerations=i.acceleration.rows.map(r=>{
|
||||
const a=b.depreciation?.assets.find(x=>x.id===r.assetId),base=m.depreciation?.assets.find(x=>x.id===r.assetId),issues:string[]=[];let status:Status='indeterminate';
|
||||
if(accDecision.status!=='calculated')issues.push(accDecision.reason);
|
||||
if(!r.reference.trim()||!r.eligible||!r.kind)issues.push('Condição/afectação do activo ao projecto por documentar.');
|
||||
if(i.acceleration.rows.filter(x=>x.assetId===r.assetId).length!==1)issues.push('Activo repetido no benefício.');
|
||||
if(!a||base?.status!=='calculated')issues.push('ActivoL6 inexistente ou cálculo de origem indeterminado.');
|
||||
if(!issues.length&&r.eligible==='no')status='not_applicable';
|
||||
else if(!issues.length&&a){
|
||||
const building=r.kind==='new_project_building'&&base?.catalog?.kind==='building',equipment=['industrial_equipment','agroindustrial_equipment'].includes(r.kind)&&['machine','laundry_machine'].includes(a.category);
|
||||
if(!building&&!equipment)issues.push('Categoria/afectação fora do recorte:imóvel novo ou máquina industrial/agro-industrial correspondida;reabilitados e outras categorias/métodos exigem regra própria.');
|
||||
if(base?.catalog&&cmp(decimalFraction(a.rate),decimalFraction(base.catalog.rate))!==0n)issues.push('RecorteCBF16 usa a taxa normal máxima da tabela;opção por quota inferior exige correspondência própria,sem a acelerar por aproximação.');
|
||||
if(i.acceleration.monthly){
|
||||
const p=specialPeriod(b,m),priorZero=[a.previousAccounting,a.previousFiscal,a.priorAvailable].every(v=>cmp(decimalFraction(v),z())===0n);
|
||||
if(i.acceleration.monthly.continuation){
|
||||
const c=i.acceleration.monthly.continuation,annual=c.period==='annual'&&p.from==='2026-01-01'&&p.to==='2026-12-31'&&!m.periodsFx?.short,cessation=c.period==='cessation'&&b.periodsFx?.kind==='cessation'&&m.periodsFx?.short&&p.from==='2026-01-01'&&iso(p.to)&&p.to<'2026-12-01';
|
||||
if(b.scope!=='resident_general'||p.pending.length||!annual&&!cessation||a.method!=='constant'||a.timing!=='months'||!iso(a.start)||a.start<'2025-01-01'||a.start>p.to||a.start>='2026-01-01'&&!priorZero||a.exitState!=='absent'&&!(a.exitState==='known'&&iso(a.exitDate)&&a.exitDate>=p.from&&a.exitDate<=p.to)||base?.months===null||base?.months===undefined)issues.push('CBF16 cessação/quotas anteriores:residente,ano civil2026 ou cessaçãoL6 de meses completos desde1Janeiro,activo novo com entrada2025/2026 e saldosL6 reconciliados,método constante e duodécimos. Quotas anteriores positivas exigem entrada2025;saída só por evento documentado dentro do período. Outros anos/períodos/métodos mantêm correspondência própria.');
|
||||
}else if(i.acceleration.monthly.startPeriod){
|
||||
if(b.scope!=='resident_general'||b.periodsFx?.kind!=='start'||!m.periodsFx?.short||p.pending.length||!iso(p.from)||p.from<'2026-02-01'||p.from>'2026-12-01'||p.from.slice(-2)!=='01'||p.to!=='2026-12-31'||a.method!=='constant'||a.timing!=='months'||!iso(a.start)||a.start<p.from||a.start>p.to||a.exitState!=='absent'||!priorZero||base?.months===null||base?.months===undefined)issues.push('CBF16 início de actividade:residente,período curtoL6 de meses completos em2026 até31/12,activo novo emuso dentro do período,método constante,opção mensal e ausência documentada de saída/quotas anteriores;cessação/transição e demais situações permanecem separadas.');
|
||||
}else if(a.method!=='constant'||a.timing!=='months'||!iso(a.start)||a.start<'2026-01-01'||a.start>'2026-12-31'||a.exitState!=='absent'||!priorZero||p.from!=='2026-01-01'||p.to!=='2026-12-31'||base?.months===null||base?.months===undefined)issues.push('CBF16 por duodécimos:exercício anual civil2026,método constante,entrada no ano,opção mensalL6 e ausência documentada de saída/quotas anteriores;outros períodos/casos permanecem separados.');
|
||||
}else if(a.method!=='constant'||a.timing!=='annual'||a.start!=='2026-01-01'||a.exitState!=='absent'||a.previousAccounting!=='0'||a.previousFiscal!=='0'||a.priorAvailable!=='0'||m.fiscalPeriod?.from!=='2026-01-01'||m.fiscalPeriod?.to!=='2026-12-31')issues.push('CBF16 inicial:primeiro exercício anual civil2026,método constante,sem quotas anteriores ou saída;duodécimos e recuperação anterior continuam separados.');
|
||||
if(!issues.length)status='calculated';
|
||||
}
|
||||
return{...structuredClone(r),assetKey:a?.assetKey??'',description:a?.description??'',status,reason:issues.join(' ')||(status==='calculated'?'Activo existente elegível;taxa normal ×1,5,com limite contabilístico e saldo fiscal.':'Condição negativa documentada;quota normal mantida.')};
|
||||
});
|
||||
let acceleratedDepreciation:NormalDepreciationModel|null=null,additionalDeduction:FiscalFraction|null=accDecision.status==='indeterminate'?null:z();
|
||||
if(accDecision.status==='calculated'){
|
||||
for(const r of accelerations)if(r.status==='indeterminate')fail(accDecision,(r.description||r.id)+': '+r.reason);
|
||||
if(accDecision.status==='calculated'&&b.depreciation&&m.depreciation?.adjustment){
|
||||
const startPeriod=!!i.acceleration.monthly?.startPeriod,continuation=i.acceleration.monthly?.continuation;
|
||||
acceleratedDepreciation=calculateNormalDepreciation(b.depreciation,source,startPeriod||continuation?specialPeriod(b,m):{from:'2026-01-01',to:'2026-12-31'},[...b.rows,...(b.schedules?.rows??[]),...(b.costs?.rows??[])],startPeriod||continuation?.period==='cessation',new Set(accelerations.filter(r=>r.status==='calculated').map(r=>r.assetId)));
|
||||
if(startPeriod||continuation)acceleratedDepreciation={...acceleratedDepreciation,source:continuation?specialCessationPriorSource:specialStartPeriodSource};
|
||||
if(acceleratedDepreciation.adjustment===null)fail(accDecision,acceleratedDepreciation.pending.join(' '));
|
||||
else additionalDeduction=subtractFractions(m.depreciation.adjustment,acceleratedDepreciation.adjustment);
|
||||
}else if(accDecision.status==='calculated')fail(accDecision,'Reconciliação da amortização normal em falta.');
|
||||
}
|
||||
if(accDecision.status==='indeterminate')additionalDeduction=null;
|
||||
const taxableProfit=m.taxableProfit&&additionalDeduction?subtractFractions(m.taxableProfit,additionalDeduction):null;
|
||||
const base=b.base?calculateNormalBase(b.base,taxableProfit,b.year,b.schedules?.currentLossReference,!!m.periodsFx?.short):null;
|
||||
const assessmentInput=coopDecision.status==='calculated'?{version:1 as const,treatment:'general_61_1' as const,reference:i.cooperative.qualification.reference}:b.assessment;
|
||||
const assessment=assessmentInput?calculateNormalAssessment(assessmentInput,base?.taxableBase??null,{year:b.year,scope:b.scope,currency:m.currency,extended:!!b.schedules||!!b.periodsFx,short:!!m.periodsFx?.short,period:specialPeriod(b,m)}):null;
|
||||
const normalColecta=assessment?.colecta??null,colecta=coopDecision.status==='indeterminate'?null:normalColecta?(coopDecision.status==='calculated'?mul(normalColecta,1n,2n):normalColecta):null;
|
||||
const combinedColecta=colecta&&autonomousTax?addFractions([colecta,autonomousTax]):null;
|
||||
const monthlySource=i.acceleration.monthly?.continuation?specialCessationPriorSource:i.acceleration.monthly?.startPeriod?specialStartPeriodSource:specialMonthlySource;
|
||||
const monthlyModel=i.acceleration.monthly?{input:structuredClone(i.acceleration.monthly),period:specialPeriod(b,m),source:monthlySource,assets:accelerations.map(r=>{
|
||||
const input=b.depreciation?.assets.find(a=>a.id===r.assetId),normal=m.depreciation?.assets.find(a=>a.id===r.assetId),accelerated=acceleratedDepreciation?.assets.find(a=>a.id===r.assetId),applied=accDecision.status==='calculated'&&r.status==='calculated'&&accelerated?.status==='calculated',rate=normal?.status==='calculated'&&input?decimalFraction(input.rate):null;
|
||||
return{...(i.acceleration.monthly?.continuation?{prior:{previousAccounting:input?.previousAccounting??'',previousFiscal:input?.previousFiscal??'',available:input?.priorAvailable??'',reference:input?.previousReference??'',normalUsed:normal?.priorUsed??null,normalRemaining:normal?.priorRemaining??null,acceleratedUsed:applied?accelerated.priorUsed:null,acceleratedRemaining:applied?accelerated.priorRemaining:null,normalFiscalRemaining:normal?.remainingFiscal??null,acceleratedFiscalRemaining:applied?accelerated.remainingFiscal:null},exit:{state:input?.exitState??'',date:input?.exitDate??''}}:{}),id:r.id,assetId:r.assetId,assetKey:r.assetKey,description:r.description,start:input?.start??'',months:normal?.months??null,taxBasis:normal?.taxBasis??null,normalRate:rate,acceleratedRate:applied&&rate?mul(rate,3n,2n):null,normalQuota:normal?.quota??null,acceleratedQuota:applied?accelerated.quota:null,normalDeduction:normal?.deduction??null,acceleratedDeduction:applied?accelerated.deduction:null,additionalDeduction:applied&&normal?.deduction&&accelerated.deduction?subtractFractions(accelerated.deduction,normal.deduction):r.status==='not_applicable'?z():null,applied,reason:r.reason};
|
||||
})}:undefined;
|
||||
return{input:structuredClone(i),context:structuredClone(specialContext(draft)),subjectNuit:b.base?.subjectNuit??'',period:specialPeriod(b,m),expenses:{...expenseDecision,rows:expenses,knownAutonomous,autonomousTax,source:specialSources.expenses},cooperative:{...coopDecision,rate:coopDecision.status==='calculated'?fraction(16n):null,source:specialSources.cooperative},acceleration:{...accDecision,rows:accelerations,additionalDeduction,normal:m.depreciation??null,accelerated:acceleratedDepreciation,...(monthlyModel?{monthly:monthlyModel}:{}),source:i.acceleration.monthly?.continuation?specialCessationPriorSource:i.acceleration.monthly?.startPeriod?specialStartPeriodSource:i.acceleration.monthly?specialSources.acceleration+' '+specialMonthlySource:specialSources.acceleration},reference:{taxableProfit:m.taxableProfit,taxableBase:m.taxableBase,colecta:m.colecta??null},taxableProfit,taxableBase:base?.taxableBase??null,colecta,combinedColecta,pending:[...expenseDecision.pending,...coopDecision.pending,...accDecision.pending,...(base?.pending??[]),...(assessment?.pending??[])],limitations:['L7 parcial:apenas61(4),cooperativa integralmente elegível12 eCBF16 no recorte documentado.','Localização/sector só contextualizam;não activam benefícios.','Parcelas mistas,cumulação,mais-valias e demais famílias têm correspondência própria.','M20/M22 permanecem preparaçãoL6 de referência;efeitosL7 sem campo oficial presumido.','Colecta combinada não é saldo final a pagar/recuperar;retenções,pagamentos e créditos anuais emL8.'],finalBalance:{scope:'L8',payable:null,recoverable:null}};
|
||||
}
|
||||
export type SpecialModel=ReturnType<typeof calculateSpecial>;
|
||||
const money=(v:FiscalFraction|null)=>{if(!v)return'Indeterminado';const p=fractionPresentation(v);return(p.approximate?'≈':'')+p.decimal+' MZN (exacto '+v.numerator+'/'+v.denominator+')';};
|
||||
const status=(s:Status)=>({calculated:'Calculado no recorte',absent:'Ausência declarada',not_applicable:'Não aplicável',indeterminate:'Informação em falta'})[s];
|
||||
const contextDescription=(c:Record<string,unknown>)=>[['Sector','sector_id'],['Província','province_id'],['Distrito','district_id'],['Posto administrativo','admin_post_id'],['Localidade','locality_id']].map(([label,key])=>label+': '+String(c[key+'_label']||c[key]||'Por identificar')).join(';');
|
||||
export function specialReportRows(m:SpecialModel):Array<[string,string,string,string]>{return[
|
||||
['IRPC — L7','Qualificação comum',`NUIT:${m.subjectNuit};período:${m.period.from}–${m.period.to};${contextDescription(m.context)};${m.limitations.join(' ')}`,'Origem herdada conservada;fonte/condições/período por tratamento;sem concessão pela localização.'],
|
||||
['IRPC — L7','Despesas — imposto autónomo',`${status(m.expenses.status)};parcela conhecida:${money(m.expenses.knownAutonomous)};imposto autónomo reconciliado:${money(m.expenses.autonomousTax)};${m.expenses.reason}`,`${m.input.expenses.qualification.reference};${m.input.expenses.qualification.periodReference};${m.expenses.source}`],
|
||||
...m.expenses.rows.map(r=>['IRPC — L7',r.document+'/'+r.line,`${status(r.status)};natureza:${r.nature||'Por identificar'};despesa:${money(r.amount)};ajustamento36g já emL6:${money(r.l6Adjustment)};novo ajustamento ao lucro:${money(r.additionalProfitAdjustment)};taxa:${r.rate?'35%':'Não aplicada'};imposto autónomo:${money(r.tax)};${r.reason}`,r.reference]as[string,string,string,string]),
|
||||
['IRPC — L7','Cooperativa — redução da taxa',`${status(m.cooperative.status)};tipo:${m.input.cooperative.kind||'Por identificar'};taxa:${m.cooperative.rate?'16%':'Não aplicada'};${m.cooperative.reason}`,`${m.input.cooperative.qualification.reference};${m.input.cooperative.qualification.periodReference};${m.cooperative.source}`],
|
||||
['IRPC — L7','Amortizações aceleradas',`${status(m.acceleration.status)};dedução adicional conciliada:${money(m.acceleration.additionalDeduction)};${m.acceleration.reason}`,`${m.input.acceleration.qualification.reference};${m.input.acceleration.qualification.periodReference};${m.input.acceleration.recognitionReference};${m.acceleration.source}`],
|
||||
...m.acceleration.rows.map(r=>{const a=m.acceleration.accelerated?.assets.find(a=>a.id===r.assetId),n=m.acceleration.normal?.assets.find(a=>a.id===r.assetId);return['IRPC — L7',r.description||r.assetId,`${status(r.status)};quota normal:${money(n?.quota??null)};quota acelerada:${money(a?.quota??null)};dedução normal:${money(n?.deduction??null)};dedução acelerada:${money(a?.deduction??null)};${r.reason}`,r.reference]as[string,string,string,string];}),
|
||||
['IRPC — L7','Efeitos nos totais',`ReferênciaL6:lucro:${money(m.reference.taxableProfit)};base:${money(m.reference.taxableBase)};colecta:${money(m.reference.colecta)}. Após tratamentosL7:lucro:${money(m.taxableProfit)};base:${money(m.taxableBase)};colecta sobre a base:${money(m.colecta)};imposto autónomo:${money(m.expenses.autonomousTax)};colecta combinada:${money(m.combinedColecta)}. Saldo final a pagar/recuperar:Indeterminado (L8).`,m.pending.join(' | ')||'Regras/parcelas reconciliadas neste recorte;simulação,não liquidação final.'],
|
||||
...(m.acceleration.monthly?specialMonthlyReport(m.acceleration.monthly,m.acceleration.additionalDeduction):[]),
|
||||
];}
|
||||
|
||||
function specialMonthlyReport(m:NonNullable<SpecialModel['acceleration']['monthly']>,deduction:FiscalFraction|null):Array<[string,string,string,string]>{
|
||||
return[['IRPC — L7','CBF16 — duodécimos reutilizados de L6','Período:'+m.period.from+'–'+m.period.to+';dedução adicional conciliada:'+money(deduction)+';sem nova dedução do activo de origem.',m.input.reference+(m.input.startPeriod?';início de actividade:'+m.input.startPeriod.reference:'')+(m.input.continuation?';período:'+(m.input.continuation.period==='cessation'?'Cessação da actividade':m.input.continuation.period==='annual'?'Ano civil2026':'Informação em falta')+';suporte:'+m.input.continuation.reference+';histórico:'+m.input.continuation.historyReference:'')+';'+m.source],...m.assets.map(a=>['IRPC — L7','CBF16 por duodécimos — '+a.description,'Entrada emuso:'+(a.start||'Informação em falta')+';duodécimosL6:'+(a.months??'Indeterminados')+';base fiscal:'+money(a.taxBasis)+';taxa normal:'+(a.normalRate?fractionPresentation(a.normalRate).decimal+'%':'Indeterminada')+';taxa CBF16:'+(a.acceleratedRate?fractionPresentation(a.acceleratedRate).decimal+'%':'Não aplicada')+';quota normal:'+money(a.normalQuota)+';quota CBF16:'+money(a.acceleratedQuota)+';dedução normal:'+money(a.normalDeduction)+';dedução CBF16:'+money(a.acceleratedDeduction)+';diferença adicional:'+money(a.additionalDeduction)+(a.prior?';quotas contabilísticas anteriores:'+a.prior.previousAccounting+';quotas fiscais anteriores:'+a.prior.previousFiscal+';parcela anterior recuperável declarada:'+a.prior.available+';recuperada normal:'+money(a.prior.normalUsed)+';recuperada CBF16:'+money(a.prior.acceleratedUsed)+';saldo anterior aritmético normal:'+money(a.prior.normalRemaining)+';saldo anterior aritmético CBF16:'+money(a.prior.acceleratedRemaining)+';saldo fiscal normal:'+money(a.prior.normalFiscalRemaining)+';saldo fiscal CBF16:'+money(a.prior.acceleratedFiscalRemaining)+';saída:'+(a.exit?.state==='absent'?'Ausência declarada':a.exit?.state==='known'?'Evento documentado':'Informação em falta')+' '+(a.exit?.date??'')+';sem consumo de saldos oficiais':'')+';'+a.reason,m.source+(a.prior?';suporte das quotas anteriores:'+a.prior.reference:'')]as[string,string,string,string])];
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
import {validateMrfta,mrftaReportRows,type MrftaStore} from './irpc-mrfta.ts';
|
||||
import {irpcReliefVersion,evaluateIrpcRelief,irpcReliefEvidenceLabel,type IrpcReliefPreparation} from './irpc-relief-preparation.ts';
|
||||
import {convertIrpcAmount,irpcFxDependency,irpcFxEvidenceLabel,type IrpcFxAmount,type IrpcFxEvidence} from './irpc-fx.ts';
|
||||
import {acquisitionBook,acquisitionScope} from './iva-acquisitions.ts';
|
||||
import {salesBook} from './iva-operations.ts';
|
||||
import {closureFingerprint} from './iva-closure.ts';
|
||||
import {addFractions,decimalFraction,fraction,fractionPresentation,subtractFractions,type FiscalFraction} from './fiscal-rational.ts';
|
||||
|
||||
export const irpcWithholdingVersion='irpc-L5/1';
|
||||
export const irpcWithholdingSource='Lei12/2025,BR248/2025,PDF19/p2180(19):arts5(5/7),20(2)c,62(5)a/b e67(5/7);CIRPC Lei34/2007 arts2,62/67/68,PDF17–19/p768(71–73);Lei19/2013 PDF2/p682(22),62(3/4);Lei20/2022 BR252 p2731/PDF1,62(1–5). Art67(7)remete62(6),enquanto taxa nova consta62(5):divergência formal preservada,sem renumerar o original. MRFTA19/39AT,p1–2. Código2002 revogado não usado. Outros regimes/taxas dependem da correspondência específica,sem zero presumido.';
|
||||
type Choice=''|'yes'|'no';
|
||||
export type IrpcKind=''|'digital_goods'|'digital_services'|'emoney_commission'|'royalty'|'equipment'|'rent'|'capital'|'services'|'telecom'|'international_transport'|'connected_installation'|'aircraft_maintenance_charter'|'rural_public_electrification'|'maritime_fishing_cabotage'|'other';
|
||||
export const irpcKinds:Array<[IrpcKind,string]>=[['','Por identificar'],['digital_goods','Transmissão de bens digitais'],['digital_services','Prestação de serviços digitais'],['emoney_commission','Comissão de agente de moeda electrónica'],['royalty','Propriedade intelectual/industrial'],['equipment','Uso de equipamento'],['rent','Rendimento predial'],['capital','Aplicação de capitais'],['services','Outras prestações/intermediação'],['telecom','Serviços de telecomunicações — artigo62(4)a'],['international_transport','Transportes internacionais — artigo62(4)a'],['connected_installation','Montagem/instalação de equipamentos conexos a telecomunicações/transportes —62(4)a'],['aircraft_maintenance_charter','Manutenção e fretamento de aeronaves —62(4)a'],['rural_public_electrification','Construção/reabilitação de infraestruturas de produção,transporte e distribuição de energia eléctrica,nas zonas rurais,em projectos públicos de electrificação rural —62(4)b'],['maritime_fishing_cabotage','Afretamento de embarcações marítimas para pesca/cabotagem —62(4)c'],['other','Outro enquadramento']];
|
||||
export type IrpcEvent={kind:'cost'|'payment'|'maturity'|'availability'|'liquidation'|'quantification';date:string;reference:string};
|
||||
export type IrpcPayment=IrpcFxAmount&{id:string;kind:'beneficiary'|'remittance'|'withholding_proof';reference:string;date:string;amount:string;currency:string};
|
||||
export type IrpcOrdinaryFacts={nonDigital:Choice;capitalType:''|'unlisted_interest'|'unlisted_dividend'|'listed_debt_mz'|'listed_other_mz'|'liquidity_repo'|'other';rentOwnPropertyManagement:Choice;specialFacts:Choice;capitalSeatAndManagement?:Choice;reference:string};
|
||||
export const emptyIrpcOrdinaryFacts=():IrpcOrdinaryFacts=>({nonDigital:'',capitalType:'',rentOwnPropertyManagement:'',specialFacts:'',capitalSeatAndManagement:'',reference:''});
|
||||
export type IrpcRow=IrpcFxAmount&{reliefPreparation?:IrpcReliefPreparation;ordinary?:IrpcOrdinaryFacts;id:string;direction:'paid'|'received';counterparty:string;documentRef:string;description:string;base:string;currency:string;origin:'projected'|'effective';kind:IrpcKind;recipientIrpc:Choice;payerIrpc:Choice;residence:''|'resident'|'nonresident';permanentEstablishment:Choice;attributable:Choice;mozambique:Choice;qualificationRef:string;specialRelief:''|'none'|'claimed';reliefRef:string;eventsComplete:Choice;events:IrpcEvent[];settlement:''|'none'|'complete';settlementRef:string;allocations:Array<{paymentId:string;amount:string}>;source?:{id:string;key:string;fingerprint:string};};
|
||||
export type IrpcResult={treatment?:'dispensed'|'treaty';reliefRule?:string;id:string;status:'calculated'|'indeterminate'|'outside_scope';reason:string;period:string;eventDate:string;nature:'definitive'|'on_account'|null;rate:number|null;base:FiscalFraction|null;tax:FiscalFraction|null;settled:FiscalFraction|null;outstanding:FiscalFraction|null;direction:IrpcRow['direction'];conversion?:IrpcFxEvidence|null};
|
||||
export type IrpcBook=MrftaStore&{version:1;rows:IrpcRow[];payments:IrpcPayment[];result?:{version:string;key:string;calculatedAt:string;inputs:IrpcRow[];payments:IrpcPayment[];rows:IrpcResult[];paymentConversions?:Record<string,IrpcFxEvidence|null>};history?:Array<NonNullable<IrpcBook['result']>>};
|
||||
export const newIrpcRow=(id:string):IrpcRow=>({id,direction:'paid',counterparty:'',documentRef:'',description:'',base:'',currency:'MZN',origin:'projected',kind:'',recipientIrpc:'',payerIrpc:'',residence:'',permanentEstablishment:'',attributable:'',mozambique:'',qualificationRef:'',specialRelief:'',reliefRef:'',eventsComplete:'',events:[],settlement:'',settlementRef:'',allocations:[]});
|
||||
function store(d:Record<string,unknown>){const s=JSON.parse(String(d.modelo_a_snapshot||'{"version":1,"books":{}}'));if(s.version!==1||!s.books||typeof s.books!=='object'||Array.isArray(s.books))throw Error('Livros fiscais não recuperáveis;originais preservados.');return s;}
|
||||
function map(d:Record<string,unknown>):Record<string,IrpcBook>{const m=store(d).irpcWithholdings;if(m===undefined)return{};if(!m||typeof m!=='object'||Array.isArray(m))throw Error('Mapa IRPC não recuperável;originais preservados.');return m;}
|
||||
function validate(b:IrpcBook){
|
||||
if(!b||b.version!==1||!Array.isArray(b.rows)||!Array.isArray(b.payments)||b.history!==undefined&&!Array.isArray(b.history))throw Error('Livro IRPC não recuperável.');
|
||||
validateMrfta(b);
|
||||
for(const r of b.rows){const template=newIrpcRow('');if(!r||Object.keys(template).filter(k=>typeof template[k as keyof IrpcRow]==='string').some(k=>typeof r[k as keyof IrpcRow]!=='string')||!['paid','received'].includes(r.direction)||!['projected','effective'].includes(r.origin)||!irpcKinds.some(([k])=>k===r.kind)||!['','resident','nonresident'].includes(r.residence)||!['','none','claimed'].includes(r.specialRelief)||!['','none','complete'].includes(r.settlement)||['recipientIrpc','payerIrpc','permanentEstablishment','attributable','mozambique','eventsComplete'].some(k=>!['','yes','no'].includes(r[k as keyof IrpcRow]as string))||!Array.isArray(r.events)||!Array.isArray(r.allocations)||r.events.some(e=>!e||!['cost','payment','maturity','availability','liquidation','quantification'].includes(e.kind)||typeof e.date!=='string'||typeof e.reference!=='string')||r.allocations.some(a=>!a||typeof a.paymentId!=='string'||typeof a.amount!=='string')||r.source!==undefined&&(!r.source||!['id','key','fingerprint'].every(k=>typeof r.source![k as keyof NonNullable<IrpcRow['source']>]==='string')))throw Error('Entradas IRPC não recuperáveis;sem apagar ou repor vazios.');}
|
||||
for(const r of b.rows)if(r.reliefPreparation&&(r.reliefPreparation.rule!==undefined&&!['','cirpc68d','cirpc68f','ptMz12'].includes(r.reliefPreparation.rule)||r.reliefPreparation.facts!==undefined&&(!r.reliefPreparation.facts||typeof r.reliefPreparation.facts!=='object'||Array.isArray(r.reliefPreparation.facts)||Object.values(r.reliefPreparation.facts).some(v=>!['','yes','no'].includes(v)))))throw Error('Condições da dispensa/convenção não recuperáveis.');
|
||||
for(const r of b.rows)if(r.reliefPreparation&&(!['dispensation','exemption','treaty'].includes(r.reliefPreparation.kind)||['instrument','article','country','residenceDocument','validFrom','validTo','conditions','evidence'].some(k=>typeof r.reliefPreparation![k as keyof IrpcReliefPreparation]!=='string')))throw Error('Preparação de dispensa/convenção não recuperável;original preservado.');
|
||||
for(const r of b.rows)if(r.ordinary&&(['nonDigital','rentOwnPropertyManagement','specialFacts'].some(k=>!['','yes','no'].includes(r.ordinary![k as 'nonDigital'|'rentOwnPropertyManagement'|'specialFacts']))||typeof r.ordinary.reference!=='string'||!['','unlisted_interest','unlisted_dividend','listed_debt_mz','listed_other_mz','liquidity_repo','other'].includes(r.ordinary.capitalType)))throw Error('Factos específicos IRPC não recuperáveis.');
|
||||
for(const r of b.rows)if(r.ordinary?.capitalSeatAndManagement!==undefined&&!['','yes','no'].includes(r.ordinary.capitalSeatAndManagement))throw Error('Factos de sede/direcção não recuperáveis.');
|
||||
for(const v of [...b.rows,...b.payments])if(v.fxSelection!==undefined&&(!v.fxSelection||typeof v.fxSelection!=='object'||Array.isArray(v.fxSelection))||v.fxLink!==undefined&&(!v.fxLink||typeof v.fxLink.id!=='string'||typeof v.fxLink.fingerprint!=='string'))throw Error('Vínculo/selecção cambial não recuperável;original preservado.');
|
||||
for(const p of b.payments)if(!p||!['id','reference','date','amount','currency'].every(k=>typeof p[k as keyof IrpcPayment]==='string')||!['beneficiary','remittance','withholding_proof'].includes(p.kind))throw Error('Pagamento IRPC inválido;originais preservados.');
|
||||
if(b.result&&(!Array.isArray(b.result.rows)||!Array.isArray(b.result.inputs)||typeof b.result.key!=='string'||b.result.version!==irpcWithholdingVersion))throw Error('Resultado IRPC não recuperável.');
|
||||
if(b.payments.some((p,i)=>p.reference.trim()&&b.payments.some((q,j)=>i!==j&&q.kind===p.kind&&q.reference.trim()===p.reference.trim()&&q.date===p.date&&q.currency===p.currency)))throw Error('Pagamento/prova já registado:reutilize a referência existente em vez de duplicar.');
|
||||
if(new Set(b.rows.map(r=>r.id)).size!==b.rows.length||new Set(b.payments.map(p=>p.id)).size!==b.payments.length)throw Error('Identificadores IRPC repetidos.');
|
||||
}
|
||||
export function irpcBook(d:Record<string,unknown>):IrpcBook{const b=map(d)[acquisitionScope(d)]??{version:1,rows:[],payments:[]};validate(b);return b;}
|
||||
export function saveIrpcBook(d:Record<string,unknown>,b:IrpcBook):string{validate(b);return JSON.stringify({...store(d),irpcWithholdings:{...map(d),[acquisitionScope(d)]:b}});}
|
||||
export function irpcSources(d:Record<string,unknown>){return[
|
||||
...acquisitionBook(d).rows.map(r=>({id:'acquisition:'+r.id,key:closureFingerprint(r),counterparty:r.supplier,documentRef:r.documentRef+(r.documentLine?' / linha '+r.documentLine:''),description:r.description,amount:r.net,currency:acquisitionBook(d).currency,direction:'paid' as const,origin:r.origin})),
|
||||
...salesBook(d).rows.map(r=>({id:'sale:'+r.id,key:closureFingerprint(r),counterparty:'',documentRef:r.evidence,description:r.description,amount:r.basis==='net'?r.amount:'',currency:r.sourceCurrency,direction:'received' as const,origin:'projected' as const})),
|
||||
];}
|
||||
export function reuseIrpcSources(d:Record<string,unknown>,b:IrpcBook):IrpcBook{validate(b);const rows=[...b.rows];for(const s of irpcSources(d))if(!rows.some(r=>r.source?.id===s.id)){const r={...newIrpcRow('irpc:'+s.id),counterparty:s.counterparty,documentRef:s.documentRef,description:s.description,base:s.amount,currency:s.currency,direction:s.direction,origin:s.origin};rows.push({...r,source:{id:s.id,key:s.key,fingerprint:closureFingerprint(r)}});}return{...b,rows};}
|
||||
function sourceIssue(d:Record<string,unknown>,r:IrpcRow){if(!r.source)return'';const s=irpcSources(d).find(s=>s.id===r.source!.id);return !s?'Operação de origem não está disponível neste contexto;vínculo e edições conservados.':s.key!==r.source.key?'Documento/operação de origem alterado;compare o histórico e reconcilie a divergência antes de calcular.':'';}
|
||||
const date=(s:string)=>/^20\d{2}-(0[1-9]|1[0-2])-\d{2}$/.test(s)&&!Number.isNaN(Date.parse(s))&&new Date(s).toISOString().slice(0,10)===s;
|
||||
const positive=(f:FiscalFraction)=>BigInt(f.numerator)>0n;
|
||||
export function evaluateIrpc(d:Record<string,unknown>,r:IrpcRow):IrpcResult{
|
||||
const v:IrpcResult={id:r.id,status:'indeterminate',reason:'Identifique o rendimento e os intervenientes.',period:'',eventDate:'',nature:null,rate:null,base:null,tax:null,settled:null,outstanding:null,direction:r.direction};
|
||||
const issue=sourceIssue(d,r)||irpcFxDependency(d,r);if(issue)return{...v,reason:issue};
|
||||
if(r.recipientIrpc==='no')return{...v,status:'outside_scope',reason:'Titular fora de IRPC;sem converter em IRPS ou em isenção.'};
|
||||
if(!r.counterparty.trim()||!r.documentRef.trim()||r.recipientIrpc!=='yes'||r.payerIrpc!=='yes'||!r.residence||!r.kind||!r.qualificationRef.trim())return{...v,reason:'Faltam contraparte,documento,qualificação do rendimento,titular IRPC,devedor IRPC ou residência. A via devedor IRPS exige âmbito próprio.'};
|
||||
if(r.mozambique!=='yes')return{...v,reason:'Falta correspondência territorial aos arts5/67;ser estrangeiro não resolve incidência nem isenção.'};
|
||||
if(r.specialRelief!=='none'&&r.specialRelief!=='claimed')return{...v,reason:'Convenção,isenção ou dispensa invocada/desconhecida:identificar artigo,período,condições e prova;sem taxa reduzida ou zero automáticos.'};
|
||||
if(!r.eventsComplete||r.eventsComplete!=='yes'||!r.events.length||r.events.some(e=>!date(e.date)||!e.reference.trim()))return{...v,reason:'Identifique os eventos aplicáveis67(5),incluindo reconhecimento do custo,e confirme a sua completude com suporte;uma factura ou pagamento isolado não fixa o momento.'};
|
||||
v.eventDate=r.events.map(e=>e.date).sort()[0];v.period=v.eventDate.slice(0,7);
|
||||
if(!v.eventDate.startsWith('2026-'))return{...v,reason:'Primeiro evento aplicável fora de2026;corresponder versão/período próprio,sem deslocar para o pagamento posterior.'};
|
||||
try{const converted=convertIrpcAmount(d,r.base,r);v.base=converted.value;v.conversion=converted.evidence;}catch(e){return{...v,reason:'Base do rendimento/conversão por resolver: '+String(e)};}
|
||||
if(r.specialRelief==='claimed'){
|
||||
const relief=evaluateIrpcRelief(r,v.eventDate);if(!relief.applied)return{...v,reason:relief.reason};
|
||||
v.treatment=relief.treatment;v.reliefRule=relief.rule;v.rate=relief.rate;v.nature=relief.treatment==='treaty'?'definitive':'on_account';v.reason=relief.reason;
|
||||
v.tax=fraction(BigInt(v.base.numerator)*BigInt(relief.rate),BigInt(v.base.denominator)*100n);v.status='calculated';return v;
|
||||
}
|
||||
const digital=['digital_goods','digital_services','emoney_commission'].includes(r.kind);
|
||||
if(digital){
|
||||
if(r.residence==='nonresident'&&r.permanentEstablishment==='no'||r.residence==='nonresident'&&r.permanentEstablishment==='yes'&&r.attributable==='no')v.nature='definitive';
|
||||
else return{...v,reason:'Para residente ou rendimento imputável aEP,corresponder concretamente a taxa62(5) com as dispensas68,em especial68(d),antes da liquidação. EP desconhecido permanece indeterminado;90dias/serviço digital não criam ausência deEP automática.'};
|
||||
v.rate=10;v.reason='Taxa10%62(5) no âmbito digital/moeda electrónica demonstrado;retenção definitiva67(3). Procedimento67(7)/remissão62(6) e CER permanecem separados.';
|
||||
}else{
|
||||
const f=r.ordinary;
|
||||
if(!f||f.nonDigital!=='yes'||!f.reference.trim())return{...v,reason:'Classifique o rendimento não abrangido pelo ramo digital/moeda electrónica e identifique os factos específicos. Cotejo62/67:Lei34/2007,Lei19/2013 eLei20/2022 agora disponível;sem taxa genérica.'};
|
||||
const nonresident=r.residence==='nonresident';
|
||||
if(nonresident&&r.permanentEstablishment!=='no'&&!(r.permanentEstablishment==='yes'&&['yes','no'].includes(r.attributable)))return{...v,reason:'Falta identificar EP e imputação;ausência física ou nacionalidade não resolvem este facto.'};
|
||||
const attributable=!nonresident||r.permanentEstablishment==='yes'&&r.attributable==='yes';
|
||||
v.nature=r.kind==='rent'||attributable?'on_account':'definitive';
|
||||
if(['equipment','services'].includes(r.kind)&&v.nature==='on_account')return{...v,reason:'Rendimento67(1)b/g com imposto por conta:dispensa68(d) identificada,por corresponder no ramo de dispensas;não reter20% nem declarar isenção do rendimento.'};
|
||||
if(r.kind==='rent'&&f.rentOwnPropertyManagement!=='no')return{...v,reason:'Rendimento predial mantém natureza por conta67(3). Identifique a gestão de imóveis próprios e eventual dispensa68(f)/transparência;apenas este caso depende dessa correspondência.'};
|
||||
if(r.kind==='capital'){
|
||||
if(!f.capitalType||f.capitalType==='other')return{...v,reason:'Identifique juros/dividendos não cotados,títulos cotadosBM ou permutas de liquidez;62(3/4) não permite taxa única para capitais.'};
|
||||
if(r.residence==='resident'&&['listed_debt_mz','liquidity_repo'].includes(f.capitalType)){if(f.capitalSeatAndManagement!=='yes')return{...v,reason:'Art62(3):identifique sede e direcção efectiva nacionais do titular,além da categoria exacta dos títulos/permuta;residência genérica não substitui estes factos.'};v.nature='definitive';}
|
||||
if(v.nature==='on_account'&&f.capitalType!=='listed_debt_mz')return{...v,reason:'Capitais com imposto por conta:correspondência específica das dispensas68(a/b/c/g),incluindo titular e operação,permanece separada;sem bloquear capitais definitivos independentes.'};
|
||||
if(f.capitalType==='liquidity_repo'&&r.residence!=='resident')return{...v,reason:'Permutas de liquidez62(3)b exigem entidade com sede/direcção efectiva nacional;caso não residente mantém correspondência própria.'};
|
||||
}
|
||||
const special=['telecom','international_transport','connected_installation','aircraft_maintenance_charter','rural_public_electrification','maritime_fishing_cabotage'].includes(r.kind)||r.kind==='capital'&&f.capitalType==='listed_other_mz';
|
||||
if(special){
|
||||
if(!nonresident||r.permanentEstablishment!=='no')return{...v,reason:'Taxa especial62(4) refere entidades62(2),não residentes semEP. O caso residente/EP tem correspondência própria;sem copiar10%.'};
|
||||
if(f.specialFacts!=='yes')return{...v,reason:'Confirme os factos exactos62(4)a–d:conexão dos equipamentos,projecto público rural,pesca/cabotagem ou título cotadoBM que não é dívida/bilhete62(3)a,conforme categoria. Sem taxa especial por descrição genérica.'};
|
||||
v.rate=10;v.reason='Taxa especial10%62(4),redacçãoLei19/2013,conservada emLei20/2022 eLei12/2025;entidade não residente semEP e categoria específica identificadas. Não é a taxa digital62(5).';
|
||||
}else{
|
||||
if(!['royalty','equipment','rent','capital','services'].includes(r.kind))return{...v,reason:'Natureza fora dos ramos agrupados;identificar artigo e condições próprios,sem taxa por defeito.'};
|
||||
v.rate=20;v.reason=(r.kind==='capital'&&r.residence==='resident'&&['listed_debt_mz','liquidity_repo'].includes(f.capitalType)?'Retenção liberatória20%62(3)a/b:juros de dívida/bilhetes cotados ou permuta de liquidez qualificados,com sede e direcção efectiva nacionais. ':'')+'Taxa20%62(1),com62(2/3) quando aplicável;incidência67(1),natureza67(3). Lei20/2022,p2731,confrontada:as medidas agrícolas terminam31/12/2025 e não são transportadas para2026. Sem aplicar10% digital a rendimentos não digitais.';
|
||||
}
|
||||
}
|
||||
v.tax=fraction(BigInt(v.base.numerator)*BigInt(v.rate!),BigInt(v.base.denominator)*100n);v.status='calculated';v.reason+=' Base separada do IVA;entrega/prova e liquidação anual mantêm reconciliação própria.';return v;
|
||||
}
|
||||
function sharedPayments(d:Record<string,unknown>,b:IrpcBook){const used=b.payments.filter(p=>b.rows.some(r=>r.allocations.some(a=>a.paymentId===p.id)));return Object.entries(map(d)).filter(([ctx])=>ctx!==acquisitionScope(d)).flatMap(([ctx,other])=>{validate(other);const payments=other.payments.filter(q=>used.some(p=>p.reference.trim()===q.reference.trim()&&p.date===q.date&&p.currency===q.currency&&p.kind===q.kind));return payments.length?[[ctx,payments,other.rows.flatMap(r=>r.allocations.filter(a=>payments.some(p=>p.id===a.paymentId)))]]:[];});}
|
||||
function key(d:Record<string,unknown>,b:IrpcBook){const fx=[...b.rows,...b.payments].filter(r=>r.currency!=='MZN'&&r.fxLink).map(r=>irpcFxDependency(d,r));return JSON.stringify([irpcWithholdingVersion,acquisitionScope(d),b.rows,b.payments,b.rows.map(r=>sourceIssue(d,r)),sharedPayments(d,b),...(fx.length?[fx]:[]),...(b.rows.some(r=>r.specialRelief==='claimed')?[irpcReliefVersion]:[])]);}
|
||||
export function irpcCurrent(d:Record<string,unknown>,b:IrpcBook){return !!b.result&&b.result.key===key(d,b);}
|
||||
export function recordIrpc(d:Record<string,unknown>,b:IrpcBook,now=new Date().toISOString()):IrpcBook{
|
||||
validate(b);const rows=b.rows.map(r=>evaluateIrpc(d,r));const paymentConversions:Record<string,IrpcFxEvidence|null>={};const allocations=new Map<string,FiscalFraction[]>();
|
||||
const fail=(i:number,reason:string)=>{rows[i]={...rows[i],status:'indeterminate',reason,settled:null,outstanding:null};};
|
||||
b.rows.forEach((r,i)=>{
|
||||
if(rows[i].status!=='calculated')return;
|
||||
if(rows[i].treatment==='dispensed'){if(r.allocations.length){fail(i,'Dispensa com entrega/prova associada: reconcilie sem apagar o pagamento nem gerar crédito automático.');return;}rows[i].settled=fraction(0n,1n);rows[i].outstanding=fraction(0n,1n);return;}
|
||||
if(r.settlement==='none'&&r.allocations.length){fail(i,'Ausência de entrega/prova contradiz pagamentos associados;conserve e reconcilie.');return;}
|
||||
if(!r.settlement||!r.settlementRef.trim()){rows[i].reason+=' Entrega à AT/retenção sofrida ainda não reconciliada;não presumir zero pago.';return;}
|
||||
const parts:FiscalFraction[]=[];const seen=new Set<string>();
|
||||
for(const a of r.allocations){const p=b.payments.find(p=>p.id===a.paymentId);try{
|
||||
if(!p||seen.has(p.id)||p.kind==='remittance'&&p.currency!=='MZN'||!date(p.date)||p.date<rows[i].eventDate||!p.reference.trim()||p.kind!==(r.direction==='paid'?'remittance':'withholding_proof'))throw Error();
|
||||
seen.add(p.id);const amount=decimalFraction(a.amount);paymentConversions[p.id]=convertIrpcAmount(d,p.amount,p).evidence;parts.push(amount);allocations.set(p.id,[...(allocations.get(p.id)??[]),amount]);
|
||||
}catch(e){fail(i,'Pagamento/prova ausente,incoerente,repetido ou de outra natureza:pagamento ao fornecedor e imposto IVA não são entrega IRPC. '+String(e));return;}}
|
||||
const settled=addFractions(parts);if(positive(subtractFractions(settled,rows[i].tax!))){fail(i,'Valor associado excede a retenção calculada;reconcilie excesso sem gerar crédito automático.');return;}
|
||||
rows[i].settled=settled;rows[i].outstanding=subtractFractions(rows[i].tax!,settled);
|
||||
});
|
||||
for(const [id,parts]of allocations){const p=b.payments.find(p=>p.id===id)!;let excess=false;try{const elsewhere:FiscalFraction[]=[];for(const [ctx,other]of Object.entries(map(d))){if(ctx===acquisitionScope(d))continue;validate(other);for(const q of other.payments.filter(q=>q.reference.trim()===p.reference.trim()&&q.date===p.date&&q.kind===p.kind&&q.currency===p.currency)){if(q.amount!==p.amount||q.currency!=='MZN'&&JSON.stringify(q.fxSelection)!==JSON.stringify(p.fxSelection))throw Error('Montantes/conversões divergentes');for(const r of other.rows)for(const a of r.allocations.filter(a=>a.paymentId===q.id))elsewhere.push(decimalFraction(a.amount));}}excess=positive(subtractFractions(addFractions([...parts,...elsewhere]),convertIrpcAmount(d,p.amount,p).value));}catch{excess=true;}if(excess)b.rows.forEach((r,i)=>{if(r.allocations.some(a=>a.paymentId===id))fail(i,'Mesmo pagamento utilizado além do montante disponível;reparta sem duplicação.');});}
|
||||
// An identical source document/income cannot become a second tax just by adding a row.
|
||||
b.rows.forEach((r,i)=>{if(b.rows.some((s,j)=>j!==i&&(r.source&&s.source?.id===r.source.id||r.documentRef.trim()&&s.documentRef.trim()===r.documentRef.trim()&&s.counterparty.trim()===r.counterparty.trim()&&s.direction===r.direction))){fail(i,'Documento/rendimento repetido neste livro;identifique parcelas próprias antes de somar,sem duplicação.');}});
|
||||
return{...b,history:b.result?[...(b.history??[]),structuredClone(b.result)]:b.history,result:{version:irpcWithholdingVersion,key:key(d,b),calculatedAt:now,inputs:structuredClone(b.rows),payments:structuredClone(b.payments),rows,paymentConversions}};
|
||||
}
|
||||
const amount=(v:FiscalFraction|null)=>{if(!v)return'Indeterminado';const p=fractionPresentation(v);return(p.approximate?'≈':'')+p.decimal+' MZN';};
|
||||
export function irpcReportRows(d:Record<string,unknown>):Array<[string,string,string,string]>{try{const b=irpcBook(d),r=b.result;if(!r)return mrftaReportRows(b,false);return [...r.rows.map((v):[string,string,string,string]=>{const i=r.inputs.find(i=>i.id===v.id)!;return['IRPC — retenções',`${i.documentRef} — ${i.counterparty}`,`${({calculated:'Calculado',indeterminate:'Indeterminado',outside_scope:'Fora deste âmbito'})[v.status]};tratamento:${v.treatment==='dispensed'?'Dispensa de retenção':v.treatment==='treaty'?'Limite convencional':'Retenção interna'};enquadramento: ${irpcKinds.find(([k])=>k===i.kind)?.[1]??i.kind};${i.direction==='paid'?'retida a entregar':'sofrida'};base:${amount(v.base)};taxa:${v.treatment==='dispensed'?'Dispensa (sem retenção)':(v.rate??'por corresponder')+'%'};retenção:${amount(v.tax)};entrega/prova:${amount(v.settled)};saldo:${amount(v.outstanding)};${v.reason}`,`${acquisitionScope(d)};${i.origin};${v.period};evento:${v.eventDate};${v.nature==='on_account'?'Imposto por conta (sem crédito anual automático)':v.nature==='definitive'?'Retenção definitiva':'Natureza por determinar'};${irpcCurrent(d,b)?'Entradas correspondentes':'Histórico;entradas/origem divergentes'};dispensa/convenção:${irpcReliefEvidenceLabel(i)};reconciliação:${i.settlementRef};comprovativos:${i.allocations.map(a=>{const p=r.payments.find(p=>p.id===a.paymentId);return p?`${p.reference}/${p.date}:parcela${a.amount}MZN de${p.amount}${p.currency};${r.paymentConversions?.[p.id]?irpcFxEvidenceLabel(r.paymentConversions[p.id]!):'sem conversão usada'}`:'referência por resolver';}).join(' | ')};${r.calculatedAt};${v.conversion?'Câmbio:'+irpcFxEvidenceLabel(v.conversion)+';':''}${irpcWithholdingSource}`];}),...mrftaReportRows(b,irpcCurrent(d,b))];}catch(e){return[['IRPC — retenções','Livro não recuperável',String(e),'Originais e histórico preservados.']];}}
|
||||
export function irpcPreparationHtml(d:Record<string,unknown>):string{const b=irpcBook(d);if(!b.result||!irpcCurrent(d,b))throw Error('Calcule e guarde as entradas actuais antes de preparar.');const esc=(v:unknown)=>String(v).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]!));return'<!doctype html><html lang="pt"><meta charset="utf-8"><title>IRPC — preparação das retenções</title><body><h1>Preparação IRPC — L5</h1><p>Mapa de trabalho;sem submissão,recepção ou aceitação AT. MRFTA19/39:quadro1 retenção;quadro2 mês/ano único por declaração;quadro7 base/taxa/imposto. CER e correspondência das rubricas digitais/moeda electrónica por esclarecer;67(7)remete62(6),mas taxa nova em62(5). Não preencher assinatura ou uso dos serviços. Não consolidar períodos diferentes nem transformar retenções sofridas em imposto a entregar.</p>'+irpcReportRows(d).map(r=>'<section><h2>'+esc(r[1])+'</h2><p>'+esc(r[2])+'</p><small>'+esc(r[3])+'</small></section>').join('')+'<p>Instruções do exemplar:prazo nominal dia20 do mês seguinte à dedução,sem ajuste de calendário/prorrogação ou procedimento2026 presumidos. Juros não calculados. GuiaM/39 anterior preservada,sem actualizar remissões do original.</p></body></html>';}
|
||||
@@ -35,7 +35,7 @@ function assess(i:IspcEligibilityInput):Pick<IspcEligibilityResult,'status'|'rea
|
||||
let annual:FiscalFraction|null=null;try{annual=decimalFraction(i.annualReference);}catch{ /* Missing or invalid is never zero. */ }
|
||||
const stop=(status:IspcEligibilityResult['status'],reason:string,missing:string[]=[])=>({status,reason,missing,annualReference:annual});
|
||||
if(!validDate(i.assessmentDate)||!i.assessmentDate.startsWith('2026-')||i.currency!=='MZN')return stop('indeterminate','Este incremento cobre apenas avaliação2026emMZN;identifique data e moeda sem conversão silenciosa.',['data2026','moedaMZN']);
|
||||
if(i.mode==='occasional')return stop('indeterminate','Operação ocasional3(3–4):conservar dados;use o percurso específico de operações ocasionais próprias abaixo,com incidênciaIRPS e famílias3(4).',['enquadramento específico da operação ocasional']);
|
||||
if(i.mode==='occasional')return stop('indeterminate','Operação ocasional3(3–4):conservar dados;incidênciaIRPS e famílias próprias ainda não avaliadas neste incremento.',['enquadramento específico da operação ocasional']);
|
||||
if(i.territory==='no')return stop('incompatible','O âmbito territorial declarado não corresponde ao exercício em território nacional de2(1);nacionalidade do investidor não substitui este facto.');
|
||||
if(i.activities.includes('other')||i.otherActivities==='yes')return stop('incompatible','Actividade fora dos âmbitos2/3declarada;exclusão3(2)c,não aplicarISPC por nome do sector.');
|
||||
if(i.organizedRequired==='yes')return stop('incompatible','Obrigação de contabilidade organizada declarada:4(1)b não permite este enquadramento. Manter contabilidade voluntária distinto de obrigação.');
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
import {acquisitionScope} from './iva-acquisitions.ts';
|
||||
import {ispcEligibilityBook,ispcEligibilityCurrent} from './ispc-eligibility.ts';
|
||||
import {ispcWithholdingBook} from './ispc-withholding.ts';
|
||||
import {ispcQuarterBook,ispcQuarterCurrent} from './ispc-quarter.ts';
|
||||
import {addFractions,decimalFraction,fraction,fractionPresentation,subtractFractions,type FiscalFraction} from './fiscal-rational.ts';
|
||||
export type ResidualKind='occasional'|'acquisitions'|'formalities';
|
||||
export type ResidualResult={key:string;scope:string;calculatedAt:string;status:'calculated'|'settled_by_withholding'|'partial'|'indeterminate'|'not_applicable';reason:string;missing:string[];input:Record<string,string>;amounts:Record<string,FiscalFraction|null>;details:Record<string,string>;source:string};
|
||||
export type ResidualBook={version:1;kind:ResidualKind;input:Record<string,string>;result?:ResidualResult;history?:ResidualResult[]};
|
||||
export const residualSources={occasional:'ISPC Lei9/2025 arts3(3–4),4,5,8,9,10-A,12(3);BR248 PDF10–11. IRPS republicação Lei19/2017,BR202/7.ºsuplemento,art8(3h,4),9;PDF4/p2602(128). Lei11/2025 não altera estes artigos. Operação imprevisível/não reiterada, pessoa singular sem actividade habitual e famílias restritas; imposto próprio distinto de retenção liberatória documentada.',acquisitions:'ISPC12(3–4):limite global anual2.500.000MZN para factura por conta/retencão5%. Parcela acima do limite não adquire taxa por ultrapassagem. IRPS57(1,2k,4),republicação19/2017 PDF13/p2602(137),e65(1)naLei11/2025 PDF17:acto isolado qualificado e sem opçãoISPC aplicável,20%sobre rendimento ilíquido declarado; não confundir com20%do excesso de vendasISPC8(1)d.',formalities:'AT Comunicado9/2026,06/10/2026,p1:ModeloB–Geral enquanto se ajusta sistema;pagamentos trimestrais emJaneiro/Abril/Julho/Outubro. AT ModeloBGeral2p:quadros1/2/3/5/6/8/10. Modelo30 disponível contém75.000/3%antigos,não usado para calcular2026. Sem submissãoAT automática.'};
|
||||
const blank=(kind:ResidualKind):Record<string,string>=>kind==='occasional'?{personType:'',currency:'',origin:'projected',operationDate:'',quarter:'',noHabitual:'',territory:'',sporadic:'',activity:'',reference:'',amount:'',allQuarterOperations:'',priorYearTurnover:'',priorYearRef:'',organizedRequired:'',option:'preparation',optionRef:'',optionDate:'',settlement:'',annual2026:'',annualOrigin:'',annualRef:'',priorInYear:'',buyerIspc:'',unregistered:'',buyerAnnualPurchases:'',withheldActual:'',withheldRef:''}:kind==='acquisitions'?{route:'unknown',noIspcOnExcess:'',isolatedAct:'',incomeInMoz:'',grossExcess:'',grossRef:'',supplierOptionRef:'',reference:''}:{sourceKind:'quarter',name:'',nuit:'',fiscalArea:'',address:'',declaration:'initial',formMonth:'',formYear:'2026',formPeriodRef:'',interestSituation:'',interestAmount:'',interestRef:'',externalStatus:'preparation',externalRef:'',externalDate:''};
|
||||
function store(d:Record<string,unknown>){const s=JSON.parse(String(d.modelo_a_snapshot||'{"version":1,"books":{}}'));if(s.version!==1||!s.books||typeof s.books!=='object'||Array.isArray(s.books))throw Error('Livros não recuperáveis; originais preservados.');return s;}
|
||||
function maps(d:Record<string,unknown>):Record<string,Record<string,ResidualBook>>{const v=store(d).ispcResiduals;if(v===undefined)return{};if(!v||typeof v!=='object'||Array.isArray(v))throw Error('Mapa residualISPC inválido; originais preservados.');return v;}
|
||||
function validate(b:ResidualBook,kind:ResidualKind){
|
||||
const enums:Record<string,string[]>=kind==='occasional'?{personType:['','singular','collective'],origin:['projected','effective'],noHabitual:['','yes','no'],territory:['','yes','no'],sporadic:['','yes','no'],activity:['','forestry','fishery','livestock','agriculture','poultry','beekeeping','other'],allQuarterOperations:['','yes','no'],organizedRequired:['','yes','no'],option:['preparation','opted','not_opted'],settlement:['','self','withheld'],annualOrigin:['','forecast','closed_year'],buyerIspc:['','yes','no'],unregistered:['','yes','no']}:kind==='acquisitions'?{route:['unknown','ispc_supplier','irps_isolated'],noIspcOnExcess:['','yes','no'],isolatedAct:['','yes','no'],incomeInMoz:['','yes','no']}:{sourceKind:['quarter','occasional','acquisitions'],declaration:['initial','substitution'],interestSituation:['','none','amount'],externalStatus:['preparation','submitted','received','paid']};
|
||||
if(b?.input&&Object.entries(enums).some(([k,v])=>!v.includes(b.input[k])))throw Error('Opções residuais não recuperáveis;entradas preservadas.');
|
||||
if(!b||b.version!==1||b.kind!==kind||!b.input||Object.keys(blank(kind)).some(k=>typeof b.input[k]!=='string')||b.history!==undefined&&!Array.isArray(b.history)||b.result!==undefined&&(!b.result.input||!b.result.amounts||!Array.isArray(b.result.missing)))throw Error('Livro residualISPC não recuperável; sem substituir por vazio.');}
|
||||
export function ispcResidualBook(d:Record<string,unknown>,kind:ResidualKind):ResidualBook{const m=maps(d)[acquisitionScope(d)];if(m!==undefined&&(!m||typeof m!=='object'||Array.isArray(m)))throw Error('Contexto residual inválido.');let b=m?.[kind];if(!b){const input=blank(kind);if(kind==='occasional'){const i=ispcEligibilityBook(d).input;Object.assign(input,{personType:i.personType,currency:i.currency,origin:i.origin,operationDate:i.assessmentDate,territory:i.territory,option:i.option,optionRef:i.optionReference,optionDate:i.optionDate});}if(kind==='formalities'){if(ispcEligibilityBook(d).input.mode==='occasional'&&m?.occasional?.result)input.sourceKind='occasional';else if(!ispcQuarterBook(d).result&&m?.acquisitions?.result)input.sourceKind='acquisitions';Object.assign(input,{name:String(d.legal_name??d.organization_name??''),nuit:String(d.nuit??''),address:String(d.address??'')});}b={version:1,kind,input};}validate(b,kind);return b;}
|
||||
export function saveIspcResidualBook(d:Record<string,unknown>,b:ResidualBook):string{validate(b,b.kind);const scope=acquisitionScope(d);return JSON.stringify({...store(d),ispcResiduals:{...maps(d),[scope]:{...maps(d)[scope],[b.kind]:b}}});}
|
||||
const cmp=(a:FiscalFraction,b:FiscalFraction)=>BigInt(a.numerator)*BigInt(b.denominator)-BigInt(b.numerator)*BigInt(a.denominator);
|
||||
const rate=(a:FiscalFraction,n:number)=>fraction(BigInt(a.numerator)*BigInt(n),BigInt(a.denominator)*100n);
|
||||
const min=(a:FiscalFraction,b:FiscalFraction)=>cmp(a,b)<0n?a:b;
|
||||
const positive=(a:FiscalFraction)=>cmp(a,fraction(0n))>0n?a:fraction(0n);
|
||||
const validDate=(s:string)=>/^2026-\d{2}-\d{2}$/.test(s)&&!Number.isNaN(Date.parse(s))&&new Date(s).toISOString().slice(0,10)===s;
|
||||
const amount=(s:string,label:string,r:ResidualResult)=>{try{return decimalFraction(s);}catch{r.missing.push(label);return null;}};
|
||||
function dependency(d:Record<string,unknown>,kind:ResidualKind,i:Record<string,string>):unknown{if(kind==='acquisitions'){const e=ispcEligibilityBook(d);return[ispcWithholdingBook(d).input,e.input,e.result?.key];}if(kind==='formalities'){if(i.sourceKind==='quarter'){const b=ispcQuarterBook(d);return[b.input,b.result?.key,ispcQuarterCurrent(d,b)];}const b=ispcResidualBook(d,i.sourceKind==='occasional'?'occasional':'acquisitions');return[b.input,b.result?.key,b.result?.calculatedAt,ispcResidualCurrent(d,b)];}return null;}
|
||||
const key=(d:Record<string,unknown>,b:ResidualBook)=>JSON.stringify(['ispc-residual/1',acquisitionScope(d),b.kind,b.input,dependency(d,b.kind,b.input)]);
|
||||
export const ispcResidualCurrent=(d:Record<string,unknown>,b:ResidualBook)=>!!b.result&&b.result.key===key(d,b);
|
||||
function occasional(i:Record<string,string>,r:ResidualResult){
|
||||
if(i.personType==='collective'||i.noHabitual==='no'||i.territory==='no'||i.sporadic==='no'||i.activity==='other'){r.status='not_applicable';r.reason='Os factos excluem o recorte ocasional3(3–4); conserve o percurso habitual ou o imposto próprio aplicável, sem presumir isenção.';return;}
|
||||
if(i.territory!=='yes')r.missing.push('Operação em território nacional,sem inferir da moeda ou nacionalidade');
|
||||
if(!i.personType)r.missing.push('Pessoa singular por identificar');
|
||||
if(i.currency!=='MZN'||!validDate(i.operationDate)||!['1','2','3','4'].includes(i.quarter)||validDate(i.operationDate)&&Math.ceil(Number(i.operationDate.slice(5,7))/3)!==Number(i.quarter))r.missing.push('Data/trimestre de2026 coerentes e moedaMZN');
|
||||
if(i.noHabitual!=='yes'||i.sporadic!=='yes'||!['forestry','fishery','livestock','agriculture','poultry','beekeeping'].includes(i.activity)||!i.reference.trim())r.missing.push('Pessoa sem actividade habitual,acto imprevisível/não reiterado,família3(4)e suporte da operação');
|
||||
const base=amount(i.amount,'Volume das operações ocasionais deste trimestre, incluindo zero expresso',r);r.amounts.base=base;
|
||||
r.details.IRPS='Acto isolado8(3h)referente a8(2a),não previsível/reiterado8(4);família3(4)ISPC. Não se infere pelo nome do sector.';
|
||||
if(i.settlement==='withheld'){
|
||||
const purchases=amount(i.buyerAnnualPurchases,'Aquisições globais anuais do adquirente, incluindo estas operações',r),actual=amount(i.withheldActual,'Montante efectivamente retido',r);
|
||||
if(i.buyerIspc!=='yes'||i.unregistered!=='yes'||!i.withheldRef.trim())r.missing.push('AdquirenteISPC,fornecedor não inscrito e documento de retenção liberatória12(3)');
|
||||
if(purchases&&base&&(cmp(purchases,base)<0n||cmp(purchases,fraction(2500000n))>0n))r.missing.push('Reconciliar aquisições globais do adquirente dentro do limite2.500.000;fora dele usar tratamento próprio');
|
||||
if(!r.missing.length&&base&&actual){r.amounts.tax=rate(base,5);r.amounts.withheld=actual;if(cmp(actual,r.amounts.tax)!==0n){r.missing.push('Retenção documentada diverge de5%da base;reconciliar diferença sem presumir quitação');return;}r.status='settled_by_withholding';r.details.rate='5';r.reason='Retenção liberatória documentada para estas operações; não somar nova liquidação própria3/4/5%nem usar a retenção como crédito duplicado. Pagamento próprio adicional não é gerado.';}return;
|
||||
}
|
||||
if(i.settlement!=='self'){r.missing.push('Via de liquidação própria ou retenção liberatória documentada');return;}
|
||||
if(i.organizedRequired==='yes'){r.status='not_applicable';r.reason='Obrigação de contabilidade organizada declarada:fora da liquidação própriaISPC4(1b);entradas e documentos conservados,sem presumir isenção noutro imposto.';return;}
|
||||
if(i.allQuarterOperations!=='yes')r.missing.push('Volume de todas as operações ocasionais do sujeito passivo no trimestre');
|
||||
const access=amount(i.priorYearTurnover,'Volume de referência2025, sem inferir zero por ausência de actividade habitual',r);if(!i.priorYearRef.trim()||i.organizedRequired!=='no')r.missing.push('Suporte da referência anual e inexistência de obrigação de contabilidade organizada4(1)');if(access&&cmp(access,fraction(4000000n))>0n){r.status='not_applicable';r.reason='Volume de acesso4(1)superior4.000.000MZN declarado:fora da liquidação própriaISPC;sem atribuir taxa de outro regime por presunção.';return;}
|
||||
if(i.option==='not_opted'){r.status='not_applicable';r.reason='Sem opçãoISPC para esta operação; não aplicar exclusãoIRPS5nem taxaISPC automaticamente.';return;}
|
||||
if(!['preparation','opted'].includes(i.option)||i.option==='opted'&&(!i.optionRef.trim()||!validDate(i.optionDate)||i.optionDate>i.operationDate)||i.origin==='effective'&&i.option!=='opted')r.missing.push('Opção documentada aplicável à operação efectiva;preparação apenas permite cenário');
|
||||
const annual=amount(i.annual2026,'Volume anual2026 para escalão, distinto do acesso2025',r),prior=amount(i.priorInYear,'Volume anterior no ano2026',r);if(!['forecast','closed_year'].includes(i.annualOrigin)||!i.annualRef.trim())r.missing.push('Referência anual suportada e previsão identificada como cenário');
|
||||
if(base&&prior&&annual&&(cmp(annual,addFractions([base,prior]))<0n||i.annualOrigin==='closed_year'&&i.quarter==='4'&&cmp(annual,addFractions([base,prior]))!==0n))r.missing.push('Reconciliar volume anual com acumulado anterior e trimestre');
|
||||
if(r.missing.length||!base||!prior||!annual)return;
|
||||
const n=cmp(annual,fraction(1000000n))<=0n?3:cmp(annual,fraction(2500000n))<=0n?4:5,ordinary=min(base,positive(subtractFractions(fraction(4000000n),prior))),excess=subtractFractions(base,ordinary),tax=addFractions([rate(ordinary,n),rate(excess,20)]);r.amounts={...r.amounts,ordinary,excess,tax,payment:cmp(tax,fraction(500n))<0n?fraction(0n):tax};r.details.projected=i.origin==='projected'||i.option==='preparation'||i.annualOrigin==='forecast'?'yes':'no';r.details.rate=String(n);r.details.declaration='Mantida mesmo quando prestação inferior500MZN';r.status='calculated';r.reason=`${r.details.projected==='yes'?'Cenário declarado;sem adesão automática.':'Opção e factos efectivos declarados.'} Operações ocasionais próprias3(3–4),base trimestral9,taxa${n}%e20%somente no excesso de vendas acima4.000.000. Não há retenção presumida nem dedução de custos/IVA.`;
|
||||
}
|
||||
function acquisitions(d:Record<string,unknown>,i:Record<string,string>,r:ResidualResult){
|
||||
const w=ispcWithholdingBook(d).input,e=ispcEligibilityBook(d);if(!ispcEligibilityCurrent(d,e)||e.result?.status!=='compatible'||e.result.optionStatus==='not_opted'||e.result.optionStatus==='indeterminate'||e.input.origin==='effective'&&e.result.optionStatus!=='recorded'){r.missing.push('Enquadramento/opção actual do adquirenteISPC');return;}
|
||||
if(w.applicable!=='yes'||w.naturalOccasional!=='yes'||w.unregistered!=='yes'||w.related!=='yes'||!['forestry','fishery','livestock','agriculture','poultry','beekeeping'].includes(w.activity)||!w.reference.trim()){r.missing.push('Condições específicas12(3–4)e suporte no livro das aquisições');return;}
|
||||
const base=amount(w.base,'Base das aquisições',r),prior=amount(w.priorAnnualPurchases,'Aquisições globais anteriores do ano',r);if(!base||!prior)return;const covered=min(base,positive(subtractFractions(fraction(2500000n),prior))),excess=subtractFractions(base,covered);r.amounts={base,prior,covered,excess,coveredTax:rate(covered,5),excessTax:null,total:null};r.details.quarter=w.quarter;r.details.acquisitionRef=w.reference;
|
||||
if(cmp(excess,fraction(0n))<=0n){r.status='not_applicable';r.reason='Sem parcela acima do limite; o cálculo5%já disponível permanece no seu livro, sem segunda liquidação.';return;}
|
||||
r.status='partial';r.reason='Parcela até ao limite separada a5%; parcela excedente quantificada, sem presumir5%ou20%pelo simples excesso. Montante total continua indeterminado até identificar tratamento próprio.';
|
||||
if(i.route==='irps_isolated'){
|
||||
const net=amount(i.grossExcess,'Rendimento ilíquido da parcela excedente, distinto de rendimento líquido e do preço líquido de IVA',r);if(i.noIspcOnExcess!=='yes'||i.isolatedAct!=='yes'||i.incomeInMoz!=='yes'||!i.grossRef.trim()||!i.reference.trim())r.missing.push('Acto isoladoIRPS8(3h,4),rendimento emMoçambique,sem opçãoISPC5aplicável à parcela,e referências da classificação/base');
|
||||
if(net&&cmp(net,excess)!==0n)r.missing.push('Base ilíquida57(4)não coincide com a parcela bruta identificada;reconciliar sem deduzir custos/IVA automaticamente');
|
||||
if(!r.missing.length&&net){r.amounts.excessTax=rate(net,20);r.amounts.total=addFractions([r.amounts.coveredTax!,r.amounts.excessTax]);r.status='calculated';r.reason='Correspondência positiva independente:IRPS57(2k)acto isolado,20%sobre rendimento ilíquido57(4)da parcela identificada,sem opçãoISPCaplicável. Não se usa taxa20%do excesso de vendasISPC. Retenções5%e20%separadas,não são crédito do imposto próprio do adquirente.';}
|
||||
}else if(i.route==='ispc_supplier'){if(!i.supplierOptionRef.trim())r.missing.push('Referência da opção/registoISPCdo fornecedor aplicável a estas operações');r.reason='Fornecedor com opçãoISPC declarada:art5impede aplicarIRPSporpresunção. A parcela fora12(3)exige factura/registo do fornecedor e liquidação própria correspondente; o comprador não atribui5%ou20%automaticamente. Sem total de retenção presumido.';}
|
||||
else r.missing.push('Enquadramento específico da parcela excedente:opçãoISPCdo fornecedor ou acto isoladoIRPS,base e suporte');
|
||||
}
|
||||
function formalities(d:Record<string,unknown>,i:Record<string,string>,r:ResidualResult){
|
||||
let src:ResidualResult|undefined;if(i.sourceKind==='quarter'){const b=ispcQuarterBook(d),v=b.result;if(!v||!ispcQuarterCurrent(d,b)||v.status!=='calculated'){r.missing.push('Apuramento trimestral actual e calculado');return;}r.amounts={base:v.base,tax:v.tax,payment:v.payment,ordinary:v.ordinary,excess:v.excess};r.details={quarter:v.input.quarter,rate:String(v.rate),sourceDate:v.calculatedAt};}
|
||||
else{const b=ispcResidualBook(d,i.sourceKind==='occasional'?'occasional':'acquisitions');src=b.result;if(!src||!ispcResidualCurrent(d,b)){r.missing.push('Resultado actual do percurso seleccionado');return;}if(src.status==='settled_by_withholding'){r.status='not_applicable';r.reason='Operação própria já com retenção liberatória documentada:conservar comprovativo,sem emitir liquidação própria duplicada.';return;}if(src.status!=='calculated'){r.missing.push('Cálculo completo do percurso seleccionado;as partes determinadas permanecem consultáveis');return;}r.amounts={...src.amounts,tax:src.amounts.total??src.amounts.tax,payment:src.amounts.total??src.amounts.payment};r.details={quarter:src.input.quarter||src.details.quarter,rate:src.details.rate||'retenções separadas',sourceDate:src.calculatedAt};}
|
||||
const first=r.amounts.covered??r.amounts.ordinary??r.amounts.base,second=r.amounts.excess??fraction(0n),firstRate=i.sourceKind==='acquisitions'?5:Number(r.details.rate);
|
||||
if(first&&[3,4,5,12,15].includes(firstRate)){const firstTax=r.amounts.coveredTax??rate(first,firstRate),secondTax=r.amounts.excessTax??rate(second,20);r.amounts.q8base01=first;r.amounts.q8tax05=firstTax;r.amounts.q8base02=second;r.amounts.q8tax06=secondTax;r.details.q8rate01=String(firstRate);r.details.q8rate02='20';if(r.amounts.tax&&cmp(addFractions([firstTax,secondTax]),r.amounts.tax)!==0n)r.missing.push('Parcelas do quadro8divergem do cálculo guardado;conferir apenas essa correspondência');}
|
||||
if(i.sourceKind==='acquisitions'&&!(i.retentionFormRef??'').trim())r.missing.push('Modelo/código de entrega da retençãoISPC12(3)e da retençãoIRPS57(2k),distintos do imposto próprio;comunicado9não resolve isoladamente este modelo');
|
||||
if(r.amounts.tax&&r.amounts.payment&&cmp(r.amounts.tax,fraction(0n))>0n&&cmp(r.amounts.tax,fraction(500n))<0n&&cmp(r.amounts.payment,fraction(0n))===0n)r.missing.push('Representação da dispensa de pagamento10-A noB–Geral:declarar imposto apurado sem presumir zero no campo de montante apurado');
|
||||
r.details.model='Modelo B–Geral;comunicadoAT9/2026';r.details.paymentMonth=['Abril2026','Julho2026','Outubro2026','Janeiro2027'][Number(r.details.quarter)-1]||'Trimestre por identificar';r.details.formPeriod=i.formMonth?`${i.formMonth}/${i.formYear}`:'Indeterminado:quadro2pede mês/ano;comunicado identifica trimestre/mês de pagamento,sem resolver a codificação do período';
|
||||
if(!/^[0-9]{9}$/.test(i.nuit)||!i.name.trim()||!i.fiscalArea.trim()||!i.address.trim())r.missing.push('NUIT9dígitos,nome,área fiscal/UGC e domicílio para formalização;preparação do cálculo não exige esses campos');
|
||||
if(!/^(0[1-9]|1[0-2])$/.test(i.formMonth)||!['2026','2027'].includes(i.formYear)||!i.formPeriodRef.trim())r.missing.push('Mês/ano a inscrever no quadro2e instrução/correspondência utilizada; não preencher automaticamente com mês de pagamento');
|
||||
if(!['none','amount'].includes(i.interestSituation)||!i.interestRef.trim())r.missing.push('Situação dos juros compensatórios e suporte;desconhecido não é zero');
|
||||
if(i.interestSituation==='amount')r.amounts.interest=amount(i.interestAmount,'Juros documentados,não calculados por falta de taxa/período regulamentar',r);else if(i.interestSituation==='none')r.amounts.interest=fraction(0n);
|
||||
r.amounts.finalPayment=r.amounts.payment&&r.amounts.interest?addFractions([r.amounts.payment,r.amounts.interest]):null;
|
||||
if(i.externalStatus!=='preparation'&&(!i.externalRef.trim()||!i.externalDate.trim()))r.missing.push('Referência e data da submissão/recepção/pagamento declarado;sem confirmação automáticaAT');
|
||||
r.status=r.missing.length?'partial':'calculated';r.reason='Preparação dos campos identificados do B–Geral,com cálculo e prestação separados. O Modelo30antigo não recebe taxas2026. Submissão,recepção e pagamento são actos externos;este registo conserva referências e histórico,sem os efectuar ou certificar.';
|
||||
}
|
||||
export function priorOccasionalSettlement(b:ResidualBook):ResidualResult|undefined{if(b.kind!=='occasional'||b.input.settlement!=='self')return;return[b.result,...(b.history??[])].find(r=>r?.status==='settled_by_withholding'&&r.input.reference.trim()===b.input.reference.trim()&&r.input.operationDate===b.input.operationDate&&r.input.quarter===b.input.quarter&&r.input.amount===b.input.amount);}
|
||||
export function recordIspcResidual(d:Record<string,unknown>,b:ResidualBook,now=new Date().toISOString()):ResidualBook{validate(b,b.kind);const r:ResidualResult={key:key(d,b),scope:acquisitionScope(d),calculatedAt:now,status:'indeterminate',reason:'Dados específicos em falta;sem presumir zero.',missing:[],input:structuredClone(b.input),amounts:{},details:{},source:residualSources[b.kind]};if(b.kind==='occasional'){occasional(b.input,r);const prior=priorOccasionalSettlement(b);if(prior&&r.status==='calculated'){r.details.priorWithholdingRef=prior.input.withheldRef;r.details.priorWithholdingDate=prior.calculatedAt;if(b.input.withholdingCorrected==='yes'&&(b.input.withholdingCorrectionRef??'').trim()){r.details.withholdingCorrectionRef=b.input.withholdingCorrectionRef;r.reason+=' Correcção da retenção anterior declarada segundo referência externa,sem certificar esse acto;histórico preservado.';}else{r.status='partial';r.amounts.hypotheticalOwnTax=r.amounts.tax;r.amounts.tax=null;r.amounts.payment=null;r.amounts.withheld=prior.amounts.withheld??prior.amounts.tax;r.missing.push('Retenção liberatória anterior para a mesma operação;reconciliar eventual correcção documentada antes de nova prestação própria');r.reason='A via foi alterada,mas a retenção liberatória documentada permanece no histórico. Não é gerada segunda prestação;os dados da operação e as duas versões ficam preservados.';}}}else if(b.kind==='acquisitions')acquisitions(d,b.input,r);else formalities(d,b.input,r);return{...b,...(b.result?{history:[...(b.history??[]),structuredClone(b.result)]}:{}),result:r};}
|
||||
const labels:Record<string,string>={base:'Base',prior:'Acumulado global anterior',ordinary:'Parcela ordinária',excess:'Parcela excedente',tax:'Imposto',payment:'Prestação própria',withheld:'Retenção documentada',hypotheticalOwnTax:'Cálculo próprio apenas hipotético,sem prestação gerada',covered:'Parcela abrangida pelo limite',coveredTax:'Retenção5%da parcela abrangida',excessTax:'RetençãoIRPS20%da parcela qualificada',total:'Total de retenções',interest:'Juros documentados',finalPayment:'Preparação do montante a entregar'};
|
||||
export function ispcResidualReportRows(d:Record<string,unknown>):Array<[string,string,string,string]>{const rows:Array<[string,string,string,string]>=[];for(const kind of ['occasional','acquisitions','formalities']as const){try{const b=ispcResidualBook(d,kind),r=b.result;if(!r)continue;const title={occasional:'Operações ocasionais próprias',acquisitions:'Aquisições acima do limite',formalities:'Formalidades2026—B–Geral'}[kind];rows.push(['ISPC',title,`${({calculated:'Calculado',settled_by_withholding:'Retenção liberatória documentada',partial:'Parcial',indeterminate:'Indeterminado',not_applicable:'Não aplicável ao recorte'} as Record<string,string>)[r.status]};${r.reason};falta:${r.missing.join('; ')||'nenhum dado deste recorte'}`,`${ispcResidualCurrent(d,b)?'Entradas correspondentes':'Histórico preservado;rever entradas'};${r.calculatedAt};${r.source}`]);for(const[k,v]of Object.entries(r.amounts).filter(([k])=>!k.startsWith('q8')))rows.push(['ISPC',`${title}—${kind==='formalities'&&r.input.sourceKind==='acquisitions'&&k==='payment'?'Retenções a entregar pelo adquirente':labels[k]||k}`,v?`${fractionPresentation(v).decimal}MZN (${v.numerator}/${v.denominator})`:'Indeterminado',`${r.input.reference||r.details.acquisitionRef||r.input.externalRef||'Pressupostos/documentos declarados'};${r.scope}`]);}catch(e){rows.push(['ISPC','Residual não recuperável',String(e),'Originais preservados.']);}}return rows;}
|
||||
export function ispcFormalPreparationHtml(d:Record<string,unknown>):string{const b=ispcResidualBook(d,'formalities'),r=b.result;if(!r||!ispcResidualCurrent(d,b)||!Object.keys(r.amounts).length)throw Error('Guarde primeiro preparação actual com cálculo identificado.');const esc=(v:unknown)=>String(v??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]!));const v=(n:string)=>r.amounts[n]?fractionPresentation(r.amounts[n]!).decimal:'Indeterminado';const fields=[['Quadro1—tipo',b.input.declaration==='initial'?'Inicial':'Substituição'],['Quadro2—mês/ano',r.details.formPeriod],['Contexto—trimestre e mês de pagamento',`2026/T${r.details.quarter};${r.details.paymentMonth} (não copiado automaticamente para quadro2)`],['Quadro3—NUIT/ÁreaFiscal',`${b.input.nuit}/${b.input.fiscalArea}`],['Quadro5—nome',b.input.name],['Quadro6—domicílio',b.input.address],['Quadro8—linha1:base01/taxa/montante05',`${b.input.sourceKind==='acquisitions'?'ISPC—retenção12(3)':'ISPC—parcela ordinária'};base01:${v('q8base01')};taxa:${r.details.q8rate01}%;montante05:${v('q8tax05')}`],['Quadro8—linha2:base02/taxa/montante06',r.amounts.q8base02&&cmp(r.amounts.q8base02,fraction(0n))>0n?`${b.input.sourceKind==='acquisitions'?'IRPS—acto isolado57(2k)':'ISPC—excesso de vendas8(1)d'};base02:${v('q8base02')};taxa20%;montante06:${v('q8tax06')}`:'Não aplicável ao cálculo seleccionado;sem segunda parcela'],['Quadro8—subtotal1campo09',v('tax')],['Quadro10—montante/juros/importância',`Imposto calculado:${v('tax')};prestação legal:${v('payment')};juros:${v('interest')};totalpreparado:${v('finalPayment')}`],['Modelo/código das retenções',b.input.retentionFormRef||'Por corresponder se aplicável'],['Estado externo declarado',`${({preparation:'Em preparação',submitted:'Submetido segundo referência declarada',received:'Recebido segundo referência declarada',paid:'Pago segundo referência declarada'} as Record<string,string>)[b.input.externalStatus]};${b.input.externalRef};${b.input.externalDate}`],['Falta',r.missing.join('; ')||'Nenhum dado deste recorte']];return`<!doctype html><html lang="pt"><meta charset="utf-8"><title>PreparaçãoISPC—B–Geral</title><style>body{font:16px system-ui;margin:32px}td,th{border:1px solid #777;padding:10px;vertical-align:top}table{border-collapse:collapse;width:100%}</style><h1>Preparação de campos ISPC—Modelo B–Geral</h1><p>Correspondência de apoio; não é formulário oficial emitido, declaração submetida ou comprovativo de pagamento. Original e instrução AT preservados,sem os alterar.</p><table>${fields.map(([a,c])=>`<tr><th>${esc(a)}</th><td>${esc(c)}</td></tr>`).join('')}</table><p>${esc(r.source)}</p><p>Quadros8e10têm numeração própria;campos homónimos não são somados entre quadros. Não preencher área de serviços nem assinatura automaticamente.</p></html>`;}
|
||||
@@ -189,7 +189,7 @@ export function calculateAcquisitions(draft:Record<string,unknown>,book:Acquisit
|
||||
if(input?.absent.includes('05') && (declaredAmount('exports')||declaredAmount('sales_zero_rate'))) throw new Error('Existem exportações ou vendas de outro enquadramento. Não confirme ausência no campo05 sem resolver a classificação.');
|
||||
const sales=salesCurrent?projection?.rows?.find(r=>r.date.slice(0,7)===period):null;
|
||||
fields['01']=sales?.net_sales??null;fields['02']=sales?.vat??null;
|
||||
if((!sales || sales.net_sales===null || sales.vat===null)&&!(book.rows.some(r=>r.deductionLink||r.d)&&salesOperationsCurrent(draft,salesBook(draft))&&salesBook(draft).result?.periods.some(p=>p.period===period))) reasons.push('01/02: vendas ou IVA mensal em falta, execução incompleta ou desactualizada.');
|
||||
if((!sales || sales.net_sales===null || sales.vat===null)&&!(salesOperationsCurrent(draft,salesBook(draft))&&salesBook(draft).result?.periods.some(p=>p.period===period&&p.fields['01']!=null&&p.fields['02']!=null))) reasons.push('01/02: vendas ou IVA mensal em falta, execução incompleta ou desactualizada.');
|
||||
for(const field of excluded) fields[field]=input?.absent.includes(field)?'0.00':null;
|
||||
const operations=salesBook(draft);
|
||||
if(operations.rows.length || operations.result) {
|
||||
|
||||
@@ -15,9 +15,9 @@ export const modeloAFields: ModeloAField[] = [
|
||||
{field:'02',purpose:'IVA à taxa geral',origin:'Resultado mensal congelado no servidor',calculation:'Campo01 × taxa da versão publicada /100',basis:'CIVA art.17(1); mesma regra/versionamento do consumidor',status:'Implementado; componente do apuramento'},
|
||||
{field:'03',purpose:'Base de operações específicas à taxa reduzida',origin:'Operações separadas e enquadradas; ainda não recolhidas',calculation:'Base das operações elegíveis',basis:'Exemplar e CIVA art.17-A, aditado pela Lei22/2022; enquadramento a cadastrar',status:pending},
|
||||
{field:'04',purpose:'IVA à taxa reduzida',origin:'Campo03 e futura versão fundamentada',calculation:'Campo03 × taxa reduzida aplicável; não activa pelo exemplar',basis:'CIVA art.17-A; âmbito/versão temporal a integrar',status:pending},
|
||||
{field:'05',purpose:'Vendas isentas com direito à dedução',origin:'Vendas classificadas por operação e fundamento',calculation:'Soma das bases classificadas; sem taxa presumida',basis:'Exemplar; CIVA arts.9–14 e 18–20 a consolidar por operação',status:pending},
|
||||
{field:'06',purpose:'Operações da alínea b), n.º1, art.18, conforme exemplar',origin:'Operações classificadas com referência verificada',calculation:'Soma separada; não inferir do nome do sector',basis:'Remissão do exemplar ao art.18(1)(b); cotejo do âmbito necessário',status:pending},
|
||||
{field:'07',purpose:'Isentas sem direito à dedução',origin:'Vendas classificadas e uso das aquisições',calculation:'Soma das bases elegíveis',basis:'Exemplar; incidência/isenções e exclusões de dedução a fundamentar',status:pending},
|
||||
{field:'05',purpose:'Vendas isentas com direito à dedução',origin:'Operações com tratamento próprio identificado no catálogo',calculation:'Soma exclusiva das bases classificadas05; sem repetir06',basis:'Correspondência do exemplar confirmada pelaTempo25/10/2026;fundamento próprio de cada tratamento preservado',status:'Correspondência reconciliada no catálogo existente;condições fiscais por operação mantidas'},
|
||||
{field:'06',purpose:'Operações do n.º1,alínea b),do artigo18.ºdoCIVA',origin:'Linhas com correspondência própria identificada;nenhum tratamento actual atribuído06',calculation:'Soma exclusiva de06;sem repetir05 e sem inferir de localização estrangeira',basis:'Rótulo e posição no exemplar confirmados pelaTempo25/10/2026;sem corrigir a remissão',status:'Identificado e separado;desconhecido não vira06 nem zero;período completo sem linhas06 permitezero'},
|
||||
{field:'07',purpose:'Operações que não conferem direito à dedução',origin:'Vendas classificadas e uso das aquisições',calculation:'Soma das bases elegíveis',basis:'Exemplar; incidência/isenções e exclusões de dedução a fundamentar',status:pending},
|
||||
{field:'08',purpose:'IVA dedutível — imobilizado',origin:'Aquisições/facturas de activos, não o valor global do investimento',calculation:'Apenas imposto elegível documentado',basis:'CIVA arts.18–21; art.18(2), Lei10/2025: documentos legais e fornecedor inscrito',status:pending},
|
||||
{field:'09',purpose:'IVA dedutível — existências',origin:'Compras projectadas reutilizáveis; falta IVA, documento e elegibilidade',calculation:'IVA elegível das existências, não compras × taxa geral',basis:'CIVA arts.18–21; condições/exclusões, afectação e período',status:pending},
|
||||
{field:'10',purpose:'IVA dedutível — outros bens/serviços',origin:'Aquisições discriminadas; despesas agregadas não provam IVA',calculation:'IVA elegível; excluir operações sem direito',basis:'CIVA arts.18–21; art.19(2), Lei10/2025, inclui exclusão das operações art.17-A',status:pending},
|
||||
|
||||
@@ -22,7 +22,7 @@ const source2016 = 'CIVA republicado Lei13/2016, BR156, 10.º suplemento, PDF9
|
||||
const source2025 = 'Lei10/2025, BR248, suplemento1, PDF14–15 (2180(14)–(15)); arts.1/2/3/5; efeitos01/01/2026';
|
||||
const healthGoodsSource = 'CIVA republicado Lei13/2016, PDF9, p.1426(267), art.9(1)(b–f); PDF15, p.1426(273), art.19(1); Lei22/2022 art.1, PDF1, p.2252(25), mantém9(1)(b–f). Âmbito técnico2026/MZN';
|
||||
const internalOperation = 'Operação interna localizada em Moçambique; não é importação nem operação localizada no estrangeiro';
|
||||
export const modeloA06Correspondence = 'P001 residual:identificação05/06/07 do exemplar preservada. Não há atribuição automática06por localização estrangeira ou operação desconhecida. Retoma apenas com esclarecimento concreto novo;provas anteriores preservadas. Esta limitação não impede os tratamentos independentes já disponíveis.';
|
||||
export const modeloA06Correspondence = 'Correspondência confirmada pela Tempo em25/10/2026 no exemplar VAT Return(1).pdf:05 — Vendas isentas com direito à dedução;06 — Operações do n.º1,alínea b),do artigo18.ºdoCIVA;07 — Operações que não conferem direito à dedução. Campo14=01+03+05+06+07,cada operação contada uma única vez no seu campo. O catálogo actual identifica os seus tratamentos por fundamento e destino exclusivo;nenhum está atribuído ao06. Operação no estrangeiro não significa06:enquadramento desconhecido permanece indeterminado. O06 só soma linhas que tenham correspondência própria identificada;zero exige período completo sem essas linhas. Originais e resultados históricos preservados.';
|
||||
export type OperationTreatment = {id:string; label:string; field:string|null; rate:number|null; article:string; source:string; conditions:string[];logicVersion?:string};
|
||||
const nonprofitConditions = [
|
||||
'Não distribui nem disponibiliza lucros; os corpos gerentes não têm interesse directo ou indirecto nos resultados, por si ou interposta pessoa',
|
||||
@@ -132,6 +132,21 @@ export type SalesOperation = {id:string;period:string;description:string;establi
|
||||
export type SalesBook = {currency:string;rows:SalesOperation[];periods:Array<{period:string;complete:boolean}>; result?:SalesResult; history?:SalesResult[]};
|
||||
export type SalesLineResult = {id:string;field:string|null;net:string|null;vat:string|null;gross:string|null;rate:number|null;status:'calculated'|'exempt'|'indeterminate';reason:string;article:string;source:string;exact?:{net:FiscalFraction;vat:FiscalFraction;gross:FiscalFraction}};
|
||||
export type SalesResult = {version:string;revision:number;calculatedAt:string;opportunity:string;location:string;currency:string;key:string;inputs:SalesOperation[];rows:SalesLineResult[];periods:Array<{period:string;fields:Record<string,string|null>;exactFields?:Record<string,FiscalFraction|null>;reasons:string[]}>;rounding:string};
|
||||
export const salesBaseFields = ['01','03','05','06','07'] as const;
|
||||
/** One result identity belongs to at most one base field; this does not classify a new tax treatment. */
|
||||
export function salesBaseMembership(rows:readonly SalesLineResult[]):Record<typeof salesBaseFields[number],SalesLineResult[]> {
|
||||
const groups:Record<typeof salesBaseFields[number],SalesLineResult[]>={'01':[],'03':[],'05':[],'06':[],'07':[]};
|
||||
const seen=new Set<string>();
|
||||
for(const row of rows){
|
||||
if(seen.has(row.id))throw new Error('Mesma operação repetida no apuramento; não somar em05 e06 nem duas vezes no mesmo campo.');
|
||||
seen.add(row.id);
|
||||
if(row.field===null)continue;
|
||||
if(!salesBaseFields.includes(row.field as typeof salesBaseFields[number]))throw new Error('Campo de base sem correspondência identificada no exemplar; conservar a operação antes de a somar.');
|
||||
groups[row.field as typeof salesBaseFields[number]].push(row);
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
|
||||
type Store = ReturnType<typeof readAcquisitionStore> & {salesOperations?:Record<string,SalesBook>};
|
||||
export function newSalesOperation(id:string,period:string,currency:string):SalesOperation {return {id,period,description:'',establishment:'',amount:'',basis:'',treatment:'other',confirmed:[],evidence:'',sourceAmount:null,sourcePeriod:period,sourceCurrency:currency,source:'Introdução directa; projecção, não declaração submetida'};}
|
||||
export function continueAnnexIOperation(row:SalesOperation,targetId:string):SalesOperation {
|
||||
@@ -244,9 +259,9 @@ export function calculateSales(draft:Record<string,unknown>,book:SalesBook,now=n
|
||||
const periods=book.periods.map(p=>{
|
||||
const matching=book.rows.map((r,i)=>({input:r,result:rows[i]})).filter(r=>r.input.period===p.period),fields:Record<string,string|null>={},exactFields:Record<string,FiscalFraction|null>={},reasons=matching.filter(r=>r.result.status==='indeterminate').map(r=>`${r.input.description||r.input.id}: ${r.result.reason}`);
|
||||
const known=p.complete&&!matching.some(r=>r.result.status==='indeterminate');
|
||||
for(const f of ['01','03','05','07'])fields[f]=known?sum(matching.filter(r=>r.result.field===f).map(r=>r.result.net)):null;
|
||||
const membership=salesBaseMembership(matching.map(r=>r.result));
|
||||
for(const f of salesBaseFields)fields[f]=known?sum(membership[f].map(r=>r.net)):null;
|
||||
for(const [f,base] of [['02','01'],['04','03']])fields[f]=known?sum(matching.filter(r=>r.result.field===base).map(r=>r.result.vat)):null;
|
||||
fields['06']=known?'0.00':null;
|
||||
if(matching.some(r=>r.result.exact)) {
|
||||
for(const [f,base,part] of [['01','01','net'],['02','01','vat'],['03','03','net'],['04','03','vat'],['05','05','net'],['06','06','net'],['07','07','net']] as const) {
|
||||
exactFields[f]=known?addFractions(matching.filter(r=>r.result.field===base).map(r=>r.result.exact?.[part]??decimalFraction(r.result[part]!))):null;
|
||||
|
||||
@@ -445,25 +445,20 @@ export function portalNavigation(access: PortalNavAccess): PortalNavItem[] {
|
||||
id: 'discovery',
|
||||
label: 'Descoberta',
|
||||
children: [
|
||||
link(
|
||||
'why',
|
||||
'Porquê investir em Moçambique?',
|
||||
'/porque-investir',
|
||||
),
|
||||
link(
|
||||
'idea-entry',
|
||||
'Partir de uma ideia',
|
||||
'/investimentos/iniciar',
|
||||
),
|
||||
link(
|
||||
'opportunities',
|
||||
'Consultar oportunidades',
|
||||
'/oportunidades',
|
||||
'why',
|
||||
'Porquê investir em Moçambique',
|
||||
'/porque-investir',
|
||||
),
|
||||
link(
|
||||
'simulator',
|
||||
'Simulador Fiscal',
|
||||
access.context?.simulator || '/simulador-fiscal',
|
||||
'opportunities',
|
||||
'Oportunidades de investimento',
|
||||
'/oportunidades',
|
||||
),
|
||||
link('sectors', 'Sectores de investimento', '/sectores'),
|
||||
link('locations', 'Localizações', '/oportunidades?view=map'),
|
||||
@@ -505,6 +500,11 @@ export function portalNavigation(access: PortalNavAccess): PortalNavItem[] {
|
||||
label: 'Realização',
|
||||
children: [
|
||||
link('start', 'Iniciar investimento', '/investimentos/iniciar'),
|
||||
link(
|
||||
'simulator',
|
||||
'Incentivos e simulador fiscal',
|
||||
access.context?.simulator || '/simulador-fiscal',
|
||||
),
|
||||
link(
|
||||
'licensing',
|
||||
'Licenciamento',
|
||||
|
||||
@@ -176,9 +176,6 @@ const rowSection: Record<string, DossierReportSectionId> = {
|
||||
Tesouraria: 'finance',
|
||||
'IVA mensal': 'finance',
|
||||
ISPC: 'finance',
|
||||
'IRPC — retenções': 'finance',
|
||||
'IRPC normal — L6': 'finance',
|
||||
'IRPC — L7': 'finance',
|
||||
Equipa: 'team',
|
||||
'Necessidade de negócio': 'resources',
|
||||
Financiamento: 'resources',
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import {normalReportRows} from './irpc-normal.ts';
|
||||
import {irpcReportRows} from './irpc-withholdings.ts';
|
||||
import {ispcResidualReportRows} from './ispc-residuals.ts';
|
||||
import {ispcWithholdingReportRows} from './ispc-withholding.ts';
|
||||
import {ispcQuarterReportRows} from './ispc-quarter.ts';
|
||||
import {ispcEligibilityReportRows} from './ispc-eligibility.ts';
|
||||
@@ -694,9 +691,6 @@ export function buildProjectDossierRows(
|
||||
rows.push(...ispcEligibilityReportRows(draft));
|
||||
rows.push(...ispcQuarterReportRows(draft));
|
||||
rows.push(...ispcWithholdingReportRows(draft));
|
||||
rows.push(...ispcResidualReportRows(draft));
|
||||
rows.push(...irpcReportRows(draft));
|
||||
rows.push(...normalReportRows(draft));
|
||||
rows.push(...fiscalCalculationGapReportRows(draft));
|
||||
rows.push(...l3FormPreparationReportRows(draft));
|
||||
const operationRows = salesReportRows(draft);
|
||||
|
||||
@@ -1001,6 +1001,7 @@ export default function PortalInvestidorApp({
|
||||
setQuery={setHeroQuery}
|
||||
onSearch={handleHeroSearch}
|
||||
stats={home.data?.data.stats}
|
||||
onNavigate={navigate}
|
||||
/>
|
||||
<InvestmentContextCards />
|
||||
<QueryStatus
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Head, Link, usePage } from '@inertiajs/react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { PortalMenu } from '@/layouts/portal-navigation';
|
||||
import { cn } from '@/lib/utils';
|
||||
import type { TerritorialSourceEvidence } from '@/components/territorial-source-evidence';
|
||||
import type {
|
||||
StructureGeography,
|
||||
@@ -102,11 +101,9 @@ export const card = 'rounded-xl border border-slate-200 bg-white p-5 shadow-sm';
|
||||
export function Frame({
|
||||
title,
|
||||
children,
|
||||
mainClassName,
|
||||
}: {
|
||||
title: string;
|
||||
children: ReactNode;
|
||||
mainClassName?: string;
|
||||
}) {
|
||||
const { flash } = usePage<{
|
||||
flash?: { success?: string; warning?: string };
|
||||
@@ -115,12 +112,7 @@ export function Frame({
|
||||
<div className="min-h-screen bg-slate-50 text-slate-900">
|
||||
<Head title={title} />
|
||||
<PortalMenu />
|
||||
<main
|
||||
className={cn(
|
||||
'mx-auto max-w-7xl space-y-6 px-5 py-9',
|
||||
mainClassName,
|
||||
)}
|
||||
>
|
||||
<main className="mx-auto max-w-7xl space-y-6 px-5 py-9">
|
||||
<h1 className="text-3xl font-bold">{title}</h1>
|
||||
{flash?.warning && (
|
||||
<p
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user