سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 22:00 UTC
Verify expense and income source posting
davoodmehraban89 committed
Sep 29, 2026 at 22:21 UTC
a10bcf64fb9376df59e65e544ad0d1ee7cc0278e
1 file changed
+1
scripts/phase3-behavior-check.mjs
+1
@@ -30,5 +30,6 @@ let dup=false;try{ctx.jePostSourceRecord('receipt',{...receipt,journalVoucherId:
30
const rv=ctx.jeReverse(v.id,'1405/07/08','test reversal');
31
assert(v.status==='reversed'&&rv.status==='posted','reversal lifecycle failed');
32
assert(ctx.jeTrialBalance().every(x=>Math.abs(x.balance)<0.0001),'reversal must net original ledger to zero');
33
+const ev=ctx.jePostSourceRecord('expense',{id:'EXP_OK',date:'1405/07/08',amount:700});assert(ev.status==='posted','expense source must post');const iv=ctx.jePostSourceRecord('income',{id:'INC_OK',date:'1405/07/08',amount:900});assert(iv.status==='posted','income source must post');
34
fiscal[0].status='locked';let locked=false;try{ctx.jePostSourceRecord('expense',{id:'EXP1',date:'1405/07/09',amount:1000})}catch(_){locked=true}assert(locked,'locked fiscal year must reject posting');
35
console.log('Phase 3 behavioral accounting scenarios passed.');