fix: include invoice id in unremitted payments query
The invoice select was missing `id`, causing InvoiceSummary.fromJson to crash on null — silently swallowing the error and showing an empty unremitted list in the mobile app.
This commit is contained in:
@@ -169,7 +169,7 @@ export class PaymentService {
|
|||||||
where: { tenantId, collectedById: collectorId, id: { notIn: remittedIds.length > 0 ? remittedIds : ['none'] } },
|
where: { tenantId, collectedById: collectorId, id: { notIn: remittedIds.length > 0 ? remittedIds : ['none'] } },
|
||||||
include: {
|
include: {
|
||||||
client: { select: { firstName: true, lastName: true, accountNumber: true } },
|
client: { select: { firstName: true, lastName: true, accountNumber: true } },
|
||||||
invoice: { select: { number: true } },
|
invoice: { select: { id: true, number: true } },
|
||||||
},
|
},
|
||||||
orderBy: { createdAt: 'desc' },
|
orderBy: { createdAt: 'desc' },
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user