korrektur

This commit is contained in:
Andreas Knuth 2026-02-25 10:22:42 -06:00
parent cc41ed6ec9
commit 053f01c5ec
1 changed files with 4 additions and 2 deletions

View File

@ -247,7 +247,8 @@ async function openQuoteModal(quoteId = null) {
const data = await response.json(); const data = await response.json();
// Set customer in Alpine component // 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) { if (customer) {
// Find the Alpine component and update it // Find the Alpine component and update it
const customerInput = document.querySelector('#quote-modal input[placeholder="Search customer..."]'); const customerInput = document.querySelector('#quote-modal input[placeholder="Search customer..."]');
@ -652,7 +653,8 @@ async function openInvoiceModal(invoiceId = null) {
const data = await response.json(); const data = await response.json();
// Set customer in Alpine component // 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) { if (customer) {
const customerInput = document.querySelector('#invoice-modal input[placeholder="Search customer..."]'); const customerInput = document.querySelector('#invoice-modal input[placeholder="Search customer..."]');
if (customerInput) { if (customerInput) {