Kulcare Docs
Test plansClinic app

Test Plan: Reports

Module: Clinic App — Patient Reports & Revenue Analytics
Code Audit Date: 2026-06-19
URLs: Patient Reports /cms/reports/patients | Revenue /cms/reports/revenue-v2
Status: 🔄 In Progress


SECTION 1: Patient Reports (✅ Complete — 18 tested)

#Test CaseResultBug
REP-01Load page✅
REP-02Loading state✅
REP-03Error state✅
REP-04Stats cards✅
REP-10Search by name✅
REP-10bSearch full name with space❌#31
REP-11Gender filter✅
REP-12Birth date range✅
REP-13Age range filter✅
REP-14Category filter❌No data
REP-15Diagnoses filter❌No data
REP-16Medicines filter❌No data
REP-17Appointment type filter✅
REP-18Clear all filters✅
REP-20Pagination✅
REP-21Upload patient file✅
REP-22Export report❌#37
REP-24Click row → detail❌#56

SECTION 2: Revenue — Summary Tab (✅ Complete)

#Test CaseResultBug
REV-01Earnings cards (total_revenue, received, pending)❌#57
REV-02Visit type donut chart❌#59
REV-03Payment method donut chart❌#57
REV-04Service type donut chart⚠️Case-sensitive (known)
REV-05Revenue trend line chart✅
REV-06Loading state✅
REV-07Error state✅
REV-08Empty state✅

SECTION 3: Revenue — Services Tab

Component: ServicesTabV2.tsx
API: useAllServices({ facility_id, start_time, end_time, ...filters })

3.1 Filters

#Test CasePriorityExpectedStatus
SV-01Search by service nameP0Type service name → debounced 300ms → filteredBug #61 ⚠️
SV-02Search by patient nameP0Type patient name → 500 error (API bug)Bug #62 ❌
SV-03Clear searchP0Click X → resets✅ PASS
SV-04Filter by billing status — AllP0All (billed + unbilled)✅ PASS
SV-05Filter by billing status — BilledP1Only invoiced✅ PASS
SV-06Filter by billing status — UnbilledP1Only non-invoiced✅ PASS
SV-07Filter by payment status — AllP1Default✅ PASS
SV-08Filter by payment status — PaidP1Only paid✅ PASS
SV-09Filter by payment status — UnpaidP1Only unpaid✅ PASS
SV-10Filter by practitionerP0Select doctor → filtered✅ PASS
SV-11Combined filtersP1Practitioner + billing + search✅ PASS

3.2 Table Display

