Skip to content

Reports & Metrics

Backend domains:

RBAC Path: REPORTS.

Reports

reports/ ships a wide catalogue of operational and financial reports, each as a dedicated GraphQL query. They share a common pattern: parameters (date range, currency, filters) in, a typed response out, an optional PDF/CSV export via getReportPresignedUrl (see mcp notes).

Key queries by family:

Sales / receivables

  • invoiceRegisterReport, orderRegisterReport, quoteRegisterReport
  • agedReceivableReport, agedReceivableReportSummary
  • clientStatement, clientStatementPdf
  • paymentMethodReport

Purchases / payables

  • supplierInvoiceRegisterReport, purchaseOrderRegisterReport, supplierQuoteRegisterReport
  • agedPayableReport, agedPayableReportSummary
  • expenseRegisterReport, expenseCategoryReport

Inventory & items

  • itemInvoiceDetailReport, itemSupplierInvoiceDetailReport, itemPurchaseOrderDetailReport
  • itemCategoryPurchaseOrderReport, itemCostReport
  • inventoryInsightsReport
  • getItemPurchasesReport, getItemOrdersReport

Financial statements

  • incomeStatement
  • detailedBalanceSheet
  • detailedTrialBalance
  • cashFlowStatement

Configurable / saved reports

  • reports, reportConfigs, createReportConfig, deleteReportConfig — let users save filter sets and re-run them.

PDF rendering goes through app/graphql/pdf/ and is templated via app/graphql/pdf_templates/.

Metrics

metrics/ powers the landing-page widgets and dashboard KPIs.

Key queries: findLandingPages, findLandingPageKpis, getAmountsReport, getStatusAmountsReport, getTimeSeriesReport, getGroupedTimeSeriesReport, getTopEntitiesReport, getEntityCountsReport, getNetIncomeKpi.

These are designed to be cheap to render (pre-aggregated where possible) and parameterised by entity type + date range, so the same widget can show "Top 5 clients this month" or "Top 5 suppliers YTD".

Home dashboard

app/graphql/home/ composes the per-role landing page from metrics/ queries. A PYME owner, accountant, salesperson, and warehouse manager each see a different default set of widgets — these defaults live in code today and are good candidates for a "dashboard builder" UI.

What's missing / candidates

  • Saved schedule + email delivery on any report (e.g. "send me the aged receivable every Monday").
  • Drill-down from a KPI tile straight into the underlying transactions.
  • Excel export with pivot-friendly formatting (CSV exists).
  • Comparison vs. budget on the income statement (data is there; report is not).
  • Per-project / per-cost-centre P&L (data captured, report not surfaced).