feat(woo): mark an order as already booked outside the integration (#1895)
* feat(woo): mark an order as already booked outside the integration Orders booked by hand before the store was connected sat under Att bokfora forever: the only exits were the book and create-invoice routes. - Migration: manually_booked_at/_by + optional manually_booked_journal_entry_id on webshop_orders (informational link, no financial freeze; the mark produced no accounting objects). - POST/DELETE /api/webshop-orders/[id]/mark-booked: mark with optional posted-verifikat reference (validated per company), conditional claim against concurrent booking/invoicing; unmark is a plain revert. - book and create-invoice routes refuse marked rows (409 WEBSHOP_ORDER_MANUALLY_BOOKED) and exclude them in their atomic claims. - List route: booked/unbooked filters treat a manual mark as a closed exit, so marked rows leave the Att bokfora tab and join Bokforda. - Orders page: row overflow menu with Markera som bokford / Angra markering, MarkOrderBookedDialog with a searchable candidate list of posted entries near the order date, muted status text linking to the referenced verifikat. Fixes #1879 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(woo): close skeptic findings on the manual-booked mark - mark-booked applies the same open-twin gate as book/create-invoice: an OPEN legacy feed transaction blocks the mark (409 WEBSHOP_ORDER_LEGACY_TRANSACTION_OPEN); ignored or booked feed rows unlock it, so no open path to a duplicate remains. - ingest treats manually marked rows as frozen for drift purposes: remote financial deltas set remote_changed_after_freeze (same badge as booked rows) instead of silently refreshing the row under the user's assertion. - re-marking with a journal_entry_id updates the informational link instead of silently dropping it. - dialog: candidate amount computed from the returned lines (the list API does not return total_amount), newest-first ordering, cap hint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * chore(migrations): bump webshop manual-booking migration past freshly merged 20260825120000 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(woo): resolve PR review findings in one pass - freeze v3 migration: financial fields are frozen at the DB level while a row is manually marked as booked (review finding: the mark's freeze lived only in ingest.ts, so any other write path could silently mutate a marked row); unmark stays the escape hatch. pg test added. - pass the active locale to getErrorMessage in the orders page and MarkOrderBookedDialog (CodeRabbit: English users got Swedish errors). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
cd46d936f3
commit
1f9578ca76
@@ -6217,8 +6217,25 @@
|
||||
"status_in_transactions": "In transactions",
|
||||
"status_unpaid": "Unpaid",
|
||||
"status_to_book": "Not booked",
|
||||
"status_marked_booked": "Booked manually",
|
||||
"action_book": "Book",
|
||||
"action_create_invoice": "Create invoice",
|
||||
"action_mark_booked": "Mark as booked",
|
||||
"action_unmark_booked": "Undo mark",
|
||||
"row_menu_aria": "More actions for order {number}",
|
||||
"mark_title": "Mark order {number} as booked",
|
||||
"mark_refund_title": "Mark refund of order {number} as booked",
|
||||
"mark_description": "The order is checked off as already booked outside the integration. No verifikat is created and the order leaves the to-book list. The mark can be undone from the row menu.",
|
||||
"mark_link_label": "Link to an existing verifikat (optional)",
|
||||
"mark_link_search_placeholder": "Search voucher text",
|
||||
"mark_link_loading": "Searching entries",
|
||||
"mark_link_empty": "No posted entries found near the order date. Search to look wider.",
|
||||
"mark_link_optional_hint": "Click an entry to link it; click again to clear the choice.",
|
||||
"mark_link_capped": "Showing the {count} most recent. Search to find more.",
|
||||
"mark_confirm": "Mark as booked",
|
||||
"mark_submitting": "Marking",
|
||||
"mark_failed": "Could not mark the order",
|
||||
"unmark_failed": "Could not undo the mark",
|
||||
"book_title": "Book order {number}",
|
||||
"book_refund_title": "Book refund of order {number}",
|
||||
"fx_unresolved": "The exchange rate for the order currency could not be fetched yet. Try again shortly.",
|
||||
|
||||
@@ -6217,8 +6217,25 @@
|
||||
"status_in_transactions": "Finns i transaktioner",
|
||||
"status_unpaid": "Obetald",
|
||||
"status_to_book": "Ej bokförd",
|
||||
"status_marked_booked": "Bokförd manuellt",
|
||||
"action_book": "Bokför",
|
||||
"action_create_invoice": "Skapa faktura",
|
||||
"action_mark_booked": "Markera som bokförd",
|
||||
"action_unmark_booked": "Ångra markering",
|
||||
"row_menu_aria": "Fler åtgärder för order {number}",
|
||||
"mark_title": "Markera order {number} som bokförd",
|
||||
"mark_refund_title": "Markera återbetalning av order {number} som bokförd",
|
||||
"mark_description": "Ordern prickas av som redan bokförd utanför integrationen. Inget verifikat skapas och ordern försvinner från Att bokföra. Markeringen kan ångras via radmenyn.",
|
||||
"mark_link_label": "Koppla till befintligt verifikat (valfritt)",
|
||||
"mark_link_search_placeholder": "Sök verifikationstext",
|
||||
"mark_link_loading": "Söker verifikationer",
|
||||
"mark_link_empty": "Inga bokförda verifikationer hittades nära orderdatumet. Sök för att leta bredare.",
|
||||
"mark_link_optional_hint": "Klicka på ett verifikat för att koppla det; klicka igen för att ta bort valet.",
|
||||
"mark_link_capped": "Visar de {count} senaste. Sök för att hitta fler.",
|
||||
"mark_confirm": "Markera som bokförd",
|
||||
"mark_submitting": "Markerar",
|
||||
"mark_failed": "Kunde inte markera ordern",
|
||||
"unmark_failed": "Kunde inte ångra markeringen",
|
||||
"book_title": "Bokför order {number}",
|
||||
"book_refund_title": "Bokför återbetalning av order {number}",
|
||||
"fx_unresolved": "Växelkursen för orderns valuta har inte kunnat hämtas ännu. Försök igen om en stund.",
|
||||
|
||||
Reference in New Issue
Block a user