Skip to content

Daily Sales Report

How the per-day sales report counts gross, net, tax, collected, payment modes, refunds and voids, and how the Today view shares the same sales rule.

11 min read

Overview

The Daily Sales Report shows one row per calendar day (India time, IST) built from paid invoices, with a per-payment-mode breakdown, refunds, and voided bills. It is a report on billed and received money, not on appointments.

Kagami daily sales report DSR with gross revenue, payment method breakdowns, and tax totals

Every figure is computed on demand from the invoices, payment_splits and invoice_refunds tables. There is no nightly aggregate for this report. Amounts are stored in minor units (paise) and shown in rupees.

Where to find it: More → Money → Daily Sales Report, Business & Growth → Daily Sales, or the "Daily Report" card on the dashboard home. The page is /dashboard/analytics/reports/daily.

Day boundaries

  • A "day" is an IST calendar day (UTC+05:30). The code always uses a fixed +05:30 offset, so day edges do not depend on the server clock.
  • The date range you pick (From / To, both inclusive) is turned into From 00:00:00.000 IST through To 23:59:59.999 IST.
  • An invoice belongs to the day of its paid_at timestamp. A refund belongs to the day of its refunded_at. A void belongs to the day of its voided_at.
  • Default range: the last 30 days, ending today (IST). Presets: Today, Yesterday, This week (Monday start), Last week, This month, Last month.
  • A day with no activity has no row. A day with only a refund or only a void still gets a row.
  • Rows are sorted newest first.

What counts as a sale

Only invoices with status = 'paid' and a paid_at inside the range are counted. Voided bills never enter the paid figures. Invoices are scoped to the caller's brands and, when a store filter applies, to location_id IN (...).

Column definitions

All sums run over the paid invoices of that day.

Column Definition
Inv Number of paid invoices (zero-amount invoices count)
Gross Σ subtotal_minor (line items before discount and tax)
Discounts Σ discount_minor
Net Gross − Discounts (the post-discount amount; whether it contains tax depends on the pricing mode, see below)
Tax Σ tax_minor (the GST amount on the bill)
Total Σ total_minor (the final billed amount as stored on the invoice, after round-off)
Refunds Σ refunds given on that day (see below)
Collected Total − Refunds
Cash / UPI / Card / Wallet / Other Money received per payment mode, before refunds
Adjustments Total − Σ modes
Voided Count and value of bills voided on that day

How Net, Tax and Total relate

The relation depends on the pricing mode of the brand's default GST rate. Each rate has a switch in Accounting → GST (the "incl." / "on top" badge on the rate, or "Add tax on top of price" when creating a rate). Invoices follow the same rule as checkout (see Checkout & POS).

  • Tax-inclusive pricing (the default). The listed price already contains GST. Total is the post-discount amount, and the GST is extracted from it for reporting only. So Net already contains the tax, Net + Tax is not Total, and Total = Net (before round-off).
  • Tax-exclusive pricing ("on top"). GST is added to the post-discount amount. So Total = Net + Tax (before round-off).

In both modes Total is read from the invoice as stored. The payable total is rounded to the nearest whole rupee at checkout, and any later change to the invoice total shows up in Total but not in Net or Tax. The report does not re-check any of these relations.

Payment modes

Money received per mode comes from the invoice's payment_splits rows, one per method, for split-tender bills.

  • If a bill has no split rows and a positive total, the whole total goes to the invoice's own payment_method. A positive no-split bill with no method goes to Other.
  • If a bill has no split rows and a zero or negative total (complimentary, credit note), it adds nothing to any mode.
  • cash, upi, card and wallet map to their own columns. Every other method (loyalty points, package, membership, gift card, cashback, anything else) goes to Other.

The Other and Adjustments columns are hidden on the page unless at least one day in the range is non-zero. The CSV export always includes them.

Refunds

