Invoice Generation System - Complete Guide
Last Updated: 2026-05-27 | Applies to: IK v1.2+ | Role: Administrator, Accountant
Understanding Invoice Generation
InstitutionKit's invoice system automatically:
Pulls assigned fees for each student
Calculates previous unpaid balances
Creates monthly invoices with detailed breakdowns
Marks old unpaid invoices as "transferred" to new ones
The Invoice Page Layout
Navigate to: π° Fee Management β π§Ύ Invoices
Page Sections:
text
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ π GENERATE / UPDATE INVOICES ββ [Select Class βΎ] [Generate] [π§ Send Emails] [π Status]ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β π FILTERS ββ Class: [All βΎ] Search: [_______] [Filter] [Reset]ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β π STATUS QUICK FILTERS ββ [All] [Unpaid] [Partial] ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€β π ALL INVOICES (Table) ββ Roll# | Title | Student | Total | Paid | Status... ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Step 1: Generating Invoices for a Class
Select a class from dropdown
Click "Generate / Update Invoices"
System processes all students in that class
Success message shows count
What happens behind the scenes:
text
For EACH student in selected class:βββ Get all assigned monthly fees (from student_fees table)βββ Calculate previous unpaid balances from OLD invoicesβββ Check if THIS month's invoice already existsβ βββ EXISTS β Update total, recreate itemsβ βββ NEW β Create invoice with due date (+10 days)βββ Add current month fee items (with month prefix)βββ Add previous balance as detailed line itemsβββ Mark old unpaid invoices as "transferred"
The Invoice Creation Logic
Monthly Fee Detection:The system looks for fees with "Monthly" in their name:
"Monthly Tuition Fee" β Included
"Monthly Transport Fee" β Included
"Annual Registration Fee" β Skipped (not monthly)
Previous Balance Calculation:
text
Student: John Doeβββ April Invoice: $500 (unpaid) β Balance: $500βββ March Invoice: $200 (partial, paid $100) β Balance: $100βββ Total Previous Balance: $600New May Invoice:βββ May Monthly Tuition: $500βββ Outstanding April: $500βββ Outstanding March: $100βββ Total: $1,100
Invoice Items Example:
text
May 2026 Fee Invoice #1045βββ May Tuition Fee: $500.00βββ May Transport Fee: $100.00βββ Outstanding April Fee: $500.00βββ Outstanding March Fee: $100.00βββ Total: $1,200.00
Understanding Invoice Statuses
| Status | Meaning | How It Happens |
|---|---|---|
| unpaid | No payment received | Default for new invoices |
| partial | Some payment made | When 0 < paid < total |
| paid | Fully settled | When paid β₯ total |
| transferred | Balance moved to newer invoice | Old unpaid invoices auto-marked |
Transferred Status:When a new monthly invoice is generated, all previous "unpaid" invoices for that student are marked as "transferred". Their balances are added as line items in the new invoice. This prevents duplicate payment tracking.
Step 2: Filtering Invoices
Filter by Class:
text
[All Classes βΎ]βββ Grade 1βββ Grade 2βββ Grade 3βββ ...
Search:Type student name or roll number to find specific invoices.
Status Quick Filters:
All - Every invoice
Unpaid - Only unpaid (red status)
Partial - Partially paid (orange status)
Invoice Table Columns
text
ββββββββ¬ββββββββββββββββββ¬βββββββββββββ¬ββββββββ¬ββββββββ¬βββββββββ¬βββββββββββββ¬ββββββββββββRoll #β Title β Student β Total β Paid β Status β Date β Actions βββββββββΌββββββββββββββββββΌβββββββββββββΌββββββββΌββββββββΌβββββββββΌβββββββββββββΌβββββββββββ€β 1042 β May 2026 Fee β John Doe β $1,200β $600 β PARTIALβ 01-05-2026 β[View][Edit]ββ 1041 β May 2026 Fee β Jane Smith β $800 β $800 β PAID β 01-05-2026 β[View][Edit]ββ 1040 β April 2026 Fee β Bob Wilson β $500 β $0 β TRANSF.β 01-04-2026 β[View][Edit]βββββββββ΄ββββββββββββββββββ΄βββββββββββββ΄ββββββββ΄ββββββββ΄βββββββββ΄βββββββββββββ΄βββββββββββ
Status Colors:
π’ Green = Paid
π Orange = Partial
π΄ Red = Unpaid
β« Gray = Transferred
Step 3: Viewing a Single Invoice
Click "View" on any invoice to see:
text
ββββββββββββββββββββββββββββββββββββββββββββ Invoice #1045 [β Back] ββββββββββββββββββββββββββββββββββββββββββββ€β Student: John Doe ββ Class: Grade 5 ββ Status: Partial ββββββββββββββββββββββββββββββββββββββββββββ€β ITEM AMOUNT ββ May Tuition Fee $500.00 ββ May Transport Fee $100.00 ββ Outstanding April Fee $500.00 ββ Outstanding March Fee $100.00 ββ βββββββββββββββββββββββββββββββββββββ ββ TOTAL: $1,200.00 ββ PAID: $600.00 ββ BALANCE: $600.00 ββββββββββββββββββββββββββββββββββββββββββββ€β [π Download PDF] ββββββββββββββββββββββββββββββββββββββββββββ
Article 20: Invoice Payment Recording
Apprentice Lesson Setup
text
Chapter: Fee & Invoice SystemLesson Title: "Recording Payments and Managing Transactions"Lesson Type: Step-by-Step GuideLabels: [Admin] [Accountant] [Guide]
Article Content
Last Updated: 2026-05-27 | Applies to: IK v1.2+
Recording a Payment (AJAX System)
From the single invoice view, use the payment form:
text
ββββββββββββββββββββββββββββββββββββββββββββ Record Payment ββββββββββββββββββββββββββββββββββββββββββββ€β Payment Amount: [$_______] ββ Payment Date: [2026-05-27] ββ Payment Method: [Cash βΎ] ββ Options: Cash / Bank Transfer / ββ Credit Card / Check ββ Notes: [_______________] ββ ββ [Record Payment] ββββββββββββββββββββββββββββββββββββββββββββ
Validation Rules:
Payment amount must be > 0
Payment cannot exceed balance due
All fields required except notes
What happens on submit:
AJAX call validates amount
Updates
invoice.amount_paidAuto-calculates new status (partial/paid)
Creates transaction record
Returns updated UI without page refresh
Response Updates:
text
β Payment recorded!βββ New Total Paid: $1,200.00βββ New Balance: $0.00βββ Status Changed: Partial β PAIDβββ New payment row added to transaction history
Transaction History
Each payment creates a record in institutionkit_transactions:
| Column | Description |
|---|---|
transaction_id | Auto-increment |
invoice_id | Linked invoice |
amount | Payment amount |
payment_method | Cash, Bank Transfer, Credit Card, Check |
payment_date | Date of payment |
notes | Optional notes |
recorded_by | Admin who recorded it |
created_at | Timestamp |
Article 21: PDF Invoice Generation
Apprentice Lesson Setup
text
Chapter: Fee & Invoice SystemLesson Title: "Generating Professional PDF Invoices"Lesson Type: Feature GuideLabels: [Admin] [Accountant] [Guide]
Article Content
Last Updated: 2026-05-27 | Applies to: IK v1.2+
PDF Download Options
From Invoice List:
Click "View" β "π Download PDF"
Direct URL:
text
admin.php?page=ik-invoices&view=single&invoice_id=1045&ik_pdf=1
PDF Design Features
The PDF invoice includes:
Header Bar:
text
SCHOOL NAME | ADDRESS | TEL: PHONE
Three-Column Header:
text
FEE INVOICE [LOGO] #01045School Name UNPAIDSchool Address
Bill To Section:
text
ββββββββββββββββββββ¬ββββββββββββββββββββ BILL TO β INVOICE DETAILS ββ Student: John Doeβ Invoice: #01045 ββ Class: Grade 5 β Title: May 2026 ββ Roll No: 1042 β Issued: 01 May ββ Guardian: Mr. Doeβ Due: 10 May 2026 βββββββββββββββββββββ΄βββββββββββββββββββ
Amount Cards:
text
ββββββββββββββ¬βββββββββββββ¬ββββββββββββββ TOTAL β PAID β BALANCE ββ Rs 1,200 β Rs 600 β Rs 600 βββββββββββββββ΄βββββββββββββ΄βββββββββββββ
Fee Breakdown Table:
text
# Fee Item Amount (Rs)1 May Tuition Fee 5002 May Transport Fee 1003 Outstanding April Fee 5004 Outstanding March Fee 100βββββββββββββββββββββββββββββββββββββββββ Total Rs 1,200
Footer:
text
Terms: Please pay by due date to avoid late fees.This is a computer-generated invoice.Generated on May 27, 2026 | School Name Β© 2026
PDF Technical Details
Library: Dompdf (included at
includes/lib/dompdf/)Paper Size: A4 Portrait
Font: DejaVu Sans (Unicode support)
Logo:
assets/images/logo1.png(auto-detected)Fallback: π« emoji if no logo found
Customizing the PDF
Change Logo:Replace assets/images/logo1.png with your school logo (PNG format, ~200px wide recommended)
Change Colors:The PDF uses a blue theme (#1e40af). To customize, modify the CSS in generate_invoice_pdf_raw() method.
Add Custom Fields:Edit the "Bill To" section in the PDF generation code.

Comments are closed.