This commit is contained in:
natib21
2026-07-04 00:37:36 +00:00
parent 4994d14002
commit 6bf7371716
2 changed files with 14 additions and 4 deletions

View File

@@ -57,7 +57,8 @@ export class FirstMileInvoiceService {
return null;
}
const totalAmount = record.remainingPayment || 0;
// numeric columns come back as strings — coerce before the finite/>0 check.
const totalAmount = Number(record.remainingPayment) || 0;
if (!Number.isFinite(totalAmount) || totalAmount <= 0) {
this.logger.warn(
`Skipping invoice for first-mile record ${record.id}: no remaining payment.`,