HomeFeaturesCommunityPricingContactDocumentation
Login
HomeFeaturesCommunityPricingContactDocumentation
  • Introduction
  • Help center
  • Common questions
  • Get Started
  • Localhost
  • Architecture
  • Structure
  • Pattern
  • Page
  • Layout
  • Content
  • Types
  • Config
  • Actions
  • Queries
  • Authorization
  • Validation
  • Form
  • Table
  • Detail
  • Card
  • Util
  • Hooks
  • List Params
  • Views
  • README.md
  • ISSUE.md
  • Technology Stack
  • Database
  • File
  • CDN Assets
  • Entry Points
  • Dashboard
  • Authentication
  • Credentials
  • OAuth
  • Flow Diagrams
  • Multi-Tenancy
  • Offline
  • Onboarding
  • Onboarding Videos
  • Add Values
  • Admission
  • Application
  • Attendance
  • Compliance
  • Profile
  • Exams
  • Exam Wizard
  • Timetable
  • Classrooms
  • Notifications
  • Conference
  • LMS (Lumos)
  • Finance
  • Fee Management
  • Invoice
  • Wallet
  • Salary
  • Payroll
  • Timesheet
  • Expenses
  • Budget
  • Receipt
  • Accounts
  • Banking
  • Reports
  • Dashboard
  • Permissions
  • Messages
  • Integration Flow
  • Provision
  • AI Document Processing
  • Document Intelligence
  • Internationalization
  • Translation
  • Translation Guide
  • Icons
  • Docs Factory
  • Inspiration
  • Listings
  • Teachers
  • Students
  • Catalog
  • Library
  • Contributing
  • Code of conduct
  • GitHub Workflow
  • Database Seeds
  • Database Safety
  • Test Accounts
  • Bulk import
  • Playwright
  • Prettier
  • Block Rebound
  • Transportation
  • PRD

Fee Management

PreviousNext

Fee structures, student assignments, payments (Stripe + offline), installments, automated overdue detection, and notifications.

Define what the school charges, assign fees to students, collect online or offline, track installments, and notify on lifecycle events. A 9 AM cron detects overdue fees and dispatches urgent reminders.

Lists on a phone

The fee structures, assignments, payments, fines and scholarships lists open on cards on a phone — name, amount in the school's currency, status chips, date, and the same actions menu as the table row. The view toggle switches to the table. Amounts in these lists are formatted in School.currency.

How fees cascade — school → grade → student

One price flows down three levels. Each level inherits from the one above until someone fine-tunes it.

LevelWhere it's setInheritsFine-tuned how
SchoolSchool → Configuration → Price (or the onboarding price step)—The school fee is the default for every grade
GradeFinance → Fees → Fee Structures → a grade's feeThe school feeSaving a new amount marks the grade Fine-tuned; Reset to school fee puts it back
StudentFinance → Fees → Assignments → a student's fee → Student priceTheir grade's feeSave price gives the student their own price; Reset to grade fee puts them back

