From 2bd97ec81262397dd18901f96f014db2b6f63d3c Mon Sep 17 00:00:00 2001 From: delchev Date: Thu, 2 Jul 2026 20:37:57 +0300 Subject: [PATCH] MonthlyRevenue report - income, net and VAT per month Uses the month(date) bucket dimension (sortable YYYYMM integer) with count/sum(net)/sum(vat)/sum(total) measures. Co-Authored-By: Claude Fable 5 --- README.md | 3 ++- sales-invoices/sales-invoices.intent | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ba413b..c939ee5 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ customer -> see only their payments -> amount pre-filled). ## Reports -Four management reports over the invoice data ([`sales-invoices.intent`](sales-invoices/sales-invoices.intent) +Five management reports over the invoice data ([`sales-invoices.intent`](sales-invoices/sales-invoices.intent) `reports:`), rendered by the generated Harmonia report pages (sidebar **Reports** + dashboard tiles): | Report | Shows | @@ -73,6 +73,7 @@ Four management reports over the invoice data ([`sales-invoices.intent`](sales-i | `InvoicesByStatus` | pipeline overview - count and value per status | | `OverdueInvoices` | unpaid invoices past their due date (listing with a compound filter) | | `SalesByProduct` | quantity sold and revenue per product | +| `MonthlyRevenue` | income, net and VAT aggregated per month (`month(date)` bucket) | `Customer` and `Product` are **cross-model dimensions**: the report joins the owning model's table and shows the name instead of the raw FK id. Every report table offers **typed per-column filters** diff --git a/sales-invoices/sales-invoices.intent b/sales-invoices/sales-invoices.intent index 2513efc..730cc19 100644 --- a/sales-invoices/sales-invoices.intent +++ b/sales-invoices/sales-invoices.intent @@ -176,6 +176,13 @@ reports: description: Quantity sold and revenue per product dimensions: [Product] measures: ["sum(quantity)", "count(*)", "sum(total)"] + # month(date) buckets the invoice date into a sortable YYYYMM integer (e.g. 202607) - income, + # net and VAT aggregated per month. + - name: MonthlyRevenue + source: SalesInvoice + description: Income, net and VAT per month + dimensions: ["month(date)"] + measures: ["count(*)", "sum(net)", "sum(vat)", "sum(total)"] forms: - { name: ApproveSalesInvoice, forEntity: SalesInvoice, fields: [number, date, due, Customer, total, Status], actions: [approve, reject] }