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:
co-authored by
Claude Opus 4.6
parent
31dec292fe
commit
a2ea52954c
@@ -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>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 })
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user