fix(tracker): update payment progress and bills service (batch 0.37.1)
This commit is contained in:
parent
ce596c6dc2
commit
80ef1208ae
|
|
@ -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);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue