From 96ed8c714119c8946288f46760d5005bb04ba398 Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Wed, 1 Apr 2026 17:06:31 -0500 Subject: [PATCH] fix for Downpayment label + fix for invoice modal --- public/index.html | 5 ++++- src/services/pdf-service.js | 13 +++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index 197f552..b052568 100644 --- a/public/index.html +++ b/public/index.html @@ -437,7 +437,10 @@ + Add Item -
+
+
diff --git a/src/services/pdf-service.js b/src/services/pdf-service.js index b04d086..ae23dd2 100644 --- a/src/services/pdf-service.js +++ b/src/services/pdf-service.js @@ -118,17 +118,26 @@ function renderInvoiceItems(items, invoice = null) { $${formatMoney(total)} `; + // Add downpayment/balance if partial // Add downpayment/balance if partial if (amountPaid > 0) { + const isFullyPaid = balanceDue <= 0.01; // allow for rounding + const paymentLabel = isFullyPaid ? 'Payment:' : 'Downpayment:'; + itemsHTML += ` - Downpayment: + ${paymentLabel} -$${formatMoney(amountPaid)} - + `; + + // Only show BALANCE DUE row if there's actually a remaining balance + if (!isFullyPaid) { + itemsHTML += ` BALANCE DUE: $${formatMoney(balanceDue)} `; + } } // Thank you message