سامانه صدور فاکتور و حسابداری
Verify Phase 4 deduction account mappings
davoodmehraban89 committed
Sep 29, 2026 at 12:52 UTC
bd2ad654b382b966b33a615f7ca55537cde2d206
1 file changed
+1
scripts/phase4-behavior-check.mjs
+1
@@ -11,5 +11,6 @@ if(ctx.p4ContractLocked(ds.contracts[0]))throw new Error('active contract locked
11
ds.expenses.push({ownerUserId:'u1',projectId:'p1',kind:'expense',amount:100});ds.purchases.push({ownerUserId:'u1',projectId:'p1',grandTotal:200});
12
ds.contractStatements.push({ownerUserId:'u1',companyId:'c1',contractId:'c',status:'posted',grossAmount:1000});
13
const pr=ctx.p4ContractProfit(ds.contracts[0]);if(pr.revenue!==1000||pr.cost!==300||pr.profit!==700)throw new Error('profitability reconciliation failed');
14
+for(const accountCode of ["'1105'","'1106'","'1107'","'2105'","'6109'"])if(!code.includes(accountCode))throw new Error('deduction account mapping missing '+accountCode);
15
for(const token of ['p4PostStatement','p4ReverseStatement','p4Audit','contractDeductions','guaranteeEvents'])if(!code.includes(token))throw new Error('missing '+token);
16
console.log('Phase 4 behavior checks passed');