From f96a445d880dca5e6506fb9deec141d6fc46e289 Mon Sep 17 00:00:00 2001 From: Jakob Wennberg Date: Fri, 4 Sep 2026 17:13:52 +0200 Subject: [PATCH] fix(sjalvfaktura): name the arrival date so it is not read as payment date (#2272) Root cause: the self-billing form labelled invoices.received_date as "Mottaget datum" / "Received date". Read cold, "mottaget" attaches to whatever the reader has in mind (payment received, goods received), and two people in the Discord thread guessed wrong. The field only records the day the counterparty's document arrived; the payment date is set separately when the invoice is marked as paid. Fix: rename the label to "Ankomstdatum" / "Date received" (with the matching validation message and the next-step hint in the editor footer), and add a helper line under the field saying the payment date is set when the invoice is marked paid. Same text-xs muted helper pattern the form already uses for other hints. The keys live in the self_billing and invoice_editor namespaces and are used only by InvoiceEditor.tsx; nothing is shared with the supplier-invoice form. No DB columns, API fields or types change. Fixes #2264 Claude-Session: https://claude.ai/code/session_015qgLgdt4mLmha1ZLFMwq1u Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com> Co-authored-by: Claude Fable 5.1 --- components/invoices/InvoiceEditor.tsx | 1 + messages/en.json | 7 ++++--- messages/sv.json | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/invoices/InvoiceEditor.tsx b/components/invoices/InvoiceEditor.tsx index f5bd8cb7..eb38f440 100644 --- a/components/invoices/InvoiceEditor.tsx +++ b/components/invoices/InvoiceEditor.tsx @@ -2239,6 +2239,7 @@ export default function InvoiceEditor(props: InvoiceEditorProps = { mode: 'creat aria-required="true" className="tabular-nums" /> +

{ts('received_date_help')}

{errors.received_date && (

{errors.received_date.message}

)} diff --git a/messages/en.json b/messages/en.json index a229eafe..2ff13109 100644 --- a/messages/en.json +++ b/messages/en.json @@ -3696,7 +3696,7 @@ "next_step_personnummer": "enter the personal number for the deduction", "next_step_housing": "enter the property designation", "next_step_external_number": "enter the customer's invoice number", - "next_step_received_date": "set the received date", + "next_step_received_date": "set the date received", "ready_create": "Ready to review: everything else has sensible defaults.", "ready_edit": "Ready to save.", "ready_self_billed": "Ready to register.", @@ -6440,13 +6440,14 @@ "agreement_ref_label": "Agreement reference", "agreement_ref_placeholder": "Self-billing agreement", "invoice_date_label": "Invoice date", - "received_date_label": "Received date", + "received_date_label": "Date received", + "received_date_help": "The day the self-billing invoice arrived. The payment date is set when the invoice is marked as paid.", "register": "Register self-billing invoice", "created_title": "Self-billing invoice registered", "created_description": "Self-billing invoice {number} has been booked as a sale", "create_failed_title": "Could not register the self-billing invoice", "validation_external_number_required": "Invoice number is required", - "validation_received_date_required": "Received date is required" + "validation_received_date_required": "Date received is required" }, "invoices": { "rot_rut_payout_action": "ROT/RUT file", diff --git a/messages/sv.json b/messages/sv.json index 35773129..6d4bd371 100644 --- a/messages/sv.json +++ b/messages/sv.json @@ -3696,7 +3696,7 @@ "next_step_personnummer": "ange personnummer för skattereduktionen", "next_step_housing": "ange fastighetsbeteckning", "next_step_external_number": "ange kundens fakturanummer", - "next_step_received_date": "ange mottagningsdatum", + "next_step_received_date": "ange ankomstdatum", "ready_create": "Klar att granska: allt annat har smarta förval.", "ready_edit": "Klart att spara.", "ready_self_billed": "Klar att registrera.", @@ -6440,13 +6440,14 @@ "agreement_ref_label": "Avtalsreferens", "agreement_ref_placeholder": "Självfaktureringsavtal", "invoice_date_label": "Fakturadatum", - "received_date_label": "Mottaget datum", + "received_date_label": "Ankomstdatum", + "received_date_help": "Dagen självfakturan kom in. Betaldatum sätts när fakturan markeras som betald.", "register": "Registrera självfaktura", "created_title": "Självfaktura registrerad", "created_description": "Självfaktura {number} har bokförts som försäljning", "create_failed_title": "Kunde inte registrera självfakturan", "validation_external_number_required": "Fakturanummer krävs", - "validation_received_date_required": "Mottaget datum krävs" + "validation_received_date_required": "Ankomstdatum krävs" }, "invoices": { "rot_rut_payout_action": "ROT/RUT-fil",