Page Specifications
Verified Against source code
15 major pages documented
Last updated: September 2026
1. Dashboard
| Property | Value |
| Route | /dashboard |
| Access | Authenticated dealer or staff with dashboard: "visible" |
| Feature gate | None |
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.
- Today's Sales — total billing amount for today
- Today's Collections — total payments received today
- Total Outstanding — sum of all farmer dues
- Bills Today — count of bills created today
- 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.
- Sales Trend — line chart of daily sales for last 30 days (Recharts)
- Top Products — bar chart of top-selling products by quantity
- Overdue Farmers — list of farmers with overdue payments, sorted by amount
- Recent Bills — last 5 bills with farmer name, amount, status
- Low Stock — products below reorder point
- Expiring Stock — lots expiring within 30 days
- Payment Methods — pie chart breakdown (cash/UPI/bank/cheque)
- Branch Comparison — sales comparison across branches (if multi-branch)
- Monthly Summary — month-to-date sales, collections, purchases
- Quick Actions — shortcut buttons for common actions
Layout
- Desktop: KPI cards in a single row. Widgets in a 2-column grid below.
- Mobile: KPI cards as a horizontal scroll. Widgets stack vertically.
2. New Bill
| Property | Value |
| Route | /billing |
| Access | Authenticated dealer or staff with newBill: "visible" |
| Feature gate | None |
| Key component | ProductSelector (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)
- Left panel: FarmerSelector at top, ProductSelector below. Sidebar collapses to 76px to give maximum space.
- Right panel: Running bill summary, payment inputs, review. Always visible alongside product selection.
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
| Shortcut | Action |
/ | Focus product search |
Esc | Close modal / clear search |
Enter | Confirm quantity / advance step |
Tab | Move 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
| Property | Value |
| Route | /farmers/:id/ledger |
| Access | Authenticated dealer or staff with farmerList: "visible" |
| Data source | Paginated RPC with infinite scroll |
Tabs
- Ledger — Chronological list of all transactions (bills, payments, returns, adjustments). Infinite scroll with paginated RPC. Each entry shows date, type, amount, running balance.
- Items — Products purchased by this farmer with quantities and totals.
- Discounts — Per-product discount rates configured for this farmer.
Actions
- Collect Payment (opens payment flow with farmer pre-selected)
- Create Bill (opens billing with farmer pre-selected)
- Share Statement (WhatsApp or PDF)
- View Statement (formatted printable view)
- Edit Farmer (profile details)
Layout
- Desktop: Farmer summary card at top (name, phone, outstanding, credit limit). Tabs below with full-width table.
- Mobile: Farmer summary as compact header. Tabs as swipeable. Ledger entries as cards instead of table rows.
4. Farmer List
| Property | Value |
| Route | /farmers |
| Access | Authenticated 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
| Property | Value |
| Route | /inventory |
| Access | Authenticated 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
| Property | Value |
| Route | /inventory/:id |
| Access | Authenticated dealer or staff with inventory: "visible" |
| Component size | 1,444 lines |
Sections
- Product Summary: Name, category, current stock, average cost, latest selling rate, MRP
- Active Lots: Table of FIFO lots — purchase date, quantity remaining, cost per unit, expiry date, supplier. Sorted oldest first.
- Movement History: All stock movements for this product — purchases, sales, returns, transfers, adjustments. Filterable by type and date range.
- Rate Adjustment: Change selling rate per lot with reason tracking. Creates audit entry in movements.
Actions
- Record Purchase (opens purchase form pre-filled with this product)
- Adjust Rate (change selling rate with reason)
- Stock Adjustment (manual correction with reason)
- View by Branch (if multi-branch, toggle stock view per branch)
7. Reports
| Property | Value |
| Route | /reports and /reports/:section |
| Access | Authenticated 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
- Sales Register — Every bill with line items, grouped by date
- Profit Report — Revenue minus cost of goods sold, per product
- Stock Report — Current stock levels, valuation, expiring items
- Dues Report — Farmer-wise outstanding with ageing
- Collection Report — Payments received, grouped by method
- Purchase Report — Supplier-wise purchases
- GST Report — Tax breakdown for filing
Export Formats
PDF (via jsPDF) and Excel-compatible CSV. Reports open in a printable view for direct browser printing.
8. Daily Book
| Property | Value |
| Route | /daily-book and /daily-book/:section |
| Access | Authenticated dealer |
| Style | Register-style daily view |
Sub-pages (11)
- Summary — Day overview with totals for all categories
- Bills — All bills created on the selected date
- Payments — All payments received
- Purchases — All stock purchases
- Supplier Payments — Payments made to suppliers
- Returns — All returns processed
- Expenses — All expenses recorded
- Cash Entries — Manual cash book entries
- Stock Transfers — Inter-branch transfers
- Adjustments — Stock and rate adjustments
- Cancellations — Cancelled bills
Key Behaviors
- Date navigation: Left/right arrows to move between days. Date picker for jumping to specific date.
- Prefetching: Adjacent days (yesterday and tomorrow) are prefetched for instant navigation.
- Empty state: "No activity on this date" with option to navigate to nearest active date.
9. Settings
| Property | Value |
| Route | /settings and /settings/:section |
| Access | Authenticated dealer |
Settings Sections
- Shop Profile — Shop name, address, phone, logo, GSTIN, PAN
- Lock Screen — Auto-lock timeout, PIN configuration
- Billing Templates — Choose from 5 invoice designs (TemplateOne through TemplateFive). Configure which columns to show: HSN code, rate, discount, GST breakdown, MRP, expiry date, signature area. Branch-specific template selection.
- Feature Badges — Visual indicators for enabled features on the plan
- WhatsApp — Configure authkey.io API key, manage templates, view message quota
- Branches — Add/edit branches (if multi-branch enabled)
- Staff — Manage staff members (if staff access enabled)
- Subscription — View current plan, upgrade, manage billing
10. Dues
| Property | Value |
| Route | /dues |
| Access | Authenticated dealer |
Ageing Buckets
Farmers grouped by how long their dues have been outstanding:
- 0–30 days — Current dues (normal)
- 31–60 days — Overdue (yellow)
- 61–90 days — Significantly overdue (orange)
- 90+ days — Critical (red)
Key Behaviors
- Virtualized list: Uses windowed rendering for performance with 500+ farmers
- Click farmer to open ledger
- "Collect Payment" action per farmer row
- "Send Reminder" via WhatsApp per farmer
- Sort by: amount, name, age of oldest due
- Summary card at top: total outstanding, number of farmers with dues
11. Cashbook
| Property | Value |
| Route | /cashbook |
| Access | Authenticated dealer or staff with cashbook: "visible" |
| Feature gate | cashbook |
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
| Property | Value |
| Route | /expenses |
| Access | Authenticated dealer or staff with expenses: "visible" |
| Feature gate | expenses |
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
| Property | Value |
| Routes | /suppliers, /suppliers/:id, /suppliers/:id/ledger |
| Access | Authenticated 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
| Property | Value |
| Route | /bill-history |
| Access | Authenticated 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
| Property | Value |
| Route | /billing/:id |
| Access | Authenticated 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
- Edit — Opens
/billing/:id/edit. Requires billEditing feature gate.
- Cancel — Same-day only, unpaid only. Confirmation dialog. Calls
cancel_bill_v1 RPC.
- Return — Opens
/billing/:id/return. Requires returns feature gate.
- Share via WhatsApp — Sends bill notification via authkey.io or opens wa.me link.
- Download PDF — Renders bill to PDF via html2canvas (DOM → canvas → PNG → PDF).
- Print — Opens browser print dialog with the invoice template.
- Collect Payment — If balance due > 0, opens payment flow pre-filled with this bill's farmer and remaining amount.