| ← All Docs Page Specifications

Page Specifications

Verified Against source code 15 major pages documented Last updated: September 2026

1. Dashboard

PropertyValue
Route/dashboard
AccessAuthenticated dealer or staff with dashboard: "visible"
Feature gateNone

KPI StatCards (5)

Displayed in a horizontal row at the top. Each card shows a primary metric value, label, and comparison to the previous period.

  1. Today's Sales — total billing amount for today
  2. Today's Collections — total payments received today
  3. Total Outstanding — sum of all farmer dues
  4. Bills Today — count of bills created today
  5. Active Farmers — farmers with at least one bill in the last 90 days

Toggleable Widgets (10)

Each widget can be shown/hidden via a gear icon. State persisted in dealer preferences.

  1. Sales Trend — line chart of daily sales for last 30 days (Recharts)
  2. Top Products — bar chart of top-selling products by quantity
  3. Overdue Farmers — list of farmers with overdue payments, sorted by amount
  4. Recent Bills — last 5 bills with farmer name, amount, status
  5. Low Stock — products below reorder point
  6. Expiring Stock — lots expiring within 30 days
  7. Payment Methods — pie chart breakdown (cash/UPI/bank/cheque)
  8. Branch Comparison — sales comparison across branches (if multi-branch)
  9. Monthly Summary — month-to-date sales, collections, purchases
  10. Quick Actions — shortcut buttons for common actions

Layout

2. New Bill

PropertyValue
Route/billing
AccessAuthenticated dealer or staff with newBill: "visible"
Feature gateNone
Key componentProductSelector (1,519 lines)

Mobile Layout (3 Steps)

1
FarmerSelector — Search/select farmer. QuickAddFarmerModal for inline creation.
2
ProductSelector — Full-screen product grid. Search, category filter. Tap product to add. Quantity/rate inline editing. Running total shown.
3
PaymentStep + ReviewStep — Payment amount, method. Bill summary. Signature canvas. Save button.

Desktop Layout (2 Panels)

Draft Tabs

Up to 5 concurrent drafts stored in sessionStorage. Tab bar at top of billing page. Each draft preserves: selected farmer, added products with quantities, and payment info. Allows switching between partial bills when interrupted.

Keyboard Shortcuts

ShortcutAction
/Focus product search
EscClose modal / clear search
EnterConfirm quantity / advance step
TabMove between quantity fields

Empty State

If no products are configured yet, shows a prompt to "Add your first product" with a link to inventory setup.

3. Farmer Ledger

PropertyValue
Route/farmers/:id/ledger
AccessAuthenticated dealer or staff with farmerList: "visible"
Data sourcePaginated RPC with infinite scroll

Tabs

Actions

Layout

4. Farmer List

PropertyValue
Route/farmers
AccessAuthenticated dealer or staff with farmerList: "visible"

Searchable, filterable list of all farmers. Search by name or phone number. Filter by: outstanding balance range, last bill date, active/inactive status. Sort by: name, outstanding amount, last activity. Pagination: server-side with page size of 20.

Empty state: "No farmers yet. Add your first farmer to get started" with an "Add Farmer" button.

5. Inventory

PropertyValue
Route/inventory
AccessAuthenticated dealer or staff with inventory: "visible"

Product list with current stock levels. Each row shows: product name, category, current stock quantity, unit, latest rate, total stock value. Search by product name. Filter by category, stock status (in stock, low stock, out of stock). Color-coded stock indicators: green (adequate), yellow (low), red (out of stock).

6. Inventory Detail

PropertyValue
Route/inventory/:id
AccessAuthenticated dealer or staff with inventory: "visible"
Component size1,444 lines

Sections

Actions

7. Reports

PropertyValue
Route/reports and /reports/:section
AccessAuthenticated dealer or staff with reports: "visible"

Date Presets

All reports support: Today, Yesterday, This Week, This Month, Last Month, This Quarter, This Year, Custom Range.

Report Sections

Export Formats

PDF (via jsPDF) and Excel-compatible CSV. Reports open in a printable view for direct browser printing.

8. Daily Book

PropertyValue
Route/daily-book and /daily-book/:section
AccessAuthenticated dealer
StyleRegister-style daily view

Sub-pages (11)

  1. Summary — Day overview with totals for all categories
  2. Bills — All bills created on the selected date
  3. Payments — All payments received
  4. Purchases — All stock purchases
  5. Supplier Payments — Payments made to suppliers
  6. Returns — All returns processed
  7. Expenses — All expenses recorded
  8. Cash Entries — Manual cash book entries
  9. Stock Transfers — Inter-branch transfers
  10. Adjustments — Stock and rate adjustments
  11. Cancellations — Cancelled bills

Key Behaviors

9. Settings

PropertyValue
Route/settings and /settings/:section
AccessAuthenticated dealer

Settings Sections

10. Dues

PropertyValue
Route/dues
AccessAuthenticated dealer

Ageing Buckets

Farmers grouped by how long their dues have been outstanding:

Key Behaviors

11. Cashbook

PropertyValue
Route/cashbook
AccessAuthenticated dealer or staff with cashbook: "visible"
Feature gatecashbook

Daily cash register view. Shows opening balance, all cash movements (sales, payments received, purchases, expenses, manual entries), and closing balance. Date navigation with prefetching. Manual entry option for corrections. Linked to all bill and payment transactions via cash_book table.

12. Expenses

PropertyValue
Route/expenses
AccessAuthenticated dealer or staff with expenses: "visible"
Feature gateexpenses

Expense tracking with categories (rent, transport, salary, utilities, misc). Each expense: date, amount, category, description, payment method. List view with date filters and category filters. Monthly summary chart. Totals by category. Creates entries in cash_book when payment method is cash.

13. Suppliers

PropertyValue
Routes/suppliers, /suppliers/:id, /suppliers/:id/ledger
AccessAuthenticated dealer or staff with suppliers: "visible"

Supplier List

All suppliers with name, phone, outstanding balance. Search and sort.

Supplier Detail / Ledger

Similar to Farmer Ledger but for supplier transactions: purchases, payments made. Running balance. Actions: Record Purchase, Make Payment, View Statement.

14. Bill History

PropertyValue
Route/bill-history
AccessAuthenticated dealer or staff with billHistory: "visible"

Searchable list of all bills. Search by bill number, farmer name. Filter by: date range, status (active, cancelled, edited), payment status (paid, partial, unpaid), branch. Sort by date, amount, farmer name. Pagination with server-side cursor. Each row: bill number, date, farmer, amount, paid, status badges.

15. Bill Detail

PropertyValue
Route/billing/:id
AccessAuthenticated dealer or staff with billHistory: "visible"

Display

Renders the bill using the configured invoice template (TemplateOne through TemplateFive). Shows: bill number, date, farmer details, line items with quantities/rates/amounts, subtotal, discounts, GST breakdown (if applicable), total, payment received, balance due, signature (if captured).

Actions