Private
Tracker *Bug Feature Support Testing
Subject *
Description Edit *Code Location:* vendorInvoiceController.js:L2708(updateVendorOutstandingBalance) *What is happening in code:* The system calculates a vendor's outstanding debt by summing all invoices with paymentStatus: "Unpaid" or "Partially Paid". When you pay off the final invoice, the query finds zero unpaid invoices (result.length === 0). The code then encounters an early return statement: if (!result || result.length === 0) return; // 💥 Exits without updating the vendor! *Real-Life Example:* You owe Vendor XYZ $5,000 across two invoices ($2,500 each). The vendor profile correctly shows: Outstanding Balance: $5,000. You pay off both invoices via bank transfer and mark them as "Paid". The aggregation runs, finds 0 unpaid invoices, and immediately exits. What breaks: The vendor profile still displays Outstanding Balance: $5,000 forever! Business Impact: Your accounts payable reports show debts that have already been paid. You risk paying a vendor twice or having arguments over settling accounts. *Sample Fix :* if (!result || result.length === 0) { // Explicitly reset balance to zero! await Vendor.updateOne({ vendor_id: vendorId }, { $set: { outstandingBalance: 0 } }); return; }
Status Resolved
Priority *Low Normal High Immediate
Assignee Ajit ABindu DandaChandra SekharDivya InapakurthiKarthik PalakondaPavan Kumar MuralaRavi Shankar PalleRavindra AtthotaSai MahanandaSai Priyatham SadineniSowjanya atthotaSravani RangannapalemTeja Sriram SanganiYalavarthi Thriveni
Target version Sprint (10/05/2026- 10/09/2026) sprint (10/12/2026 - 10/31/2026) Backlog
Parent task
Start date
Due date
Estimated time Hours
% Done0 % 10 % 20 % 30 % 40 % 50 % 60 % 70 % 80 % 90 % 100 %