Project

General

Profile

Actions

Feature #619

open
MN RH

Supplier-wise outstanding (unpaid) bills view in Pharmacy

Feature #619: Supplier-wise outstanding (unpaid) bills view in Pharmacy

Added by Medha N. 16 days ago. Updated 2 days ago.

Status:
Resolved
Priority:
Normal
Target version:
-
Start date:
10/28/2026
Due date:
% Done:

0%

Estimated time:
Resolved By:

Description

Module: Pharmacy → Inventory → Purchasing → Payables
Environment: Test, VVMC: https://vvmc.test.clinq.health/pharmacy/inventory/purchase-orders?tab=payables (v2026.10.38)
Type: Enhancement
Priority: Medium–High

Description

The pharmacy needs a clear view of which bills are unpaid for each supplier, so it knows whom to pay, how much and by when. The current Payables tab shows supplier totals, and an expandable GRN list for each supplier, but it doesn’t work as an outstanding-bills view.

Current behaviour
Supplier totals: Invoiced, Paid, Advance, Credits, Outstanding, Overdue, Balance.
“Show GRNs” per supplier lists GRN number, received date, invoice number and amount, paid, outstanding, and “No due date.”
Gaps:
Only GRNs with a recorded invoice count as outstanding. GRNs that are “Awaiting invoice” show as “Invoice not recorded” with no amount, even though the goods were received and are owed. (On VVMC production, all 85 GRNs are in this state.)
No due date or ageing. Bills can’t be sorted or filtered by how long they’ve been unpaid, and the Overdue column stays ₹0.
No consolidated list. There’s no single list of all unpaid bills across suppliers; each supplier has to be expanded one at a time.
No filter for “Outstanding only,” “Overdue,” or a specific supplier.
No export or print of the outstanding bill list for accounts or for supplier reconciliation.
Expected behaviour

Add an “Outstanding Bills” view, either as a new tab under Purchasing or as a mode of the Payables tab:

Columns

Supplier GRN # Invoice # Invoice date Due date Invoice amount Paid Outstanding Days outstanding / overdue Status

Behaviour

Shows every unpaid or part-paid bill, grouped by supplier, with a subtotal per supplier and a grand total.
Includes GRNs awaiting invoice at their GRN value, tagged “Invoice pending,” so received goods aren’t missed.
Filters: supplier, status (Unpaid / Part-paid / Overdue / Invoice pending), and date range.
Sort by due date, by days outstanding, or by amount.
Ageing buckets: 0–30, 31–60, 61–90 and 90+ days.
A “Pay” action on each bill, or on a selection of bills, which opens Record payment with those bills already selected.
Export to Excel / CSV, and Print a supplier statement.
Acceptance criteria
There’s a single list of all unpaid and part-paid supplier bills, with a subtotal per supplier and a grand total.
GRNs awaiting invoice appear at their GRN value, tagged “Invoice pending.”
The view can be filtered by supplier, status and date, and sorted by due date, age or amount.
Ageing buckets (0–30 / 31–60 / 61–90 / 90+) are shown.
Bills can be selected and paid from the view.
Export (Excel / CSV) and print (supplier statement) work.
Totals match the Payables tab’s Outstanding for each supplier.

RH Updated by Roshni Harish. 14 days ago Actions #1

  • Subject changed from Pharmacy: show outstanding bills of suppliers to Supplier-wise outstanding (unpaid) bills view in Pharmacy
  • Description updated (diff)

RH Updated by Roshni Harish. 14 days ago Actions #2

  • Assignee set to Arya M.

RH Updated by Roshni Harish. 10 days ago Actions #3

  • Assignee changed from Arya M. to Kavin Kumar

RH Updated by Roshni Harish. 10 days ago Actions #4

  • Assignee changed from Kavin Kumar to SK -

S- Updated by SK - 2 days ago Actions #5

  • Status changed from New to Resolved
  • Resolved By set to SK -

Built the Outstanding Bills view and fixed the root cause behind the "GRNs awaiting invoice show nothing owed" gap.

Root cause (code-confirmed): VendorPaymentService.GetPayablesAsync summed only invoiced GRN lines into TotalOutstanding/OverdueAmount, so a GRN with no invoice yet (all 85 on VVMC production) read as owing ₹0 even though goods were received.

Shipped:

  • Payables tab's own Outstanding total now includes GRNs awaiting invoice at their own computed receipt value (Overdue/Payable/Credits/Balance intentionally unchanged - those stay invoice-scoped, as documented in the existing credit-note tests).
  • New "Outstanding Bills" tab (Inventory > Purchasing): every unpaid/part-paid bill across every supplier, one flat list. GRNs awaiting invoice are listed at their GRN value, tagged "Invoice pending", ageing from the GRN's received date (no invoice date exists yet) - never flagged Overdue (no due date to compare against).
  • Columns: Supplier, GRN #, Invoice #, Invoice date, Due date, Invoice amount, Paid, Outstanding, Days outstanding, Ageing bucket (0-30/31-60/61-90/90+), Status (Unpaid/Part-paid/Overdue/Invoice pending - one priority-ordered tag per bill).
  • Filters: supplier, status, date range (on invoice date, or received date while invoice-pending). Sort: due date / days outstanding / amount.
  • Grand total and per-supplier subtotals shown above the list, computed over the whole filtered set (not just the page on screen) - verified these match the Payables tab's own Outstanding per supplier.
  • Pay: per bill, or a same-supplier checkbox selection (disabled across suppliers), opens the existing Record payment drawer pre-filled.
  • Export to CSV (the existing shared pattern). Print a supplier statement once exactly one supplier is selected, through the same print path Pharmacy's other reports use.

Scoped down from the ticket, deliberately: Excel export - CSV only; a genuine .xlsx export would be a new dependency for one page. If Excel specifically is needed, happy to pick that up as a follow-up.

Spec: clinq-docs/modules/pharmacy/specs/2026-11-11-outstanding-bills-view-design.md
Plan: clinq-docs/modules/pharmacy/plans/2026-11-11-outstanding-bills-view-plan.md

Pushed to nuvita-pharmacy dev at 8bcedade (built on e8e1082a). Full backend suite green (4269 tests, 96.3% line coverage). Full frontend suite green (3411 tests, 364 files; coverage 93.9% statements/lines, 87.3% branches, 77.3% functions - all above this repo's floors). QA change-log row added, flagging the Payables Outstanding number change explicitly since it's a visible number that goes up for suppliers with un-invoiced GRNs - that's the real amount owed, previously hidden.

S- Updated by SK - 2 days ago Actions #6

  • Assignee changed from SK - to Roshni Harish.

Reassigning to Roshni for verification.

Actions

Also available in: PDF Atom