Compare commits
4
Commits
e62b7dfdc2
...
df7cb7fa47
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df7cb7fa47 | ||
|
|
287f2f8321 | ||
|
|
4672789f2b | ||
|
|
15894f4b04 |
@@ -16554,5 +16554,307 @@
|
||||
},
|
||||
"base_VAT_separation": "Accepted QA proofs reused:baseAmount independent from vat/rate(alwaysnull),references/inputs/version/history/report preserved. Exact four installed runtime hashes and compiled component/ledger/report markers checked;no synthetic write or repeated acceptance tests in active.",
|
||||
"activation": "Normal Git fast-forward/webhook/installer;zero migrations/imports"
|
||||
},
|
||||
"iva_l1_g7b_P091_homologation_20261024": {
|
||||
"status": "installed_delta_verified_partial_L1",
|
||||
"candidate": "9bd2e062f427155a9877abc14876183ff4b7d9e0",
|
||||
"base_installed": "4193056bdd69b48cf61c25a9a7404af4f0957f3c",
|
||||
"coverage_complete_branches": {
|
||||
"AUD-SIM-L1-P091": [
|
||||
"commission_sale_transfer",
|
||||
"commission_purchase_transfer"
|
||||
]
|
||||
},
|
||||
"branch_count_complete": 1,
|
||||
"treatment_count": 2,
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-commission-base.ts",
|
||||
"sha256_LF": "3be1331f4da40e6292fa7f5dcfba28355af6d931a7d24f44eb081c6f16c8efb2"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-commission-base.tsx",
|
||||
"sha256_LF": "5bfbb95d2dd22106d7d416fd3af0f7ae0778f22ae9d23da15ba9dd45882cfc94"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-monthly-iva.tsx",
|
||||
"sha256_LF": "16c95f5eaf5d5a308c93b30523292e52ccafed9d4e7f897f8559459116fbf4ae"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "945a9e2a4a9aa6a26f7108f95d4fd237c0551dbf884cec41bcaa3eba592acc4a"
|
||||
}
|
||||
],
|
||||
"counts_before": {
|
||||
"delivered": 79,
|
||||
"QA": 1,
|
||||
"functional_pending": 52,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 80,
|
||||
"QA": 0,
|
||||
"functional_pending": 52,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_delivery": {
|
||||
"delivered": 80,
|
||||
"QA": 0,
|
||||
"functional_pending": 52,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"QA_proofs_reused": [
|
||||
"iva-l1-g7b-qa-20261024.json"
|
||||
],
|
||||
"authorization": "Tempo explicitly deploy9bd2e062 through existingGit,preserve concurrentchanges and check installeddelta only;two treatments sameP091branch,base remains separate fromVAT",
|
||||
"scope": "P091only,commission_sale_transfer/commission_purchase_transfer;saleprice-minuscommission/purchaseprice-pluscommission,principal/agent/contract/price/commission/compositionreferences in immutable result.inputs/report;vat/rate alwaysnull,no incidence/tax/deduction/field11/ModeloAtotals inferred",
|
||||
"preservation": "79priorclosures and partialP084/P085 preserved;acceptedQA reused;freshbackup/realisolatedrestore beforeinstallation;installeddelta only;P060decision/list/plan/scope andproportionalresults,P056authorization,P050serviceVAT preserved",
|
||||
"partial_P084_P085": "Already available for preparation/conditional simulation only,benefits pending;no closure in this release",
|
||||
"limits": "L1open;P00105/06;beveragesL2/L3;Statistics/AIdeferred;L1closuredoesnotrequireL2/L3/alltaxes",
|
||||
"containment": "l1-g7b-readonly-rollback-20261024.patch,checked only,not applied;blocks newP091calculations only,preserves readers/history andotherbranches",
|
||||
"authenticated_preflight": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "4193056bdd69b48cf61c25a9a7404af4f0957f3c",
|
||||
"release": "/var/www/investmoz-homologacao/releases/4193056bdd69b48cf61c25a9a7404af4f0957f3c-c2452b39",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/eb9294ef42c2cfc97eb8c2553d545e3bff7c0add-08cf86ab",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/4193056bdd69b48cf61c25a9a7404af4f0957f3c-c2452b39",
|
||||
"release_revision": {
|
||||
"commit": "4193056bdd69b48cf61c25a9a7404af4f0957f3c",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T19:52:03.661019+00:00",
|
||||
"manifest_sha256": "7c9c5a728ad2afa1157a4a74a013dce1538a915f080d74790052655030582884"
|
||||
},
|
||||
"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-g7b-delivery-20261024/backup",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "14910f7a6372948985ca3e0d6deddca5e079e015c7554cdb46d4a150c4b0a204",
|
||||
"files_sha256": "09e56a62d74f60773bb9da0da520ddafa790f39489a2f8335ebb9d949ae0445a",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "l1_g7b_restore_20261024",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "14910f7a6372948985ca3e0d6deddca5e079e015c7554cdb46d4a150c4b0a204",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
},
|
||||
"served_commit": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"installation": {
|
||||
"protected": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"release": "/var/www/investmoz-homologacao/releases/e62b7dfdc25f7c12425e89cea26f7ccf67b7d177-c1e20222",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/4193056bdd69b48cf61c25a9a7404af4f0957f3c-c2452b39",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"runtime_files_verified": 4,
|
||||
"persistent_files_and_env_verified": 369,
|
||||
"tables_compared": 174,
|
||||
"changed_tables": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 105,
|
||||
"checksum": "828efdd2e464a169de683e0bc582767b"
|
||||
},
|
||||
"after": {
|
||||
"rows": 105,
|
||||
"checksum": "3d23e6ba4ed2476e65e0bf3687da774e"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 56,
|
||||
"checksum": "28841e1b889560d2d78d41b0464e83e4"
|
||||
},
|
||||
"after": {
|
||||
"rows": 57,
|
||||
"checksum": "2a2fd7e26ccced1b89fdd0d497b3036b"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T20:15:27.726611+00:00",
|
||||
"manifest_sha256": "dccf1e8a2fabf42a877cac166b5821548af5a6e6cfbf2c8578afebb70468c531"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"commission-goods-base/1": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"commission_sale_transfer": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"commission_purchase_transfer": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"commissionBases": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"taxableDomesticGoods": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"commissionContract": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"directionConfirmed": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"notSpecialAuction": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"agreedPrice": [
|
||||
"assets/project-dossier-C03JDnMc.js",
|
||||
"assets/services-BQD7ago3.js"
|
||||
],
|
||||
"commissionAmount": [
|
||||
"assets/project-dossier-C03JDnMc.js",
|
||||
"assets/services-BQD7ago3.js"
|
||||
],
|
||||
"agreementRef": [
|
||||
"assets/project-dossier-C03JDnMc.js",
|
||||
"assets/services-BQD7ago3.js"
|
||||
],
|
||||
"priceRef": [
|
||||
"assets/project-dossier-C03JDnMc.js",
|
||||
"assets/services-BQD7ago3.js"
|
||||
],
|
||||
"commissionRef": [
|
||||
"assets/project-dossier-C03JDnMc.js",
|
||||
"assets/services-BQD7ago3.js"
|
||||
],
|
||||
"IVA: Indeterminado": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/simulation-form-CPZAFZU3.js",
|
||||
"status": 200,
|
||||
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-C03JDnMc.js",
|
||||
"status": 200,
|
||||
"sha256": "6afe3105603d2d99eb6c1f10ac0478425ac7edbea306ead42900e8d7752526da"
|
||||
},
|
||||
{
|
||||
"file": "assets/services-BQD7ago3.js",
|
||||
"status": 200,
|
||||
"sha256": "dba6c2c3a511902395f1798e5b03083e4413a5aaa530e3e408e716edd614af93"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-B6GsDYYK.js",
|
||||
"status": 200,
|
||||
"sha256": "083e27ff6b3262e988de1dfcf8ea7f90bf5ea5f06b9a36afeb1cde1bff36e4b8"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-BAqBGTCO.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": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"release": "/var/www/investmoz-homologacao/releases/e62b7dfdc25f7c12425e89cea26f7ccf67b7d177-c1e20222",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/4193056bdd69b48cf61c25a9a7404af4f0957f3c-c2452b39",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"release": "/var/www/investmoz-homologacao/releases/e62b7dfdc25f7c12425e89cea26f7ccf67b7d177-c1e20222",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/4193056bdd69b48cf61c25a9a7404af4f0957f3c-c2452b39",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"e62b7dfdc25f7c12425e89cea26f7ccf67b7d177"
|
||||
],
|
||||
"finished_at": "2026-10-24T20:15:30.463596+00:00"
|
||||
},
|
||||
"log_file": "1792872831592310207.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 25.87s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 350",
|
||||
"# pass 350",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 131096
|
||||
},
|
||||
"rollback_executed": false
|
||||
},
|
||||
"base_VAT_separation": "Accepted QA reused:saleprice minuscommission/purchaseprice pluscommission,baseAmount independentfromvat/rate(alwaysnull),immutable references/inputs/version/history/report retained. Exact four installed runtime hashes and compiled ledger/component/report markers verified;no synthetic activewrite.",
|
||||
"activation": "Normal Git fast-forward/webhook/installer;zero migrations/imports"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"implementation_commit": "948621a65caf1395230bfed3ddfab59e94cddda0",
|
||||
"status": "QA_complete_not_delivered",
|
||||
"status": "delivered_with_QA_proofs_preserved",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P091": [
|
||||
"commission_sale_transfer",
|
||||
@@ -152,5 +152,18 @@
|
||||
"homologation_unchanged": "4193056b",
|
||||
"remaining": "Integrate/deliver by existingGit withmanifest,freshbackup/realisolatedrestore andinstalleddelta;no pushinQAtask",
|
||||
"limits": "P084/P085partial,pending;P00105/06;L1open;beveragesL2/L3;Statistics/AIdeferred",
|
||||
"sources_inventory": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g7b-commissions-20261024\\source-archive-inventory.json"
|
||||
"sources_inventory": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g7b-commissions-20261024\\source-archive-inventory.json",
|
||||
"qa_status_preserved": "QA_complete_not_delivered",
|
||||
"delivery_followup": {
|
||||
"served_commit": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"receipt": "l1-g7b-delivery-20261024.json",
|
||||
"record": "iva_l1_g7b_P091_homologation_20261024",
|
||||
"counts": {
|
||||
"delivered": 80,
|
||||
"QA": 0,
|
||||
"functional_pending": 52,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
{
|
||||
"implementation_commit": "4672789f2bf1fcce0726936e9e5bec05fb18c448",
|
||||
"status": "QA_complete_not_delivered",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P094": [
|
||||
"act_sale_amount",
|
||||
"act_normal_value"
|
||||
]
|
||||
},
|
||||
"branch_count": 1,
|
||||
"treatment_count": 2,
|
||||
"source": "CIVA15(2)(h),Lei13/2016PDF13/p1426(271);15(4)/(5)/(6)PDF14/p1426(272). Lei22/2022PDF3maintains15h/4–6 by remissão;Lei10/2025doesnotamend15. Rectificação2017doesnotamend15h.",
|
||||
"meaning": "Goods transferred as result of auction,judicial/administrative sale,conciliation or settlement;value at which auction/sale effected or,where applicable,normal value. Five act kinds are contexts,not five branches. No automatic lower value or normal-value fallback.",
|
||||
"technical_choices": "New opportunity-scoped actSaleBases book in existing modelo_a_snapshot/API/dossier;no schema/permissions change. Chosen net value and composition references,up to6fractiondigits exactly preserved,no assumed fiscal rounding. Changing act/valuation retains both values/documents and clears corresponding applicability confirmation as integrity choice,not new organizational requirement. Reuse existing documents or explicit projection assumptions;no invented certificate,appraiser or approver.",
|
||||
"scope": "2026/MZN,P094baseonly;normal value supplied with identified basis/scope,not appraised automatically. No incidence,rate,VAT,deduction/field11/ModeloAtotals or substitution of special auctioncommission15g. Unknown values remain indeterminate,explicit zero distinguished.",
|
||||
"verification": {
|
||||
"frontend": {
|
||||
"tests": 4,
|
||||
"passed": 4,
|
||||
"failed": 0,
|
||||
"scope": "All5actkinds and2valuations;ownconditions missing/no;references/date/currency;no minimum/fallback;exactdecimal/zero;switch retention/cleared confirmation;context/history;corruptwriteguard;old books/currentkeys preserved;report"
|
||||
},
|
||||
"privateAPI": {
|
||||
"tests": 1,
|
||||
"assertions": 28,
|
||||
"target": "simulator_fiscal_delta_20261021_test:55441",
|
||||
"transaction_rollback": true,
|
||||
"xml": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g7c-act-bases-20261024\\api-tests.xml"
|
||||
},
|
||||
"types": "passed",
|
||||
"build": "passed,existing plugin timing warnings",
|
||||
"UI": "Realcomponent Edge/CUA:missing applicability and valuation reference yield indeterminate;switch to normal retains2200.50;confirming yields2200.50 instead of1500.25;specialauction condition no yields notapplicable/noIVAzero;finalact1500.25/normal2200.50,VATnull;save/recover/report2rows+5priorversions. Synthetic QA,not manual Tempo acceptance.",
|
||||
"UI_screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g7c-act-bases-20261024\\qa-recovered-report.png"
|
||||
},
|
||||
"preservation": {
|
||||
"base": "15894f4b0493423fda5edde7d016a270fd137a30",
|
||||
"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-P090",
|
||||
"AUD-SIM-L1-P091"
|
||||
],
|
||||
"confirmed_losses": [],
|
||||
"accepted_delivery": "e62b7dfd/15894f4b;174tables/369files;29published/28relations/408geometries;code/schema/data/config/permissions checked at delivery",
|
||||
"frozen": "tests\\frontend\\fixtures\\iva-g7c-preserved-inputs.json",
|
||||
"sha256": "2ffcdb0f42ac1011aa29fde5b72532c99a3c75210e754442e38af587489d542c",
|
||||
"counts_before": {
|
||||
"delivered": 80,
|
||||
"QA": 0,
|
||||
"functional_pending": 52,
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
},
|
||||
"scope": "P094only;preserve P091directions/references/baseVAT,P090,P060scope,P056,P050,partialP084P085;no active query/write"
|
||||
},
|
||||
"runtime_delta": {
|
||||
"resources/js/lib/iva-act-sale-base.ts": "ed555c826427a0964995144c59d4e801bfeebce5219a63a612f31bb977788d00",
|
||||
"resources/js/components/simulation-act-sale-base.tsx": "384e17aa18ed5ed9a8c6c47773577e87f211c2bccb3acbe3943269a08de1485a",
|
||||
"resources/js/components/simulation-monthly-iva.tsx": "3b2a24fde6db625c350f7366ec789b5aa7e86aa08645409203b5e96d02dc1ff3",
|
||||
"resources/js/lib/project-dossier.ts": "852ceaf59b95d92ff57d3b711dc2bc13eb4b547e7d9f1516eb543ece83247c09"
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 80,
|
||||
"QA": 1,
|
||||
"functional_pending": 51,
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
},
|
||||
"homologation_unchanged": "e62b7dfd",
|
||||
"remaining": "Integrate/deliver through existingGit withmanifest,freshbackup/real isolatedrestore and installeddelta;no push in QA task",
|
||||
"limits": "P084/P085partial,pending;P00105/06;L1open;beveragesL2/L3;Statistics/AIdeferred",
|
||||
"sources_inventory": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g7c-act-bases-20261024\\source-archive-inventory.json"
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
|
||||
"status": "installed_delta_verified_partial_L1",
|
||||
"candidate": "9bd2e062f427155a9877abc14876183ff4b7d9e0",
|
||||
"base_installed": "4193056bdd69b48cf61c25a9a7404af4f0957f3c",
|
||||
"coverage_complete_branches": {
|
||||
@@ -36,8 +36,8 @@
|
||||
"total": 133
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 79,
|
||||
"QA": 1,
|
||||
"delivered": 80,
|
||||
"QA": 0,
|
||||
"functional_pending": 52,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
@@ -122,5 +122,181 @@
|
||||
"source_dump_sha256": "14910f7a6372948985ca3e0d6deddca5e079e015c7554cdb46d4a150c4b0a204",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"served_commit": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"installation": {
|
||||
"protected": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"release": "/var/www/investmoz-homologacao/releases/e62b7dfdc25f7c12425e89cea26f7ccf67b7d177-c1e20222",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/4193056bdd69b48cf61c25a9a7404af4f0957f3c-c2452b39",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"runtime_files_verified": 4,
|
||||
"persistent_files_and_env_verified": 369,
|
||||
"tables_compared": 174,
|
||||
"changed_tables": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 105,
|
||||
"checksum": "828efdd2e464a169de683e0bc582767b"
|
||||
},
|
||||
"after": {
|
||||
"rows": 105,
|
||||
"checksum": "3d23e6ba4ed2476e65e0bf3687da774e"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 56,
|
||||
"checksum": "28841e1b889560d2d78d41b0464e83e4"
|
||||
},
|
||||
"after": {
|
||||
"rows": 57,
|
||||
"checksum": "2a2fd7e26ccced1b89fdd0d497b3036b"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T20:15:27.726611+00:00",
|
||||
"manifest_sha256": "dccf1e8a2fabf42a877cac166b5821548af5a6e6cfbf2c8578afebb70468c531"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"commission-goods-base/1": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"commission_sale_transfer": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"commission_purchase_transfer": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"commissionBases": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"taxableDomesticGoods": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"commissionContract": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"directionConfirmed": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"notSpecialAuction": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
],
|
||||
"agreedPrice": [
|
||||
"assets/project-dossier-C03JDnMc.js",
|
||||
"assets/services-BQD7ago3.js"
|
||||
],
|
||||
"commissionAmount": [
|
||||
"assets/project-dossier-C03JDnMc.js",
|
||||
"assets/services-BQD7ago3.js"
|
||||
],
|
||||
"agreementRef": [
|
||||
"assets/project-dossier-C03JDnMc.js",
|
||||
"assets/services-BQD7ago3.js"
|
||||
],
|
||||
"priceRef": [
|
||||
"assets/project-dossier-C03JDnMc.js",
|
||||
"assets/services-BQD7ago3.js"
|
||||
],
|
||||
"commissionRef": [
|
||||
"assets/project-dossier-C03JDnMc.js",
|
||||
"assets/services-BQD7ago3.js"
|
||||
],
|
||||
"IVA: Indeterminado": [
|
||||
"assets/project-dossier-C03JDnMc.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/simulation-form-CPZAFZU3.js",
|
||||
"status": 200,
|
||||
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-C03JDnMc.js",
|
||||
"status": 200,
|
||||
"sha256": "6afe3105603d2d99eb6c1f10ac0478425ac7edbea306ead42900e8d7752526da"
|
||||
},
|
||||
{
|
||||
"file": "assets/services-BQD7ago3.js",
|
||||
"status": 200,
|
||||
"sha256": "dba6c2c3a511902395f1798e5b03083e4413a5aaa530e3e408e716edd614af93"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-B6GsDYYK.js",
|
||||
"status": 200,
|
||||
"sha256": "083e27ff6b3262e988de1dfcf8ea7f90bf5ea5f06b9a36afeb1cde1bff36e4b8"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-BAqBGTCO.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": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"release": "/var/www/investmoz-homologacao/releases/e62b7dfdc25f7c12425e89cea26f7ccf67b7d177-c1e20222",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/4193056bdd69b48cf61c25a9a7404af4f0957f3c-c2452b39",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"release": "/var/www/investmoz-homologacao/releases/e62b7dfdc25f7c12425e89cea26f7ccf67b7d177-c1e20222",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/4193056bdd69b48cf61c25a9a7404af4f0957f3c-c2452b39",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"e62b7dfdc25f7c12425e89cea26f7ccf67b7d177"
|
||||
],
|
||||
"finished_at": "2026-10-24T20:15:30.463596+00:00"
|
||||
},
|
||||
"log_file": "1792872831592310207.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 25.87s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 350",
|
||||
"# pass 350",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 131096
|
||||
},
|
||||
"rollback_executed": false
|
||||
},
|
||||
"base_VAT_separation": "Accepted QA reused:saleprice minuscommission/purchaseprice pluscommission,baseAmount independentfromvat/rate(alwaysnull),immutable references/inputs/version/history/report retained. Exact four installed runtime hashes and compiled ledger/component/report markers verified;no synthetic activewrite.",
|
||||
"activation": "Normal Git fast-forward/webhook/installer;zero migrations/imports"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
|
||||
"candidate": "287f2f8321038dc72ff8f0746526df0761a871d6",
|
||||
"base_installed": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"coverage_complete_branches": {
|
||||
"AUD-SIM-L1-P094": [
|
||||
"act_sale_amount",
|
||||
"act_normal_value"
|
||||
]
|
||||
},
|
||||
"branch_count_complete": 1,
|
||||
"treatment_count": 2,
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-act-sale-base.ts",
|
||||
"sha256_LF": "ed555c826427a0964995144c59d4e801bfeebce5219a63a612f31bb977788d00"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-act-sale-base.tsx",
|
||||
"sha256_LF": "384e17aa18ed5ed9a8c6c47773577e87f211c2bccb3acbe3943269a08de1485a"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-monthly-iva.tsx",
|
||||
"sha256_LF": "3b2a24fde6db625c350f7366ec789b5aa7e86aa08645409203b5e96d02dc1ff3"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "852ceaf59b95d92ff57d3b711dc2bc13eb4b547e7d9f1516eb543ece83247c09"
|
||||
}
|
||||
],
|
||||
"counts_before": {
|
||||
"delivered": 80,
|
||||
"QA": 1,
|
||||
"functional_pending": 51,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_current": {
|
||||
"delivered": 80,
|
||||
"QA": 1,
|
||||
"functional_pending": 51,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_delivery": {
|
||||
"delivered": 81,
|
||||
"QA": 0,
|
||||
"functional_pending": 51,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"QA_proofs_reused": [
|
||||
"iva-l1-g7c-qa-20261024.json"
|
||||
],
|
||||
"authorization": "Tempo explicitly deploy287f2f83 through existingGit,preserve concurrentchanges and check installeddelta only;two treatments sameP094branch",
|
||||
"scope": "2026/MZN,P094baseonly;normal value supplied with identified basis/scope,not appraised automatically. No incidence,rate,VAT,deduction/field11/ModeloAtotals or substitution of special auctioncommission15g. Unknown values remain indeterminate,explicit zero distinguished.",
|
||||
"meaning": "Goods transferred as result of auction,judicial/administrative sale,conciliation or settlement;value at which auction/sale effected or,where applicable,normal value. Five act kinds are contexts,not five branches. No automatic lower value or normal-value fallback.",
|
||||
"preservation": "80priorclosures and partialP084/P085 preserved;acceptedQA reused;freshbackup/realisolatedrestore beforeinstallation;installeddelta only",
|
||||
"partial_P084_P085": "Preparation/conditional simulation only,benefits pending;no closure",
|
||||
"limits": "P084/P085partial,pending;P00105/06;L1open;beveragesL2/L3;Statistics/AIdeferred",
|
||||
"containment": "l1-g7c-readonly-rollback-20261024.patch,checked only,not applied;blocks newP094calculations only,preserves readers/history/otherbranches",
|
||||
"authenticated_preflight": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"release": "/var/www/investmoz-homologacao/releases/e62b7dfdc25f7c12425e89cea26f7ccf67b7d177-c1e20222",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/4193056bdd69b48cf61c25a9a7404af4f0957f3c-c2452b39",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/e62b7dfdc25f7c12425e89cea26f7ccf67b7d177-c1e20222",
|
||||
"release_revision": {
|
||||
"commit": "e62b7dfdc25f7c12425e89cea26f7ccf67b7d177",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T20:15:27.726611+00:00",
|
||||
"manifest_sha256": "dccf1e8a2fabf42a877cac166b5821548af5a6e6cfbf2c8578afebb70468c531"
|
||||
},
|
||||
"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-g7c-delivery-20261024/backup",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "15851ca2ed235382c8acb325b154470e191d95c10d5c2dac8fa9be287132d024",
|
||||
"files_sha256": "af9076b5993550acd8aa55ac85a1112822f6db26f744247cfcc76d6f03ee7925",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "l1_g7c_restore_20261024",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "15851ca2ed235382c8acb325b154470e191d95c10d5c2dac8fa9be287132d024",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/resources/js/lib/iva-act-sale-base.ts
|
||||
+++ b/resources/js/lib/iva-act-sale-base.ts
|
||||
@@ -47,6 +47,7 @@
|
||||
function key(draft:Record<string,unknown>,book:ActSaleBook):string{return JSON.stringify({version:actSaleBaseVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},currency:draft.currency,rows:book.rows});}
|
||||
export function actSaleCurrent(draft:Record<string,unknown>,book:ActSaleBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);}
|
||||
export function recordActSaleBases(draft:Record<string,unknown>,book:ActSaleBook):ActSaleBook{
|
||||
+ throw new Error('Novas bases P094 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:ActSaleCalculation={version:actSaleBaseVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:actSaleBaseSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateActSale(row,draft.currency))};
|
||||
const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveActSaleBook(draft,next);return next;
|
||||
@@ -1,6 +1,38 @@
|
||||
# Rastreabilidade, utilização e formação
|
||||
|
||||
|
||||
## 24/10/2026 — G7C/P094 concluído emQA:transmissões por acto
|
||||
|
||||
Implementação`4672789f`. **Um ramo,dois tratamentos**:`act_sale_amount`(valor da arrematação/venda efectuada) e`act_normal_value`(valor normal quando aplicável). FonteCIVA15(2)(h),Lei13/2016PDF13/p1426(271),15(4)/(5)/(6)PDF14/p1426(272);Lei22/2022PDF3mantém15h/4–6 por remissão;Lei10/2025não altera15. Arrematação,venda judicial,venda administrativa,conciliação e contrato de transacção são cinco naturezas do acto dentro do ramo,não cinco fechos. Identificar a transmissão dos bens,acto,fundamento e âmbito da valorização,composição semIVA e documentos ou pressupostos expressos;um pagamento/acordo genérico não prova transmissão sujeita.
|
||||
|
||||
O portal usa apenas o valor correspondente ao tratamento escolhido,sem escolher o menor valor,substituir montante desconhecido por valor normal ou avaliar automaticamente os bens. Desconhecido é indeterminado;zero só expresso. Decimal exacto até6casas,sem arredondamento fiscal presumido. Base separada de incidência/taxa/IVA/dedução/campo11/totaisModeloA;regra especial do organizador de leilão em comissão15g não substituída. LivroactSaleBases por oportunidade no snapshot/API/dossier existentes,sem schema/permissões novos. Mudar acto ou valorização conserva ambos os montantes/documentos e limpa as confirmações correspondentes;escolha técnica de integridade,não regra organizacional. Reutilizar referências existentes,sem criar certificados,avaliadores ou aprovadores.
|
||||
|
||||
Provas do delta:**4testes frontend**,**APIprivada1teste/28asserções**,guarda`simulator_fiscal_delta_20261021_test:55441` e rollback;tipos/build passaram. Interface real Edge/CUA:condição/fundamento em falta→indeterminado;troca para normal conserva2200.50 e exige confirmação;confirmado usa2200.50 mesmo com1500.25conservado;leilão especial→não aplicação desta base,não isenção/IVAzero. Gravação recuperada e relatório:1500.25/2200.50,IVAindeterminado,2linhas/5versões anteriores. Dados sintéticos,não aceitação manual atribuída à Tempo.80fechos/livros/resultados/históricos intactos,incluindoP091/P090,P060/P056/P050 eP084/P085parciais;provas anteriores reutilizadas. [RegistoQA](../simulations/iva-l1-g7c-qa-20261024.json).
|
||||
|
||||
**80entregues +1emQA(P094) +51funcionaispendentes +P001 =133**. Homologação permanece`e62b7dfd`;falta integração/entrega pelo processoGit,manifesto/backup/restauro e delta instalado. P084/P085 continuam nos51,apenas preparação/simulação condicionada,sem benefícios confirmados. L1aberto;P00105/06;bebidasL2/L3;Estatísticas/IAadiadas.
|
||||
|
||||
|
||||
|
||||
## 24/10/2026 — preparação G7C/P094,inventário antes de testes
|
||||
|
||||
G7B/P091 aceitee62b7dfd/15894f4b;**80entregues+52funcionaispendentes+P001=133**. Inventariados80fechos,sem perdas confirmadas;provas instaladas código/schema/dados/configuração/permissões174tabelas/369ficheiros/29fichas/28relações/408geometrias reutilizadas. Congelados livros/resultados/históricos,P091(sentidos/referências/baseIVA),P090,P060(despacho/lista/plano/âmbito/redução),P056(autorização),P050(IVAserviço),P084/P085parciais. Sem repetir aceitação anterior ou ensaiar no activo.
|
||||
|
||||
G7C/P094 executa alínea documentada independente:CIVA15(2)(h),2016PDF13/p1426(271),transmissões de bens resultantes de arrematação,venda judicial/administrativa,conciliação ou contratos de transacção. Base=valor por que arrematação/venda foi efectuada ou,se for caso,valor normal dos bens.15(4)/(5)/(6),PDF14/p1426(272),normal/composição/exclusões,sem próprioIVA.2022PDF3mantémh por remissão,2025não altera15;rectificação2017 não altera15h. Fontes oficiais/exemplares/inventários aceites,cotejo visual com skillPDF. Não substituir leilão em comissão15g nem transformar pagamento/acordo genérico em transmissão sujeita.
|
||||
|
||||
Dois tratamentos de valorização no mesmo ramo,sem duplicar os cinco tipos de acto em fechos. Valor normal depende de fundamento/âmbito aplicável,não opção automática pelo menor valor nem avaliação automática/certificado/aprovador novo. Montantes semIVA documentados/assumidos;desconhecido não é zero. Mudança de acto/fundamento conserva montantes/documentos,mas limpa as confirmações afectadas para rever correspondência,escolha técnica de integridade. Base separada de incidência/taxa/IVA/dedução/campo11/totaisModeloA. Livro por oportunidade no snapshot/API/relatório existentes,sem migração/permissões. L1aberto;P00105/06;bebidasL2/L3;P084/P085parciais;Estatísticas/IAadiadas.
|
||||
|
||||
|
||||
|
||||
## 24/10/2026 — G7B/P091 entregue,venda menos comissão e compra mais comissão
|
||||
|
||||
Homologação **`e62b7dfd`**,pelo processoGit existente,sobre`4193056b`;candidata`9bd2e062` expressamente aceite pela Tempo. **P091:um ramo,dois tratamentos**,`commission_sale_transfer` e`commission_purchase_transfer`. Comitente→comissário:preço de venda acordado pelo comissário−comissão;comissário→comitente:preço de compra acordado pelo comissário+comissão. Valores semIVA,antes do único ajuste;comitente,comissário,contrato,preço,comissão e composição referenciados nas entradas imutáveis do resultado,histórico e relatório. Mudança de sentido conserva dados/referências e exige rever confirmação dos papéis/preço correspondentes. Desconhecido não é zero;diferença negativa identificada,sem pisozero/absoluto/base fiscal presumidos neste recorte. Base separada de incidência/taxa/IVA(IVA/taxa permanecemnull),serviço autónomo,dedução/campo11/totaisModeloA;regra especial de leilão não substituída. Livros anteriores não são alterados nem base somada como imposto.
|
||||
|
||||
Destino e main conferidos novamente;sem avanço concorrente encontrado. SessãoSSH autenticada existente reutilizada,sem guardar credenciais. Backup novo e restauro real isolado sem rede:**174tabelas e369ficheiros/configuração**. ProvasQA aceites reutilizadas;conferido apenas delta instalado:revisão servida,manifesto/hash,14marcadores compilados do livro/componente/relatório,sentidos e referências,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çãoP091 conferida,não aplicada,leitores/históricos e restantes ramos preservados.
|
||||
|
||||
[Manifesto/recibo](../simulations/l1-g7b-delivery-20261024.json),registo`iva_l1_g7b_P091_homologation_20261024`. **80entregues +52funcionaispendentes +P001 =133;sem candidatasQA por disponibilizar.** Os79fechos anteriores permanecem encerrados,incluindoP090(base/IVA),P060(despacho/lista/plano/âmbito/redução),P056(autorização),P050(IVAserviço). P084/P085 continuam nos52,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 — G7B/P091 concluído emQA,comissão de venda e compra
|
||||
|
||||
Implementação`948621a6`. **Um ramo,dois tratamentos**:`commission_sale_transfer` e`commission_purchase_transfer`. FonteCIVA15(2)(e),2016PDF13/p1426(271),3(3)(c)PDF6/p1426(264),15(5)/(6)PDF14/p1426(272);2022PDF3mantém15e,2025PDF12mantém3c e não altera15. Bens transferidos em execução de contrato de comissão,incluindo consignação quando aplicável;na venda considera-se comprador o comissário,na compra o comitente. Não estender a qualquer pagamento de comissão/serviço autónomo nem substituir regra especial de leilão15g.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,29 @@
|
||||
import {useState} from 'react';
|
||||
import {newActSaleBase,switchActValuation,switchActKind,actSaleBook,actSaleConditions,actSaleCurrent,actSaleReportRows,actSaleBaseSource,actSaleKinds,actSaleTreatments,recordActSaleBases,saveActSaleBook,type ActSaleBook,type ActSaleRow} from '@/lib/iva-act-sale-base';
|
||||
|
||||
export function SimulationActSaleBase({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}){
|
||||
const[error,setError]=useState('');let book:ActSaleBook;
|
||||
try{book=actSaleBook(draft);}catch(cause){return<p role="alert">{String(cause)}</p>;}
|
||||
const save=(next:ActSaleBook)=>{try{onChange('modelo_a_snapshot',saveActSaleBook(draft,next));setError('');}catch(cause){setError(String(cause));}};
|
||||
const change=(id:string,patch:Partial<ActSaleRow>)=>save({...book,rows:book.rows.map(row=>row.id===id?{...row,...patch}:row)});
|
||||
return<details className="space-y-3 rounded border p-3">
|
||||
<summary>Base tributável — arrematação e outros actos de transmissão</summary>
|
||||
<p>Oportunidade: {String(draft.context_opportunity||'entrada geral')}. Prepare apenas transmissões de bens resultantes dos actos abrangidos pelo artigo15(2)(h). Indique o valor por que a arrematação/venda foi efectuada ou,se for caso,o valor normal dos bens. O portal não escolhe o menor valor nem transforma um pagamento ou acordo genérico numa transmissão sujeita a IVA.</p>
|
||||
<p>Na conciliação ou transacção,identifique a transmissão dos bens e o fundamento do valor aplicável; não basta o montante genérico do acordo. O valor normal exige fundamento e âmbito identificados,não um certificado ou avaliador criado pelo portal. Base e IVA são resultados distintos.</p>
|
||||
<p>{actSaleBaseSource}</p>{error&&<p role="alert">{error}</p>}
|
||||
<button type="button" className="underline" onClick={()=>save({...book,rows:[...book.rows,newActSaleBase(crypto.randomUUID(),String(draft.currency??''))]})}>Acrescentar transmissão por acto</button>
|
||||
{book.rows.map(row=>{const rule=actSaleTreatments.find(item=>item.id===row.treatment);return<details key={row.id} className="rounded border p-3"><summary>{row.description||'Transmissão por identificar'} — {row.period||'mês por indicar'}</summary>
|
||||
<div className="grid gap-3 md:grid-cols-2">
|
||||
<label>Natureza do acto<select className="block rounded border p-2" value={row.actKind} onChange={e=>change(row.id,switchActKind(row,e.target.value))}><option value="">Por indicar</option>{actSaleKinds.map(item=><option key={item.id} value={item.id}>{item.label}</option>)}</select></label>
|
||||
<label>Fundamento do valor aplicável<select className="block rounded border p-2" value={row.treatment} onChange={e=>change(row.id,switchActValuation(row,e.target.value))}><option value="">Por indicar</option>{actSaleTreatments.map(item=><option key={item.id} value={item.id}>{item.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 ActSaleRow['origin']})}><option value="projected">Projectados / pressupostos</option><option value="effective">Efectivos declarados</option></select></label>
|
||||
{([['description','Bens e transmissão identificados'],['actRef','Acto ou contrato / referência da previsão'],['documentRef','Documento da transmissão / referência da previsão'],['documentDate','Data do documento / prevista'],['period','Mês da transmissão'],['currency','Moeda de origem'],['valuationRef','Referência documental / pressuposto da valorização'],['valuationScope','Âmbito da valorização: bens, operação, período e condições'],['compositionRef','Referência da composição sem IVA — inclusões e exclusões aplicáveis'],['evidence','Fundamento factual / pressupostos']] as const).map(([field,label])=><label key={field}>{label}<input className="block rounded border p-2" type={field==='documentDate'?'date':field==='period'?'month':'text'} value={row[field]} onChange={e=>change(row.id,{[field]:e.target.value})}/></label>)}
|
||||
{rule&&<label>{row.treatment==='act_sale_amount'?'Valor da arrematação ou venda efectuada,sem IVA (moeda indicada)':'Valor normal dos bens,sem IVA (moeda indicada)'}<input className="block rounded border p-2" value={row.treatment==='act_sale_amount'?row.actValue:row.normalValue} onChange={e=>change(row.id,{[row.treatment==='act_sale_amount'?'actValue':'normalValue']:e.target.value})}/></label>}
|
||||
</div>
|
||||
<p>Mudar de acto ou fundamento conserva os montantes e documentos,mas exige rever a correspondência dos bens e da valorização antes de determinar a base. As versões anteriores mantêm-se.</p>
|
||||
{rule?<fieldset><legend>Condições próprias desta transmissão</legend>{actSaleConditions.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}})}><option value="">Por indicar</option><option value="yes">Sim</option><option value="no">Não</option></select></label>)}</fieldset>:<p>Escolha o fundamento para apresentar o montante aplicável;os valores anteriores conservam-se.</p>}
|
||||
</details>;})}
|
||||
{!!book.rows.length&&<button type="button" className="rounded bg-emerald-800 p-2 text-white" onClick={()=>{try{save(recordActSaleBases(draft,book));}catch(cause){setError(String(cause));}}}>Determinar bases de transmissão e guardar versão</button>}
|
||||
{book.result&&<><p role="status">{actSaleCurrent(draft,book)?'Bases de transmissão correspondentes às entradas guardadas.':'Entradas alteradas;bases de transmissão históricas conservadas. Reveja e determine novamente.'} {book.history?.length??0} versões anteriores. IVA e campo11 não são preenchidos por estas bases.</p><dl>{actSaleReportRows(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>;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import { SimulationAcquisitions } from './simulation-acquisitions';
|
||||
import { SimulationImportExemptions } from './simulation-import-exemptions';
|
||||
import { SimulationPublicAuthorityBase } from './simulation-public-authority-base';
|
||||
import { SimulationCommissionBase } from './simulation-commission-base';
|
||||
import { SimulationActSaleBase } from './simulation-act-sale-base';
|
||||
import { SimulationOfferPreparations } from './simulation-offer-preparations';
|
||||
import { SimulationOperations } from './simulation-operations';
|
||||
|
||||
@@ -94,6 +95,7 @@ export function SimulationMonthlyIva({draft, busy, onCalculate, onChange}: {
|
||||
<SimulationImportExemptions draft={draft} onChange={onChange} />
|
||||
<SimulationPublicAuthorityBase draft={draft} onChange={onChange} />
|
||||
<SimulationCommissionBase draft={draft} onChange={onChange} />
|
||||
<SimulationActSaleBase draft={draft} onChange={onChange} />
|
||||
<SimulationOfferPreparations draft={draft} onChange={onChange} />
|
||||
<SimulationModeloA draft={draft} />
|
||||
</section>;
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import {acquisitionScope,readAcquisitionStore} from './iva-acquisitions.ts';
|
||||
|
||||
export const actSaleBaseVersion='act-goods-base/1';
|
||||
export const actSaleBaseSource='CIVA republicado Lei13/2016,15(2)(h),PDF13/p1426(271): nas transmissões de bens resultantes de actos de arrematação ou venda judicial ou administrativa,de conciliação ou contratos de transacção,a base é o valor por que as arrematações ou vendas foram efectuadas ou,se for caso,o valor normal dos bens. Art15(4)/(5)/(6),PDF14/p1426(272),valor normal,composição e exclusões,sem próprioIVA. Lei22/2022PDF3mantém15(2)(h)/(4–6)por remissão;Lei10/2025não altera15. Recorte2026/MZN;determinação da base,sem inferir incidência,taxa,IVA,dedução/campo11 ou totaisModeloA;sem substituir regime especial15(2)(g)de leilão em comissão.';
|
||||
export const actSaleKinds=[{id:'auction',label:'Arrematação'},{id:'judicial_sale',label:'Venda judicial'},{id:'administrative_sale',label:'Venda administrativa'},{id:'conciliation',label:'Conciliação'},{id:'settlement',label:'Contrato de transacção'}] as const;
|
||||
export const actSaleTreatments=[{id:'act_sale_amount',label:'Valor da arrematação ou venda efectuada'},{id:'act_normal_value',label:'Valor normal dos bens,quando aplicável'}] as const;
|
||||
export const actSaleConditions=[
|
||||
['taxableDomesticGoods','Está identificada uma transmissão de bens sujeita a IVA no território nacional; não é qualquer pagamento,indemnização ou prestação de serviços'],
|
||||
['goodsByAct','Estes bens são transmitidos em resultado do acto de arrematação,venda judicial/administrativa,conciliação ou contrato de transacção identificado'],
|
||||
['valuationApplies','O valor escolhido corresponde ao fundamento aplicável nesta transmissão:valor por que a arrematação/venda foi efectuada ou,se for caso,valor normal; não é uma opção automática pelo menor valor'],
|
||||
['netComposition','O montante indicado exclui o próprio IVA e reflecte a composição aplicável do artigo15(5)/(6),identificada no fundamento,sem omissões ou duplicações'],
|
||||
['notAuctionCommissionRegime','Esta transmissão corresponde ao artigo15(2)(h),não a uma venda abrangida pela regra especial do organizador de leilão em comissão do artigo15(2)(g)'],
|
||||
] as const;
|
||||
type Choice=''|'yes'|'no';type Condition=typeof actSaleConditions[number][0];
|
||||
export type ActSaleRow={id:string;treatment:string;actKind:string;description:string;period:string;origin:'projected'|'effective';currency:string;actRef:string;documentRef:string;documentDate:string;actValue:string;normalValue:string;valuationRef:string;valuationScope:string;compositionRef:string;evidence:string;conditions:Partial<Record<Condition,Choice>>};
|
||||
type LineResult={id:string;status:'determined'|'not_applicable'|'indeterminate';baseAmount:string|null;vat:null;rate:null;reason:string};
|
||||
export type ActSaleCalculation={version:string;revision:number;calculatedAt:string;opportunity:string;location:string;sourceKey:string;source:string;inputs:ActSaleRow[];rows:LineResult[]};
|
||||
export type ActSaleBook={rows:ActSaleRow[];result?:ActSaleCalculation;history?:ActSaleCalculation[]};
|
||||
type Store=ReturnType<typeof readAcquisitionStore>&{actSaleBases?:Record<string,ActSaleBook>};
|
||||
export function newActSaleBase(id:string,currency:string):ActSaleRow{return{id,treatment:'',actKind:'',description:'',period:'',origin:'projected',currency,actRef:'',documentRef:'',documentDate:'',actValue:'',normalValue:'',valuationRef:'',valuationScope:'',compositionRef:'',evidence:'',conditions:{}};}
|
||||
export function switchActValuation(row:ActSaleRow,treatment:string):ActSaleRow{return{...row,treatment,conditions:{...row.conditions,valuationApplies:''}};}
|
||||
export function switchActKind(row:ActSaleRow,actKind:string):ActSaleRow{return{...row,actKind,conditions:{...row.conditions,goodsByAct:'',valuationApplies:''}};}
|
||||
function readStore(draft:Record<string,unknown>):Store{
|
||||
const store=readAcquisitionStore(draft.modelo_a_snapshot) as Store;
|
||||
if(store.actSaleBases!==undefined&&(!store.actSaleBases||typeof store.actSaleBases!=='object'||Array.isArray(store.actSaleBases)))throw new Error('Bases de transmissão por acto não recuperáveis;originais preservados.');
|
||||
const fields=Object.keys(newActSaleBase('','')).filter(key=>key!=='conditions');
|
||||
for(const book of Object.values(store.actSaleBases??{}))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 ActSaleRow]!=='string')||!row.conditions||typeof row.conditions!=='object'||Array.isArray(row.conditions)))throw new Error('Linhas de transmissão por acto não recuperáveis;originais preservados,sem substituição por lista vazia.');
|
||||
return store;
|
||||
}
|
||||
export function actSaleBook(draft:Record<string,unknown>):ActSaleBook{return readStore(draft).actSaleBases?.[acquisitionScope(draft)]??{rows:[]};}
|
||||
export function saveActSaleBook(draft:Record<string,unknown>,book:ActSaleBook):string{const current=readStore(draft),encoded=JSON.stringify({...current,actSaleBases:{...current.actSaleBases,[acquisitionScope(draft)]:book}});readStore({...draft,modelo_a_snapshot:encoded});return encoded;}
|
||||
function decimal(raw:unknown):bigint|null{if(typeof raw!=='string'||!/^\d{1,15}(\.\d{1,6})?$/.test(raw.trim()))return null;const[whole,fraction='']=raw.trim().split('.');return BigInt(whole)*1000000n+BigInt(fraction.padEnd(6,'0'));}
|
||||
function money(n:bigint):string{return`${n/1000000n}.${(n%1000000n).toString().padStart(6,'0').replace(/0+$/,'').padEnd(2,'0')}`;}
|
||||
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 evaluateActSale(row:ActSaleRow,currency:unknown):LineResult{
|
||||
const result:LineResult={id:row.id,status:'indeterminate',baseAmount:null,vat:null,rate:null,reason:''};const stop=(reason:string,status:LineResult['status']='indeterminate')=>({...result,status,reason});
|
||||
const rule=actSaleTreatments.find(item=>item.id===row.treatment),kind=actSaleKinds.find(item=>item.id===row.actKind);
|
||||
if(!rule||!kind)return stop('Identifique o acto e o fundamento do valor aplicável; acto ou valorização desconhecidos não determinam base.');
|
||||
if(currency!=='MZN'||row.currency!==currency)return stop('Moeda fora do âmbito MZN ou divergente do projecto;sem conversão silenciosa.');
|
||||
if(!/^2026-(0[1-9]|1[0-2])$/.test(row.period)||!['projected','effective'].includes(row.origin))return stop('Indique o período em2026 e dados efectivos declarados ou pressupostos de projecção; não se infere o período do orçamento.');
|
||||
const failed=actSaleConditions.filter(([key])=>row.conditions[key]==='no');if(failed.length)return stop('Não se aplica esta base de transmissão por acto: '+failed.map(([,label])=>label).join('; ')+'. Não é isenção nem IVA zero.','not_applicable');
|
||||
const missing=actSaleConditions.filter(([key])=>row.conditions[key]!=='yes');if(missing.length)return stop('Condições por indicar: '+missing.map(([,label])=>label).join('; ')+'. Desconhecido não significa não aplicável ou zero.');
|
||||
if(!row.description.trim()||!row.actRef.trim()||!row.documentRef.trim()||!row.valuationRef.trim()||!row.valuationScope.trim()||!row.compositionRef.trim()||!row.evidence.trim()||!validDate(row.documentDate))return stop('Identifique bens,acto,documento/data,fundamento e âmbito do valor escolhido e composição,ou pressupostos expressos;reutilize referências existentes,sem novo certificado ou avaliador imposto pelo portal.');
|
||||
const value=decimal(row.treatment==='act_sale_amount'?row.actValue:row.normalValue);if(value===null)return stop('Indique o montante sem IVA correspondente ao fundamento escolhido; valor desconhecido ou inválido não é zero. Não se escolhe automaticamente o menor valor.');
|
||||
const base=money(value);return{...result,status:'determined',baseAmount:base,reason:`Base15(2)(h),${kind.label}: ${rule.label} = ${base}MZN,${row.origin==='projected'?'nas condições expressamente assumidas na projecção':'nos dados efectivos declarados'}. Valor sem IVA,com fundamento e âmbito identificados;valor normal não é avaliado automaticamente pelo portal. Base não é imposto;IVA/taxa,dedução/campo11 e totaisModeloA não são determinados por este cálculo.`};
|
||||
}
|
||||
function key(draft:Record<string,unknown>,book:ActSaleBook):string{return JSON.stringify({version:actSaleBaseVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},currency:draft.currency,rows:book.rows});}
|
||||
export function actSaleCurrent(draft:Record<string,unknown>,book:ActSaleBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);}
|
||||
export function recordActSaleBases(draft:Record<string,unknown>,book:ActSaleBook):ActSaleBook{
|
||||
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:ActSaleCalculation={version:actSaleBaseVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:actSaleBaseSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateActSale(row,draft.currency))};
|
||||
const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveActSaleBook(draft,next);return next;
|
||||
}
|
||||
export function actSaleReportRows(draft:Record<string,unknown>):Array<[string,string,string,string]>{
|
||||
try{const book=actSaleBook(draft),result=book.result;if(!result)return[];return result.inputs.map((row,index)=>['IVA mensal',`Base P094 — ${row.period} — ${row.id}`,`${row.description};base tributável: ${result.rows[index].baseAmount??'Indeterminada'} ${row.currency};IVA: Indeterminado;${result.rows[index].reason}`,`${result.opportunity};${result.location};${actSaleCurrent(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'};${actSaleKinds.find(item=>item.id===row.actKind)?.label??'Acto por indicar'};acto ${row.actRef};${actSaleTreatments.find(item=>item.id===row.treatment)?.label??'Valorização por indicar'};montante ${row.treatment==='act_sale_amount'?row.actValue:row.normalValue} ${row.currency};fundamento da valorização ${row.valuationRef};âmbito ${row.valuationScope};composição ${row.compositionRef};documento ${row.documentRef},${row.documentDate};condições ${actSaleConditions.map(([key,label])=>label+': '+(row.conditions[key]==='yes'?'Sim':row.conditions[key]==='no'?'Não':'Por indicar')).join('; ')};fundamento factual ${row.evidence};não preenche totaisModeloA ou campo11.`]);}
|
||||
catch{return[['IVA mensal','Base de transmissão por acto','Dados não recuperáveis','Originais preservados;sem substituir por zero.']];}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import { acquisitionReportRows } from './iva-acquisitions.ts';
|
||||
import { importExemptionReportRows } from './iva-import-exemptions.ts';
|
||||
import { publicBaseReportRows } from './iva-public-authority-base.ts';
|
||||
import { commissionBaseReportRows } from './iva-commission-base.ts';
|
||||
import { actSaleReportRows } from './iva-act-sale-base.ts';
|
||||
import { offerPreparationReportRows } from './iva-offer-preparations.ts';
|
||||
import { salesReportRows } from './iva-operations.ts';
|
||||
import { fiscalQaRows } from './fiscal-qa-preview.ts';
|
||||
@@ -624,6 +625,7 @@ export function buildProjectDossierRows(
|
||||
rows.push(...importExemptionReportRows(draft));
|
||||
rows.push(...publicBaseReportRows(draft));
|
||||
rows.push(...commissionBaseReportRows(draft));
|
||||
rows.push(...actSaleReportRows(draft));
|
||||
rows.push(...offerPreparationReportRows(draft));
|
||||
const operationRows = salesReportRows(draft);
|
||||
rows.push(...operationRows);
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<?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 IvaActSaleBaseDraftTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
public function test_act_sale_bases_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-g7c-bases.json')), true, flags: JSON_THROW_ON_ERROR);
|
||||
$id = $this->postJson('/api/v1/simulation-drafts', ['personal_snapshot' => [], 'economic_snapshot' => $draft], ['Idempotency-Key' => (string) Str::uuid()])->assertCreated()->json('data.id');
|
||||
$recovered = $this->getJson('/api/v1/simulation-drafts/'.$id)->assertOk()->json('data.economic_snapshot');
|
||||
$this->assertSame($draft['modelo_a_snapshot'], $recovered['modelo_a_snapshot']);
|
||||
$this->assertSame('opportunity:341', $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['actSaleBases']['opportunity:341'];
|
||||
$this->assertCount(2, $book['rows']);
|
||||
$this->assertSame(['act_sale_amount','act_normal_value'], array_column($book['rows'], 'treatment'));
|
||||
$this->assertSame(['1500.25','2200.50'], array_column($book['result']['rows'], 'baseAmount'));
|
||||
$this->assertSame(['determined','determined'], array_column($book['result']['rows'], 'status'));
|
||||
$this->assertSame([null,null], array_column($book['result']['rows'], 'vat'));
|
||||
$this->assertSame([null,null], array_column($book['result']['rows'], 'rate'));
|
||||
$this->assertSame(['auction','settlement'], array_column($book['rows'], 'actKind'));
|
||||
$this->assertSame('1500.25', $book['rows'][0]['actValue']);
|
||||
$this->assertSame('2200.50', $book['rows'][0]['normalValue']);
|
||||
$this->assertStringContainsString('acto A', $book['rows'][0]['actRef']);
|
||||
$this->assertStringContainsString('fundamento A', $book['rows'][0]['valuationRef']);
|
||||
$this->assertStringContainsString('dezembro2026', $book['rows'][0]['valuationScope']);
|
||||
$this->assertStringContainsString('15(2)(h)', $book['result']['source']);
|
||||
$this->assertSame($book['rows'], $book['result']['inputs']);
|
||||
$this->assertCount(2, $book['history']);
|
||||
$this->assertNull($book['history'][0]['rows'][0]['baseAmount']);
|
||||
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-g7c-preserved-inputs.json')), true, flags: JSON_THROW_ON_ERROR);
|
||||
$prior = json_decode($frozen['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
|
||||
$this->assertSame($prior, array_diff_key($store, ['actSaleBases' => 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-g7c-act-bases-20261024/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,39 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import {newActSaleBase,switchActValuation,switchActKind,actSaleKinds,actSaleTreatments,actSaleConditions,evaluateActSale,recordActSaleBases,saveActSaleBook,actSaleBook,actSaleCurrent,actSaleReportRows} from '../../resources/js/lib/iva-act-sale-base.ts';
|
||||
import {commissionBaseCurrent} from '../../resources/js/lib/iva-commission-base.ts';
|
||||
import {publicBaseCurrent} from '../../resources/js/lib/iva-public-authority-base.ts';
|
||||
import {importExemptionCurrent} from '../../resources/js/lib/iva-import-exemptions.ts';
|
||||
import {createProjectDossierReport} from '../../resources/js/lib/project-dossier-report.ts';
|
||||
const frozen=JSON.parse(fs.readFileSync(new URL('./fixtures/iva-g7c-preserved-inputs.json',import.meta.url),'utf8'));
|
||||
const row=(treatment=actSaleTreatments[0].id)=>({...newActSaleBase('g7c-'+treatment,'MZN'),treatment,actKind:treatment==='act_sale_amount'?'auction':'settlement',description:'SYNTHETIC QA bens transmitidos pelo acto identificado',period:'2026-12',actRef:'SYNTHETIC QA acto A / bens desta operação',documentRef:'SYNTHETIC QA G7C '+treatment,documentDate:'2026-11-14',actValue:'1500.25',normalValue:'2200.50',valuationRef:'SYNTHETIC QA fundamento A do valor escolhido',valuationScope:'SYNTHETIC QA bens A, operação A, dezembro2026 e condições declaradas',compositionRef:'SYNTHETIC QA composição15(5)/(6),valor líquido de IVA',evidence:'SYNTHETIC QA pressupostos expressos,não documento real',conditions:Object.fromEntries(actSaleConditions.map(([key])=>[key,'yes']))});
|
||||
const draft=()=>({...structuredClone(frozen),context_opportunity:'opportunity:341',project_title:'SYNTHETIC QA — G7C / Bases de transmissão por acto'});
|
||||
|
||||
test('P094 each act and valuation requires own conditions and references; unknown/no never become zero or VAT',()=>{
|
||||
for(const rule of actSaleTreatments)for(const kind of actSaleKinds){const input={...row(rule.id),actKind:kind.id},ok=evaluateActSale(input,'MZN');assert.equal(ok.status,'determined');assert.equal(ok.baseAmount,rule.id==='act_sale_amount'?'1500.25':'2200.50');assert.equal(ok.vat,null);assert.equal(ok.rate,null);
|
||||
for(const[key]of actSaleConditions)for(const value of ['','unknown','no']){const r=evaluateActSale({...input,conditions:{...input.conditions,[key]:value}},'MZN');assert.equal(r.status,value==='no'?'not_applicable':'indeterminate');assert.equal(r.baseAmount,null);assert.equal(r.vat,null);}
|
||||
for(const patch of [{description:''},{actRef:''},{documentRef:''},{documentDate:'2026-02-30'},{valuationRef:''},{valuationScope:''},{compositionRef:''},{evidence:''},{period:'2025-12'},{currency:'USD'},{actKind:'unknown'},{treatment:'unknown'}])assert.equal(evaluateActSale({...input,...patch},'MZN').baseAmount,null);
|
||||
}
|
||||
});
|
||||
|
||||
test('selected act value or normal value only; no automatic minimum/fallback, exact decimals and retained edits on switch',()=>{
|
||||
const input=row();for(const[patch,expected]of [[{actValue:'0'},'0.00'],[{actValue:'1.000002'},'1.000002'],[{actValue:'999999999999999.999999'},'999999999999999.999999'],[{normalValue:'invalid'},'1500.25'],[{treatment:'act_normal_value',actValue:'invalid'},'2200.50']])assert.equal(evaluateActSale({...input,...patch},'MZN').baseAmount,expected);
|
||||
for(const patch of [{actValue:''},{actValue:'-1'},{actValue:'NaN'},{actValue:'0.0000001'},{treatment:'act_normal_value',normalValue:''}])assert.equal(evaluateActSale({...input,...patch},'MZN').baseAmount,null);
|
||||
const switched=switchActValuation(input,'act_normal_value');assert.equal(switched.conditions.valuationApplies,'');for(const field of ['actValue','normalValue','actRef','valuationRef','valuationScope','documentRef'])assert.equal(switched[field],input[field]);assert.equal(evaluateActSale(switched,'MZN').baseAmount,null);assert.equal(evaluateActSale({...switched,conditions:{...switched.conditions,valuationApplies:'yes'}},'MZN').baseAmount,'2200.50');
|
||||
const changed=switchActKind(input,'judicial_sale');assert.equal(changed.conditions.goodsByAct,'');assert.equal(changed.conditions.valuationApplies,'');assert.equal(changed.actValue,input.actValue);assert.equal(changed.documentRef,input.documentRef);assert.equal(evaluateActSale(changed,'MZN').baseAmount,null);
|
||||
});
|
||||
|
||||
test('save/recovery/history/report preserve all80 delivered books and old currentkeys',()=>{
|
||||
const d=draft(),prior=JSON.parse(d.modelo_a_snapshot);assert.deepEqual(actSaleBook(d),{rows:[]});assert.deepEqual(actSaleReportRows(d),[]);
|
||||
let book=recordActSaleBases(d,{rows:actSaleTreatments.map(rule=>({...row(rule.id),conditions:{}}))});book=recordActSaleBases(d,{...book,rows:actSaleTreatments.map(rule=>({...row(rule.id),conditions:{...row(rule.id).conditions,goodsByAct:'no'}}))});book=recordActSaleBases(d,{...book,rows:actSaleTreatments.map(rule=>row(rule.id))});assert.equal(book.history.length,2);assert.ok(book.history.every(h=>h.rows.every(r=>r.baseAmount===null&&r.vat===null)));assert.ok(actSaleCurrent(d,book));
|
||||
for(const field of ['treatment','actKind','actValue','normalValue','valuationRef','valuationScope','actRef'])assert.ok(!actSaleCurrent(d,{...book,rows:book.rows.map(r=>({...r,[field]:'changed'}))}));for(const patch of [{context_opportunity:'opportunity:342'},{currency:'USD'},{selection_labels:{province_id:'Maputo'}}])assert.ok(!actSaleCurrent({...d,...patch},book));
|
||||
d.modelo_a_snapshot=saveActSaleBook(d,book);assert.deepEqual(actSaleBook(JSON.parse(JSON.stringify(d))),book);const next=JSON.parse(d.modelo_a_snapshot);const{actSaleBases,...untouched}=next;assert.deepEqual(untouched,prior);for(const[scope,previous]of Object.entries(prior.importExemptions))assert.ok(importExemptionCurrent({...d,context_opportunity:scope},previous));for(const[scope,previous]of Object.entries(prior.publicAuthorityBases))assert.ok(publicBaseCurrent({...d,context_opportunity:scope},previous));for(const[scope,previous]of Object.entries(prior.commissionBases))assert.ok(commissionBaseCurrent({...d,context_opportunity:scope},previous));
|
||||
assert.equal(next.commissionBases['opportunity:340'].result.rows[0].baseAmount,'900.15');assert.equal(next.publicAuthorityBases['opportunity:339'].result.rows[0].vat,null);assert.equal(next.importExemptions['opportunity:338'].result.rows[1].importVat,'400.00');assert.equal(next.books['opportunity:329'].result.periods[0].fields['11'],null);
|
||||
const report=JSON.stringify(createProjectDossierReport(d,{selectedSections:new Set(['finance']),version:'QA G7C'}));for(const token of ['Base P094','1500.25','2200.50','IVA: Indeterminado','opportunity:341','Manica','2026-12','acto A','15(2)(h)','fundamento A','dezembro2026','campo11'])assert.ok(report.includes(token),token);assert.deepEqual(actSaleReportRows({...d,context_opportunity:'opportunity:342'}),[]);
|
||||
if(process.env.IVA_G7C_CALCULATED)fs.writeFileSync(process.env.IVA_G7C_CALCULATED,JSON.stringify(d));
|
||||
});
|
||||
|
||||
test('corrupt rows/store cannot overwrite originals; duplicate operation identifiers cannot be recorded',()=>{
|
||||
const d=draft(),original=d.modelo_a_snapshot;for(const patch of [{actValue:4},{conditions:[]},{valuationRef:null}])assert.throws(()=>saveActSaleBook(d,{rows:[{...row(),...patch}]}),/originais preservados/);assert.equal(d.modelo_a_snapshot,original);assert.throws(()=>recordActSaleBases(d,{rows:[row(),row()]}),/distintos/);assert.throws(()=>recordActSaleBases(d,{rows:[]}),/distintos/);assert.throws(()=>actSaleBook({...d,modelo_a_snapshot:JSON.stringify({...JSON.parse(original),actSaleBases:[]})}),/originais preservados/);
|
||||
});
|
||||
Reference in New Issue
Block a user