سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 3, 18:15 UTC
Prevent duplicate sales invoice numbers
davoodmehraban89 committed
Sep 28, 2026 at 13:43 UTC
05af0108df583939a86aec2a2f9466a6f10c3906
1 file changed
+1
js/invoices.js
+1
@@ -332,6 +332,7 @@ function commitSaveInvoice(){
332
const paymentMethod=document.getElementById('invoice-payment-method')?.value||'cash';
333
const paymentMethodLabel=paymentMethod==='credit'?'نسیه':'نقدی';
334
const editId=document.getElementById('edit-invoice-id')?.value;
335
+ if(getMyInvoices().some(i=>i.id!==editId&&i.companyId===companyId&&String(i.number||'').trim()===number)){alert('شماره فاکتور برای این شرکت قبلاً ثبت شده است.');return;}
336
if(kind==='non_formal'){document.getElementById('invoice-vat-mode').value='none';}
337
338
const contractNumber=document.getElementById('invoice-contract-number')?.value.trim()||'';