Skip to content

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 recomputeBalances mutation 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-target RecomputeResult (checked/drifted/applied counts + capped items: [RecomputeDrift]). dryRun:true (default) reports drift and writes nothing; dryRun:false applies. 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.py computed invoices − receipts and omitted credit notes, which independently reduce a client's balance. The new CLIENT_BALANCES recompute uses invoices − receipts − active credits (VOID/CANCELED credits 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 recomputeBalances mutation — surface it as an admin maintenance tool. Always run dryRun:true first and show the items diff (label, field, currentValuerecomputedValue), then offer an apply action with dryRun:false. Counts are exact; items is capped at 200. A non-admin role gets 403 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.