Generating Invoices - Automatic & Manual Methods

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

  1. Select a class from dropdown

  2. Click "Generate / Update Invoices"

  3. System processes all students in that class

  4. 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

StatusMeaningHow It Happens
unpaidNo payment receivedDefault for new invoices
partialSome payment madeWhen 0 < paid < total
paidFully settledWhen paid β‰₯ total
transferredBalance moved to newer invoiceOld 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:

  1. AJAX call validates amount

  2. Updates invoice.amount_paid

  3. Auto-calculates new status (partial/paid)

  4. Creates transaction record

  5. 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:

ColumnDescription
transaction_idAuto-increment
invoice_idLinked invoice
amountPayment amount
payment_methodCash, Bank Transfer, Credit Card, Check
payment_dateDate of payment
notesOptional notes
recorded_byAdmin who recorded it
created_atTimestamp

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.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
πŸ’¬ Ask Me Anything!