PRD: Partner Ledger & P&L
| Module | Finance (CORE-12) | PRD ID | PRD-LDG-001 |
| Status | Planned | Owner | Việt Võ · Phát Nguyễn |
| Date | 2026-06-11 | Version | v0.1 (draft) |
| Packages | @nx/finance · apps/client | URD | LDG |
| Epic | BANA-1324 | Window | Jul (receivables) · Aug (ledger view + P&L) |
TL;DR
One partner ledger, two directions: receivables (customers) and payables (vendors), with running balances and voucher-based settlement - plus a basic P&L so an owner finally knows if a period made money. Customer and vendor records live in their own modules; all the money lives here.
1. Context & Problem
Half the ledger exists: vendor payables already arise automatically when a purchase order is received, vouchers (receipt/payment) have backend and screens, and COGS is posted on every sale. But customer receivables don't exist (a credit B2B sale can't raise a debt), there is no unified partner view, and no P&L - despite revenue, COGS and expenses all being posted to accounts already.
2. Goals & Non-Goals
Goals - receivables raised by charge sales and settled by receipts (URD-LDG-001) · payables verified e2e (002) · one partner-ledger view with balances (003) · P&L per period (004) · voucher settlement (005) · filters (006).
Non-Goals - credit limits/dunning · multi-currency · full accounting statements (only basic P&L).
3. Success Metrics
| Metric | Target |
|---|---|
| Two-way ledger | A credit sale and a received PO both show correct balances |
| P&L | Reconciles to the financial accounts for a pilot month |
4. Personas & Use Cases
Owner (who owes me / whom do I owe / did I profit) · Cashier (records a credit sale, takes later payment).
5. User Stories
- As an owner, I sell to a company on credit and see their debt until the receipt clears it.
- As an owner, I open P&L for May and see revenue − COGS − expenses.
6. Functional Requirements
Delivers URD LDG URD-LDG-001…006 (Musts 001-004). Depends on customer records (PRD-BIZ-001) for the receivable side.
7. Non-Functional Requirements
- Balances must always reconcile to vouchers/accounts (no parallel bookkeeping).
8. UX & Flows
- Partner ledger: list by partner (type filter) → balance → drill to vouchers.
- Credit sale: checkout marks "charge" → receivable opens → receipt voucher settles.
- P&L: pick a period → revenue, COGS, expenses, profit.
9. Data & Domain
- Receivable mirrors the existing payable pattern (party on voucher) with customer as party; P&L derives from posted accounts (revenue, COGS - already posted - and expense categories).
10. Dependencies & Assumptions
| Dependency | Why |
|---|---|
| Business customers (PRD-BIZ-001, Jul) | The debtor identity |
| COGS/inventory postings (exists) | P&L's cost side |
| Shift reconcile (E4) | Cash movements feeding accounts |
11. Risks & Open Questions
- P&L expense coverage: which categories count in v1? (proposal: all expense-type vouchers).
- Opening balances for existing debts - manual entry voucher in v1.
12. Release Plan & Launch Criteria
Jul: receivables. Aug: partner view + P&L. Launch: AC-LDG-01 passes on a pilot merchant month.
13. FAQ
- Is this accounting software? No - it's the merchant-facing debt + profit view on top of the posting engine.
References
URD LDG · Phase 2 - By Month · Epic BANA-1324