0029 — Accounts Portal and Support Portal improvements (Oct 2026)¶
Status: accepted for implementation (2026-10-31). Records what was built for the owner's Accounts Portal and Support Portal requirement lists, what was deliberately not invented, and the decisions still open.
What was built, and where it reuses existing code¶
| Area | Built | Reuses |
|---|---|---|
| Support: customer location | City + state on the ticket's customer card, from the customer's latest order's delivery address. No street, PIN code, landmark or phone leaves the server. No language is guessed. | GetAdminTicketDetail (existing admin-gated endpoint) |
| Dashboard | Purchase-bill check counts + duplicate groups (server counts), a truthful "Not checked" balances card, a date-filtered daily work report (orders, bills, supplier payments, invoices, recorded actions) as on-screen summary + PDF + Excel | task engine, services, export helpers |
| Purchase bills | Verify / reject / reopen with reviewer, time, reason and an append-only history (migration 120); duplicate warning (exact / likely / possible); per-user auto-saved draft | existing status column, DUPLICATE_BILL unique guard, existing draft idea |
| Suppliers | One-request overview (pending, last payment, due / overdue), complete chronological statement with opening/closing balance, pending filter, PDF/Excel, overdue reminders on Today's Work | supplier_payments + allocations, task engine |
| Problems to Fix | Numbered steps per problem, last-checked time + "Check again", routes to the exact simple-workspace record, honest message when no record is named | existing detectors and cards |
| Invoices | PDF/Excel of sales invoices and, separately, of supplier purchase bills (date and time, tax split, status, filters, totals) | existing missing-invoice queue (already honours owner exclusions and compliance holds) |
| All Orders | Date and time, every product with quantity, total quantity, full-set totals, PDF/Excel daily work report | OrderRow now carries itemLines/totalQuantity from one LATERAL aggregate |
| Activity History | Reads GET /activity (every accounting role) instead of the admin/auditor/owner-only /audit-logs, which returned 403 to everyone else |
existing audit table |
All PDFs come from one dependency-free writer (src/lib/export/pdf.ts): A4 landscape, header row on every page, wrapped cells (nothing truncated), totals row, page numbers and generated timestamp. It writes the rupee sign as "Rs." because the standard PDF fonts have no ₹; the Excel export keeps the original characters.
Decisions and non-decisions¶
- Cash and bank balances are not shown. The portal has no cash or bank account ledger (the double-entry engine is off), so there is no opening balance, closing balance or independent figure to mismatch against. The dashboard says "Not checked"; it never says "Matched". Enabling this needs an owner/CA decision on the chart of accounts and bank accounts and the journal engine, not UI work.
- Pending = stored status
recorded. A new bill is Pending; there is no maker-checker. A bill with money paid against it cannot be rejected (void it). Review never changes amounts, stock or the journal. A rejected bill is excluded from what is owed to the supplier. If the journal engine is later enabled, a rejected bill that had already posted a payable must be reversed by the CA's procedure; rejection alone does not do it. - Due dates exist only when the supplier's payment terms say "Net N" or "Advance". Otherwise a bill is "pending, no due date" and is never called overdue.
- Reminders are the existing Today's Work tasks, derived from supplier positions each time — not a new notification channel. They cannot repeat, stop when paid, and move no money.
- Draft storage stays local to the browser, keyed by the signed-in person, 30-day expiry, payment reference never stored. A server-side draft would consume purchase numbers and post into the books' sequences.
- Missing-invoice alerts already existed and already exclude the owner's protected orders and compliance holds; no invoice is created automatically and no issuance flag changed.
- Customer sales invoices stay internal. Nothing here adds invoice viewing to the customer app.
- Activity history cannot show events that were never recorded; nothing is back-filled.
Rollback¶
rollback_120.sql (refuses while any bill is rejected; export purchase_bill_reviews first). The other changes are additive reads or UI.