Refunds come from the invoice_refunds table, one row per refund actually given, with its own method and date.

  • A refund is attributed to the day it was given, not the day the invoice was paid. A refund-only day gets its own row with negative Collected.
  • Refunds are split per mode: Cash, UPI, Card, Online / other. The methods online and other (and any unknown value) land in Online / other.
  • Collected for the day is reduced by every refund given that day, in any mode.
  • A refund on a bill that is now void is skipped. A voided bill is not a sale, so its refund is not a negative either.
  • A refund with no store (location_id NULL) cannot be tied to a store, so it only appears in the unrestricted all-stores view.
  • In the per-invoice list, "refunded ₹X" is the invoice's lifetime refunded amount, not a per-day figure.

Voided bills

A voided bill keeps its paid_at (when it was sold) and gets voided_at. The report counts voids on the day they were voided.

  • A bill sold Monday and voided Wednesday is no sale on Monday and one void on Wednesday.
  • A bill sold and voided on the same day is no sale and one void that day.
  • Voids are informational: they appear in the Voided column and the "Voided bills" card as count · amount, and never reduce any other figure.
  • Bills voided before void dates were recorded have no voided_at and cannot be listed.

The adjustment identity

Two identities hold for every row and for the totals:

Σ modes (Cash + UPI + Card + Wallet + Other) + Adjustments = Total
Total − Refunds = Collected

Adjustments is non-zero in two cases:

  • Negative: a credit note was applied to an already-paid invoice. That lowers invoices.total_minor but leaves the split rows unchanged, so modes add up to more than Total.
  • Positive: a bill has split rows that add up to less than its total, or a no-split bill had a zero/negative total.

Adjustments makes the identity exact, so a non-zero value is a signal to look at those bills, not an error in the report.

Worked example

One IST day, amounts in rupees, GST 18%. The same kind of bills are shown under both pricing modes.

Case 1: tax-inclusive pricing (the default). The listed price contains GST, so the post-discount amount is the total.

Invoice Subtotal Discount Total (post-discount) Tax inside it Paid with
A 1,300 120 1,180 180 cash 700 + UPI 480 (split)
B 590 0 590 90 wallet 590
C (older, no split rows) 236 0 236 36 payment_method = card

Later the same day: a refund of 200 in cash and one of 100 in UPI is given, and one bill (₹500) is voided.

Figure Calculation Result
Inv 3 3
Gross 1,300 + 590 + 236 2,126
Discounts 120 120
Net 2,126 − 120 2,006
Tax 180 + 90 + 36 306
Total 1,180 + 590 + 236 2,006
Cash / UPI / Card / Wallet 700 / 480 / 236 / 590 sum 2,006
Adjustments 2,006 − 2,006 0
Refunds 200 + 100 300
Collected 2,006 − 300 1,706
Voided 1 bill, ₹500 1 · 500

Net (2,006) already contains the 306 of tax, so Net + Tax (2,312) is not Total. Total equals Net.

Case 2: tax-exclusive pricing ("on top"). GST is added to the post-discount amount, so Total = Net + Tax.

Invoice Subtotal Discount Tax Total Paid with
A 1,000 100 162 1,062 cash 600 + UPI 462 (split)
B 500 0 90 590 wallet 590
C (older, no split rows) 200 0 36 236 payment_method = card

Same refunds (cash 200, UPI 100) and the same ₹500 void.

Figure Calculation Result
Inv 3 3
Gross 1,000 + 500 + 200 1,700
Discounts 100 100
Net 1,700 − 100 1,600
Tax 162 + 90 + 36 288
Total 1,062 + 590 + 236 (= Net + Tax) 1,888
Cash / UPI / Card / Wallet 600 / 462 / 236 / 590 sum 1,888
Adjustments 1,888 − 1,888 0
Refunds 200 + 100 300
Collected 1,888 − 300 1,588
Voided 1 bill, ₹500 1 · 500

Revenue card and the shared Sales definition

These are two different numbers that are easy to confuse.

Revenue card on the report. Labelled "Revenue (Cash + Card + UPI + Online)". It is Cash + Card + UPI + Wallet received over the range, before refunds. In the tax-inclusive example above: 700 + 236 + 480 + 590 = 2,006.

Shared Sales definition (collectedSalesMinor, SALO-2484). Used by the Today screens so they cannot disagree with each other:

