diff --git a/server.js b/server.js index 73e20ae..79f38b9 100644 --- a/server.js +++ b/server.js @@ -187,7 +187,9 @@ app.get('/api/quotes/next-number', async (req, res) => { app.get('/api/quotes/:id', async (req, res) => { try { const quoteResult = await pool.query( - `SELECT q.*, c.* + `SELECT q.id, q.quote_number, q.customer_id, q.quote_date, q.tax_exempt, + q.tax_rate, q.subtotal, q.tax_amount, q.total, q.has_tbd, q.tbd_note, + c.name as customer_name, c.street, c.city, c.state, c.zip_code, c.account_number FROM quotes q LEFT JOIN customers c ON q.customer_id = c.id WHERE q.id = $1`, @@ -469,7 +471,7 @@ app.post('/api/quotes/:id/pdf', async (req, res) => { margin: { top: '0.5in', right: '0.5in', - bottom: '0.5in', + bottom: '0.3in', left: '0.5in' } }); @@ -591,11 +593,13 @@ function generateQuoteHTML(quote) { .container { max-width: 8.5in; - height:11in; margin: 0 auto; background-color: white; + padding: 0; + } + + .content-wrapper { padding: 40px; - box-shadow: 0 0 10px rgba(0,0,0,0.1); } .header { @@ -746,6 +750,7 @@ function generateQuoteHTML(quote) {
+
${logoHTML} @@ -811,7 +816,8 @@ function generateQuoteHTML(quote) { ${tbdNote} -
+
+
`; }