feat: enhance supplier invoices, entity-aware categorization, and new tests

Expand supplier invoice module with overdue cron job, credit note journal
entries, and event emissions on approve/mark-paid/create flows. Add entity
type (EF/AB) awareness to transaction categorization UI and category
mapping logic. Add comprehensive tests for supplier-invoice-entries,
transaction-entries, and expanded API route coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-03-03 17:08:26 +01:00
co-authored by Claude Opus 4.6
parent f6a9889f0a
commit a9bf24ce0b
23 changed files with 2293 additions and 113 deletions
@@ -15,7 +15,7 @@ import type { UploadedFile } from '@/components/bookkeeping/DocumentUploadZone'
import VatTreatmentSelect from './VatTreatmentSelect'
import { VAT_TREATMENT_OPTIONS } from './transaction-types'
import type { TransactionWithInvoice } from './transaction-types'
import type { TransactionCategory, VatTreatment, BASAccount } from '@/types'
import type { TransactionCategory, VatTreatment, BASAccount, EntityType } from '@/types'
interface QuickReviewDialogProps {
open: boolean
@@ -25,6 +25,7 @@ interface QuickReviewDialogProps {
categoryLabel: string
defaultAccount: string
defaultVat: VatTreatment | 'none'
entityType?: EntityType
onConfirm: (
id: string,
category: TransactionCategory,
@@ -41,6 +42,7 @@ export default function QuickReviewDialog({
categoryLabel,
defaultAccount,
defaultVat,
entityType,
onConfirm,
}: QuickReviewDialogProps) {
const { toast } = useToast()
@@ -184,6 +186,7 @@ export default function QuickReviewDialog({
category={category}
vatTreatment={isLiabilityAccount ? 'none' : vatTreatment}
accountOverride={accountOverride}
entityType={entityType}
/>
{/* Account */}
@@ -220,7 +223,7 @@ export default function QuickReviewDialog({
className="text-xs text-primary hover:underline"
onClick={() => setShowVatDropdown(true)}
>
Andra
Ändra
</button>
</p>
)}