Test Cases: Invoice Details View
Module: Billing & Invoicing - Invoice Details
Backend Endpoint: GET /api/billing/admin/invoices/:id, GET /api/billing/invoices/:id
Frontend Pages:
- Admin:
frontend/pwa-app/src/pages/AdminInvoicesPage.tsx (InvoiceDetailPanel — master-detail, opens via ?selected={id}) - Member:
frontend/pwa-app/src/pages/MemberInvoiceDetailPage.tsx
Prerequisites
- Invoices exist with various statuses and payment histories.
- Test data from
00_MASTER_TEST_DATA.mdis seeded.
Test Data
Using invoices from Master Test Data:
- RCME-DUES-0001 (PAID) - Maria Cruz
- RCME-DUES-0002 (PENDING) - Antonio Dela Cruz
- RCME-DUES-0005 (PARTIALLY_PAID) - Maria Cruz
Test Cases
TC-BIL-021: View Invoice Details - Admin
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as Admin User (ADMIN). | Dashboard displayed. |
| 2 | Navigate to Admin > Invoices. | Invoice list displayed. |
| 3 | Click on RCME-DUES-0001. | Invoice detail page opens. |
| 4 | Verify header information. | Invoice number, member name, status badge displayed. |
| 5 | Verify member details. | Name: Maria Cruz, Email, Member ID visible. |
| 6 | Verify line items. | All line items with descriptions and amounts displayed. |
| 7 | Verify totals. | Subtotal, any discounts, and total amount displayed. |
| 8 | Verify dates. | Created date, due date, paid date (if applicable) shown. |
TC-BIL-022: View Invoice Details - Member Own Invoice
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as Maria Cruz (MEMBER). | Member dashboard displayed. |
| 2 | Navigate to My Invoices. | Invoice list displayed. |
| 3 | Click on RCME-DUES-0001. | Invoice detail page opens. |
| 4 | Verify all invoice details visible. | Same information as admin view (minus admin-only notes). |
| 5 | Verify no edit capabilities. | No edit buttons visible for member. |
TC-BIL-023: View Invoice - Access Denied (Other Member's Invoice)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as Maria Cruz (MEMBER). | - |
| 2 | Attempt to access RCME-DUES-0002 (Roberto's invoice) via URL. | Access denied page or redirect to own invoices. |
| 3 | Verify API response. | Status 403 Forbidden or 404 Not Found. |
TC-BIL-024: View Paid Invoice Details
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open RCME-DUES-0001 (PAID status). | Invoice detail displayed. |
| 2 | Verify status badge. | "PAID" badge displayed in green. |
| 3 | Verify payment information. | Payment date, amount, method displayed. |
| 4 | Verify payment reference. | Payment ID or reference number shown. |
| 5 | Verify action buttons. | "Mark as Paid" button disabled/hidden. Download PDF available. |
TC-BIL-025: View Pending Invoice Details
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open RCME-DUES-0002 (PENDING status). | Invoice detail displayed. |
| 2 | Verify status badge. | "PENDING" badge displayed in yellow/warning. |
| 3 | Verify due date emphasis. | Due date clearly visible with days remaining. |
| 4 | Verify payment options. | "Pay Now" button visible (for member view). |
| 5 | Verify admin actions. | "Mark as Paid", "Void", "Send Reminder" buttons visible. |
TC-BIL-026: View Overdue Invoice Details
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open RCME-DUES-0003 (OVERDUE status). | Invoice detail displayed. |
| 2 | Verify status badge. | "OVERDUE" badge displayed in red. |
| 3 | Verify due date. | Past due date shown with "X days overdue" indicator. |
| 4 | Verify urgency indicators. | Visual emphasis on overdue status. |
TC-BIL-027: View Partially Paid Invoice Details
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open RCME-DUES-0005 (PARTIALLY_PAID). | Invoice detail displayed. |
| 2 | Verify status badge. | "PARTIALLY PAID" badge displayed. |
| 3 | Verify payment breakdown. | Total: PHP 3,500, Paid: PHP 2,000, Balance: PHP 1,500. |
| 4 | Verify payment history. | List of partial payments with dates and amounts. |
| 5 | Verify remaining balance prominently displayed. | "Balance Due: PHP 1,500" clearly visible. |
TC-BIL-028: View Voided Invoice Details
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open RCME-DUES-0004 (VOIDED status). | Invoice detail displayed. |
| 2 | Verify status badge. | "VOIDED" badge displayed (gray or strikethrough). |
| 3 | Verify void reason. | Void reason displayed: "Member deactivated". |
| 4 | Verify void date and user. | Who voided and when is recorded. |
| 5 | Verify no payment actions. | All payment buttons disabled/hidden. |
TC-BIL-029: View Invoice Line Items
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open any invoice with multiple line items. | Invoice detail displayed. |
| 2 | Verify line items table. | Description, Quantity, Unit Price, Amount columns. |
| 3 | Verify calculations. | Each line: Qty x Unit Price = Amount. |
| 4 | Verify subtotal. | Sum of all line amounts. |
| 5 | Verify any adjustments. | Discounts or fees applied if present. |
| 6 | Verify grand total. | Final amount to pay. |
TC-BIL-030: View Invoice Payment History
| Step | Action | Expected Result |
|---|---|---|
| 1 | Open invoice with payment history (RCME-DUES-0001 or RCME-DUES-0005). | Invoice detail displayed. |
| 2 | Locate "Payment History" section. | Section visible on page. |
| 3 | Verify payment records. | Each payment shows: Date, Amount, Method, Reference, Status. |
| 4 | For partially paid invoice. | Multiple payment entries visible. |
TC-BIL-031: View Invoice Audit Trail (Admin)
| Step | Action | Expected Result |
|---|---|---|
| 1 | Login as ADMIN. | - |
| 2 | Open any invoice. | - |
| 3 | Locate "Activity" or "History" section. | Audit trail visible. |
| 4 | Verify entries. | Created, status changes, sent emails, payment recorded events logged. |
| 5 | Verify actor information. | Who performed each action is recorded. |
TC-BIL-032: Invoice Detail - Non-Existent Invoice
| Step | Action | Expected Result |
|---|---|---|
| 1 | Navigate to /invoices/non-existent-id. | Error page or redirect. |
| 2 | Verify API response. | Status 404 Not Found. |
| 3 | Verify UI. | "Invoice not found" message displayed. |
API Test Cases
TC-BIL-API-007: GET /api/billing/admin/invoices/:id
Request: GET /api/billing/admin/invoices/RCME-DUES-0001
Expected Response: 200 OK
{
"id": "uuid",
"invoiceNumber": "RCME-DUES-0001",
"member": {
"id": "MEM-2024-0004",
"firstName": "Juan",
"lastName": "Garcia",
"email": "testmember@rcme.membervu.com"
},
"lines": [
{ "description": "Annual Dues", "quantity": 1, "unitPrice": 15000, "amount": 15000 }
],
"subtotal": 15000,
"total": 15000,
"status": "PAID",
"dueDate": "2024-01-15",
"createdAt": "2024-01-01T00:00:00Z",
"paidAt": "2024-01-10T14:30:00Z",
"payments": [
{
"id": "PAY-2024-0001",
"amount": 15000,
"method": "BANK_TRANSFER",
"reference": "BDO-123456789",
"paidAt": "2024-01-10T14:30:00Z"
}
]
}
TC-BIL-API-008: GET /api/billing/invoices/:id (Member - Own Invoice)
Request: GET /api/billing/invoices/RCME-DUES-0001 (as Maria Cruz)
Expected Response: 200 OK with invoice details
TC-BIL-API-009: GET /api/billing/invoices/:id (Member - Other's Invoice)
Request: GET /api/billing/invoices/RCME-DUES-0002 (as Maria Cruz)
Expected Response: 403 Forbidden or 404 Not Found