fix(articles): non-SEK price support + reinstated deactivate (support: odinaero.se) (#1166)
* fix(articles): stop losing and mislabeling non-SEK article prices Support report (odinaero.se): EUR article prices did not stick and the register showed every price in kr. Three concrete defects, one cause: articles.currency existed in the DB and API but the UI dropped it. - Edit dialog omitted currency from initialData, so ArticleForm fell back to SEK and every save silently reset an EUR article to SEK. - Register list and detail page formatted prices without the article's currency, rendering EUR amounts as "kr". - "Spara som artikel" in the invoice editor posted the line price without the invoice's currency, so lines from EUR invoices became SEK articles. - The xlsx/csv register export stamped the kr-suffixed currency format on every price; prices now use a new suffix-free decimalColumn and a Valuta column carries the per-article code. Follow-ups (not in this diff): the article importer does not detect a Valuta column yet, and the MCP create/update_article staged schemas have no currency param (agent-created articles stay SEK). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(articles): reinstate deactivate/activate on the article detail page Support report (odinaero.se): no button to set an article inactive. Commit 8a9a930f turned DELETE into a hard delete and removed the deactivate action, but hard delete is refused for articles referenced by invoice lines (ARTICLE_IN_USE), leaving used articles with no retire path even though the API, the list badge and the i18n keys for deactivation all still exist. Adds an Inaktivera/Aktivera button next to Redigera that PATCHes the active flag (confirm dialog on deactivate, none on reactivate) and stays on the page so the status badge reflects the change. Reuses the orphaned deactivate_* keys; adds the three missing activate_* keys in both locales. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(customers): stop resetting customer language to Swedish on every edit Same defect class as the article currency reset in this branch: the customer edit dialog's initialData omits language, CustomerForm defaults it to 'sv' and submits every field, and the PATCH route applies it. Editing any detail on an English-language customer silently flipped their invoice PDFs and emails back to Swedish. Found by a repo-wide sweep for hand-picked initialData edit dialogs; customers, suppliers and articles are the only three such call sites, and suppliers passes every form field already. 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
47938520d6
commit
17dc5f12f6
@@ -4711,6 +4711,7 @@
|
||||
"back": "Back to articles",
|
||||
"edit": "Edit",
|
||||
"deactivate": "Deactivate",
|
||||
"activate": "Activate",
|
||||
"delete": "Delete",
|
||||
"edit_dialog_title": "Edit article",
|
||||
"viewer_disabled_tooltip": "You only have viewer access in this company",
|
||||
@@ -4741,7 +4742,9 @@
|
||||
"deactivate_confirm_description": "The article is hidden from lists and invoice pickers but its history is kept. You can reactivate it later.",
|
||||
"deactivate_confirm_label": "Deactivate",
|
||||
"deactivated_title": "Article deactivated",
|
||||
"activated_title": "Article activated",
|
||||
"deactivate_failed_title": "Could not deactivate article",
|
||||
"activate_failed_title": "Could not activate article",
|
||||
"delete_confirm_title": "Delete {name}",
|
||||
"delete_confirm_description": "The article and its article number are permanently deleted. This is only possible if the article has never been used on an invoice.",
|
||||
"delete_confirm_label": "Delete",
|
||||
|
||||
@@ -4711,6 +4711,7 @@
|
||||
"back": "Tillbaka till artiklar",
|
||||
"edit": "Redigera",
|
||||
"deactivate": "Inaktivera",
|
||||
"activate": "Aktivera",
|
||||
"delete": "Ta bort",
|
||||
"edit_dialog_title": "Redigera artikel",
|
||||
"viewer_disabled_tooltip": "Du har endast läsbehörighet i detta företag",
|
||||
@@ -4741,7 +4742,9 @@
|
||||
"deactivate_confirm_description": "Artikeln döljs i listor och fakturaval men historiken bevaras. Du kan aktivera den igen senare.",
|
||||
"deactivate_confirm_label": "Inaktivera",
|
||||
"deactivated_title": "Artikel inaktiverad",
|
||||
"activated_title": "Artikel aktiverad",
|
||||
"deactivate_failed_title": "Kunde inte inaktivera artikel",
|
||||
"activate_failed_title": "Kunde inte aktivera artikel",
|
||||
"delete_confirm_title": "Ta bort {name}",
|
||||
"delete_confirm_description": "Artikeln och dess artikelnummer tas bort permanent. Det går bara om artikeln aldrig har använts på en faktura.",
|
||||
"delete_confirm_label": "Ta bort",
|
||||
|
||||
Reference in New Issue
Block a user