fix(tracker): update payment progress and bills service (batch 0.37.1)

This commit is contained in:
null 2026-06-08 11:54:47 -05:00
parent ce596c6dc2
commit 80ef1208ae
2 changed files with 5 additions and 4 deletions

View File

@ -11,7 +11,7 @@ export function PaymentProgress({ row, threshold, onOpen, onMarkFullAmount, comp
const amountLabel = (() => { const amountLabel = (() => {
if (summary.paid === 0) return '—'; 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`; if (summary.remaining > 0) return `${fmt(summary.paidTowardDue)} paid`;
return fmt(summary.paidTowardDue); return fmt(summary.paidTowardDue);
})(); })();

View File

@ -247,11 +247,12 @@ function validateBillData(data, existingBill = null) {
const validCycleTypes = getValidCycleTypes(); const validCycleTypes = getValidCycleTypes();
// name is required // name is required; fall back to existing value on partial updates
if (!data.name) { const nameVal = data.name !== undefined ? data.name : existingBill?.name;
if (!nameVal) {
errors.push({ field: 'name', message: 'name is required' }); errors.push({ field: 'name', message: 'name is required' });
} }
normalized.name = data.name || null; normalized.name = nameVal || null;
// due_day is required // due_day is required
if (data.due_day === undefined || data.due_day === null) { if (data.due_day === undefined || data.due_day === null) {