فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
Cover fiscal period ownership and date validation in accounting reports
davoodmehraban89 committed
Oct 13, 2026 at 13:26 UTC
fb0ee7aed08f1a560608ee670aa68ba788e56c5d
1 file changed
+11
tests/reconciliation.test.mjs
+11
@@ -101,3 +101,14 @@ test('real integrated purchase-sale-settlement reconciles without errors and rej
101
Auth.currentUser={id:'guest',role:'user'};
102
await assert.rejects(accounts.reconciliationReport(),/مدیر/);
103
});
104
+
105
+test('accounting report period filters reject foreign periods and malformed Jalali dates',async()=>{
106
+ await setup();
107
+ const p=(await accounts.listPeriods())[0];
108
+ await db.put('fiscal_periods',{id:'foreign-period',companyId:'foreign-c',
109
+ name:'other',startDate:'1405/01/01',endDate:'1405/12/29',status:'open'});
110
+ await assert.rejects(accounts.financialReports({periodId:'foreign-period'}),/شرکت فعال/);
111
+ await assert.rejects(accounts.financialReports({from:'2026-10-13'}),/تاریخ|شمسی/);
112
+ const report=await accounts.financialReports({periodId:p.id,from:'1405/01/01',to:'1405/12/29'});
113
+ assert.equal(report.postedCount,0);
114
+});