Lyceum Guardian
Features

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:

StageDescriptionBadge Color
PendingAwaiting payment🟡 Yellow
ProcessingPayment being processed🔵 Blue
PaidPayment received🟢 Green
RecoveryPast due, in recovery🟠 Orange
ExpiredInvoice 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:

  1. Click "Mark as Paid"
  2. Enter payment reference (required)
  3. Add payment notes (optional)
  4. 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-statuses

This command runs daily at 2:00 AM and:

  1. Moves overdue PENDING invoices to RECOVERY
  2. Issues credit notes for expired recovery invoices
  3. Updates invoice statuses accordingly

Dry Run

Test the command without making changes:

php artisan invoices:process-statuses --dry-run --details

Invoice 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 Note

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

On this page