load invoice templates from JSON files via backend

Templates are now loaded dynamically from data/templates/*.json
via the get_invoice_templates Tauri command instead of being
hardcoded in TypeScript. Preview and PDF renderer switch on
template.layout instead of template.id, allowing custom templates
to reuse built-in layouts with different colors.
This commit is contained in:
Your Name
2026-02-18 15:17:54 +02:00
parent fd2b24ebc2
commit f78bfa81ec
4 changed files with 51 additions and 327 deletions

View File

@@ -1825,7 +1825,7 @@ export function renderInvoicePdf(
items: InvoiceItem[],
businessInfo: BusinessInfo,
): jsPDF {
switch (config.id) {
switch (config.layout) {
case 'clean': return renderClean(config, invoice, client, items, businessInfo)
case 'professional': return renderProfessional(config, invoice, client, items, businessInfo)
case 'bold': return renderBold(config, invoice, client, items, businessInfo)