Files
accounted/app
Mattsson ebf69d2933 fix: credit-note overdue countdown + voucher sequence resync after SIE import (#1069)
* fix(invoices): hide overdue countdown for credit notes in invoice list

Credit notes stay in status 'sent' forever (invoices_credit_note_not_paid
blocks paid states), so the relative due-date label rendered an ever-growing
'X dagar forsenad' on every issued credit note. Skip the label for rows with
credited_invoice_id set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(bookkeeping): resync voucher_sequences counters left behind by pre-RPC SIE imports

The batch SIE import path that predated import_sie_journal_entries
(20260712150000) inserted vouchers with explicit numbers but never
updated voucher_sequences, leaving counters behind max (year-end
integrity error, duplicate-key crash on the next voucher) or missing
entirely (next_voucher_number restarts at 1 and collides). Idempotent
data repair: raise lagging counters to the observed max and insert
missing rows attributed to the company owner. Already applied to prod
and staging; replay is a no-op.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(bookkeeping): harden voucher-sequence resync per PR review

Address PR #1069 review findings: close the ON CONFLICT race by
upgrading DO NOTHING to DO UPDATE with GREATEST (a row created by
next_voucher_number between snapshot and insert is raised instead of
left at 1), unify the voucher_number > 0 filter across both statements,
and record the manual prod/staging execution timestamps as the change
record (ISO 27001 A.8.32, BFNAR 2013:2 behandlingshistorik).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 13:35:52 +02:00
..
2026-07-15 15:53:15 +02:00
2026-07-13 22:54:33 +02:00
2026-04-29 16:32:26 +02:00