diff --git a/public/app.js b/public/app.js index 549eb25..8097309 100644 --- a/public/app.js +++ b/public/app.js @@ -1,5 +1,5 @@ // Global state -let customers = []; +let customers = []; // shared, updated by customer-view.js let quotes = []; let invoices = []; let currentQuoteId = null; @@ -204,50 +204,8 @@ async function uploadLogo() { } } -// Customer Management -async function loadCustomers() { - try { - const response = await fetch('/api/customers'); - customers = await response.json(); - renderCustomers(); - } catch (error) { - console.error('Error loading customers:', error); - alert('Error loading customers'); - } -} -// ===================================================== -// 1. renderCustomers() — ERSETZE komplett -// Zeigt QBO-Status und Export-Button in der Kundenliste -// ===================================================== -function renderCustomers() { - const tbody = document.getElementById('customers-list'); - tbody.innerHTML = customers.map(customer => { - const lines = [customer.line1, customer.line2, customer.line3, customer.line4].filter(Boolean); - const cityStateZip = [customer.city, customer.state, customer.zip_code].filter(Boolean).join(' '); - let fullAddress = lines.join(', '); - if (cityStateZip) fullAddress += (fullAddress ? ', ' : '') + cityStateZip; - - // QBO Status - const qboStatus = customer.qbo_id - ? `QBO ✓` - : ``; - - return ` -