financial page with bank data
All checks were successful
Deploy / build-deploy (push) Successful in 1m48s

This commit is contained in:
Jorijn van der Graaf 2026-08-14 04:14:13 +02:00
commit 33c68c2f44
11 changed files with 394 additions and 87 deletions

View file

@ -654,13 +654,18 @@ body_lacks /financials 'data-fin-donations-count' "no donation figures before th
cat >"$ORDERS.financials.json" <<'JSON'
{"as_of":"2026-08-14",
"donations":{"count":3,"total_minor":4500},
"recurring":[{"label":"Hosting","total_minor":1200}],
"single":[{"label":"Inventory","total_minor":230000}]}
"expenses":[{"label":"Hosting","total_minor":1200},
{"label":"Inventory","total_minor":230000}]}
JSON
body_has /financials 'data-fin-donations-count="3"' "donation count picked up live"
body_has /financials 'data-fin-expenses-minor="231200"' "expense total picked up live"
body_has /financials 'Hosting' "recurring category renders"
body_has /financials 'Inventory' "one-off category renders"
# Net = (donations 4500 + sales 0) - expenses 231200. Negative on purpose:
# a shop that has bought stock but not sold it is exactly this shape, and the
# figure has to survive going below zero.
body_has /financials 'data-fin-net-minor="-226700"' "net is published and may be negative"
body_has /financials '€-2267' "a negative net renders with its sign"
body_has /financials 'Hosting' "an expense category renders"
body_has /financials 'Inventory' "a second expense category renders"
body_has /financials '2026-08-14' "bank figures carry their as-of date"
echo "== the bunq mutation callback =="
@ -672,7 +677,7 @@ echo "== the bunq mutation callback =="
# re-read per callback, so a new rule takes effect without a restart.
cat >"$ORDERS.financial-rules.json" <<'JSON'
{"donation_accounts":[9911],
"rules":[{"description_contains":"hetzner","group":"recurring","label":"Hosting"},
"rules":[{"description_contains":"hetzner","group":"expense","label":"Hosting"},
{"iban":"NL01OWNSELF0000000","group":"ignore"}]}
JSON