What moves when a price changes:

  • School fee changes → every grade still on the school fee re-prices, and so does every student still on their grade's fee. Fine-tuned grades and students with their own price stay.
  • Grade fee changes → every student in that grade still on the grade fee re-prices. Students with their own price stay.
  • Discounts and scholarships apply on top of whichever price wins: own price, else grade fee.
  • Anything with money against it stays. A fee with a payment or a paid instalment is never re-priced; the open instalments of a re-priced fee are re-split so they still add up to the new amount.
  • Grade change or promotion → this year's unpaid fee of the old grade is cancelled and the new grade's fee is assigned. Last year's unpaid fees stay as arrears.
  • New academic year → creating the latest school year gives every grade its fee (last year's fine-tuned price carries over; otherwise the school fee) and every student their grade's fee.

The code lives in src/lib/fee-reprice.ts (the cascade), src/lib/fee-provisioning.ts (school → grade) and src/lib/fee-auto-assign.ts (grade → student).

Pipeline

1. Admin creates a Fee Structure (tuition, transport, uniform, …)
2. Admin assigns fees to students (individual or bulk)
3. Student + guardians notified (in-app + email)
4. Student pays online (Stripe) or admin records manual payment
5. System tracks installments — PAID / PARTIAL / OVERDUE
6. Daily cron at 9 AM detects overdue → urgent reminders
7. PDF receipt generated for every payment

Fee structure

Defined under Finance → Fees → Fee Structures.

FieldDescription
Name"Tuition Fee", "Transport Fee"
AmountTotal fee amount
CategoryTUITION, TRANSPORT, UNIFORM, EXAM, ACTIVITY, LIBRARY, LAB, HOSTEL, OTHERS
Academic year"2025-2026"
GradeOptional — the grade it charges; empty = every grade (school-wide)
InstallmentsNumber of installments (default 1)
Payment scheduleOptional — exact dates and amounts
Late feeOptional — FIXED, PERCENTAGE, DAILY, MONTHLY
Discount policyOptional — sibling, early payment

Assignment

Two modes:

  • Individual — select student → pick structure → optional custom amount → assign
  • Bulk — tick students (or select all) → pick structure → assign

On assignment: FeeAssignment row created with status PENDING, student + all guardians get fee_due notification (in-app + email), sibling discount auto-calculated (e.g. 2nd child 10%, 3rd child 20%).

Automatic. A student placed in a grade — through admission, the add-student wizard, or an edit that changes the grade — gets every structure of the year that charges their grade, plus the school-wide ones. A structure charges a grade, never a class (since 2026-10-04); older class-linked structures were moved to their class's grade.

Payment

Online (student self-service)

Login → My Fees → click "Pay Online" → Stripe Checkout (Visa, MC, Apple Pay)
  → on success, webhook records Payment automatically
  → fee_paid notification (student + guardians)

Offline (admin records)

Finance → Fees → Payments → New Payment
  → select fee assignment → enter amount, method, optional reference
  → Payment record + status update + fee_paid notification

Methods

MethodStatusMarkets
StripeLiveGlobal (Visa, MC, Apple Pay, Google Pay)
TapComing SoonGulf (mada, KNET, STC Pay)
CashLiveAll
Bank TransferLiveAll
Mobile MoneyLiveSudan (Bankak, mBOK)

Gateway is selected automatically based on the school's country.

Installments

Two modes:

  • Explicit — admin sets exact dates and amounts (e.g. 5,000 SAR Sep 1 / 5,000 SAR Dec 1 / 5,000 SAR Mar 1)
  • Equal split — admin sets count, system divides equally with monthly due dates
StatusMeaning
PAIDFully covered
PARTIALSome payment, balance remaining
PENDINGNot yet due
OVERDUEPast due date, not fully paid

Students see a visual timeline with green / yellow / red / gray indicators and a progress bar.

Notifications

EventRecipientsPriorityChannels
Fee assignedStudent + guardiansHighIn-app + Email
Payment receivedStudent + guardiansNormalIn-app + Email
Fee overdueStudent + guardiansUrgentIn-app + Email

Overdue cron

Daily at 9:00 AM:

  1. Scan all PENDING and PARTIAL assignments
  2. Check if any installment due date has passed
  3. Update status to OVERDUE
  4. Dispatch urgent notification (amount + fee name)

The overdue notification fires once — when status first changes to OVERDUE. Repeated reminders to already-overdue accounts is a planned enhancement (re-notify if last notification > 7 days).

User preferences: notification types, channels (in-app / email), quiet hours, digest mode (daily / weekly).

Tracking

WhoWhereSees
StudentMy FeesAssigned fees, payment history, installment timeline
GuardianNotificationsDue / overdue / paid alerts (in-app + email)
AdminFinance → Fees → PaymentsAll payments, filterable by student / status / method
AccountantFinance → FeesFull payment ledger with journal entries

Payment record fields: payment number (unique), receipt number (unique), amount, date, method, external transaction ID (online), status (PENDING → SUCCESS → REFUNDED?), journal entry link.

Every successful payment generates a downloadable PDF receipt with school branding, payment details, and remaining balance.

Refunds

Refund requests track: request date, reason, approval (processedBy, approvalNotes), supporting documents, status through the refund lifecycle.

Discounts

Sibling discounts

Auto-detected through shared guardians. Configurable percentages (e.g. 2nd child 10%, 3rd child 20%). Applied at assignment time.

Scholarships

Custom amount or percentage, linked to specific fee assignments, full audit trail.

Late fees

Per fee structure:

TypeExample
FIXED100 SAR flat
PERCENTAGE5% of outstanding
DAILY10 SAR per day overdue
MONTHLY200 SAR per month overdue

Key files

ComponentPath
Server actionssrc/components/school-dashboard/finance/fees/actions.ts
Queriessrc/components/school-dashboard/finance/fees/queries.ts
Payment formsrc/components/school-dashboard/finance/fees/payment-form.tsx
My Fees (student)src/components/school-dashboard/finance/fees/my-fees.tsx
Pay Online buttonsrc/components/school-dashboard/finance/fees/pay-online-button.tsx
Installment timelinesrc/components/school-dashboard/finance/fees/installment-timeline.tsx
Receipt PDFsrc/components/school-dashboard/finance/fees/receipt-pdf.tsx
Overdue cronsrc/app/api/cron/fee-overdue/route.ts
Payment providerssrc/lib/payment/providers/
Gateway configsrc/lib/payment/gateway-config.ts
Stripe webhooksrc/app/api/webhooks/stripe/route.ts
Schemaprisma/models/finance-fees.prisma

See also

  • Finance — finance block overview + status matrix
  • Invoice — invoice auto-generation from fee assignments
  • Notifications — fee_due, fee_paid, fee_overdue
  • Admission — enrollment creates fee assignments
FinanceInvoice

On This Page

Lists on a phoneHow fees cascade — school → grade → studentPipelineFee structureAssignmentPaymentOnline (student self-service)Offline (admin records)MethodsInstallmentsNotificationsOverdue cronTrackingRefundsDiscountsSibling discountsScholarshipsLate feesKey filesSee also

Built by Databayt ·