Lyceum Guardian
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 issued

Credit Note Fields

Each credit note contains:

FieldDescription
Credit Note NumberUnique ID (e.g., CN-2025-000001)
InvoiceLinked original invoice
StudentStudent the credit note is for
AmountAmount carried from invoice
Statuspending, paid, or cancelled
Issue DateWhen the credit note was created
Due DateWhen payment is due

Credit Note Statuses

StatusDescription
PendingAwaiting payment
PaidPayment received
CancelledCredit 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-statuses

Process Flow

  1. Command identifies RECOVERY invoices past recovery_expiry_date
  2. Creates a CreditNote record:
    • Unique credit note number
    • Amount from original invoice
    • Status: pending
    • Due date calculated from formula
  3. 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 creation

New 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 creation

Example 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_at

Managing Credit Notes

Marking as Paid

When a credit note payment is received:

  1. View the credit note details
  2. Update status to paid
  3. Record payment transaction

Cancelling Credit Notes

If a credit note should be voided:

  1. View the credit note details
  2. Change status to cancelled
  3. Add notes explaining the reason

On this page