Compare commits
8
Commits
c1314cdf90
...
78c9f4a356
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78c9f4a356 | ||
|
|
7996c35933 | ||
|
|
29e708ba2d | ||
|
|
f9fb04f947 | ||
|
|
77d1290258 | ||
|
|
946fc08906 | ||
|
|
7ecf9ec79a | ||
|
|
536559d651 |
@@ -14769,5 +14769,572 @@
|
||||
"pages": 136
|
||||
}
|
||||
]
|
||||
},
|
||||
"iva_l1_g6e_P052_homologation_20261024": {
|
||||
"status": "installed_delta_verified_partial_L1",
|
||||
"candidate": "1565aa4ffb13fae75e925ccdb2b7553a9b111dd5",
|
||||
"last_installed": "2d889a21",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P052": [
|
||||
"ship_provisions_import",
|
||||
"ship_fuel_import",
|
||||
"ship_technical_products_import",
|
||||
"ship_cargo_accessories_import",
|
||||
"aircraft_provisions_import",
|
||||
"aircraft_fuel_import",
|
||||
"aircraft_technical_products_import",
|
||||
"aircraft_cargo_accessories_import"
|
||||
]
|
||||
},
|
||||
"branch_count": 1,
|
||||
"treatment_count": 8,
|
||||
"runtime_delta_G6E": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-import-exemptions.ts",
|
||||
"sha256_LF": "5a1359a75aa0403d9ccb2607e443dd15729d4c504a713b8710e655ac3e1a52f3"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-import-exemptions.tsx",
|
||||
"sha256_LF": "63e424a64933dca63761c2c55eb3fd3c3a50e22aa8aa3a919e959cb43218b6fd"
|
||||
},
|
||||
{
|
||||
"path": "app/Http/Requests/StoreSimulationFormDraftRequest.php",
|
||||
"sha256_LF": "5a966ef9d3a668d3785b073f8bae600f8ed18ccbd076fec3c62c64f020fca936"
|
||||
}
|
||||
],
|
||||
"uninstalled_ancestral_draft_preparation_runtime": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-offer-preparations.ts",
|
||||
"sha256_LF": "c5262327d4f1a3fd062ce4febcb628af5ef97c9c77eac7ebc7af27a96e1842a2"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-offer-preparations.tsx",
|
||||
"sha256_LF": "e8ae2e9138b244d6173ff92e0e75ea2143fbd86c20092e1fa2a5d732c547b031"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-monthly-iva.tsx",
|
||||
"sha256_LF": "54278996c89d1508219dae83633a75261f3d36d60e7737d4a53d5d132febaf5e"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "ee742d34d31c06414efe39de2748b98dc9b981dbaf98a52f8ff02aab1b9198de"
|
||||
}
|
||||
],
|
||||
"ancestry_scope_warning": "Candidate also contains uninstalledP084/P085draftpreparation5ec2f198,not benefits;future deliverymust identify totalinstalleddelta and preserve those drafts,not countP084/P085 asclosed",
|
||||
"counts_current": {
|
||||
"delivered": 75,
|
||||
"QA": 0,
|
||||
"functional_pending": 57,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_P052_delivery_only": {
|
||||
"delivered": 75,
|
||||
"QA": 0,
|
||||
"functional_pending": 57,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"QA_proofs_reused": "iva-l1-g6e-qa-20261024.json;accepted74closures anddraftproofs not rerun",
|
||||
"required_before_delivery": "Freshauthenticateddestination/main;backupandrealisolatedrestore;existingGitprocess;onlyinstalleddeltaverification",
|
||||
"limits": "L1open;P001only05/06;beveragesL2/L3;Statistics/AIdeferred;closingL1doesnotrequireL2/L3/alltaxes",
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-import-exemptions.ts",
|
||||
"sha256_LF": "5a1359a75aa0403d9ccb2607e443dd15729d4c504a713b8710e655ac3e1a52f3"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-import-exemptions.tsx",
|
||||
"sha256_LF": "63e424a64933dca63761c2c55eb3fd3c3a50e22aa8aa3a919e959cb43218b6fd"
|
||||
},
|
||||
{
|
||||
"path": "app/Http/Requests/StoreSimulationFormDraftRequest.php",
|
||||
"sha256_LF": "5a966ef9d3a668d3785b073f8bae600f8ed18ccbd076fec3c62c64f020fca936"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-offer-preparations.ts",
|
||||
"sha256_LF": "c5262327d4f1a3fd062ce4febcb628af5ef97c9c77eac7ebc7af27a96e1842a2"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-offer-preparations.tsx",
|
||||
"sha256_LF": "e8ae2e9138b244d6173ff92e0e75ea2143fbd86c20092e1fa2a5d732c547b031"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-monthly-iva.tsx",
|
||||
"sha256_LF": "54278996c89d1508219dae83633a75261f3d36d60e7737d4a53d5d132febaf5e"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/project-dossier.ts",
|
||||
"sha256_LF": "ee742d34d31c06414efe39de2748b98dc9b981dbaf98a52f8ff02aab1b9198de"
|
||||
}
|
||||
],
|
||||
"authorization": "Tempo24/10:G6E/P052 candidate1565aa4f integrate/deploy viaexistingGit,concurrentchangespreserved,installeddeltaonly;preserve P084/P085drafts and domestic/import distinction,noautobenefit",
|
||||
"base_installed": "2d889a211ba303db31dcba815e439456dfba9f36",
|
||||
"counts_before": {
|
||||
"delivered": 74,
|
||||
"QA": 1,
|
||||
"functional_pending": 57,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_delivery": {
|
||||
"delivered": 75,
|
||||
"QA": 0,
|
||||
"functional_pending": 57,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"P084_P085": "Ancestordraftpreparation5ec2f198included as partialdraftavailability,not fullbenefitdelivery;P084/P085 remain57pending;newlyrequestedstatus/scenariosclarification willbeQAonlyafterthisrelease",
|
||||
"authenticated_preflight": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "2d889a211ba303db31dcba815e439456dfba9f36",
|
||||
"release": "/var/www/investmoz-homologacao/releases/2d889a211ba303db31dcba815e439456dfba9f36-dac24b34",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/d46b794ab2c6113738f76c69097ae3dcddcf56dd-e81e61d1",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/2d889a211ba303db31dcba815e439456dfba9f36-dac24b34",
|
||||
"release_revision": {
|
||||
"commit": "2d889a211ba303db31dcba815e439456dfba9f36",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T18:06:14.188038+00:00",
|
||||
"manifest_sha256": "84df9b7bd7b9912749d43fc40855ea10cebc9f7bf92451e6eb9860771169840a"
|
||||
},
|
||||
"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-g6e-delivery-20261024/backup",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "e6b37683c01019b2fc361a3ff33f6be0f2ebf6f5a1a23c4a81dc95ea278dd9b9",
|
||||
"files_sha256": "60c38657d68d0a98f5b287fb3c74062bacc283729ff8c3aa84c110408067d9bc",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "l1_g6e_restore_20261024",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "e6b37683c01019b2fc361a3ff33f6be0f2ebf6f5a1a23c4a81dc95ea278dd9b9",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
},
|
||||
"served_commit": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"installation": {
|
||||
"protected": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"release": "/var/www/investmoz-homologacao/releases/c1314cdf90c368b51489aaf04c2cdbe59cfb88e6-d4800fe2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/2d889a211ba303db31dcba815e439456dfba9f36-dac24b34",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"runtime_files_verified": 7,
|
||||
"persistent_files_and_env_verified": 369,
|
||||
"tables_compared": 174,
|
||||
"changed_tables": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 105,
|
||||
"checksum": "2df1487be225c60843f9f0ef9f07ed71"
|
||||
},
|
||||
"after": {
|
||||
"rows": 105,
|
||||
"checksum": "286378eec2e9e387ecfbeb156f168fca"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 41,
|
||||
"checksum": "0e709e11078a7c89e010c3f670d6f207"
|
||||
},
|
||||
"after": {
|
||||
"rows": 42,
|
||||
"checksum": "da381873ffd7fe5eaa5ab5996ca602ab"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T18:25:28.022659+00:00",
|
||||
"manifest_sha256": "efd98a5b7940896109788186b7deedd09ce7dc44f391e3c618e7ec1ee82e6b7d"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"import-onboard-supplies/1": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"ship_provisions_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"ship_fuel_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"ship_technical_products_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"ship_cargo_accessories_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"aircraft_provisions_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"aircraft_fuel_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"aircraft_technical_products_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"aircraft_cargo_accessories_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"supplyNoCoastalFishing": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"supplyNormalTanks": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"offerPreparations": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"benefício não aplicado": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/simulation-form-CPZAFZU3.js",
|
||||
"status": 200,
|
||||
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-CIQlqNrD.js",
|
||||
"status": 200,
|
||||
"sha256": "081f2d08cfe70c8ca035c9da6022cfd88f1980ca8e5433eb3d16f96971e080eb"
|
||||
},
|
||||
{
|
||||
"file": "assets/services-CqPgbMxW.js",
|
||||
"status": 200,
|
||||
"sha256": "ee59b7a86ed1cb4e6e171c3ef65e114f8f2fbe91d76aac4194b58706f49c50c1"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-RK4qLB-o.js",
|
||||
"status": 200,
|
||||
"sha256": "580dc668b93ff861cf4757a47de165c0575255ed77e19816a566b6efcf80d0c7"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-DdR4Impy.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": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"release": "/var/www/investmoz-homologacao/releases/c1314cdf90c368b51489aaf04c2cdbe59cfb88e6-d4800fe2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/2d889a211ba303db31dcba815e439456dfba9f36-dac24b34",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"release": "/var/www/investmoz-homologacao/releases/c1314cdf90c368b51489aaf04c2cdbe59cfb88e6-d4800fe2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/2d889a211ba303db31dcba815e439456dfba9f36-dac24b34",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"c1314cdf90c368b51489aaf04c2cdbe59cfb88e6"
|
||||
],
|
||||
"finished_at": "2026-10-24T18:25:30.464203+00:00"
|
||||
},
|
||||
"log_file": "1792866235841214128.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 25.41s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 327",
|
||||
"# pass 327",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 123869
|
||||
},
|
||||
"rollback_executed": false
|
||||
},
|
||||
"activation": "NormalGitFF/webhook/installer;zero migrations/imports"
|
||||
},
|
||||
"iva_l1_P084_P085_distinct_paths_request_scope_scenarios_QA_20261024": {
|
||||
"candidate": "946fc089066fa7c7b71648da0de4035f3b8b592f",
|
||||
"status": "partial offer-path clarification demonstratedQA,not installed;P084/P085benefits remainpending",
|
||||
"authorization": "ExplicitTempo:distinctP085emergency/humanitarianpurpose andP084requeststates;presentingdoesnotgrant;decisionspreservegoods/operation/period/conditions;normalandconditionalhypotheticalscenarios;documentaryconference stillrequired",
|
||||
"P084": {
|
||||
"states": [
|
||||
"preparation",
|
||||
"presented",
|
||||
"granted",
|
||||
"denied"
|
||||
],
|
||||
"scope": "Immutable explicitrequestRecords retain state,goods,operation,period,conditions,decisionreference/date;allrecordedscopes showninUI/report;edits/currentrequest donot replace prior decisions or extend them toother goods/operations/periods/opportunities",
|
||||
"precision": "Months,exact calendardates,or literaloperation/temporalscope including untilrevocation/withoutend;no artificialenddate orsingleoperation restriction when thedocumentstatesotherwise",
|
||||
"incomplete": "Draft can save incomplete;recording scopeddecision requires fouruserrequested scopeelements,not a new certificate/approver;document/date optional ifnotavailable",
|
||||
"not_submission": "No request sent to authority;declaredrecordstate isnot a grant bysimulator"
|
||||
},
|
||||
"P085": {
|
||||
"fields": "Emergency/disaster,nature,humanitarianpurpose,goods,recipient,availabledocuments,mitigation",
|
||||
"procedure": "Only applyemergency/donation procedurewhen correspondence demonstrated;not appliednow;P085acquisition scope retained,no automaticimport extension orP084status requirement"
|
||||
},
|
||||
"scenarios": {
|
||||
"normal": "User-indicated VAT with documentorprojectionpremise;missing/invalidamountororigin remainsindeterminate,no inferrednormalrate/base",
|
||||
"conditional": "Explicit hypotheticalassumption+materialconditions/context required;unknown/contradictedconditions giveindeterminate;0.00 onlylabelledhypotheticalconditionalexemption,notgrantedorapplied",
|
||||
"application": "Never modifies VATresults,field11,ModeloAtotals orrequeststatus;evenrecordeddeferido doesnotautoapply"
|
||||
},
|
||||
"reuse": "Existingper-opportunity reference reuse fills emptyfields only;optional availabledocuments canappend primaryreference without overwriting otherdocuments;all27priorfiscalbooks andoldofferhistory/deliberatepurpose preservedexactly",
|
||||
"verification": {
|
||||
"frontend": {
|
||||
"passed": 4,
|
||||
"failed": 0,
|
||||
"scope": "requestnotgrant,scopeddecisionhistory includingexact/literalperiods,P085ownpurpose,scenariopremises,save/recover/reportpreservation",
|
||||
"record": "latestnode:test outputthissession;acceptedoldproofs not rerun"
|
||||
},
|
||||
"privateAPI": {
|
||||
"tests": 1,
|
||||
"assertions": 31,
|
||||
"target": "simulator_fiscal_delta_20261021_test:55441",
|
||||
"rollback": true,
|
||||
"xml": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-offer-paths-20261024\\api-tests.xml"
|
||||
},
|
||||
"types_final": "passed",
|
||||
"production_build_final": "passed;existingplugin/chunkwarnings",
|
||||
"UI": "CodexEdgeCUA:presentedstate,priorpartialgrantNovemberonly,normal800/conditional0hypothesis;withdrawassumption->indeterminate;incompletescopecannotreplacepriorrecord;P085humanitarianpurpose/normal160;version/save/recover/reportwithallrecords,4historicalversions. Exact/literalperiodvariants coveredbyunit tests,not separateUIclaim;notmanualTempoacceptance"
|
||||
},
|
||||
"regulatory_correspondence": {
|
||||
"status": "Still not demonstrated;not closed or declarednonexistent",
|
||||
"established_chain": "ModelI.1/Despacho06Jan2010->Decreto56/2009art2->CBFLei4/2009;not demonstrated implementinglinkCIVA14(3)",
|
||||
"this_session": "Jointtargetedqueries foundno newlyestablishedprimarylink;directATfiscal listing returnedno readabletoolcontent,whichisnot evidenceofabsence;no unreadsources adopted",
|
||||
"next": "Locate/read specific14(3) implementinglink or expressly applicable procedure,withinternalacquisition/import scope and amendments;onlythenapplyrespectivebenefit",
|
||||
"no_invented_requirements": "No certificate,taxclearance,projectapproval,newauthorityorapprover created;Tempo productclarification isnotdocumentaryproof"
|
||||
},
|
||||
"counts": {
|
||||
"delivered": 75,
|
||||
"QA_complete_branches": 0,
|
||||
"functional_pending": 57,
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
},
|
||||
"installed": "G6E/P052c1314cdf,receipt536559d6;thisclarification946fc089QAonly,nopush/install",
|
||||
"preservation_before_tests": {
|
||||
"frozen": "tests\\frontend\\fixtures\\iva-g6e-inputs.json",
|
||||
"sha256": "f1ac7bd08994dfcf34f8567dffca98acf945f722093791ce8bbe94d679ac3af5",
|
||||
"accepted_delivered_before_install": 74,
|
||||
"accepted_QA": [
|
||||
"P052"
|
||||
],
|
||||
"preserved": "27fiscalbooks+offerbook(2rows,deliberateedits,histories)",
|
||||
"confirmed_losses": [],
|
||||
"scope": "Tempo explicitP084requeststates/scopeddecision,P085emergency/humanitarianpurpose,normal/conditionalhypotheticalscenarios;no automaticbenefit/activechange",
|
||||
"installation_in_progress": "c1314cdf;separateverifiedreceipt"
|
||||
},
|
||||
"limits": "L1open;P001only05/06;beveragesL2/L3;Statistics/AIdeferred;classificationdistinctfromdeduction/field11;L1closuredoesnotrequireL2/L3/alltaxes"
|
||||
},
|
||||
"iva_l1_g6f_P050_import_included_services_QA_20261024": {
|
||||
"candidate": "29e708ba2dca2450eaff8eff6f5e19079ffc7f8e",
|
||||
"implementation_commit": "f9fb04f9",
|
||||
"status": "P050 demonstratedQA,notinstalled;P084/P085 partialpreparation/scenarios includedinancestry andauthorizedfornextdelivery,notbenefitclosure",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P050": [
|
||||
"service_in_customs_value",
|
||||
"accessory_service_first_destination"
|
||||
]
|
||||
},
|
||||
"branch_count": 1,
|
||||
"treatment_count": 2,
|
||||
"source": "CIVA12(1)(e),Lei13/2016PDF11/p1426(269);16(1)/16(1)(b)/16(2),PDF14/p1426(272);2022PDF1–2/2025PDF12–13maintain12e byreference,notchange16;2020/2025May9(13)scopes reused",
|
||||
"meaning": "Servicefullvalueincluded in importtaxbase,eitheralreadyincustomsvalue oraddedaccessorycharge untilfirstdestination;destinationfromtransportdocument or,initsabsence,firstbreakbulk inland. Two technicalprofiles,notnewbusinessconditions.",
|
||||
"tax_separation": "serviceVat0.00 onlywhenownconditions;importVat remainsnull forP050,no customsbase/duties/importedgoodstaxcalculation,normalratepresumption,invoicecorrection orfield11deduction",
|
||||
"new_inputs": "OptionalserviceImportRef,serviceBaseRef,serviceFirstDestination(onlyaccessoryprofile),serviceProvider. Servicevalue/reference/context requiredforclassification;not newmandatoryfields onoldgoods. HidegoodsCode/originCountry forservices;preserve hiddenanswers across profilechange.",
|
||||
"reference_reuse": "P050services filteredout from importedgoods references ofP084/P085;no newtaxbenefit or goodsconversion",
|
||||
"verification": {
|
||||
"frontend": {
|
||||
"new_tests": 4,
|
||||
"passed": 4,
|
||||
"failed": 0,
|
||||
"scope": "allownconditions,missing/failednotzero,ownfirstdestination,switchpreservation,service/importVATseparation,27priorfiscalbooks+946fc089drafts exact,currentoldkeys,report,malformedservicewriteguard,no service-as-goods reuse",
|
||||
"record": "latestnode:test outputthissession;acceptedoldproofs reused,not rerun"
|
||||
},
|
||||
"privateAPI": {
|
||||
"tests": 1,
|
||||
"assertions": 30,
|
||||
"target": "simulator_fiscal_delta_20261021_test:55441",
|
||||
"rollback": true,
|
||||
"xml": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6f-services-20261024\\api-tests.xml"
|
||||
},
|
||||
"types_final": "passed",
|
||||
"production_build_final": "passed,existingplugin/chunkwarnings",
|
||||
"synthetic_QA_storage": "1passed includingmultibyteUTF8bufferboundary",
|
||||
"UI": "CodexEdgeCUArealcomponent:inclusionunknown->indeterminate,no->nonapplication,yes->serviceexemption;servicefieldsownrefs;goodsfields hidden,firstdestination onlyaccessory;save/recover/report2rows/opportunity336/Manica/2026-12/document14Nov2026/5historyversions;notmanualTempoacceptance"
|
||||
},
|
||||
"integrity_fix": "Newmalformedoptionalreference test initially detected savepath lacked validating newencodedbook;now validatesbefore returning/onChange,no original overwritten;validoldbooks/keys preserved",
|
||||
"preservation": {
|
||||
"base": "77d1290258a925a104b616dc4648db33d43064ea",
|
||||
"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-P051",
|
||||
"AUD-SIM-L1-P052",
|
||||
"AUD-SIM-L1-P053",
|
||||
"AUD-SIM-L1-P054",
|
||||
"AUD-SIM-L1-P055",
|
||||
"AUD-SIM-L1-P057",
|
||||
"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"
|
||||
],
|
||||
"confirmed_losses": [],
|
||||
"preservation": "Reuse acceptedG6Ec1314cdf/536559d6:174tables/369files/29published/28relations/408geometries;code/schema/data/config/permissions delta accepted;no active query/write in this QA task",
|
||||
"frozen": "tests\\frontend\\fixtures\\iva-offer-paths-inputs.json",
|
||||
"sha256": "78125d82172cda05c16b10e74ac2fdfd4eaaa25bd99cd3bde33281c2bfdd01e6",
|
||||
"books": "27fiscalbooks+offerbook;requeststates/scopes/normal-conditionalscenarios/history946fc089preservedexactly",
|
||||
"counts_before": {
|
||||
"delivered": 75,
|
||||
"QA": 0,
|
||||
"functional_pending": 57,
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
}
|
||||
},
|
||||
"counts": {
|
||||
"delivered": 75,
|
||||
"QA": 1,
|
||||
"functional_pending": 56,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"active": "Unchangedc1314cdf/536559d6;no push/install/activequeries/schema/data/config/permissionchange",
|
||||
"P084_P085": {
|
||||
"authorized_partial_candidate": "946fc089",
|
||||
"next_delivery_scope": "Preparation/requeststates/scopeddecisions/humanitarianpurpose/normalandconditionalhypotheticalscenarios,notconfirmedbenefit/notclosing2branches",
|
||||
"documentary_scope": "IdentifyexpressapplicableCIVA14(3)procedure/link and amendments;distinguishP084internal/import andP085acquisition. ModelI.1/Despacho/CBFcotejo reused,not repeated;do notinventcertificates/approvers orclaimregulation nonexistent",
|
||||
"preserved": "Allrows,scopeversions,deliberateedits,normal/conditionalinputs andhistory exactlyequalfrozenfixture"
|
||||
},
|
||||
"limits": "L1open;P001only05/06;beveragesL2/L3;classificationseparatefromfield11;Statistics/AIdeferred;L1closuredoesnotrequireL2/L3/alltaxes"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"candidate": "1565aa4ffb13fae75e925ccdb2b7553a9b111dd5",
|
||||
"status": "P052 demonstratedQA;notinstalled;P084/P085 drafts preserved,benefits pending",
|
||||
"status": "delivered_with_QA_proofs_preserved",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P052": [
|
||||
"ship_provisions_import",
|
||||
@@ -144,5 +144,18 @@
|
||||
},
|
||||
"active": "2d889a21/e3269079unchanged;no push/install/migration",
|
||||
"P084_P085": "ModelI.1diploma checked jointly;Despacho06/01/2010->Decreto56/2009art2->CBFLei4/2009;no direct14(3)correspondence found inreadRegulation1–16;scenario mapping recorded separately;drafts5ec2f198preservedexactly",
|
||||
"limits": "L1open;P001only05/06;beveragesL2/L3;Statistics/AIdeferred;closingL1doesnotrequireL2/L3/alltaxes"
|
||||
"limits": "L1open;P001only05/06;beveragesL2/L3;Statistics/AIdeferred;closingL1doesnotrequireL2/L3/alltaxes",
|
||||
"qa_status_preserved": "P052 demonstratedQA;notinstalled;P084/P085 drafts preserved,benefits pending",
|
||||
"delivery_followup": {
|
||||
"served_commit": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"receipt": "l1-g6e-delivery-20261024.json",
|
||||
"record": "iva_l1_g6e_P052_homologation_20261024",
|
||||
"counts": {
|
||||
"delivered": 75,
|
||||
"QA": 0,
|
||||
"functional_pending": 57,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
{
|
||||
"candidate": "29e708ba2dca2450eaff8eff6f5e19079ffc7f8e",
|
||||
"implementation_commit": "f9fb04f9",
|
||||
"status": "P050 demonstratedQA,notinstalled;P084/P085 partialpreparation/scenarios includedinancestry andauthorizedfornextdelivery,notbenefitclosure",
|
||||
"coverage": {
|
||||
"AUD-SIM-L1-P050": [
|
||||
"service_in_customs_value",
|
||||
"accessory_service_first_destination"
|
||||
]
|
||||
},
|
||||
"branch_count": 1,
|
||||
"treatment_count": 2,
|
||||
"source": "CIVA12(1)(e),Lei13/2016PDF11/p1426(269);16(1)/16(1)(b)/16(2),PDF14/p1426(272);2022PDF1–2/2025PDF12–13maintain12e byreference,notchange16;2020/2025May9(13)scopes reused",
|
||||
"meaning": "Servicefullvalueincluded in importtaxbase,eitheralreadyincustomsvalue oraddedaccessorycharge untilfirstdestination;destinationfromtransportdocument or,initsabsence,firstbreakbulk inland. Two technicalprofiles,notnewbusinessconditions.",
|
||||
"tax_separation": "serviceVat0.00 onlywhenownconditions;importVat remainsnull forP050,no customsbase/duties/importedgoodstaxcalculation,normalratepresumption,invoicecorrection orfield11deduction",
|
||||
"new_inputs": "OptionalserviceImportRef,serviceBaseRef,serviceFirstDestination(onlyaccessoryprofile),serviceProvider. Servicevalue/reference/context requiredforclassification;not newmandatoryfields onoldgoods. HidegoodsCode/originCountry forservices;preserve hiddenanswers across profilechange.",
|
||||
"reference_reuse": "P050services filteredout from importedgoods references ofP084/P085;no newtaxbenefit or goodsconversion",
|
||||
"verification": {
|
||||
"frontend": {
|
||||
"new_tests": 4,
|
||||
"passed": 4,
|
||||
"failed": 0,
|
||||
"scope": "allownconditions,missing/failednotzero,ownfirstdestination,switchpreservation,service/importVATseparation,27priorfiscalbooks+946fc089drafts exact,currentoldkeys,report,malformedservicewriteguard,no service-as-goods reuse",
|
||||
"record": "latestnode:test outputthissession;acceptedoldproofs reused,not rerun"
|
||||
},
|
||||
"privateAPI": {
|
||||
"tests": 1,
|
||||
"assertions": 30,
|
||||
"target": "simulator_fiscal_delta_20261021_test:55441",
|
||||
"rollback": true,
|
||||
"xml": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6f-services-20261024\\api-tests.xml"
|
||||
},
|
||||
"types_final": "passed",
|
||||
"production_build_final": "passed,existingplugin/chunkwarnings",
|
||||
"synthetic_QA_storage": "1passed includingmultibyteUTF8bufferboundary",
|
||||
"UI": "CodexEdgeCUArealcomponent:inclusionunknown->indeterminate,no->nonapplication,yes->serviceexemption;servicefieldsownrefs;goodsfields hidden,firstdestination onlyaccessory;save/recover/report2rows/opportunity336/Manica/2026-12/document14Nov2026/5historyversions;notmanualTempoacceptance"
|
||||
},
|
||||
"integrity_fix": "Newmalformedoptionalreference test initially detected savepath lacked validating newencodedbook;now validatesbefore returning/onChange,no original overwritten;validoldbooks/keys preserved",
|
||||
"preservation": {
|
||||
"base": "77d1290258a925a104b616dc4648db33d43064ea",
|
||||
"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-P051",
|
||||
"AUD-SIM-L1-P052",
|
||||
"AUD-SIM-L1-P053",
|
||||
"AUD-SIM-L1-P054",
|
||||
"AUD-SIM-L1-P055",
|
||||
"AUD-SIM-L1-P057",
|
||||
"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"
|
||||
],
|
||||
"confirmed_losses": [],
|
||||
"preservation": "Reuse acceptedG6Ec1314cdf/536559d6:174tables/369files/29published/28relations/408geometries;code/schema/data/config/permissions delta accepted;no active query/write in this QA task",
|
||||
"frozen": "tests\\frontend\\fixtures\\iva-offer-paths-inputs.json",
|
||||
"sha256": "78125d82172cda05c16b10e74ac2fdfd4eaaa25bd99cd3bde33281c2bfdd01e6",
|
||||
"books": "27fiscalbooks+offerbook;requeststates/scopes/normal-conditionalscenarios/history946fc089preservedexactly",
|
||||
"counts_before": {
|
||||
"delivered": 75,
|
||||
"QA": 0,
|
||||
"functional_pending": 57,
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
}
|
||||
},
|
||||
"counts": {
|
||||
"delivered": 75,
|
||||
"QA": 1,
|
||||
"functional_pending": 56,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"active": "Unchangedc1314cdf/536559d6;no push/install/activequeries/schema/data/config/permissionchange",
|
||||
"P084_P085": {
|
||||
"authorized_partial_candidate": "946fc089",
|
||||
"next_delivery_scope": "Preparation/requeststates/scopeddecisions/humanitarianpurpose/normalandconditionalhypotheticalscenarios,notconfirmedbenefit/notclosing2branches",
|
||||
"documentary_scope": "IdentifyexpressapplicableCIVA14(3)procedure/link and amendments;distinguishP084internal/import andP085acquisition. ModelI.1/Despacho/CBFcotejo reused,not repeated;do notinventcertificates/approvers orclaimregulation nonexistent",
|
||||
"preserved": "Allrows,scopeversions,deliberateedits,normal/conditionalinputs andhistory exactlyequalfrozenfixture"
|
||||
},
|
||||
"limits": "L1open;P001only05/06;beveragesL2/L3;classificationseparatefromfield11;Statistics/AIdeferred;L1closuredoesnotrequireL2/L3/alltaxes"
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"candidate": "946fc089066fa7c7b71648da0de4035f3b8b592f",
|
||||
"status": "partial offer-path clarification demonstratedQA,not installed;P084/P085benefits remainpending",
|
||||
"authorization": "ExplicitTempo:distinctP085emergency/humanitarianpurpose andP084requeststates;presentingdoesnotgrant;decisionspreservegoods/operation/period/conditions;normalandconditionalhypotheticalscenarios;documentaryconference stillrequired",
|
||||
"P084": {
|
||||
"states": [
|
||||
"preparation",
|
||||
"presented",
|
||||
"granted",
|
||||
"denied"
|
||||
],
|
||||
"scope": "Immutable explicitrequestRecords retain state,goods,operation,period,conditions,decisionreference/date;allrecordedscopes showninUI/report;edits/currentrequest donot replace prior decisions or extend them toother goods/operations/periods/opportunities",
|
||||
"precision": "Months,exact calendardates,or literaloperation/temporalscope including untilrevocation/withoutend;no artificialenddate orsingleoperation restriction when thedocumentstatesotherwise",
|
||||
"incomplete": "Draft can save incomplete;recording scopeddecision requires fouruserrequested scopeelements,not a new certificate/approver;document/date optional ifnotavailable",
|
||||
"not_submission": "No request sent to authority;declaredrecordstate isnot a grant bysimulator"
|
||||
},
|
||||
"P085": {
|
||||
"fields": "Emergency/disaster,nature,humanitarianpurpose,goods,recipient,availabledocuments,mitigation",
|
||||
"procedure": "Only applyemergency/donation procedurewhen correspondence demonstrated;not appliednow;P085acquisition scope retained,no automaticimport extension orP084status requirement"
|
||||
},
|
||||
"scenarios": {
|
||||
"normal": "User-indicated VAT with documentorprojectionpremise;missing/invalidamountororigin remainsindeterminate,no inferrednormalrate/base",
|
||||
"conditional": "Explicit hypotheticalassumption+materialconditions/context required;unknown/contradictedconditions giveindeterminate;0.00 onlylabelledhypotheticalconditionalexemption,notgrantedorapplied",
|
||||
"application": "Never modifies VATresults,field11,ModeloAtotals orrequeststatus;evenrecordeddeferido doesnotautoapply"
|
||||
},
|
||||
"reuse": "Existingper-opportunity reference reuse fills emptyfields only;optional availabledocuments canappend primaryreference without overwriting otherdocuments;all27priorfiscalbooks andoldofferhistory/deliberatepurpose preservedexactly",
|
||||
"verification": {
|
||||
"frontend": {
|
||||
"passed": 4,
|
||||
"failed": 0,
|
||||
"scope": "requestnotgrant,scopeddecisionhistory includingexact/literalperiods,P085ownpurpose,scenariopremises,save/recover/reportpreservation",
|
||||
"record": "latestnode:test outputthissession;acceptedoldproofs not rerun"
|
||||
},
|
||||
"privateAPI": {
|
||||
"tests": 1,
|
||||
"assertions": 31,
|
||||
"target": "simulator_fiscal_delta_20261021_test:55441",
|
||||
"rollback": true,
|
||||
"xml": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-offer-paths-20261024\\api-tests.xml"
|
||||
},
|
||||
"types_final": "passed",
|
||||
"production_build_final": "passed;existingplugin/chunkwarnings",
|
||||
"UI": "CodexEdgeCUA:presentedstate,priorpartialgrantNovemberonly,normal800/conditional0hypothesis;withdrawassumption->indeterminate;incompletescopecannotreplacepriorrecord;P085humanitarianpurpose/normal160;version/save/recover/reportwithallrecords,4historicalversions. Exact/literalperiodvariants coveredbyunit tests,not separateUIclaim;notmanualTempoacceptance"
|
||||
},
|
||||
"regulatory_correspondence": {
|
||||
"status": "Still not demonstrated;not closed or declarednonexistent",
|
||||
"established_chain": "ModelI.1/Despacho06Jan2010->Decreto56/2009art2->CBFLei4/2009;not demonstrated implementinglinkCIVA14(3)",
|
||||
"this_session": "Jointtargetedqueries foundno newlyestablishedprimarylink;directATfiscal listing returnedno readabletoolcontent,whichisnot evidenceofabsence;no unreadsources adopted",
|
||||
"next": "Locate/read specific14(3) implementinglink or expressly applicable procedure,withinternalacquisition/import scope and amendments;onlythenapplyrespectivebenefit",
|
||||
"no_invented_requirements": "No certificate,taxclearance,projectapproval,newauthorityorapprover created;Tempo productclarification isnotdocumentaryproof"
|
||||
},
|
||||
"counts": {
|
||||
"delivered": 75,
|
||||
"QA_complete_branches": 0,
|
||||
"functional_pending": 57,
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
},
|
||||
"installed": "G6E/P052c1314cdf,receipt536559d6;thisclarification946fc089QAonly,nopush/install",
|
||||
"preservation_before_tests": {
|
||||
"frozen": "tests\\frontend\\fixtures\\iva-g6e-inputs.json",
|
||||
"sha256": "f1ac7bd08994dfcf34f8567dffca98acf945f722093791ce8bbe94d679ac3af5",
|
||||
"accepted_delivered_before_install": 74,
|
||||
"accepted_QA": [
|
||||
"P052"
|
||||
],
|
||||
"preserved": "27fiscalbooks+offerbook(2rows,deliberateedits,histories)",
|
||||
"confirmed_losses": [],
|
||||
"scope": "Tempo explicitP084requeststates/scopeddecision,P085emergency/humanitarianpurpose,normal/conditionalhypotheticalscenarios;no automaticbenefit/activechange",
|
||||
"installation_in_progress": "c1314cdf;separateverifiedreceipt"
|
||||
},
|
||||
"limits": "L1open;P001only05/06;beveragesL2/L3;Statistics/AIdeferred;classificationdistinctfromdeduction/field11;L1closuredoesnotrequireL2/L3/alltaxes"
|
||||
}
|
||||
@@ -58,5 +58,11 @@
|
||||
"P001": 1,
|
||||
"total": 133
|
||||
},
|
||||
"limits": "L1open;P001only05/06;beveragesL2/L3;Statistics/AIdeferred;classification separatefromfield11;L1closure doesnotdepend onL2/L3/alltaxes"
|
||||
"limits": "L1open;P001only05/06;beveragesL2/L3;Statistics/AIdeferred;classification separatefromfield11;L1closure doesnotdepend onL2/L3/alltaxes",
|
||||
"draft_delivery_followup": {
|
||||
"served_commit": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"receipt": "l1-g6e-delivery-20261024.json",
|
||||
"status": "Originaldraftpreparationavailable;notfullbenefitclosure",
|
||||
"new_request_states_scenarios": "Not included;separateQAafterthisrelease"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
|
||||
"status": "installed_delta_verified_partial_L1",
|
||||
"candidate": "1565aa4ffb13fae75e925ccdb2b7553a9b111dd5",
|
||||
"last_installed": "2d889a21",
|
||||
"coverage": {
|
||||
@@ -50,8 +50,8 @@
|
||||
],
|
||||
"ancestry_scope_warning": "Candidate also contains uninstalledP084/P085draftpreparation5ec2f198,not benefits;future deliverymust identify totalinstalleddelta and preserve those drafts,not countP084/P085 asclosed",
|
||||
"counts_current": {
|
||||
"delivered": 74,
|
||||
"QA": 1,
|
||||
"delivered": 75,
|
||||
"QA": 0,
|
||||
"functional_pending": 57,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
@@ -177,5 +177,172 @@
|
||||
"source_dump_sha256": "e6b37683c01019b2fc361a3ff33f6be0f2ebf6f5a1a23c4a81dc95ea278dd9b9",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"served_commit": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"installation": {
|
||||
"protected": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"release": "/var/www/investmoz-homologacao/releases/c1314cdf90c368b51489aaf04c2cdbe59cfb88e6-d4800fe2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/2d889a211ba303db31dcba815e439456dfba9f36-dac24b34",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"runtime_files_verified": 7,
|
||||
"persistent_files_and_env_verified": 369,
|
||||
"tables_compared": 174,
|
||||
"changed_tables": {
|
||||
"cache": {
|
||||
"before": {
|
||||
"rows": 105,
|
||||
"checksum": "2df1487be225c60843f9f0ef9f07ed71"
|
||||
},
|
||||
"after": {
|
||||
"rows": 105,
|
||||
"checksum": "286378eec2e9e387ecfbeb156f168fca"
|
||||
}
|
||||
},
|
||||
"sessions": {
|
||||
"before": {
|
||||
"rows": 41,
|
||||
"checksum": "0e709e11078a7c89e010c3f670d6f207"
|
||||
},
|
||||
"after": {
|
||||
"rows": 42,
|
||||
"checksum": "da381873ffd7fe5eaa5ab5996ca602ab"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T18:25:28.022659+00:00",
|
||||
"manifest_sha256": "efd98a5b7940896109788186b7deedd09ce7dc44f391e3c618e7ec1ee82e6b7d"
|
||||
},
|
||||
"manifest_hash_matches": true,
|
||||
"compiled_delta_markers": {
|
||||
"import-onboard-supplies/1": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"ship_provisions_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"ship_fuel_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"ship_technical_products_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"ship_cargo_accessories_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"aircraft_provisions_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"aircraft_fuel_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"aircraft_technical_products_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"aircraft_cargo_accessories_import": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"supplyNoCoastalFishing": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"supplyNormalTanks": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"offerPreparations": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
],
|
||||
"benefício não aplicado": [
|
||||
"assets/project-dossier-RK4qLB-o.js"
|
||||
]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"file": "assets/simulation-form-CPZAFZU3.js",
|
||||
"status": 200,
|
||||
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-document-CIQlqNrD.js",
|
||||
"status": 200,
|
||||
"sha256": "081f2d08cfe70c8ca035c9da6022cfd88f1980ca8e5433eb3d16f96971e080eb"
|
||||
},
|
||||
{
|
||||
"file": "assets/services-CqPgbMxW.js",
|
||||
"status": 200,
|
||||
"sha256": "ee59b7a86ed1cb4e6e171c3ef65e114f8f2fbe91d76aac4194b58706f49c50c1"
|
||||
},
|
||||
{
|
||||
"file": "assets/project-dossier-RK4qLB-o.js",
|
||||
"status": 200,
|
||||
"sha256": "580dc668b93ff861cf4757a47de165c0575255ed77e19816a566b6efcf80d0c7"
|
||||
}
|
||||
],
|
||||
"simulator_status": 200,
|
||||
"simulator_entry": "assets/app-DdR4Impy.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": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"release": "/var/www/investmoz-homologacao/releases/c1314cdf90c368b51489aaf04c2cdbe59cfb88e6-d4800fe2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/2d889a211ba303db31dcba815e439456dfba9f36-dac24b34",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"latest_report": {
|
||||
"status": "installed",
|
||||
"commit": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"release": "/var/www/investmoz-homologacao/releases/c1314cdf90c368b51489aaf04c2cdbe59cfb88e6-d4800fe2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/2d889a211ba303db31dcba815e439456dfba9f36-dac24b34",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0,
|
||||
"requested_commits": [
|
||||
"c1314cdf90c368b51489aaf04c2cdbe59cfb88e6"
|
||||
],
|
||||
"finished_at": "2026-10-24T18:25:30.464203+00:00"
|
||||
},
|
||||
"log_file": "1792866235841214128.log",
|
||||
"summaries": [
|
||||
"OK (1 test, 3106 assertions)",
|
||||
"built in 25.41s",
|
||||
"OK (59 tests, 317 assertions)",
|
||||
"# tests 327",
|
||||
"# pass 327",
|
||||
"# fail 0"
|
||||
],
|
||||
"log_bytes": 123869
|
||||
},
|
||||
"rollback_executed": false
|
||||
},
|
||||
"activation": "NormalGitFF/webhook/installer;zero migrations/imports"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
{
|
||||
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
|
||||
"candidate": "29e708ba2dca2450eaff8eff6f5e19079ffc7f8e",
|
||||
"base_installed": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"coverage_complete_branches": {
|
||||
"AUD-SIM-L1-P050": [
|
||||
"service_in_customs_value",
|
||||
"accessory_service_first_destination"
|
||||
]
|
||||
},
|
||||
"branch_count_complete": 1,
|
||||
"treatment_count_P050": 2,
|
||||
"partial_coverage_P084_P085": {
|
||||
"authorized_partial_candidate": "946fc089",
|
||||
"next_delivery_scope": "Preparation/requeststates/scopeddecisions/humanitarianpurpose/normalandconditionalhypotheticalscenarios,notconfirmedbenefit/notclosing2branches",
|
||||
"documentary_scope": "IdentifyexpressapplicableCIVA14(3)procedure/link and amendments;distinguishP084internal/import andP085acquisition. ModelI.1/Despacho/CBFcotejo reused,not repeated;do notinventcertificates/approvers orclaimregulation nonexistent",
|
||||
"preserved": "Allrows,scopeversions,deliberateedits,normal/conditionalinputs andhistory exactlyequalfrozenfixture"
|
||||
},
|
||||
"runtime_delta_total": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-import-exemptions.ts",
|
||||
"sha256_LF": "1e6005f87eafa9db9cd032c8c3f01ae23f1755b33c20d0925538dd427ce25868"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-import-exemptions.tsx",
|
||||
"sha256_LF": "656945b77e1e9f8f059b184969de783a1e2c9a1252af0084cf53ebc2bf249cb8"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-offer-preparations.ts",
|
||||
"sha256_LF": "23a84aa1e87d6a6defbca1e0c5eee96deb4619ffc1980881f2f69abfe54f81c1"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-offer-preparations.tsx",
|
||||
"sha256_LF": "e8ad2edd142736269b5a119de5270e67086a79b26d476105dcd290393b6b94ed"
|
||||
}
|
||||
],
|
||||
"runtime_delta": [
|
||||
{
|
||||
"path": "resources/js/lib/iva-import-exemptions.ts",
|
||||
"sha256_LF": "1e6005f87eafa9db9cd032c8c3f01ae23f1755b33c20d0925538dd427ce25868"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-import-exemptions.tsx",
|
||||
"sha256_LF": "656945b77e1e9f8f059b184969de783a1e2c9a1252af0084cf53ebc2bf249cb8"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/lib/iva-offer-preparations.ts",
|
||||
"sha256_LF": "23a84aa1e87d6a6defbca1e0c5eee96deb4619ffc1980881f2f69abfe54f81c1"
|
||||
},
|
||||
{
|
||||
"path": "resources/js/components/simulation-offer-preparations.tsx",
|
||||
"sha256_LF": "e8ad2edd142736269b5a119de5270e67086a79b26d476105dcd290393b6b94ed"
|
||||
}
|
||||
],
|
||||
"counts_current": {
|
||||
"delivered": 75,
|
||||
"QA": 1,
|
||||
"functional_pending": 56,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_P050_delivery_only": {
|
||||
"delivered": 76,
|
||||
"QA": 0,
|
||||
"functional_pending": 56,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"QA_proofs_reused": [
|
||||
"iva-l1-g6f-qa-20261024.json",
|
||||
"iva-l1-offer-paths-qa-20261024.json"
|
||||
],
|
||||
"authorization": "Tempo24/10 explicitly deploy29e708ba viaexistingGit,including946fc089onlypartialpreparation/conditionalsimulationP084/P085;preserveconcurrentchanges,installeddeltaonly",
|
||||
"fresh_backup_restore": "Required freshauthenticateddestination/main,backup/realisolatedrestore beforeinstallation;accepted75closuresreused,installeddeltaonly",
|
||||
"limits": "L1open;P001only05/06;beveragesL2/L3;classificationseparatefromfield11;Statistics/AIdeferred;L1closuredoesnotrequireL2/L3/alltaxes",
|
||||
"counts_before": {
|
||||
"delivered": 75,
|
||||
"QA": 1,
|
||||
"functional_pending": 56,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"counts_after_delivery": {
|
||||
"delivered": 76,
|
||||
"QA": 0,
|
||||
"functional_pending": 56,
|
||||
"documentary": 1,
|
||||
"total": 133
|
||||
},
|
||||
"scope": "P050onecompletebranch/twotreatments;P084/P085partialrequest/emergencydrafts/scenarios,notconfirmedbenefits/notclosing2branches",
|
||||
"authenticated_preflight": {
|
||||
"installed": {
|
||||
"status": "installed",
|
||||
"commit": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"release": "/var/www/investmoz-homologacao/releases/c1314cdf90c368b51489aaf04c2cdbe59cfb88e6-d4800fe2",
|
||||
"previous_release": "/var/www/investmoz-homologacao/releases/2d889a211ba303db31dcba815e439456dfba9f36-dac24b34",
|
||||
"database_migrations": 0,
|
||||
"content_imports": 0
|
||||
},
|
||||
"current_link": "/var/www/investmoz-homologacao/releases/c1314cdf90c368b51489aaf04c2cdbe59cfb88e6-d4800fe2",
|
||||
"release_revision": {
|
||||
"commit": "c1314cdf90c368b51489aaf04c2cdbe59cfb88e6",
|
||||
"branch": "main",
|
||||
"built_at": "2026-10-24T18:25:28.022659+00:00",
|
||||
"manifest_sha256": "efd98a5b7940896109788186b7deedd09ce7dc44f391e3c618e7ec1ee82e6b7d"
|
||||
},
|
||||
"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-g6f-delivery-20261024/backup",
|
||||
"target": {
|
||||
"database": "teste_investidor",
|
||||
"port": 5432
|
||||
},
|
||||
"tables": 174,
|
||||
"files_verified": 369,
|
||||
"dump_sha256": "91632c927b4a7de70ca06690c7dc50936b2975ee31c53d5781461583fdca9cda",
|
||||
"files_sha256": "ebb421927381bb5c1cdb536eea61739fb4134b51faaf2f57b773222655b1c0b9",
|
||||
"restore_verified": false
|
||||
},
|
||||
"restore": {
|
||||
"restore_verified": true,
|
||||
"tables_verified": 174,
|
||||
"container_network": "none",
|
||||
"database": "l1_g6f_restore_20261024",
|
||||
"port": 55441,
|
||||
"source_dump_sha256": "91632c927b4a7de70ca06690c7dc50936b2975ee31c53d5781461583fdca9cda",
|
||||
"active_database_writes": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/resources/js/lib/iva-import-exemptions.ts
|
||||
+++ b/resources/js/lib/iva-import-exemptions.ts
|
||||
@@ -102,6 +102,7 @@
|
||||
}
|
||||
export function importExemptionCurrent(draft:Record<string,unknown>,book:ImportExemptionBook):boolean {return !!book.result&&book.result.sourceKey===key(draft,book);}
|
||||
export function recordImportExemptions(draft:Record<string,unknown>,book:ImportExemptionBook):ImportExemptionBook {
|
||||
+ throw new Error('Novas classificações de importação/serviços temporariamente suspensas; dados, histórico e relatórios preservados.');
|
||||
if(!book.rows.length||new Set(book.rows.map(r=>r.id)).size!==book.rows.length)throw new Error('Indique importações com identificadores distintos; versões anteriores conservadas.');
|
||||
const result:ImportExemptionCalculation={version:importExemptionVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:[...new Set(book.rows.map(row=>importRuleSource(row.treatment)))].join(' | '),inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateImportExemption(row,draft.currency))};
|
||||
return {...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};
|
||||
@@ -1,6 +1,56 @@
|
||||
# Rastreabilidade, utilização e formação
|
||||
|
||||
|
||||
## 24/10/2026 — G6F/P050 demonstradoQA,candidata 29e708ba
|
||||
|
||||
**Umramo/doistratamentos:**service_in_customs_value eaccessory_service_first_destination. CIVA12(1)(e),Lei13/2016PDF11/p1426(269),16(1)/16(1)(b)/16(2),PDF14/p1426(272);2022PDF1–2/2025PDF12–13mantêmeporremissãoenãoalteram16. Valorintegraldoserviçodalinha incluídonabase tributável da importação identificada,oujácompreendidonovaloraduaneirooucomoacréscimoacessórioatéo primeirodestino(doc.transporteou,na falta,primeirarupturadecarganointeriordoPaís). Perfisdivisão técnica,nãocondiçõesorganizacionaisnovas. Referênciadaimportação/base/montantedoserviço/documento/fundamentoexpresso;primeirodestinoapenasnoacessório. Camposbenssem aplicaçãoocultos,conservandodadosao mudarperfil. Projecçãocompressuposto,nãocertificaçãoATinventada. SaídaprópriaserviceVat,importVatnullP050;IVAdoserviço,nãoIVAdosbens,nãorecalcula/somabaseaduaneira,nãocalculadireitos,taxanormal,campo11oucorrecçãofactura. Unknown→indeterminado,não→nãoaplicaestaisençãocomimpostonormalporenquadrar.
|
||||
|
||||
4testesnovos aprovados,APIprivadaQA1/30asserções/rollback/guarda*_test:55441,tipos/buildfinaisaprovados,avisospreexistentesplugins/chunks;armazenamentosintéticoUTF8 1testeaprovado. UICodex/Edge-CUA:inclusãoporindicar→indeterminado,não→nãoaplicação,sim→isençãodoserviço;primeirodestinoocultonoperfiljáincluído e códigos/paísdebensocultosnosserviços. Guardar→Recuperar→Relatório2linhasP050,opportunity336/Manica/2026-12,documento14/11/2026/refsDU-A/base,5versõesanteriores. NãoatribuiraceitaçãomanualTempo. 27livrosfiscaisanteriores eP084/P085estados/decisões/âmbitos/cenários/edições/histórico exactamenteiguais,semrecalcularou repetirprovasaceites. Chaves/fontesantigasactuais,nova versãoimport-included-services/1sólivroscomserviços. Testedereferênciamalfomadaidentificoufaltadevalidaçãoantesdaescrita,nãoperdaactiva:corrigidopara validarJSONantesderetornar/onChange;originais nãosobrescritos. ServiçosP050 excluídosdasreferênciasdebensimportadosnasofertasP084/P085,sem converterserviços em bens.
|
||||
|
||||
[RegistoQA](../simulations/iva-l1-g6f-qa-20261024.json),[manifestopreparado](../simulations/l1-g6f-delivery-20261024.json):4ficheirosruntime totais,comP050e946fc089parcialautorizadana próximaentrega;P084/P085preparação/simulaçãocondicionada,nãobenefíciosconfirmadosoufecho. Contençãoconferidanãoaplicada,leitores/históricomantidos. **75entregues+1QA(P050)+56funcionaispendentes+P001=133.** Homologaçãoc1314cdf/536559d6mantida;nenhumpush/instalação/alteraçãoactiva. PesquisaP084/P085delimitadaàcorrespondênciaexpressa14(3)/procedimentoaplicávelealterações,distinguindoaquisiçãointerna/importação;ModelI.1/CBFjáconferidonãorepetido,nãoprovaausênciaderegulamento,nãocria certificados/aprovadores;rascunhospreservados. L1aberto;P001só05/06;bebidasL2/L3;classificaçãoseparadacampo11;Estatísticas/IAadiadas;L1nãoexigeL2/L3/todosimpostos.
|
||||
|
||||
|
||||
|
||||
## 24/10/2026 — preparação G6F/P050 e próxima entrega parcial946fc089
|
||||
|
||||
TempoaceitouG6E/P052c1314cdf/536559d6;**75entregues+57funcionaispendentes+P001=133**. Autorizou946fc089na próximaentrega como preparação/simulação condicionadaP084/P085,coberturaparcial,nãobenefíciosconfirmadosnemfecho. Nãoinstaladaautomaticamente nesta passagemQA;incluirâmbitototalexpresso nomanifestoseguinte. PesquisaP084/P085delimitadaàligação/procedimentoregulamentar14(3),âmbitosdistintos,semrepetircotejoModelI.1/CBFjáaceite neminventarcertificados/aprovadores. Rascunhos/âmbitos/cenários/históricopreservados,nãobloqueiamramosindependentes.
|
||||
|
||||
Inventárioantesdostestes:75fechos;27livrosfiscais+1livroderascunhosP084/P085 comestados/decisões,âmbitos,edições/cenários eversões congelados,fixtureiva-offer-paths-inputs.json;semperdasconfirmadas. Provasaceitescódigo/schema/dados/configuração/permissõesdestinoreutilizadas,174tabelas/369ficheiros/29fichas/28relações/408geometrias;semrecalcularanterioresouescrevernoactivo.
|
||||
|
||||
**G6F/P050**:CIVA12(1)(e),Lei13/2016PDF11/p1426(269);valor do serviço incluídona basetributável daimportaçãodebens,conforme16. Art16(1)valoraduaneiro eacréscimosna medidaquenãoincluídos;16(1)(b)despesasacessórias(embalagem/transporte/seguros/outrosencargos)atéprimeirodestinonointeriordoPaís;16(2)destinododocumentodetransporteou,na suafalta,primeirarupturadecarganointeriordoPaís. Página14/p1426(272)conferida integralmente,nãoaplica17%históricoimpressonessapáginacomo taxapresente. Distinguir valorjácompreendidonovaloraduaneiro eparcelaacessória adicionadaconforme16(1)(b)/2;duasperfisdeumramo,sem duplicarserviço/bemou presumir inclusão porcategoriasectorial. Nãosomavalorcalculadoàbaseaduaneira,nãocalculaIVA dosbensnemdireitos,nãopreenchecampo11;resultadoexpressamenteIVA do serviço. Informações/desconhecidosnãozeramimposto;projecçõescomfundamentoexplícito,semcertificaçãoATinventada. Fontesaceites/inventáriosoriginais/hashesreutilizados,semsegundavalidação. L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.
|
||||
|
||||
|
||||
|
||||
## 24/10/2026 — percursos distintos P084/P085 e cenários demonstradosQA
|
||||
|
||||
Candidata`946fc089`,[registo](../simulations/iva-l1-offer-paths-qa-20261024.json). OrientaçãoexpressaTempo incorporada nosrascunhos existentes,novoscampos opcionais/retrocompatíveis. P084:estadosdeclarados preparação/apresentado/deferido/indeferido,referências/documentos/datas disponíveis e registosversionadosdeâmbito(bens,operação,período,condições). Guardar rascunho incompleto continua permitido;pararegistardecisão conserva os4elementosdeâmbitopedidosTempo. Datasexactas,meses outextoliteraldoâmbito(porexemploatérevogação/semtermo,operaçõesconjuntas) são conservados,sem inventarfimoualargarconcessãoaoutrosbens/períodos/oportunidades. Documento/datadisponíveis,nãocertificado/aprovadornovo. TodososregistosanterioresaparecemnoUI/relatório;ediçõesnopididoactual nãosobrescrevemdecisãoanterior. Registar estado nãoapresentapedidoàautoridade nemconcedeisençãopelosimulador.
|
||||
|
||||
P085:emergência/calamidade,natureza,finalidadehumanitária,bens,destinatário/documentosdisponíveis,mitigação;sem impor estadosP084oualargar automaticamenteaimportação. Reutilização explícita de dados/documentoda mesmaoportunidade mantémcamposeditados eoriginais;referênciadodocumentojáindicado podejuntar-seàlistaexistentesem sobrescreveroutrosdocumentos. Procedimentodeemergência/doação sóseráaplicadoquando correspondênciaestiverdemonstrada.
|
||||
|
||||
Comparação:cenárionormalusaIVAindicado eorigem/documento/pressuposto,nãotaxa/basepresumida. Cenáriocondicionadorequerhipóteseexpressa+condiçõesmateriais/contexto;faltasoucontradiçõesficamindeterminadas,nãozero. Zeroapareceapenasnessahipóteserotulada,nãobenefícioconcedido/aplicado. Apresentarpedidonãoconcedeisenção;nemestadodeferidodeclaradoalteraautomaticamenteimposto/campo11/totaisModeloA. Registosdeâmbito nãoseestendemautomaticamenteàoperaçãoactual. AfonteCIVA14(3)continua pendente;ModelI.1/Despacho/CBFjáconferidos nãodemonstramessacorrespondência. Pesquisa conjunta/procuraATnestasessãonãoproduziunovafonteaplicável;listagemATsemconteúdolegívelpelaferramentanãoprovaausência. Nãoforam adoptadasfontesnãolidasoucriadoscertificados/aprovadores/condiçõesnovas. Restaidentificardisposição/remissão/procedimentoexpressoealterações,concluiraplicaçãodosbenefíciospróprios everificar;sem bloqueardemaisramos.
|
||||
|
||||
4testesnovos aprovados,APIprivadaQA1/31asserções comrollback/guarda*_test:55441,tipos/build finais aprovados,avisospreexistentesplugins/chunks. UICodex/Edge-CUA:pedidoApresentado,decisãoparcialanterior sóbensA/importeNovembro,normal800/condicionado0rotuladohipótese;retirarhipótese→indeterminado;âmbitoincompleto nãoapagaosregistos;P085humanitário/normal160. Guardarversão→Guardar→Recuperar→Relatório,4versõesanteriores eâmbitosanteriores. Variantesdatasexactas/textoliteralsemtermo verificadasnostestes,nãoconferênciamanualTempoatribuída. 27livrosfiscais,históricos/ediçõesderascunhosanteriores preservados;sem schemanovoesemrepetirprovasaceites.
|
||||
|
||||
**75entregues+57funcionaispendentes+P001=133**;P084/P085 incluídos57,nãoramostotalmenteconcluídosQA. Homologação`c1314cdf`,recibo`536559d6`(P052entregue);clarificação946fc089apenasQA,nãopushada/instalada. L1aberto;P001só05/06;bebidasL2/L3;classificaçãoseparadacampo11;Estatísticas/IAadiadas;L1nãodependedeL2/L3/todosimpostos.
|
||||
|
||||
|
||||
|
||||
## 24/10/2026 — G6E/P052 entregue na homologação c1314cdf
|
||||
|
||||
Tempoaceitou1565aa4f eautorizouGit/deltainstalado. **P052,umramo/oitotratamentos:**ship_provisions_import,ship_fuel_import,ship_technical_products_import,ship_cargo_accessories_import;aircraft_provisions_import,aircraft_fuel_import,aircraft_technical_products_import,aircraft_cargo_accessories_import. CIVA12(1)(g),12(3),13(3),2026/MZN. ProvasQAaceites reutilizadas,nãorepetidas. GitFF2d889a21→c1314cdf,sem avançoconcorrente encontrado,sessãoSSHpronta reutilizada semregistarcredenciais. Backupnovo/restauroreal isoladosemrede174tabelas/369ficheiros;delta revisão servida/manifesto/hash/13marcadores/7ficheirosfuncionais/simuladorHTTP200. 174tabelas/369ficheiros/configuração e29fichas/28relações/408geometrias preservados,mesmoactorpostgresantes/depois,sócache/sessõesdiferentes;zeromigrações/importações/alteraçõespermissões/ensaiossintéticosnoactivo.
|
||||
|
||||
Âmbitototalexpresso:3ficheirosG6E(classificador/componente/limitetécnicoAPI4M) e4ficheirosancestrais depreparaçãoP084/P085(5ec2f198),sem aplicação dobenefício. Essesrascunhos anteriores passamdisponíveiscomcontexto/gravação/relatório;P084/P085 nãofechados. A nova clarificaçãoTempo deestadosdecisão/cenários/distinçãohumanitária ainda está emQA local,nãoincluídanestarevisão. Backup/release anterioresconservados,contençãoconferidanãoaplicada,leitores/históricomantidos. [Manifesto/recibo](../simulations/l1-g6e-delivery-20261024.json),registo`iva_l1_g6e_P052_homologation_20261024`.
|
||||
|
||||
**75entregues+57funcionaispendentes+P001=133;semcandidatas de ramo completoQA porentregar.** 74fechosanteriores preservados;P084/P085 incluídos57,rascunhos/cotejo nãoequivalemabenefíciosconcluídos. L1aberto;P001só05/06;classificaçãoimportação separada dededução/campo11;bebidasL2/L3;Estatísticas/IAadiadas;L1nãoexigeL2/L3/todosimpostos.
|
||||
|
||||
|
||||
|
||||
## 24/10/2026 — preparação dos percursos distintos de ofertas,antes dos testes
|
||||
|
||||
InstruçãoexpressaTempo:P085emergência/finalidadehumanitária,bens,destinatário/documentos disponíveis,procedimento sóquando correspondênciademonstrada. P084justificação/pedido,estados preparação/apresentado/deferido/indeferido;apresentação não concedeisenção;decisão conserva âmbito:bens,operação,período,condições/documento. Cenárionormal econdicionado explicitamentehipotético,nãoconcedido;sem inferirtaxa/basefaltante nem alimentarcampo11. OrigemTempo,não interpretação jurídicaCodex. CorrespondênciaCIVA14(3)pendente;ModelI.1/Despacho/CBF não a substituem;sem certificados/aprovadores novos. Rascunhos compatíveis,novoscampos opcionais;inventário pré-testes27livrosfiscais+2rascunhos/edições/históricos preservados,74entregues+P052QAaceites,sem perdasconfirmadas. Instaladorc1314cdf emexecução,reciboseparado apósdelta;semalteraçãoactiva por esta preparação. Mesma matriz e manual,sem novo backlog.
|
||||
|
||||
|
||||
|
||||
## 24/10/2026 — G6E/P052 demonstradoQA,candidata 1565aa4f
|
||||
|
||||
**Umramo/oitotratamentos:**ship_provisions_import,ship_fuel_import,ship_technical_products_import,ship_cargo_accessories_import;aircraft_provisions_import,aircraft_fuel_import,aircraft_technical_products_import,aircraft_cargo_accessories_import. Lei13/2016,CIVA12(1)(g),12(3)(a)(i–iv)/(b),13(3),PDF11–12/p1426(269–270);2022/2025g/3 mantidos por remissão. Perfis são divisão técnica para ocultar condições sem aplicação:exclusões de embarcação sóprovisões deembarcação;depósitosnormais sócombustíveis/carburantes;produtostécnicos/lubrificantes eacessórioscarga comnaturezaprópria. Não importar condição de companhiaprincipalmenteinternacionalP054 nem elegibilidade deoperações/vendas13(1)(c/d/f). Fonte/período/documento/fundamento econdições exigidos para classificar,não para conservarrascunho;desconhecido→indeterminado,não→nãoaplicação desta isenção,sem imposto normal presumido. Nova versãoimport-onboard-supplies/1 sólivroscomP052,chaves/fontes anteriores mantidasactuais.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
import { useState } from 'react';
|
||||
import { importExemptionBook,importExemptionCurrent,importExemptionReportRows,importExemptionRules,importRuleSource,newImportExemption,recordImportExemptions,saveImportExemptionBook,type ImportExemptionBook,type ImportExemptionRow } from '@/lib/iva-import-exemptions';
|
||||
import { importExemptionBook,importExemptionCurrent,importExemptionReportRows,importExemptionRules,importRuleSource,isImportService,newImportExemption,recordImportExemptions,saveImportExemptionBook,type ImportExemptionBook,type ImportExemptionRow } from '@/lib/iva-import-exemptions';
|
||||
|
||||
export function SimulationImportExemptions({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}) {
|
||||
const [error,setError]=useState('');
|
||||
@@ -8,25 +8,28 @@ export function SimulationImportExemptions({draft,onChange}:{draft:Record<string
|
||||
const save=(next:ImportExemptionBook)=>{try {onChange('modelo_a_snapshot',saveImportExemptionBook(draft,next));setError('');}catch(cause){setError(String(cause));}};
|
||||
const change=(id:string,patch:Partial<ImportExemptionRow>)=>save({...book,rows:book.rows.map(row=>row.id===id?{...row,...patch}:row)});
|
||||
return <details className="space-y-3 rounded border p-3">
|
||||
<summary>IVA na importação — enquadramentos disponíveis</summary>
|
||||
<summary>IVA na importação e serviços associados — enquadramentos disponíveis</summary>
|
||||
<p>Oportunidade: {String(draft.context_opportunity||'entrada geral')}. Indique apenas importações relevantes: reimportação no mesmo estado, ouro pelo Banco de Moçambique, objectos de arte, veículo de combate a incêndios, embarcação/avião elegível ou objecto da sua exploração, bens em regime aduaneiro com isenção total de direitos, importação sob controlo alfandegário em zona/depósito/loja franca nas condições próprias, ou bens de abastecimento a bordo de embarcação/avião de navegação internacional. Escolha o ramo para apresentar as condições aplicáveis. Cobertura2026/MZN; as compras internas e os seus resultados conservam-se.</p>
|
||||
<p>O valor declarado/previsional é conservado, sem o fixar como base aduaneira. A classificação não preenche o campo11 de dedução nem os totais do ModeloA. Uma condição não cumprida afasta só esta isenção; o imposto normal fica por enquadrar. Nas projecções, as respostas são pressupostos, sem certificação aduaneira.</p>
|
||||
<p>Nos serviços associados, identifique a importação e a inclusão do valor na sua base, conforme o artigo16. O IVA do serviço é apresentado separadamente do IVA dos bens; o simulador não soma novamente esse valor à base.</p>
|
||||
{error&&<p role="alert">{error}</p>}
|
||||
<button type="button" className="underline" onClick={()=>save({...book,rows:[...book.rows,newImportExemption(crypto.randomUUID(),String(draft.currency??''))]})}>Acrescentar importação relevante</button>
|
||||
<button type="button" className="underline" onClick={()=>save({...book,rows:[...book.rows,newImportExemption(crypto.randomUUID(),String(draft.currency??''))]})}>Acrescentar importação ou serviço relevante</button>
|
||||
{book.rows.map(row=>{
|
||||
const rule=importExemptionRules.find(item=>item.id===row.treatment);
|
||||
return <details key={row.id} className="rounded border p-3"><summary>{row.description||'Importação por identificar'} — {row.period||'mês por indicar'}</summary>
|
||||
<div className="grid gap-3 md:grid-cols-2">
|
||||
<label>Ramo da importação<select className="block rounded border p-2" value={row.treatment} onChange={e=>change(row.id,{treatment:e.target.value})}><option value="">Por indicar</option>{importExemptionRules.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 ImportExemptionRow['origin']})}><option value="projected">Projectados / pressupostos</option><option value="effective">Efectivos declarados</option></select></label>
|
||||
{(['description','importer','declaredValue','goodsCode','originCountry','documentRef','documentDate','period','evidence'] as const).map((field,index)=><label key={field}>{['Bens importados','Importador','Valor declarado / previsão (moeda indicada)','Código aduaneiro, se disponível','País de origem, se disponível','Documento aduaneiro / referência da previsão','Data do documento / prevista','Mês da importação','Fundamento factual das condições / pressupostos'][index]}<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>)}
|
||||
{(['description','importer','declaredValue','goodsCode','originCountry','documentRef','documentDate','period','evidence'] as const).map((field,index)=>isImportService(row.treatment)&&['goodsCode','originCountry'].includes(field)?null:<label key={field}>{isImportService(row.treatment)&&field==='description'?'Serviço associado à importação':isImportService(row.treatment)&&field==='importer'?'Importador destinatário do serviço':isImportService(row.treatment)&&field==='declaredValue'?'Valor do serviço incluído na base (moeda indicada)':isImportService(row.treatment)&&field==='documentRef'?'Documento do serviço / referência da previsão':isImportService(row.treatment)&&field==='period'?'Mês do serviço':['Bens importados','Importador','Valor declarado / previsão (moeda indicada)','Código aduaneiro, se disponível','País de origem, se disponível','Documento aduaneiro / referência da previsão','Data do documento / prevista','Mês da importação','Fundamento factual das condições / pressupostos'][index]}<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>)}
|
||||
{isImportService(row.treatment)&&(['serviceImportRef','serviceBaseRef','serviceProvider'] as const).map((field,index)=><label key={field}>{['Importação de bens associada / documento ou previsão','Referência da base tributável que inclui o valor do serviço','Prestador do serviço, se disponível'][index]}<input className="block rounded border p-2" value={row[field]??''} onChange={e=>change(row.id,{[field]:e.target.value})}/></label>)}
|
||||
{row.treatment==='accessory_service_first_destination'&&<label>Primeiro destino e documento de transporte ou primeira ruptura de carga<input className="block rounded border p-2" value={row.serviceFirstDestination??''} onChange={e=>change(row.id,{serviceFirstDestination:e.target.value})}/></label>}
|
||||
<label>Moeda de origem<input className="block rounded border p-2" value={row.currency} onChange={e=>change(row.id,{currency:e.target.value})}/></label>
|
||||
</div>
|
||||
{rule?<><p>{importRuleSource(row.treatment)}</p><fieldset><legend>Condições de{rule.article}; respostas conservadas ao mudar de ramo</legend>{rule.conditions.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 ramo para apresentar apenas as condições aplicáveis; as respostas anteriores mantêm-se.</p>}
|
||||
<p>Editar não substitui o resultado anterior. Ao classificar novamente, a versão anterior passa ao histórico.</p>
|
||||
</details>;
|
||||
})}
|
||||
{!!book.rows.length&&<button type="button" className="rounded bg-emerald-800 p-2 text-white" onClick={()=>{try {save(recordImportExemptions(draft,book));}catch(cause){setError(String(cause));}}}>Classificar importações e guardar versão</button>}
|
||||
{!!book.rows.length&&<button type="button" className="rounded bg-emerald-800 p-2 text-white" onClick={()=>{try {save(recordImportExemptions(draft,book));}catch(cause){setError(String(cause));}}}>{book.rows.some(row=>isImportService(row.treatment))?'Classificar importações e serviços e guardar versão':'Classificar importações e guardar versão'}</button>}
|
||||
{book.result&&<><p role="status">{importExemptionCurrent(draft,book)?'Classificação correspondente às entradas guardadas.':'Entradas alteradas; classificação histórica preservada. Reveja e classifique novamente.'} {book.history?.length??0} versões anteriores.</p><dl>{importExemptionReportRows(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>;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from 'react';
|
||||
import { newOfferPreparation,offerPreparationBook,offerPreparationSource,offerReusableData,recordOfferPreparations,reuseOfferData,saveOfferPreparationBook,type OfferPreparation,type OfferPreparationBook } from '@/lib/iva-offer-preparations';
|
||||
import { newOfferPreparation,offerPreparationBook,offerPreparationSource,offerReusableData,recordOfferPreparations,reuseOfferData,saveOfferPreparationBook,emptyOfferRequest,recordOfferRequest,offerRequestLabels,offerScenarios,type OfferRequest,type OfferPreparation,type OfferPreparationBook } from '@/lib/iva-offer-preparations';
|
||||
|
||||
export function SimulationOfferPreparations({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}) {
|
||||
const [error,setError]=useState('');let book:OfferPreparationBook;let reusable:ReturnType<typeof offerReusableData>;
|
||||
@@ -10,7 +10,7 @@ export function SimulationOfferPreparations({draft,onChange}:{draft:Record<strin
|
||||
const question=(row:OfferPreparation,key:'nationalInstitution'|'publicSocialInstitution'|'goodsSuitable'|'publicInterestUse'|'mitigation',label:string)=><label className="block" key={key}>{label}<select className="block rounded border p-2" value={row[key]} onChange={e=>change(row.id,{[key]:e.target.value})}><option value="">Por indicar</option><option value="yes">Sim</option><option value="no">Não</option></select></label>;
|
||||
return <details className="space-y-3 rounded border p-3"><summary>Ofertas a instituições e para calamidades — preparar rascunhos</summary>
|
||||
<p>Prepare apenas as ofertas relevantes para a oportunidade {String(draft.context_opportunity||'entrada geral')}. Pode guardar dados incompletos e reutilizar referências existentes. A reutilização preenche apenas campos vazios; as suas edições mantêm-se.</p>
|
||||
<p>O procedimento de aplicação do benefício está em pesquisa. Este rascunho não concede isenção, não calcula IVA nem altera a dedução no campo11. Os restantes enquadramentos continuam disponíveis.</p>
|
||||
<p>O procedimento de aplicação do benefício está em pesquisa. Prepare o pedido e compare o cenário normal com uma hipótese condicionada à isenção. Apresentar o pedido não concede isenção. Estes cenários não alteram a dedução no campo11; os restantes enquadramentos continuam disponíveis.</p>
|
||||
{error&&<p role="alert">{error}</p>}
|
||||
<button type="button" className="underline" onClick={()=>run(()=>save({...book,rows:[...book.rows,newOfferPreparation(crypto.randomUUID(),'P084',String(draft.currency??''))]}))}>Preparar oferta a instituição</button>{' '}
|
||||
<button type="button" className="underline" onClick={()=>run(()=>save({...book,rows:[...book.rows,newOfferPreparation(crypto.randomUUID(),'P085',String(draft.currency??''))]}))}>Preparar oferta para calamidade</button>
|
||||
@@ -21,6 +21,26 @@ export function SimulationOfferPreparations({draft,onChange}:{draft:Record<strin
|
||||
{row.reusedFrom&&<p>Referência reutilizada: {row.reusedFrom.key}. A origem foi conservada; a aquisição/importação original não foi alterada.</p>}
|
||||
<div className="grid gap-3 md:grid-cols-2">{(['description','period','currency','amount','counterparty','documentRef','documentDate','beneficiary','purpose','evidence'] as const).map((key,index)=><label key={key}>{['Bens destinados à oferta','Período previsto / efectivo','Moeda','Valor de referência, sem cálculo fiscal','Fornecedor / importador','Documento / referência da previsão','Data do documento / prevista','Instituição / destinatário da oferta','Finalidade concreta da oferta','Fundamento factual / pressupostos'][index]}<input className="block rounded border p-2" type={key==='period'?'month':key==='documentDate'?'date':'text'} value={row[key]} onChange={e=>change(row.id,{[key]:e.target.value})}/></label>)}</div>
|
||||
{row.branch==='P084'?<fieldset><legend>Condições próprias da oferta à instituição</legend>{question(row,'nationalInstitution','A instituição beneficiária é nacional')}{question(row,'publicSocialInstitution','A instituição tem interesse público e relevantes fins sociais')}{question(row,'goodsSuitable','Os bens são inteiramente adequados à natureza da instituição')}{question(row,'publicInterestUse','A instituição utilizará os bens em actividades de evidente interesse público')}</fieldset>:<fieldset><legend>Finalidade própria da oferta para calamidade</legend><label>Calamidade e contexto afectados<input className="block rounded border p-2" value={row.disaster} onChange={e=>change(row.id,{disaster:e.target.value})}/></label><label>Natureza da calamidade<input className="block rounded border p-2" value={row.disasterKind} placeholder="Cheias, tempestades, secas, ciclones, sismos ou outra de idêntica natureza" onChange={e=>change(row.id,{disasterKind:e.target.value})}/></label>{question(row,'mitigation','Os bens destinam-se a ofertas para atenuar os efeitos da calamidade identificada')}</fieldset>}
|
||||
{row.branch==='P085'&&<label>Finalidade humanitária da resposta à emergência<textarea className="block w-full rounded border p-2" value={row.humanitarianPurpose??''} onChange={e=>change(row.id,{humanitarianPurpose:e.target.value})}/></label>}
|
||||
<label>Documentos disponíveis e respectivas referências<textarea className="block w-full rounded border p-2" value={row.availableDocuments??''} onChange={e=>change(row.id,{availableDocuments:e.target.value})}/></label>
|
||||
{!!row.documentRef&&<button type="button" className="underline" onClick={()=>{const reference=[row.documentRef,row.documentDate].filter(Boolean).join(', ');if(!(row.availableDocuments??'').includes(reference))change(row.id,{availableDocuments:[row.availableDocuments,reference].filter(Boolean).join('\n')});}}>Juntar referência do documento já indicado</button>}
|
||||
{row.branch==='P084'&&(()=>{const request=row.request??emptyOfferRequest();const edit=(patch:Partial<OfferRequest>)=>change(row.id,{request:{...request,...patch}});return <fieldset className="rounded border p-3"><legend>Pedido e âmbito da decisão</legend>
|
||||
<p>Registe o estado declarado e os elementos disponíveis. Este registo não apresenta um pedido à autoridade nem concede o benefício. Conserve o âmbito exacto de cada decisão, mesmo que cubra apenas parte dos bens ou períodos.</p>
|
||||
<label>Estado declarado do pedido<select className="block rounded border p-2" value={request.state} onChange={e=>edit({state:e.target.value as OfferRequest['state']})}>{Object.entries(offerRequestLabels).map(([value,label])=><option key={value} value={value}>{label}</option>)}</select></label>
|
||||
{(['reference','presentedOn','decisionRef','decisionOn','goods','periodFrom','periodTo','conditions'] as const).map((key,index)=><label className="block" key={key}>{['Referência do pedido','Data de apresentação, se disponível','Documento / referência da decisão, se disponível','Data da decisão, se disponível','Bens abrangidos pela decisão','Início do período abrangido','Fim do período abrangido','Condições, limites ou fundamento da decisão'][index]}<input className="block rounded border p-2" type={key==='presentedOn'||key==='decisionOn'?'date':'text'} placeholder={key==='periodFrom'||key==='periodTo'?'AAAA-MM ou AAAA-MM-DD, conforme a decisão':undefined} value={request[key]} onChange={e=>edit({[key]:e.target.value})}/></label>)}
|
||||
<label>Operação abrangida pela decisão<select className="block rounded border p-2" value={request.operation} onChange={e=>edit({operation:e.target.value as OfferRequest['operation']})}><option value="">Por indicar</option><option value="acquisition">Aquisição</option><option value="import">Importação</option></select></label>
|
||||
<label>Âmbito de operações literal, se a decisão abranger mais do que a opção indicada<input className="block rounded border p-2" value={request.operationScope??''} onChange={e=>edit({operationScope:e.target.value})}/></label>
|
||||
<label>Âmbito temporal literal, se não estiver limitado pelas datas indicadas<input className="block rounded border p-2" placeholder="Conservar, por exemplo, a indicação sem termo ou até revogação do documento" value={request.periodScope??''} onChange={e=>edit({periodScope:e.target.value})}/></label>
|
||||
<button type="button" className="underline" onClick={()=>edit({goods:request.goods||row.description,operation:request.operation||row.operation,periodFrom:request.periodFrom||row.period,periodTo:request.periodTo||row.period})}>Reutilizar contexto nos campos de âmbito vazios</button>{' '}
|
||||
<button type="button" className="rounded border p-2" onClick={()=>run(()=>save({...book,rows:book.rows.map(item=>item.id===row.id?recordOfferRequest(item):item)}))}>Registar estado declarado e âmbito</button>
|
||||
{(row.requestRecords??[]).map((record,index)=><p key={index}>{offerRequestLabels[record.request.state]} — {record.recordedAt}; bens: {record.request.goods||'por indicar'}; operação: {record.request.operationScope||record.request.operation||'por indicar'}; período: {record.request.periodScope||`${record.request.periodFrom||'por indicar'} a ${record.request.periodTo||'por indicar'}`}; condições: {record.request.conditions||'por indicar'}; decisão: {record.request.decisionRef||'por indicar'}. Este âmbito não se estende automaticamente à restante operação ou oportunidade.</p>)}
|
||||
</fieldset>;})()}
|
||||
<fieldset className="rounded border p-3"><legend>Cenário normal e cenário condicionado à isenção</legend>
|
||||
<label>IVA no cenário normal, indicado em documento ou pressuposto<input className="block rounded border p-2" inputMode="decimal" value={row.normalVat??''} onChange={e=>change(row.id,{normalVat:e.target.value})}/></label>
|
||||
<label>Documento ou pressuposto do IVA normal<input className="block rounded border p-2" value={row.normalVatSource??''} onChange={e=>change(row.id,{normalVatSource:e.target.value})}/></label>
|
||||
<label>Assumir, apenas para comparar, a hipótese condicionada de isenção<select className="block rounded border p-2" value={row.conditionalAssumption??''} onChange={e=>change(row.id,{conditionalAssumption:e.target.value as ''|'yes'|'no'})}><option value="">Por indicar</option><option value="yes">Sim, como hipótese condicionada</option><option value="no">Não</option></select></label>
|
||||
{(()=>{const scenarios=offerScenarios(row);return <><table><thead><tr><th>Cenário</th><th>IVA ({row.currency})</th></tr></thead><tbody><tr><td>Normal — valor indicado, sem taxa presumida</td><td>{scenarios.normalVat??'Indeterminado'}</td></tr><tr><td>Condicionado à isenção — hipótese, não concessão</td><td>{scenarios.conditionalVat??'Indeterminado'}</td></tr></tbody></table><p>{scenarios.conditionalReason}</p><p>O cenário condicionado não altera imposto, dedução, totais ou o estado do pedido. O procedimento só será aplicado quando a correspondência regulamentar estiver demonstrada.</p></>;})()}
|
||||
</fieldset>
|
||||
</details>)}
|
||||
{!!book.rows.length&&<><button type="button" className="rounded border p-2" onClick={()=>run(()=>save(recordOfferPreparations(book)))}>Guardar versão dos rascunhos de ofertas</button><p role="status">{book.saved?'Versão de preparação conservada; alterações seguintes não substituem essa versão.':'Preparação em curso; pode guardar mesmo com informação em falta.'} Benefício não aplicado. {book.history?.length??0} versões anteriores.</p></>}
|
||||
</details>;
|
||||
|
||||
@@ -14,7 +14,12 @@ export const importSpecialRegimeVersion = 'import-special-regimes/1';
|
||||
export const importSpecialRegimeSource = 'CIVA republicado pela Lei13/2016, BR156/10.º suplemento, art.14(1)(a) e condição inicial14(1),PDF13/p.1426(271). Lei22/2022 e Lei10/2025 não alteram14 neste acervo. Importações sob controlo alfandegário e disposições especificamente aplicáveis, enquanto os bens permanecem nos regimes enumerados, sem utilização nem consumo finais nas áreas mencionadas. Cobertura2026/MZN; sem dedução/campo11, cálculo de direitos ou saída do regime.';
|
||||
export const importSupplyVersion = 'import-onboard-supplies/1';
|
||||
export const importSupplySource = 'CIVA republicado pela Lei13/2016,BR156/10.º suplemento,12(1)(g),12(3)(a)(i–iv)/(b),PDF11–12/p.1426(269–270),e definição13(3). Lei22/2022PDF2/p.2252(26) e Lei10/2025PDF13/p.2180(13) mantêm g/3 por remissão. Cobertura2026/MZN; abastecimentos importados na janela própria,consumidos ou a bordo de embarcação de navegação internacional marítima/fluvial/lacustre ou avião de navegação aérea internacional;exclusões próprias de provisões e depósitos normais. Sem exigir companhia principalmente internacional,sem dedução/campo11,direitos ou base aduaneira.';
|
||||
export const importServiceVersion = 'import-included-services/1';
|
||||
export const importServiceSource = 'CIVA republicado Lei13/2016,12(1)(e),PDF11/p.1426(269): prestações de serviços cujo valor esteja incluído na base tributável da importação de bens,conforme16. Art16(1)/16(1)(b)/16(2),PDF14/p.1426(272): valor aduaneiro e despesas acessórias até primeiro destino,do documento de transporte ou,na falta,primeira ruptura de carga no interior do País. Lei22/2022PDF1–2 e Lei10/2025PDF12–13 mantêm e por remissão e não alteram16. Cobertura2026/MZN; IVA do serviço,sem calcular base aduaneira,direitos,IVA dos bens,dedução/campo11 ou rectificação automática de factura.';
|
||||
export const importExemptionRules = [
|
||||
{id:'service_in_customs_value',branch:'P050',label:"Serviço já compreendido no valor aduaneiro",article:'12(1)(e)',conditions:[["serviceImportLinked", "A prestação está ligada à importação de bens identificada na referência própria; não basta tratar-se de serviço prestado a um importador"], ["serviceFullValueIncluded", "O valor integral do serviço desta linha está incluído na base tributável da importação identificada, nos termos do artigo16; documento ou pressuposto discrimina a inclusão, não apenas a intenção de a incluir"], ["serviceInCustomsValue", "O valor deste serviço já está compreendido no valor aduaneiro que integra a base do artigo16(1); não é uma nova parcela a somar pelo simulador"]]},
|
||||
{id:'accessory_service_first_destination',branch:'P050',label:"Serviço acessório até ao primeiro destino",article:'12(1)(e)',conditions:[["serviceImportLinked", "A prestação está ligada à importação de bens identificada na referência própria; não basta tratar-se de serviço prestado a um importador"], ["serviceFullValueIncluded", "O valor integral do serviço desta linha está incluído na base tributável da importação identificada, nos termos do artigo16; documento ou pressuposto discrimina a inclusão, não apenas a intenção de a incluir"], ["serviceAccessoryCost", "O serviço é uma despesa acessória da importação (embalagem, transporte, seguro ou outro encargo) adicionada à base por ainda não estar compreendida no valor aduaneiro, conforme16(1)(b)"], ["serviceToFirstDestination", "A despesa verifica-se até ao primeiro lugar de destino no interior do País: o constante do documento de transporte ou, na sua falta, o local da primeira ruptura de carga no interior do País, conforme16(2); destino e percurso identificados no fundamento"]]},
|
||||
|
||||
{id:'ship_provisions_import',branch:'P052',label:"Embarcação internacional — Provisões de bordo",article:'12(1)(g)',conditions:[["supplyInternationalShip", "A embarcação identificada efectua navegação marítima, fluvial ou lacustre internacional; não basta pertencer a uma empresa marítima"], ["supplyProvisions", "São provisões de bordo: produtos destinados exclusivamente ao consumo da tripulação e dos passageiros"], ["supplyImportWindow", "Os bens são importados desde a entrada no território nacional até à chegada ao porto ou aeroporto nacionais de destino, ou durante a permanência nesses locais pelo período normal necessário ao cumprimento das tarefas; trajecto e datas constam do fundamento"], ["supplyOnboard", "Os bens importados são consumidos ou encontram-se a bordo da embarcação ou avião identificados no fundamento factual"], ["supplyNoDismantleOtherUse", "As provisões não se encontram em embarcação a desmantelar ou utilizada para fins diferentes da navegação internacional, durante essa situação"], ["supplyNoFloatingHospitality", "As provisões não se encontram em embarcação utilizada em hotel, restaurante, sala de jogos flutuante ou fim semelhante, durante permanência em porto ou águas territoriais/interiores nacionais"], ["supplyNoRecreation", "As provisões não se encontram em embarcação de recreio durante permanência em porto ou águas territoriais/interiores nacionais"], ["supplyNoCoastalFishing", "As provisões não se encontram em embarcação de pesca costeira"]]},
|
||||
{id:'ship_fuel_import',branch:'P052',label:"Embarcação internacional — Combustíveis ou carburantes",article:'12(1)(g)',conditions:[["supplyInternationalShip", "A embarcação identificada efectua navegação marítima, fluvial ou lacustre internacional; não basta pertencer a uma empresa marítima"], ["supplyFuel", "São combustíveis ou carburantes destinados ao funcionamento das máquinas de propulsão ou de outros aparelhos de uso técnico instalados a bordo"], ["supplyImportWindow", "Os bens são importados desde a entrada no território nacional até à chegada ao porto ou aeroporto nacionais de destino, ou durante a permanência nesses locais pelo período normal necessário ao cumprimento das tarefas; trajecto e datas constam do fundamento"], ["supplyOnboard", "Os bens importados são consumidos ou encontram-se a bordo da embarcação ou avião identificados no fundamento factual"], ["supplyNormalTanks", "Os combustíveis/carburantes importados são os contidos nos depósitos normais; depósitos suplementares ou externos não cumprem esta condição"]]},
|
||||
{id:'ship_technical_products_import',branch:'P052',label:"Embarcação internacional — Lubrificantes e outros produtos de funcionamento técnico",article:'12(1)(g)',conditions:[["supplyInternationalShip", "A embarcação identificada efectua navegação marítima, fluvial ou lacustre internacional; não basta pertencer a uma empresa marítima"], ["supplyTechnicalProducts", "São lubrificantes ou outros produtos, distintos dos combustíveis/carburantes, destinados ao funcionamento das máquinas de propulsão ou de outros aparelhos de uso técnico instalados a bordo"], ["supplyImportWindow", "Os bens são importados desde a entrada no território nacional até à chegada ao porto ou aeroporto nacionais de destino, ou durante a permanência nesses locais pelo período normal necessário ao cumprimento das tarefas; trajecto e datas constam do fundamento"], ["supplyOnboard", "Os bens importados são consumidos ou encontram-se a bordo da embarcação ou avião identificados no fundamento factual"]]},
|
||||
@@ -43,15 +48,16 @@ export const importExemptionRules = [
|
||||
{id:'customs_temporary_import',branch:'P048',label:'Importação temporária de bens com isenção total de direitos',article:'12(1)(c)',conditions:[['customsTemporary','Os bens identificados são importados sob regime de importação temporária; regime e operação constam do documento ou pressuposto expresso, não apenas intenção de utilização temporária'],['fullCustomsExemption','Esta importação beneficia de isenção total de direitos aduaneiros, identificada no fundamento factual; redução parcial ou mera suspensão não comprovam esta condição']]},
|
||||
{id:'customs_drawback_import',branch:'P048',label:'Importação de bens em draubaque com isenção total de direitos',article:'12(1)(c)',conditions:[['customsDrawback','Os bens identificados são importados sob regime de draubaque; regime e operação constam do documento ou pressuposto expresso, não qualquer promessa de restituição futura'],['fullCustomsExemption','Esta importação beneficia de isenção total de direitos aduaneiros, identificada no fundamento factual; redução parcial ou mera suspensão não comprovam esta condição']]},
|
||||
] as const;
|
||||
type Condition = 'supplyCargoAccessories'|'supplyFuel'|'supplyImportWindow'|'supplyInternationalAircraft'|'supplyInternationalShip'|'supplyNoCoastalFishing'|'supplyNoDismantleOtherUse'|'supplyNoFloatingHospitality'|'supplyNoRecreation'|'supplyNormalTanks'|'supplyOnboard'|'supplyProvisions'|'supplyTechnicalProducts'|'specialEconomicZone'|'freeZone'|'freeWarehouse'|'generalFreeWarehouse'|'customsWarehouse'|'dutyFreeShop'|'specialCustomsControl'|'specialApplicableProvisions'|'specialRegimePermanence'|'specialNoFinalUseConsumption'|'sameExporter'|'sameState'|'customsExempt'|'gold'|'centralBank'|'artObjects'|'eligibleArtImporter'|'fireVehicle'|'fireBrigade'|'exclusiveOwnUse'|'eligibleShip'|'importedShip'|'shipObjectLink'|'eligibleAircraft'|'importedAircraft'|'aircraftObjectLink'|'customsTransit'|'customsTemporary'|'customsDrawback'|'fullCustomsExemption';
|
||||
type Condition = 'serviceImportLinked'|'serviceFullValueIncluded'|'serviceInCustomsValue'|'serviceAccessoryCost'|'serviceToFirstDestination'|'supplyCargoAccessories'|'supplyFuel'|'supplyImportWindow'|'supplyInternationalAircraft'|'supplyInternationalShip'|'supplyNoCoastalFishing'|'supplyNoDismantleOtherUse'|'supplyNoFloatingHospitality'|'supplyNoRecreation'|'supplyNormalTanks'|'supplyOnboard'|'supplyProvisions'|'supplyTechnicalProducts'|'specialEconomicZone'|'freeZone'|'freeWarehouse'|'generalFreeWarehouse'|'customsWarehouse'|'dutyFreeShop'|'specialCustomsControl'|'specialApplicableProvisions'|'specialRegimePermanence'|'specialNoFinalUseConsumption'|'sameExporter'|'sameState'|'customsExempt'|'gold'|'centralBank'|'artObjects'|'eligibleArtImporter'|'fireVehicle'|'fireBrigade'|'exclusiveOwnUse'|'eligibleShip'|'importedShip'|'shipObjectLink'|'eligibleAircraft'|'importedAircraft'|'aircraftObjectLink'|'customsTransit'|'customsTemporary'|'customsDrawback'|'fullCustomsExemption';
|
||||
function beneficiaryImport(id:string):boolean {return id==='author_art_import'||id==='fire_brigade_vehicle';}
|
||||
function assetImport(id:string):boolean {return ['eligible_ship_import','ship_operation_object_import','eligible_aircraft_import','aircraft_operation_object_import'].includes(id);}
|
||||
function customsImport(id:string):boolean {return ['customs_transit_import','customs_temporary_import','customs_drawback_import'].includes(id);}
|
||||
function specialRegimeImport(id:string):boolean {return ["special_economic_zone_import", "free_zone_import", "free_warehouse_import", "general_free_warehouse_import", "customs_warehouse_import", "duty_free_shop_import"].includes(id);}
|
||||
function supplyImport(id:string):boolean {return ["ship_provisions_import", "ship_fuel_import", "ship_technical_products_import", "ship_cargo_accessories_import", "aircraft_provisions_import", "aircraft_fuel_import", "aircraft_technical_products_import", "aircraft_cargo_accessories_import"].includes(id);}
|
||||
export function importRuleSource(id:string):string {return supplyImport(id)?importSupplySource:specialRegimeImport(id)?importSpecialRegimeSource:customsImport(id)?importCustomsSource:assetImport(id)?importAssetSource:beneficiaryImport(id)?importBeneficiarySource:importExemptionSource;}
|
||||
export type ImportExemptionRow = {id:string;treatment:string;description:string;period:string;origin:'projected'|'effective';currency:string;declaredValue:string;goodsCode:string;originCountry:string;importer:string;documentRef:string;documentDate:string;evidence:string;conditions:Partial<Record<Condition,Choice>>};
|
||||
type ImportResult = {id:string;status:'exempt'|'not_applicable'|'indeterminate';importVat:string|null;reason:string};
|
||||
export function isImportService(id:string):boolean {return ['service_in_customs_value','accessory_service_first_destination'].includes(id);}
|
||||
export function importRuleSource(id:string):string {return isImportService(id)?importServiceSource:supplyImport(id)?importSupplySource:specialRegimeImport(id)?importSpecialRegimeSource:customsImport(id)?importCustomsSource:assetImport(id)?importAssetSource:beneficiaryImport(id)?importBeneficiarySource:importExemptionSource;}
|
||||
export type ImportExemptionRow = {id:string;treatment:string;description:string;period:string;origin:'projected'|'effective';currency:string;declaredValue:string;goodsCode:string;originCountry:string;importer:string;documentRef:string;documentDate:string;evidence:string;conditions:Partial<Record<Condition,Choice>>;serviceImportRef?:string;serviceBaseRef?:string;serviceFirstDestination?:string;serviceProvider?:string};
|
||||
type ImportResult = {id:string;status:'exempt'|'not_applicable'|'indeterminate';importVat:string|null;serviceVat?:string|null;reason:string};
|
||||
export type ImportExemptionCalculation = {version:string;revision:number;calculatedAt:string;opportunity:string;location:string;sourceKey:string;source:string;inputs:ImportExemptionRow[];rows:ImportResult[]};
|
||||
export type ImportExemptionBook = {rows:ImportExemptionRow[];result?:ImportExemptionCalculation;history?:ImportExemptionCalculation[]};
|
||||
type Store = {version:1;books:Record<string,unknown>;importExemptions?:Record<string,ImportExemptionBook>;[key:string]:unknown};
|
||||
@@ -60,36 +66,39 @@ function store(draft:Record<string,unknown>):Store {
|
||||
if(value?.version!==1||!value.books||typeof value.books!=='object'||Array.isArray(value.books))throw new Error('Dados fiscais não recuperáveis; originais preservados, sem substituição.');
|
||||
if(value.importExemptions!==undefined&&(!value.importExemptions||typeof value.importExemptions!=='object'||Array.isArray(value.importExemptions)))throw new Error('Importações guardadas não recuperáveis; originais preservados.');
|
||||
for(const book of Object.values(value.importExemptions??{})) {
|
||||
if(Array.isArray(book?.rows)&&book.rows.some(row=>row&&['serviceImportRef','serviceBaseRef','serviceFirstDestination','serviceProvider'].some(key=>row[key as keyof ImportExemptionRow]!==undefined&&typeof row[key as keyof ImportExemptionRow]!=='string')))throw new Error('Referências do serviço associado à importação não recuperáveis; originais preservados.');
|
||||
if(!book||!Array.isArray(book.rows)||(book.history!==undefined&&!Array.isArray(book.history))||book.rows.some(row=>!row||['id','treatment','description','period','origin','currency','declaredValue','goodsCode','originCountry','importer','documentRef','documentDate','evidence'].some(k=>typeof row[k as keyof ImportExemptionRow]!=='string')||!row.conditions||typeof row.conditions!=='object'||Array.isArray(row.conditions)))throw new Error('Linhas de importação não recuperáveis; sem substituição por lista vazia.');
|
||||
}
|
||||
return value;
|
||||
}
|
||||
export function importExemptionBook(draft:Record<string,unknown>):ImportExemptionBook {return store(draft).importExemptions?.[acquisitionScope(draft)]??{rows:[]};}
|
||||
export function saveImportExemptionBook(draft:Record<string,unknown>,book:ImportExemptionBook):string {
|
||||
const current=store(draft);return JSON.stringify({...current,importExemptions:{...current.importExemptions,[acquisitionScope(draft)]:book}});
|
||||
const current=store(draft),encoded=JSON.stringify({...current,importExemptions:{...current.importExemptions,[acquisitionScope(draft)]:book}});store({...draft,modelo_a_snapshot:encoded});return encoded;
|
||||
}
|
||||
export function newImportExemption(id:string,currency:string):ImportExemptionRow {return {id,treatment:'',description:'',period:'',origin:'projected',currency,declaredValue:'',goodsCode:'',originCountry:'',importer:'',documentRef:'',documentDate:'',evidence:'',conditions:{}};}
|
||||
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 evaluateImportExemption(row:ImportExemptionRow,currency:unknown):ImportResult {
|
||||
const result:ImportResult={id:row.id,status:'indeterminate',importVat:null,reason:''};
|
||||
const result:ImportResult={id:row.id,status:'indeterminate',importVat:null,reason:'',...(isImportService(row.treatment)?{serviceVat:null}:{})};
|
||||
const stop=(reason:string,status:ImportResult['status']='indeterminate')=>({...result,status,reason});
|
||||
const rule=importExemptionRules.find(r=>r.id===row.treatment);
|
||||
if(!rule)return stop('Escolha o ramo aplicável; referência desconhecida ou em falta não concede isenção.');
|
||||
if(currency!=='MZN'||row.currency!==currency)return stop('Moeda fora do âmbito MZN ou divergente do projecto; valores conservados, sem conversão.');
|
||||
if(!/^2026-(0[1-9]|1[0-2])$/.test(row.period))return stop('Indique o período da importação em2026; não é inferido do mês do orçamento.');
|
||||
if(!/^2026-(0[1-9]|1[0-2])$/.test(row.period))return stop(isImportService(row.treatment)?'Indique o período do serviço em2026; a importação é identificada separadamente, sem inferir o mês do orçamento.':'Indique o período da importação em2026; não é inferido do mês do orçamento.');
|
||||
if(!['projected','effective'].includes(row.origin))return stop('Indique dados efectivos ou pressupostos de projecção.');
|
||||
const failed=rule.conditions.filter(([key])=>row.conditions[key]==='no');
|
||||
if(failed.length)return stop('Não se aplica esta isenção: '+failed.map(([,label])=>label).join('; ')+'. O IVA fora deste fundamento permanece por enquadrar, sem taxa presumida.','not_applicable');
|
||||
const missing=rule.conditions.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 nem IVA zero.');
|
||||
if(!row.description.trim()||!row.importer.trim()||!row.documentRef.trim()||!row.evidence.trim())return stop('Identifique bens, importador, documento aduaneiro ou previsão e o fundamento factual das condições; não é exigida segunda validação da fonte oficial.');
|
||||
if(isImportService(row.treatment)&&(!row.serviceImportRef?.trim()||!row.serviceBaseRef?.trim()||!row.declaredValue.trim()||(row.treatment==='accessory_service_first_destination'&&!row.serviceFirstDestination?.trim())))return stop('Identifique a importação de bens, a referência da base que inclui o valor do serviço e o montante desta linha; no serviço acessório, indique o primeiro destino e o fundamento documental ou pressuposto.');
|
||||
if(!row.description.trim()||!row.importer.trim()||!row.documentRef.trim()||!row.evidence.trim())return stop(isImportService(row.treatment)?'Identifique o serviço, importador destinatário, documento/previsão e fundamento factual da inclusão; sem exigir segunda validação da fonte oficial.':'Identifique bens, importador, documento aduaneiro ou previsão e o fundamento factual das condições; não é exigida segunda validação da fonte oficial.');
|
||||
if(!validDate(row.documentDate))return stop('Data do documento/previsão em falta ou inválida; o período da importação é indicado separadamente.');
|
||||
if(row.declaredValue.trim()&&!/^\d{1,15}(\.\d{1,6})?$/.test(row.declaredValue.trim()))return stop('Valor declarado/previsional inválido; conserve o original e reveja, sem presumir base aduaneira ou imposto normal.');
|
||||
if(isImportService(row.treatment))return {...result,status:'exempt',serviceVat:'0.00',reason:`Isenção do serviço ${rule.article} nas condições ${row.origin==='projected'?'expressamente assumidas na projecção':'efectivas declaradas'}. IVA do serviço:0.00MZN; não é o IVA dos bens importados, não soma novamente o serviço à base nem corrige factura ou dedução.`};
|
||||
return {...result,status:'exempt',importVat:'0.00',reason:`Isenção ${rule.article} nas condições ${row.origin==='projected'?'expressamente assumidas na projecção':'efectivas declaradas'}. IVA na importação:0.00MZN por isenção, sem inferir direitos aduaneiros, certificação pela AT ou dedução.`};
|
||||
}
|
||||
function key(draft:Record<string,unknown>,book:ImportExemptionBook):string {
|
||||
const base={version:importExemptionVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},currency:draft.currency,rows:book.rows};
|
||||
return JSON.stringify({...base,...(book.rows.some(row=>beneficiaryImport(row.treatment))?{beneficiaryVersion:importBeneficiaryVersion}:{}),...(book.rows.some(row=>assetImport(row.treatment))?{assetVersion:importAssetVersion}:{}),...(book.rows.some(row=>customsImport(row.treatment))?{customsVersion:importCustomsVersion}:{}),...(book.rows.some(row=>specialRegimeImport(row.treatment))?{specialRegimeVersion:importSpecialRegimeVersion}:{}),...(book.rows.some(row=>supplyImport(row.treatment))?{supplyVersion:importSupplyVersion}:{})});
|
||||
return JSON.stringify({...base,...(book.rows.some(row=>beneficiaryImport(row.treatment))?{beneficiaryVersion:importBeneficiaryVersion}:{}),...(book.rows.some(row=>assetImport(row.treatment))?{assetVersion:importAssetVersion}:{}),...(book.rows.some(row=>customsImport(row.treatment))?{customsVersion:importCustomsVersion}:{}),...(book.rows.some(row=>specialRegimeImport(row.treatment))?{specialRegimeVersion:importSpecialRegimeVersion}:{}),...(book.rows.some(row=>supplyImport(row.treatment))?{supplyVersion:importSupplyVersion}:{}),...(book.rows.some(row=>isImportService(row.treatment))?{serviceVersion:importServiceVersion}:{})});
|
||||
}
|
||||
export function importExemptionCurrent(draft:Record<string,unknown>,book:ImportExemptionBook):boolean {return !!book.result&&book.result.sourceKey===key(draft,book);}
|
||||
export function recordImportExemptions(draft:Record<string,unknown>,book:ImportExemptionBook):ImportExemptionBook {
|
||||
@@ -101,6 +110,6 @@ export function importExemptionReportRows(draft:Record<string,unknown>):Array<[s
|
||||
try {
|
||||
const book=importExemptionBook(draft),result=book.result;if(!result)return [];
|
||||
const context=`${result.opportunity}; ${result.location}; ${importExemptionCurrent(draft,book)?'Resultado actual':'Entradas alteradas; resultado histórico conservado'}; versão${result.revision}; ${result.calculatedAt}; ${result.source}`;
|
||||
return result.inputs.map((row,index)=>['IVA mensal',`Importação ${importExemptionRules.find(r=>r.id===row.treatment)?.branch??row.treatment} — ${row.period} — ${row.id}`,`${row.description}; IVA na importação: ${result.rows[index].importVat??'Indeterminado'} ${row.currency}; ${result.rows[index].reason}`,`${context}; ${row.origin==='projected'?'Projecção':'Dados efectivos declarados'}; importador ${row.importer}; valor declarado/previsional ${row.declaredValue||'Não informado'} ${row.currency}, sem fixar base aduaneira; código ${row.goodsCode||'não indicado'}; origem ${row.originCountry||'não indicada'}; documento ${row.documentRef},${row.documentDate}; condições ${(importExemptionRules.find(rule=>rule.id===row.treatment)?.conditions??[]).map(([key,label])=>label+': '+(row.conditions[key]==='yes'?'Sim':row.conditions[key]==='no'?'Não':'Por indicar')).join('; ')}; fundamento factual ${row.evidence}; campo11 e totaisModeloA não preenchidos por esta classificação.`]);
|
||||
return result.inputs.map((row,index)=>['IVA mensal',`${isImportService(row.treatment)?'Serviço associado à importação':'Importação'} ${importExemptionRules.find(r=>r.id===row.treatment)?.branch??row.treatment} — ${row.period} — ${row.id}`,`${row.description}; ${isImportService(row.treatment)?'IVA do serviço':'IVA na importação'}: ${(isImportService(row.treatment)?result.rows[index].serviceVat:result.rows[index].importVat)??'Indeterminado'} ${row.currency}; ${result.rows[index].reason}`,`${context}; ${row.origin==='projected'?'Projecção':'Dados efectivos declarados'}; importador ${row.importer}; valor declarado/previsional ${row.declaredValue||'Não informado'} ${row.currency}, sem fixar base aduaneira; ${isImportService(row.treatment)?`importação associada ${row.serviceImportRef||'por indicar'}; base com inclusão do serviço ${row.serviceBaseRef||'por indicar'}; prestador ${row.serviceProvider||'por indicar'}${row.treatment==='accessory_service_first_destination'?`; primeiro destino ${row.serviceFirstDestination||'por indicar'}`:''}`:`código ${row.goodsCode||'não indicado'}; origem ${row.originCountry||'não indicada'}`}; documento ${row.documentRef},${row.documentDate}; condições ${(importExemptionRules.find(rule=>rule.id===row.treatment)?.conditions??[]).map(([key,label])=>label+': '+(row.conditions[key]==='yes'?'Sim':row.conditions[key]==='no'?'Não':'Por indicar')).join('; ')}; fundamento factual ${row.evidence}; campo11 e totaisModeloA não preenchidos por esta classificação.`]);
|
||||
}catch {return [['IVA mensal','Importações','Dados não recuperáveis','Originais preservados; sem substituir por zero.']];}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { acquisitionBook, acquisitionScope } from './iva-acquisitions.ts';
|
||||
import { importExemptionBook } from './iva-import-exemptions.ts';
|
||||
import { importExemptionBook,isImportService } from './iva-import-exemptions.ts';
|
||||
|
||||
type Choice = ''|'yes'|'no';
|
||||
export const offerPreparationSource='CIVA,Lei13/2016,14(2)(a/b) e14(3),PDF13/p.1426(271). Preparação de dados; procedimento regulamentar de aplicação ainda em pesquisa. Não concede isenção nem preenche dedução/campo11.';
|
||||
export type OfferPreparation = {id:string;branch:'P084'|'P085';operation:''|'acquisition'|'import';description:string;period:string;currency:string;amount:string;counterparty:string;documentRef:string;documentDate:string;beneficiary:string;purpose:string;evidence:string;nationalInstitution:Choice;publicSocialInstitution:Choice;goodsSuitable:Choice;publicInterestUse:Choice;disaster:string;disasterKind:string;mitigation:Choice;reusedFrom?:{key:string;copiedAt:string}};
|
||||
export type OfferRequest = {state:'preparation'|'presented'|'granted'|'denied';reference:string;presentedOn:string;decisionRef:string;decisionOn:string;goods:string;operation:''|'acquisition'|'import';periodFrom:string;periodTo:string;conditions:string;operationScope?:string;periodScope?:string};
|
||||
export const offerRequestLabels = {preparation:'Em preparação',presented:'Apresentado',granted:'Deferido',denied:'Indeferido'};
|
||||
export type OfferPreparation = {id:string;branch:'P084'|'P085';operation:''|'acquisition'|'import';description:string;period:string;currency:string;amount:string;counterparty:string;documentRef:string;documentDate:string;beneficiary:string;purpose:string;evidence:string;nationalInstitution:Choice;publicSocialInstitution:Choice;goodsSuitable:Choice;publicInterestUse:Choice;disaster:string;disasterKind:string;mitigation:Choice;reusedFrom?:{key:string;copiedAt:string};humanitarianPurpose?:string;availableDocuments?:string;request?:OfferRequest;requestRecords?:Array<{recordedAt:string;request:OfferRequest}>;normalVat?:string;normalVatSource?:string;conditionalAssumption?:Choice};
|
||||
export type OfferPreparationBook={rows:OfferPreparation[];history?:Array<{savedAt:string;rows:OfferPreparation[]}>;saved?:{savedAt:string;rows:OfferPreparation[]}};
|
||||
type Store={version:1;books:Record<string,unknown>;offerPreparations?:Record<string,OfferPreparationBook>;[key:string]:unknown};
|
||||
export function newOfferPreparation(id:string,branch:OfferPreparation['branch'],currency:string):OfferPreparation{return {id,branch,operation:branch==='P085'?'acquisition':'',description:'',period:'',currency,amount:'',counterparty:'',documentRef:'',documentDate:'',beneficiary:'',purpose:'',evidence:'',nationalInstitution:'',publicSocialInstitution:'',goodsSuitable:'',publicInterestUse:'',disaster:'',disasterKind:'',mitigation:''};}
|
||||
@@ -13,7 +15,11 @@ function read(draft:Record<string,unknown>):Store {
|
||||
if(value.offerPreparations!==undefined&&(!value.offerPreparations||typeof value.offerPreparations!=='object'||Array.isArray(value.offerPreparations)))throw new Error('Rascunhos de ofertas não recuperáveis; sem substituição por lista vazia.');
|
||||
for(const book of Object.values(value.offerPreparations??{})){
|
||||
if(!book||!Array.isArray(book.rows)||(book.history!==undefined&&!Array.isArray(book.history)))throw new Error('Formato de rascunhos de ofertas não recuperável; originais preservados.');
|
||||
for(const row of book.rows)if(!row||!['P084','P085'].includes(row.branch)||Object.keys(newOfferPreparation('','P084','')).some(key=>typeof row[key as keyof OfferPreparation]!=='string')||(row.branch==='P085'&&row.operation==='import'))throw new Error('Rascunho de oferta não recuperável ou operação fora do ramo; dados conservados.');
|
||||
for(const row of book.rows){
|
||||
if(!row||!['P084','P085'].includes(row.branch)||Object.keys(newOfferPreparation('','P084','')).some(key=>typeof row[key as keyof OfferPreparation]!=='string')||(row.branch==='P085'&&row.operation==='import'))throw new Error('Rascunho de oferta não recuperável ou operação fora do ramo; dados conservados.');
|
||||
if(['humanitarianPurpose','availableDocuments','normalVat','normalVatSource','conditionalAssumption'].some(key=>row[key as keyof OfferPreparation]!==undefined&&typeof row[key as keyof OfferPreparation]!=='string')||(row.requestRecords!==undefined&&!Array.isArray(row.requestRecords)))throw new Error('Elementos do percurso de ofertas não recuperáveis; originais preservados.');
|
||||
if(row.request!==undefined&&(!row.request||!Object.hasOwn(offerRequestLabels,row.request.state)||Object.entries(emptyOfferRequest()).some(([key])=>typeof row.request?.[key as keyof OfferRequest]!=='string')))throw new Error('Pedido de oferta não recuperável; decisão e originais conservados.');
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -28,7 +34,7 @@ export function recordOfferPreparations(book:OfferPreparationBook):OfferPreparat
|
||||
export type OfferReusable={key:string;label:string;operation:'acquisition'|'import';values:Partial<OfferPreparation>};
|
||||
export function offerReusableData(draft:Record<string,unknown>):OfferReusable[]{
|
||||
const purchases=acquisitionBook(draft).rows.map(row=>({key:'acquisition:'+row.id,label:'Aquisição: '+(row.description||row.documentRef||row.id),operation:'acquisition' as const,values:{description:row.description,period:row.period,currency:row.sourceCurrency,amount:row.net,documentRef:row.documentRef,documentDate:row.documentDate,counterparty:row.supplier}}));
|
||||
const imports=importExemptionBook(draft).rows.map(row=>({key:'import:'+row.id,label:'Importação: '+(row.description||row.documentRef||row.id),operation:'import' as const,values:{description:row.description,period:row.period,currency:row.currency,amount:row.declaredValue,documentRef:row.documentRef,documentDate:row.documentDate,counterparty:row.importer}}));
|
||||
const imports=importExemptionBook(draft).rows.filter(row=>!isImportService(row.treatment)).map(row=>({key:'import:'+row.id,label:'Importação: '+(row.description||row.documentRef||row.id),operation:'import' as const,values:{description:row.description,period:row.period,currency:row.currency,amount:row.declaredValue,documentRef:row.documentRef,documentDate:row.documentDate,counterparty:row.importer}}));
|
||||
return [...purchases,...imports];
|
||||
}
|
||||
export function reuseOfferData(row:OfferPreparation,source:OfferReusable):OfferPreparation {
|
||||
@@ -41,7 +47,30 @@ export function reuseOfferData(row:OfferPreparation,source:OfferReusable):OfferP
|
||||
for(const [key,value] of Object.entries(source.values))if(!next[key as keyof OfferPreparation]&&typeof value==='string')Object.assign(next,{[key]:value});
|
||||
return {...next,reusedFrom:{key:source.key,copiedAt:new Date().toISOString()}};
|
||||
}
|
||||
export function emptyOfferRequest():OfferRequest{return {state:'preparation',reference:'',presentedOn:'',decisionRef:'',decisionOn:'',goods:'',operation:'',periodFrom:'',periodTo:'',conditions:''};}
|
||||
export function recordOfferRequest(row:OfferPreparation):OfferPreparation{
|
||||
if(row.branch!=='P084')throw new Error('Os estados deste pedido pertencem ao percurso P084; emergência conservada no percurso próprio.');
|
||||
const request=row.request??emptyOfferRequest();
|
||||
const validPeriod=(value:string)=>{if(/^\d{4}-(0[1-9]|1[0-2])$/.test(value))return true;if(!/^\d{4}-\d{2}-\d{2}$/.test(value))return false;const d=new Date(value+'T00:00:00Z');return Number.isFinite(d.getTime())&&d.toISOString().slice(0,10)===value;};
|
||||
const temporalScope=!!request.periodScope?.trim()||(validPeriod(request.periodFrom)&&validPeriod(request.periodTo)&&request.periodFrom.length===request.periodTo.length&&request.periodTo>=request.periodFrom);
|
||||
if(['granted','denied'].includes(request.state)&&(!request.goods.trim()||(!['acquisition','import'].includes(request.operation)&&!request.operationScope?.trim())||!temporalScope||!request.conditions.trim()))throw new Error('Conserve o âmbito da decisão: bens, operação, período e condições. Pode usar datas, meses ou o âmbito temporal literal do documento, inclusive sem termo. Pode continuar a guardar o rascunho incompleto.');
|
||||
return {...row,requestRecords:[...(row.requestRecords??[]),{recordedAt:new Date().toISOString(),request:structuredClone(request)}]};
|
||||
}
|
||||
export function offerScenarios(row:OfferPreparation):{normalVat:string|null;conditionalVat:string|null;conditionalReason:string;applied:false}{
|
||||
const normalVat=row.normalVatSource?.trim()&&/^\d{1,15}(\.\d{1,6})?$/.test(row.normalVat??'')?row.normalVat!:null;
|
||||
const result={normalVat,conditionalVat:null as string|null,conditionalReason:'Hipótese de isenção não assumida; benefício não aplicado.',applied:false as const};
|
||||
if(row.conditionalAssumption!=='yes')return result;
|
||||
const choices=row.branch==='P084'?[row.nationalInstitution,row.publicSocialInstitution,row.goodsSuitable,row.publicInterestUse]:[row.mitigation];
|
||||
if(choices.includes('no'))return {...result,conditionalReason:'Condição material contrariada; este cenário de isenção não está demonstrado. Benefício não aplicado.'};
|
||||
if(choices.some(value=>value!=='yes')||!row.description.trim()||!row.beneficiary.trim()||!row.purpose.trim()||!row.operation||!/^2026-(0[1-9]|1[0-2])$/.test(row.period)||row.currency!=='MZN'||(row.branch==='P085'&&(!row.disaster.trim()||!row.humanitarianPurpose?.trim())))return {...result,conditionalReason:'Pressupostos, contexto ou condições materiais por indicar; sem IVA zero presumido. Benefício não aplicado.'};
|
||||
return {...result,conditionalVat:'0.00',conditionalReason:'Cenário condicionado à isenção: hipótese expressa de cumprimento das condições e aplicação do procedimento, cuja correspondência permanece pendente. Não é benefício concedido nem imposto aplicado; apresentar pedido não concede isenção.'};
|
||||
}
|
||||
export function offerPathReport(row:OfferPreparation):string {
|
||||
const request=row.request??emptyOfferRequest(),scenario=offerScenarios(row);
|
||||
const scope=(r:OfferRequest)=>`bens ${r.goods||'por indicar'}; operação ${r.operationScope||r.operation||'por indicar'}; período ${r.periodScope||`${r.periodFrom||'por indicar'} a ${r.periodTo||'por indicar'}`}; condições ${r.conditions||'por indicar'}; documento ${r.decisionRef||'por indicar'},${r.decisionOn||'data por indicar'}`;
|
||||
return `${row.branch==='P084'?`Pedido ${offerRequestLabels[request.state]} (estado declarado, sem concessão pelo simulador); referência ${request.reference||'por indicar'}, apresentação ${request.presentedOn||'por indicar'}; âmbito em edição ${scope(request)}; ${(row.requestRecords??[]).map(record=>`estado registado ${offerRequestLabels[record.request.state]} em ${record.recordedAt}, ${scope(record.request)}`).join(' | ')||'sem estado/decisão registado'}; não estender decisão aos restantes bens, operações, períodos ou oportunidades; apresentar pedido não concede isenção`:`Emergência ${row.disaster||'por indicar'}; finalidade humanitária ${row.humanitarianPurpose||'por indicar'}; procedimento de emergência/doação por corresponder, sem aplicação automática`}; documentos disponíveis ${row.availableDocuments||row.documentRef||'por indicar'}; Cenário normal — IVA ${scenario.normalVat??'Indeterminado'} ${row.currency}, documento/pressuposto ${row.normalVatSource||'por indicar'}; Cenário condicionado à isenção — IVA ${scenario.conditionalVat??'Indeterminado'} ${row.currency}; ${scenario.conditionalReason}`;
|
||||
}
|
||||
export function offerPreparationReportRows(draft:Record<string,unknown>):Array<[string,string,string,string]>{
|
||||
try{return offerPreparationBook(draft).rows.map(row=>['IVA mensal',`Rascunho de oferta ${row.branch} — ${row.id}`,`${row.description||'Bens por indicar'}; preparação, benefício não aplicado; ${row.amount||'Valor não informado'} ${row.currency}; ${row.period||'Período não informado'}`,`${offerPreparationSource} Oportunidade ${acquisitionScope(draft)}; operação ${row.operation||'por indicar'}; contraparte ${row.counterparty||'por indicar'}; documento ${row.documentRef||'por indicar'},${row.documentDate||'data por indicar'}; beneficiário ${row.beneficiary||'por indicar'}; finalidade ${row.purpose||'por indicar'}; ${row.branch==='P084'?`instituição nacional ${row.nationalInstitution||'por indicar'}, interesse público/relevantes fins sociais ${row.publicSocialInstitution||'por indicar'}, bens adequados ${row.goodsSuitable||'por indicar'}, utilização de interesse público ${row.publicInterestUse||'por indicar'}`:`calamidade ${row.disaster||'por indicar'}, natureza ${row.disasterKind||'por indicar'}, atenuação dos efeitos ${row.mitigation||'por indicar'}`}; fundamento ${row.evidence||'por indicar'}; origem reutilizada ${row.reusedFrom?.key||'entrada directa'}; sem cálculo de IVA,isenção automática ou dedução.`]);}
|
||||
try{return offerPreparationBook(draft).rows.map(row=>['IVA mensal',`Rascunho de oferta ${row.branch} — ${row.id}`,`${row.description||'Bens por indicar'}; preparação, benefício não aplicado; ${row.amount||'Valor não informado'} ${row.currency}; ${row.period||'Período não informado'}`,`${offerPreparationSource} Oportunidade ${acquisitionScope(draft)}; operação ${row.operation||'por indicar'}; contraparte ${row.counterparty||'por indicar'}; documento ${row.documentRef||'por indicar'},${row.documentDate||'data por indicar'}; beneficiário ${row.beneficiary||'por indicar'}; finalidade ${row.purpose||'por indicar'}; ${row.branch==='P084'?`instituição nacional ${row.nationalInstitution||'por indicar'}, interesse público/relevantes fins sociais ${row.publicSocialInstitution||'por indicar'}, bens adequados ${row.goodsSuitable||'por indicar'}, utilização de interesse público ${row.publicInterestUse||'por indicar'}`:`calamidade ${row.disaster||'por indicar'}, natureza ${row.disasterKind||'por indicar'}, atenuação dos efeitos ${row.mitigation||'por indicar'}`}; fundamento ${row.evidence||'por indicar'}; origem reutilizada ${row.reusedFrom?.key||'entrada directa'}; ${offerPathReport(row)}; sem isenção automática ou dedução.`]);}
|
||||
catch{return [['IVA mensal','Rascunhos de ofertas','Dados não recuperáveis','Originais preservados; sem substituição por zero.']];}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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 IvaImportServicesDraftTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
public function test_import_classification_recovers_privately_without_changing_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-g6f-imports.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:336', $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['importExemptions']['opportunity:336'];
|
||||
$this->assertCount(2, $book['rows']);
|
||||
$this->assertSame(['service_in_customs_value','accessory_service_first_destination'], array_column($book['rows'], 'treatment'));
|
||||
$this->assertSame(array_fill(0, 2, '0.00'), array_column($book['result']['rows'], 'serviceVat'));
|
||||
$this->assertSame([null,null], array_column($book['result']['rows'], 'importVat'));
|
||||
$this->assertSame('SYNTHETIC QA importação DU-A,2026-12', $book['rows'][0]['serviceImportRef']);
|
||||
$this->assertSame('SYNTHETIC QA base DU-A,linha serviço5000MZN', $book['rows'][0]['serviceBaseRef']);
|
||||
$this->assertSame(array_fill(0, 2, 'exempt'), array_column($book['result']['rows'], 'status'));
|
||||
$this->assertSame('2026-12', $book['rows'][0]['period']);
|
||||
$this->assertSame('5000', $book['rows'][0]['declaredValue']);
|
||||
$this->assertSame('SYNTHETIC QA G6F service_in_customs_value', $book['rows'][0]['documentRef']);
|
||||
$this->assertStringContainsString('12(1)(e)', $book['result']['source']);
|
||||
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-offer-paths-inputs.json')), true, flags: JSON_THROW_ON_ERROR);
|
||||
$prior = json_decode($frozen['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
|
||||
$this->assertSame($prior['salesOperations'], $store['salesOperations']);
|
||||
$this->assertSame($prior['books'], $store['books']);
|
||||
$this->assertSame($prior['importExemptions']['opportunity:330'], $store['importExemptions']['opportunity:330']);
|
||||
$this->assertSame($prior['importExemptions']['opportunity:331'], $store['importExemptions']['opportunity:331']);
|
||||
$this->assertSame($prior['importExemptions']['opportunity:332'], $store['importExemptions']['opportunity:332']);
|
||||
$this->assertCount(2, $book['history']);
|
||||
$this->assertSame($prior['importExemptions'], array_diff_key($store['importExemptions'], ['opportunity:336' => true]));
|
||||
$this->assertSame($prior['offerPreparations'], $store['offerPreparations']);
|
||||
$this->assertNull($book['history'][0]['rows'][0]['importVat']);
|
||||
$this->assertNull($store['books']['opportunity:329']['result']['periods'][0]['fields']['11']);
|
||||
$this->assertNull($store['books']['opportunity:329']['result']['periods'][0]['fields']['17']);
|
||||
$this->assertStringContainsString('BR89', $store['books']['opportunity:329']['result']['sources']);
|
||||
file_put_contents(base_path('outputs/iva-l1-g6f-services-20261024/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
|
||||
final class IvaOfferPathsDraftTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
public function test_import_classification_recovers_privately_without_changing_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-offer-paths.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:334', $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['offerPreparations']['opportunity:334'];
|
||||
$this->assertCount(2, $book['rows']);
|
||||
$this->assertSame(['P084','P085'], array_column($book['rows'], 'branch'));
|
||||
$this->assertSame(['import','acquisition'], array_column($book['rows'], 'operation'));
|
||||
$this->assertArrayNotHasKey('result', $book);
|
||||
$this->assertCount(3, $book['history']);
|
||||
$this->assertSame('SYNTHETIC QA finalidade editada deliberadamente', $book['saved']['rows'][0]['purpose']);
|
||||
$this->assertSame('SYNTHETIC QA cheias', $book['rows'][1]['disaster']);
|
||||
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-g6e-inputs.json')), true, flags: JSON_THROW_ON_ERROR);
|
||||
$prior = json_decode($frozen['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
|
||||
$this->assertSame($prior['salesOperations'], $store['salesOperations']);
|
||||
$this->assertSame($prior['books'], $store['books']);
|
||||
$this->assertSame($prior['importExemptions']['opportunity:330'], $store['importExemptions']['opportunity:330']);
|
||||
$this->assertSame($prior['importExemptions']['opportunity:331'], $store['importExemptions']['opportunity:331']);
|
||||
$this->assertSame($prior['importExemptions']['opportunity:332'], $store['importExemptions']['opportunity:332']);
|
||||
$this->assertSame($prior['importExemptions'], $store['importExemptions']);
|
||||
$this->assertSame('presented', $book['rows'][0]['request']['state']);
|
||||
$this->assertSame('granted', $book['rows'][0]['requestRecords'][0]['request']['state']);
|
||||
$this->assertSame('SYNTHETIC QA apenas bens A', $book['rows'][0]['requestRecords'][0]['request']['goods']);
|
||||
$this->assertSame('2026-11', $book['rows'][0]['requestRecords'][0]['request']['periodTo']);
|
||||
$this->assertSame('SYNTHETIC QA assistência imediata às vítimas das cheias', $book['rows'][1]['humanitarianPurpose']);
|
||||
$this->assertSame('800', $book['rows'][0]['normalVat']);
|
||||
$this->assertSame('yes', $book['rows'][1]['conditionalAssumption']);
|
||||
$this->assertArrayNotHasKey('appliedBenefit', $book);
|
||||
$this->assertNull($store['books']['opportunity:329']['result']['periods'][0]['fields']['11']);
|
||||
$this->assertNull($store['books']['opportunity:329']['result']['periods'][0]['fields']['17']);
|
||||
$this->assertStringContainsString('BR89', $store['books']['opportunity:329']['result']['sources']);
|
||||
file_put_contents(base_path('outputs/iva-offer-paths-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,30 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import { newImportExemption,evaluateImportExemption,recordImportExemptions,saveImportExemptionBook,importExemptionBook,importExemptionCurrent,importExemptionRules,importServiceSource } from '../../resources/js/lib/iva-import-exemptions.ts';
|
||||
import { createProjectDossierReport } from '../../resources/js/lib/project-dossier-report.ts';
|
||||
import { offerReusableData } from '../../resources/js/lib/iva-offer-preparations.ts';
|
||||
const frozen=JSON.parse(fs.readFileSync(new URL('./fixtures/iva-offer-paths-inputs.json',import.meta.url),'utf8'));
|
||||
const rules=importExemptionRules.filter(r=>r.branch==='P050');
|
||||
const row=rule=>({...newImportExemption('g6f-'+rule.id,'MZN'),treatment:rule.id,description:'SYNTHETIC QA '+rule.label,period:'2026-12',declaredValue:'5000',importer:'SYNTHETIC QA importador destinatário',documentRef:'SYNTHETIC QA G6F '+rule.id,documentDate:'2026-11-14',evidence:'SYNTHETIC QA serviço e montante integral incluídos na base identificada, conforme artigo16; pressuposto expresso, não documento real',serviceImportRef:'SYNTHETIC QA importação DU-A,2026-12',serviceBaseRef:'SYNTHETIC QA base DU-A,linha serviço5000MZN',serviceProvider:'SYNTHETIC QA prestador',...(rule.id==='accessory_service_first_destination'?{serviceFirstDestination:'SYNTHETIC QA Manica,primeiro destino no documento de transporte'}:{}),conditions:Object.fromEntries(rule.conditions.map(([key])=>[key,'yes']))});
|
||||
const draft=()=>({...structuredClone(frozen),context_opportunity:'opportunity:336',project_title:'SYNTHETIC QA — G6F / Serviços na base da importação'});
|
||||
test('P050 two treatments exempt only service VAT;every missing/failed condition leaves service and imported-goods tax indeterminate',()=>{
|
||||
assert.equal(rules.length,2);assert.match(importServiceSource,/16\(2\)/);
|
||||
for(const rule of rules){const input=row(rule),ok=evaluateImportExemption(input,'MZN');assert.equal(ok.serviceVat,'0.00');assert.equal(ok.importVat,null);assert.match(ok.reason,/IVA do serviço/);
|
||||
for(const [key] of rule.conditions)for(const value of ['','unknown','no']){const r=evaluateImportExemption({...input,conditions:{...input.conditions,[key]:value}},'MZN');assert.equal(r.status,value==='no'?'not_applicable':'indeterminate');assert.equal(r.serviceVat,null);assert.equal(r.importVat,null);}
|
||||
for(const patch of [{serviceImportRef:''},{serviceBaseRef:''},{declaredValue:''},{documentRef:''},{period:'2025-12'},{currency:'USD'},{documentDate:'2026-02-30'}])assert.equal(evaluateImportExemption({...input,...patch},'MZN').serviceVat,null);
|
||||
}
|
||||
});
|
||||
test('first-destination reference is required only for added accessory service;switching keeps facts but cannot inherit own eligibility',()=>{
|
||||
const inValue=row(rules[0]),accessory=row(rules[1]);assert.equal(evaluateImportExemption({...accessory,serviceFirstDestination:''},'MZN').status,'indeterminate');assert.equal(evaluateImportExemption(inValue,'MZN').status,'exempt');const changed={...inValue,treatment:rules[1].id};assert.equal(evaluateImportExemption(changed,'MZN').status,'indeterminate');assert.equal(changed.documentRef,inValue.documentRef);assert.ok(!rules[0].conditions.some(([key])=>key==='serviceToFirstDestination'));
|
||||
const beyond={...accessory,conditions:{...accessory.conditions,serviceToFirstDestination:'no'}};assert.equal(evaluateImportExemption(beyond,'MZN').status,'not_applicable');assert.equal(evaluateImportExemption({...inValue,conditions:{...inValue.conditions,serviceFullValueIncluded:'no'}},'MZN').serviceVat,null);
|
||||
});
|
||||
test('save/recovery/report preserve27fiscalbooks and946fc089scenarios/requests/history exactly;service is not added to base or deduction',()=>{
|
||||
const d=draft(),prior=JSON.parse(frozen.modelo_a_snapshot);let book=recordImportExemptions(d,{rows:rules.map(rule=>({...row(rule),conditions:{}}))});book=recordImportExemptions(d,{...book,rows:rules.map(rule=>({...row(rule),conditions:{...row(rule).conditions,serviceFullValueIncluded:'no'}}))});book=recordImportExemptions(d,{...book,rows:rules.map(row)});assert.equal(book.history.length,2);assert.ok(book.history.every(h=>h.rows.every(r=>r.serviceVat===null&&r.importVat===null)));d.modelo_a_snapshot=saveImportExemptionBook(d,book);assert.deepEqual(importExemptionBook(JSON.parse(JSON.stringify(d))),book);assert.match(book.result.sourceKey,/import-included-services\/1/);const next=JSON.parse(d.modelo_a_snapshot);for(const key of ['books','salesOperations','offerPreparations'])assert.deepEqual(next[key],prior[key]);for(const [scope,previous] of Object.entries(prior.importExemptions)){assert.deepEqual(next.importExemptions[scope],previous);assert.ok(importExemptionCurrent({...d,context_opportunity:scope},previous));}assert.equal(next.books['opportunity:329'].result.periods[0].fields['11'],null);
|
||||
const report=JSON.stringify(createProjectDossierReport(d,{selectedSections:new Set(['finance']),version:'QA G6F'}));for(const token of ['Serviço associado à importação P050','IVA do serviço: 0.00','opportunity:336','Manica','2026-12','SYNTHETIC QA G6F','12(1)(e)','primeiro destino','campo11'])assert.ok(report.includes(token),token);assert.ok(!report.includes('IVA na importação: 0.00'));if(process.env.IVA_G6F_CALCULATED)fs.writeFileSync(process.env.IVA_G6F_CALCULATED,JSON.stringify(d));
|
||||
});
|
||||
test('old goods rows keep own tax representation and malformed optional service references cannot overwrite saved originals',()=>{
|
||||
const d=draft(),prior=JSON.parse(d.modelo_a_snapshot);for(const book of Object.values(prior.importExemptions))assert.ok(book.result.rows.every(row=>!Object.hasOwn(row,'serviceVat')));
|
||||
assert.throws(()=>saveImportExemptionBook(d,{rows:[{...row(rules[0]),serviceBaseRef:42}]}),/Referências do serviço/);
|
||||
const serviceOnly={...d,context_opportunity:'opportunity:336'};serviceOnly.modelo_a_snapshot=saveImportExemptionBook(serviceOnly,{rows:rules.map(row)});assert.equal(offerReusableData(serviceOnly).length,0,'P050 services cannot be reused as imported goods in P084');
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import { offerPreparationBook,saveOfferPreparationBook,recordOfferRequest,emptyOfferRequest,offerScenarios,offerPathReport,recordOfferPreparations } from '../../resources/js/lib/iva-offer-preparations.ts';
|
||||
import { createProjectDossierReport } from '../../resources/js/lib/project-dossier-report.ts';
|
||||
const frozen=JSON.parse(fs.readFileSync(new URL('./fixtures/iva-g6e-inputs.json',import.meta.url),'utf8'));
|
||||
const draft=()=>({...structuredClone(frozen),context_opportunity:'opportunity:334',project_title:'SYNTHETIC QA — Offer paths'});
|
||||
const row84=()=>({...offerPreparationBook(draft()).rows[0],normalVat:'800',normalVatSource:'SYNTHETIC QA pressuposto expresso, não taxa inferida',conditionalAssumption:'yes'});
|
||||
test('presented request never grants benefit;normal amount requires own source and conditional scenario explicit material assumptions',()=>{
|
||||
const row={...row84(),request:{...emptyOfferRequest(),state:'presented',reference:'SYNTHETIC QA pedido',presentedOn:'2026-11-20'}};
|
||||
assert.deepEqual(offerScenarios(row),{normalVat:'800',conditionalVat:'0.00',conditionalReason:offerScenarios(row).conditionalReason,applied:false});assert.match(offerScenarios(row).conditionalReason,/Não é benefício concedido/);
|
||||
for(const patch of [{conditionalAssumption:''},{goodsSuitable:''},{goodsSuitable:'no'},{period:'2027-01'},{currency:'USD'}])assert.equal(offerScenarios({...row,...patch}).conditionalVat,null);
|
||||
for(const patch of [{normalVat:''},{normalVatSource:''},{normalVat:'-10'},{normalVat:'desconhecido'}])assert.equal(offerScenarios({...row,...patch}).normalVat,null);
|
||||
assert.match(offerPathReport(row),/Pedido Apresentado/);assert.match(offerPathReport(row),/apresentar pedido não concede isenção/);
|
||||
});
|
||||
test('P084 recorded decisions preserve goods/operation/period/conditions and previous decision when current inputs change',()=>{
|
||||
let row={...row84(),request:{...emptyOfferRequest(),state:'granted',decisionRef:'SYNTHETIC QA decisão parcial',decisionOn:'2026-11-25',goods:'SYNTHETIC QA só bens A',operation:'import',periodFrom:'2026-12',periodTo:'2026-12',conditions:'SYNTHETIC QA exclusivamente entrega ao destinatário A'}};
|
||||
row=recordOfferRequest(row);assert.equal(row.requestRecords.length,1);const accepted=structuredClone(row.requestRecords[0]);
|
||||
row={...row,description:'Bens B posteriores',operation:'acquisition',period:'2027-01',request:{...row.request,state:'denied',decisionRef:'SYNTHETIC QA decisão B',goods:'Bens B',periodFrom:'2027-01',periodTo:'2027-01',operation:'acquisition',conditions:'SYNTHETIC QA apenas pedido B'}};row=recordOfferRequest(row);assert.deepEqual(row.requestRecords[0],accepted);assert.equal(row.requestRecords.length,2);assert.equal(offerScenarios(row).applied,false);assert.equal(offerScenarios(row).conditionalVat,null);assert.match(offerPathReport(row),/não estender decisão/);
|
||||
for(const key of ['goods','operation','periodFrom','periodTo','conditions'])assert.throws(()=>recordOfferRequest({...row,request:{...row.request,[key]:''}}),/âmbito da decisão/);
|
||||
const exact=recordOfferRequest({...row,request:{...row.request,periodFrom:'2027-01-10',periodTo:'2027-01-15'}});assert.equal(exact.requestRecords.at(-1).request.periodFrom,'2027-01-10');assert.equal(exact.requestRecords.at(-1).request.periodTo,'2027-01-15');assert.throws(()=>recordOfferRequest({...row,request:{...row.request,periodFrom:'2027-02-30',periodTo:'2027-03-01'}}),/âmbito da decisão/);
|
||||
const literal=recordOfferRequest({...row,request:{...row.request,operation:'',operationScope:'SYNTHETIC QA aquisição e importação dos bens A',periodFrom:'',periodTo:'',periodScope:'SYNTHETIC QA desde a decisão até revogação, sem termo'}});assert.match(offerPathReport(literal),/até revogação, sem termo/);assert.equal(literal.requestRecords.at(-1).request.operationScope,'SYNTHETIC QA aquisição e importação dos bens A');
|
||||
assert.equal(row.requestRecords[0].request.operation,'import');assert.equal(row.operation,'acquisition');
|
||||
});
|
||||
test('P085 humanitarian purpose/emergency/documents are distinct;missing inputs stay indeterminate and no P084 state is imposed',()=>{
|
||||
const base={...offerPreparationBook(draft()).rows[1],period:'2026-12',beneficiary:'SYNTHETIC QA destinatário',purpose:'SYNTHETIC QA atenuar cheias',humanitarianPurpose:'SYNTHETIC QA água e alimentação para deslocados',availableDocuments:'SYNTHETIC QA lista de bens\nSYNTHETIC QA guia disponível',normalVat:'160',normalVatSource:'SYNTHETIC QA previsão explícita',conditionalAssumption:'yes'};
|
||||
assert.equal(offerScenarios(base).conditionalVat,'0.00');assert.equal(offerScenarios({...base,humanitarianPurpose:''}).conditionalVat,null);assert.equal(offerScenarios({...base,mitigation:'no'}).conditionalVat,null);assert.throws(()=>recordOfferRequest(base),/P084/);assert.match(offerPathReport(base),/finalidade humanitária/);assert.match(offerPathReport(base),/procedimento de emergência\/doação por corresponder/);assert.equal(base.request,undefined);
|
||||
});
|
||||
test('save/recover/report retain old drafts/histories and all27fiscalbooks;normal and conditional are labelled and field11 stays unchanged',()=>{
|
||||
const d=draft(),prior=JSON.parse(frozen.modelo_a_snapshot),old=offerPreparationBook(d);const priorDecision=recordOfferRequest({...row84(),request:{...emptyOfferRequest(),state:'granted',decisionRef:'SYNTHETIC QA decisão parcial anterior',goods:'SYNTHETIC QA apenas bens A',operation:'import',periodFrom:'2026-11',periodTo:'2026-11',conditions:'SYNTHETIC QA só a operação anterior A'}});const p84=recordOfferRequest({...priorDecision,request:{...emptyOfferRequest(),state:'presented',reference:'SYNTHETIC QA pedido em apreciação'}});const p85={...old.rows[1],period:'2026-12',beneficiary:'SYNTHETIC QA destinatário',purpose:'SYNTHETIC QA resposta humanitária',humanitarianPurpose:'SYNTHETIC QA assistência imediata às vítimas das cheias',availableDocuments:'SYNTHETIC QA bens e destinatário',normalVat:'160',normalVatSource:'SYNTHETIC QA previsão sem taxa inferida',conditionalAssumption:'yes'};
|
||||
const book=recordOfferPreparations({...old,rows:[p84,p85]});assert.deepEqual(book.history.at(-1),old.saved);d.modelo_a_snapshot=saveOfferPreparationBook(d,book);assert.deepEqual(offerPreparationBook(JSON.parse(JSON.stringify(d))),book);const next=JSON.parse(d.modelo_a_snapshot);for(const key of ['books','salesOperations','importExemptions'])assert.deepEqual(next[key],prior[key]);assert.equal(next.books['opportunity:329'].result.periods[0].fields['11'],null);
|
||||
const report=JSON.stringify(createProjectDossierReport(d,{selectedSections:new Set(['finance']),version:'QA offer paths'}));for(const token of ['Pedido Apresentado','Cenário normal','Cenário condicionado à isenção','hipótese','finalidade humanitária','benefício não aplicado','800','160','apresentar pedido não concede isenção','SYNTHETIC QA decisão parcial anterior','SYNTHETIC QA apenas bens A','2026-11'])assert.ok(report.includes(token),token);
|
||||
if(process.env.IVA_OFFER_PATHS)fs.writeFileSync(process.env.IVA_OFFER_PATHS,JSON.stringify(d));
|
||||
});
|
||||
Reference in New Issue
Block a user