fix(transactions): steer duplicate guard to matching for ledger-only vouchers (#958)
When the booking-time duplicate guard flags a ledger-only voucher candidate (transaction_id null: a verifikat from an SIE import, a paid invoice, a salary payout), the dialog's primary action is now "Matcha mot verifikatet": it links the bank transaction to the existing voucher via /api/reconciliation/bank/link (the same path MatchVoucherDialog uses) instead of double-booking the same affarshandelse. "Bokfor anda" stays available but demoted to an outline button. Sibling-transaction candidates keep today's layout: matching a second bank line onto a voucher that already has one is the N:1 edge case, not the default. Wired through both call sites: the transactions page (runCategorize) reuses handleVoucherLinked's refresh, and TransactionBookingDialog (JournalEntryForm, /api/transactions/[id]/book path) reuses the booked flow so in-dialog attached documents land on the matched verifikat and the row leaves the list, with a "Bankhandelsen kopplad" toast instead of "Bokford". No lib change: the candidate payload already carries the transaction_id discriminator, covered by existing detection tests. Closes #919. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
d7e110b6b2
commit
82c66739d7
@@ -3872,6 +3872,8 @@
|
||||
"dialog_duplicate_voucher_label": "Voucher {label}",
|
||||
"dialog_duplicate_voucher_generic": "Existing voucher",
|
||||
"dialog_duplicate_view_voucher": "View the voucher",
|
||||
"dialog_duplicate_match": "Match to the voucher",
|
||||
"dialog_duplicate_match_failed": "Could not match",
|
||||
"dialog_duplicate_book_anyway": "Book anyway",
|
||||
"dialog_duplicate_cancel": "Cancel",
|
||||
"load_failed_title": "Could not load transactions",
|
||||
|
||||
@@ -3872,6 +3872,8 @@
|
||||
"dialog_duplicate_voucher_label": "Verifikat {label}",
|
||||
"dialog_duplicate_voucher_generic": "Befintlig verifikation",
|
||||
"dialog_duplicate_view_voucher": "Visa verifikatet",
|
||||
"dialog_duplicate_match": "Matcha mot verifikatet",
|
||||
"dialog_duplicate_match_failed": "Kunde inte matcha",
|
||||
"dialog_duplicate_book_anyway": "Bokför ändå",
|
||||
"dialog_duplicate_cancel": "Avbryt",
|
||||
"load_failed_title": "Kunde inte ladda transaktioner",
|
||||
|
||||
Reference in New Issue
Block a user