Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f14f5dde2 | ||
|
|
fb7248661d | ||
|
|
0682ef74e2 | ||
|
|
21ce03f65c |
@@ -18728,5 +18728,320 @@
|
||||
},
|
||||
"base_VAT_separation": "Accepted QA reused:comparison retainsdeclaredbase withoutautomaticcorrection;referencedcorrection uses ownamount/ref/date/scope;projectedscenario explicitlyconditional,notATdecision. Context/percourse/origin changesretainvalues andclearconfirmation. Base independent of VAT/rate(alwaysnull),no deduction/regularisation inferred. Four installed runtime hashes and16compiled markers verified;no synthetic activewrite.",
|
||||
"activation": "Normal Git fast-forward/webhook/installer;zero migrations/imports"
|
||||
},
|
||||
"iva_l1_g7i_P089_homologation_20261024": {
|
||||
"status": "installed_delta_verified_partial_L1",
|
||||
"candidate": "a4329bb4bfb44546a5c64b8c4baabf4231a1c3c3",
|
||||
"base_installed": "cd530b248bf9dee5a6e7f1e4d710346084a2421f",
|
||||
"coverage_complete_branches": {
|
||||
"AUD-SIM-L1-P089": [
|
||||
"free_company_service",
|
||||
"private_company_asset_use",
|
||||
"exempt_sector_asset_use"
|
||||
]
|
||||
},
|
||||
"branch_count_complete": 1,
|
||||
"treatment_count": 3,
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-service-normal.ts",
|
||||
"sha256_LF": "e10fa8131534982eae17ce72849fb794a8e0438c85719b872571a33c53e5f019"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-service-normal.tsx",
|
||||
"sha256_LF": "b7838cc7dadd058906a3997e218deb79792d587a6daf67f7f3139ff22a0668a5"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-monthly-iva.tsx",
|
||||
"sha256_LF": "8581d037947c9d764400e99627952524bcf28ed8b5bf865ba4a1cb4b74acd7ac"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "aa15412c46064a9cff6dbe2dba086e1acfe79fe50f313280ccb9ee7c89484c99"
|
||||
}
|
||||
],
|
||||
"counts_before": {
|
||||
"delivered": 86,
|
||||
"QA": 1,
|
||||
"functional_pending": 45,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 87,
|
||||
"QA": 0,
|
||||
"functional_pending": 45,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_delivery": {
|
||||
"delivered": 87,
|
||||
"QA": 0,
|
||||
"functional_pending": 45,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"QA_proofs_reused": [
|
||||
"iva-l1-g7i-qa-20261024.json"
|
||||
],
|
||||
"authorization": "Tempo explicitly deploya4329bb4 through existingGit,preserve concurrentchanges and check installeddelta only;P089three treatments,prior deductioncondition limitedto applicableassetuse paths",
|
||||
"scope": "2026/MZN,P089baseonly;no automaticnormalvaluation orsubstitution byassetpurchaseprice/cost;no IVA/incidence/rate/deduction/field11/regularisation/ModeloAtotals. Prior deductionfact/reference doesnot calculateorgrant deduction. Unknownconditions/normalvalue indeterminate,explicitno notapplicable notzero. Otherbooks includingP103/102/101/095unchanged.",
|
||||
"meaning": "Free services bycompany forprivate/nonbusinesspurpose4(2)(a);useofcompanygoods forprivate/nonbusinesspurpose or in exemptsector4(2)(b). Previous total/partialdeduction ongoods/elements requiredonlyfor4(2)(b),not4(2)(a). Use distinctfrompermanentgoods transferP088.",
|
||||
"formula": "normalvalue ofservice under15(4),identifiedbasis/scope andcomposition15(5)/(6),netofownVAT",
|
||||
"preservation": "86priorclosures and partialP084/P085 preserved;acceptedQA reused;freshbackup/realisolatedrestore beforeinstallation;installeddelta only",
|
||||
"partial_P084_P085": "Preparation/conditional simulation only,benefits pending;no closure",
|
||||
"limits": "P084/P085partial,pending;P00105/06;L1open;beveragesL2/L3;Statistics/AIdeferred",
|
||||
"containment": "l1-g7i-readonly-rollback-20261024.patch,checked only,not applied;blocks newP089calculations only,preserves readers/history/otherbranches",
|
||||
"authenticated_preflight": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "cd530b248bf9dee5a6e7f1e4d710346084a2421f",
|
||||
"release": "/var/www/investmoz-homologacao/releases/cd530b248bf9dee5a6e7f1e4d710346084a2421f-0b68e7a9",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/5d5f3b414866969e4b2d38376402b8f264c6d19c-7453aad9",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/cd530b248bf9dee5a6e7f1e4d710346084a2421f-0b68e7a9",
|
||||
"release_revision": {
|
||||
"commit": "cd530b248bf9dee5a6e7f1e4d710346084a2421f",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:14:42.034149+00:00",
|
||||
"manifest_sha256": "ba479b580dd012c09e8f4c94e691a75642da781583a21a6fc46c649b59b6d4e1"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"backup_restore": {
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-l1-g7i-delivery-20261024/backup",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "f521bc779cc87c7bc500c37f44d15748961e098d0a420e9514bbb11adf8eefa4",
|
||||
"files_sha256": "5d26d4d18c8ee9f09c40f9f99c044c9b7c98d3a33db94dc03347b23aa89dc9cf",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "l1_g7i_restore_20261024",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "f521bc779cc87c7bc500c37f44d15748961e098d0a420e9514bbb11adf8eefa4",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
},
|
||||
"served_commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"installation": {
|
||||
"protected": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/cd530b248bf9dee5a6e7f1e4d710346084a2421f-0b68e7a9",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"runtime_files_verified": 4,
|
||||
"persistent_files_and_env_verified": 369,
|
||||
"tables_compared": 174,
|
||||
"changed_tables": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 106,
|
||||
"checksum": "45610a4958896515bb8c40336788ed14"
|
||||
},
|
||||
"after": {
|
||||
"rows": 106,
|
||||
"checksum": "fbe7bcd9ed9fb14cd53e72323e65123b"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 78,
|
||||
"checksum": "f2d2cc72e918fa3281aa63d3f1694643"
|
||||
},
|
||||
"after": {
|
||||
"rows": 79,
|
||||
"checksum": "cd50f4e02a9922517e5d427d5dd2473c"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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
|
||||
},
|
||||
"public": {
|
||||
"status": "installed_delta_verified",
|
||||
"served_revision": {
|
||||
"commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:23:28.102878+00:00",
|
||||
"manifest_sha256": "329dea28609b9850332b63a730576a539077489d9e085235be7f344c3428f39c"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"assimilated-service-normal/1": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"free_company_service": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"private_company_asset_use": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"exempt_sector_asset_use": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"serviceNormals": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"freeByCompany": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"nonBusinessPurpose": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"companyAssetUse": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"privatePurpose": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"exemptSector": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"priorDeduction": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"assetRef": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"deductionRef": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"purposeRef": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"normalValue": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"valuationScope": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"IVA: Indeterminado": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/services-QCmLUqU2.js",
|
||||
"status": 200,
|
||||
"sha256": "43e0f5cc440aac01075a66a6cde5cf2b8124f9ae2ce1937d742a38867f4f1c26"
|
||||
},
|
||||
{
|
||||
"file": "assets/simulation-form-CPZAFZU3.js",
|
||||
"status": 200,
|
||||
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-_Ly_4ECn.js",
|
||||
"status": 200,
|
||||
"sha256": "9db3d0991381c45f9ef4e73ee285f90b6e39736709459cbe992d59644008ed0c"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-CdgtDyQM.js",
|
||||
"status": 200,
|
||||
"sha256": "d319ea9cc9113ed0dc5ebe2f931b9e445578cea9d0e35a6f4d9feab4a0476d85"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-BEW2fH9O.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"
|
||||
},
|
||||
"installer": {
|
||||
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/cd530b248bf9dee5a6e7f1e4d710346084a2421f-0b68e7a9",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/cd530b248bf9dee5a6e7f1e4d710346084a2421f-0b68e7a9",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"6f1cf7b7a09796b3964b39f0b1e778f978ae60fb"
|
||||
],
|
||||
"finished_at": "2026-10-24T21:23:30.754896+00:00"
|
||||
},
|
||||
"log_file": "1792876907186052463.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 26.07s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 378",
|
||||
"# pass 378",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 139074
|
||||
},
|
||||
"rollback_executed": false
|
||||
},
|
||||
"base_VAT_separation": "Accepted QA reused:normalvalueofservice15c/4(2),three ownconditionpaths;prior total/partialdeduction ongoods/elements requiredonlyassetuse4(2)b,notfreecompanyservice4(2)a. References/purpose/normalvaluebasis/scope/immutableinputs/history/report preserved. Base independent of VAT/rate(alwaysnull),prior deductionreference doesnotcalculateorgrantfield11. Four installed runtime hashes and17compiled markers verified;no synthetic activewrite.",
|
||||
"activation": "Normal Git fast-forward/webhook/installer;zero migrations/imports"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"implementation_commit": "90b31c677f9f541364a2fdddc98d01280d4371f1",
|
||||
"status": "QA_complete_not_delivered",
|
||||
"status": "delivered_with_QA_proofs_preserved",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P089": [
|
||||
"free_company_service",
|
||||
@@ -153,5 +153,18 @@
|
||||
"homologation_unchanged": "cd530b24",
|
||||
"remaining": "Integrate/deliver through existingGit withmanifest,freshbackup/real isolatedrestore and installeddelta;no push in QA task",
|
||||
"limits": "P084/P085partial,pending;P00105/06;L1open;beveragesL2/L3;Statistics/AIdeferred",
|
||||
"sources_inventory": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g7i-service-normal-20261024\\source-archive-inventory.json"
|
||||
"sources_inventory": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g7i-service-normal-20261024\\source-archive-inventory.json",
|
||||
"qa_status_preserved": "QA_complete_not_delivered",
|
||||
"delivery_followup": {
|
||||
"served_commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"receipt": "l1-g7i-delivery-20261024.json",
|
||||
"record": "iva_l1_g7i_P089_homologation_20261024",
|
||||
"counts": {
|
||||
"delivered": 87,
|
||||
"QA": 0,
|
||||
"functional_pending": 45,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"implementation_commit": "0682ef74e2e1523d5a424b92989de39122677898",
|
||||
"status": "QA_complete_not_delivered",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P105": [
|
||||
"goods_with_transport",
|
||||
"goods_without_transport",
|
||||
"goods_before_import"
|
||||
]
|
||||
},
|
||||
"branch_count": 1,
|
||||
"treatment_count": 3,
|
||||
"source": "CIVA6(1)/(2),Lei13/2016 PDF7/p1426(265);Lei10/2025 PDF12 mantém1/2 e altera7–9 digitais.",
|
||||
"meaning": "Local dos bens no início transporte/expedição ou,sem transporte,quando postos à disposição;regra especial do importador/transmissões subsequentes antes da importação nacional. Fora do território não equivale a isenção ou IVA zero.",
|
||||
"formula": "Classificação territorial pelos factos6(1)/(2),sem cálculo monetário.",
|
||||
"scope": "2026,bens corpóreos;classificação territorial apenas,sem base,taxa,IVA,isenção,dedução/campo11,direitos ou totaisModeloA. Não abrange digitais/serviços por esta regra.",
|
||||
"technical_choices": "Livro goodsLocations por oportunidade no snapshot/API/dossier existente;sem schema/permissões. Troca conserva locais/referências ocultos e limpa condições próprias;dados e documentos reutilizáveis ou pressupostos expressos,sem certificados/aprovadores inventados.",
|
||||
"verification": {
|
||||
"frontend": {
|
||||
"tests": 4,
|
||||
"passed": 4,
|
||||
"failed": 0,
|
||||
"scope": "Três percursos,condições desconhecidas/não,referências/datas,local físico e regra6(2),endereço/moeda não determinam território,troca conserva dados ocultos/limpa condições próprias,gravação/histórico/relatório e livros anteriores preservados."
|
||||
},
|
||||
"privateAPI": {
|
||||
"tests": 1,
|
||||
"assertions": 30,
|
||||
"target": "simulator_fiscal_delta_20261021_test:55441",
|
||||
"transaction_rollback": true,
|
||||
"xml": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g8a-goods-location-20261024\\api-tests.xml"
|
||||
},
|
||||
"types": "passed",
|
||||
"build": "passed,existing plugin timing warnings",
|
||||
"UI": "Edge/CUA componente real:local desconhecido produz indeterminado;restauradoMZ,gravação/recuperação/relatório confirmam national/outside/national,IVA/base/taxa null,3linhas e4versões anteriores. Dados sintéticos,não aceitação manualTempo.",
|
||||
"UI_screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g8a-goods-location-20261024\\qa-recovered-report.png"
|
||||
},
|
||||
"preservation": {
|
||||
"base": "21ce03f65ced0047ae7143e47c76f250b20029d6",
|
||||
"delivered_ids": [
|
||||
"AUD-SIM-L1-P003",
|
||||
"AUD-SIM-L1-P004",
|
||||
"AUD-SIM-L1-P005",
|
||||
"AUD-SIM-L1-P006",
|
||||
"AUD-SIM-L1-P007",
|
||||
"AUD-SIM-L1-P008",
|
||||
"AUD-SIM-L1-P009",
|
||||
"AUD-SIM-L1-P010",
|
||||
"AUD-SIM-L1-P011",
|
||||
"AUD-SIM-L1-P012",
|
||||
"AUD-SIM-L1-P013",
|
||||
"AUD-SIM-L1-P014",
|
||||
"AUD-SIM-L1-P015",
|
||||
"AUD-SIM-L1-P016",
|
||||
"AUD-SIM-L1-P017",
|
||||
"AUD-SIM-L1-P018",
|
||||
"AUD-SIM-L1-P019",
|
||||
"AUD-SIM-L1-P020",
|
||||
"AUD-SIM-L1-P021",
|
||||
"AUD-SIM-L1-P022",
|
||||
"AUD-SIM-L1-P023",
|
||||
"AUD-SIM-L1-P024",
|
||||
"AUD-SIM-L1-P025",
|
||||
"AUD-SIM-L1-P026",
|
||||
"AUD-SIM-L1-P027",
|
||||
"AUD-SIM-L1-P028",
|
||||
"AUD-SIM-L1-P029",
|
||||
"AUD-SIM-L1-P030",
|
||||
"AUD-SIM-L1-P031",
|
||||
"AUD-SIM-L1-P032",
|
||||
"AUD-SIM-L1-P033",
|
||||
"AUD-SIM-L1-P034",
|
||||
"AUD-SIM-L1-P035",
|
||||
"AUD-SIM-L1-P036",
|
||||
"AUD-SIM-L1-P037",
|
||||
"AUD-SIM-L1-P038",
|
||||
"AUD-SIM-L1-P039",
|
||||
"AUD-SIM-L1-P040",
|
||||
"AUD-SIM-L1-P041",
|
||||
"AUD-SIM-L1-P042",
|
||||
"AUD-SIM-L1-P043",
|
||||
"AUD-SIM-L1-P044",
|
||||
"AUD-SIM-L1-P045",
|
||||
"AUD-SIM-L1-P048",
|
||||
"AUD-SIM-L1-P049",
|
||||
"AUD-SIM-L1-P050",
|
||||
"AUD-SIM-L1-P051",
|
||||
"AUD-SIM-L1-P052",
|
||||
"AUD-SIM-L1-P053",
|
||||
"AUD-SIM-L1-P054",
|
||||
"AUD-SIM-L1-P055",
|
||||
"AUD-SIM-L1-P056",
|
||||
"AUD-SIM-L1-P057",
|
||||
"AUD-SIM-L1-P060",
|
||||
"AUD-SIM-L1-P061",
|
||||
"AUD-SIM-L1-P062",
|
||||
"AUD-SIM-L1-P063",
|
||||
"AUD-SIM-L1-P064",
|
||||
"AUD-SIM-L1-P065",
|
||||
"AUD-SIM-L1-P066",
|
||||
"AUD-SIM-L1-P067",
|
||||
"AUD-SIM-L1-P068",
|
||||
"AUD-SIM-L1-P069",
|
||||
"AUD-SIM-L1-P070",
|
||||
"AUD-SIM-L1-P071",
|
||||
"AUD-SIM-L1-P072",
|
||||
"AUD-SIM-L1-P073",
|
||||
"AUD-SIM-L1-P074",
|
||||
"AUD-SIM-L1-P075",
|
||||
"AUD-SIM-L1-P076",
|
||||
"AUD-SIM-L1-P077",
|
||||
"AUD-SIM-L1-P078",
|
||||
"AUD-SIM-L1-P079",
|
||||
"AUD-SIM-L1-P080",
|
||||
"AUD-SIM-L1-P081",
|
||||
"AUD-SIM-L1-P082",
|
||||
"AUD-SIM-L1-P083",
|
||||
"AUD-SIM-L1-P086",
|
||||
"AUD-SIM-L1-P089",
|
||||
"AUD-SIM-L1-P090",
|
||||
"AUD-SIM-L1-P091",
|
||||
"AUD-SIM-L1-P094",
|
||||
"AUD-SIM-L1-P095",
|
||||
"AUD-SIM-L1-P100",
|
||||
"AUD-SIM-L1-P101",
|
||||
"AUD-SIM-L1-P102",
|
||||
"AUD-SIM-L1-P103"
|
||||
],
|
||||
"confirmed_losses": [],
|
||||
"accepted_delivery": "6f1cf7b7/21ce03f6;174tables/369files;29published/28relations/408geometries;code/schema/data/config/permissions compared at delivery",
|
||||
"frozen": "tests\\frontend\\fixtures\\iva-g8a-preserved-inputs.json",
|
||||
"sha256": "7b0b553abaeb83d891064cedb65ccddc730caac27a227ae2046aa3e4f5d75538",
|
||||
"counts_before": {
|
||||
"delivered": 87,
|
||||
"QA": 0,
|
||||
"functional_pending": 45,
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
},
|
||||
"scope": "P105only;allpreviousbooks immutable including P089/P103/P102/P101/P095/P060/P050/partialP084P085;no active query/write"
|
||||
},
|
||||
"runtime_delta": {
|
||||
"resources/js/lib/iva-goods-location.ts": "c187bbaf13d408461e787786dc8cc81504fef6ed60a848f62ebffe31cfa86e6d",
|
||||
"resources/js/components/simulation-goods-location.tsx": "e4440c1315a1b1009d9b51ced99d7e6a2fc65a3ebac05d6b5bde1d41a796784f",
|
||||
"resources/js/components/simulation-monthly-iva.tsx": "ca7c2185d9fcf8ffc8374be4a99d3102c7e1326372859ac678603da90b3de913",
|
||||
"resources/js/lib/project-dossier.ts": "c95bbd7e307ab2c7dcec42fc9d280709f0ecb7c9be174977ae571cc4447bf5b9"
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 87,
|
||||
"QA": 1,
|
||||
"functional_pending": 44,
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
},
|
||||
"homologation_unchanged": "6f1cf7b7",
|
||||
"remaining": "Integrar/disponibilizar pelo processoGit existente com manifesto,backup/restauro e delta instalado;sem push nesta tarefaQA.",
|
||||
"limits": "P084/P085 parciais e pendentes;L1aberto;P00105/06;bebidasL2/L3;Estatísticas/IAadiadas.",
|
||||
"sources_inventory": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g8a-goods-location-20261024\\source-archive-inventory.json"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
|
||||
"status": "installed_delta_verified_partial_L1",
|
||||
"candidate": "a4329bb4bfb44546a5c64b8c4baabf4231a1c3c3",
|
||||
"base_installed": "cd530b248bf9dee5a6e7f1e4d710346084a2421f",
|
||||
"coverage_complete_branches": {
|
||||
@@ -37,8 +37,8 @@
|
||||
"total": 133
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 86,
|
||||
"QA": 1,
|
||||
"delivered": 87,
|
||||
"QA": 0,
|
||||
"functional_pending": 45,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
@@ -125,5 +125,191 @@
|
||||
"source_dump_sha256": "f521bc779cc87c7bc500c37f44d15748961e098d0a420e9514bbb11adf8eefa4",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"served_commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"installation": {
|
||||
"protected": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/cd530b248bf9dee5a6e7f1e4d710346084a2421f-0b68e7a9",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"runtime_files_verified": 4,
|
||||
"persistent_files_and_env_verified": 369,
|
||||
"tables_compared": 174,
|
||||
"changed_tables": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 106,
|
||||
"checksum": "45610a4958896515bb8c40336788ed14"
|
||||
},
|
||||
"after": {
|
||||
"rows": 106,
|
||||
"checksum": "fbe7bcd9ed9fb14cd53e72323e65123b"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 78,
|
||||
"checksum": "f2d2cc72e918fa3281aa63d3f1694643"
|
||||
},
|
||||
"after": {
|
||||
"rows": 79,
|
||||
"checksum": "cd50f4e02a9922517e5d427d5dd2473c"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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
|
||||
},
|
||||
"public": {
|
||||
"status": "installed_delta_verified",
|
||||
"served_revision": {
|
||||
"commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:23:28.102878+00:00",
|
||||
"manifest_sha256": "329dea28609b9850332b63a730576a539077489d9e085235be7f344c3428f39c"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"assimilated-service-normal/1": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"free_company_service": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"private_company_asset_use": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"exempt_sector_asset_use": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"serviceNormals": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"freeByCompany": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"nonBusinessPurpose": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"companyAssetUse": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"privatePurpose": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"exemptSector": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"priorDeduction": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"assetRef": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"deductionRef": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"purposeRef": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"normalValue": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"valuationScope": [
|
||||
"assets/services-QCmLUqU2.js",
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
],
|
||||
"IVA: Indeterminado": [
|
||||
"assets/project-dossier-_Ly_4ECn.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/services-QCmLUqU2.js",
|
||||
"status": 200,
|
||||
"sha256": "43e0f5cc440aac01075a66a6cde5cf2b8124f9ae2ce1937d742a38867f4f1c26"
|
||||
},
|
||||
{
|
||||
"file": "assets/simulation-form-CPZAFZU3.js",
|
||||
"status": 200,
|
||||
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-_Ly_4ECn.js",
|
||||
"status": 200,
|
||||
"sha256": "9db3d0991381c45f9ef4e73ee285f90b6e39736709459cbe992d59644008ed0c"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-CdgtDyQM.js",
|
||||
"status": 200,
|
||||
"sha256": "d319ea9cc9113ed0dc5ebe2f931b9e445578cea9d0e35a6f4d9feab4a0476d85"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-BEW2fH9O.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"
|
||||
},
|
||||
"installer": {
|
||||
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/cd530b248bf9dee5a6e7f1e4d710346084a2421f-0b68e7a9",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/cd530b248bf9dee5a6e7f1e4d710346084a2421f-0b68e7a9",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"6f1cf7b7a09796b3964b39f0b1e778f978ae60fb"
|
||||
],
|
||||
"finished_at": "2026-10-24T21:23:30.754896+00:00"
|
||||
},
|
||||
"log_file": "1792876907186052463.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 26.07s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 378",
|
||||
"# pass 378",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 139074
|
||||
},
|
||||
"rollback_executed": false
|
||||
},
|
||||
"base_VAT_separation": "Accepted QA reused:normalvalueofservice15c/4(2),three ownconditionpaths;prior total/partialdeduction ongoods/elements requiredonlyassetuse4(2)b,notfreecompanyservice4(2)a. References/purpose/normalvaluebasis/scope/immutableinputs/history/report preserved. Base independent of VAT/rate(alwaysnull),prior deductionreference doesnotcalculateorgrantfield11. Four installed runtime hashes and17compiled markers verified;no synthetic activewrite.",
|
||||
"activation": "Normal Git fast-forward/webhook/installer;zero migrations/imports"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
{
|
||||
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
|
||||
"candidate": "fb7248661dce64def0b809479b2b30fbb099ea42",
|
||||
"base_installed": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"coverage_complete_branches": {
|
||||
"AUD-SIM-L1-P105": [
|
||||
"goods_with_transport",
|
||||
"goods_without_transport",
|
||||
"goods_before_import"
|
||||
]
|
||||
},
|
||||
"branch_count_complete": 1,
|
||||
"treatment_count": 3,
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-goods-location.ts",
|
||||
"sha256_LF": "c187bbaf13d408461e787786dc8cc81504fef6ed60a848f62ebffe31cfa86e6d"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-goods-location.tsx",
|
||||
"sha256_LF": "e4440c1315a1b1009d9b51ced99d7e6a2fc65a3ebac05d6b5bde1d41a796784f"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-monthly-iva.tsx",
|
||||
"sha256_LF": "ca7c2185d9fcf8ffc8374be4a99d3102c7e1326372859ac678603da90b3de913"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "c95bbd7e307ab2c7dcec42fc9d280709f0ecb7c9be174977ae571cc4447bf5b9"
|
||||
}
|
||||
],
|
||||
"counts_before": {
|
||||
"delivered": 87,
|
||||
"QA": 1,
|
||||
"functional_pending": 44,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 87,
|
||||
"QA": 1,
|
||||
"functional_pending": 44,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_delivery": {
|
||||
"delivered": 88,
|
||||
"QA": 0,
|
||||
"functional_pending": 44,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"QA_proofs_reused": [
|
||||
"iva-l1-g8a-qa-20261024.json"
|
||||
],
|
||||
"authorization": "Tempo explicitly deployfb724866 through existingGit,preserve concurrentchanges and check installeddelta only",
|
||||
"scope": "2026,bens corpóreos;classificação territorial apenas,sem base,taxa,IVA,isenção,dedução/campo11,direitos ou totaisModeloA. Não abrange digitais/serviços por esta regra.",
|
||||
"meaning": "Local dos bens no início transporte/expedição ou,sem transporte,quando postos à disposição;regra especial do importador/transmissões subsequentes antes da importação nacional. Fora do território não equivale a isenção ou IVA zero.",
|
||||
"formula": "Classificação territorial pelos factos6(1)/(2),sem cálculo monetário.",
|
||||
"preservation": "87prior closures and partialP084/P085 preserved;acceptedQA reused;fresh backup/real isolated restore;installed delta only",
|
||||
"partial_P084_P085": "Preparation/conditional simulation only,benefits pending;no closure",
|
||||
"limits": "P084/P085 parciais e pendentes;L1aberto;P00105/06;bebidasL2/L3;Estatísticas/IAadiadas.",
|
||||
"containment": "l1-g8a-readonly-rollback-20261024.patch,checked only,not applied;blocks newP105classifications,preserves readers/history/otherbranches",
|
||||
"authenticated_preflight": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/cd530b248bf9dee5a6e7f1e4d710346084a2421f-0b68e7a9",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"release_revision": {
|
||||
"commit": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:23:28.102878+00:00",
|
||||
"manifest_sha256": "329dea28609b9850332b63a730576a539077489d9e085235be7f344c3428f39c"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"backup_restore": {
|
||||
"backup": {
|
||||
"stage": "/var/backups/investmoz-l1-g8a-delivery-20261024/backup",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "8d776d1a8fe3383bf7a02b8539256ef5c9c12a8d9a07ef5e310ee70dd30de38d",
|
||||
"files_sha256": "b90f41cd34fac9e2aea698e7d95eeb55893a6e1cca1c08e26d3f7ef00ca7aec3",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "l1_g8a_restore_20261024",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "8d776d1a8fe3383bf7a02b8539256ef5c9c12a8d9a07ef5e310ee70dd30de38d",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/resources/js/lib/iva-goods-location.ts
|
||||
+++ b/resources/js/lib/iva-goods-location.ts
|
||||
@@ -51,6 +51,7 @@
|
||||
function key(draft:Record<string,unknown>,book:GoodsLocationBook):string{return JSON.stringify({version:goodsLocationVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},rows:book.rows});}
|
||||
export function goodsLocationCurrent(draft:Record<string,unknown>,book:GoodsLocationBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);}
|
||||
export function recordGoodsLocations(draft:Record<string,unknown>,book:GoodsLocationBook):GoodsLocationBook{
|
||||
+ throw new Error('Novas classificações P105 temporariamente suspensas; dados, histórico, relatórios e restantes ramos preservados.');
|
||||
if(!book.rows.length||new Set(book.rows.map(row=>row.id)).size!==book.rows.length)throw new Error('Indique operações com identificadores distintos;originais conservados.');
|
||||
const result:GoodsLocationCalculation={version:goodsLocationVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:goodsLocationSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateGoodsLocation(row))};
|
||||
const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveGoodsLocationBook(draft,next);return next;
|
||||
@@ -1,5 +1,34 @@
|
||||
# Rastreabilidade, utilização e formação
|
||||
|
||||
## 24/10/2026 — G8A/P105 concluído em QA:localização de bens
|
||||
|
||||
Implementação `0682ef74`. Um ramo,três tratamentos: `goods_with_transport`, `goods_without_transport`, `goods_before_import`. CIVA6(1)/(2),Lei13/2016 PDF7/p1426(265);Lei10/2025 PDF12 mantém1/2 e altera7–9 digitais. 2026,bens corpóreos;classificação territorial apenas,sem base,taxa,IVA,isenção,dedução/campo11,direitos ou totaisModeloA. Não abrange digitais/serviços por esta regra.
|
||||
|
||||
Identificar local físico e momento relevante;endereço/nacionalidade do cliente não os substituem. Conferir a regra6(2)antes de aplicar6(1):importador e transmissões subsequentes antes da importação nacional,com transporte/cadeia/importação e âmbito identificados. Fora do território não equivale a isenção/IVA zero;desconhecido permanece indeterminado. Reutilizar documentos/dados ou pressupostos expressos. Troca de percurso conserva campos ocultos e exige rever condições próprias,escolha técnica de integridade. Livro incremental goodsLocations,snapshot/API/dossier existentes,sem schema/permissões novos.
|
||||
|
||||
Verificação:4testes frontend;API privada1teste/30asserções com rollback emQAisolada55441;tipos/build aprovados;Edge/CUA local desconhecido,gravação/recuperação/relatório de3linhas e4versões anteriores. Livros/resultados/históricos anteriores comparados com congelamento,87fechos preservados;provas anteriores reutilizadas. Relatório `docs\investmoz\simulations\iva-l1-g8a-qa-20261024.json`;evidência `C:\laragon\www\portal-investidor\outputs\iva-l1-g8a-goods-location-20261024/verification.json` e imagem `qa-recovered-report.png`. Sem escrita no activo.
|
||||
|
||||
**87entregues +1QA(P105) +44funcionaispendentes +P001=133**. Homologação permanece `6f1cf7b7`;falta integração/disponibilização. P084/P085 parciais e pendentes;L1aberto;P00105/06;bebidasL2/L3;Estatísticas/IAadiadas.
|
||||
|
||||
|
||||
|
||||
## 24/10/2026 — preparação G8A/P105,inventário antes de testes
|
||||
|
||||
G7I/P089 aceite6f1cf7b7/21ce03f6;**87entregues+45funcionaispendentes+P001=133**. Inventariados87fechos,sem perdas confirmadas;provas instaladas código/schema/dados/configuração/permissões174tabelas/369ficheiros/29fichas/28relações/408geometrias reutilizadas. Congelados todos os livros/resultados/históricos,incluindoP089/P103/P102/P101/P100/P095/P094/P091/P060/P050/P084/P085parciais. Sem repetir aceitação anterior ou ensaiar no activo.
|
||||
|
||||
G8A/P105 executaCIVA6(1)/(2),2016PDF7/p1426(265),mantidos naLei10/2025PDF12,que altera6(7–9)digitais. Três tratamentos no mesmo ramo,recorte2026/bens corpóreos:não usar regra física genérica para bens digitais/serviços. Localização dos bens ao iniciar transporte/expedição para adquirente;sem transporte,ao pôr à disposição;apesar de6(1),transmissões pelo importador e subsequentes de bens transportados/expedidos do estrangeiro antes de importação nacional são abrangidas6(2). Confirmar não aplicação6(2)antes de usar6(1);desconhecido não é fora do território. Endereço/nacionalidade do cliente não determina local dos bens. Referências/local/data/cadeia/âmbito reutilizáveis ou pressupostos expressos,sem certificado/aprovador novo. Classificação territorial,não isenção/taxa/IVA/base/dedução/campo11/direitos/totaisModeloA. Novo livro incremental,snapshot/API/relatório existentes,sem schema/permissões. L1aberto;P00105/06;bebidasL2/L3;P084/P085parciais;Estatísticas/IAadiadas.
|
||||
|
||||
|
||||
|
||||
## 24/10/2026 — G7I/P089 entregue:valor normal de serviços gratuitos/utilização de bens
|
||||
|
||||
Homologação **`6f1cf7b7`**,pelo processoGit existente,sobre`cd530b24`;candidata`a4329bb4` expressamente aceite pela Tempo. **P089:um ramo,três tratamentos**:`free_company_service`,`private_company_asset_use`,`exempt_sector_asset_use`. Base=valor normal do serviço15(2)c/15(4),fundamento/âmbito e composição15(5)/(6),sem próprioIVA. Serviço gratuito pela própria empresa para necessidades particulares do titular/pessoal ou fins alheios4(2)a não exige dedução anterior. Utilização de bens para uso próprio/particular/alheio ou em sector isento4(2)b exige dedução anterior total/parcial nos bens/elementos,com referência;essa referência não calcula nem concede dedução/campo11. Uso não é transmissão permanenteP088;nenhum custo/preço de aquisição dos bens substitui automaticamente valor normal do serviço. Mudança de tratamento conserva montantes/documentos/bens/dedução oculta e limpa condições próprias,mantém comuns. Referências/finalidade/fundamento/âmbito conservados nas entradas imutáveis,versões/histórico/relatório. Desconhecido não é zero;sem avaliadores/certificados/aprovadores novos. Base separada de incidência/taxa/IVA(IVA/taxa permanecemnull),dedução/campo11/regularizações/totaisModeloA. Livros anteriores não alterados nem base somada como imposto.
|
||||
|
||||
Destino e main conferidos novamente;sem avanço concorrente encontrado. SessãoSSH autenticada existente reutilizada,sem guardar credenciais. Backup novo e restauro real isolado sem rede:**174tabelas e369ficheiros/configuração**. ProvasQA aceites reutilizadas;conferido apenas delta instalado:revisão servida,manifesto/hash,17marcadores compilados do livro/componente/relatório,três percursos/condições próprias/dedução anterior limitada/fundamento/âmbito,quatro ficheiros funcionais e simuladorHTTP200. Comparação PostgreSQL pela mesma identidade antes/depois:174tabelas/369ficheiros,29fichas publicadas/28relações/408geometrias preservados;diferenças apenas cache/sessões. Zero migrações/importações/alterações de permissões e zero ensaios sintéticos no activo. Release/backup anteriores preservados;contençãoP089 conferida,não aplicada,leitores/históricos e restantes ramos preservados.
|
||||
|
||||
[Manifesto/recibo](../simulations/l1-g7i-delivery-20261024.json),registo`iva_l1_g7i_P089_homologation_20261024`. **87entregues +45funcionaispendentes +P001 =133;sem candidatasQA por disponibilizar.** Os86fechos anteriores permanecem encerrados. P084/P085 continuam nos45,apenas preparação/simulação condicionada,sem benefícios confirmados;rascunhos,decisões,âmbitos e históricos preservados. L1aberto;P001 só05/06;bebidasL2/L3;Estatísticas/IAadiadas. FecharL1 não exige concluirL2/L3 nem todos os impostos.
|
||||
|
||||
|
||||
|
||||
## 24/10/2026 — G7I/P089 concluído emQA:valor normal de serviços gratuitos/utilização de bens
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,34 @@
|
||||
import {useState} from 'react';
|
||||
import {newGoodsLocation,switchGoodsTreatment,goodsLocationBook,goodsLocationConditions,ownGoodsConditions,goodsLocationCurrent,goodsLocationReportRows,goodsLocationSource,goodsLocationTreatments,recordGoodsLocations,saveGoodsLocationBook,type GoodsLocationBook,type GoodsLocationRow} from '@/lib/iva-goods-location';
|
||||
|
||||
export function SimulationGoodsLocation({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}){
|
||||
const[error,setError]=useState('');let book:GoodsLocationBook;
|
||||
try{book=goodsLocationBook(draft);}catch(cause){return<p role="alert">{String(cause)}</p>;}
|
||||
const save=(next:GoodsLocationBook)=>{try{onChange('modelo_a_snapshot',saveGoodsLocationBook(draft,next));setError('');}catch(cause){setError(String(cause));}};
|
||||
const change=(id:string,patch:Partial<GoodsLocationRow>)=>save({...book,rows:book.rows.map(row=>row.id===id?{...row,...patch}:row)});
|
||||
return<details className="space-y-3 rounded border p-3">
|
||||
<summary>Localização — transmissões de bens e antes da importação</summary>
|
||||
<p>Oportunidade: {String(draft.context_opportunity||'entrada geral')}. Identifique os bens e os factos da transmissão. Com transporte,indique onde se encontram ao iniciá-lo;sem transporte,onde são postos à disposição. O endereço ou nacionalidade do cliente não substituem estes factos.</p>
|
||||
<p>Na transmissão pelo importador ou subsequente antes da importação nacional de bens vindos do estrangeiro,confira a regra própria6(2). A localização física anterior no estrangeiro não a afasta por si. Fora do âmbito territorial não equivale a isenção ou IVA zero;esta classificação não calcula imposto.</p>
|
||||
<p>{goodsLocationSource}</p>{error&&<p role="alert">{error}</p>}
|
||||
<button type="button" className="underline" onClick={()=>save({...book,rows:[...book.rows,newGoodsLocation(crypto.randomUUID())]})}>Acrescentar localização de transmissão</button>
|
||||
{book.rows.map(row=><details key={row.id} className="rounded border p-3"><summary>{row.description||'Operação por identificar'} — {row.period||'mês por indicar'}</summary>
|
||||
<div className="grid gap-3 md:grid-cols-2">
|
||||
<label>Percurso de localização dos bens<select className="block rounded border p-2" value={row.treatment} onChange={e=>change(row.id,switchGoodsTreatment(row,e.target.value))}><option value="">Por indicar</option>{goodsLocationTreatments.map(t=><option key={t.id} value={t.id}>{t.label}</option>)}</select></label>
|
||||
<label>Natureza dos dados<select className="block rounded border p-2" value={row.origin} onChange={e=>change(row.id,{origin:e.target.value as GoodsLocationRow['origin']})}><option value="projected">Projectados / pressupostos</option><option value="effective">Efectivos declarados</option></select></label>
|
||||
{([['description','Bens e transmissão identificados'],['operationRef','Referência da operação / pressuposto'],['operationDate','Data da transmissão / prevista'],['period','Mês da transmissão'],['documentRef','Documento da operação / referência da previsão'],['documentDate','Data do documento / prevista'],['scope','Âmbito: bens, operação, período e condições'],['evidence','Fundamento factual / pressupostos']] as const).map(([field,label])=><label key={field}>{label}<input className="block rounded border p-2" type={['operationDate','documentDate'].includes(field)?'date':field==='period'?'month':'text'} value={row[field]} onChange={e=>change(row.id,{[field]:e.target.value})}/></label>)}
|
||||
{row.treatment&&row.treatment!=='goods_before_import'&&<>
|
||||
<label>{row.treatment==='goods_with_transport'?'Local dos bens no início do transporte/expedição':'Local dos bens quando postos à disposição sem transporte'}<input className="block rounded border p-2" value={row.goodsPlace} onChange={e=>change(row.id,{goodsPlace:e.target.value})}/></label>
|
||||
<label>Situação desse local face ao território nacional<select className="block rounded border p-2" value={row.placeCountry} onChange={e=>change(row.id,{placeCountry:e.target.value})}><option value="">Por indicar</option><option value="MZ">Em Moçambique</option><option value="foreign">Fora de Moçambique</option></select></label>
|
||||
<label>Referência da localização dos bens / pressuposto<input className="block rounded border p-2" value={row.placeRef} onChange={e=>change(row.id,{placeRef:e.target.value})}/></label>
|
||||
</>}
|
||||
{['goods_with_transport','goods_before_import'].includes(row.treatment)&&<label>Referência do transporte/expedição / pressuposto<input className="block rounded border p-2" value={row.transportRef} onChange={e=>change(row.id,{transportRef:e.target.value})}/></label>}
|
||||
{row.treatment==='goods_before_import'&&<><label>Referência da importação nacional / pressuposto<input className="block rounded border p-2" value={row.importRef} onChange={e=>change(row.id,{importRef:e.target.value})}/></label><label>Importador/cadeia e posição desta transmissão<input className="block rounded border p-2" value={row.chainRef} onChange={e=>change(row.id,{chainRef:e.target.value})}/></label></>}
|
||||
</div>
|
||||
<p>Mudar percurso conserva os locais e referências,mas exige rever os factos próprios. Campos sem aplicação ficam ocultos e conservados.</p>
|
||||
<fieldset><legend>Factos próprios deste percurso</legend>{[...goodsLocationConditions,...ownGoodsConditions(row.treatment)].map(([key,label])=><label className="block" key={key}>{label}<select className="block rounded border p-2" value={row.conditions[key]??''} onChange={e=>change(row.id,{conditions:{...row.conditions,[key]:e.target.value as ''|'yes'|'no'}})}><option value="">Por indicar</option><option value="yes">Sim</option><option value="no">Não</option></select></label>)}</fieldset>
|
||||
</details>)}
|
||||
{!!book.rows.length&&<button type="button" className="rounded bg-emerald-800 p-2 text-white" onClick={()=>{try{save(recordGoodsLocations(draft,book));}catch(cause){setError(String(cause));}}}>Classificar localização e guardar versão</button>}
|
||||
{book.result&&<><p role="status">{goodsLocationCurrent(draft,book)?'Localizações correspondentes às entradas guardadas.':'Entradas alteradas;localizações históricas conservadas. Reveja e classifique novamente.'} {book.history?.length??0} versões anteriores. Classificação não determina isenção,IVA ou campo11.</p><dl>{goodsLocationReportRows(draft).map(([,label,value,origin],index)=><div key={index}><dt className="font-semibold">{label}</dt><dd>{value}<small className="block">{origin}</small></dd></div>)}</dl></>}
|
||||
</details>;
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import { SimulationCompositionBase } from './simulation-composition-base';
|
||||
import { SimulationExclusionBase } from './simulation-exclusion-base';
|
||||
import { SimulationValueReview } from './simulation-value-review';
|
||||
import { SimulationServiceNormal } from './simulation-service-normal';
|
||||
import { SimulationGoodsLocation } from './simulation-goods-location';
|
||||
import { SimulationOfferPreparations } from './simulation-offer-preparations';
|
||||
import { SimulationOperations } from './simulation-operations';
|
||||
|
||||
@@ -108,6 +109,7 @@ export function SimulationMonthlyIva({draft, busy, onCalculate, onChange}: {
|
||||
<SimulationExclusionBase draft={draft} onChange={onChange} />
|
||||
<SimulationValueReview draft={draft} onChange={onChange} />
|
||||
<SimulationServiceNormal draft={draft} onChange={onChange} />
|
||||
<SimulationGoodsLocation draft={draft} onChange={onChange} />
|
||||
<SimulationOfferPreparations draft={draft} onChange={onChange} />
|
||||
<SimulationModeloA draft={draft} />
|
||||
</section>;
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import {acquisitionScope,readAcquisitionStore} from './iva-acquisitions.ts';
|
||||
|
||||
export const goodsLocationVersion='goods-territoriality/1';
|
||||
export const goodsLocationSource='CIVA republicado Lei13/2016,6(1)/(2),PDF7/p1426(265):localização dos bens no território nacional ao iniciar transporte/expedição para o adquirente ou,sem transporte/expedição,ao pôr à sua disposição. Não obstante6(1),são também tributáveis transmissões pelo importador e subsequentes de bens transportados/expedidos do estrangeiro,antes da importação. Lei10/2025PDF12mantém6(1)/(2),altera6(7–9)quanto a digitais;recorte2026,bens corpóreos,não digitais. Endereço/nacionalidade do cliente não substituem localização dos bens. Classificação territorial apenas,não isenção/taxa/IVA/dedução/campo11/direitos aduaneiros ou totaisModeloA.';
|
||||
export const goodsLocationTreatments=[{id:'goods_with_transport',label:'Bens com transporte ou expedição para o adquirente'},{id:'goods_without_transport',label:'Bens sem transporte ou expedição'},{id:'goods_before_import',label:'Transmissão pelo importador ou subsequente,antes da importação'}] as const;
|
||||
export const goodsLocationConditions=[
|
||||
['goodsSupply','Está identificada uma transmissão de bens corpóreos,não uma prestação de serviços ou bens digitais abrangidos por regras próprias'],
|
||||
['factsCorrespond','Os factos,referências e âmbito correspondem a esta operação e período,não apenas ao endereço ou nacionalidade do adquirente'],
|
||||
] as const;
|
||||
export const goodsOwnConditions={
|
||||
goods_with_transport:[['transportToBuyer','Os bens são transportados ou expedidos para o adquirente'],['notBeforeImport','Não corresponde à transmissão pré-importação abrangida pelo artigo6(2)']],
|
||||
goods_without_transport:[['noTransport','Não há expedição ou transporte dos bens para esta transmissão'],['notBeforeImport','Não corresponde à transmissão pré-importação abrangida pelo artigo6(2)']],
|
||||
goods_before_import:[['fromAbroad','Os bens são transportados ou expedidos do estrangeiro'],['nationalImport','Está identificada a importação desses bens para o território nacional'],['importerChain','A transmissão é feita pelo importador ou é subsequente na cadeia desses bens'],['beforeImport','Esta transmissão ocorre antes da importação identificada']],
|
||||
} as const;
|
||||
export function ownGoodsConditions(treatment:string):ReadonlyArray<readonly[string,string]>{return goodsOwnConditions[treatment as keyof typeof goodsOwnConditions]??[];}
|
||||
type Choice=''|'yes'|'no';type Condition=typeof goodsLocationConditions[number][0];
|
||||
export type GoodsLocationRow={id:string;treatment:string;description:string;period:string;origin:'projected'|'effective';operationDate:string;operationRef:string;documentRef:string;documentDate:string;goodsPlace:string;placeCountry:string;placeRef:string;transportRef:string;importRef:string;chainRef:string;scope:string;evidence:string;conditions:Partial<Record<string,Choice>>};
|
||||
type LineResult={id:string;status:'determined'|'not_applicable'|'indeterminate';territory:'national'|'outside'|null;baseAmount:null;vat:null;rate:null;reason:string};
|
||||
export type GoodsLocationCalculation={version:string;revision:number;calculatedAt:string;opportunity:string;location:string;sourceKey:string;source:string;inputs:GoodsLocationRow[];rows:LineResult[]};
|
||||
export type GoodsLocationBook={rows:GoodsLocationRow[];result?:GoodsLocationCalculation;history?:GoodsLocationCalculation[]};
|
||||
type Store=ReturnType<typeof readAcquisitionStore>&{goodsLocations?:Record<string,GoodsLocationBook>};
|
||||
export function newGoodsLocation(id:string):GoodsLocationRow{return{id,treatment:'',description:'',period:'',origin:'projected',operationDate:'',operationRef:'',documentRef:'',documentDate:'',goodsPlace:'',placeCountry:'',placeRef:'',transportRef:'',importRef:'',chainRef:'',scope:'',evidence:'',conditions:{}};}
|
||||
export function switchGoodsTreatment(row:GoodsLocationRow,treatment:string):GoodsLocationRow{return{...row,treatment,conditions:Object.fromEntries(goodsLocationConditions.map(([key])=>[key,row.conditions[key]??'']))};}
|
||||
|
||||
function readStore(draft:Record<string,unknown>):Store{
|
||||
const store=readAcquisitionStore(draft.modelo_a_snapshot) as Store;
|
||||
if(store.goodsLocations!==undefined&&(!store.goodsLocations||typeof store.goodsLocations!=='object'||Array.isArray(store.goodsLocations)))throw new Error('Bases de contraprestação não recuperáveis;originais preservados.');
|
||||
const fields=Object.keys(newGoodsLocation('')).filter(key=>key!=='conditions');
|
||||
for(const book of Object.values(store.goodsLocations??{}))if(!book||!Array.isArray(book.rows)||(book.history!==undefined&&!Array.isArray(book.history))||book.rows.some(row=>!row||fields.some(key=>typeof row[key as keyof GoodsLocationRow]!=='string')||!row.conditions||typeof row.conditions!=='object'||Array.isArray(row.conditions)))throw new Error('Linhas de contraprestação não recuperáveis;originais preservados,sem substituição por lista vazia.');
|
||||
return store;
|
||||
}
|
||||
export function goodsLocationBook(draft:Record<string,unknown>):GoodsLocationBook{return readStore(draft).goodsLocations?.[acquisitionScope(draft)]??{rows:[]};}
|
||||
export function saveGoodsLocationBook(draft:Record<string,unknown>,book:GoodsLocationBook):string{const current=readStore(draft),encoded=JSON.stringify({...current,goodsLocations:{...current.goodsLocations,[acquisitionScope(draft)]:book}});readStore({...draft,modelo_a_snapshot:encoded});return encoded;}
|
||||
function validDate(value:string):boolean{const d=new Date(value+'T00:00:00Z');return /^\d{4}-\d{2}-\d{2}$/.test(value)&&Number.isFinite(d.getTime())&&d.toISOString().slice(0,10)===value;}
|
||||
export function evaluateGoodsLocation(row:GoodsLocationRow):LineResult{
|
||||
const result:LineResult={id:row.id,status:'indeterminate',territory:null,baseAmount:null,vat:null,rate:null,reason:''};const stop=(reason:string,status:LineResult['status']='indeterminate')=>({...result,status,reason});
|
||||
const rule=goodsLocationTreatments.find(t=>t.id===row.treatment);if(!rule)return stop('Identifique transporte,ausência de transporte ou transmissão antes da importação;desconhecido não determina território.');
|
||||
if(!/^2026-(0[1-9]|1[0-2])$/.test(row.period)||!['projected','effective'].includes(row.origin)||!validDate(row.operationDate)||row.operationDate.slice(0,7)!==row.period)return stop('Identifique mês em2026 e data da operação correspondentes,com dados efectivos declarados ou pressupostos expressos de projecção.');
|
||||
const required=[...goodsLocationConditions,...ownGoodsConditions(row.treatment)];const failed=required.filter(([key])=>row.conditions[key]==='no');if(failed.length)return stop('Este percurso não se aplica: '+failed.map(([,label])=>label).join('; ')+'. Rever o percurso,não classificar automaticamente como fora do território ou isento.','not_applicable');
|
||||
if(required.some(([key])=>row.conditions[key]!=='yes'))return stop('Confirme os factos próprios deste percurso;desconhecido não é fora do território,isenção ou IVA zero.');
|
||||
if(!row.description.trim()||!row.operationRef.trim()||!row.documentRef.trim()||!validDate(row.documentDate)||!row.scope.trim()||!row.evidence.trim())return stop('Identifique bens/operação,documento/data,âmbito e factos ou pressupostos expressos;reutilize referências existentes,sem certificado/aprovador novo.');
|
||||
if(row.treatment==='goods_before_import'){
|
||||
if(!row.transportRef.trim()||!row.importRef.trim()||!row.chainRef.trim())return stop('Identifique transporte/expedição do estrangeiro,importação nacional e posição da transmissão na cadeia,ou pressupostos expressos;não inferir a condição pelo endereço do adquirente.');
|
||||
return{...result,status:'determined',territory:'national',reason:`Art6(2):transmissão pelo importador ou subsequente de bens transportados/expedidos do estrangeiro,antes da importação nacional identificada;abrangida territorialmente emMoçambique,${row.origin==='projected'?'nas condições expressamente assumidas na projecção':'nos dados efectivos declarados'}. A localização física anterior no estrangeiro não afasta por si esta regra. Classificação não determina isenção,base,taxa,IVA,dedução/campo11,direitos ou totaisModeloA.`};
|
||||
}
|
||||
if(!row.goodsPlace.trim()||!row.placeRef.trim()||!['MZ','foreign'].includes(row.placeCountry))return stop('Identifique onde os bens se encontram no momento relevante e respectiva referência:início do transporte/expedição ou colocação à disposição sem transporte;endereço do cliente não substitui esse facto.');
|
||||
if(row.treatment==='goods_with_transport'&&!row.transportRef.trim())return stop('Identifique o transporte/expedição correspondente ao início referido,ou pressuposto expresso.');
|
||||
const territory=row.placeCountry==='MZ'?'national':'outside';return{...result,status:'determined',territory,reason:`Art6(1):bens ${territory==='national'?'situados emMoçambique':'situados fora deMoçambique'} ${row.treatment==='goods_with_transport'?'ao iniciar o transporte/expedição para o adquirente':'ao serem postos à disposição do adquirente,sem transporte/expedição'},${row.origin==='projected'?'nas condições expressamente assumidas na projecção':'nos dados efectivos declarados'}. Factos de6(2)conferidos como não aplicáveis a este percurso. ${territory==='outside'?'Fora deste âmbito territorial não equivale a isenção ou taxa/IVA zero.':'Abrangência territorial não confirma isenção,taxa ou IVA.'} Classificação não determina base,dedução/campo11,direitos ou totaisModeloA.`};
|
||||
}
|
||||
|
||||
function key(draft:Record<string,unknown>,book:GoodsLocationBook):string{return JSON.stringify({version:goodsLocationVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},rows:book.rows});}
|
||||
export function goodsLocationCurrent(draft:Record<string,unknown>,book:GoodsLocationBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);}
|
||||
export function recordGoodsLocations(draft:Record<string,unknown>,book:GoodsLocationBook):GoodsLocationBook{
|
||||
if(!book.rows.length||new Set(book.rows.map(row=>row.id)).size!==book.rows.length)throw new Error('Indique operações com identificadores distintos;originais conservados.');
|
||||
const result:GoodsLocationCalculation={version:goodsLocationVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:goodsLocationSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateGoodsLocation(row))};
|
||||
const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveGoodsLocationBook(draft,next);return next;
|
||||
}
|
||||
export function goodsLocationReportRows(draft:Record<string,unknown>):Array<[string,string,string,string]>{
|
||||
try{const book=goodsLocationBook(draft),result=book.result;if(!result)return[];return result.inputs.map((row,index)=>['IVA mensal',`Localização P105 — ${row.period} — ${row.id}`,`${row.description};classificação territorial: ${result.rows[index].territory==='national'?'Moçambique':result.rows[index].territory==='outside'?'Fora do território nacional':'Indeterminada'};IVA: Indeterminado;${result.rows[index].reason}`,`${result.opportunity};${result.location};${goodsLocationCurrent(draft,book)?'Resultado actual':'Entradas alteradas;resultado histórico conservado'};versão${result.revision};${result.calculatedAt};${result.source};${row.origin==='projected'?'Projecção':'Dados efectivos declarados'};${goodsLocationTreatments.find(t=>t.id===row.treatment)?.label??'Percurso por indicar'};operação ${row.operationRef},${row.operationDate};${row.treatment==='goods_before_import'?`transporte ${row.transportRef};importação ${row.importRef};cadeia ${row.chainRef}`:`local dos bens ${row.goodsPlace},${row.placeCountry};referência ${row.placeRef}${row.treatment==='goods_with_transport'?`;transporte ${row.transportRef}`:''}`};âmbito ${row.scope};documento ${row.documentRef},${row.documentDate};condições ${[...goodsLocationConditions,...ownGoodsConditions(row.treatment)].map(([key,label])=>label+': '+(row.conditions[key]==='yes'?'Sim':row.conditions[key]==='no'?'Não':'Por indicar')).join('; ')};fundamento factual ${row.evidence};não determina isenção/IVA/campo11/totaisModeloA.`]);}
|
||||
catch{return[['IVA mensal','Localização de bens','Dados não recuperáveis','Originais preservados;sem classificar por defeito.']];}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import { compositionReportRows } from './iva-composition-base.ts';
|
||||
import { exclusionReportRows } from './iva-exclusion-base.ts';
|
||||
import { valueReviewReportRows } from './iva-value-review.ts';
|
||||
import { serviceNormalReportRows } from './iva-service-normal.ts';
|
||||
import { goodsLocationReportRows } from './iva-goods-location.ts';
|
||||
import { offerPreparationReportRows } from './iva-offer-preparations.ts';
|
||||
import { salesReportRows } from './iva-operations.ts';
|
||||
import { fiscalQaRows } from './fiscal-qa-preview.ts';
|
||||
@@ -638,6 +639,7 @@ export function buildProjectDossierRows(
|
||||
rows.push(...exclusionReportRows(draft));
|
||||
rows.push(...valueReviewReportRows(draft));
|
||||
rows.push(...serviceNormalReportRows(draft));
|
||||
rows.push(...goodsLocationReportRows(draft));
|
||||
rows.push(...offerPreparationReportRows(draft));
|
||||
const operationRows = salesReportRows(draft);
|
||||
rows.push(...operationRows);
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
|
||||
final class IvaGoodsLocationDraftTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
public function test_goods_locations_recover_privately_preserving_all_delivered_books(): void
|
||||
{
|
||||
$target = DB::selectOne('select current_database() as name,inet_server_port() as port');
|
||||
$this->assertSame('simulator_fiscal_delta_20261021_test', $target->name);
|
||||
$this->assertSame(55441, (int) $target->port);
|
||||
config(['investor-path.enabled' => true, 'suitecrm.enabled' => false]);
|
||||
$this->actingAs(User::factory()->create(['email_verified_at' => now()]));
|
||||
$draft = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-g8a-bases.json')), true, flags: JSON_THROW_ON_ERROR);
|
||||
$id = $this->postJson('/api/v1/simulation-drafts', ['personal_snapshot' => [], 'economic_snapshot' => $draft], ['Idempotency-Key' => (string) Str::uuid()])->assertCreated()->json('data.id');
|
||||
$recovered = $this->getJson('/api/v1/simulation-drafts/'.$id)->assertOk()->json('data.economic_snapshot');
|
||||
$this->assertSame($draft['modelo_a_snapshot'], $recovered['modelo_a_snapshot']);
|
||||
$this->assertSame('opportunity:348', $recovered['context_opportunity']);
|
||||
$this->assertSame('Manica', $recovered['selection_labels']['province_id']);
|
||||
$store = json_decode($recovered['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
|
||||
$book = $store['goodsLocations']['opportunity:348'];
|
||||
$this->assertCount(3, $book['rows']);
|
||||
$this->assertSame(['goods_with_transport','goods_without_transport','goods_before_import'], array_column($book['rows'], 'treatment'));
|
||||
$this->assertSame(['national','outside','national'], array_column($book['result']['rows'], 'territory'));
|
||||
$this->assertSame(['determined','determined','determined'], array_column($book['result']['rows'], 'status'));
|
||||
$this->assertSame([null,null,null], array_column($book['result']['rows'], 'baseAmount'));
|
||||
$this->assertSame([null,null,null], array_column($book['result']['rows'], 'vat'));
|
||||
$this->assertSame([null,null,null], array_column($book['result']['rows'], 'rate'));
|
||||
$this->assertSame(['MZ','foreign','foreign'], array_column($book['rows'], 'placeCountry'));
|
||||
$this->assertSame('2026-12-12', $book['rows'][0]['operationDate']);
|
||||
$this->assertSame('yes', $book['rows'][2]['conditions']['beforeImport']);
|
||||
$this->assertStringContainsString('importação nacional A', $book['rows'][2]['importRef']);
|
||||
$this->assertStringContainsString('importador A', $book['rows'][2]['chainRef']);
|
||||
$this->assertStringContainsString('local físico', $book['rows'][0]['goodsPlace']);
|
||||
$this->assertStringContainsString('não equivale a isenção', $book['result']['rows'][1]['reason']);
|
||||
$this->assertStringContainsString('6(1)/(2)', $book['result']['source']);
|
||||
$this->assertSame($book['rows'], $book['result']['inputs']);
|
||||
$this->assertCount(2, $book['history']);
|
||||
$this->assertNull($book['history'][0]['rows'][0]['baseAmount']);
|
||||
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-g8a-preserved-inputs.json')), true, flags: JSON_THROW_ON_ERROR);
|
||||
$prior = json_decode($frozen['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
|
||||
$this->assertSame($prior, array_diff_key($store, ['goodsLocations' => true]));
|
||||
$this->assertSame('1250.30', $store['publicAuthorityBases']['opportunity:339']['result']['rows'][1]['baseAmount']);
|
||||
$this->assertNull($store['publicAuthorityBases']['opportunity:339']['result']['rows'][1]['vat']);
|
||||
$this->assertSame('400.00', $store['importExemptions']['opportunity:338']['result']['rows'][1]['importVat']);
|
||||
$this->assertNull($store['books']['opportunity:329']['result']['periods'][0]['fields']['11']);
|
||||
file_put_contents(base_path('outputs/iva-l1-g8a-goods-location-20261024/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,35 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import {newGoodsLocation,switchGoodsTreatment,goodsLocationTreatments,goodsLocationConditions,ownGoodsConditions,evaluateGoodsLocation,recordGoodsLocations,saveGoodsLocationBook,goodsLocationBook,goodsLocationCurrent,goodsLocationReportRows} from '../../resources/js/lib/iva-goods-location.ts';
|
||||
import {serviceNormalCurrent} from '../../resources/js/lib/iva-service-normal.ts';
|
||||
import {valueReviewCurrent} from '../../resources/js/lib/iva-value-review.ts';
|
||||
import {createProjectDossierReport} from '../../resources/js/lib/project-dossier-report.ts';
|
||||
const frozen=JSON.parse(fs.readFileSync(new URL('./fixtures/iva-g8a-preserved-inputs.json',import.meta.url),'utf8'));
|
||||
const row=(treatment='goods_with_transport')=>({...newGoodsLocation('g8a-'+treatment),treatment,description:'SYNTHETIC QA bens A',period:'2026-12',operationDate:'2026-12-12',operationRef:'SYNTHETIC QA operação A',documentRef:'SYNTHETIC QA G8A '+treatment,documentDate:'2026-12-12',goodsPlace:'SYNTHETIC QA local físico dos bens no momento relevante',placeCountry:treatment==='goods_with_transport'?'MZ':'foreign',placeRef:'SYNTHETIC QA referência do local e momento A',transportRef:'SYNTHETIC QA transporte A',importRef:'SYNTHETIC QA importação nacional A',chainRef:'SYNTHETIC QA importador A/transmissão subsequente antes da importação',scope:'SYNTHETIC QA bens A/operação A/dezembro2026/condições A',evidence:'SYNTHETIC QA pressupostos expressos,não documento real',conditions:Object.fromEntries([...goodsLocationConditions,...ownGoodsConditions(treatment)].map(([key])=>[key,'yes']))});
|
||||
const draft=()=>({...structuredClone(frozen),context_opportunity:'opportunity:348',project_title:'SYNTHETIC QA — G8A / Localização de bens'});
|
||||
test('P105 each route owns facts/references;unknown/no never defaultoutside/exempt orIVA zero',()=>{
|
||||
for(const t of goodsLocationTreatments){const input=row(t.id),ok=evaluateGoodsLocation(input);assert.equal(ok.territory,t.id==='goods_without_transport'?'outside':'national');assert.equal(ok.baseAmount,null);assert.equal(ok.vat,null);assert.equal(ok.rate,null);
|
||||
for(const[key]of [...goodsLocationConditions,...ownGoodsConditions(t.id)])for(const value of ['','unknown','no']){const r=evaluateGoodsLocation({...input,conditions:{...input.conditions,[key]:value}});assert.equal(r.status,value==='no'?'not_applicable':'indeterminate');assert.equal(r.territory,null);assert.equal(r.vat,null);}
|
||||
for(const patch of [{description:''},{operationRef:''},{documentRef:''},{documentDate:'2026-02-30'},{operationDate:'2026-11-12'},{operationDate:'2026-02-30'},{scope:''},{evidence:''},{period:'2025-12'},{treatment:''}])assert.equal(evaluateGoodsLocation({...input,...patch}).territory,null);
|
||||
const required=t.id==='goods_before_import'?['transportRef','importRef','chainRef']:['goodsPlace','placeCountry','placeRef',...(t.id==='goods_with_transport'?['transportRef']:[])];for(const field of required)assert.equal(evaluateGoodsLocation({...input,[field]:''}).territory,null);
|
||||
}
|
||||
});
|
||||
test('physical start/disposal determines6(1);preimport6(2)overridesphysicalforeign;no inference fromclient ormoney',()=>{
|
||||
for(const treatment of ['goods_with_transport','goods_without_transport'])for(const placeCountry of ['MZ','foreign'])assert.equal(evaluateGoodsLocation({...row(treatment),placeCountry}).territory,placeCountry==='MZ'?'national':'outside');
|
||||
const before=row('goods_before_import');assert.equal(evaluateGoodsLocation({...before,goodsPlace:'',placeCountry:'',placeRef:''}).territory,'national');assert.equal(evaluateGoodsLocation({...before,placeCountry:'foreign'}).territory,'national');assert.equal(evaluateGoodsLocation({...row(),placeCountry:'unknown'}).territory,null);
|
||||
const switched=switchGoodsTreatment(row('goods_without_transport'),'goods_before_import');for(const field of ['goodsPlace','placeCountry','placeRef','transportRef','importRef','chainRef'])assert.equal(switched[field],row('goods_without_transport')[field]);assert.equal(switched.conditions.beforeImport,undefined);assert.equal(evaluateGoodsLocation(switched).territory,null);
|
||||
const d=draft(),book=recordGoodsLocations(d,{rows:[row()]});assert.ok(goodsLocationCurrent({...d,currency:'USD',customer_address:'foreign',customer_nationality:'foreign'},book));
|
||||
});
|
||||
test('save/recovery/history/report preserve all87 delivered books/currentkeys and territorialclassification distinctfromtax',()=>{
|
||||
const d=draft(),prior=JSON.parse(d.modelo_a_snapshot);assert.deepEqual(goodsLocationBook(d),{rows:[]});assert.deepEqual(goodsLocationReportRows(d),[]);
|
||||
let book=recordGoodsLocations(d,{rows:goodsLocationTreatments.map(t=>({...row(t.id),conditions:{}}))});book=recordGoodsLocations(d,{...book,rows:goodsLocationTreatments.map(t=>({...row(t.id),conditions:{...row(t.id).conditions,goodsSupply:'no'}}))});book=recordGoodsLocations(d,{...book,rows:goodsLocationTreatments.map(t=>row(t.id))});assert.equal(book.history.length,2);assert.ok(book.history.every(h=>h.rows.every(r=>r.territory===null&&r.vat===null)));assert.ok(goodsLocationCurrent(d,book));
|
||||
for(const field of ['treatment','placeCountry','goodsPlace','placeRef','importRef','chainRef','scope','operationDate'])assert.ok(!goodsLocationCurrent(d,{...book,rows:book.rows.map(r=>({...r,[field]:'changed'}))}));for(const patch of [{context_opportunity:'opportunity:349'},{selection_labels:{province_id:'Maputo'}}])assert.ok(!goodsLocationCurrent({...d,...patch},book));
|
||||
d.modelo_a_snapshot=saveGoodsLocationBook(d,book);assert.deepEqual(goodsLocationBook(JSON.parse(JSON.stringify(d))),book);const next=JSON.parse(d.modelo_a_snapshot);const{goodsLocations,...untouched}=next;assert.deepEqual(untouched,prior);for(const[scope,previous]of Object.entries(prior.serviceNormals))assert.ok(serviceNormalCurrent({...d,context_opportunity:scope},previous));for(const[scope,previous]of Object.entries(prior.valueReviews))assert.ok(valueReviewCurrent({...d,context_opportunity:scope},previous));
|
||||
assert.equal(next.serviceNormals['opportunity:347'].result.rows[2].baseAmount,'900.75');assert.equal(next.valueReviews['opportunity:346'].result.rows[1].baseAmount,'1400.75');assert.equal(next.considerationExclusions['opportunity:345'].result.rows[0].baseAmount,'799.70');assert.equal(next.books['opportunity:329'].result.periods[0].fields['11'],null);
|
||||
const report=JSON.stringify(createProjectDossierReport(d,{selectedSections:new Set(['finance']),version:'QA G8A'}));for(const token of ['Localização P105','Fora do território nacional','IVA: Indeterminado','opportunity:348','Manica','2026-12','6(1)','6(2)','importador A','não equivale a isenção','campo11'])assert.ok(report.includes(token),token);assert.deepEqual(goodsLocationReportRows({...d,context_opportunity:'opportunity:349'}),[]);
|
||||
if(process.env.IVA_G8A_CALCULATED)fs.writeFileSync(process.env.IVA_G8A_CALCULATED,JSON.stringify(d));
|
||||
});
|
||||
test('corrupt goods rows/store cannot overwrite originals;duplicateoperationids cannotbe recorded',()=>{
|
||||
const d=draft(),original=d.modelo_a_snapshot;for(const patch of [{placeCountry:4},{conditions:[]},{chainRef:null}])assert.throws(()=>saveGoodsLocationBook(d,{rows:[{...row(),...patch}]}),/originais preservados/);assert.equal(d.modelo_a_snapshot,original);assert.throws(()=>recordGoodsLocations(d,{rows:[row(),row()]}),/distintos/);assert.throws(()=>recordGoodsLocations(d,{rows:[]}),/distintos/);assert.throws(()=>goodsLocationBook({...d,modelo_a_snapshot:JSON.stringify({...JSON.parse(original),goodsLocations:[]})}),/originais preservados/);
|
||||
});
|
||||
Reference in New Issue
Block a user