From 053f01c5ec18b87b9ac8de6ac9c6ca29cf4995f1 Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Wed, 25 Feb 2026 10:22:42 -0600 Subject: [PATCH] korrektur --- public/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/app.js b/public/app.js index 6790cf7..4454b5b 100644 --- a/public/app.js +++ b/public/app.js @@ -247,7 +247,8 @@ async function openQuoteModal(quoteId = null) { const data = await response.json(); // Set customer in Alpine component - const customer = customers.find(c => c.id === data.quote.customer_id); + const allCust = window.getCustomers ? window.getCustomers() : customers; + const customer = allCust.find(c => c.id === data.quote.customer_id); if (customer) { // Find the Alpine component and update it const customerInput = document.querySelector('#quote-modal input[placeholder="Search customer..."]'); @@ -652,7 +653,8 @@ async function openInvoiceModal(invoiceId = null) { const data = await response.json(); // Set customer in Alpine component - const customer = customers.find(c => c.id === data.invoice.customer_id); + const allCust = window.getCustomers ? window.getCustomers() : customers; + const customer = allCust.find(c => c.id === data.invoice.customer_id); if (customer) { const customerInput = document.querySelector('#invoice-modal input[placeholder="Search customer..."]'); if (customerInput) {