Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a7254406d | ||
|
|
4601bf64a0 | ||
|
|
6cffa1188f | ||
|
|
4853bc7284 | ||
|
|
03c26d6613 | ||
|
|
3f4e71c3f3 | ||
|
|
ec33fb5be2 | ||
|
|
aac3f46306 |
@@ -19043,5 +19043,654 @@
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"iva_l1_g8a_P105_homologation_20261024": {
|
||||
"status": "installed_delta_verified_partial_L1",
|
||||
"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": 88,
|
||||
"QA": 0,
|
||||
"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
|
||||
}
|
||||
},
|
||||
"served_commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"installation": {
|
||||
"protected": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"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": "b71bbd418f434e4cd252de9c8db2767f"
|
||||
},
|
||||
"after": {
|
||||
"rows": 106,
|
||||
"checksum": "430d9fb2707a97bf11f20da3f69721ae"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 81,
|
||||
"checksum": "23894ba9a97f87ef8fade6cce1a1b6b9"
|
||||
},
|
||||
"after": {
|
||||
"rows": 82,
|
||||
"checksum": "f52ae0d14e4c0bd31543756d83305bb9"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:33:02.101616+00:00",
|
||||
"manifest_sha256": "0a967a74dd5163728a082b24a62b22b9fae00a3ac428b5bcaa2082340c62ac00"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"goods-territoriality/1": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"goods_with_transport": [
|
||||
"assets/services-BYGK7w_P.js",
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"goods_without_transport": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"goods_before_import": [
|
||||
"assets/services-BYGK7w_P.js",
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"goodsLocations": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"notBeforeImport": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"transportToBuyer": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"noTransport": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"fromAbroad": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"nationalImport": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"importerChain": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"beforeImport": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"placeCountry": [
|
||||
"assets/services-BYGK7w_P.js",
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"placeRef": [
|
||||
"assets/services-BYGK7w_P.js",
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"chainRef": [
|
||||
"assets/services-BYGK7w_P.js",
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"IVA: Indeterminado": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/services-BYGK7w_P.js",
|
||||
"status": 200,
|
||||
"sha256": "8101fcf81fd55ca5de974667767336fe8199927e4107880c61c89ad4f1e4062d"
|
||||
},
|
||||
{
|
||||
"file": "assets/simulation-form-CPZAFZU3.js",
|
||||
"status": 200,
|
||||
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-l0g-w_hy.js",
|
||||
"status": 200,
|
||||
"sha256": "c00cf64236adbbc7a8467488e6519dba629861972cd8bff06db72b252837c16e"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-cHoELYnH.js",
|
||||
"status": 200,
|
||||
"sha256": "13303e6e5b3e96851a9f48d372ae4c763f755f97df4833293b92053094fd1934"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-BF7zA-aZ.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": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"8f14f5dde24819fce062dc316ed21dfbe033ebf8"
|
||||
],
|
||||
"finished_at": "2026-10-24T21:33:05.003586+00:00"
|
||||
},
|
||||
"log_file": "1792877479675740742.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 26.44s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 382",
|
||||
"# pass 382",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 140139
|
||||
},
|
||||
"rollback_executed": false
|
||||
},
|
||||
"base_VAT_separation": "AcceptedQA reused:P105goods territoriality6(1)/(2),three distinct owncondition paths;physical place/time for transport or availability,preimport importer/subsequentchain override with references/scope. Outside territory not exemption/zeroVAT;classification doesnotcalculatebase/rate/VAT/deductionfield11. Inputs/history/report and87priorclosures preserved;four installedruntime hashes and16compiled markers;no syntheticactivewrites.",
|
||||
"activation": "Normal Git fast-forward/webhook/installer;zero migrations/imports"
|
||||
},
|
||||
"iva_l1_g8_services_P106_P110_homologation_20261024": {
|
||||
"status": "installed_delta_verified_partial_L1",
|
||||
"candidate": "3f4e71c3f360505dcb53c12376d14ee91643f3cd",
|
||||
"base_installed": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"coverage_complete_branches": {
|
||||
"AUD-SIM-L1-P106": [
|
||||
"general_service"
|
||||
],
|
||||
"AUD-SIM-L1-P107": [
|
||||
"immovable_service"
|
||||
],
|
||||
"AUD-SIM-L1-P108": [
|
||||
"movable_work"
|
||||
],
|
||||
"AUD-SIM-L1-P109": [
|
||||
"activity_service"
|
||||
],
|
||||
"AUD-SIM-L1-P110": [
|
||||
"transport_service"
|
||||
]
|
||||
},
|
||||
"branch_count_complete": 5,
|
||||
"treatment_count": 5,
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-service-location.ts",
|
||||
"sha256_LF": "abf13bd0f6f8aed209b38f3fd8d5906b96572de2d13f87b0d742ee3f31095a19"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-service-location.tsx",
|
||||
"sha256_LF": "ede4923dc4343949821cdd1c540837261cf816afee3069d031053cac73da5339"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-monthly-iva.tsx",
|
||||
"sha256_LF": "dd102e122a243f58c85db0dcde889877066c5aac9c873eb0f8f93905a6d0d848"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "03bfad1ac2a443ee4fd0a7c0091f5b3e34e17a9c8b2b75d1249ac0c96729d643"
|
||||
}
|
||||
],
|
||||
"counts_before": {
|
||||
"delivered": 88,
|
||||
"QA": 5,
|
||||
"functional_pending": 39,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 93,
|
||||
"QA": 0,
|
||||
"functional_pending": 39,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_delivery": {
|
||||
"delivered": 93,
|
||||
"QA": 0,
|
||||
"functional_pending": 39,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"QA_proofs_reused": [
|
||||
"iva-l1-g8-services-qa-20261024.json"
|
||||
],
|
||||
"authorization": "Tempo explicitly requests one joint delivery of3f4e71c3,P106–P110,main compatibility/concurrent changes preserved,installeddelta only",
|
||||
"scope": "Recorte2026,classificação territorial de serviços por factos próprios;sem base,taxa,IVA,isenção,dedução/campo11 ou totaisModeloA. Digital/outros6(7)/(8)exigem percursos próprios,não classificados automaticamente. P002transversal não encerrado.",
|
||||
"source": "CIVA6(3),6(4)/(5)a–d,6(6),Lei13/2016 PDF7–8/p1426(265–266);Aviso BR89-I,de08/06/2017,PDF1,rectifica expressamente6(5)c/d:actividades nacionais e transporte pela distância nacional;Lei10/2025 PDF12mantém6(3–6),altera7–9digitais.",
|
||||
"meaning": {
|
||||
"P106": "Sede/EP/domicílio do prestador a partir do qual o serviço é prestado,sem regras especiais aplicáveis. Não usar endereço/nacionalidade do cliente.",
|
||||
"P107": "Local do imóvel e relação do serviço,incluindo preparação/coordenação de trabalhos imobiliários,peritos/agentes. Independente da sede do prestador.",
|
||||
"P108": "Execução total ou essencial dos trabalhos/peritagens em bens móveis corpóreos. Independente da sede do prestador.",
|
||||
"P109": "Local material de actividades artísticas,científicas,desportivas,recreativas,ensino/similares,organizadores e serviços acessórios;6(5)c rectificado2017.",
|
||||
"P110": "Distância nacional6(5)d rectificada2017;partida/chegada nacionais incluem percurso fora do país6(6);ida/volta são dois trajectos. Identificar distância total/nacional na mesma unidade,sem apuramento monetário."
|
||||
},
|
||||
"formula": "Territorial classification only;P110 exact distances retained as numerator/denominator with6(6)deemednational override,no monetaryapportionment/rounding.",
|
||||
"preservation": "88prior closures and partialP084/P085 preserved;accepted perbranchQA reused;one integration/backup/real isolatedrestore/check for whole set",
|
||||
"partial_P084_P085": "Preparation/conditional simulation only,benefits pending;no closure",
|
||||
"limits": "P084/P085partial,pending;L1open;P00105/06;beveragesL2/L3;Statistics/AIdeferred",
|
||||
"containment": "l1-g8-services-readonly-rollback-20261024.patch,checked only,not applied;blocks newP106–110classifications,preserves readers/history/otherbranches",
|
||||
"authenticated_preflight": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"release_revision": {
|
||||
"commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:33:02.101616+00:00",
|
||||
"manifest_sha256": "0a967a74dd5163728a082b24a62b22b9fae00a3ac428b5bcaa2082340c62ac00"
|
||||
},
|
||||
"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-g8-services-delivery-20261024/backup",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "1188dd6c559ba60472c26a9332765b5157bd2b25ba66655b0311d5584c18b919",
|
||||
"files_sha256": "252a84497714170faac6088de5e2f343a046092023c52c676f60628039d30f83",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "l1_g8_services_restore_20261024",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "1188dd6c559ba60472c26a9332765b5157bd2b25ba66655b0311d5584c18b919",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
},
|
||||
"served_commit": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"installation": {
|
||||
"protected": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"release": "/var/www/investmoz-homologacao/releases/03c26d66139f36573cf58362a5076b4d5f98eca2-ac76aca8",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"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": "555fd286e63d7efbd8080a4539536e17"
|
||||
},
|
||||
"after": {
|
||||
"rows": 106,
|
||||
"checksum": "1549defd5f3415c655fef9d5c1eacec9"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 84,
|
||||
"checksum": "4a8cb0e5713004dc915ae58634691888"
|
||||
},
|
||||
"after": {
|
||||
"rows": 85,
|
||||
"checksum": "2dc4aeb9fab2ea3553e91d84f14e9b98"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:42:26.795541+00:00",
|
||||
"manifest_sha256": "7deb424f38c7361d0a8df4d0be22464ab066a01e5aa38ece15fa62115c15f8c4"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"service-territoriality/1": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"general_service": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"immovable_service": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"movable_work": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"activity_service": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"transport_service": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"serviceLocations": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"providerEstablishment": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"propertyRelation": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"totalEssential": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"materialActivity": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"routeCorresponds": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"totalDistance": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"nationalDistance": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"providerCountry": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"subjectRef": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"IVA: Indeterminado": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"08/06/2017": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/project-dossier-CyMPKo3h.js",
|
||||
"status": 200,
|
||||
"sha256": "2b4728486975e76e77f8f343dcd6c4f82d32385f9b70af212e204b4bb500bb69"
|
||||
},
|
||||
{
|
||||
"file": "assets/simulation-form-CPZAFZU3.js",
|
||||
"status": 200,
|
||||
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-ESDgCIR1.js",
|
||||
"status": 200,
|
||||
"sha256": "731071c47247f46f2f693f51dbad7e2ad7fd3f122c873b7525c844788ccedb2c"
|
||||
},
|
||||
{
|
||||
"file": "assets/services-CZ5pQbhW.js",
|
||||
"status": 200,
|
||||
"sha256": "23ee3e239b2b0b3aa977486aee55212babc601b7599e42943d3298d6f4affe43"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-D23Ij5K_.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": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"release": "/var/www/investmoz-homologacao/releases/03c26d66139f36573cf58362a5076b4d5f98eca2-ac76aca8",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"release": "/var/www/investmoz-homologacao/releases/03c26d66139f36573cf58362a5076b4d5f98eca2-ac76aca8",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"03c26d66139f36573cf58362a5076b4d5f98eca2"
|
||||
],
|
||||
"finished_at": "2026-10-24T21:42:30.119032+00:00"
|
||||
},
|
||||
"log_file": "1792878042157298229.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 27.76s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 389",
|
||||
"# pass 389",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 141421
|
||||
},
|
||||
"rollback_executed": false
|
||||
},
|
||||
"base_VAT_separation": "Accepted perbranchQA reused:P106general providerestablishment,P107propertylocation,P108total/essential movablework,P109materialactivities,P110national/deemednational/mixedroute. AvisoBR89-I08/06/2017PDF1rectification6(5)c/d maintained. Territorial classification independentof exemption/base/rate/VAT/deductionfield11. Four installedruntime hashes/18compiledmarkers;88previousclosures preserved;no syntheticactivewrite.",
|
||||
"activation": "OnejointGit fast-forward/webhook/installer;zero migrations/imports"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
{
|
||||
"implementation_commit": "ec33fb5be2934f34d06349b84bf8e5316f90960e",
|
||||
"status": "delivered_with_QA_proofs_preserved",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P106": [
|
||||
"general_service"
|
||||
],
|
||||
"AUD-SIM-L1-P107": [
|
||||
"immovable_service"
|
||||
],
|
||||
"AUD-SIM-L1-P108": [
|
||||
"movable_work"
|
||||
],
|
||||
"AUD-SIM-L1-P109": [
|
||||
"activity_service"
|
||||
],
|
||||
"AUD-SIM-L1-P110": [
|
||||
"transport_service"
|
||||
]
|
||||
},
|
||||
"branch_count": 5,
|
||||
"treatment_count": 5,
|
||||
"QA_example_count": 10,
|
||||
"source": "CIVA6(3),6(4)/(5)a–d,6(6),Lei13/2016 PDF7–8/p1426(265–266);Aviso BR89-I,de08/06/2017,PDF1,rectifica expressamente6(5)c/d:actividades nacionais e transporte pela distância nacional;Lei10/2025 PDF12mantém6(3–6),altera7–9digitais.",
|
||||
"meaning": {
|
||||
"P106": "Sede/EP/domicílio do prestador a partir do qual o serviço é prestado,sem regras especiais aplicáveis. Não usar endereço/nacionalidade do cliente.",
|
||||
"P107": "Local do imóvel e relação do serviço,incluindo preparação/coordenação de trabalhos imobiliários,peritos/agentes. Independente da sede do prestador.",
|
||||
"P108": "Execução total ou essencial dos trabalhos/peritagens em bens móveis corpóreos. Independente da sede do prestador.",
|
||||
"P109": "Local material de actividades artísticas,científicas,desportivas,recreativas,ensino/similares,organizadores e serviços acessórios;6(5)c rectificado2017.",
|
||||
"P110": "Distância nacional6(5)d rectificada2017;partida/chegada nacionais incluem percurso fora do país6(6);ida/volta são dois trajectos. Identificar distância total/nacional na mesma unidade,sem apuramento monetário."
|
||||
},
|
||||
"formula": "Territorial classification only;P110 exact distances retained as numerator/denominator with6(6)deemednational override,no monetaryapportionment/rounding.",
|
||||
"scope": "Recorte2026,classificação territorial de serviços por factos próprios;sem base,taxa,IVA,isenção,dedução/campo11 ou totaisModeloA. Digital/outros6(7)/(8)exigem percursos próprios,não classificados automaticamente. P002transversal não encerrado.",
|
||||
"technical_choices": "NewserviceLocations opportunity-scoped book in existingmodelo_a snapshot/API/dossier;no schema/permissions. Switch preserveshiddenrefs/locations/routes but clearsownconditions,keepscommon. Decimaldistance up to18integer/6fractiondigits,BigInt comparison,no float/no assumedzero. References or explicitprojectedassumptions reused,no certificates/approvers invented.",
|
||||
"verification": {
|
||||
"frontend": {
|
||||
"tests": 7,
|
||||
"passed": 7,
|
||||
"failed": 0,
|
||||
"by_branch": {
|
||||
"AUD-SIM-L1-P106": "own conditions unknown/no,dates/references,domestic/foreign cases passed",
|
||||
"AUD-SIM-L1-P107": "own conditions unknown/no,dates/references,domestic/foreign cases passed",
|
||||
"AUD-SIM-L1-P108": "own conditions unknown/no,dates/references,domestic/foreign cases passed",
|
||||
"AUD-SIM-L1-P109": "own conditions unknown/no,dates/references,domestic/foreign cases passed",
|
||||
"AUD-SIM-L1-P110": "own conditions unknown/no,dates/references,domestic/foreign cases passed"
|
||||
},
|
||||
"additional": "Preservation of all oldbooks includingP105 and partialP084/P085;switch hiddenretention/ownconditions reset;scope/history/report;transport mixed route,deemed national route,zero vs unknown,invalid/decimal exact distances."
|
||||
},
|
||||
"privateAPI": {
|
||||
"tests": 1,
|
||||
"assertions": 48,
|
||||
"target": "simulator_fiscal_delta_20261021_test:55441",
|
||||
"transaction_rollback": true,
|
||||
"xml": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g8-services-20261024\\api-tests.xml"
|
||||
},
|
||||
"types": "passed",
|
||||
"build": "passed,existing plugin timing warnings",
|
||||
"UI": "Realcomponent Edge/CUA:unknown providercountry makesP106 indeterminate;restoration producesnational. P110 departureMZ/arrivalforeign yieldsnationalportion80.25of100.50. Saved/recovered/report10rows+3previousversions across5branches;VAT/base/rate alwaysnull. SyntheticQA,notmanualTempoacceptance.",
|
||||
"UI_screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g8-services-20261024\\qa-recovered-report.png"
|
||||
},
|
||||
"preservation": {
|
||||
"base": "aac3f463067e9178e15219262027fcb976566a2a",
|
||||
"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",
|
||||
"AUD-SIM-L1-P105"
|
||||
],
|
||||
"confirmed_losses": [],
|
||||
"accepted_delivery": "8f14f5dd/aac3f463;174tables/369files;29published/28relations/408geometries;code/schema/data/config/permissions compared",
|
||||
"frozen": "tests\\frontend\\fixtures\\iva-g8-services-preserved.json",
|
||||
"sha256": "bed8a17fc6bf961dc15eccc46a8c336270752728470cf196cb2c2c901085c186",
|
||||
"scope": "P106–109 QA only;P105 and all previous books/history immutable;no active writes"
|
||||
},
|
||||
"runtime_delta": {
|
||||
"resources/js/lib/iva-service-location.ts": "abf13bd0f6f8aed209b38f3fd8d5906b96572de2d13f87b0d742ee3f31095a19",
|
||||
"resources/js/components/simulation-service-location.tsx": "ede4923dc4343949821cdd1c540837261cf816afee3069d031053cac73da5339",
|
||||
"resources/js/components/simulation-monthly-iva.tsx": "dd102e122a243f58c85db0dcde889877066c5aac9c873eb0f8f93905a6d0d848",
|
||||
"resources/js/lib/project-dossier.ts": "03bfad1ac2a443ee4fd0a7c0091f5b3e34e17a9c8b2b75d1249ac0c96729d643"
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 88,
|
||||
"QA": 5,
|
||||
"functional_pending": 39,
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
},
|
||||
"homologation_unchanged": "8f14f5dd",
|
||||
"remaining": "One jointGit integration/delivery forfivecompatiblebranches,one backup/realrestore,individualQAproofsreused,installeddelta only. No individualbranch deployment.",
|
||||
"limits": "P084/P085partial,pending;L1open;P00105/06;beveragesL2/L3;Statistics/AIdeferred",
|
||||
"sources_inventory": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g8-services-20261024\\source-archive-inventory.json",
|
||||
"qa_status_preserved": "QA_complete_not_delivered",
|
||||
"delivery_followup": {
|
||||
"served_commit": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"receipt": "l1-g8-services-delivery-20261024.json",
|
||||
"record": "iva_l1_g8_services_P106_P110_homologation_20261024",
|
||||
"counts": {
|
||||
"delivered": 93,
|
||||
"QA": 0,
|
||||
"functional_pending": 39,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"implementation_commit": "0682ef74e2e1523d5a424b92989de39122677898",
|
||||
"status": "QA_complete_not_delivered",
|
||||
"status": "delivered_with_QA_proofs_preserved",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P105": [
|
||||
"goods_with_transport",
|
||||
@@ -154,5 +154,18 @@
|
||||
"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"
|
||||
"sources_inventory": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g8a-goods-location-20261024\\source-archive-inventory.json",
|
||||
"qa_status_preserved": "QA_complete_not_delivered",
|
||||
"delivery_followup": {
|
||||
"served_commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"receipt": "l1-g8a-delivery-20261024.json",
|
||||
"record": "iva_l1_g8a_P105_homologation_20261024",
|
||||
"counts": {
|
||||
"delivered": 88,
|
||||
"QA": 0,
|
||||
"functional_pending": 44,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
{
|
||||
"implementation_commit": "6cffa1188f8f0f43d8d161cf97b7a08a885055f6",
|
||||
"status": "QA_complete_not_delivered",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P111": [
|
||||
"rights_service"
|
||||
],
|
||||
"AUD-SIM-L1-P112": [
|
||||
"advertising_service"
|
||||
],
|
||||
"AUD-SIM-L1-P113": [
|
||||
"telecom_service"
|
||||
],
|
||||
"AUD-SIM-L1-P114": [
|
||||
"consulting_service"
|
||||
],
|
||||
"AUD-SIM-L1-P115": [
|
||||
"data_service"
|
||||
],
|
||||
"AUD-SIM-L1-P116": [
|
||||
"finance_service"
|
||||
],
|
||||
"AUD-SIM-L1-P117": [
|
||||
"staff_service"
|
||||
],
|
||||
"AUD-SIM-L1-P118": [
|
||||
"intermediation_service"
|
||||
],
|
||||
"AUD-SIM-L1-P119": [
|
||||
"abstention_service"
|
||||
],
|
||||
"AUD-SIM-L1-P120": [
|
||||
"movable_lease_service"
|
||||
]
|
||||
},
|
||||
"branch_count": 10,
|
||||
"treatment_count": 10,
|
||||
"QA_example_count": 30,
|
||||
"source": "CIVA2(1)a/b,2(2),6(3),6(7)a–j e6(8),Lei13/2016PDF6–8/p1426(264–266);23(1)/(2),25(4),26(1–3),PDF16–17. Lei22/2022não altera estes artigos. Lei10/2025PDF12mantém alíneasa–j ealtera6(7–9);PDF13art23(2)excluik e remete declaração33(2);PDF14mantém26(1–3),adita26(4)digital ealtera33(2).",
|
||||
"meaning": {
|
||||
"P111": {
|
||||
"clause": "6(7)a",
|
||||
"treatment": "rights_service",
|
||||
"nature": "Cessão/autorização de direitos de autor,licenças,marcas e análogos"
|
||||
},
|
||||
"P112": {
|
||||
"clause": "6(7)b",
|
||||
"treatment": "advertising_service",
|
||||
"nature": "Publicidade"
|
||||
},
|
||||
"P113": {
|
||||
"clause": "6(7)c",
|
||||
"treatment": "telecom_service",
|
||||
"nature": "Telecomunicações"
|
||||
},
|
||||
"P114": {
|
||||
"clause": "6(7)d",
|
||||
"treatment": "consulting_service",
|
||||
"nature": "Consultores,engenheiros,advogados,economistas,contabilistas/gabinetes de estudos,organização,investigação/desenvolvimento e similares"
|
||||
},
|
||||
"P115": {
|
||||
"clause": "6(7)e",
|
||||
"treatment": "data_service",
|
||||
"nature": "Tratamento de dados/fornecimento de informações"
|
||||
},
|
||||
"P116": {
|
||||
"clause": "6(7)f",
|
||||
"treatment": "finance_service",
|
||||
"nature": "Operações bancárias,financeiras,seguro/resseguro;eventual isenção independente"
|
||||
},
|
||||
"P117": {
|
||||
"clause": "6(7)g",
|
||||
"treatment": "staff_service",
|
||||
"nature": "Colocação de pessoal"
|
||||
},
|
||||
"P118": {
|
||||
"clause": "6(7)h",
|
||||
"treatment": "intermediation_service",
|
||||
"nature": "Intermediação em nome epor conta de outrem no fornecimento de serviço enumerado,subjacente identificado"
|
||||
},
|
||||
"P119": {
|
||||
"clause": "6(7)i",
|
||||
"treatment": "abstention_service",
|
||||
"nature": "Obrigação de não exercer,mesmo parcialmente,actividade/direito enumerado,subjacente identificado"
|
||||
},
|
||||
"P120": {
|
||||
"clause": "6(7)j",
|
||||
"treatment": "movable_lease_service",
|
||||
"nature": "Locação de bens móveis corpóreos,incluindo financeira,bens/contrato identificados"
|
||||
}
|
||||
},
|
||||
"routes": {
|
||||
"inbound": "Prestador semsede/EP/domicílio nacional a partir do qual presta;adquirente2(1)a/b comEP/domicílio nacional,incluindo exclusivamente isentos semdedução:territórionacional6(7),responsáveladquirente2(2)/23(2),declaração33(2)nos termosa regulamentar;sem pressupor montante/imposto devido.",
|
||||
"outbound": "Adquirente estabelecido/domiciliado noestrangeiro:6(8)forado âmbitonacional,ainda que prestadortenha sede/EP/domicílio nacional;não isenção/IVAzero nem imposto estrangeiro presumido. Qualidadea/b oculta/conservada,não imposta aestepercurso.",
|
||||
"domestic": "Prestador nacional apartirdo qualpresta eadquirentenacional,sem regraspróprias:6(3);qualidade prestadorSP/regimegeral ereferência permite identificarprestador23(1),casocontrário responsávelindeterminado sem apagarclassificaçãoterritorial."
|
||||
},
|
||||
"formula": "Territorial classification and responsible party only,no monetarycalculation. No righttodeduction prerequisite for6(7);nondigital23(2)excludedigital26(4)/32(1)c routing.",
|
||||
"scope": "2026,serviços enumerados não digitais;localização e identificação do responsável pelas obrigações. Sem isenção confirmada,base,taxa,IVA,montante a pagar,dedução/campo11 ou totaisModeloA. P121/P130digitais eP002transversal não fechados;outros6(4)/(5)encaminhados para percursos próprios. Não automatiza declaração,pagamento,retenção ou prazo digital32(1)c.",
|
||||
"technical_choices": "NewlistedServices opportunity-scoped book in existingmodelo_a snapshot/API/dossier;no schema/permissions. Switchpreserveshiddenparty/quality/targetrefs andclearsownconditions,keepscommon. References or explicitprojectedassumptions reused,no certificates/approvers invented. Requiredfactualrefs explainruleapplication,not provenance revalidation.",
|
||||
"verification": {
|
||||
"frontend": {
|
||||
"tests": 12,
|
||||
"passed": 12,
|
||||
"failed": 0,
|
||||
"by_branch": {
|
||||
"AUD-SIM-L1-P111": "Ownnature,unknown/no,three routes,quality a/b/other,exemptwithoutdeduction allowed,dates/references and separate responsible passed",
|
||||
"AUD-SIM-L1-P112": "Ownnature,unknown/no,three routes,quality a/b/other,exemptwithoutdeduction allowed,dates/references and separate responsible passed",
|
||||
"AUD-SIM-L1-P113": "Ownnature,unknown/no,three routes,quality a/b/other,exemptwithoutdeduction allowed,dates/references and separate responsible passed",
|
||||
"AUD-SIM-L1-P114": "Ownnature,unknown/no,three routes,quality a/b/other,exemptwithoutdeduction allowed,dates/references and separate responsible passed",
|
||||
"AUD-SIM-L1-P115": "Ownnature,unknown/no,three routes,quality a/b/other,exemptwithoutdeduction allowed,dates/references and separate responsible passed",
|
||||
"AUD-SIM-L1-P116": "Ownnature,unknown/no,three routes,quality a/b/other,exemptwithoutdeduction allowed,dates/references and separate responsible passed",
|
||||
"AUD-SIM-L1-P117": "Ownnature,unknown/no,three routes,quality a/b/other,exemptwithoutdeduction allowed,dates/references and separate responsible passed",
|
||||
"AUD-SIM-L1-P118": "Ownnature,unknown/no,three routes,quality a/b/other,exemptwithoutdeduction allowed,dates/references and separate responsible passed",
|
||||
"AUD-SIM-L1-P119": "Ownnature,unknown/no,three routes,quality a/b/other,exemptwithoutdeduction allowed,dates/references and separate responsible passed",
|
||||
"AUD-SIM-L1-P120": "Ownnature,unknown/no,three routes,quality a/b/other,exemptwithoutdeduction allowed,dates/references and separate responsible passed"
|
||||
},
|
||||
"additional": "P118/P119 underlyingclauses/refs,selfreference/digitaltarget guard;switchretains hiddenrefs andclearsownconditions;alloldbooks immutable,currentkeys/history/report/corruptwrites."
|
||||
},
|
||||
"privateAPI": {
|
||||
"tests": 1,
|
||||
"assertions": 109,
|
||||
"target": "simulator_fiscal_delta_20261021_test:55441",
|
||||
"transaction_rollback": true,
|
||||
"xml": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g9-nondigital-20261024\\api-tests.xml"
|
||||
},
|
||||
"types": "passed",
|
||||
"build": "passed,existing plugin timing warnings",
|
||||
"UI": "Realcomponent Edge/CUA:recipientqualityunknown andP118underlyingclauseunknown make resultsindeterminate;switch buyerforeign applies6(8)andhidesquality,returnMZ restoresunknown qualityandoriginalref;restorea/subjclause then save/recover/report30rows+4previousversions. VAT/base/ratealwaysnull,responsible acquirer/outside/provider. SyntheticQA,notmanualTempoacceptance.",
|
||||
"UI_screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g9-nondigital-20261024\\qa-recovered-report.png"
|
||||
},
|
||||
"preservation": {
|
||||
"base": "4853bc7284d3ed3b1fbafa403fd8406705ac3165",
|
||||
"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",
|
||||
"AUD-SIM-L1-P105",
|
||||
"AUD-SIM-L1-P106",
|
||||
"AUD-SIM-L1-P107",
|
||||
"AUD-SIM-L1-P108",
|
||||
"AUD-SIM-L1-P109",
|
||||
"AUD-SIM-L1-P110"
|
||||
],
|
||||
"confirmed_losses": [],
|
||||
"accepted_delivery": "03c26d66/4853bc72;174tables/369files;29published/28relations/408geometries;code/schema/data/config/permissions compared",
|
||||
"frozen": "tests\\frontend\\fixtures\\iva-g9-nondigital-preserved.json",
|
||||
"sha256": "3132adfbbbcde4b2d8c7c7c657dfb38f743d7994650b78bab4931c443eaab628",
|
||||
"scope": "P111–P120QA;all priorbooks/history includingP105–110 andpartialP084/P085 immutable;no activewrites"
|
||||
},
|
||||
"runtime_delta": {
|
||||
"resources/js/lib/iva-listed-services.ts": "fdc05407576a6c68f8158bc797331380c09e84282609a06ae2a7aa2966c54db6",
|
||||
"resources/js/components/simulation-listed-services.tsx": "77badfa54c3bb6e25fe5153bb852cebc48262b64b4aabc9348a2b1838094917a",
|
||||
"resources/js/components/simulation-monthly-iva.tsx": "43446ed6a23b0e101d72ea50f73cdbae0242ace92af12d836a0955cc85800d82",
|
||||
"resources/js/lib/project-dossier.ts": "fea39f530bf7786778dbdadbb6b08678f2a4071bcccc264e3d026155477517c8"
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 93,
|
||||
"QA": 10,
|
||||
"functional_pending": 29,
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
},
|
||||
"homologation_unchanged": "03c26d66",
|
||||
"remaining": "OnejointGit integration/delivery for tencompatiblebranches,onebackup/realisolatedrestore,individualQAproofsreused,installeddeltaonly. No individualbranch deployment.",
|
||||
"limits": "P084/P085partial,pending;L1open;P00105/06;beveragesL2/L3;Statistics/AIdeferred",
|
||||
"sources_inventory": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g9-nondigital-20261024\\source-archive-inventory.json"
|
||||
}
|
||||
@@ -0,0 +1,338 @@
|
||||
{
|
||||
"status": "installed_delta_verified_partial_L1",
|
||||
"candidate": "3f4e71c3f360505dcb53c12376d14ee91643f3cd",
|
||||
"base_installed": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"coverage_complete_branches": {
|
||||
"AUD-SIM-L1-P106": [
|
||||
"general_service"
|
||||
],
|
||||
"AUD-SIM-L1-P107": [
|
||||
"immovable_service"
|
||||
],
|
||||
"AUD-SIM-L1-P108": [
|
||||
"movable_work"
|
||||
],
|
||||
"AUD-SIM-L1-P109": [
|
||||
"activity_service"
|
||||
],
|
||||
"AUD-SIM-L1-P110": [
|
||||
"transport_service"
|
||||
]
|
||||
},
|
||||
"branch_count_complete": 5,
|
||||
"treatment_count": 5,
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-service-location.ts",
|
||||
"sha256_LF": "abf13bd0f6f8aed209b38f3fd8d5906b96572de2d13f87b0d742ee3f31095a19"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-service-location.tsx",
|
||||
"sha256_LF": "ede4923dc4343949821cdd1c540837261cf816afee3069d031053cac73da5339"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-monthly-iva.tsx",
|
||||
"sha256_LF": "dd102e122a243f58c85db0dcde889877066c5aac9c873eb0f8f93905a6d0d848"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "03bfad1ac2a443ee4fd0a7c0091f5b3e34e17a9c8b2b75d1249ac0c96729d643"
|
||||
}
|
||||
],
|
||||
"counts_before": {
|
||||
"delivered": 88,
|
||||
"QA": 5,
|
||||
"functional_pending": 39,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 93,
|
||||
"QA": 0,
|
||||
"functional_pending": 39,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_delivery": {
|
||||
"delivered": 93,
|
||||
"QA": 0,
|
||||
"functional_pending": 39,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"QA_proofs_reused": [
|
||||
"iva-l1-g8-services-qa-20261024.json"
|
||||
],
|
||||
"authorization": "Tempo explicitly requests one joint delivery of3f4e71c3,P106–P110,main compatibility/concurrent changes preserved,installeddelta only",
|
||||
"scope": "Recorte2026,classificação territorial de serviços por factos próprios;sem base,taxa,IVA,isenção,dedução/campo11 ou totaisModeloA. Digital/outros6(7)/(8)exigem percursos próprios,não classificados automaticamente. P002transversal não encerrado.",
|
||||
"source": "CIVA6(3),6(4)/(5)a–d,6(6),Lei13/2016 PDF7–8/p1426(265–266);Aviso BR89-I,de08/06/2017,PDF1,rectifica expressamente6(5)c/d:actividades nacionais e transporte pela distância nacional;Lei10/2025 PDF12mantém6(3–6),altera7–9digitais.",
|
||||
"meaning": {
|
||||
"P106": "Sede/EP/domicílio do prestador a partir do qual o serviço é prestado,sem regras especiais aplicáveis. Não usar endereço/nacionalidade do cliente.",
|
||||
"P107": "Local do imóvel e relação do serviço,incluindo preparação/coordenação de trabalhos imobiliários,peritos/agentes. Independente da sede do prestador.",
|
||||
"P108": "Execução total ou essencial dos trabalhos/peritagens em bens móveis corpóreos. Independente da sede do prestador.",
|
||||
"P109": "Local material de actividades artísticas,científicas,desportivas,recreativas,ensino/similares,organizadores e serviços acessórios;6(5)c rectificado2017.",
|
||||
"P110": "Distância nacional6(5)d rectificada2017;partida/chegada nacionais incluem percurso fora do país6(6);ida/volta são dois trajectos. Identificar distância total/nacional na mesma unidade,sem apuramento monetário."
|
||||
},
|
||||
"formula": "Territorial classification only;P110 exact distances retained as numerator/denominator with6(6)deemednational override,no monetaryapportionment/rounding.",
|
||||
"preservation": "88prior closures and partialP084/P085 preserved;accepted perbranchQA reused;one integration/backup/real isolatedrestore/check for whole set",
|
||||
"partial_P084_P085": "Preparation/conditional simulation only,benefits pending;no closure",
|
||||
"limits": "P084/P085partial,pending;L1open;P00105/06;beveragesL2/L3;Statistics/AIdeferred",
|
||||
"containment": "l1-g8-services-readonly-rollback-20261024.patch,checked only,not applied;blocks newP106–110classifications,preserves readers/history/otherbranches",
|
||||
"authenticated_preflight": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"release_revision": {
|
||||
"commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:33:02.101616+00:00",
|
||||
"manifest_sha256": "0a967a74dd5163728a082b24a62b22b9fae00a3ac428b5bcaa2082340c62ac00"
|
||||
},
|
||||
"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-g8-services-delivery-20261024/backup",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "1188dd6c559ba60472c26a9332765b5157bd2b25ba66655b0311d5584c18b919",
|
||||
"files_sha256": "252a84497714170faac6088de5e2f343a046092023c52c676f60628039d30f83",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "l1_g8_services_restore_20261024",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "1188dd6c559ba60472c26a9332765b5157bd2b25ba66655b0311d5584c18b919",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
},
|
||||
"served_commit": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"installation": {
|
||||
"protected": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"release": "/var/www/investmoz-homologacao/releases/03c26d66139f36573cf58362a5076b4d5f98eca2-ac76aca8",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"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": "555fd286e63d7efbd8080a4539536e17"
|
||||
},
|
||||
"after": {
|
||||
"rows": 106,
|
||||
"checksum": "1549defd5f3415c655fef9d5c1eacec9"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 84,
|
||||
"checksum": "4a8cb0e5713004dc915ae58634691888"
|
||||
},
|
||||
"after": {
|
||||
"rows": 85,
|
||||
"checksum": "2dc4aeb9fab2ea3553e91d84f14e9b98"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:42:26.795541+00:00",
|
||||
"manifest_sha256": "7deb424f38c7361d0a8df4d0be22464ab066a01e5aa38ece15fa62115c15f8c4"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"service-territoriality/1": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"general_service": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"immovable_service": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"movable_work": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"activity_service": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"transport_service": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"serviceLocations": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"providerEstablishment": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"propertyRelation": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"totalEssential": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"materialActivity": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"routeCorresponds": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"totalDistance": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"nationalDistance": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"providerCountry": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"subjectRef": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
],
|
||||
"IVA: Indeterminado": [
|
||||
"assets/project-dossier-CyMPKo3h.js"
|
||||
],
|
||||
"08/06/2017": [
|
||||
"assets/project-dossier-CyMPKo3h.js",
|
||||
"assets/services-CZ5pQbhW.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/project-dossier-CyMPKo3h.js",
|
||||
"status": 200,
|
||||
"sha256": "2b4728486975e76e77f8f343dcd6c4f82d32385f9b70af212e204b4bb500bb69"
|
||||
},
|
||||
{
|
||||
"file": "assets/simulation-form-CPZAFZU3.js",
|
||||
"status": 200,
|
||||
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-ESDgCIR1.js",
|
||||
"status": 200,
|
||||
"sha256": "731071c47247f46f2f693f51dbad7e2ad7fd3f122c873b7525c844788ccedb2c"
|
||||
},
|
||||
{
|
||||
"file": "assets/services-CZ5pQbhW.js",
|
||||
"status": 200,
|
||||
"sha256": "23ee3e239b2b0b3aa977486aee55212babc601b7599e42943d3298d6f4affe43"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-D23Ij5K_.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": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"release": "/var/www/investmoz-homologacao/releases/03c26d66139f36573cf58362a5076b4d5f98eca2-ac76aca8",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"release": "/var/www/investmoz-homologacao/releases/03c26d66139f36573cf58362a5076b4d5f98eca2-ac76aca8",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"03c26d66139f36573cf58362a5076b4d5f98eca2"
|
||||
],
|
||||
"finished_at": "2026-10-24T21:42:30.119032+00:00"
|
||||
},
|
||||
"log_file": "1792878042157298229.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 27.76s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 389",
|
||||
"# pass 389",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 141421
|
||||
},
|
||||
"rollback_executed": false
|
||||
},
|
||||
"base_VAT_separation": "Accepted perbranchQA reused:P106general providerestablishment,P107propertylocation,P108total/essential movablework,P109materialactivities,P110national/deemednational/mixedroute. AvisoBR89-I08/06/2017PDF1rectification6(5)c/d maintained. Territorial classification independentof exemption/base/rate/VAT/deductionfield11. Four installedruntime hashes/18compiledmarkers;88previousclosures preserved;no syntheticactivewrite.",
|
||||
"activation": "OnejointGit fast-forward/webhook/installer;zero migrations/imports"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/resources/js/lib/iva-service-location.ts
|
||||
+++ b/resources/js/lib/iva-service-location.ts
|
||||
@@ -56,6 +56,7 @@
|
||||
function key(draft:Record<string,unknown>,book:ServiceLocationBook):string{return JSON.stringify({version:serviceLocationVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},rows:book.rows});}
|
||||
export function serviceLocationCurrent(draft:Record<string,unknown>,book:ServiceLocationBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);}
|
||||
export function recordServiceLocations(draft:Record<string,unknown>,book:ServiceLocationBook):ServiceLocationBook{
|
||||
+ throw new Error('Novas classificações P106–P110 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:ServiceLocationCalculation={version:serviceLocationVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:serviceLocationSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateServiceLocation(row))};
|
||||
const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveServiceLocationBook(draft,next);return next;
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
|
||||
"status": "installed_delta_verified_partial_L1",
|
||||
"candidate": "fb7248661dce64def0b809479b2b30fbb099ea42",
|
||||
"base_installed": "6f1cf7b7a09796b3964b39f0b1e778f978ae60fb",
|
||||
"coverage_complete_branches": {
|
||||
@@ -37,8 +37,8 @@
|
||||
"total": 133
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 87,
|
||||
"QA": 1,
|
||||
"delivered": 88,
|
||||
"QA": 0,
|
||||
"functional_pending": 44,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
@@ -125,5 +125,187 @@
|
||||
"source_dump_sha256": "8d776d1a8fe3383bf7a02b8539256ef5c9c12a8d9a07ef5e310ee70dd30de38d",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"served_commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"installation": {
|
||||
"protected": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"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": "b71bbd418f434e4cd252de9c8db2767f"
|
||||
},
|
||||
"after": {
|
||||
"rows": 106,
|
||||
"checksum": "430d9fb2707a97bf11f20da3f69721ae"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 81,
|
||||
"checksum": "23894ba9a97f87ef8fade6cce1a1b6b9"
|
||||
},
|
||||
"after": {
|
||||
"rows": 82,
|
||||
"checksum": "f52ae0d14e4c0bd31543756d83305bb9"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:33:02.101616+00:00",
|
||||
"manifest_sha256": "0a967a74dd5163728a082b24a62b22b9fae00a3ac428b5bcaa2082340c62ac00"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"goods-territoriality/1": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"goods_with_transport": [
|
||||
"assets/services-BYGK7w_P.js",
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"goods_without_transport": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"goods_before_import": [
|
||||
"assets/services-BYGK7w_P.js",
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"goodsLocations": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"notBeforeImport": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"transportToBuyer": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"noTransport": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"fromAbroad": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"nationalImport": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"importerChain": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"beforeImport": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"placeCountry": [
|
||||
"assets/services-BYGK7w_P.js",
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"placeRef": [
|
||||
"assets/services-BYGK7w_P.js",
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"chainRef": [
|
||||
"assets/services-BYGK7w_P.js",
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
],
|
||||
"IVA: Indeterminado": [
|
||||
"assets/project-dossier-l0g-w_hy.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/services-BYGK7w_P.js",
|
||||
"status": 200,
|
||||
"sha256": "8101fcf81fd55ca5de974667767336fe8199927e4107880c61c89ad4f1e4062d"
|
||||
},
|
||||
{
|
||||
"file": "assets/simulation-form-CPZAFZU3.js",
|
||||
"status": 200,
|
||||
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-l0g-w_hy.js",
|
||||
"status": 200,
|
||||
"sha256": "c00cf64236adbbc7a8467488e6519dba629861972cd8bff06db72b252837c16e"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-cHoELYnH.js",
|
||||
"status": 200,
|
||||
"sha256": "13303e6e5b3e96851a9f48d372ae4c763f755f97df4833293b92053094fd1934"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-BF7zA-aZ.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": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "8f14f5dde24819fce062dc316ed21dfbe033ebf8",
|
||||
"release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/6f1cf7b7a09796b3964b39f0b1e778f978ae60fb-e919f615",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"8f14f5dde24819fce062dc316ed21dfbe033ebf8"
|
||||
],
|
||||
"finished_at": "2026-10-24T21:33:05.003586+00:00"
|
||||
},
|
||||
"log_file": "1792877479675740742.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 26.44s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 382",
|
||||
"# pass 382",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 140139
|
||||
},
|
||||
"rollback_executed": false
|
||||
},
|
||||
"base_VAT_separation": "AcceptedQA reused:P105goods territoriality6(1)/(2),three distinct owncondition paths;physical place/time for transport or availability,preimport importer/subsequentchain override with references/scope. Outside territory not exemption/zeroVAT;classification doesnotcalculatebase/rate/VAT/deductionfield11. Inputs/history/report and87priorclosures preserved;four installedruntime hashes and16compiled markers;no syntheticactivewrites.",
|
||||
"activation": "Normal Git fast-forward/webhook/installer;zero migrations/imports"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
{
|
||||
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
|
||||
"candidate": "4601bf64a03a02254cbf2e247374996cb36b6a49",
|
||||
"base_installed": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"coverage_complete_branches": {
|
||||
"AUD-SIM-L1-P111": [
|
||||
"rights_service"
|
||||
],
|
||||
"AUD-SIM-L1-P112": [
|
||||
"advertising_service"
|
||||
],
|
||||
"AUD-SIM-L1-P113": [
|
||||
"telecom_service"
|
||||
],
|
||||
"AUD-SIM-L1-P114": [
|
||||
"consulting_service"
|
||||
],
|
||||
"AUD-SIM-L1-P115": [
|
||||
"data_service"
|
||||
],
|
||||
"AUD-SIM-L1-P116": [
|
||||
"finance_service"
|
||||
],
|
||||
"AUD-SIM-L1-P117": [
|
||||
"staff_service"
|
||||
],
|
||||
"AUD-SIM-L1-P118": [
|
||||
"intermediation_service"
|
||||
],
|
||||
"AUD-SIM-L1-P119": [
|
||||
"abstention_service"
|
||||
],
|
||||
"AUD-SIM-L1-P120": [
|
||||
"movable_lease_service"
|
||||
]
|
||||
},
|
||||
"branch_count_complete": 10,
|
||||
"treatment_count": 10,
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-listed-services.ts",
|
||||
"sha256_LF": "fdc05407576a6c68f8158bc797331380c09e84282609a06ae2a7aa2966c54db6"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-listed-services.tsx",
|
||||
"sha256_LF": "77badfa54c3bb6e25fe5153bb852cebc48262b64b4aabc9348a2b1838094917a"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-monthly-iva.tsx",
|
||||
"sha256_LF": "43446ed6a23b0e101d72ea50f73cdbae0242ace92af12d836a0955cc85800d82"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "fea39f530bf7786778dbdadbb6b08678f2a4071bcccc264e3d026155477517c8"
|
||||
}
|
||||
],
|
||||
"counts_before": {
|
||||
"delivered": 93,
|
||||
"QA": 10,
|
||||
"functional_pending": 29,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 93,
|
||||
"QA": 10,
|
||||
"functional_pending": 29,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_delivery": {
|
||||
"delivered": 103,
|
||||
"QA": 0,
|
||||
"functional_pending": 29,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"QA_proofs_reused": [
|
||||
"iva-l1-g9-nondigital-qa-20261024.json"
|
||||
],
|
||||
"authorization": "Tempo explicitly requests one joint delivery of4601bf64,P111–P120,main compatibility/concurrent changes preserved,installeddelta only",
|
||||
"scope": "2026,serviços enumerados não digitais;localização e identificação do responsável pelas obrigações. Sem isenção confirmada,base,taxa,IVA,montante a pagar,dedução/campo11 ou totaisModeloA. P121/P130digitais eP002transversal não fechados;outros6(4)/(5)encaminhados para percursos próprios. Não automatiza declaração,pagamento,retenção ou prazo digital32(1)c.",
|
||||
"source": "CIVA2(1)a/b,2(2),6(3),6(7)a–j e6(8),Lei13/2016PDF6–8/p1426(264–266);23(1)/(2),25(4),26(1–3),PDF16–17. Lei22/2022não altera estes artigos. Lei10/2025PDF12mantém alíneasa–j ealtera6(7–9);PDF13art23(2)excluik e remete declaração33(2);PDF14mantém26(1–3),adita26(4)digital ealtera33(2).",
|
||||
"meaning": {
|
||||
"P111": {
|
||||
"clause": "6(7)a",
|
||||
"treatment": "rights_service",
|
||||
"nature": "Cessão/autorização de direitos de autor,licenças,marcas e análogos"
|
||||
},
|
||||
"P112": {
|
||||
"clause": "6(7)b",
|
||||
"treatment": "advertising_service",
|
||||
"nature": "Publicidade"
|
||||
},
|
||||
"P113": {
|
||||
"clause": "6(7)c",
|
||||
"treatment": "telecom_service",
|
||||
"nature": "Telecomunicações"
|
||||
},
|
||||
"P114": {
|
||||
"clause": "6(7)d",
|
||||
"treatment": "consulting_service",
|
||||
"nature": "Consultores,engenheiros,advogados,economistas,contabilistas/gabinetes de estudos,organização,investigação/desenvolvimento e similares"
|
||||
},
|
||||
"P115": {
|
||||
"clause": "6(7)e",
|
||||
"treatment": "data_service",
|
||||
"nature": "Tratamento de dados/fornecimento de informações"
|
||||
},
|
||||
"P116": {
|
||||
"clause": "6(7)f",
|
||||
"treatment": "finance_service",
|
||||
"nature": "Operações bancárias,financeiras,seguro/resseguro;eventual isenção independente"
|
||||
},
|
||||
"P117": {
|
||||
"clause": "6(7)g",
|
||||
"treatment": "staff_service",
|
||||
"nature": "Colocação de pessoal"
|
||||
},
|
||||
"P118": {
|
||||
"clause": "6(7)h",
|
||||
"treatment": "intermediation_service",
|
||||
"nature": "Intermediação em nome epor conta de outrem no fornecimento de serviço enumerado,subjacente identificado"
|
||||
},
|
||||
"P119": {
|
||||
"clause": "6(7)i",
|
||||
"treatment": "abstention_service",
|
||||
"nature": "Obrigação de não exercer,mesmo parcialmente,actividade/direito enumerado,subjacente identificado"
|
||||
},
|
||||
"P120": {
|
||||
"clause": "6(7)j",
|
||||
"treatment": "movable_lease_service",
|
||||
"nature": "Locação de bens móveis corpóreos,incluindo financeira,bens/contrato identificados"
|
||||
}
|
||||
},
|
||||
"formula": "Territorial classification and responsible party only,no monetarycalculation. No righttodeduction prerequisite for6(7);nondigital23(2)excludedigital26(4)/32(1)c routing.",
|
||||
"preservation": "93prior closures and partialP084/P085 preserved;accepted perbranchQA reused;one integration/backup/real isolatedrestore/check for whole set",
|
||||
"partial_P084_P085": "Preparation/conditional simulation only,benefits pending;no closure",
|
||||
"limits": "P084/P085partial,pending;L1open;P00105/06;beveragesL2/L3;Statistics/AIdeferred",
|
||||
"containment": "l1-g9-nondigital-readonly-rollback-20261024.patch,checked only,not applied;blocks newP111–120classifications,preserves readers/history/otherbranches",
|
||||
"authenticated_preflight": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"release": "/var/www/investmoz-homologacao/releases/03c26d66139f36573cf58362a5076b4d5f98eca2-ac76aca8",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/8f14f5dde24819fce062dc316ed21dfbe033ebf8-6abb42c2",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/03c26d66139f36573cf58362a5076b4d5f98eca2-ac76aca8",
|
||||
"release_revision": {
|
||||
"commit": "03c26d66139f36573cf58362a5076b4d5f98eca2",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T21:42:26.795541+00:00",
|
||||
"manifest_sha256": "7deb424f38c7361d0a8df4d0be22464ab066a01e5aa38ece15fa62115c15f8c4"
|
||||
},
|
||||
"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-g9-nondigital-delivery-20261024/backup",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "8d783acaa134d37d4d5d7da2842f3a4a2ca159cab444b10b127fc1baf7113ac2",
|
||||
"files_sha256": "195de1b12e33ce73510143f009a10cae42f622093e6049d36389e2849e3a117b",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "l1_g9_nondigital_restore_20261024",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "8d783acaa134d37d4d5d7da2842f3a4a2ca159cab444b10b127fc1baf7113ac2",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/resources/js/lib/iva-listed-services.ts
|
||||
+++ b/resources/js/lib/iva-listed-services.ts
|
||||
@@ -71,6 +71,7 @@
|
||||
function key(draft:Record<string,unknown>,book:ListedServiceBook):string{return JSON.stringify({version:listedServiceVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},rows:book.rows});}
|
||||
export function listedServiceCurrent(draft:Record<string,unknown>,book:ListedServiceBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);}
|
||||
export function recordListedServices(draft:Record<string,unknown>,book:ListedServiceBook):ListedServiceBook{
|
||||
+ throw new Error('Novas classificações P111–P120 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:ListedServiceCalculation={version:listedServiceVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:listedServiceSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateListedService(row))};
|
||||
const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveListedServiceBook(draft,next);return next;
|
||||
@@ -1,5 +1,85 @@
|
||||
# Rastreabilidade, utilização e formação
|
||||
|
||||
## 24/10/2026 — G9A–G9J/P111–P120 concluídos emQA,conjunto compatível não digital
|
||||
|
||||
Implementação`6cffa118`. Dez ramos com rastreabilidade/testes próprios,uma candidata conjunta. CIVA2(1)a/b,2(2),6(3),6(7)a–j e6(8),Lei13/2016PDF6–8/p1426(264–266);23(1)/(2),25(4),26(1–3),PDF16–17. Lei22/2022não altera estes artigos. Lei10/2025PDF12mantém alíneasa–j ealtera6(7–9);PDF13art23(2)excluik e remete declaração33(2);PDF14mantém26(1–3),adita26(4)digital ealtera33(2).
|
||||
|
||||
- **P111 — 6(7)a**: Cessão/autorização de direitos de autor,licenças,marcas e análogos.
|
||||
- **P112 — 6(7)b**: Publicidade.
|
||||
- **P113 — 6(7)c**: Telecomunicações.
|
||||
- **P114 — 6(7)d**: Consultores,engenheiros,advogados,economistas,contabilistas/gabinetes de estudos,organização,investigação/desenvolvimento e similares.
|
||||
- **P115 — 6(7)e**: Tratamento de dados/fornecimento de informações.
|
||||
- **P116 — 6(7)f**: Operações bancárias,financeiras,seguro/resseguro;eventual isenção independente.
|
||||
- **P117 — 6(7)g**: Colocação de pessoal.
|
||||
- **P118 — 6(7)h**: Intermediação em nome epor conta de outrem no fornecimento de serviço enumerado,subjacente identificado.
|
||||
- **P119 — 6(7)i**: Obrigação de não exercer,mesmo parcialmente,actividade/direito enumerado,subjacente identificado.
|
||||
- **P120 — 6(7)j**: Locação de bens móveis corpóreos,incluindo financeira,bens/contrato identificados.
|
||||
|
||||
Prestador estrangeiro semsede/EP/domicílio nacional apartirdoqualpresta+adquirente2(1)a/b comEP/domicílio nacional:6(7),incluindo quem pratique exclusivamente operações isentas sem direitoàdedução;responsáveladquirente2(2)/23(2),declaração33(2)nos termosa regulamentar. Não exigir dedução para localizar. Adquirente estabelecido/domiciliado estrangeiro:6(8),ainda queprestador nacional,sem imposto estrangeiro presumido. Percurso doméstico6(3),sem regras especiais:qualidade prestadorSP/regimegeral+referência identifica prestador23(1);se desconhecida,conservarlocalização e responsávelindeterminado. P118/P119exigem subjacente identificado,sem auto-referência ou enquadramento digital presumido. 2026,serviços enumerados não digitais;localização e identificação do responsável pelas obrigações. Sem isenção confirmada,base,taxa,IVA,montante a pagar,dedução/campo11 ou totaisModeloA. P121/P130digitais eP002transversal não fechados;outros6(4)/(5)encaminhados para percursos próprios. Não automatiza declaração,pagamento,retenção ou prazo digital32(1)c.
|
||||
|
||||
Localização/isenção/dedução/obrigação/montante independentes. Referências e pressupostos expressos reutilizáveis,sem certificado/aprovador novo;troca conserva dados ocultos e limpa condições próprias,escolhatécnicadeintegridade. listedServices poroportunidade nosnapshot/API/dossier existentes,sem schema/permissões.
|
||||
|
||||
Doze testes funcionais:um porramo comtrêspercursos+subjacentes/troca+persistência/histórico/preservação.APIprivada1teste/109asserções comrollback emQAisolada55441;tipos/build aprovados;Edge/CUAqualidade/subjacente desconhecidos,adquirente estrangeiro/retorno conserva referências,gravação/recuperação/relatório30exemplos+4versõesanteriores. Comparação de todos oslivros anteriores,incluindoP105–110/P084/P085parciais,comcongelamento;93fechos preservados,provas anteriores reutilizadas. Relatório`docs\investmoz\simulations\iva-l1-g9-nondigital-qa-20261024.json`;evidência`C:\laragon\www\portal-investidor\outputs\iva-l1-g9-nondigital-20261024/verification.json` eimagem`qa-recovered-report.png`. Sem escrita noactivo.
|
||||
|
||||
**93entregues +10QA +29funcionaispendentes +P001=133**. Homologação`03c26d66`;entrega conjunta pendente. P121/P130digitais/P002transversal/P084/P085 eL1abertos;P00105/06;bebidasL2/L3;Estatísticas/IAadiadas. Uma integração/backup/restauro/conferência paraesteconjunto,reutilizando provas porramo.
|
||||
|
||||
|
||||
## 24/10/2026 — preparação conjunta G9A–G9J/P111–P120
|
||||
|
||||
Inventariados93fechos antes dos testes,sem perdas confirmadas;provas03c26d66/4853bc72 reutilizadas. Congelados livros/resultados/históricos incluindoP105–110 eP084/P085parciais. QAporramo eentrega conjunta futura;sem alterações no activo. CIVA6(7)a–j/6(8),2(1)a/b e2(2),2016PDF6/8;Lei10/2025PDF12–14 para6(7–9),23(2),26/33. P121digital é percurso próprio,não classificar pelo recorte não digital. Localização,isenção e dedução independentes;qualidade SP do adquirente inclui quem realiza operações isentas sem direito à dedução.
|
||||
|
||||
## 24/10/2026 — G8B–G8F/P106–P110 entregues numa operação conjunta
|
||||
|
||||
Homologação **`03c26d66`**,sobre`8f14f5dd`;candidata`3f4e71c3` expressamente aceite pela Tempo. Cinco ramos,uma integração/backup/restauro/instalação/conferência,provas individuaisQA reutilizadas.
|
||||
|
||||
- **P106**: Sede/EP/domicílio do prestador a partir do qual o serviço é prestado,sem regras especiais aplicáveis. Não usar endereço/nacionalidade do cliente.
|
||||
- **P107**: Local do imóvel e relação do serviço,incluindo preparação/coordenação de trabalhos imobiliários,peritos/agentes. Independente da sede do prestador.
|
||||
- **P108**: Execução total ou essencial dos trabalhos/peritagens em bens móveis corpóreos. Independente da sede do prestador.
|
||||
- **P109**: Local material de actividades artísticas,científicas,desportivas,recreativas,ensino/similares,organizadores e serviços acessórios;6(5)c rectificado2017.
|
||||
- **P110**: Distância nacional6(5)d rectificada2017;partida/chegada nacionais incluem percurso fora do país6(6);ida/volta são dois trajectos. Identificar distância total/nacional na mesma unidade,sem apuramento monetário.
|
||||
|
||||
CIVA6(3),6(4)/(5)a–d,6(6),Lei13/2016 PDF7–8/p1426(265–266);Aviso BR89-I,de08/06/2017,PDF1,rectifica expressamente6(5)c/d:actividades nacionais e transporte pela distância nacional;Lei10/2025 PDF12mantém6(3–6),altera7–9digitais. Recorte2026,classificação territorial de serviços por factos próprios;sem base,taxa,IVA,isenção,dedução/campo11 ou totaisModeloA. Digital/outros6(7)/(8)exigem percursos próprios,não classificados automaticamente. P002transversal não encerrado. Factos/referências/datas/âmbito,entradas imutáveis/histórico/relatório preservados. Desconhecido não é zero;fora do território não é isenção/IVAzero;sem certificados/aprovadores novos.
|
||||
|
||||
Compatibilidade com main e destino conferida,sem avanço concorrente encontrado;fast-forward normal,sem sobrescrever alterações. SessãoSSH existente autenticada reutilizada,sem guardar credenciais. Backup novo e restauro real isolado sem rede:174tabelas/369ficheiros/configuração. Conferido apenas delta instalado:revisão servida,manifesto/hash,18marcadores compilados,quatro hashes funcionais e simuladorHTTP200. PostgreSQL pela mesma identidade antes/depois:174tabelas/369ficheiros e29fichas publicadas/28relações/408geometrias preservados;diferenças apenascache/sessões. Zero migrações/importações/alterações de permissões ou ensaios sintéticos no activo. Contenção de novas classificações conferida,não aplicada;leitores/histórico/outrosramos preservados. Release/backup anteriores conservados.
|
||||
|
||||
[Manifesto/recibo](../simulations/l1-g8-services-delivery-20261024.json),registo`iva_l1_g8_services_P106_P110_homologation_20261024`. **93entregues +39funcionaispendentes +P001=133**,sem candidatasQApor disponibilizar. Os88fechos anteriores preservados. P084/P085 continuam incluídos nos39,apenas preparação/simulação condicionada;P002transversal eL1abertos;P00105/06;bebidasL2/L3;Estatísticas/IAadiadas. ManterQAporramo eentregasconjuntas compatíveis.
|
||||
|
||||
|
||||
## 24/10/2026 — G8B–G8F/P106–P110 concluídos emQA,conjunto compatível
|
||||
|
||||
Implementação`ec33fb5b`. Cinco ramos com rastreabilidade/testes próprios,uma candidata conjunta,não cinco entregas. CIVA6(3),6(4)/(5)a–d,6(6),Lei13/2016 PDF7–8/p1426(265–266);Aviso BR89-I,de08/06/2017,PDF1,rectifica expressamente6(5)c/d:actividades nacionais e transporte pela distância nacional;Lei10/2025 PDF12mantém6(3–6),altera7–9digitais.
|
||||
|
||||
- **P106**: Sede/EP/domicílio do prestador a partir do qual o serviço é prestado,sem regras especiais aplicáveis. Não usar endereço/nacionalidade do cliente.
|
||||
- **P107**: Local do imóvel e relação do serviço,incluindo preparação/coordenação de trabalhos imobiliários,peritos/agentes. Independente da sede do prestador.
|
||||
- **P108**: Execução total ou essencial dos trabalhos/peritagens em bens móveis corpóreos. Independente da sede do prestador.
|
||||
- **P109**: Local material de actividades artísticas,científicas,desportivas,recreativas,ensino/similares,organizadores e serviços acessórios;6(5)c rectificado2017.
|
||||
- **P110**: Distância nacional6(5)d rectificada2017;partida/chegada nacionais incluem percurso fora do país6(6);ida/volta são dois trajectos. Identificar distância total/nacional na mesma unidade,sem apuramento monetário.
|
||||
|
||||
A divergência de transporte do exemplar2016 foi resolvida pelo Aviso2017já existente no acervo,consultado visualmentePDF1;não permanece impedimento documentalP110. A preparação anterior deP106–109não incluíaP110;este foi inventariado antes dos seus testes e juntou-se após o cotejo. Recorte2026,classificação territorial de serviços por factos próprios;sem base,taxa,IVA,isenção,dedução/campo11 ou totaisModeloA. Digital/outros6(7)/(8)exigem percursos próprios,não classificados automaticamente. P002transversal não encerrado. Fora do território não é isenção/IVAzero;desconhecido não é zero. Pressupostos expressos/referências reutilizáveis,sem certificados/aprovadores novos. Troca conserva referências/locais/trajectos ocultos e limpa condições próprias;escolha técnica de integridade,não nova regra organizacional. serviceLocations por oportunidade no snapshot/API/dossier existentes,sem schema/permissões.
|
||||
|
||||
Sete testes funcionais:um por ramo+preservação/persistência/histórico+casos específicos de transporte.APIprivada1teste/48asserções com rollback emQAisolada55441;tipos/build aprovados;Edge/CUA10operações,campo do prestador desconhecido,transporte misto80.25/100.50,gravação/recuperação/relatório e3versões anteriores. Comparação de todos os livros anteriores com congelamento,incluindoP105/P084/P085parciais,88fechos preservados;provas aceites reutilizadas. Relatório`docs\investmoz\simulations\iva-l1-g8-services-qa-20261024.json`,evidência`C:\laragon\www\portal-investidor\outputs\iva-l1-g8-services-20261024/verification.json`. Sem escrita no activo.
|
||||
|
||||
**88entregues +5QA +39funcionaispendentes +P001=133**. Homologação`8f14f5dd`;entrega conjunta pendente. P002transversal/P084/P085 eL1abertos;P00105/06;bebidasL2/L3;Estatísticas/IAadiadas. Uma integração/backup/restauro/conferência para este conjunto,reutilizando as provas por ramo.
|
||||
|
||||
|
||||
## 24/10/2026 — preparação conjunta G8B–G8E/P106–P109
|
||||
|
||||
Inventariados88fechos antes de testes,sem perdas confirmadas;provas8f14f5dd/aac3f463 reutilizadas. Congelados livros/resultados/históricos incluindoP105 eP084/P085parciais. QAporramo,entrega conjunta futura;sem alterações no activo. CIVA6(3),6(4)/(5)a–c,2016PDF7–8/p1426(265–266);2025PDF12mantém3–6. P110 separado para cotejo textual específico6(5)d/6(6),sem bloquear estes quatro ramos.
|
||||
|
||||
## 24/10/2026 — decisão da Tempo: entregas por grupos relacionados
|
||||
|
||||
Implementar e testar cada ramo em QA com rastreabilidade própria; agrupar ramos relacionados numa entrega, incluindo os próximos percursos compatíveis de G8. Fazer uma integração, backup/restauro e conferência do conjunto, reutilizando as provas individuais. Entregar isoladamente apenas por correcção urgente, risco especial ou dependência identificada. Estar concluído em QA não obriga à instalação imediata. Esta orientação chegou quando G8A já estava enviado para main e o instalador em execução; a operação iniciada foi acompanhada até à conferência do resultado. Os próximos ramos compatíveis aguardam entrega conjunta. Preservar fechos, alterações concorrentes e limites de âmbito; não criar nova matriz/backlog.
|
||||
|
||||
|
||||
## 24/10/2026 — G8A/P105 entregue:localização territorial dos bens
|
||||
|
||||
Homologação **`8f14f5dd`**,pelo processoGit existente,sobre`6f1cf7b7`;candidata`fb724866` expressamente aceite pela Tempo. **P105:um ramo,três tratamentos**:`goods_with_transport`,`goods_without_transport`,`goods_before_import`. CIVA6(1)/(2),Lei13/2016PDF7/p1426(265),mantidosLei10/2025PDF12;recorte2026/bens corpóreos. Localização no início transporte/expedição para adquirente ou,sem transporte,ao pôr à disposição. Regra própria das transmissões pelo importador/subsequentes antes da importação nacional de bens vindos do estrangeiro,com referências de transporte/importação/cadeia e âmbito. Endereço/nacionalidade do cliente não substituem esses factos. Fora do território não equivale a isenção/IVAzero. Classificação não calcula base/taxa/IVA/dedução/campo11/direitos/totaisModeloA,nem aplica esta regra física a digitais/serviços. Desconhecido permanece indeterminado. Troca conserva dados ocultos e limpa condições próprias;referências/datas/âmbito/entradas imutáveis/histórico/relatório preservados;sem certificados/aprovadores novos.
|
||||
|
||||
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,16marcadores compilados do livro/componente/relatório,três percursos/localização/regra6(2)/referências/â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çãoP105 conferida,não aplicada,leitores/históricos e restantes ramos preservados.
|
||||
|
||||
[Manifesto/recibo](../simulations/l1-g8a-delivery-20261024.json),registo`iva_l1_g8a_P105_homologation_20261024`. **88entregues +44funcionaispendentes +P001 =133;sem candidatasQA por disponibilizar.** Os87fechos anteriores permanecem encerrados. P084/P085 continuam nos44,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 — 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.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,41 @@
|
||||
import {useState} from 'react';
|
||||
import {newListedService,switchListedTreatment,listedServiceBook,listedServiceConditions,ownListedConditions,listedServiceCurrent,listedServiceReportRows,listedServiceSource,listedServiceTreatments,recordListedServices,saveListedServiceBook,type ListedServiceBook,type ListedServiceRow} from '@/lib/iva-listed-services';
|
||||
|
||||
export function SimulationListedServices({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}){
|
||||
const[error,setError]=useState('');let book:ListedServiceBook;
|
||||
try{book=listedServiceBook(draft);}catch(cause){return<p role="alert">{String(cause)}</p>;}
|
||||
const save=(next:ListedServiceBook)=>{try{onChange('modelo_a_snapshot',saveListedServiceBook(draft,next));setError('');}catch(cause){setError(String(cause));}};
|
||||
const change=(id:string,patch:Partial<ListedServiceRow>)=>save({...book,rows:book.rows.map(row=>row.id===id?{...row,...patch}:row)});
|
||||
return<details className="space-y-3 rounded border p-3">
|
||||
<summary>Serviços enumerados — localização e responsável pelas obrigações</summary>
|
||||
<p>Oportunidade: {String(draft.context_opportunity||'entrada geral')}. Identifique a natureza do serviço,o estabelecimento a partir do qual o prestador o fornece e o estabelecimento estável ou domicílio do adquirente. Nacionalidade não substitui estes factos.</p>
|
||||
<p>Adquirente no estrangeiro:conferir6(8). Prestador estrangeiro e adquirente nacional:6(7)inclui sujeitos passivos2(1)a/b que realizem exclusivamente operações isentas sem direito à dedução. Não exigir direito à dedução como condição de localização. Digital,imóveis e outras regras próprias têm os seus percursos.</p>
|
||||
<p>A classificação não concede isenção nem calcula IVA. A identificação do responsável explica a regra aplicável;não apresenta declaração nem inicia pagamento.</p>
|
||||
<p>{listedServiceSource}</p>{error&&<p role="alert">{error}</p>}
|
||||
<button type="button" className="underline" onClick={()=>save({...book,rows:[...book.rows,newListedService(crypto.randomUUID())]})}>Acrescentar serviço enumerado</button>
|
||||
{book.rows.map(row=><details key={row.id} className="rounded border p-3"><summary>{row.description||'Serviço por identificar'} — {row.period||'mês por indicar'}</summary>
|
||||
<div className="grid gap-3 md:grid-cols-2">
|
||||
<label>Tratamento do serviço<select className="block rounded border p-2" value={row.treatment} onChange={e=>change(row.id,switchListedTreatment(row,e.target.value))}><option value="">Por indicar</option>{listedServiceTreatments.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 ListedServiceRow['origin']})}><option value="projected">Projectados / pressupostos</option><option value="effective">Efectivos declarados</option></select></label>
|
||||
{([['description','Serviço identificado'],['operationRef','Referência da operação / pressuposto'],['operationDate','Data do serviço / prevista'],['period','Mês do serviço'],['documentRef','Documento da operação / referência da previsão'],['documentDate','Data do documento / prevista'],['subjectRef','Objecto:direito,campanha,serviço,pessoal,bens ou contrato'],['useRef','Destinatário e utilização / pressuposto'],['scope','Âmbito:serviço,operação,período e condições'],['evidence','Fundamento factual / pressupostos'],['providerPlace','Sede,EP ou domicílio a partir do qual o prestador fornece'],['providerRef','Referência do estabelecimento prestador'],['buyerPlace','Estabelecimento estável ou domicílio do adquirente'],['buyerRef','Referência do estabelecimento ou domicílio adquirente']] 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>)}
|
||||
{([['providerCountry','País do estabelecimento prestador'],['buyerCountry','País do estabelecimento ou domicílio adquirente']] as const).map(([field,label])=><label key={field}>{label}<select className="block rounded border p-2" value={row[field]} onChange={e=>change(row.id,{[field]:e.target.value})}><option value="">Por indicar</option><option value="MZ">Moçambique</option><option value="foreign">Estrangeiro</option></select></label>)}
|
||||
{row.providerCountry==='foreign'&&row.buyerCountry==='MZ'&&<>
|
||||
<label>Qualidade do adquirente2(1)<select className="block rounded border p-2" value={row.recipientType} onChange={e=>change(row.id,{recipientType:e.target.value})}><option value="">Por esclarecer</option><option value="a">Alínea a — actividade independente habitual,incluindo operações isentas sem dedução</option><option value="b">Alínea b — operação independente nos pressupostos legais</option><option value="other">Não corresponde às alíneas a/b</option></select></label>
|
||||
<label>Referência da qualidade fiscal do adquirente<input className="block rounded border p-2" value={row.recipientRef} onChange={e=>change(row.id,{recipientRef:e.target.value})}/></label>
|
||||
</>}
|
||||
{row.providerCountry==='MZ'&&row.buyerCountry==='MZ'&&<>
|
||||
<label>Prestador sujeito passivo no regime geral<select className="block rounded border p-2" value={row.providerTaxable} onChange={e=>change(row.id,{providerTaxable:e.target.value})}><option value="">Por esclarecer</option><option value="yes">Sim</option><option value="no">Não</option></select></label>
|
||||
<label>Referência da qualidade fiscal do prestador<input className="block rounded border p-2" value={row.providerTaxRef} onChange={e=>change(row.id,{providerTaxRef:e.target.value})}/></label>
|
||||
</>}
|
||||
{['intermediation_service','abstention_service'].includes(row.treatment)&&<>
|
||||
<label>Alínea6(7)do serviço,direito ou actividade subjacente<select className="block rounded border p-2" value={row.targetClause} onChange={e=>change(row.id,{targetClause:e.target.value})}><option value="">Por indicar</option>{listedServiceTreatments.filter(t=>t.id!==row.treatment).map(t=><option key={t.id} value={t.clause}>{t.clause} — {t.label}</option>)}</select></label>
|
||||
<label>Referência do subjacente e relação da intermediação/obrigação<input className="block rounded border p-2" value={row.targetRef} onChange={e=>change(row.id,{targetRef:e.target.value})}/></label>
|
||||
</>}
|
||||
</div>
|
||||
<p>Mudar tratamento conserva dados e referências ocultos,mas exige rever os factos próprios. Campos sem aplicação ficam ocultos e conservados.</p>
|
||||
<fieldset><legend>Factos próprios deste tratamento</legend>{[...listedServiceConditions,...ownListedConditions(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(recordListedServices(draft,book));}catch(cause){setError(String(cause));}}}>Classificar serviços e guardar versão</button>}
|
||||
{book.result&&<><p role="status">{listedServiceCurrent(draft,book)?'Resultados correspondentes às entradas guardadas.':'Entradas alteradas;resultados históricos conservados. Reveja e classifique novamente.'} {book.history?.length??0} versões anteriores. Localização e responsável não determinam isenção,IVA ou dedução/campo11.</p><dl>{listedServiceReportRows(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>;
|
||||
}
|
||||
@@ -16,6 +16,8 @@ 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 { SimulationServiceLocation } from './simulation-service-location';
|
||||
import { SimulationListedServices } from './simulation-listed-services';
|
||||
import { SimulationOfferPreparations } from './simulation-offer-preparations';
|
||||
import { SimulationOperations } from './simulation-operations';
|
||||
|
||||
@@ -110,6 +112,8 @@ export function SimulationMonthlyIva({draft, busy, onCalculate, onChange}: {
|
||||
<SimulationValueReview draft={draft} onChange={onChange} />
|
||||
<SimulationServiceNormal draft={draft} onChange={onChange} />
|
||||
<SimulationGoodsLocation draft={draft} onChange={onChange} />
|
||||
<SimulationServiceLocation draft={draft} onChange={onChange} />
|
||||
<SimulationListedServices draft={draft} onChange={onChange} />
|
||||
<SimulationOfferPreparations draft={draft} onChange={onChange} />
|
||||
<SimulationModeloA draft={draft} />
|
||||
</section>;
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
import {useState} from 'react';
|
||||
import {newServiceLocation,switchServiceTreatment,serviceLocationBook,serviceLocationConditions,ownServiceConditions,serviceLocationCurrent,serviceLocationReportRows,serviceLocationSource,serviceLocationTreatments,recordServiceLocations,saveServiceLocationBook,type ServiceLocationBook,type ServiceLocationRow} from '@/lib/iva-service-location';
|
||||
|
||||
export function SimulationServiceLocation({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}){
|
||||
const[error,setError]=useState('');let book:ServiceLocationBook;
|
||||
try{book=serviceLocationBook(draft);}catch(cause){return<p role="alert">{String(cause)}</p>;}
|
||||
const save=(next:ServiceLocationBook)=>{try{onChange('modelo_a_snapshot',saveServiceLocationBook(draft,next));setError('');}catch(cause){setError(String(cause));}};
|
||||
const change=(id:string,patch:Partial<ServiceLocationRow>)=>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 — serviços, imóveis, trabalhos, actividades e transporte</summary>
|
||||
<p>Oportunidade: {String(draft.context_opportunity||'entrada geral')}. Regra geral:ponto de estabelecimento do prestador a partir do qual o serviço é prestado. Imóveis,execução total/essencial em bens móveis e actividades materiais têm percursos próprios,independentemente da sede do prestador.</p>
|
||||
<p>Conferir primeiro a natureza e as regras especiais. Endereço/nacionalidade do cliente não substituem os factos relevantes. Digital e outros6(7)/(8)seguem os seus percursos. Classificação territorial não concede isenção nem calcula IVA.</p>
|
||||
<p>{serviceLocationSource}</p>{error&&<p role="alert">{error}</p>}
|
||||
<button type="button" className="underline" onClick={()=>save({...book,rows:[...book.rows,newServiceLocation(crypto.randomUUID())]})}>Acrescentar localização de serviç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 do serviço<select className="block rounded border p-2" value={row.treatment} onChange={e=>change(row.id,switchServiceTreatment(row,e.target.value))}><option value="">Por indicar</option>{serviceLocationTreatments.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 ServiceLocationRow['origin']})}><option value="projected">Projectados / pressupostos</option><option value="effective">Efectivos declarados</option></select></label>
|
||||
{([['description','Serviço identificado'],['operationRef','Referência da operação / pressuposto'],['operationDate','Data do serviço / prevista'],['period','Mês do serviço'],['documentRef','Documento da operação / referência da previsão'],['documentDate','Data do documento / prevista'],['scope','Âmbito: serviço, 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==='transport_service'?<>
|
||||
<p>Uma linha por trajecto;ida e volta separadas. Use a mesma unidade nas duas distâncias. Partida e chegada nacionais incluem percurso fora do país6(6).</p>
|
||||
{([['routeRef','Trajecto e referência / pressuposto'],['totalDistance','Distância total'],['nationalDistance','Distância fisicamente nacional']] as const).map(([field,label])=><label key={field}>{label}<input className="block rounded border p-2" value={row[field]} onChange={e=>change(row.id,{[field]:e.target.value})}/></label>)}
|
||||
{([['departure','País do ponto de partida'],['arrival','País do ponto de chegada']] as const).map(([field,label])=><label key={field}>{label}<select className="block rounded border p-2" value={row[field]} onChange={e=>change(row.id,{[field]:e.target.value})}><option value="">Por indicar</option><option value="MZ">Moçambique</option><option value="foreign">Estrangeiro</option></select></label>)}
|
||||
</>:row.treatment==='general_service'?<>
|
||||
<label>Estabelecimento do prestador a partir do qual o serviço é prestado<input className="block rounded border p-2" value={row.providerPlace} onChange={e=>change(row.id,{providerPlace:e.target.value})}/></label>
|
||||
<label>País desse estabelecimento<select className="block rounded border p-2" value={row.providerCountry} onChange={e=>change(row.id,{providerCountry:e.target.value})}><option value="">Por indicar</option><option value="MZ">Moçambique</option><option value="foreign">Estrangeiro</option></select></label>
|
||||
<label>Referência do estabelecimento prestador / pressuposto<input className="block rounded border p-2" value={row.providerRef} onChange={e=>change(row.id,{providerRef:e.target.value})}/></label>
|
||||
</>:row.treatment&&<>
|
||||
<label>{row.treatment==='immovable_service'?'Local do imóvel':row.treatment==='movable_work'?'Local de execução total ou essencial':'Local material da actividade ou serviço acessório'}<input className="block rounded border p-2" value={row.servicePlace} onChange={e=>change(row.id,{servicePlace:e.target.value})}/></label>
|
||||
<label>Situação do local relevante<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">Moçambique</option><option value="foreign">Estrangeiro</option></select></label>
|
||||
<label>Referência da localização / pressuposto<input className="block rounded border p-2" value={row.placeRef} onChange={e=>change(row.id,{placeRef:e.target.value})}/></label>
|
||||
<label>Imóvel, bens ou actividade e relação do serviço<input className="block rounded border p-2" value={row.subjectRef} onChange={e=>change(row.id,{subjectRef: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>{[...serviceLocationConditions,...ownServiceConditions(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(recordServiceLocations(draft,book));}catch(cause){setError(String(cause));}}}>Classificar localização e guardar versão</button>}
|
||||
{book.result&&<><p role="status">{serviceLocationCurrent(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>{serviceLocationReportRows(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>;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import {acquisitionScope,readAcquisitionStore} from './iva-acquisitions.ts';
|
||||
|
||||
export const listedServiceVersion='listed-nondigital-services/1';
|
||||
export const listedServiceSource='CIVA2(1)a/b,2(2),6(3),6(7)a–j e6(8),Lei13/2016PDF6–8/p1426(264–266);obrigações23(1)/(2),25(4),26(1–3),2016PDF16–17;Lei10/2025PDF12mantém alíneasa–j ealtera6(7)/(8)/(9),PDF13art23(2)excluik,PDF14mantém26(1–3),adita26(4)digital ealtera33(2). Recorte2026,não digital. Regime digital/P121 eoutros6(4)/(5)seguem percurso próprio. Localização/obrigações não confirmam isenção,taxa,IVA,dedução/campo11 ou montante a pagar.';
|
||||
export const listedServiceTreatments=[
|
||||
{id:'rights_service',branch:'P111',clause:'a',label:'P111 — Direitos de autor,patentes,licenças e marcas'},
|
||||
{id:'advertising_service',branch:'P112',clause:'b',label:'P112 — Publicidade'},
|
||||
{id:'telecom_service',branch:'P113',clause:'c',label:'P113 — Telecomunicações'},
|
||||
{id:'consulting_service',branch:'P114',clause:'d',label:'P114 — Consultoria,engenharia,advocacia,economia e contabilidade'},
|
||||
{id:'data_service',branch:'P115',clause:'e',label:'P115 — Tratamento de dados e informações'},
|
||||
{id:'finance_service',branch:'P116',clause:'f',label:'P116 — Banca,finanças,seguro e resseguro'},
|
||||
{id:'staff_service',branch:'P117',clause:'g',label:'P117 — Colocação de pessoal'},
|
||||
{id:'intermediation_service',branch:'P118',clause:'h',label:'P118 — Intermediação em nome e por conta de outrem'},
|
||||
{id:'abstention_service',branch:'P119',clause:'i',label:'P119 — Obrigação de não exercer actividade ou direito'},
|
||||
{id:'movable_lease_service',branch:'P120',clause:'j',label:'P120 — Locação de bens móveis corpóreos e financeira'},
|
||||
] as const;
|
||||
export const listedServiceConditions=[['serviceSupply','Está identificada uma prestação de serviços desta operação e período'],['nonDigital','A natureza foi conferida:este caso não é bem/serviço digital abrangido por6(7)k/6(9)/26(4)'],['placeRulesExcluded','Foram conferidas as regras de imóveis,trabalhos em móveis,actividades e transporte6(4)/(5):não exigem outro percurso neste caso']] as const;
|
||||
export const listedOwnConditions={
|
||||
rights_service:[['rightsNature','Cessão ou autorização para utilizar direitos de autor,licenças,marcas de fábrica/comércio ou outros direitos análogos identificados']],
|
||||
advertising_service:[['advertisingNature','Serviço de publicidade identificado']],
|
||||
telecom_service:[['telecomNature','Serviço de telecomunicações identificado']],
|
||||
consulting_service:[['consultingNature','Consultores,engenheiros,advogados,economistas,contabilistas ou gabinetes de estudo,organização,investigação e desenvolvimento ou domínio similar identificado']],
|
||||
data_service:[['dataNature','Tratamento de dados ou fornecimento de informações identificado']],
|
||||
finance_service:[['financeNature','Operação bancária,financeira,de seguro ou resseguro identificada;localização não determina a eventual isenção']],
|
||||
staff_service:[['staffNature','Colocação de pessoal identificada']],
|
||||
intermediation_service:[['intermediaryNature','Intermediário intervém em nome e por conta de outrem no fornecimento de serviço enumerado neste número']],
|
||||
abstention_service:[['abstentionNature','Obrigação de não exercer,mesmo parcialmente,actividade profissional ou direito mencionado nas alíneas deste número']],
|
||||
movable_lease_service:[['leaseNature','Locação de bens móveis corpóreos,incluindo locação financeira,com bens e contrato identificados']],
|
||||
} as const;
|
||||
export function ownListedConditions(treatment:string):ReadonlyArray<readonly[string,string]>{return listedOwnConditions[treatment as keyof typeof listedOwnConditions]??[];}
|
||||
type Choice=''|'yes'|'no';type Condition=typeof listedServiceConditions[number][0];
|
||||
export type ListedServiceRow={id:string;treatment:string;description:string;period:string;origin:'projected'|'effective';operationDate:string;operationRef:string;documentRef:string;documentDate:string;providerPlace:string;providerCountry:string;providerRef:string;buyerPlace:string;buyerCountry:string;buyerRef:string;recipientType:string;recipientRef:string;providerTaxable:string;providerTaxRef:string;useRef:string;subjectRef:string;targetClause:string;targetRef:string;scope:string;evidence:string;conditions:Partial<Record<string,Choice>>};
|
||||
type LineResult={id:string;status:'determined'|'not_applicable'|'indeterminate';territory:'national'|'outside'|null;responsible:'acquirer'|'provider'|'outside'|'indeterminate';obligationReason:string;baseAmount:null;vat:null;rate:null;reason:string};
|
||||
export type ListedServiceCalculation={version:string;revision:number;calculatedAt:string;opportunity:string;location:string;sourceKey:string;source:string;inputs:ListedServiceRow[];rows:LineResult[]};
|
||||
export type ListedServiceBook={rows:ListedServiceRow[];result?:ListedServiceCalculation;history?:ListedServiceCalculation[]};
|
||||
type Store=ReturnType<typeof readAcquisitionStore>&{listedServices?:Record<string,ListedServiceBook>};
|
||||
export function newListedService(id:string):ListedServiceRow{return{id,treatment:'',description:'',period:'',origin:'projected',operationDate:'',operationRef:'',documentRef:'',documentDate:'',providerPlace:'',providerCountry:'',providerRef:'',buyerPlace:'',buyerCountry:'',buyerRef:'',recipientType:'',recipientRef:'',providerTaxable:'',providerTaxRef:'',useRef:'',subjectRef:'',targetClause:'',targetRef:'',scope:'',evidence:'',conditions:{}};}
|
||||
export function switchListedTreatment(row:ListedServiceRow,treatment:string):ListedServiceRow{return{...row,treatment,conditions:Object.fromEntries(listedServiceConditions.map(([key])=>[key,row.conditions[key]??'']))};}
|
||||
|
||||
function readStore(draft:Record<string,unknown>):Store{
|
||||
const store=readAcquisitionStore(draft.modelo_a_snapshot) as Store;
|
||||
if(store.listedServices!==undefined&&(!store.listedServices||typeof store.listedServices!=='object'||Array.isArray(store.listedServices)))throw new Error('Serviços enumerados não recuperáveis;originais preservados.');
|
||||
const fields=Object.keys(newListedService('')).filter(key=>key!=='conditions');
|
||||
for(const book of Object.values(store.listedServices??{}))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 ListedServiceRow]!=='string')||!row.conditions||typeof row.conditions!=='object'||Array.isArray(row.conditions)))throw new Error('Linhas de serviços enumerados não recuperáveis;originais preservados,sem substituição por lista vazia.');
|
||||
return store;
|
||||
}
|
||||
export function listedServiceBook(draft:Record<string,unknown>):ListedServiceBook{return readStore(draft).listedServices?.[acquisitionScope(draft)]??{rows:[]};}
|
||||
export function saveListedServiceBook(draft:Record<string,unknown>,book:ListedServiceBook):string{const current=readStore(draft),encoded=JSON.stringify({...current,listedServices:{...current.listedServices,[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 evaluateListedService(row:ListedServiceRow):LineResult{
|
||||
const result:LineResult={id:row.id,status:'indeterminate',territory:null,responsible:'indeterminate',obligationReason:'Responsável indeterminado;sem obrigação ou montante presumido.',baseAmount:null,vat:null,rate:null,reason:''};const stop=(reason:string,status:LineResult['status']='indeterminate')=>({...result,status,reason});
|
||||
const rule=listedServiceTreatments.find(t=>t.id===row.treatment);if(!rule)return stop('Identifique o serviço enumerado,não digital,e a natureza efectiva da operação.');
|
||||
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ês2026,data correspondente e dados efectivos ou pressupostos expressos.');
|
||||
const required=[...listedServiceConditions,...ownListedConditions(row.treatment)];
|
||||
if(required.some(([key])=>row.conditions[key]==='no'))return stop('Este percurso não se aplica:conferir natureza digital,regra territorial própria ou tratamento indicado;nenhum IVAzero/isenção presumido.','not_applicable');
|
||||
if(required.some(([key])=>row.conditions[key]!=='yes'))return stop('Natureza ou regra própria por esclarecer;desconhecido não é fora do território,isenção ou IVAzero.');
|
||||
if(!row.description.trim()||!row.operationRef.trim()||!row.documentRef.trim()||!validDate(row.documentDate)||!row.scope.trim()||!row.evidence.trim()||!row.useRef.trim()||!row.subjectRef.trim())return stop('Identifique serviço,objecto,destinatário/utilização,operação,documento/data,âmbito e factos ou pressupostos expressos;reutilize referências,sem certificado/aprovador novo.');
|
||||
if(['intermediation_service','abstention_service'].includes(row.treatment)&&(!'abcdefghij'.includes(row.targetClause)||row.targetClause.length!==1||row.targetClause===rule.clause||!row.targetRef.trim()))return stop('Identifique o serviço/direito/actividade subjacente e a sua alínea de6(7),com referência;digitalk exige percurso próprio,não presumir pelo título.');
|
||||
if(!['MZ','foreign'].includes(row.buyerCountry)||!row.buyerPlace.trim()||!row.buyerRef.trim())return stop('Identifique o estabelecimento estável ou domicílio do adquirente,país e referência correspondentes,não apenas nacionalidade.');
|
||||
if(row.buyerCountry==='foreign')return{...result,status:'determined',territory:'outside',responsible:'outside',obligationReason:'Artigo6(8):fora do âmbito territorial de Moçambique;sem obrigação nacional calculada por este percurso ou imposto estrangeiro presumido.',reason:`${rule.branch}:6(8),Lei10/2025PDF12,adquirente estabelecido ou domiciliado no estrangeiro;serviço6(7)${rule.clause} não tributável neste âmbito,ainda que prestador tenha sede/EP/domicílio nacional. Não é concessão de isenção nem IVAzero;sem dedução/campo11 ou imposto estrangeiro presumido.`};
|
||||
if(!['MZ','foreign'].includes(row.providerCountry)||!row.providerPlace.trim()||!row.providerRef.trim())return stop('Identifique sede/EP/domicílio do prestador a partir do qual o serviço é prestado,país e referência.');
|
||||
if(row.providerCountry==='foreign'){
|
||||
if(row.recipientType==='other')return stop('Adquirente não corresponde a2(1)a/b:6(7)não demonstrado por este percurso;conferir outra regra aplicável,sem classificar automaticamente fora do território.','not_applicable');
|
||||
if(!['a','b'].includes(row.recipientType)||!row.recipientRef.trim())return stop('Identifique qualidade do adquirente2(1)a/b e referência;inclui quem pratica exclusivamente operações isentas sem direito à dedução,não exigir direito à dedução.');
|
||||
return{...result,status:'determined',territory:'national',responsible:'acquirer',obligationReason:'Adquirente sujeito passivo2(2)/6(7)/23(2),redacção2025:entrega declaração33(2)eimposto exigível,nos termos a regulamentar. Não se aplica26(4)digital,nem prazo32(1)c digital a este caso. Eventual isenção/taxa/montante eprocedimento de pagamento não são apurados aqui.',reason:`${rule.branch}:6(7)${rule.clause},prestador estrangeiro sem sede/EP/domicílio nacional a partir do qual presta;adquirente2(1)${row.recipientType} comEP/domicílio nacional,mesmo que pratique exclusivamente operações isentas sem dedução. Localização nacional não confirma isenção,IVA ou dedução/campo11.`};
|
||||
}
|
||||
const liable=row.providerTaxable==='yes'&&!!row.providerTaxRef.trim();
|
||||
return{...result,status:'determined',territory:'national',responsible:liable?'provider':'indeterminate',obligationReason:liable?'Prestador sujeito passivo no regime geral:23(1),sem activação automática de cobrança;eventual isenção,taxa,IVA eapuramento independentes.':'Localização6(3)determinada;qualidade fiscal do prestador ou referência por esclarecer,sem atribuir obrigação automaticamente.',reason:`${rule.branch}:6(3),prestador comsede/EP/domicílio nacional a partir do qual presta eadquirente nacional,sem regras6(4)/(5)ou digitais aplicáveis. Qualidade do adquirente2(1)a/b não é pré-condição deste percurso doméstico. Localização não concede isenção nem calculaIVA/dedução.`};
|
||||
}
|
||||
|
||||
function key(draft:Record<string,unknown>,book:ListedServiceBook):string{return JSON.stringify({version:listedServiceVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},rows:book.rows});}
|
||||
export function listedServiceCurrent(draft:Record<string,unknown>,book:ListedServiceBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);}
|
||||
export function recordListedServices(draft:Record<string,unknown>,book:ListedServiceBook):ListedServiceBook{
|
||||
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:ListedServiceCalculation={version:listedServiceVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:listedServiceSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateListedService(row))};
|
||||
const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveListedServiceBook(draft,next);return next;
|
||||
}
|
||||
export function listedServiceReportRows(draft:Record<string,unknown>):Array<[string,string,string,string]>{
|
||||
try{const book=listedServiceBook(draft),result=book.result;if(!result)return[];return result.inputs.map((row,index)=>{const line=result.rows[index];return['IVA mensal',`Serviço ${listedServiceTreatments.find(t=>t.id===row.treatment)?.branch??'enumerado'} — ${row.period} — ${row.id}`,`${row.description};classificação territorial: ${line.territory==='national'?'Moçambique':line.territory==='outside'?'Fora do território nacional':'Indeterminada'};IVA: Indeterminado;${line.reason};responsável: ${line.responsible==='acquirer'?'Adquirente':line.responsible==='provider'?'Prestador':line.responsible==='outside'?'Fora deste âmbito':'Indeterminado'};${line.obligationReason}`,`${result.opportunity};${result.location};${listedServiceCurrent(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'};${listedServiceTreatments.find(t=>t.id===row.treatment)?.label??'Percurso por indicar'};operação ${row.operationRef},${row.operationDate};prestador ${row.providerPlace},${row.providerCountry},${row.providerRef};adquirente ${row.buyerPlace},${row.buyerCountry},${row.buyerRef};${row.buyerCountry==='MZ'&&row.providerCountry==='foreign'?`qualidade adquirente2(1)${row.recipientType},${row.recipientRef};`:''}${row.buyerCountry==='MZ'&&row.providerCountry==='MZ'?`qualidade prestador ${row.providerTaxable},${row.providerTaxRef};`:''}objecto ${row.subjectRef};destinatário/utilização ${row.useRef};${['intermediation_service','abstention_service'].includes(row.treatment)?`subjacente6(7)${row.targetClause},${row.targetRef};`:''}âmbito ${row.scope};documento ${row.documentRef},${row.documentDate};condições ${[...listedServiceConditions,...ownListedConditions(row.treatment)].map(([key,label])=>label+': '+(row.conditions[key]==='yes'?'Sim':row.conditions[key]==='no'?'Não':'Por indicar')).join('; ')};fundamento ${row.evidence};sem isenção/IVA/campo11/totaisModeloA.`];});}
|
||||
catch{return[['IVA mensal','Serviços enumerados','Dados não recuperáveis','Originais preservados;sem classificação por defeito.']];}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import {acquisitionScope,readAcquisitionStore} from './iva-acquisitions.ts';
|
||||
|
||||
export const serviceLocationVersion='service-territoriality/1';
|
||||
export const serviceLocationSource='CIVA6(3),6(4)/(5)(a–d),6(6),Lei13/2016PDF7–8/p1426(265–266);AvisoBR89-I,08/06/2017,PDF1 rectifica6(5)c/d:actividades materialmente nacionais e transporte pela distância nacional;Lei10/2025PDF12mantém6(3–6),altera7–9digitais. Recorte2026:regra geral sem regras especiais aplicáveis;imóveis,trabalhos/peritagens em móveis e actividades presenciais pelos factos próprios. Sem taxa/IVA/isenção/dedução/campo11/totaisModeloA;digital e outros6(7)/(8)não classificados por estes percursos.';
|
||||
export const serviceLocationTreatments=[{id:'general_service',label:'P106 — Regra geral dos serviços',branch:'P106'},{id:'immovable_service',label:'P107 — Serviços relacionados com imóveis',branch:'P107'},{id:'movable_work',label:'P108 — Trabalhos/peritagens em bens móveis',branch:'P108'},{id:'activity_service',label:'P109 — Actividades presenciais e serviços acessórios',branch:'P109'},{id:'transport_service',label:'P110 — Transporte por distância e percurso',branch:'P110'}] as const;
|
||||
export const serviceLocationConditions=[['serviceSupply','Está identificada uma prestação de serviços e a operação/período correspondentes'],['otherSpecialRulesExcluded','Foi conferida a natureza da operação: não está abrangida neste caso por regime digital ou regras6(7)/(8)que exijam outro percurso']] as const;
|
||||
export const serviceOwnConditions={
|
||||
general_service:[['noPlaceException','Não se aplica nenhuma excepção de localização6(4)/(5):imóveis,trabalhos/peritagens em móveis,actividades materiais ou transporte'],['providerEstablishment','Identificada a sede,estabelecimento estável ou domicílio do prestador a partir do qual este serviço é prestado']],
|
||||
immovable_service:[['propertyRelation','O serviço relaciona-se com o imóvel identificado,incluindo preparação/coordenação de trabalhos imobiliários,peritos ou agentes imobiliários']],
|
||||
movable_work:[['corporealMovable','São trabalhos em bens móveis corpóreos ou peritagens a eles referentes'],['totalEssential','O local indicado corresponde à execução total ou essencial dos trabalhos/peritagens']],
|
||||
activity_service:[['activityNature','Serviço artístico,científico,desportivo,recreativo,de ensino ou similar,incluindo organizadores e serviços acessórios dessa actividade'],['materialActivity','A actividade ou serviço acessório tem materialmente lugar no local indicado']],
|
||||
transport_service:[['transportNature','Prestação de transporte com percurso e distâncias identificados'],['routeCorresponds','Distâncias e pontos de partida/chegada correspondem a este trajecto;ida e volta são trajectos distintos6(6)']],
|
||||
} as const;
|
||||
export function ownServiceConditions(treatment:string):ReadonlyArray<readonly[string,string]>{return serviceOwnConditions[treatment as keyof typeof serviceOwnConditions]??[];}
|
||||
type Choice=''|'yes'|'no';type Condition=typeof serviceLocationConditions[number][0];
|
||||
export type ServiceLocationRow={id:string;treatment:string;description:string;period:string;origin:'projected'|'effective';operationDate:string;operationRef:string;documentRef:string;documentDate:string;servicePlace:string;placeCountry:string;placeRef:string;totalDistance:string;nationalDistance:string;departure:string;arrival:string;routeRef:string;providerRef:string;providerPlace:string;providerCountry:string;subjectRef:string;scope:string;evidence:string;conditions:Partial<Record<string,Choice>>};
|
||||
type LineResult={id:string;status:'determined'|'not_applicable'|'indeterminate';territory:'national'|'outside'|'partial'|null;baseAmount:null;vat:null;rate:null;reason:string};
|
||||
export type ServiceLocationCalculation={version:string;revision:number;calculatedAt:string;opportunity:string;location:string;sourceKey:string;source:string;inputs:ServiceLocationRow[];rows:LineResult[]};
|
||||
export type ServiceLocationBook={rows:ServiceLocationRow[];result?:ServiceLocationCalculation;history?:ServiceLocationCalculation[]};
|
||||
type Store=ReturnType<typeof readAcquisitionStore>&{serviceLocations?:Record<string,ServiceLocationBook>};
|
||||
export function newServiceLocation(id:string):ServiceLocationRow{return{id,treatment:'',description:'',period:'',origin:'projected',operationDate:'',operationRef:'',documentRef:'',documentDate:'',servicePlace:'',placeCountry:'',placeRef:'',totalDistance:'',nationalDistance:'',departure:'',arrival:'',routeRef:'',providerRef:'',providerPlace:'',providerCountry:'',subjectRef:'',scope:'',evidence:'',conditions:{}};}
|
||||
export function switchServiceTreatment(row:ServiceLocationRow,treatment:string):ServiceLocationRow{return{...row,treatment,conditions:Object.fromEntries(serviceLocationConditions.map(([key])=>[key,row.conditions[key]??'']))};}
|
||||
|
||||
function readStore(draft:Record<string,unknown>):Store{
|
||||
const store=readAcquisitionStore(draft.modelo_a_snapshot) as Store;
|
||||
if(store.serviceLocations!==undefined&&(!store.serviceLocations||typeof store.serviceLocations!=='object'||Array.isArray(store.serviceLocations)))throw new Error('Localizações de serviços não recuperáveis;originais preservados.');
|
||||
const fields=Object.keys(newServiceLocation('')).filter(key=>key!=='conditions');
|
||||
for(const book of Object.values(store.serviceLocations??{}))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 ServiceLocationRow]!=='string')||!row.conditions||typeof row.conditions!=='object'||Array.isArray(row.conditions)))throw new Error('Linhas de localização de serviços não recuperáveis;originais preservados,sem substituição por lista vazia.');
|
||||
return store;
|
||||
}
|
||||
export function serviceLocationBook(draft:Record<string,unknown>):ServiceLocationBook{return readStore(draft).serviceLocations?.[acquisitionScope(draft)]??{rows:[]};}
|
||||
export function saveServiceLocationBook(draft:Record<string,unknown>,book:ServiceLocationBook):string{const current=readStore(draft),encoded=JSON.stringify({...current,serviceLocations:{...current.serviceLocations,[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 evaluateServiceLocation(row:ServiceLocationRow):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=serviceLocationTreatments.find(t=>t.id===row.treatment);if(!rule)return stop('Identifique o percurso do serviç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ês2026,data correspondente e natureza efectiva/projectada dos dados.');
|
||||
const conditions=[...serviceLocationConditions,...ownServiceConditions(row.treatment)];
|
||||
if(conditions.some(([key])=>row.conditions[key]==='no'))return stop('Este percurso não se aplica aos factos declarados;rever a regra própria,sem presumir fora do território,isenção ou IVAzero.','not_applicable');
|
||||
if(conditions.some(([key])=>row.conditions[key]!=='yes'))return stop('Factos ou regra própria por esclarecer;localização indeterminada,não isenção ou IVAzero.');
|
||||
if(!row.description.trim()||!row.operationRef.trim()||!row.documentRef.trim()||!validDate(row.documentDate)||!row.scope.trim()||!row.evidence.trim())return stop('Identifique serviço/operação,documento/data,âmbito e fundamento factual ou pressupostos expressos;reutilize dados sem certificado/aprovador novo.');
|
||||
if(row.treatment==='transport_service'){
|
||||
const parse=(v:string):bigint|null=>/^\d{1,18}(\.\d{1,6})?$/.test(v)?BigInt(v.split('.')[0])*1000000n+BigInt((v.split('.')[1]??'').padEnd(6,'0')):null;
|
||||
const total=parse(row.totalDistance),national=parse(row.nationalDistance);
|
||||
if(total===null||total===0n||national===null||national>total||!['MZ','foreign'].includes(row.departure)||!['MZ','foreign'].includes(row.arrival)||!row.routeRef.trim())return stop('Identifique percurso,pontos de partida/chegada e distâncias na mesma unidade,total positiva e nacional entre zero e total;desconhecido não é zero.');
|
||||
const deemed=row.departure==='MZ'&&row.arrival==='MZ';const covered=deemed?total:national;const territory=covered===0n?'outside':covered===total?'national':'partial';
|
||||
return{...result,status:'determined',territory,reason:`P110:artigo6(4)d/6(5)d rectificado pelo AvisoBR89-I,08/06/2017,PDF1,e6(6). ${deemed?'Partida e chegada no território nacional:inclui o percurso efectuado fora dos mesmos.':`Parcela nacional:distância ${row.nationalDistance} de ${row.totalDistance},na mesma unidade,sem arredondamento ou apuramento monetário.`} Ida e volta são trajectos distintos:recolher uma linha por trajecto. ${row.origin==='projected'?'Pressupostos expressos.':'Dados efectivos declarados.'} Fora do território não equivale a isenção/IVAzero;sem base,taxa,IVA,dedução/campo11 ou totaisModeloA.`};
|
||||
}
|
||||
const general=row.treatment==='general_service';const country=general?row.providerCountry:row.placeCountry;
|
||||
if(!['MZ','foreign'].includes(country)||!(general?row.providerPlace:row.servicePlace).trim()||!(general?row.providerRef:row.placeRef).trim()||(!general&&!row.subjectRef.trim()))return stop(general?'Identifique sede/EP/domicílio do prestador a partir do qual o serviço é prestado,país e referência;endereço do cliente não substitui esse estabelecimento.':'Identifique local,país,referência e imóvel/bens/actividade a que respeita;endereço do cliente ou sede do prestador não substituem esses factos.');
|
||||
const territory=country==='MZ'?'national':'outside';const clause=general?'6(3)':`6(${territory==='national'?'5':'4'})(${row.treatment==='immovable_service'?'a':row.treatment==='movable_work'?'b':'c'})`;
|
||||
const fact=general?'estabelecimento do prestador a partir do qual o serviço é prestado':row.treatment==='immovable_service'?'local do imóvel':row.treatment==='movable_work'?'local de execução total ou essencial dos trabalhos/peritagens':'local material da actividade ou serviço acessório';
|
||||
return{...result,status:'determined',territory,reason:`${rule.branch}:artigo${clause},${fact} ${territory==='national'?'emMoçambique':'fora deMoçambique'},${row.origin==='projected'?'sob pressupostos expressos':'segundo dados efectivos declarados'}. ${general?'Regras especiais conferidas como não aplicáveis.':'Regra territorial própria,independente da sede nacional ou estrangeira do prestador.'} Fora deste âmbito não equivale a isenção/IVAzero;não calcula base,taxa,IVA,dedução/campo11 ou totaisModeloA.`};
|
||||
}
|
||||
|
||||
function key(draft:Record<string,unknown>,book:ServiceLocationBook):string{return JSON.stringify({version:serviceLocationVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},rows:book.rows});}
|
||||
export function serviceLocationCurrent(draft:Record<string,unknown>,book:ServiceLocationBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);}
|
||||
export function recordServiceLocations(draft:Record<string,unknown>,book:ServiceLocationBook):ServiceLocationBook{
|
||||
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:ServiceLocationCalculation={version:serviceLocationVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:serviceLocationSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateServiceLocation(row))};
|
||||
const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveServiceLocationBook(draft,next);return next;
|
||||
}
|
||||
export function serviceLocationReportRows(draft:Record<string,unknown>):Array<[string,string,string,string]>{
|
||||
try{const book=serviceLocationBook(draft),result=book.result;if(!result)return[];return result.inputs.map((row,index)=>['IVA mensal',`Localização ${serviceLocationTreatments.find(t=>t.id===row.treatment)?.branch??'serviço'} — ${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':result.rows[index].territory==='partial'?'Parcela nacional do transporte':'Indeterminada'};IVA: Indeterminado;${result.rows[index].reason}`,`${result.opportunity};${result.location};${serviceLocationCurrent(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'};${serviceLocationTreatments.find(t=>t.id===row.treatment)?.label??'Percurso por indicar'};operação ${row.operationRef},${row.operationDate};${row.treatment==='transport_service'?`trajecto ${row.routeRef};partida ${row.departure};chegada ${row.arrival};distâncias nacional/total ${row.nationalDistance}/${row.totalDistance}`:row.treatment==='general_service'?`estabelecimento prestador ${row.providerPlace},${row.providerCountry};referência ${row.providerRef}`:`local ${row.servicePlace},${row.placeCountry};referência ${row.placeRef};imóvel/bens/actividade ${row.subjectRef}`};âmbito ${row.scope};documento ${row.documentRef},${row.documentDate};condições ${[...serviceLocationConditions,...ownServiceConditions(row.treatment)].map(([key,label])=>label+': '+(row.conditions[key]==='yes'?'Sim':row.conditions[key]==='no'?'Não':'Por indicar')).join('; ')};fundamento ${row.evidence};não determina isenção/IVA/campo11/totaisModeloA.`]);}
|
||||
catch{return[['IVA mensal','Localização de serviços','Dados não recuperáveis','Originais preservados;sem classificar por defeito.']];}
|
||||
}
|
||||
@@ -15,6 +15,8 @@ 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 { serviceLocationReportRows } from './iva-service-location.ts';
|
||||
import { listedServiceReportRows } from './iva-listed-services.ts';
|
||||
import { offerPreparationReportRows } from './iva-offer-preparations.ts';
|
||||
import { salesReportRows } from './iva-operations.ts';
|
||||
import { fiscalQaRows } from './fiscal-qa-preview.ts';
|
||||
@@ -640,6 +642,8 @@ export function buildProjectDossierRows(
|
||||
rows.push(...valueReviewReportRows(draft));
|
||||
rows.push(...serviceNormalReportRows(draft));
|
||||
rows.push(...goodsLocationReportRows(draft));
|
||||
rows.push(...serviceLocationReportRows(draft));
|
||||
rows.push(...listedServiceReportRows(draft));
|
||||
rows.push(...offerPreparationReportRows(draft));
|
||||
const operationRows = salesReportRows(draft);
|
||||
rows.push(...operationRows);
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<?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 IvaListedServicesDraftTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
public function test_listed_services_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-g9-nondigital.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:350', $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['listedServices']['opportunity:350'];
|
||||
$this->assertCount(30, $book['rows']);
|
||||
$this->assertCount(10,array_unique(array_column($book['rows'],'treatment')));
|
||||
$this->assertSame(array_merge(...array_fill(0,10,['national','outside','national'])),array_column($book['result']['rows'],'territory'));
|
||||
$this->assertSame(array_merge(...array_fill(0,10,['acquirer','outside','provider'])),array_column($book['result']['rows'],'responsible'));
|
||||
foreach ($book['result']['rows'] as $row) {
|
||||
$this->assertNull($row['baseAmount']);$this->assertNull($row['vat']);$this->assertNull($row['rate']);
|
||||
}
|
||||
$this->assertSame($book['rows'], $book['result']['inputs']);
|
||||
$this->assertCount(1, $book['history']);
|
||||
$this->assertNull($book['history'][0]['rows'][0]['baseAmount']);
|
||||
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-g9-nondigital-preserved.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, ['listedServices' => 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-g9-nondigital-20261024/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?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 IvaServiceLocationDraftTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
public function test_service_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-g8-services.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:349', $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['serviceLocations']['opportunity:349'];
|
||||
$this->assertCount(10, $book['rows']);
|
||||
$this->assertSame(['general_service','general_service','immovable_service','immovable_service','movable_work','movable_work','activity_service','activity_service','transport_service','transport_service'],array_column($book['rows'],'treatment'));
|
||||
$this->assertSame(['national','outside','national','outside','national','outside','national','outside','national','outside'],array_column($book['result']['rows'],'territory'));
|
||||
foreach ($book['result']['rows'] as $row) {
|
||||
$this->assertNull($row['baseAmount']);$this->assertNull($row['vat']);$this->assertNull($row['rate']);
|
||||
}
|
||||
$this->assertSame($book['rows'], $book['result']['inputs']);
|
||||
$this->assertCount(1, $book['history']);
|
||||
$this->assertNull($book['history'][0]['rows'][0]['baseAmount']);
|
||||
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-g8-services-preserved.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, ['serviceLocations' => 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-g8-services-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
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,33 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import {newListedService,switchListedTreatment,listedServiceConditions,ownListedConditions,listedServiceTreatments,evaluateListedService,recordListedServices,saveListedServiceBook,listedServiceBook,listedServiceCurrent,listedServiceReportRows} from '../../resources/js/lib/iva-listed-services.ts';
|
||||
const frozen=JSON.parse(fs.readFileSync('tests/frontend/fixtures/iva-g9-nondigital-preserved.json','utf8'));
|
||||
const draft={...frozen,context_opportunity:'opportunity:350',project_title:'SYNTHETIC QA — G9 não digital / Manica'};
|
||||
function row(t,route='inbound') {const rule=listedServiceTreatments.find(x=>x.id===t);return {...newListedService(t+'-'+route),treatment:t,description:'SYNTHETIC QA '+rule.branch+' '+route,period:'2026-12',origin:'projected',operationDate:'2026-12-12',operationRef:'SYNTHETIC QA operação',documentRef:'SYNTHETIC QA documento/pressuposto',documentDate:'2026-12-12',scope:'SYNTHETIC QA operação/serviço/dezembro2026',evidence:'SYNTHETIC QA pressupostos expressos',providerPlace:'SYNTHETIC QA estabelecimento prestador',providerCountry:route==='inbound'?'foreign':'MZ',providerRef:'SYNTHETIC QA referência estabelecimento prestador',buyerPlace:'SYNTHETIC QA adquirente EP/domicílio',buyerCountry:route==='outbound'?'foreign':'MZ',buyerRef:'SYNTHETIC QA referência adquirente',recipientType:'a',recipientRef:'SYNTHETIC QA SP2(1)a,inclui actividade exclusivamente isenta sem dedução',providerTaxable:'yes',providerTaxRef:'SYNTHETIC QA SPprestador',subjectRef:'SYNTHETIC QA objecto próprio '+rule.branch,useRef:'SYNTHETIC QA destinatário/utilização e âmbito',targetClause:'a',targetRef:'SYNTHETIC QA relação comdireito6(7)a',conditions:Object.fromEntries([...listedServiceConditions,...ownListedConditions(t)].map(([key])=>[key,'yes']))};}
|
||||
for(const rule of listedServiceTreatments)test(rule.branch+' ownnature,three routes,quality and no deduction prerequisite',()=>{
|
||||
for(const route of ['inbound','outbound','domestic']){
|
||||
const r=row(rule.id,route),result=evaluateListedService(r);assert.equal(result.status,'determined');assert.equal(result.territory,route==='outbound'?'outside':'national');assert.equal(result.responsible,route==='outbound'?'outside':route==='inbound'?'acquirer':'provider');assert.deepEqual(['baseAmount','vat','rate'].map(k=>result[k]),[null,null,null]);
|
||||
for(const [key] of [...listedServiceConditions,...ownListedConditions(rule.id)]){const missing=structuredClone(r);delete missing.conditions[key];assert.equal(evaluateListedService(missing).status,'indeterminate');missing.conditions[key]='no';assert.equal(evaluateListedService(missing).status,'not_applicable');assert.equal(evaluateListedService(missing).territory,null);}
|
||||
for(const field of ['operationRef','documentRef','scope','evidence','subjectRef','useRef','buyerRef','buyerPlace','buyerCountry'])assert.equal(evaluateListedService({...r,[field]:''}).status,'indeterminate',field);
|
||||
assert.equal(evaluateListedService({...r,operationDate:'2026-11-12'}).status,'indeterminate');assert.equal(evaluateListedService({...r,documentDate:'2026-02-30'}).status,'indeterminate');assert.equal(evaluateListedService({...r,period:'2025-12'}).status,'indeterminate');
|
||||
}
|
||||
const r=row(rule.id);for(const field of ['providerCountry','providerPlace','providerRef','recipientType','recipientRef'])assert.equal(evaluateListedService({...r,[field]:''}).status,'indeterminate',field);
|
||||
assert.equal(evaluateListedService({...r,recipientType:'b'}).responsible,'acquirer');assert.equal(evaluateListedService({...r,recipientType:'other'}).status,'not_applicable');
|
||||
assert.equal(evaluateListedService({...r,deductionRight:'no',exemptOnly:'yes'}).territory,'national');assert.match(evaluateListedService(r).obligationReason,/23\(2\)/);assert.match(evaluateListedService(r).obligationReason,/Não se aplica26\(4\)/);
|
||||
const domestic=row(rule.id,'domestic');assert.equal(evaluateListedService({...domestic,recipientType:'',recipientRef:''}).responsible,'provider');assert.equal(evaluateListedService({...domestic,providerTaxable:''}).territory,'national');assert.equal(evaluateListedService({...domestic,providerTaxable:''}).responsible,'indeterminate');
|
||||
const outbound=row(rule.id,'outbound');assert.equal(evaluateListedService({...outbound,providerCountry:'',providerPlace:'',providerRef:'',recipientType:''}).territory,'outside');assert.match(evaluateListedService(outbound).reason,/6\(8\)/);
|
||||
});
|
||||
test('P118/P119 require identified underlying service/right and preserve hidden references',()=>{
|
||||
for(const t of ['intermediation_service','abstention_service']){const r=row(t);for(const targetClause of ['',t==='intermediation_service'?'h':'i','k','aa'])assert.equal(evaluateListedService({...r,targetClause}).status,'indeterminate');assert.equal(evaluateListedService({...r,targetRef:''}).status,'indeterminate');}
|
||||
const r=row('intermediation_service');const next=switchListedTreatment(r,'advertising_service');assert.equal(next.targetRef,r.targetRef);assert.equal(next.recipientRef,r.recipientRef);assert.equal(next.conditions.advertisingNature,undefined);next.conditions.advertisingNature='yes';assert.equal(evaluateListedService({...next,targetClause:'',targetRef:''}).status,'determined');
|
||||
});
|
||||
test('Ten branches persist together with previous books,immutable history and report',()=>{
|
||||
const rows=listedServiceTreatments.flatMap(t=>['inbound','outbound','domestic'].map(route=>row(t.id,route)));
|
||||
let book=recordListedServices(draft,{rows});book=recordListedServices(draft,book);assert.equal(book.history.length,1);assert.notEqual(book.result.inputs,book.rows);
|
||||
const next={...draft,modelo_a_snapshot:saveListedServiceBook(draft,book)};assert.deepEqual(listedServiceBook(next),book);assert.ok(listedServiceCurrent(next,book));assert.equal(listedServiceCurrent({...next,context_opportunity:'other'},book),false);assert.equal(listedServiceCurrent({...next,currency:'USD',customer_nationality:'foreign'},book),true);
|
||||
assert.equal(listedServiceReportRows(next).length,30);for(const t of listedServiceTreatments)assert.ok(listedServiceReportRows(next).some(r=>r[1].includes(t.branch)));assert.ok(listedServiceReportRows(next).some(r=>r[2].includes('responsável: Adquirente')));
|
||||
const store=JSON.parse(next.modelo_a_snapshot);delete store.listedServices;assert.deepEqual(store,JSON.parse(frozen.modelo_a_snapshot));
|
||||
assert.throws(()=>recordListedServices(next,{rows:[rows[0],rows[0]]}));assert.throws(()=>listedServiceBook({...next,modelo_a_snapshot:JSON.stringify({...JSON.parse(next.modelo_a_snapshot),listedServices:[]})}));
|
||||
if(process.env.IVA_G9_FIXTURE)fs.writeFileSync(process.env.IVA_G9_FIXTURE,JSON.stringify(next,null,2)+'\n');
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import {newServiceLocation,switchServiceTreatment,serviceLocationConditions,ownServiceConditions,serviceLocationTreatments,evaluateServiceLocation,recordServiceLocations,saveServiceLocationBook,serviceLocationBook,serviceLocationCurrent,serviceLocationReportRows} from '../../resources/js/lib/iva-service-location.ts';
|
||||
const frozen=JSON.parse(fs.readFileSync('tests/frontend/fixtures/iva-g8-services-preserved.json','utf8'));
|
||||
const draft={...frozen,context_opportunity:'opportunity:349',project_title:'SYNTHETIC QA — G8 services / Manica'};
|
||||
function row(t,country='MZ') {return {...newServiceLocation(t+'-'+country),treatment:t,description:'SYNTHETIC QA serviço',period:'2026-12',origin:'projected',operationDate:'2026-12-12',operationRef:'SYNTHETIC QA operação',documentRef:'SYNTHETIC QA documento/pressuposto',documentDate:'2026-12-12',scope:'SYNTHETIC QA operação/serviço/dezembro2026',evidence:'SYNTHETIC QA pressupostos expressos',servicePlace:'SYNTHETIC QA local material',placeCountry:country,placeRef:'SYNTHETIC QA referência local',providerPlace:'SYNTHETIC QA estabelecimento prestador',providerCountry:country,providerRef:'SYNTHETIC QA referência estabelecimento',subjectRef:'SYNTHETIC QA imóvel/bens/actividade',totalDistance:'100.50',nationalDistance:country==='MZ'?'80.25':'0',departure:country,arrival:country,routeRef:'SYNTHETIC QA trajecto individual',conditions:Object.fromEntries([...serviceLocationConditions,...ownServiceConditions(t)].map(([key])=>[key,'yes']))};}
|
||||
for(const treatment of serviceLocationTreatments)test(treatment.branch+' facts,own guards and territorial direction',()=>{
|
||||
for(const country of ['MZ','foreign']){
|
||||
const r=row(treatment.id,country);const expected=country==='MZ'?'national':'outside';assert.equal(evaluateServiceLocation(r).territory,expected);
|
||||
assert.deepEqual(['baseAmount','vat','rate'].map(k=>evaluateServiceLocation(r)[k]),[null,null,null]);
|
||||
if(treatment.id!=='general_service'){r.providerCountry=country==='MZ'?'foreign':'MZ';assert.equal(evaluateServiceLocation(r).territory,expected);}
|
||||
for(const [key] of [...serviceLocationConditions,...ownServiceConditions(treatment.id)]){const missing=structuredClone(r);delete missing.conditions[key];assert.equal(evaluateServiceLocation(missing).status,'indeterminate');missing.conditions[key]='no';assert.equal(evaluateServiceLocation(missing).status,'not_applicable');assert.equal(evaluateServiceLocation(missing).territory,null);}
|
||||
for(const field of ['operationRef','documentRef','scope','evidence',...(treatment.id==='general_service'?['providerPlace','providerCountry','providerRef']:treatment.id==='transport_service'?['routeRef','totalDistance','nationalDistance','departure','arrival']:['servicePlace','placeCountry','placeRef','subjectRef'])])assert.equal(evaluateServiceLocation({...r,[field]:''}).status,'indeterminate',field);
|
||||
assert.equal(evaluateServiceLocation({...r,operationDate:'2026-11-12'}).status,'indeterminate');assert.equal(evaluateServiceLocation({...r,documentDate:'2026-02-30'}).status,'indeterminate');assert.equal(evaluateServiceLocation({...r,period:'2025-12'}).status,'indeterminate');
|
||||
}
|
||||
});
|
||||
test('Four branches persist together,history,scope,hidden retention and previous books',()=>{
|
||||
const rows=serviceLocationTreatments.flatMap(t=>['MZ','foreign'].map(c=>row(t.id,c)));
|
||||
let book=recordServiceLocations(draft,{rows});book=recordServiceLocations(draft,book);assert.equal(book.history.length,1);
|
||||
const next={...draft,modelo_a_snapshot:saveServiceLocationBook(draft,book)};assert.deepEqual(serviceLocationBook(next),book);assert.ok(serviceLocationCurrent(next,book));assert.equal(serviceLocationCurrent({...next,context_opportunity:'other'},book),false);
|
||||
assert.equal(serviceLocationCurrent({...next,currency:'USD',customer_country:'foreign'},book),true);
|
||||
assert.equal(serviceLocationReportRows(next).length,10);for(const t of serviceLocationTreatments)assert.ok(serviceLocationReportRows(next).some(r=>r[1].includes(t.branch)));
|
||||
const store=JSON.parse(next.modelo_a_snapshot);delete store.serviceLocations;assert.deepEqual(store,JSON.parse(frozen.modelo_a_snapshot));
|
||||
const switched=switchServiceTreatment(rows[0],'immovable_service');assert.equal(switched.providerRef,rows[0].providerRef);assert.equal(switched.servicePlace,rows[0].servicePlace);assert.equal(switched.conditions.propertyRelation,undefined);assert.equal(evaluateServiceLocation(switched).status,'indeterminate');
|
||||
const corrupt={...next,modelo_a_snapshot:JSON.stringify({...JSON.parse(next.modelo_a_snapshot),serviceLocations:[]})};assert.throws(()=>serviceLocationBook(corrupt));assert.throws(()=>recordServiceLocations(next,{rows:[rows[0],rows[0]]}));
|
||||
if(process.env.IVA_G8_SERVICES_FIXTURE)fs.writeFileSync(process.env.IVA_G8_SERVICES_FIXTURE,JSON.stringify(next,null,2)+'\n');
|
||||
});
|
||||
test('P110 domestic deemed distance,mixed route,zero,invalid and exact distances',()=>{
|
||||
const r=row('transport_service');assert.equal(evaluateServiceLocation(r).territory,'national');
|
||||
assert.equal(evaluateServiceLocation({...r,arrival:'foreign'}).territory,'partial');
|
||||
assert.equal(evaluateServiceLocation({...r,arrival:'foreign',nationalDistance:'0'}).territory,'outside');
|
||||
assert.equal(evaluateServiceLocation({...r,arrival:'foreign',nationalDistance:r.totalDistance}).territory,'national');
|
||||
for(const patch of [{totalDistance:'0'},{nationalDistance:'101'},{nationalDistance:'-1'},{totalDistance:'1e3'},{totalDistance:'1,5'},{departure:''},{arrival:''}])assert.equal(evaluateServiceLocation({...r,...patch}).status,'indeterminate');
|
||||
assert.equal(evaluateServiceLocation({...r,arrival:'foreign',nationalDistance:'0.000001',totalDistance:'999999999999999999.123456'}).territory,'partial');
|
||||
assert.match(evaluateServiceLocation(r).reason,/08\/06\/2017/);assert.match(evaluateServiceLocation(r).reason,/Ida e volta/);
|
||||
});
|
||||
Reference in New Issue
Block a user