feat: the venue and products reports on v2 (platform-v2 step 6.12b)
- Reports -> Venue (src/pages/reports/store): business days (revenue/profit trend, each day's times, orders, revenue, fees, refunds, cost, profit; a day opens with its orders and shifts, a shift opens the overview's shift dialog; the owner corrects a closing time, deletes an empty day or a shift), orders (filters by status, person, table; per-order products / fees / refunds), busy times (by hour, by weekday of the business date), trends (days, weeks, months, the 7-day average), tables (time at the table, per visit, revenue) - Reports -> Products (src/pages/reports/products): products (units, revenue, refunded, cost, profit, margin, waste, share; top 10 by revenue, units or profit) and categories (share bars, profit share) - kit: PrintDialog (receipt printer, summary / full, or print the page), TrendChart and BarList on tokens (no chart animation), printBody() - access: deleting a business day or a shift (which erases its orders) is owner-only (core.settings.manage; was any dashboard user) - v1 StorePage, ProductsReportPage and their seven views removed - tests: reports.test.mjs (+1), e2e manager.mjs (every tab, a day, products revenue = the backend's, Greek) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { test } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import {
|
||||
addDays, dayChoices, defaultPeriod, hourSeries, margin, orderTotals, periodParams, periodSlug, quickRange, rangeProblem, ratio, sortRows,
|
||||
addDays, dayChoices, defaultPeriod, hourSeries, margin, orderTotals, periodParams, periodSlug, printBody, quickRange, rangeProblem, ratio, sortRows,
|
||||
} from '../src/pages/reports/kit/reportLogic.js'
|
||||
|
||||
test('periods: the default, quick ranges, the parameters sent (venue time), file names', () => {
|
||||
@@ -38,3 +38,8 @@ test('a day by the hour, an order\'s totals, business days newest first', () =>
|
||||
assert.equal(orderTotals({ items: [{ status: 'paid', unit_price: 4, price_adjustment: -1, quantity: 2 }, { status: 'cancelled', unit_price: 9, quantity: 1 }] }).revenue, 6)
|
||||
assert.deepEqual(dayChoices([{ id: 1, opened_at: '2026-11-17' }, { id: 2, opened_at: '2026-11-19' }]).map(d => d.id), [2, 1])
|
||||
})
|
||||
|
||||
test('a receipt-printer report gets the same period', () => {
|
||||
assert.deepEqual(printBody({ mode: 'day', dayId: '7' }), { business_day_id: 7, from_dt: null, to_dt: null })
|
||||
assert.deepEqual(printBody({ mode: 'range', from: '2026-11-01', to: '2026-11-02' }), { business_day_id: null, from_dt: '2026-11-01T00:00:00', to_dt: '2026-11-02T23:59:59' })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user