@davoodmehraban89 / Factor-easy / commits / 7aff108
Fork 0

سامانه صدور فاکتور و حسابداری

Verify reports honor custom chart account types

davoodmehraban89 committed Sep 29, 2026 at 22:28 UTC 7aff10833093b3d5ecc144f71526d8a2fba1aed6
1 file changed +1 -1
scripts/phase6-behavior-check.mjs
+1 -1
@@ -1,5 +1,5 @@
1 import fs from 'node:fs';import vm from 'node:vm';
2 -const accounts=[{id:'A1',code:'1101',title:'بانک',postingAllowed:true},{id:'A2',code:'4101',title:'فروش',postingAllowed:true},{id:'A3',code:'5101',title:'هزینه',postingAllowed:true}];
2 +const accounts=[{id:'A1',code:'X-01',title:'حساب نقد سفارشی',accountType:'asset',postingAllowed:true},{id:'A2',code:'X-02',title:'عنوان سفارشی درآمد',accountType:'revenue',postingAllowed:true},{id:'A3',code:'X-03',title:'عنوان سفارشی هزینه',accountType:'expense',postingAllowed:true}];
3 const vouchers={V1:{id:'V1',number:'1',date:'1405/01/01',status:'posted',sourceType:'sale'},V2:{id:'V2',number:'2',date:'1405/01/02',status:'posted',sourceType:'expense'}};
4 const rows=[{id:'L1',voucherId:'V1',accountId:'A1',debit:100,credit:0,voucher:vouchers.V1,account:accounts[0]},{id:'L2',voucherId:'V1',accountId:'A2',debit:0,credit:100,voucher:vouchers.V1,account:accounts[1]},{id:'L3',voucherId:'V2',accountId:'A3',debit:30,credit:0,voucher:vouchers.V2,account:accounts[2]},{id:'L4',voucherId:'V2',accountId:'A1',debit:0,credit:30,voucher:vouchers.V2,account:accounts[0]}];
5 const ctx={window:{},console,jeLedgerRows:()=>rows,getMyAccounts:()=>accounts,getMyJournalLineDimensions:()=>[{journalLineId:'L1',dimensionValueId:'D1'}],getMyDimensionTypes:()=>[],getMyGlobalProjects:()=>[],getMyContracts:()=>[],getMyInvoices:()=>[{id:'I1',number:'11',date:'1405/01/01',kind:'formal',grandTotal:100}],jeActiveSourceVoucher:()=>null,jeReceivableAccount:()=>({id:'AR'}),jeRevenueAccount:()=>({id:'REV'}),jeCashAccount:()=>({id:'CASH'}),getJalaliNumeric:()=> '1405/01/30',requireWrite:()=>true,confirm:()=>false,esc:x=>String(x)};vm.createContext(ctx);vm.runInContext(fs.readFileSync('js/phase6-reporting.js','utf8'),ctx);const P=ctx.window.P6Reports;if(!P)throw new Error('P6Reports not exported');