Dashboard & Reports Partial
Where you land after signing in. The KPI dashboard is now live — an operations stats row, an order-pipeline chart, a daily health-check table, and three finance/sales report widgets (recovery rate, sales trend, sales by category) scoped by a from/to date filter — all backed by live data. A standalone Reports screen (recovery rate, sales by category, by salesperson, by zone, and trend, over any date range) is also built, and every report can now be exported as an Excel spreadsheet or PDF, from the console or the API.
What you see today
On a successful sign-in you land on the Dashboard. It now opens with three AIR-specific widgets, stacked above the stock Filament account widget and version panel:
- Operations Overview — a row of four stat cards.
- Order Pipeline — a bar chart of open sale orders by state.
- Daily Health Check — a table of the latest scheduled health-check results.
All three are gated on the same permission and read data scoped to what you're allowed to see — see below.
Operations Overview
Four stat cards, computed by DashboardService::kpisFor() and — like every count on this page — geography-scoped: they only count sale orders visible to your assigned regions, the same scoping used throughout the console.
| Card | Shows |
|---|---|
| In HO review queue | Count of sale orders currently in SubmittedToHo — orders waiting for Head Office approval. |
| Awaiting payment | Count of sale orders in Payment Pending, Credit Pending or Discount Pending combined. |
| Waves scheduled | Count of picking waves currently active — any wave in Draft, Items Identified, Label Printing, Packing or At Branch. This one is not geography-scoped. |
| Recovery outstanding | A ₹ total: for every Dishonoured payment voucher, its amount minus whatever has already been recovered against it (via bounced-payment recovery records), summed across all such vouchers. Never goes below ₹0 per voucher. |
Order Pipeline
A bar chart, computed by DashboardService::pipelineFor(), showing the count of open sale orders in each of the nine operational states — from Draft through to In Despatch — as one bar per state, in state order. Like the stat cards, the underlying counts are geography-scoped to what you can see. Completed and cancelled orders aren't part of this chart; it's a snapshot of what's still moving through the pipeline right now.
Daily Health Check
A small table showing the results recorded by the most recent run of the air:health-check scheduled job — one row per check. Columns: the check's label, an OK tick/cross icon, an Issues count, a truncated result summary (hover for the full text as a tooltip), and when it was checked. The table isn't paginated — it always shows the full set of results from that one run.
Date filter Built
At the top of the Dashboard is a from/to date filter. Pick a from and to date (leave either blank for all-time) and the three report widgets below — Recovery rate, Sales trend and Sales by category — re-compute for that period. The operational widgets (Operations Overview, Order Pipeline, Daily Health Check) are current-state snapshots and are not affected by the date filter.
Recovery rate
A three-stat row summarising the recovery-rate report: the overall recovery % of dishonoured (bounced) payments, the total dishonoured value (with a voucher count), and the total recovered value (with how many were fully recovered). A head-office finance snapshot across all payments. Respects the date filter above.
Sales trend
A line chart of net sales by calendar month (the sales-trends report) — the shape of sales over time, oldest month first, scoped to the orders you're allowed to see.
Sales by category
A doughnut chart of net sales split by product category (the sales-by-category report), so you can see at a glance which parts of the catalogue are selling.
The widget only ever shows the latest health-check run. There is still no console screen to browse older scheduler runs or their dropped-record logs — see the Diagnostics note on Background Schedulers.
Reports Built
The Reports screen in the navigation gives all five reports on one page, gated by the report.view permission. At the top is a date filter — pick a from and to date (leave blank for all-time) and every section below updates. The sections are: a Recovery rate summary (rate %, dishonoured and recovered totals), Sales by category, Sales by salesperson, Sales by zone, and Sales trend (net sales by month), each as a table. The sales figures respect your geographic scope (you see totals for the orders you're allowed to); recovery rate is a head-office figure across all payments. Three of these — recovery rate, sales trend and sales by category — are also shown as the live Dashboard widgets described above. Every report is available over the API too (for the mobile app / external clients).
| Report | What it shows | Endpoint | Status |
|---|---|---|---|
| Sales by category | Net sales totalled per product category. | /api/v1/reports/sales-by-category | Built |
| Sales by salesperson | Net sales totalled per Sales Executive. | /api/v1/reports/sales-by-salesperson | Built |
| Sales by zone | Net sales totalled per geographic zone, rolled up from each order's shipping address → region → zone. Orders with no shipping address, or whose address's region isn't assigned to a zone, are grouped into an "Unzoned" bucket rather than dropped. | /api/v1/reports/sales-by-zone | Built |
| Recovery rate | Of the payments that bounced (dishonoured) in a period, how much value has been recovered — count, dishonoured total, recovered total, outstanding, recovery %, and how many were fully recovered. | /api/v1/reports/recovery-rate | Built |
| Sales trends | Net sales totalled by calendar month, oldest first — the shape of sales over time. | /api/v1/reports/sales-trends | Built |
All five accept optional from and to date filters and require report.view. The sales reports respect your geographic scope (you only see orders you're allowed to); recovery-rate is a head-office finance figure across all payments. GET /api/v1/reports/sales-by-zone returns a data array of {zone_id, zone_name, total_net, order_count} rows, ordered by net sales descending — zone_id is null and zone_name is "Unzoned" for orders that don't resolve to a zone.
Exporting reports Built
Every report can also be downloaded as a file — an Excel spreadsheet (.xlsx) or a PDF — either from the Reports screen or over the API.
From the console
The Reports screen has two header buttons, next to the date filter: Export Excel and Export PDF. Both download the full five-report pack — Recovery rate, Sales by category, Sales by salesperson, Sales by zone and Sales trend, one section per report — for whatever from/to range is currently set on the screen (leave both blank for all-time), and the sales figures in it respect your geographic scope, same as the on-screen tables.
From the API
Each report can also be downloaded individually — useful for the mobile app or other external clients that only need one report at a time:
| Endpoint | Notes |
|---|---|
GET /api/v1/reports/{report}/export?format=xlsx|pdf&from=&to= | Downloads one report as a file. |
{report} is one of sales-by-category, sales-by-salesperson, sales-by-zone, sales-trends or recovery-rate — the same keys as the report endpoints in the table above. format is required and must be xlsx or pdf; from and to are the same optional date filters as the on-screen reports. Requires report.view, and the sales reports respect your geographic scope the same as their non-export counterparts. The response is the file itself — an .xlsx spreadsheet or a .pdf — named after the report and the date range requested, not a JSON body.
Where to find more detail today
The Dashboard's KPI cards and chart give you the headline numbers, but for the underlying records, the individual module lists are still where you drill in — each with its own state filter. For example, filter Sale Orders by Submitted to Ho to see exactly what's waiting for approval, or filter Payment Vouchers by On Hold to see what needs attention, or check Bank Reconciliation for unmatched statement lines.