feat(manager): online ordering settings in tabs beside Test an order; expense lines and documents

- Online orders -> Settings: takeaway / delivery / any time side by side (wrapping, with room),
  the days of the week apart; fee rules, delivery areas and fee settings (the fee line) as tabs
  on the left, Test an order on the right; a rule's switch at the far right, equal padding,
  'Order price from' / 'Total items count from' in the rule editor.
- Expenses: the dialog lists what was bought (quantity, price before VAT, VAT; they make the
  total, with net / VAT / total) and keeps documents (attach a PDF or photo, open, remove;
  picked for a new expense, uploaded when it's saved); a paperclip in the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 14:57:58 +02:00
co-authored by Claude Opus 5.5
parent 9297cbcd3b
commit f3fc3340d2
10 changed files with 318 additions and 87 deletions
+3
View File
@@ -523,12 +523,14 @@ try {
&& await page.getByTestId('online-tab-settings').getAttribute('aria-selected') === 'true' && await page.getByTestId('rule').count() === 0)
r.check('ordering link: the venue\'s ordering app address is shown, with its QR code', await page.getByTestId('ordering-link').count() === 1
&& (await page.getByTestId('ordering-link-url').textContent()).endsWith('/order/test-site-1') && await page.getByTestId('ordering-link').locator('svg').count() >= 1)
await page.getByTestId('fees-tab-areas').click() // rules · areas · fee settings are tabs (2026-11-20)
await page.getByTestId('area-add').click()
await page.getByTestId('area-name').fill('Centre')
await page.getByTestId('area-postcodes').fill('24100, 241 31')
await page.getByTestId('area-save').click()
r.check('fees: an area with postcodes', await page.getByTestId('area').filter({ hasText: 'Centre' }).waitFor({ timeout: 5000 }).then(() => true).catch(() => false)
&& (await page.getByTestId('area').first().textContent()).includes('241 31'))
await page.getByTestId('fees-tab-rules').click()
const addRule = async (name, fill) => {
await page.getByTestId('rule-add').click()
await page.getByTestId('rule-name').fill(name)
@@ -569,6 +571,7 @@ try {
await page.waitForFunction(() => document.querySelector('[data-testid="test-result"]')?.dataset.refused, null, { timeout: 5000 }).catch(() => {})
r.check('fees: …a postcode outside the areas is refused', await page.getByTestId('test-result').getAttribute('data-refused') === 'area_not_served')
// S.5: the fee's line on the bill and the receipt (a system product, never in the catalogue)
await page.getByTestId('fees-tab-settings').click()
await page.getByTestId('fee-product-name').fill('Delivery')
await page.getByTestId('fee-product-vat').fill('2')
await page.getByTestId('fee-product-save').click()