feat(bookkeeping): concept toolbar, template booking, confirm-first posting (UI migration PR 4) (#1123)
* feat(bookkeeping): concept toolbar, template booking, confirm-first posting (UI migration PR 4)
The Bokforing page adopts the concept (scene 9) on top of the PR 3 kit:
- Toolbar in concept order with the FyPicker chip far right replacing the
"Visar:" scope selector (same persisted scope, one-click change)
- "Nytt verifikat" is a SplitButton with three remembered modes: Tomt
verifikat (existing editor, voucher-number hint kept), Bokfor fran mall
(new centered TemplateBookDialog: existing booking_template_library
data MRU-ordered, date + editable amount recomputing the kontering
live via applyTemplate, Balanserar row, direct booking + MRU touch),
and Skapa med assistenten (existing agent-sheet path; suggestion lands
in Granskning). Last-used mode persists via ui_state.create_mode
- Draft posting goes through ConfirmDialog describing the outcome
("Bokfors som verifikat A-218: ...") with an indicative next-voucher
preview; the success toast still shows the real number
- "Underlag saknas" becomes the row's only warning chip (Badge warning)
instead of the bare triangle icon; exempt rows keep the muted glyph
- New lib/hooks/use-ui-state.ts: client read of ui_state to seed the
split button's initial mode
No backend, migration or RPC changes. VAT-split math is applyTemplate,
already unit-tested in lib/bookkeeping/__tests__/template-library.test.ts;
split-button persistence is tested in lib/ui-state.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(bookkeeping): use roundOre in TemplateBookDialog money math
The antipattern ratchet caught two hand-rolled Math.round(x*100)/100;
route them through lib/money roundOre like the rest of the codebase.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* docs: PR 4 decisions
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* feat(bookkeeping): concept dry-table verifikat list (scene 9)
The list itself adopts the concept, verified against the artifact's
scene 9 markup: a borderless table (Verifikation / Datum / Beskrivning /
Belopp) with hover-revealed selection checkboxes, hover-revealed chevron,
and an animated grid-rows row expansion whose kontering renders as the
concept's vlines sub-table (uppercase hairline heads, Summa row).
Expansion actions become quiet underlined links (Visa detaljer, Skapa
andringsverifikation, Aterfor (storno), Kopiera); posting keeps its pill
+ ConfirmDialog. Drafts get a row-level Bokfor button like the concept.
All functionality preserved: batch "Inget underlag kravs" bar (above the
table), attachment counts + preview, no-doc-required toggle, out-of-
period + status badges, FX line amounts, sum footer, pagination. The
density toggle is dropped: the table has one density by design.
Fixes from verification: the list's i18n lives in the journal_list
namespace (new keys moved there; they rendered as raw keys otherwise),
and the sidebar brand Image gets explicit dimensions (Next dev warning).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(bookkeeping): bulkbar appears only when a verifikat is selected
Concept behavior: no standing "Markera alla (62) / Markera alla utan
underlag" bar. The batch bar is hidden until the first row is selected
via its hover checkbox, then pops in with the count, the reason input,
Undanta underlagskrav, and quiet actions for Markera alla, the
filter-scoped bulk mark, and Avmarkera. All batch functionality kept,
just no chrome until it is needed.
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
5b5ee8e429
commit
aa72a75dfc
+28
-2
@@ -3819,7 +3819,16 @@
|
||||
"bulk_mark_none": "No entries without documents match the filter.",
|
||||
"bulk_mark_body": "{count} entries without a supporting document match the current filter. They will be marked \"No supporting document required\". You can undo this per entry afterwards.",
|
||||
"bulk_mark_confirm": "Mark {count}",
|
||||
"bulk_cancel": "Cancel"
|
||||
"bulk_cancel": "Cancel",
|
||||
"th_voucher": "Voucher",
|
||||
"th_date": "Date",
|
||||
"th_description": "Description",
|
||||
"th_amount": "Amount",
|
||||
"missing_attachment_chip": "Missing document",
|
||||
"confirm_post_title": "Post voucher",
|
||||
"confirm_post_description": "Will be posted as voucher {voucher}: {description}, {amount}. A posted voucher cannot be edited, only corrected or reversed.",
|
||||
"confirm_post_description_generic": "The voucher \"{description}\" will be posted with the next available voucher number and can then only be corrected or reversed.",
|
||||
"bulkbar_selected": "selected"
|
||||
},
|
||||
"attachment_preview_sheet": {
|
||||
"title": "Attachments",
|
||||
@@ -4562,7 +4571,24 @@
|
||||
"copy_fetch_failed": "Could not fetch source voucher.",
|
||||
"copy_banner_title": "Copy of voucher {label}",
|
||||
"copy_banner_unknown_label": "(unknown number)",
|
||||
"copy_banner_body": "A new, standalone voucher will be created with its own voucher series and number. This is NOT a correction or reversal of the original: use \"Skapa ändringsverifikation\" if you want to correct the source voucher."
|
||||
"copy_banner_body": "A new, standalone voucher will be created with its own voucher series and number. This is NOT a correction or reversal of the original: use \"Skapa ändringsverifikation\" if you want to correct the source voucher.",
|
||||
"create_tomt": "Blank voucher",
|
||||
"create_tomt_desc": "Open the editor directly",
|
||||
"create_mall": "Book from template",
|
||||
"create_mall_desc": "Pick a template and amount",
|
||||
"create_assistent_desc": "The suggestion lands in Review",
|
||||
"tpl_dialog_title": "Book from template",
|
||||
"tpl_search_placeholder": "Search templates...",
|
||||
"tpl_empty": "No matching templates",
|
||||
"tpl_back": "Choose another template",
|
||||
"tpl_date_label": "Date",
|
||||
"tpl_amount_label": "Amount (incl. VAT)",
|
||||
"tpl_enter_amount": "Enter an amount to compute the entry",
|
||||
"tpl_balances": "Balances",
|
||||
"tpl_not_balancing": "Does not balance",
|
||||
"tpl_book": "Post",
|
||||
"tpl_cancel": "Cancel",
|
||||
"tpl_no_period": "No fiscal year covers the chosen date"
|
||||
},
|
||||
"articles": {
|
||||
"title": "Articles",
|
||||
|
||||
+28
-2
@@ -3819,7 +3819,16 @@
|
||||
"bulk_mark_none": "Inga verifikat utan underlag matchar filtret.",
|
||||
"bulk_mark_body": "{count} verifikat som saknar underlag matchar nuvarande filter. De markeras som \"Inget underlag krävs\". Du kan ångra per verifikat efteråt.",
|
||||
"bulk_mark_confirm": "Markera {count}",
|
||||
"bulk_cancel": "Avbryt"
|
||||
"bulk_cancel": "Avbryt",
|
||||
"th_voucher": "Verifikation",
|
||||
"th_date": "Datum",
|
||||
"th_description": "Beskrivning",
|
||||
"th_amount": "Belopp",
|
||||
"missing_attachment_chip": "Underlag saknas",
|
||||
"confirm_post_title": "Bokför verifikat",
|
||||
"confirm_post_description": "Bokförs som verifikat {voucher}: {description}, {amount}. Verifikatet kan inte ändras i efterhand, bara rättas eller stornas.",
|
||||
"confirm_post_description_generic": "Verifikatet \"{description}\" bokförs med nästa lediga verifikationsnummer och kan därefter inte ändras, bara rättas eller stornas.",
|
||||
"bulkbar_selected": "markerade"
|
||||
},
|
||||
"attachment_preview_sheet": {
|
||||
"title": "Bilagor",
|
||||
@@ -4562,7 +4571,24 @@
|
||||
"copy_fetch_failed": "Källverifikatet kunde inte hämtas.",
|
||||
"copy_banner_title": "Kopia av verifikat {label}",
|
||||
"copy_banner_unknown_label": "(okänt nummer)",
|
||||
"copy_banner_body": "Ett nytt, fristående verifikat skapas med egen verifikationsserie och nummer. Detta är inte en rättelse eller storno av originalet: använd \"Skapa ändringsverifikation\" om du vill korrigera källverifikatet."
|
||||
"copy_banner_body": "Ett nytt, fristående verifikat skapas med egen verifikationsserie och nummer. Detta är inte en rättelse eller storno av originalet: använd \"Skapa ändringsverifikation\" om du vill korrigera källverifikatet.",
|
||||
"create_tomt": "Tomt verifikat",
|
||||
"create_tomt_desc": "Öppna editorn direkt",
|
||||
"create_mall": "Bokför från mall",
|
||||
"create_mall_desc": "Välj mall och belopp",
|
||||
"create_assistent_desc": "Förslaget landar i Granskning",
|
||||
"tpl_dialog_title": "Bokför från mall",
|
||||
"tpl_search_placeholder": "Sök mall...",
|
||||
"tpl_empty": "Inga mallar matchar",
|
||||
"tpl_back": "Välj en annan mall",
|
||||
"tpl_date_label": "Datum",
|
||||
"tpl_amount_label": "Belopp (inkl. moms)",
|
||||
"tpl_enter_amount": "Ange ett belopp så räknas konteringen fram",
|
||||
"tpl_balances": "Balanserar",
|
||||
"tpl_not_balancing": "Balanserar inte",
|
||||
"tpl_book": "Bokför",
|
||||
"tpl_cancel": "Avbryt",
|
||||
"tpl_no_period": "Det finns inget räkenskapsår som täcker det valda datumet"
|
||||
},
|
||||
"articles": {
|
||||
"title": "Artiklar",
|
||||
|
||||
Reference in New Issue
Block a user