Sales = (Cash + UPI + Card received) − (Cash + UPI + Card refunds paid out)

Wallet, package, gift-card and points redemptions are not new money, so they are excluded. Voided bills never reach the paid figures. Refunds in the Online / other bucket are not subtracted. In the tax-inclusive example above: (700 + 480 + 236) − (200 + 100) = 1,116.

This definition is used by:

Place How
Today playbook sales panel getTodayOverview → collectedSalesMinor
Dashboard home sales figure getScopedDaySalesMinor (only for callers with the dashboard.revenue permission)
Day-close summary buildSummary in salon-day; falls back to the billed total, flagged approximate, if the sales query fails
Owner mobile "today" page getOwnerTodaySnapshot; cash revenue is collectedCashMinor (cash received − cash refunds), clamped to between 0 and total sales

Because of these differences, Today sales will not equal the report's Collected or its Revenue card on days with wallet payments, online refunds, or other tenders.

Filters, scope and permissions

  • Location: "All locations" or one store. A caller restricted to certain stores only ever sees those stores; a requested store they cannot access is replaced by "all permitted" with a notice on the page. A restricted caller with zero stores sees nothing.
  • Null-store invoices: any store filter uses location_id IN (...), which never matches an invoice with no store. Only the unrestricted all-stores view includes them, so its total can be larger than the sum of the per-store totals.
  • Brands: all brands of the caller's organisation are included.
  • Who can open it: manager roles (super_admin, org_owner, brand_manager, location_manager) always can. Any other role can open it only if the owner has enabled this page (/dashboard/analytics/reports/daily) for that role. A role without access is denied with: "Your role does not have access to the Daily Sales Report. Ask the owner to enable it in Settings → Roles and Permissions." The CSV export applies the same check. The page also needs the analytics plan feature, otherwise an upgrade prompt is shown.
  • The navigation entries are shown to manager roles only.

Invoice list

Below the day table the page lists the paid invoices in the range, newest first: invoice number (links to the bill), paid time (IST), client or "Walk-in", items, discount, tax, total (with "refunded" if any), and modes joined with +. The list is capped at 500 invoices. When the range has more, the heading reads "Invoices (500 of N, newest first)". The day table and totals are not capped. Clicking the invoice count on a day opens the Billing page filtered to that date.

Export

The Export CSV button downloads daily-sales-<from>-to-<to>.csv: one line per day plus a Total line, with these exact column headers: Date, Invoices, Gross (₹), Discounts (₹), Net (₹), Tax (₹), Total (₹), Refunds (₹), Refund Cash (₹), Refund UPI (₹), Refund Card (₹), Refund Online/Other (₹), Collected (₹), Cash (₹), UPI (₹), Card (₹), Wallet (₹), Other (₹), Adjustments (₹), Voided, Voided (₹). Voided is the count of voided bills. Amounts are in rupees with two decimals. The export re-checks the caller's role and store scope on the server and validates both dates as YYYY-MM-DD. On failure the real reason is shown under the button.

There is no print view, scheduled email or PDF for this report. Printing the page from the browser is the only option and is not specifically supported.

Source

  • web/src/lib/analytics/daily-sales.ts (aggregation, refunds, voids, invoice list)
  • web/src/lib/analytics/sales-definition.ts (shared Sales definition)
  • web/src/lib/analytics/daily-sales-scope.ts (role, brand and store scope)
  • web/src/lib/analytics/admin-actions.ts (exportDailySalesCsvAction)
  • web/src/lib/analytics/scoped-day-sales.ts, web/src/lib/finance/owner-today.ts, web/src/lib/playbook/today-overview.ts, web/src/lib/salon-day/index.ts (consumers of the shared definition)
  • web/src/lib/billing/tender-split.ts (per-invoice tender rule)
  • web/src/lib/analytics/date-presets.ts (date presets)
  • web/src/app/(tenant)/dashboard/analytics/reports/daily/ (page, filters, export button)
  • Tests next to the lib files: daily-sales.test.ts, daily-sales-invoices.test.ts, daily-sales-scope.test.ts, sales-definition.test.ts