diff --git a/apps/Frontend/src/components/patients/patient-financial-modal.tsx b/apps/Frontend/src/components/patients/patient-financial-modal.tsx index 83f98af..42bd68c 100644 --- a/apps/Frontend/src/components/patients/patient-financial-modal.tsx +++ b/apps/Frontend/src/components/patients/patient-financial-modal.tsx @@ -181,6 +181,7 @@ export function PatientFinancialsModal({ Type Date Procedures Codes + Tooth Number Billed Paid Adjusted @@ -192,14 +193,14 @@ export function PatientFinancialsModal({ {loading ? ( - + ) : rows.length === 0 ? ( No records found. @@ -212,12 +213,26 @@ export function PatientFinancialsModal({ const adjusted = Number(r.total_adjusted ?? 0); const totalDue = Number(r.total_due ?? 0); + const serviceLines = r.service_lines || []; + const procedureCodes = - (r.service_lines || []) - .map((sl: any) => sl.procedureCode) - .filter(Boolean) - .join(", ") || - (r.linked_payment_id ? "No Codes Given" : "-"); + serviceLines.length > 0 + ? serviceLines + .map((sl: any) => sl.procedureCode) + .filter(Boolean) + .join(", ") + : r.linked_payment_id + ? "No Codes Given" + : "-"; + + const toothNumbers = + serviceLines.length > 0 + ? serviceLines + .map((sl: any) => + sl.toothNumber ? String(sl.toothNumber) : "-" + ) + .join(", ") + : "-"; return ( {procedureCodes} + + {toothNumbers} + {billed.toFixed(2)}