Proforma existed (document_type 'proforma', its own conversion path and views) but the only way to pick it was the collapsed Förval panel inside the editor. A user coming from Fortnox looked for it next to "Ny faktura", did not find it, and concluded the feature was missing. "Ny proformafaktura" is now an entry in the create split button on /invoices, driven by ?proforma=1 exactly like ?quote=1 drives "Ny offert": the URL opens NewInvoiceDialog with the proforma type preselected, the dialog's accessible title says so, and closing the dialog clears the param. Keys added to sv and en. Closes #2217 Claude-Session: https://claude.ai/code/session_01VnConrmMCxJRQ5kfiPPWyy Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Jakob Wennberg
Claude Fable 5.1
parent
c3b7e79af8
commit
2c3ffaf51c
@@ -47,6 +47,7 @@ import {
|
||||
FileInput,
|
||||
FileDown,
|
||||
FileText,
|
||||
FileClock,
|
||||
} from 'lucide-react'
|
||||
import { StartCard } from '@/components/dashboard/StartCard'
|
||||
import { useCompany } from '@/contexts/CompanyContext'
|
||||
@@ -246,8 +247,12 @@ export default function InvoicesPage() {
|
||||
const copyFromId = searchParams.get('copy')
|
||||
const showNewInvoice = searchParams.has('new') || copyFromId !== null
|
||||
const openSelfBilled = searchParams.has('self')
|
||||
// ?quote=1 preselects the offert document type ("Ny offert" split entry).
|
||||
// ?quote=1 preselects the offert document type ("Ny offert" split entry);
|
||||
// ?proforma=1 the proforma type ("Ny proformafaktura" split entry, #2217:
|
||||
// proforma existed but only behind the collapsed Förval panel inside the
|
||||
// editor, so a user coming from Fortnox concluded it did not exist).
|
||||
const openQuote = searchParams.has('quote')
|
||||
const openProforma = searchParams.has('proforma')
|
||||
const showRotRutPayout = searchParams.has('rot-rut')
|
||||
// Open/close handlers rewrite only their own keys: a hardcoded '/invoices'
|
||||
// would destroy the ?status= view write-back (and any other params) every
|
||||
@@ -264,6 +269,7 @@ export default function InvoicesPage() {
|
||||
p.delete('new')
|
||||
p.delete('self')
|
||||
p.delete('quote')
|
||||
p.delete('proforma')
|
||||
p.delete('copy')
|
||||
}),
|
||||
{ scroll: false },
|
||||
@@ -286,6 +292,14 @@ export default function InvoicesPage() {
|
||||
}),
|
||||
{ scroll: false },
|
||||
)
|
||||
const openNewProforma = () =>
|
||||
router.push(
|
||||
invoicesUrl((p) => {
|
||||
p.set('new', '1')
|
||||
p.set('proforma', '1')
|
||||
}),
|
||||
{ scroll: false },
|
||||
)
|
||||
const closeRotRutPayout = () =>
|
||||
router.replace(invoicesUrl((p) => p.delete('rot-rut')), { scroll: false })
|
||||
const openRotRutPayout = () =>
|
||||
@@ -527,6 +541,15 @@ export default function InvoicesPage() {
|
||||
disabledTitle: t('viewer_disabled_tooltip'),
|
||||
onSelect: () => openNewQuote(),
|
||||
},
|
||||
{
|
||||
key: 'proforma',
|
||||
label: t('create_proforma'),
|
||||
icon: FileClock,
|
||||
description: t('create_proforma_desc'),
|
||||
disabled: !canWrite,
|
||||
disabledTitle: t('viewer_disabled_tooltip'),
|
||||
onSelect: () => openNewProforma(),
|
||||
},
|
||||
{
|
||||
key: 'aterkommande',
|
||||
label: t('create_recurring'),
|
||||
@@ -929,7 +952,7 @@ export default function InvoicesPage() {
|
||||
open
|
||||
copyFromId={copyFromId}
|
||||
selfBilled={openSelfBilled}
|
||||
documentType={openQuote ? 'quote' : undefined}
|
||||
documentType={openQuote ? 'quote' : openProforma ? 'proforma' : undefined}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) closeNewInvoice()
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user