fix: address user feedback — AI loan categorization, invoice UX, email extension, supplier module

- #43: Improve AI categorization to use account 2350 for loan repayments
  instead of incorrectly suggesting 2440 (supplier payables). Add explicit
  prompt guidance distinguishing loans from supplier debts.
- #45: Change unclear invoice unit "mån" to "månad"
- #46: Enable email extension in extensions.config.json so it appears in
  the marketplace and can be activated by users
- #47: Change "Makulera" to "Ta bort utkast" for draft invoices — reserve
  "Makulera" terminology for proforma invoices only
- #48: Show field-level validation errors when supplier creation fails
  instead of generic "Validation failed" message
- #49: Temporarily hide Leverantörer and Leverantörsfakturor from sidebar
  pending module rework

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-03-03 10:56:26 +01:00
co-authored by Claude Opus 4.6
parent 31dec292fe
commit a2ea52954c
11 changed files with 40 additions and 13 deletions
+4 -3
View File
@@ -29,6 +29,7 @@ import {
Bell,
AlertTriangle,
MessageSquare,
Trash2,
} from 'lucide-react'
import type { Invoice, InvoiceItem, Customer, InvoiceStatus, InvoiceReminder, InvoiceDocumentType } from '@/types'
@@ -875,12 +876,12 @@ export default function InvoiceDetailPage({ params }: { params: Promise<{ id: st
)}
<Button
variant="outline"
className="w-full"
className="w-full text-destructive hover:text-destructive"
onClick={() => updateStatus('cancelled')}
disabled={isUpdating}
>
<XCircle className="mr-2 h-4 w-4" />
Makulera
<Trash2 className="mr-2 h-4 w-4" />
Ta bort utkast
</Button>
</>
)}
+1 -1
View File
@@ -49,7 +49,7 @@ const schema = z.object({
type FormData = z.infer<typeof schema>
const currencies: Currency[] = ['SEK', 'EUR', 'USD', 'GBP', 'NOK', 'DKK']
const units = ['st', 'tim', 'dag', 'mån', 'km', 'kg']
const units = ['st', 'tim', 'dag', 'månad', 'km', 'kg']
export default function NewInvoicePage() {
const router = useRouter()
+2 -1
View File
@@ -68,7 +68,8 @@ export default function SupplierDetailPage() {
})
const result = await res.json()
if (!res.ok) {
toast({ title: 'Fel', description: result.error, variant: 'destructive' })
const fieldErrors = result.errors?.map((e: { field: string; message: string }) => `${e.field}: ${e.message}`).join(', ')
toast({ title: 'Fel', description: fieldErrors || result.error || 'Kunde inte uppdatera leverantör', variant: 'destructive' })
} else {
toast({ title: 'Sparat', description: 'Leverantören har uppdaterats' })
setSupplier({ ...result.data, stats: supplier?.stats })
+2 -1
View File
@@ -69,9 +69,10 @@ export default function SuppliersPage() {
const result = await response.json()
if (!response.ok) {
const fieldErrors = result.errors?.map((e: { field: string; message: string }) => `${e.field}: ${e.message}`).join(', ')
toast({
title: 'Fel',
description: result.error || 'Kunde inte skapa leverantör',
description: fieldErrors || result.error || 'Kunde inte skapa leverantör',
variant: 'destructive',
})
} else {