This commit is contained in:
Andreas Knuth 2026-01-21 21:12:01 -06:00
parent 791a5e1268
commit fd8f5fa598
1 changed files with 11 additions and 5 deletions

View File

@ -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) {
</head>
<body>
<div class="container">
<div class="content-wrapper">
<div class="header">
<div class="company-info">
${logoHTML}
@ -811,7 +816,8 @@ function generateQuoteHTML(quote) {
</tbody>
</table>
${tbdNote}
</div>
</div><!-- content-wrapper -->
</div><!-- container -->
</body>
</html>`;
}