1.5.0¶
Released: TBD
Compared to 1.4.1. Adds an admin "recompute from source of truth" tool.
Highlights¶
- Admins can repair drifted balances and statuses from the app. A new
recomputeBalancesmutation recomputes client/supplier balances, invoice statuses & balances, and order/quote/credit values from their source rows — with a safe dry-run preview before applying. See Admin Recompute From Source of Truth.
Added¶
recomputeBalances(targets, dryRun)mutation (ADMINISTRATOR-only). Targets:CLIENT_BALANCES, SUPPLIER_BALANCES, SALES_INVOICES, SUPPLIER_INVOICES, ORDERS, QUOTES, CREDITS(empty/null ⇒ all). Returns per-targetRecomputeResult(checked/drifted/appliedcounts + cappeditems: [RecomputeDrift]).dryRun:true(default) reports drift and writes nothing;dryRun:falseapplies. New types:RecomputeTarget,RecomputeResult,RecomputeDrift.
Changed¶
- Nothing existing — purely additive schema.
Fixed¶
- Client-balance recompute now subtracts credit notes. The legacy ops script
scripts/recalculate_client_balances.pycomputedinvoices − receiptsand omitted credit notes, which independently reduce a client's balance. The newCLIENT_BALANCESrecompute usesinvoices − receipts − active credits(VOID/CANCELEDcredits excluded, since their effect is already reverted). The CLI script itself is left for a follow-up; the mutation is the corrected path.
Migrations¶
- None. The feature operates on existing data and adds no tables, columns,
Path/Resource, or backfill.
Frontend impact¶
- New ADMINISTRATOR-only
recomputeBalancesmutation — surface it as an admin maintenance tool. Always rundryRun:truefirst and show theitemsdiff (label,field,currentValue→recomputedValue), then offer an apply action withdryRun:false. Counts are exact;itemsis capped at 200. A non-admin role gets403 RolePermissionError. Full contract in the feature page.
Versioning notes¶
- MINOR bump: new feature, additive schema, no migration or deploy-order coordination required.
- Bumped via
uv run python scripts/bump_version.py 1.5.0 --changelog-stub.