Skip to content

0032 — Accounts Portal record lists open on All Time (Nov 2026)

Status: accepted (2026-11-03). Portal-only change; no backend, migration or API change.

Problem

The portal has ONE global date range (DateRangeProvider), initialised to This Month. Every record list inherited it, so on 1 November the October orders, invoices and payments were not on screen. The backend was never the limit: when from/to are sent it honours any width (only a missing pair falls back to the current financial year, and the portal always sends both).

Decision

  1. New preset All Time = explicit bounds, 2000-01-01 (IST) to the end of today (IST). Because the bounds are explicit it goes through the same requests, IST-day maths and mock filters as every other range. The provider re-resolves it when the clock rolls over so a tab left open overnight still includes today.
  2. Each route has a date scope (lib/date-scope.ts):
  3. list — a historical record list: opens on All Time. The picker offers All Time there.
  4. period — a report/KPI whose meaning is a period: keeps This Month and never offers All Time. Anything not listed is period, so a new page is never silently switched.
  5. keep — a record's detail page: leaves the selected range alone.
  6. A range the user chose explicitly (This Month, Last Month, custom, even All Time) is never overwritten by navigation between lists. All Time is dropped when moving to a period page (it would sum across financial years); the list default returns afterwards.
  7. Reset (the shared FilterBar Reset and the picker's "Reset to All Time") clears filters and returns the range to the page default.
  8. Reports that live on a list page (Invoices → Reports) use usePeriodRange(): All Time becomes This Financial Year and the page says so, so nothing statutory is totalled across years by accident.
  9. Simple view: Orders and Invoices open on All Time (new SIMPLE_LIST_PRESETS); tax pages keep SIMPLE_TAX_PRESETS.

Module inventory

Route Scope Notes
/orders, /simple/orders list → All Time Simple Orders previously opened on Today.
/sales-register list → All Time
/invoices, /simple/invoices list → All Time Reports tab = period (this FY when All Time). Issuance flags untouched.
/payments, /settlements list → All Time
/purchases, /suppliers, /expenses list → All Time
/customers list → All Time "customers who ordered in ".
/credit-debit-notes, /returns-refunds list → All Time
/documents, /audit-logs, /report-history, /filing-history list → All Time
/reconciliation list → All Time Exception queue records; amounts are not statutory totals.
/dashboard, /live-sales period KPIs for a period.
/gst, /tds, /auditor-reports, /simple/gst, auditor/download pages period Return / filing / audit periods.
/deliveries period Placeholder; no data.
/warehouse, /simple/warehouse not date-scoped An operational queue with its own status eligibility and an explicit Order history tab.
record detail pages keep

Performance and limits

Server-side paging is unchanged: the adapter pages through the result 200 rows at a time (apiGetAllRows) and refuses with an error rather than truncating if more than 20,000 rows match, so a total or export is never silently partial. Most list screens still hold their filtered set in the browser and page it on screen; for the current data volume that is small. If a list grows past that, the next step is true server-paged tables per endpoint, not a date cap.

Not changed

Business rules, statuses, amounts, permissions, tenant boundaries, exports (file name for an All Time export is …_ALL_TIME_UPTO_<date>), the warehouse queue and label, invoice issuance flags, GST/TDS period logic.