سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 01:45 UTC
fix(pilot): enforce posted purchase status for payment allocation and forbid unlinked history deletion
davoodmehraban89 committed
Oct 14, 2026 at 08:56 UTC
5bbd3cce93a5863cc9380859299f127c135c3d38
1 file changed
+1
js/payments.js
+1
@@ -12,6 +12,7 @@ function invoiceOutstanding(inv){
12
return Math.max(0,gross-paid);
13
}
14
function purchaseOutstanding(inv){
15
+ if(typeof purchaseDocumentStatus==='function'&&purchaseDocumentStatus(inv)!=='posted')return 0;
16
const gross=num(inv?.grandTotal);
17
if(inv?.paymentMethod!=='credit')return 0;
18
const paid=getMyPayments().filter(p=>p.direction==='outbound'&&p.invoiceType==='purchase'&&p.invoiceId===inv.id).reduce((s,p)=>s+num(p.amount),0);