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

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

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

Synced Dec 4, 01:45 UTC

Fix settlement document number labels

davoodmehraban89 committed Sep 28, 2026 at 15:21 UTC fc180d2b70d9291cac93e1794195f1ce85b06727
1 file changed +2 -2
js/payments.js
+2 -2
@@ -38,8 +38,8 @@ function refreshPaymentInvoices(){
38 const dir=document.getElementById('pay-direction')?.value||'inbound';
39 const cid=document.getElementById('pay-contact')?.value||'';
40 let rows=[];
41 - if(dir==='inbound')rows=getMyInvoices().filter(i=>(!cid||i.contactId===cid)&&invoiceOutstanding(i)>0).map(i=>({id:i.id,type:'sale',label:`فروش ${i.invoiceNumber||i.id} — مانده ${invoiceOutstanding(i).toLocaleString('fa-IR')}`}));
42 - else rows=getMyPurchases().filter(i=>(!cid||i.supplierId===cid)&&purchaseOutstanding(i)>0).map(i=>({id:i.id,type:'purchase',label:`خرید ${i.invoiceNo||i.id} — مانده ${purchaseOutstanding(i).toLocaleString('fa-IR')}`}));
41 + if(dir==='inbound')rows=getMyInvoices().filter(i=>(!cid||i.contactId===cid)&&invoiceOutstanding(i)>0).map(i=>({id:i.id,type:'sale',label:`فروش ${i.number||i.invoiceNumber||i.id} — مانده ${invoiceOutstanding(i).toLocaleString('fa-IR')}`}));
42 + else rows=getMyPurchases().filter(i=>(!cid||i.supplierId===cid)&&purchaseOutstanding(i)>0).map(i=>({id:i.id,type:'purchase',label:`خرید ${i.number||i.invoiceNo||i.id} — مانده ${purchaseOutstanding(i).toLocaleString('fa-IR')}`}));
43 const prev=el.value;
44 el.innerHTML='<option value="">بدون تخصیص به فاکتور</option>'+rows.map(r=>`<option value="${r.type}|${escP(r.id)}">${escP(r.label)}</option>`).join('');
45 if([...el.options].some(o=>o.value===prev))el.value=prev;