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) => { app.get('/api/quotes/:id', async (req, res) => {
try { try {
const quoteResult = await pool.query( 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 FROM quotes q
LEFT JOIN customers c ON q.customer_id = c.id LEFT JOIN customers c ON q.customer_id = c.id
WHERE q.id = $1`, WHERE q.id = $1`,
@ -469,7 +471,7 @@ app.post('/api/quotes/:id/pdf', async (req, res) => {
margin: { margin: {
top: '0.5in', top: '0.5in',
right: '0.5in', right: '0.5in',
bottom: '0.5in', bottom: '0.3in',
left: '0.5in' left: '0.5in'
} }
}); });
@ -591,11 +593,13 @@ function generateQuoteHTML(quote) {
.container { .container {
max-width: 8.5in; max-width: 8.5in;
height:11in;
margin: 0 auto; margin: 0 auto;
background-color: white; background-color: white;
padding: 0;
}
.content-wrapper {
padding: 40px; padding: 40px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
} }
.header { .header {
@ -746,6 +750,7 @@ function generateQuoteHTML(quote) {
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<div class="content-wrapper">
<div class="header"> <div class="header">
<div class="company-info"> <div class="company-info">
${logoHTML} ${logoHTML}
@ -811,7 +816,8 @@ function generateQuoteHTML(quote) {
</tbody> </tbody>
</table> </table>
${tbdNote} ${tbdNote}
</div> </div><!-- content-wrapper -->
</div><!-- container -->
</body> </body>
</html>`; </html>`;
} }