@davoodmehraban89 / Factor-easy / commits / a5b6766
Fork 0

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

Bound sales Excel import resources

davoodmehraban89 committed Sep 29, 2026 at 22:34 UTC a5b6766c038bb538e2ffba7bec7743d9cd1a56ba
1 file changed +2 -2
js/invoice-excel-import.js
+2 -2
@@ -2,13 +2,13 @@
2 function importInvoiceItemsFromExcel(event){
3 if(!requireWrite())return;
4 const file=event.target.files[0];
5 - if(!file)return;
5 + if(!file)return;if(file.size>5*1024*1024){event.target.value='';alert('حجم فایل اکسل نباید بیشتر از ۵ مگابایت باشد.');return;}
6 const reader=new FileReader();
7 reader.onload=function(e){
8 try{
9 const data=new Uint8Array(e.target.result);
10 const workbook=XLSX.read(data,{type:'array'});
11 - const rows=XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]]);
11 + const rows=XLSX.utils.sheet_to_json(workbook.Sheets[workbook.SheetNames[0]]);if(rows.length>10000)throw new Error('too many rows');
12 const myProducts=getMyProducts();
13 let added=0;
14 rows.forEach(r=>{