Test Cases: Invoice Listing & Filtering
/admin/invoices. The admin list filters are: Status = All / Outstanding / Overdue / Paid / Cancelled · Source = All / Dues / Donation / Event / Other · Period = All Time / YTD / 12 Months / 30 Days. (The old "Pending / Voided / Issued" labels are wrong.) The member page (/invoices, "My Invoices & Payments") tabs are Outstanding / Recently Paid / History. Admin list endpoint = GET /api/billing/invoices/tenant.
Module: Billing & Invoicing - Invoice Listing
Backend Endpoint: GET /api/billing/invoices, GET /api/billing/admin/invoices
Frontend Pages:
- Admin:
frontend/pwa-app/src/pages/AdminInvoicesPage.tsx - Member:
frontend/pwa-app/src/pages/InvoicesPage.tsx
Prerequisites
- Test invoices exist in database (see
00_MASTER_TEST_DATA.md). - Multiple invoice statuses present: PENDING, PAID, OVERDUE, VOIDED.
Test Data
| Invoice | Member | Status | Amount | Due Date |
|---|---|---|---|---|
| RCME-DUES-0001 | Maria Cruz | PAID | PHP 15,000 | Past |
| RCME-DUES-0002 | Antonio Dela Cruz | PENDING | PHP 15,000 | Future |
| RCME-DUES-0003 | Antonio Dela Cruz | OVERDUE | PHP 2,500 | Past |
| RCME-DUES-0004 | Isabella Ramos | VOIDED | PHP 15,000 | Past |
| RCME-DUES-0005 | Maria Cruz | PARTIALLY_PAID | PHP 3,500 | Future |
Test Cases
TC-BIL-008: Admin View All Invoices
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as Admin User (ADMIN). | Dashboard displayed. |
| 2 | Navigate to Admin > Invoices. | Invoice list page displayed. |
| 3 | Verify invoice list. | All invoices from all members displayed. |
| 4 | Verify columns displayed. | Invoice #, Member, Amount, Status, Due Date, Created Date visible. |
| 5 | Verify default sorting. | Sorted by created date (newest first). |
| 6 | Verify pagination. | Pagination controls visible if > page size. |
TC-BIL-009: Member View Own Invoices Only
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as Maria Cruz (MEMBER). | Member dashboard displayed. |
| 2 | Navigate to My Invoices / Billing. | Invoice list displayed. |
| 3 | Verify invoices shown. | Only RCME-DUES-0001 and RCME-DUES-0005 visible. |
| 4 | Verify no access to other members' invoices. | Antonio Dela Cruz's invoices NOT visible. |
TC-BIL-010: Filter by Status - PENDING
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as ADMIN, navigate to Invoices. | Invoice list displayed. |
| 2 | Click status filter dropdown. | Status options displayed: All, Pending, Paid, Overdue, Voided. |
| 3 | Select "Pending". | List filtered to show only PENDING invoices. |
| 4 | Verify results. | RCME-DUES-0002 displayed. Others hidden. |
TC-BIL-011: Filter by Status - OVERDUE
| Step | Action | Expected Result |
|---|---|---|
| 1 | Select "Overdue" status filter. | List filtered. |
| 2 | Verify results. | RCME-DUES-0003 displayed (Antonio Dela Cruz's overdue invoice). |
| 3 | Verify visual indicator. | Overdue invoices highlighted in red/warning color. |
TC-BIL-012: Filter by Member
| Step | Action | Expected Result |
|---|---|---|
| 1 | Access member search/filter field. | Filter input displayed. |
| 2 | Type "Maria Cruz". | Autocomplete suggestions appear. |
| 3 | Select Maria Cruz. | List filtered to Juan's invoices only. |
| 4 | Verify results. | RCME-DUES-0001 and RCME-DUES-0005 displayed. |
TC-BIL-013: Filter by Date Range
| Step | Action | Expected Result |
|---|---|---|
| 1 | Access date range filter. | Date picker displayed. |
| 2 | Set start date: First day of current month. | - |
| 3 | Set end date: Last day of current month. | - |
| 4 | Apply filter. | Only invoices created within date range displayed. |
TC-BIL-014: Search by Invoice Number
| Step | Action | Expected Result |
|---|---|---|
| 1 | Locate search field. | Search input visible. |
| 2 | Enter "RCME-DUES-0003". | Search executed. |
| 3 | Verify results. | Only RCME-DUES-0003 displayed. |
TC-BIL-015: Combined Filters
| Step | Action | Expected Result |
|---|---|---|
| 1 | Set status filter: PENDING or OVERDUE. | - |
| 2 | Set member filter: Antonio Dela Cruz. | - |
| 3 | Apply both filters. | Only Roberto's pending/overdue invoices shown. |
| 4 | Verify results. | RCME-DUES-0002 and RCME-DUES-0003 displayed. |
TC-BIL-016: Sort by Amount
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "Amount" column header. | List sorted by amount ascending. |
| 2 | Click again. | List sorted by amount descending. |
| 3 | Verify order. | PHP 2,500 < PHP 3,500 < PHP 15,000 |
TC-BIL-017: Sort by Due Date
| Step | Action | Expected Result |
|---|---|---|
| 1 | Click "Due Date" column header. | List sorted by due date. |
| 2 | Verify overdue invoices. | Past due dates appear first (ascending) or last (descending). |
TC-BIL-018: Empty State - No Invoices
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as a member with no invoices (Miguel Fernandez). | - |
| 2 | Navigate to My Invoices. | Empty state displayed. |
| 3 | Verify message. | "No invoices found" or similar message displayed. |
TC-BIL-019: Pagination
| Step | Action | Expected Result |
|---|---|---|
| 1 | Ensure > 25 invoices exist in system. | - |
| 2 | Navigate to Admin > Invoices. | First page displayed (e.g., 25 items). |
| 3 | Click "Next" or page 2. | Second page of results displayed. |
| 4 | Verify item count. | Correct number of items per page. |
| 5 | Navigate to last page. | Last page displays remaining items. |
TC-BIL-020: Quick Actions from List
| Step | Action | Expected Result |
|---|---|---|
| 1 | Hover over an invoice row. | Action buttons appear (View, Send, Download). |
| 2 | Click row or "View" button. | Invoice detail page opens. |
| 3 | Click "Download" (PDF icon). | Invoice PDF downloads. |
| 4 | Click "Send" (email icon). | Invoice email sent confirmation. |
API Test Cases
TC-BIL-API-004: GET /api/billing/admin/invoices - List All
Request: GET /api/billing/admin/invoices
Expected Response: 200 OK
{
"invoices": [
{
"id": "uuid",
"invoiceNumber": "RCME-DUES-0001",
"member": { "id": "...", "name": "Maria Cruz", "email": "testmember@rcme.membervu.com" },
"total": 15000,
"status": "PAID",
"dueDate": "2024-01-15",
"paidDate": "2024-01-10"
}
],
"pagination": {
"page": 1,
"pageSize": 25,
"total": 100
}
}
TC-BIL-API-005: GET /api/billing/admin/invoices?status=OVERDUE
Request: GET /api/billing/admin/invoices?status=OVERDUE
Expected Response: 200 OK with only overdue invoices
TC-BIL-API-006: GET /api/billing/invoices (Member Endpoint)
Request: GET /api/billing/invoices (as Maria Cruz)
Expected Response: 200 OK with only Juan's invoices (NEVER other members')