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

fix(company): port reviewed active-company isolation in js/cheques.js

davoodmehraban89 committed Oct 14, 2026 at 13:14 UTC 2e8fc87f422d6b2bec82679a0e9a58774906ec68
1 file changed +2 -1
js/cheques.js
+2 -1
@@ -8,7 +8,8 @@ function commitSaveCheque(){
8 const bank=document.getElementById('chq-bank-input').value;
9 const amount=parseFormattedNumber(document.getElementById('chq-amount-input').value);
10 if(!sayad_id||amount<=0){alert('اطلاعات چک نامعتبر است.');return;}
11 - datastore.cheques.push({id:'CHQ_'+Date.now(),ownerUserId:currentUser.id,direction,contactName,sayad_id,bank,amount,due_date:document.getElementById('chq-due-input').value,status:document.getElementById('chq-status-input').value});
11 + if(!finoraActiveCompanyId())return alert('ابتدا شرکت فعال را انتخاب کنید.');
12 + datastore.cheques.push({id:'CHQ_'+Date.now(),ownerUserId:currentUser.id,companyId:finoraActiveCompanyId(),direction,contactName,sayad_id,bank,amount,due_date:document.getElementById('chq-due-input').value,status:document.getElementById('chq-status-input').value});
13 saveDatastore();
14 alert('چک ثبت شد.');
15 refreshAllSurfaces();