diff --git a/client/components/tracker/PaymentProgress.jsx b/client/components/tracker/PaymentProgress.jsx index 53bea27..0ee7236 100644 --- a/client/components/tracker/PaymentProgress.jsx +++ b/client/components/tracker/PaymentProgress.jsx @@ -11,7 +11,7 @@ export function PaymentProgress({ row, threshold, onOpen, onMarkFullAmount, comp const amountLabel = (() => { if (summary.paid === 0) return '—'; - if (summary.overpaid > 0) return `${fmt(summary.paidTowardDue)} · overpaid`; + if (summary.overpaid > 0) return `${fmt(summary.paid)} · overpaid`; if (summary.remaining > 0) return `${fmt(summary.paidTowardDue)} paid`; return fmt(summary.paidTowardDue); })(); diff --git a/services/billsService.js b/services/billsService.js index 2e18431..31fa0a5 100644 --- a/services/billsService.js +++ b/services/billsService.js @@ -247,11 +247,12 @@ function validateBillData(data, existingBill = null) { const validCycleTypes = getValidCycleTypes(); - // name is required - if (!data.name) { + // name is required; fall back to existing value on partial updates + const nameVal = data.name !== undefined ? data.name : existingBill?.name; + if (!nameVal) { errors.push({ field: 'name', message: 'name is required' }); } - normalized.name = data.name || null; + normalized.name = nameVal || null; // due_day is required if (data.due_day === undefined || data.due_day === null) {