feat: the staff, cancellations/discounts, technical, prep zones and expenses reports on v2; reports all on v2 (platform-v2 step 6.12c)

- Reports -> Staff (src/pages/reports/staff): shifts (pay, collected, to hand
  over, the counted difference, cancellations; a shift opens the overview's
  shift dialog; the owner deletes one), cash handover (starting cash, cash,
  card, refunds, to hand over, counted), sales by person (orders, units,
  cancellations, hours, sales net of refunds, per hour, share; ranked) - the
  v1 activity and leaderboard views merged into it
- Reports -> Cancellations and discounts (src/pages/reports/misc), with totals
  per person; Technical (printing: tickets, failed, printed first time, per
  printer, every ticket with its error, the receipt-printer summary; logs for
  the owner) - v1 printer history + printer health merged
- Prep zones report (per zone: items, value, products, orders; per-zone Excel
  downloads built in the browser with the server's Excel rules; print a zone)
  and Expenses report (period, status, category; split by category or
  supplier; payments) - its categories now match what Finance saves (the v1
  report listed categories that never existed)
- kit: csvText() / download(); PrintDialog modes for the printer summary
- v1 report kit (reports/shared) and every v1 report view deleted;
  src/pages/reports is v2 (all but LogsPanel strict)
- tests: reports.test.mjs (+1), e2e manager.mjs (every report opens, a shift's
  details, the ranking)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 09:19:49 +02:00
co-authored by Claude Opus 5.5
parent 7767bdb728
commit 6bdf0bdd79
35 changed files with 919 additions and 4230 deletions
+21
View File
@@ -1216,6 +1216,27 @@ try {
await page.getByTestId('report-tab-categories').click()
r.check(`${rp} Products → Categories opens`, await page.getByTestId('categories-share').waitFor({ timeout: 10_000 }).then(() => true).catch(() => false))
await page.screenshot({ path: path.join(OUT, 'manager-report-categories.png'), fullPage: true })
// 6.12c: staff, cancellations and discounts, technical, prep zones, expenses
const opens = async (url, testId, what) => {
await page.goto(`${APP}${url}`)
r.check(`${rp} ${what} opens`, await page.getByTestId(testId).first().waitFor({ timeout: 10_000 }).then(() => true).catch(() => false))
}
await opens('/reports/staff', 'report-shift', 'Staff → Shifts (rows)')
await page.getByTestId('report-shift').first().click()
r.check(`${rp} a shift opens its details`, await page.getByTestId('shift-dialog').waitFor({ timeout: 8000 }).then(() => true).catch(() => false))
await page.keyboard.press('Escape')
await page.getByTestId('report-tab-cash').click()
r.check(`${rp} Staff → Cash handover`, await page.getByTestId('staff-handover').waitFor({ timeout: 8000 }).then(() => true).catch(() => false))
await page.getByTestId('report-tab-people').click()
r.check(`${rp} Staff → Sales by person ranks people`, await page.getByTestId('staff-ranking').waitFor({ timeout: 8000 }).then(() => true).catch(() => false))
await page.screenshot({ path: path.join(OUT, 'manager-report-staff.png'), fullPage: true })
await opens('/reports/misc', 'cancellations-count', 'Cancellations')
await page.getByTestId('report-tab-discounts').click()
r.check(`${rp} Discounts opens`, await page.getByTestId('report-period').waitFor({ timeout: 8000 }).then(() => true).catch(() => false))
await opens('/reports/technical', 'printing-total', 'Technical → Printing')
await opens('/reports/prep-zones', 'report-period', 'Prep zones')
await opens('/reports/expenses', 'expenses-total', 'Expenses')
await page.screenshot({ path: path.join(OUT, 'manager-report-expenses.png'), fullPage: true })
await api('PUT', '/api/platform/modules/connect_orders', { token: boss, body: { enabled: true } })
await page.goto(`${APP}/online-orders`)