feat(drafts): two-button create (Vytvořit / Uložit koncept) + draft finalize UX across offers/invoices/issued-orders

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-09 18:44:10 +02:00
parent ce636215dc
commit e86c2e9a80
4 changed files with 392 additions and 55 deletions

View File

@@ -75,6 +75,15 @@ export const RECEIVED_INVOICE_STATUS: Record<string, StatusMeta> = {
paid: { label: "Uhrazena", color: "success" },
};
/**
* Display label for a document's official number. Drafts (deferred numbering)
* have a NULL/empty number until they are finalized — show "Koncept" instead
* of an empty/`null` heading.
*/
export function documentNumberLabel(num: string | null | undefined): string {
return num && String(num).trim() ? String(num) : "Koncept";
}
/** Label with a safe fallback for an unknown/empty key. */
export const statusLabel = (
m: Record<string, StatusMeta>,