@davoodmehraban89 / Factor-easy / commits / 5a05e6b
Fork 0

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

fix(company): stamp company on cheques.js records and guard company writes

davoodmehraban89 committed Oct 14, 2026 at 11:35 UTC 5a05e6b062da985f57d1c5fc3b53bd3b9b482b8f
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();