سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 05:30 UTC
fix(treasury): exclude reversed historical payment source revisions from project cash totals
davoodmehraban89 committed
Oct 14, 2026 at 10:53 UTC
aa8b0c4e7f06ba0130f421c279bec71d95bc2808
1 file changed
+2
-2
js/accounting.js
+2
-2
@@ -19,8 +19,8 @@ function getProjectFinancials(projectId){
19
const purchases=getMyPurchases().filter(i=>companyOk(i)&&purchaseAffectsBalance(i)&&(i.projectId===projectId||i.costCenterId===projectId)).reduce((s,i)=>s+n(i.grandTotal),0);
20
const expenses=getMyExpenses().filter(e=>companyOk(e)&&e.projectId===projectId&&e.kind==='expense').reduce((s,e)=>s+n(e.amount),0);
21
const income=getMyExpenses().filter(e=>companyOk(e)&&e.projectId===projectId&&e.kind==='income').reduce((s,e)=>s+n(e.amount),0);
22
- const receipts=getMyPayments().filter(p=>companyOk(p)&&p.projectId===projectId&&p.direction==='inbound').reduce((s,p)=>s+n(p.amount),0);
23
- const payments=getMyPayments().filter(p=>companyOk(p)&&p.projectId===projectId&&p.direction==='outbound').reduce((s,p)=>s+n(p.amount),0);
22
+ const receipts=(typeof paymentEffectiveRecords==='function'?paymentEffectiveRecords():getMyPayments()).filter(p=>companyOk(p)&&p.projectId===projectId&&p.direction==='inbound').reduce((s,p)=>s+n(p.amount),0);
23
+ const payments=(typeof paymentEffectiveRecords==='function'?paymentEffectiveRecords():getMyPayments()).filter(p=>companyOk(p)&&p.projectId===projectId&&p.direction==='outbound').reduce((s,p)=>s+n(p.amount),0);
24
return {sales,purchases,expenses,income,receipts,payments,accrualProfit:sales+income-purchases-expenses,cashNet:receipts+income-payments-expenses};
25
}
26
window.productMovement=productMovement;window.getInventorySnapshot=getInventorySnapshot;window.getProjectFinancials=getProjectFinancials;