Invoice Management
Managing invoices and tracking payments
The Invoice section provides comprehensive tools for managing student invoices, tracking payments, and monitoring payment status.
Dashboard Statistics
At the top of the invoice list, you'll see:
- Total Invoices - Complete count of all invoices
- Pending Invoices - Invoices awaiting payment
- Paid Invoices - Successfully paid invoices
- Pending Amount - Total outstanding amount in LKR
Invoice Stages
Invoices move through different stages during their lifecycle:
| Stage | Description | Badge Color |
|---|---|---|
| Pending | Awaiting payment | 🟡 Yellow |
| Processing | Payment being processed | 🔵 Blue |
| Paid | Payment received | 🟢 Green |
| Recovery | Past due, in recovery | 🟠 Orange |
| Expired | Invoice expired, credit note issued | 🔴 Red |
Invoice List Features
Search & Filtering
Find invoices using:
- Search - By student name, student ID, invoice number, or package name
- Status Filter - Filter by invoice stage (All, Pending, Processing, Paid, Recovery, Expired)
Sorting
Click column headers to sort by:
- Invoice number
- Student name
- Package name
- Amount
- Due date
- Status
Overdue Highlighting
Overdue invoices are highlighted in red with an "Overdue" label for easy identification.
Invoice Details
Click on any invoice to view its details:
Invoice Information
- Invoice number and status
- Issue date
- Due date (with overdue calculation)
- Payment type (NEW/EXISTING student)
Package Details
- Package name
- Payment scheme (Full Settlement / 2 Installments)
- Installment number (e.g., "1 of 2")
- Total package amount
- Current installment amount
Student Information
- Student name and ID
- Grade level
- Branch location
- Guardian name and phone
Timeline
- Invoice creation date and time
- Payment received date (for paid invoices)
Payment Actions
Mark as Paid
For non-paid invoices:
- Click "Mark as Paid"
- Enter payment reference (required)
- Add payment notes (optional)
- Click "Confirm Payment"
This creates a transaction record and updates the invoice status.
Mark as Processing
For pending/recovery/expired invoices:
- Updates status to PROCESSING
- Indicates payment is being processed
Mark as Pending
For processing/recovery/expired invoices:
- Resets status to PENDING
- Use when payment processing is cancelled
Automatic Status Processing
A scheduled command processes invoice statuses automatically:
php artisan invoices:process-statusesThis command runs daily at 2:00 AM and:
- Moves overdue PENDING invoices to RECOVERY
- Issues credit notes for expired recovery invoices
- Updates invoice statuses accordingly
Dry Run
Test the command without making changes:
php artisan invoices:process-statuses --dry-run --detailsInvoice Lifecycle
1. Invoice Created → Stage: PENDING
↓
2. Payment Before Expiry → Stage: PAID ✅
↓ (or no payment)
3. Expiry Date Passes → Stage: RECOVERY
↓
4. Payment During Recovery → Stage: PAID ✅
↓ (or no payment)
5. Recovery Expires → Stage: EXPIRED + Credit NoteDatabase Schema
invoices
├── id (primary key)
├── student_id (foreign key)
├── scheme_id (foreign key)
├── amount (decimal)
├── expiry (date)
├── type (enum: NEW/EXISTING)
├── stage (enum: PENDING/PROCESSING/PAID/RECOVERY/EXPIRED)
├── installment (integer)
├── credit_days (integer)
├── recovery_days (integer)
├── recovery_start_date (date)
├── recovery_expiry_date (date)
├── credit_note_issued (boolean)
├── created_at
└── updated_atRelated
- Credit Notes - Managing credit notes for expired invoices
- Transactions - Payment transaction records
- Payment Configuration - Configure credit periods