Skip to content

feat(report): Invoices Awaiting Receipt - #12

Merged
sayanthns merged 1 commit into
mainfrom
feat/invoices-awaiting-receipt
Oct 22, 2026
Merged

sayanthns merged 1 commit into
mainfrom
feat/invoices-awaiting-receipt

Conversation

@sayanthns

Copy link
Copy Markdown
Contributor

What

New Script Report Invoices Awaiting Receipt (Ram Custom, Purchase Invoice). Tracks Purchase Invoices booked before the goods are received.

Why

Rukn books PIs first (Update Stock off, no PO) and enters the PR ~30 days later. ERPNext holds no PI-PR link, so To-Bill and the existing Purchase Invoice Fulfilment Status report cannot show what is outstanding. Live check (read-only, 2026-10-22): 2,705 PI-first invoices, 0 PO-linked; 2,703 pair 1:1 with a PR on supplier + invoice number.

How

Pairs PI bill_no with PR custom_supplier_invoice_number per supplier (case/space/dash-insensitive), plus any direct item link. Four views: Invoices Awaiting Receipt, Receipts Without Invoice, Amount Mismatch, Possible Duplicate Receipts (catches the -DUPLICTE suffix trick behind PR-0411).

Tests

Pure-logic unit tests (12, run locally with a stubbed frappe: pass) plus site-data smoke tests (not run in a bench). Code run read-only against live data via console: all 4 views return in <1s.

Deploy

No migrate patches, no schema change. Standard report JSON is synced by bench migrate.

🤖 Generated with Claude Code

…r invoice no)

Rukn books Purchase Invoices before the goods arrive (Update Stock off, no PO)
and enters the Purchase Receipt later; ERPNext holds no link between them, so
standard To-Bill / fulfilment views cannot show what is still outstanding.

Pairs the two documents on supplier + supplier invoice number (case, spaces
and dashes ignored), plus any direct item link. Four views:
- Invoices Awaiting Receipt (ageing, possible same-amount receipt hint)
- Receipts Without Invoice
- Amount Mismatch (paired by number, totals differ beyond tolerance)
- Possible Duplicate Receipts (DUP/COPY suffix on the invoice number, or same
  supplier + invoice date + items/qty/rate)

Matching and duplicate logic are pure functions with unit tests; smoke tests
run every view against site data.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sayanthns
sayanthns merged commit 05c1a81 into main Oct 22, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant