سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 01:45 UTC
Treat cash invoices as settled in outstanding calculations
davoodmehraban89 committed
Sep 28, 2026 at 15:13 UTC
c333ecfe39d711547c60a3ed4e0f0cb0655eb32b
1 file changed
+2
js/payments.js
+2
@@ -7,11 +7,13 @@ function paymentDirectionLabel(v){return v==='outbound'?'پرداخت':'دریا
7
function paymentMethodLabel(v){return ({cash:'نقد',card:'کارت',bank:'انتقال بانکی',cheque:'چک'}[v]||'سایر');}
8
function invoiceOutstanding(inv){
9
const gross=num(inv?.grandTotal);
10
+ if(inv?.paymentMethod!=='credit')return 0;
11
const paid=getMyPayments().filter(p=>p.direction==='inbound'&&p.invoiceType==='sale'&&p.invoiceId===inv.id).reduce((s,p)=>s+num(p.amount),0);
12
return Math.max(0,gross-paid);
13
}
14
function purchaseOutstanding(inv){
15
const gross=num(inv?.grandTotal);
16
+ if(inv?.paymentMethod!=='credit')return 0;
17
const paid=getMyPayments().filter(p=>p.direction==='outbound'&&p.invoiceType==='purchase'&&p.invoiceId===inv.id).reduce((s,p)=>s+num(p.amount),0);
18
return Math.max(0,gross-paid);
19
}