#Test CasePriorityExpectedStatus
SV-15Columns visibleP0Service name, patient, practitioner, date, qty, price, discount, total, status⚠️ Patient = "NA" (Bug #62)
SV-16Amount formattingP1Currency formatted (₹), correct total✅ PASS
SV-17Date formattingP1Service date formatted✅ PASS
SV-18Data matches billing panelP0Add service in billing → appears with same values✅ PASS

3.3 Sort

Only date sort is available. Name + amount sort columns not implemented.

#Test CasePriorityExpectedStatus
SV-20Sort by dateP1Click date → asc/desc✅ PASS

3.4 Delete

#Test CasePriorityExpectedStatus
SV-25Delete — dialog opensP0Click trash → confirmation with reason⚠️ Modal shows {{patientName}} template (Bug #62)
SV-26Delete — confirmP0Enter reason → Confirm → removed, list refreshes✅ PASS
SV-27Delete — cancelP1Cancel → service stays✅ PASS
SV-28Delete — reason requiredP1Empty reason → error✅ PASS

3.5 Pagination

#Test CasePriorityExpectedStatus
SV-30Next/prev pageP1Navigate between pages✅ PASS
SV-31Page size changeP1Change per_page → refetch✅ PASS
SV-32Page reset on filter changeP1Change filter → page resets to 1✅ PASS

SECTION 4: Revenue — Payments Tab

Component: PaymentsTabV2.tsx
API: useAllPayments({ facility_id, start_time, end_time, ...filters })

4.1 Filters

#Test CasePriorityExpectedStatus
PV-01Search by patient nameP0Type name → debounced → filteredPending
PV-02Clear searchP0Click X → resetsPending
PV-03Filter by payment method — CashP0Select "Cash" → only cash paymentsPending
PV-04Filter by payment method — CardP0Select "Card" → only card paymentsPending
PV-05Filter by payment method — UPIP0Select "UPI" → only UPI paymentsPending
PV-06Filter by payment method — GatewayP1Select "Gateway" → shows gateway paymentsPending
PV-07Filter by statusP1Select status → filteredPending
PV-08Filter by practitionerP0Select doctor → that doctor's paymentsPending

4.2 Table Display

#Test CasePriorityExpectedStatus
PV-15Columns visibleP0Payment #, method (icon), amount, patient, practitioner, date, statusPending
PV-16Method iconsP1Cash=Banknote, Card=CreditCard, UPI=Smartphone, Bank=BuildingPending
PV-17Status badgeP1Completed/Pending/Cancelled with correct variant colorsPending
PV-18Data matches billing panelP0Add payment in billing → appears here with same valuesPending

4.3 Edit

#Test CasePriorityExpectedStatus
PV-20Edit — modal opensP0Click pencil → edit modal with pre-filled amount, method, date, doctorPending
PV-21Edit — change amountP0Change amount → Save → payment updatedPending
PV-22Edit — change methodP1Change method → Save → reflectedPending
PV-23Edit — cancelP0Open → Cancel → no changesPending

4.4 Cancel

#Test CasePriorityExpectedStatus
PV-25Cancel — dialog opensP0Click XCircle → confirmation with reasonPending
PV-26Cancel — confirmP0Enter reason → status changes to cancelledPending
PV-27Cancel — cancel dialogP1Open → Cancel → payment staysPending

4.5 Sort & Pagination

#Test CasePriorityExpectedStatus
PV-30Sort by dateP1Click date → asc/descPending
PV-31Sort by amountP1Click amount → low-high/high-lowPending
PV-32PaginationP1Next/prev, page sizePending

SECTION 5: Revenue — Bills Tab

Component: BillsTabV2.tsx
API: useAllInvoices({ facility_id, start_time, end_time, ...filters })

5.1 Filters

#Test CasePriorityExpectedStatus
BV-01Search by patient nameP0Type name → filteredPending
BV-02Clear searchP0ResetsPending
BV-03Filter by status — DraftP1"Draft" → only draft invoicesPending
BV-04Filter by status — PaidP1"Paid" → only paid invoicesPending
BV-05Filter by status — UnpaidP1"Unpaid" → only unpaidPending
BV-06Filter — Overdue onlyP1Toggle overdue → only overdue billsPending

5.2 Table Display

#Test CasePriorityExpectedStatus
BV-10Columns visibleP0Invoice #, patient, date, total amount, paid, balance due, status, overdue badgePending
BV-11Status badge colorsP1Draft=muted, Paid=success, Unpaid/Overdue=destructivePending
BV-12Balance due calculationP1Balance = total_amount - amount_paidPending
BV-13Data matches billing panelP0Generate bill in billing → appears herePending

5.3 Actions

#Test CasePriorityExpectedStatus
BV-15Download PDFP0Click download → PDF opens/downloadsPending
BV-16Send via emailP1Click mail → invoice emailed to patientPending
BV-17Cancel billP1Click XCircle → confirm → status cancelledPending
BV-18Print billP2Click printer → browser print dialogPending

5.4 Sort & Pagination

#Test CasePriorityExpectedStatus
BV-20Sort by invoice dateP1Click date → asc/descPending
BV-21Sort by invoice numberP1Click number → asc/descPending
BV-22PaginationP1Next/prev, page sizePending

SECTION 6: Revenue — Activity Tab

Component: ActivityLogsTabV2.tsx
API: useBillingActivityLogs({ facility_id, start_time, end_time, ...filters })

6.1 Filters

#Test CasePriorityExpectedStatus
AV-01SearchP1Type → filtered by description/entityPending
AV-02Filter by entity typeP1Select invoice/payment/service → filteredPending
AV-03Filter by actionP1Select created/updated/deleted/cancelled → filteredPending

6.2 Table Display

#Test CasePriorityExpectedStatus
AV-10Columns visibleP1Timestamp, user, action, entity type, entity ID, descriptionPending
AV-11Billing action appearsP0Add service/payment → log entry createdPending
AV-12Delete action appearsP1Delete service/payment → log entry createdPending
AV-13Cancel action appearsP1Cancel bill/payment → log entry createdPending

6.3 Sort & Pagination

#Test CasePriorityExpectedStatus
AV-15Sort by timestampP1Click → asc/descPending
AV-16Sort by actionP1Click → A-ZPending
AV-17PaginationP2Next/prev, page sizePending

SECTION 7: Revenue — Date Range & Cross-Tab

#Test CasePriorityExpectedStatus
DR-01Default — last monthP0Page opens with last month range✅ PASS
DR-02Change range — all tabs refetchP0Set new range → Services, Payments, Bills all updatePending
DR-03Preset — Last 7 daysP1Select preset → data scopedPending
DR-04Preset — Last 30 daysP1Select preset → data scopedPending
DR-05Preset — This monthP1Select → current month dataPending
DR-06Custom rangeP0Pick custom from/to → data scoped✅ PASS
DR-07Future dates blockedP1Cannot select future end datePending
DR-08Tab switch preserves rangeP0Set range → switch tabs → same rangePending
DR-09Export — revenue reportP0Click Export → email → report sentBug #60 ❌

SECTION 8: Cross-Flow Integration

#Test CasePriorityExpectedStatus
INT-01Full flow: Book → Bill → all tabsP0Book → add service → add payment → generate bill → verify Services/Payments/Bills tabs all show data correctlyPending
INT-02Edit in billing → reflects in revenueP1Edit service amount in billing panel → Services tab updated on refetchPending
INT-03Delete in billing → reflects in revenueP1Delete payment in billing → Payments tab reflectsPending
INT-04Revenue — facility scopedP0Billing in Clinic A → only in Clinic A revenuePending

🐛 Bugs Found

BugTestDescriptionSeverity
#31REP-10bFull name search with space → no results🟡 High
#37REP-22Export report — EFS permission denied🟡 High
#56REP-24Row click URL — patientId used twice🟡 High
#57REV-01Summary API — payments/earnings all zeros🟡 High
#59REV-02Visit type breakdown incorrect🟠 Medium
#60DR-09Revenue export — bill report API fails🟡 High

Test Summary

SectionTestsTestedPassedFailed
1. Patient Reports1818133
2. Summary Tab8843
3. Services Tab23000
4. Payments Tab22000
5. Bills Tab15000
6. Activity Tab9000
7. Date Range & Cross-Tab9111
8. Integration4000
Total10827187

Test Execution Order

  1. INT-01 — Full flow first (validates entire pipeline)
  2. Section 3: Services Tab (SV-01 → SV-32)
  3. Section 4: Payments Tab (PV-01 → PV-32)
  4. Section 5: Bills Tab (BV-01 → BV-22)
  5. Section 6: Activity Tab (AV-01 → AV-17)
  6. Section 7: Date Range & Cross-Tab (DR-01 → DR-09)
  7. Section 8: Integration (INT-01 → INT-04)

Status: 🔄 In Progress Last Updated: 2026-06-19

On this page