Screens / Dashboard
Dashboard
KPIs for the selected period and the prior one, the daily sales chart, the Low stock card, recent expenses, plan and seats, and an item sales ranking with the presets Most items sold, Most sales, Most refunds, Most net sales, Most cost of sales and Most gross profit; the net-sales and cost-of-sales presets show only with `costs.view`, and the app never asks for them without it. The Low stock card shows stock below zero as the real number in red (PAN-62). Back on the tab (PAN-59) the figures refresh quietly. Money follows the business currency (PAN-90). On a 390 phone the KPI values shrink to fit one line (down to 20sp) and the subtitle wraps to two lines (PAN-145).
- App routes
/dashboard- Access
- reports.sales, reports.cashflow
- Screen code
lib/screens/dashboard/dashboard_page.dartlib/screens/dashboard/dashboard_controller.dartlib/screens/dashboard/widgets/cards/low_stock_card.dartlib/screens/dashboard/widgets/item_sales_rank.dartlib/screens/dashboard/widgets/recent_expense.dartlib/screens/dashboard/widgets/kpi_value.dart- Source
- elmermj/panly-app @ pre-staging-test (72aaffd)
API calls (6)
| Call | Why the screen makes it | Where in the app code |
|---|---|---|
GET /v1/reports/cashflowCashflow report (backed by the daily_financials summary) |
Period KPIs, prior period, chart (group_by=day) and the low_stock list for the Low stock card | lib/screens/dashboard/dashboard_controller.dart:114lib/screens/dashboard/dashboard_controller.dart:151lib/screens/dashboard/dashboard_controller.dart:166lib/data/repositories/report_repository.dart:16 |
GET /v1/expensesList expenses |
Recent expenses (limit=4) | lib/screens/dashboard/dashboard_controller.dart:174lib/data/repositories/dashboard_repository.dart:12 |
GET /v1/expense-categoriesList expense categories |
Category names for the recent expenses | lib/data/repositories/dashboard_repository.dart:26 |
GET /v1/meGet the signed-in account, its role here and the current merchant |
Plan and storage for the plan card | lib/screens/dashboard/dashboard_controller.dart:181lib/data/repositories/dashboard_repository.dart:42 |
GET /v1/membersList members (memberships) of my merchant |
Staff seats (limit=100, all pages) | lib/screens/dashboard/dashboard_controller.dart:196lib/data/repositories/dashboard_repository.dart:51 |
GET /v1/reports/salesRanked sales by menu item |
Item sales ranking: `type` is the chosen preset (most_items_sold, most_sales, most_refunds, most_net_sales, most_cost_of_sales, most_gross_profit), from/to the period, limit and cursor for "load more" The server answers 403 permission_denied to the net-sales and cost-of-sales types without `costs.view`; the app hides those presets and never sends them for such a role. |
lib/screens/dashboard/dashboard_controller.dart:227lib/domain/usecases/dashboard/dashboard_usecase.dart:34lib/data/repositories/dashboard_repository.dart:64 |
Each call links to its operation in the API reference. Code locations are file:line in panly-app at 72aaffd, listed from the screen down to the line that sends the request.