diff --git a/server.js b/server.js index 45122dd..a118003 100644 --- a/server.js +++ b/server.js @@ -1403,7 +1403,7 @@ app.get('/api/invoices/:id/pdf', async (req, res) => { html = html .replace('{{LOGO_HTML}}', logoHTML) - .replace('{{CUSTOMER_NAME}}', invoice.customer_name || '') + .replace('{{CUSTOMER_NAME}}', invoice.bill_to_name || invoice.customer_name || '') .replace('{{CUSTOMER_STREET}}', streetBlock) .replace('{{CUSTOMER_CITY}}', invoice.city || '') .replace('{{CUSTOMER_STATE}}', invoice.state || '') @@ -1646,7 +1646,7 @@ app.get('/api/invoices/:id/html', async (req, res) => { html = html .replace('{{LOGO_HTML}}', logoHTML) - .replace('{{CUSTOMER_NAME}}', invoice.customer_name || '') + .replace('{{CUSTOMER_NAME}}', invoice.bill_to_name || invoice.customer_name || '') .replace('{{CUSTOMER_STREET}}', streetBlock) .replace('{{CUSTOMER_CITY}}', invoice.city || '') .replace('{{CUSTOMER_STATE}}', invoice.state || '')