Procházet zdrojové kódy

qoutation templates

Bernt Christian Egeland před 9 měsíci
rodič
revize
2619e0f4ae

+ 2 - 2
src/app/(authenticated)/settings/settings-nav.tsx

@@ -66,9 +66,9 @@ const settingsNav: SettingsNavItem[] = [
   },
   {
     title: "Templates",
-    href: "/settings/invoice-template",
+    href: "/settings/templates",
     icon: Layout,
-    description: "Invoice styling & colors",
+    description: "Invoice & quote styling",
     gate: "customTemplates",
   },
   {

+ 12 - 4
src/app/(authenticated)/settings/invoice-template/page.tsx → src/app/(authenticated)/settings/templates/page.tsx

@@ -6,7 +6,7 @@ import { getFeatures, isCloudMode } from "@/lib/features";
 import { FeatureLockedMessage } from "../feature-locked-message";
 import { redirect } from "next/navigation";
 
-export default async function InvoiceTemplatePage() {
+export default async function TemplatePage() {
   const data = await getLayoutData();
 
   if (data.status === "unauthenticated") redirect("/auth/sign-in");
@@ -17,8 +17,8 @@ export default async function InvoiceTemplatePage() {
   if (!features.customTemplates) {
     return (
       <FeatureLockedMessage
-        feature="Invoice Templates"
-        description="Choose from pre-built invoice templates and customize colors, fonts, and header layouts for your PDF invoices and quotes."
+        feature="Templates"
+        description="Choose from pre-built templates and customize colors, fonts, and header layouts for your PDF invoices and quotes."
         isCloud={isCloudMode()}
       />
     );
@@ -28,17 +28,25 @@ export default async function InvoiceTemplatePage() {
     SETTING_KEYS.INVOICE_PRIMARY_COLOR,
     SETTING_KEYS.INVOICE_FONT_FAMILY,
     SETTING_KEYS.INVOICE_HEADER_STYLE,
+    SETTING_KEYS.QUOTE_PRIMARY_COLOR,
+    SETTING_KEYS.QUOTE_FONT_FAMILY,
+    SETTING_KEYS.QUOTE_HEADER_STYLE,
   ]);
 
   const settings = result.success && result.data ? result.data : {};
 
   return (
     <TemplateSettings
-      initialValues={{
+      initialInvoiceValues={{
         primaryColor: settings[SETTING_KEYS.INVOICE_PRIMARY_COLOR] || "#d97706",
         fontFamily: settings[SETTING_KEYS.INVOICE_FONT_FAMILY] || "Helvetica",
         headerStyle: settings[SETTING_KEYS.INVOICE_HEADER_STYLE] || "standard",
       }}
+      initialQuoteValues={{
+        primaryColor: settings[SETTING_KEYS.QUOTE_PRIMARY_COLOR] || "#d97706",
+        fontFamily: settings[SETTING_KEYS.QUOTE_FONT_FAMILY] || "Helvetica",
+        headerStyle: settings[SETTING_KEYS.QUOTE_HEADER_STYLE] || "standard",
+      }}
     />
   );
 }

+ 125 - 49
src/app/(authenticated)/settings/invoice-template/template-settings.tsx → src/app/(authenticated)/settings/templates/template-settings.tsx

@@ -18,6 +18,7 @@ import { SETTING_KEYS } from "@/features/settings/Schema/settingsSchema";
 import { templatePresets } from "@/features/settings/Schema/templatePresets";
 import { Check, Loader2, Palette } from "lucide-react";
 import { ReadOnlyBanner, SaveButton, ReadOnlyWrapper } from "../read-only-guard";
+import { cn } from "@/lib/utils";
 
 interface TemplateValues {
   primaryColor: string;
@@ -25,6 +26,8 @@ interface TemplateValues {
   headerStyle: string;
 }
 
+type TabType = "invoice" | "quotation";
+
 const fontMap: Record<string, string> = {
   Helvetica: "Helvetica, Arial, sans-serif",
   "Times-Roman": "'Times New Roman', Times, serif",
@@ -46,12 +49,15 @@ function PreviewHeader({
   values,
   headerStyle,
   fontFamily,
+  documentLabel,
 }: {
   values: TemplateValues;
   headerStyle: string;
   fontFamily: string;
+  documentLabel: string;
 }) {
   const style = { fontFamily: fontMap[fontFamily] || "sans-serif" };
+  const docNumber = documentLabel === "QUOTE" ? "QT-1001" : "INV-1001";
 
   if (headerStyle === "compact") {
     return (
@@ -75,8 +81,8 @@ function PreviewHeader({
             </div>
           </div>
           <div className="text-right">
-            <p className="text-sm font-bold">INVOICE</p>
-            <p className="text-[9px] text-gray-500">INV-1001</p>
+            <p className="text-sm font-bold">{documentLabel}</p>
+            <p className="text-[9px] text-gray-500">{docNumber}</p>
           </div>
         </div>
       </div>
@@ -98,9 +104,9 @@ function PreviewHeader({
           </div>
         </div>
         <div className="mt-2 flex items-center justify-between">
-          <p className="text-sm font-bold">INVOICE</p>
+          <p className="text-sm font-bold">{documentLabel}</p>
           <div className="flex gap-3 text-[9px] text-gray-500">
-            <span>INV-1001</span>
+            <span>{docNumber}</span>
             <span>Jan 15, 2026</span>
           </div>
         </div>
@@ -130,9 +136,9 @@ function PreviewHeader({
         </div>
         <div className="text-right">
           <p className="text-lg font-bold tracking-tight" style={{ color: values.primaryColor }}>
-            INVOICE
+            {documentLabel}
           </p>
-          <p className="text-[9px] text-gray-500">INV-1001</p>
+          <p className="text-[9px] text-gray-500">{docNumber}</p>
           <p className="text-[9px] text-gray-500">Jan 15, 2026</p>
         </div>
       </div>
@@ -140,28 +146,23 @@ function PreviewHeader({
   );
 }
 
-export function TemplateSettings({
-  initialValues,
+function TemplateTab({
+  values,
+  setValues,
+  documentLabel,
+  billToLabel,
 }: {
-  initialValues: TemplateValues;
+  values: TemplateValues;
+  setValues: (v: TemplateValues) => void;
+  documentLabel: string;
+  billToLabel: string;
 }) {
-  const [saving, setSaving] = useState(false);
-  const [values, setValues] = useState(initialValues);
-
-  const handleSave = async () => {
-    setSaving(true);
-    try {
-      await Promise.all([
-        setSetting(SETTING_KEYS.INVOICE_PRIMARY_COLOR, values.primaryColor),
-        setSetting(SETTING_KEYS.INVOICE_FONT_FAMILY, values.fontFamily),
-        setSetting(SETTING_KEYS.INVOICE_HEADER_STYLE, values.headerStyle),
-      ]);
-      toast.success("Template settings saved");
-    } catch {
-      toast.error("Failed to save settings");
-    }
-    setSaving(false);
-  };
+  const currentPresetId = templatePresets.find(
+    (p) =>
+      p.primaryColor === values.primaryColor &&
+      p.fontFamily === values.fontFamily &&
+      p.headerStyle === values.headerStyle
+  )?.id;
 
   const applyPreset = (presetId: string) => {
     const preset = templatePresets.find((p) => p.id === presetId);
@@ -174,25 +175,8 @@ export function TemplateSettings({
     }
   };
 
-  const currentPresetId = templatePresets.find(
-    (p) =>
-      p.primaryColor === values.primaryColor &&
-      p.fontFamily === values.fontFamily &&
-      p.headerStyle === values.headerStyle
-  )?.id;
-
   return (
-    <div className="space-y-6">
-      <ReadOnlyBanner />
-      <div>
-        <h2 className="text-lg font-semibold">Invoice Template</h2>
-        <p className="text-sm text-muted-foreground">
-          Choose a template preset or customize the appearance of your PDF invoices and quotes.
-        </p>
-      </div>
-
-      <ReadOnlyWrapper>
-
+    <>
       {/* Template Gallery */}
       <Card className="border-0 shadow-sm">
         <CardHeader>
@@ -354,15 +338,14 @@ export function TemplateSettings({
                 </SelectContent>
               </Select>
             </div>
-
           </CardContent>
         </Card>
       </div>
 
-      {/* Invoice Preview */}
+      {/* Preview */}
       <Card className="border-0 shadow-sm">
         <CardHeader>
-          <CardTitle className="text-base">Invoice Preview</CardTitle>
+          <CardTitle className="text-base">{documentLabel} Preview</CardTitle>
         </CardHeader>
         <CardContent>
           <div
@@ -373,13 +356,14 @@ export function TemplateSettings({
               values={values}
               headerStyle={values.headerStyle}
               fontFamily={values.fontFamily}
+              documentLabel={documentLabel === "Quotation" ? "QUOTE" : "INVOICE"}
             />
 
             {/* Bill To / Vehicle */}
             <div className="my-4 grid grid-cols-2 gap-4">
               <div>
                 <p className="mb-1 text-[10px] font-semibold uppercase tracking-wider" style={{ color: values.primaryColor }}>
-                  Bill To
+                  {billToLabel}
                 </p>
                 <p className="text-sm font-medium">John Smith</p>
                 <p className="text-xs text-gray-500">john@example.com</p>
@@ -462,14 +446,106 @@ export function TemplateSettings({
           </div>
         </CardContent>
       </Card>
+    </>
+  );
+}
 
+export function TemplateSettings({
+  initialInvoiceValues,
+  initialQuoteValues,
+}: {
+  initialInvoiceValues: TemplateValues;
+  initialQuoteValues: TemplateValues;
+}) {
+  const [tab, setTab] = useState<TabType>("invoice");
+  const [saving, setSaving] = useState(false);
+  const [invoiceValues, setInvoiceValues] = useState(initialInvoiceValues);
+  const [quoteValues, setQuoteValues] = useState(initialQuoteValues);
+
+  const handleSave = async () => {
+    setSaving(true);
+    try {
+      if (tab === "invoice") {
+        await Promise.all([
+          setSetting(SETTING_KEYS.INVOICE_PRIMARY_COLOR, invoiceValues.primaryColor),
+          setSetting(SETTING_KEYS.INVOICE_FONT_FAMILY, invoiceValues.fontFamily),
+          setSetting(SETTING_KEYS.INVOICE_HEADER_STYLE, invoiceValues.headerStyle),
+        ]);
+      } else {
+        await Promise.all([
+          setSetting(SETTING_KEYS.QUOTE_PRIMARY_COLOR, quoteValues.primaryColor),
+          setSetting(SETTING_KEYS.QUOTE_FONT_FAMILY, quoteValues.fontFamily),
+          setSetting(SETTING_KEYS.QUOTE_HEADER_STYLE, quoteValues.headerStyle),
+        ]);
+      }
+      toast.success(`${tab === "invoice" ? "Invoice" : "Quotation"} template settings saved`);
+    } catch {
+      toast.error("Failed to save settings");
+    }
+    setSaving(false);
+  };
+
+  return (
+    <div className="space-y-6">
+      <ReadOnlyBanner />
+      <div>
+        <h2 className="text-lg font-semibold">Templates</h2>
+        <p className="text-sm text-muted-foreground">
+          Customize the appearance of your PDF invoices and quotes.
+        </p>
+      </div>
+
+      {/* Tab Buttons */}
+      <div className="flex gap-1 rounded-lg border bg-muted p-1">
+        <button
+          type="button"
+          onClick={() => setTab("invoice")}
+          className={cn(
+            "flex-1 rounded-md px-4 py-2 text-sm font-medium transition-colors",
+            tab === "invoice"
+              ? "bg-background text-foreground shadow-sm"
+              : "text-muted-foreground hover:text-foreground"
+          )}
+        >
+          Invoice
+        </button>
+        <button
+          type="button"
+          onClick={() => setTab("quotation")}
+          className={cn(
+            "flex-1 rounded-md px-4 py-2 text-sm font-medium transition-colors",
+            tab === "quotation"
+              ? "bg-background text-foreground shadow-sm"
+              : "text-muted-foreground hover:text-foreground"
+          )}
+        >
+          Quotation
+        </button>
+      </div>
+
+      <ReadOnlyWrapper>
+        {tab === "invoice" ? (
+          <TemplateTab
+            values={invoiceValues}
+            setValues={setInvoiceValues}
+            documentLabel="Invoice"
+            billToLabel="Bill To"
+          />
+        ) : (
+          <TemplateTab
+            values={quoteValues}
+            setValues={setQuoteValues}
+            documentLabel="Quotation"
+            billToLabel="Prepared For"
+          />
+        )}
       </ReadOnlyWrapper>
 
       <SaveButton>
         <div className="flex justify-end">
           <Button onClick={handleSave} disabled={saving}>
             {saving && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
-            Save Template Settings
+            Save {tab === "invoice" ? "Invoice" : "Quotation"} Template
           </Button>
         </div>
       </SaveButton>

+ 9 - 0
src/app/(public)/share/quote/[orgId]/[token]/page.tsx

@@ -60,6 +60,10 @@ export default async function PublicQuotePage({
             "workshop.currencyCode",
             "workshop.dateFormat",
             "workshop.timezone",
+            "quote.primaryColor",
+            "quote.headerStyle",
+            "invoice.primaryColor",
+            "invoice.headerStyle",
           ],
         },
       },
@@ -92,6 +96,9 @@ export default async function PublicQuotePage({
     else logoUrl = rawLogoUrl;
   }
 
+  const primaryColor = settingsMap["quote.primaryColor"] || settingsMap["invoice.primaryColor"] || "#d97706";
+  const headerStyle = settingsMap["quote.headerStyle"] || settingsMap["invoice.headerStyle"] || "standard";
+
   return (
     <QuoteView
       quote={quote}
@@ -103,6 +110,8 @@ export default async function PublicQuotePage({
       showTorqvoiceBranding={!features.brandingRemoved}
       dateFormat={settingsMap["workshop.dateFormat"] || undefined}
       timezone={settingsMap["workshop.timezone"] || undefined}
+      primaryColor={primaryColor}
+      headerStyle={headerStyle}
     />
   );
 }

+ 21 - 18
src/app/(public)/share/quote/[orgId]/[token]/quote-view.tsx

@@ -69,6 +69,8 @@ export function QuoteView({
   showTorqvoiceBranding,
   dateFormat,
   timezone,
+  primaryColor = "#d97706",
+  headerStyle = "standard",
 }: {
   quote: QuoteRecord;
   workshop: { name: string; address: string; phone: string; email: string };
@@ -79,6 +81,8 @@ export function QuoteView({
   showTorqvoiceBranding?: boolean;
   dateFormat?: string;
   timezone?: string;
+  primaryColor?: string;
+  headerStyle?: string;
 }) {
   const [downloading, setDownloading] = useState(false);
 
@@ -114,7 +118,8 @@ export function QuoteView({
         <button
           onClick={handleDownloadPDF}
           disabled={downloading}
-          className="inline-flex items-center gap-2 rounded-lg bg-amber-600 px-4 py-2 text-sm font-medium text-white hover:bg-amber-700 disabled:opacity-50"
+          className="inline-flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium text-white disabled:opacity-50"
+          style={{ backgroundColor: primaryColor }}
         >
           {downloading ? <Loader2 className="h-4 w-4 animate-spin" /> : <Download className="h-4 w-4" />}
           Download PDF
@@ -123,16 +128,14 @@ export function QuoteView({
 
       <div className="rounded-xl border bg-white p-6 shadow-sm sm:p-8 dark:bg-gray-900">
         {/* Header */}
-        <div className="flex flex-col gap-4 border-b-2 border-amber-500 pb-6 sm:flex-row sm:items-start sm:justify-between">
+        <div className="flex flex-col gap-4 border-b-2 pb-6 sm:flex-row sm:items-start sm:justify-between" style={{ borderColor: primaryColor }}>
           <div>
-            {logoUrl && (
-              <img
-                src={logoUrl}
-                alt={shopName}
-                className="mb-2 max-h-16 max-w-[180px] object-contain object-left"
-              />
-            )}
-            <h2 className="text-xl font-bold text-amber-600 sm:text-2xl">{shopName}</h2>
+            <img
+              src={logoUrl || "/torqvoice_app_logo.png"}
+              alt={shopName}
+              className="mb-2 max-h-16 max-w-[180px] object-contain object-left"
+            />
+            <h2 className="text-xl font-bold sm:text-2xl" style={{ color: primaryColor }}>{shopName}</h2>
             {workshop.address && <p className="mt-1 text-sm text-gray-500">{workshop.address}</p>}
             {workshop.phone && <p className="text-sm text-gray-500">Tel: {workshop.phone}</p>}
             {workshop.email && <p className="text-sm text-gray-500">{workshop.email}</p>}
@@ -166,7 +169,7 @@ export function QuoteView({
         <div className="mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3">
           {quote.customer && (
             <div className="rounded-lg bg-gray-50 p-4 dark:bg-gray-800">
-              <p className="mb-1 text-xs font-bold uppercase text-amber-600">Prepared For</p>
+              <p className="mb-1 text-xs font-bold uppercase" style={{ color: primaryColor }}>Prepared For</p>
               <p className="font-semibold">{quote.customer.name}</p>
               {quote.customer.company && <p className="text-sm">{quote.customer.company}</p>}
               {quote.customer.address && <p className="text-sm text-gray-500">{quote.customer.address}</p>}
@@ -176,14 +179,14 @@ export function QuoteView({
           )}
           {quote.vehicle && (
             <div className="rounded-lg bg-gray-50 p-4 dark:bg-gray-800">
-              <p className="mb-1 text-xs font-bold uppercase text-amber-600">Vehicle</p>
+              <p className="mb-1 text-xs font-bold uppercase" style={{ color: primaryColor }}>Vehicle</p>
               <p className="font-semibold">{quote.vehicle.year} {quote.vehicle.make} {quote.vehicle.model}</p>
               {quote.vehicle.vin && <p className="text-sm text-gray-500">VIN: {quote.vehicle.vin}</p>}
               {quote.vehicle.licensePlate && <p className="text-sm text-gray-500">Plate: {quote.vehicle.licensePlate}</p>}
             </div>
           )}
           <div className="rounded-lg bg-gray-50 p-4 dark:bg-gray-800">
-            <p className="mb-1 text-xs font-bold uppercase text-amber-600">Quote Details</p>
+            <p className="mb-1 text-xs font-bold uppercase" style={{ color: primaryColor }}>Quote Details</p>
             <p className="font-semibold">{quote.title}</p>
           </div>
         </div>
@@ -191,7 +194,7 @@ export function QuoteView({
         {/* Description */}
         {quote.description && (
           <div className="mt-6 rounded-lg bg-gray-50 p-4 dark:bg-gray-800">
-            <p className="mb-1 text-xs font-bold uppercase text-amber-600">Description</p>
+            <p className="mb-1 text-xs font-bold uppercase" style={{ color: primaryColor }}>Description</p>
             <div
               className="notes-content text-sm text-gray-600 dark:text-gray-400"
               dangerouslySetInnerHTML={{ __html: sanitizeHtml(quote.description) }}
@@ -206,7 +209,7 @@ export function QuoteView({
             <div className="-mx-6 overflow-x-auto px-6 sm:mx-0 sm:px-0">
               <table className="w-full min-w-125 text-sm">
                 <thead>
-                  <tr className="border-b bg-amber-50 text-left dark:bg-amber-900/20">
+                  <tr className="border-b text-left" style={{ backgroundColor: `${primaryColor}15` }}>
                     <th className="p-2 font-medium">Part #</th>
                     <th className="p-2 font-medium">Description</th>
                     <th className="p-2 text-right font-medium">Qty</th>
@@ -237,7 +240,7 @@ export function QuoteView({
             <div className="-mx-6 overflow-x-auto px-6 sm:mx-0 sm:px-0">
               <table className="w-full min-w-112.5 text-sm">
                 <thead>
-                  <tr className="border-b bg-amber-50 text-left dark:bg-amber-900/20">
+                  <tr className="border-b text-left" style={{ backgroundColor: `${primaryColor}15` }}>
                     <th className="p-2 font-medium">Description</th>
                     <th className="p-2 text-right font-medium">Hours</th>
                     <th className="p-2 text-right font-medium">Rate</th>
@@ -281,10 +284,10 @@ export function QuoteView({
               <span>{formatCurrency(quote.taxAmount, currencyCode)}</span>
             </div>
           )}
-          <div className="border-t border-amber-500 pt-2">
+          <div className="border-t pt-2" style={{ borderColor: primaryColor }}>
             <div className="flex justify-between text-lg font-bold">
               <span>Total</span>
-              <span className="text-amber-600">{formatCurrency(quote.totalAmount, currencyCode)}</span>
+              <span style={{ color: primaryColor }}>{formatCurrency(quote.totalAmount, currencyCode)}</span>
             </div>
           </div>
         </div>

+ 17 - 5
src/app/api/files/public/[token]/[...path]/route.ts

@@ -41,17 +41,29 @@ export async function GET(
     return NextResponse.json({ error: "Invalid filename" }, { status: 400 });
   }
 
-  // Validate token and get org
-  const record = await db.serviceRecord.findUnique({
+  // Validate token and get org (check both invoice and quote tokens)
+  let orgId: string | undefined;
+
+  const serviceRecord = await db.serviceRecord.findUnique({
     where: { publicToken: token },
     select: { vehicle: { select: { organizationId: true } } },
   });
 
-  if (!record || !record.vehicle.organizationId) {
-    return NextResponse.json({ error: "Not found" }, { status: 404 });
+  if (serviceRecord?.vehicle.organizationId) {
+    orgId = serviceRecord.vehicle.organizationId;
+  } else {
+    const quote = await db.quote.findFirst({
+      where: { publicToken: token },
+      select: { organizationId: true },
+    });
+    if (quote?.organizationId) {
+      orgId = quote.organizationId;
+    }
   }
 
-  const orgId = record.vehicle.organizationId;
+  if (!orgId) {
+    return NextResponse.json({ error: "Not found" }, { status: 404 });
+  }
   const filePath = path.join(process.cwd(), "data", "uploads", orgId, category, filename);
 
   try {

+ 3 - 3
src/app/api/quotes/[id]/pdf/route.ts

@@ -68,11 +68,11 @@ export async function GET(
     }
 
     const template = {
-      primaryColor: settingsMap["invoice.primaryColor"] || "#d97706",
-      fontFamily: settingsMap["invoice.fontFamily"] || "Helvetica",
+      primaryColor: settingsMap["quote.primaryColor"] || settingsMap["invoice.primaryColor"] || "#d97706",
+      fontFamily: settingsMap["quote.fontFamily"] || settingsMap["invoice.fontFamily"] || "Helvetica",
       showLogo: settingsMap["invoice.showLogo"] !== "false",
       showCompanyName: settingsMap["invoice.showCompanyName"] !== "false",
-      headerStyle: settingsMap["invoice.headerStyle"] || "standard",
+      headerStyle: settingsMap["quote.headerStyle"] || settingsMap["invoice.headerStyle"] || "standard",
     };
 
     const element = React.createElement(QuotePDF, {

+ 3 - 3
src/app/api/share/quote/[orgId]/[token]/pdf/route.ts

@@ -72,11 +72,11 @@ export async function GET(
     }
 
     const template = {
-      primaryColor: settingsMap["invoice.primaryColor"] || "#d97706",
-      fontFamily: settingsMap["invoice.fontFamily"] || "Helvetica",
+      primaryColor: settingsMap["quote.primaryColor"] || settingsMap["invoice.primaryColor"] || "#d97706",
+      fontFamily: settingsMap["quote.fontFamily"] || settingsMap["invoice.fontFamily"] || "Helvetica",
       showLogo: settingsMap["invoice.showLogo"] !== "false",
       showCompanyName: settingsMap["invoice.showCompanyName"] !== "false",
-      headerStyle: settingsMap["invoice.headerStyle"] || "standard",
+      headerStyle: settingsMap["quote.headerStyle"] || settingsMap["invoice.headerStyle"] || "standard",
     };
 
     const element = React.createElement(QuotePDF, {

+ 1 - 1
src/components/page-header.tsx

@@ -56,7 +56,7 @@ const breadcrumbMap: Record<string, BreadcrumbSegment[]> = {
   '/settings/company': [{ label: 'Settings', href: '/settings' }, { label: 'Company' }],
   '/settings/account': [{ label: 'Settings', href: '/settings' }, { label: 'Account' }],
   '/settings/custom-fields': [{ label: 'Settings', href: '/settings' }, { label: 'Custom Fields' }],
-  '/settings/invoice-template': [{ label: 'Settings', href: '/settings' }, { label: 'Templates' }],
+  '/settings/templates': [{ label: 'Settings', href: '/settings' }, { label: 'Templates' }],
   '/settings/team': [{ label: 'Settings', href: '/settings' }, { label: 'Team' }],
   '/settings/invoice': [{ label: 'Settings', href: '/settings' }, { label: 'Invoice' }],
   '/settings/payment': [{ label: 'Settings', href: '/settings' }, { label: 'Payment' }],

+ 1 - 1
src/features/search/Components/SearchCommand.tsx

@@ -59,7 +59,7 @@ const SEARCHABLE_SETTINGS = [
   { label: "Account", description: "Account, profile, password", href: "/settings/account", keywords: ["account", "profile", "password", "email", "2fa"] },
   { label: "Team", description: "Team members and roles", href: "/settings/team", keywords: ["team", "members", "roles", "invite"] },
   { label: "Invoice", description: "Invoice layout and prefix", href: "/settings/invoice", keywords: ["invoice", "layout", "prefix", "footer", "due"] },
-  { label: "Templates", description: "Invoice template styling", href: "/settings/invoice-template", keywords: ["template", "styling", "colors", "font", "header"] },
+  { label: "Templates", description: "Invoice & quote template styling", href: "/settings/templates", keywords: ["template", "styling", "colors", "font", "header", "quote"] },
   { label: "Payment", description: "Payment and bank settings", href: "/settings/payment", keywords: ["payment", "bank", "vipps", "stripe", "terms"] },
   { label: "Currency", description: "Currency, tax, and VAT", href: "/settings/currency", keywords: ["currency", "tax", "vat", "unit"] },
   { label: "Custom Fields", description: "Custom fields configuration", href: "/settings/custom-fields", keywords: ["custom fields", "fields"] },

+ 3 - 0
src/features/settings/Schema/settingsSchema.ts

@@ -54,6 +54,9 @@ export const SETTING_KEYS = {
   DATE_FORMAT: "workshop.dateFormat",
   TIME_FORMAT: "workshop.timeFormat",
   TIMEZONE: "workshop.timezone",
+  QUOTE_PRIMARY_COLOR: "quote.primaryColor",
+  QUOTE_FONT_FAMILY: "quote.fontFamily",
+  QUOTE_HEADER_STYLE: "quote.headerStyle",
 } as const;
 
 export type SettingKey = (typeof SETTING_KEYS)[keyof typeof SETTING_KEYS];