Features
Credit Notes
Managing credit notes for expired invoices
Credit notes are automatically issued when invoices expire after the recovery period. They represent the amount owed by the student/guardian.
Credit Note Lifecycle
Invoice PENDING → Invoice expires → RECOVERY stage
↓
Recovery period ends → EXPIRED + Credit Note issuedCredit Note Fields
Each credit note contains:
| Field | Description |
|---|---|
| Credit Note Number | Unique ID (e.g., CN-2025-000001) |
| Invoice | Linked original invoice |
| Student | Student the credit note is for |
| Amount | Amount carried from invoice |
| Status | pending, paid, or cancelled |
| Issue Date | When the credit note was created |
| Due Date | When payment is due |
Credit Note Statuses
| Status | Description |
|---|---|
| Pending | Awaiting payment |
| Paid | Payment received |
| Cancelled | Credit note cancelled |
Viewing Credit Notes
Navigate to Platform → Credit Notes to view all credit notes.
Features
- Search - Find by credit note number, student name
- Filter - Filter by status
- Sort - Click column headers to sort
Automatic Generation
Credit notes are generated automatically by the scheduled command:
php artisan invoices:process-statusesProcess Flow
- Command identifies RECOVERY invoices past
recovery_expiry_date - Creates a
CreditNoterecord:- Unique credit note number
- Amount from original invoice
- Status: pending
- Due date calculated from formula
- Updates invoice:
- Stage: EXPIRED
credit_note_issued: true
Credit Note Number Format
Credit note numbers follow the format: CN-YYYY-NNNNNN
Example: CN-2025-000042
Credit Note Formula
The due date is calculated based on the payment configuration formula:
New Students - One-time Payment
Due Date = Invoice Due Date + Recovery Period
Example: 45 + 30 = 75 days from invoice creationNew Students - Installments
1st Payment: Due Date = After invoice due date (7 days)
2nd Payment: Due Date = 2nd invoice due + recovery (30+30)Existing Students - One-time Payment
Due Date = Invoice Due Date + Recovery Period
Example: 7 + 30 = 37 days from invoice creationExample Scenario
Day 0 - New student enrolled with one-time payment
- Invoice created: LKR 49,500
- Expiry: Day 45 (45 days credit)
- Stage: PENDING
Day 46 - Command runs, no payment received
- Invoice moved to RECOVERY
- Recovery expiry: Day 76 (30 more days)
Day 77 - Command runs, still no payment
- Invoice marked EXPIRED
- Credit note CN-2025-000042 created
- Credit note amount: LKR 49,500
- Credit note status: pending
Database Schema
credit_notes
├── id (primary key)
├── credit_note_number (unique)
├── invoice_id (foreign key)
├── student_id (foreign key)
├── amount (decimal)
├── status (enum: pending/paid/cancelled)
├── issue_date (date)
├── due_date (date)
├── notes (text, nullable)
├── created_at
└── updated_atManaging Credit Notes
Marking as Paid
When a credit note payment is received:
- View the credit note details
- Update status to paid
- Record payment transaction
Cancelling Credit Notes
If a credit note should be voided:
- View the credit note details
- Change status to cancelled
- Add notes explaining the reason
Related
- Invoice Management - Managing invoices
- Payment Configuration - Credit period settings
- Transactions - Payment records