@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 086c767
Fork 0

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

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 4, 10:30 UTC

fix(company): port reviewed active-company isolation in js/invoice-excel-import.js

davoodmehraban89 committed Oct 14, 2026 at 13:14 UTC 086c76714d6c9423758a17a95e12479230196f89
1 file changed +2 -2
js/invoice-excel-import.js
+2 -2
@@ -2,7 +2,7 @@
2 function importInvoiceItemsFromExcel(event){
3 if(!requireWrite())return;
4 const file=event.target.files[0];
5 - if(!file)return;if(file.size>5*1024*1024){event.target.value='';alert('حجم فایل اکسل نباید بیشتر از ۵ مگابایت باشد.');return;}
5 + if(!file)return;if(!finoraActiveCompanyId()){alert('ابتدا شرکت فعال را انتخاب کنید.');return;}if(file.size>5*1024*1024){event.target.value='';alert('حجم فایل اکسل نباید بیشتر از ۵ مگابایت باشد.');return;}
6 const reader=new FileReader();
7 reader.onload=function(e){
8 try{
@@ -24,7 +24,7 @@ function importInvoiceItemsFromExcel(event){
24 prodId=prod.id;
25 }else{
26 prodId='P_'+Date.now()+'_'+Math.random().toString(36).slice(2,6);
27 - const newProd={id:prodId,ownerUserId:currentUser.id,code:code||(myProducts.length+added+1).toString(),name:name||code,spec:'',type:'good',unit,buy_price:0,sale_price:price,stock:0,internal_id:''};
27 + const newProd={id:prodId,ownerUserId:currentUser.id,companyId:finoraActiveCompanyId(),code:code||(myProducts.length+added+1).toString(),name:name||code,spec:'',type:'good',unit,buy_price:0,sale_price:price,stock:0,internal_id:''};
28 datastore.products.push(newProd);
29 myProducts.push(newProd);
30 }