Mcp/template data feedback (#617)
* fix(booking-templates): scope template list to the active company GET /api/settings/booking-templates relied solely on the btl_select RLS policy, which is membership-wide (user_company_ids) and returns templates from every company the user belongs to. A user who owns multiple companies saw all their templates merged regardless of which company was active. Narrow the list in the API layer (mirroring counterparty-templates) to system + the active company + the active company's team. RLS stays the security backstop; this fixes the cross-company merge within a single user's own view (it was never a cross-tenant data leak). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(import): show proper message for duplicate bank file upload The bank file import page mis-parsed the structured error envelope ({ error: { code, message, details } }), so a BANK_FILE_DUPLICATE (409) fell through to the generic "Kunde inte läsa filen" fallback. The upload step also hardcoded that same string as the error heading, so duplicates were doubly misreported as parse failures. - Parse the structured envelope by error.code; surface error.message for all codes instead of rendering the error object. - Add a dedicated BANK_FILE_DUPLICATE message using the importedAt / importedCount details the route already returns. - Add an optional errorTitle prop to BankFileUploadStep (defaults to the previous text) and pass "Filen är redan importerad" for dupes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(tests): add comprehensive tests for recordateEntry, inbox-linking, and external-id handling - Implemented unit tests for recordateEntry in the bookkeeping module to validate various scenarios including date changes, non-posted entries, and fiscal period restrictions. - Created tests for inbox-linking status in pending operations to ensure correct handling of invoice inbox items and supplier invoices, addressing historical bugs related to status updates. - Added tests for external-id utilities to ensure consistent handling of monetary amounts and deduplication keys across different transaction sources. - Introduced new functions in external-id.ts for stable external ID generation and normalization of imported descriptions, enhancing transaction deduplication reliability. feat(migrations): add new database migrations for transaction handling - Created migration to exclude storno and correction vouchers from unmatched GL lines, ensuring accurate reconciliation. - Added a migration to preserve original bank transaction descriptions in a new immutable column, allowing for user edits while maintaining audit trails and deduplication integrity. * feat(migrations): add function to exclude storno/correction vouchers from unmatched GL lines * feat(transactions): enhance transaction handling with improved description normalization and preloaded original entries --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
2c59c3633f
commit
c6c86cded4
+19
-1
@@ -1633,7 +1633,17 @@
|
||||
"match_invoice_btn": "Match invoice {number}",
|
||||
"match_supplier_invoice_btn": "Match supplier invoice {number}",
|
||||
"choose_template_btn": "Choose template...",
|
||||
"delete_aria": "Delete transaction"
|
||||
"delete_aria": "Delete transaction",
|
||||
"edit_title_aria": "Edit title",
|
||||
"edited_badge": "edited",
|
||||
"original_name_tooltip": "Original bank name: {name}",
|
||||
"edit_title_dialog_title": "Edit transaction title",
|
||||
"edit_title_warning": "Are you sure you want to edit the title of this transaction?",
|
||||
"edit_title_label": "Title",
|
||||
"edit_title_original_hint": "Original bank name: {name}.",
|
||||
"edit_title_restore": "Restore",
|
||||
"edit_title_cancel": "Cancel",
|
||||
"edit_title_save": "Save"
|
||||
},
|
||||
"tx_quick_review": {
|
||||
"open_attached_failed": "Could not open the receipt",
|
||||
@@ -2474,6 +2484,9 @@
|
||||
},
|
||||
"supplier_invoice_editor": {
|
||||
"page_title": "Register supplier invoice",
|
||||
"no_period_warning": "Invoice date {date} falls outside every fiscal year you have set up.",
|
||||
"no_period_help": "Create the fiscal year so the invoice can be booked — otherwise it can't be registered.",
|
||||
"create_period": "Create fiscal year",
|
||||
"back_aria": "Back to supplier invoices",
|
||||
"back_aria_inbox": "Back to the inbox",
|
||||
"loading_inbox": "Loading data from inbox…",
|
||||
@@ -2907,6 +2920,9 @@
|
||||
"create_correction": "Create correction entry",
|
||||
"copy_entry": "Copy journal entry",
|
||||
"edit_entry": "Edit",
|
||||
"correct_menu": "Correct",
|
||||
"correct_lines": "Correct lines",
|
||||
"correct_date": "Correct date",
|
||||
"details_title": "Journal entry details",
|
||||
"field_date": "Date",
|
||||
"field_posted_at": "Posted",
|
||||
@@ -3297,6 +3313,8 @@
|
||||
"deleted_title": "Deleted",
|
||||
"deleted_description": "The transaction has been deleted",
|
||||
"delete_failed_description": "The transaction could not be deleted. Please try again.",
|
||||
"edit_title_saved": "Title updated",
|
||||
"edit_title_failed": "Could not update the title",
|
||||
"review_in_bookkeeping_description": "Review and post the journal entry in Bookkeeping.",
|
||||
"bank_sync_attention_one": "1 bank connection needs renewal",
|
||||
"bank_sync_attention_many": "{count} bank connections need renewal",
|
||||
|
||||
+19
-1
@@ -1633,7 +1633,17 @@
|
||||
"match_invoice_btn": "Matcha Faktura {number}",
|
||||
"match_supplier_invoice_btn": "Matcha Leverantörsfaktura {number}",
|
||||
"choose_template_btn": "Välj mall...",
|
||||
"delete_aria": "Ta bort transaktion"
|
||||
"delete_aria": "Ta bort transaktion",
|
||||
"edit_title_aria": "Ändra titel",
|
||||
"edited_badge": "redigerad",
|
||||
"original_name_tooltip": "Bankens originalnamn: {name}",
|
||||
"edit_title_dialog_title": "Ändra transaktionens titel",
|
||||
"edit_title_warning": "Är du säker på att du vill ändra titeln på den här transaktionen?",
|
||||
"edit_title_label": "Titel",
|
||||
"edit_title_original_hint": "Bankens originalnamn: {name}.",
|
||||
"edit_title_restore": "Återställ",
|
||||
"edit_title_cancel": "Avbryt",
|
||||
"edit_title_save": "Spara"
|
||||
},
|
||||
"tx_quick_review": {
|
||||
"open_attached_failed": "Kunde inte öppna underlaget",
|
||||
@@ -2474,6 +2484,9 @@
|
||||
},
|
||||
"supplier_invoice_editor": {
|
||||
"page_title": "Registrera leverantörsfaktura",
|
||||
"no_period_warning": "Fakturadatumet {date} ligger utanför alla upplagda räkenskapsår.",
|
||||
"no_period_help": "Lägg upp räkenskapsåret så att fakturan kan bokföras – annars kan den inte registreras.",
|
||||
"create_period": "Skapa räkenskapsår",
|
||||
"back_aria": "Tillbaka till leverantörsfakturor",
|
||||
"back_aria_inbox": "Tillbaka till inkorgen",
|
||||
"loading_inbox": "Laddar uppgifter från inkorgen…",
|
||||
@@ -2907,6 +2920,9 @@
|
||||
"create_correction": "Skapa ändringsverifikation",
|
||||
"copy_entry": "Kopiera verifikat",
|
||||
"edit_entry": "Redigera",
|
||||
"correct_menu": "Rätta",
|
||||
"correct_lines": "Rätta rader",
|
||||
"correct_date": "Rätta datum",
|
||||
"details_title": "Verifikationsdetaljer",
|
||||
"field_date": "Datum",
|
||||
"field_posted_at": "Bokförd",
|
||||
@@ -3297,6 +3313,8 @@
|
||||
"deleted_title": "Borttagen",
|
||||
"deleted_description": "Transaktionen har tagits bort",
|
||||
"delete_failed_description": "Transaktionen kunde inte tas bort. Försök igen.",
|
||||
"edit_title_saved": "Titeln uppdaterad",
|
||||
"edit_title_failed": "Kunde inte uppdatera titeln",
|
||||
"review_in_bookkeeping_description": "Granska och bokför verifikatet i Bokföring.",
|
||||
"bank_sync_attention_one": "1 bankanslutning behöver förnyas",
|
||||
"bank_sync_attention_many": "{count} bankanslutningar behöver förnyas",
|
||||
|
||||
Reference in New Issue
Block a user