Package Allocation and Lesson Tracking¶
Applies to: all staff who book lessons or look after students; extra lessons need Invoices.Create (paid) or Lessons.Manage (free); Complete Training needs Students.Edit. Last reviewed: 2026-11-18.
When a student takes a training package, the package's lessons become the student's lesson allowance. This page explains how the allowance is calculated, what counts against it, what the "Remaining" figures on different screens mean, extra lessons (top-ups), lessons booked beyond the package, and "training completed".
1. The rule in one line¶
- Package lessons - the Number of Lessons on the training package of the student's active course.
- Extra lessons - extra lessons (top-ups) added to that course, paid or free.
- Lessons used - every lesson on that course that is not cancelled.
The result is never shown below 0.
2. What counts as "used"¶
| Lesson status | Uses a lesson from the allowance? |
|---|---|
| Scheduled | Yes |
| Confirmed | Yes |
| In Progress | Yes |
| Awaiting Instructor Sign-Off | Yes |
| Awaiting Student Sign-Off | Yes |
| Completed | Yes |
| No Show | Yes - a missed lesson is still used up |
| Cancelled | No - cancelling gives the lesson back |
Other points:
- A double or triple lesson uses two or three lessons.
- A repeat booking over several dates uses one lesson (or block) per date. The whole booking is refused if the allowance cannot cover all of it.
- Rescheduling a lesson moves it; it does not use another lesson.
- From the student portal, a lesson request that is still waiting for approval also holds a lesson (so a student cannot request more than they have). A request to change an existing lesson does not. See Student portal.
Giving a lesson back after a no-show
There is no separate "forfeit" or "refund" setting: a no-show always uses the lesson, and a cancellation always returns it. To give a lesson back after a no-show, add a free extra lesson (section 5).
3. With and without an active course¶
The allowance is counted on the student's active course only. Lessons from an earlier, completed course never use up a new course, and extra lessons added to an earlier course do not carry over.
| Situation | Package lessons | Extra lessons | Lessons used |
|---|---|---|---|
| The student has an active course | The lessons of that course's package | Extra lessons added to that course | Lessons booked on that course, not cancelled |
| The student has no active course (for example it was completed and nothing new was started) | The lessons of the package on the student record | All the student's extra lessons | All the student's lessons ever, not cancelled |
The second row means a student whose course has been completed, and who has used all their lessons, has nothing left to book until a new course is started or an extra lesson is added.
A lesson is attached to the course that was active when it was booked. Extra lessons are attached to the course that was active when they were added.
4. Where to see the numbers, and what each one means¶
The word "Remaining" does not mean the same thing on every screen. This table is the reference.
| Screen | Figure | How it is worked out |
|---|---|---|
| Profile > Overview > Active Course card and Statistics | Total Lessons / Lessons | Package lessons + extra lessons on the active course |
| Completed | Lessons on the active course with the status Completed | |
| Remaining | Total - lessons used (everything not cancelled). This is lessons left to book. | |
| Profile > Lessons tab cards | Purchased (or "Purchased (incl. N extra)") | Package lessons + extra lessons on the current course |
| Completed | Lessons with the status Completed | |
| Remaining | Purchased - Completed. This is lessons still to be taken; lessons that are booked but not yet taken are still included, and a No Show does not reduce it. | |
| Next Lesson | Date of the next Scheduled or Confirmed lesson | |
| Profile > Courses tab > active course card | Total Lessons, Completed, Remaining | Same as the Lessons tab: Remaining = total - completed |
| Course Details box | Total, Completed, Remaining | Counts booked lessons only, not the package (see Courses) |
| Student portal | Lessons left to book | Total - lessons used - requests waiting for approval |
Example: a 10-lesson package, 4 lessons completed, 1 no-show, 2 booked for next week.
- Overview Remaining: 10 - (4 + 1 + 2) = 3 (three more can be booked).
- Lessons tab Remaining: 10 - 4 = 6 (six not yet completed).
Which Remaining figure to use
When deciding whether another lesson can be booked, use the Overview figure.
Screenshot to be added
Screen: Student Profile, Lessons tab. Should show: the Purchased / Completed / Remaining / Next Lesson cards, the "Extra lessons" panel and the lesson table.
When the allowance runs out¶
Booking is refused with:
| Message | Meaning |
|---|---|
| Student has no remaining lessons in their training package. | Lessons left to book is 0. |
| This booking needs N lessons but the student only has M lesson(s) remaining in their training package. | A double/triple lesson or repeat booking needs more lessons than are left. |
To continue, add an extra lesson (section 5) or start a new course (Student enrolment).
A package with 0 lessons (a learner's-only package) has no allowance: no lessons can be booked on it until an extra lesson is added or a new course is started.
5. Extra lessons (top-ups)¶
An extra lesson adds one lesson to the student's allowance. It can be paid (an invoice is raised) or free (complimentary, with a reason).
5.1 Who can add them¶
| Kind | Permission | Also needs |
|---|---|---|
| Paid | Invoices.Create | The school's plan must include invoicing/payments |
| Free | Lessons.Manage ("Only managers can give free lessons.") | A reason |
The Add Extra Lesson button is shown to anyone with either permission. Inside the box, the option you are not allowed to use is greyed out.
5.2 Adding an extra lesson¶
- Open the student's profile > Lessons tab.
- Click Add Extra Lesson. The box explains: "Adds 1 lesson to the student's package. It counts towards their purchased lessons, free or paid."
- Choose:
- Paid - raise an invoice, or
- Free (complimentary).
-
Complete the fields:
Field Shown for Required Meaning and rules Lesson fee Paid Yes The amount to charge, in rand. Must be more than 0 and not more than R 100 000. "An invoice for this amount is created and emailed to the student." Reason (optional) / Reason (required) Both Required for free Why the lesson is added. Up to 500 characters. For a paid lesson it is saved as the invoice's note. Book the lesson now (date defaults to ...) Both - Ticked by default. After saving, the Schedule Lesson box opens with a date one week from today. Needs Lessons.Create. -
Click Add Extra Lesson.
Screenshot to be added
Screen: Add Extra Lesson box. Should show: Paid selected, with Lesson fee, Reason and the "Book the lesson now" tick box.
5.3 What happens¶
- One extra lesson is added to the student's active course (or to the student, if there is no active course).
- Paid: an invoice is created with one line, "Extra driving lesson - (package name)", quantity 1, for the fee; due in 7 days; status Pending; and it is emailed to the student. If the email fails the lesson and invoice still stand.
- Free: no invoice.
- The lesson counts immediately, whether or not a paid invoice has been paid.
Messages:
| Message | Meaning |
|---|---|
| Free extra lesson added. | Free lesson added. |
| Extra lesson added. Invoice (number) was emailed to the student. | Paid lesson added, invoice emailed. |
| Extra lesson added. Invoice (number) was created. | Paid lesson added, email not sent. |
| The extra lesson isn't booked yet - you'll be reminded in notifications until it is. | You ticked "Book the lesson now" but closed the booking box without booking. |
| Please give a reason for the free lesson. | Free lesson without a reason. |
| Enter the fee for the extra lesson, or mark it as free. | Paid lesson without a fee above 0. |
| The fee may not be more than R 100,000. | Fee too high. |
| The reason may not be longer than 500 characters. | Reason too long. |
| This student has no training package. Assign a package before adding extra lessons. | The student has no package. |
| This student is inactive. Reactivate them before adding lessons. | The student's status is Inactive. |
| You don't have permission to add this kind of lesson. | You lack Invoices.Create (paid) or Lessons.Manage (free). |
Extra lessons are added one at a time. To add three, repeat the steps three times (three invoices for paid lessons).
5.4 The Extra lessons list¶
On the Lessons tab, an Extra lessons (N) panel lists every extra lesson the student has: Added (date), Charge ("Free" or the amount), Invoice (number), Reason, Added by, and for users with Lessons.Manage a Remove button on free lessons.
5.5 Removing an extra lesson¶
A free extra lesson (Lessons.Manage):
- In the Extra lessons panel click Remove on the line.
- Confirm: "The free extra lesson added on (date) ... will be removed, and the student will have one lesson less." > Remove (or Keep it).
- You see "Free extra lesson removed."
It is refused if the lesson is already in use: "This extra lesson is already booked, so it can't be removed. Cancel the lesson it's used for first." (That is, removing it would leave the student with more lessons booked than covered.)
A paid extra lesson is removed by cancelling its invoice (Invoices.Edit; see Invoicing). The message is then "Invoice cancelled. The extra lesson on it was removed from the student's package." Trying to remove a paid one from the list gives "Only free extra lessons can be removed here. To remove a paid one, cancel its invoice."
Warning
Cancelling the invoice of a paid extra lesson does not check whether the lesson has already been booked. If it has, the student ends up with a lesson booked beyond the package (section 6).
6. Lessons booked beyond the package¶
Normally the booking rules stop a student going over the allowance. It can still happen, for example when:
- a student's lesson request is approved after every package lesson was booked;
- the Number of Lessons on the package is reduced while students are using it;
- the invoice of a paid extra lesson is cancelled after the lesson was booked.
When lessons used are more than package + extra lessons, the Lessons tab shows a warning:
"1 lesson is booked beyond the student's package and extra lessons, so it isn't billed. Bill each as an extra lesson (paid or free), or cancel it."
(or "N lessons are booked beyond ... so they aren't billed.")
Billing it¶
Users with Invoices.Create or Lessons.Manage see Bill as extra lesson in the warning and in the lesson's row menu.
- Click Bill as extra lesson. The Bill as Extra Lesson box opens - the same box as Add Extra Lesson, but:
- Lesson fee is pre-filled with the package's lesson price (see Package pricing);
- Reason is pre-filled with "Lesson booked beyond the package" (or "Lesson (number) booked beyond the package");
- there is no "Book the lesson now" option, because the lesson is already booked.
- Choose paid or free, adjust the fee or reason, and confirm.
- You see "Billed as an extra lesson. Invoice (number) was emailed to the student." (or "... was created.", or "Billed as a free extra lesson.").
This adds one extra lesson, which brings the allowance back level. Repeat for each lesson over. The alternative is to cancel the lesson.
7. Training completed¶
"Training completed" is a student status (see Student status management). It is reached in two ways.
7.1 Automatically¶
When a lesson is completed - by staff, or by the student signing it off - DriveFlow checks the student. If:
- the student's status is In Training, and
- the package has at least one lesson, and
- the number of Completed lessons has reached package lessons + extra lessons (on the active course),
the status changes to Training Completed and the date and time are recorded.
No Shows and booked lessons do not count here: only Completed lessons. A student with 10 lessons who has 9 completed and 1 no-show is not automatically completed (and has nothing left to book); either add a free extra lesson for the missed one, or complete the training by hand.
7.2 By hand - Complete Training¶
Who: users with Students.Edit.
The Complete Training button on the Lessons tab is enabled when all of these are true:
- at least one lesson has been completed;
- training is not already completed;
- the student's status is before Ready For Test.
Steps:
- Profile > Lessons tab > Complete Training.
- The Complete Student Training box asks you to "confirm that the student has completed the required practical training and is ready to proceed to the next stage", and shows Remaining Lesson : N.
- Optionally type Instructor Comments.
- Click Complete Training.
- You see "Student training completed successfully."
Unused lessons are not refunded
Any lessons the student has not used are not refunded or credited automatically, and lessons already booked for the future are not cancelled.
7.3 After training is completed¶
While the student's status is Training Completed, Ready For Test, Test Booked or Test Failed:
- The Lessons tab shows "Training is completed. N extra lesson(s) still to be scheduled." or "Training is completed. Add an extra lesson, or start a new course, to schedule more lessons."
- The Schedule Lesson button is hidden unless an extra lesson is waiting.
- A lesson can only be booked against an extra lesson added after the training was completed. Each booking made after completion uses one of those; cancelling that booking frees it again.
This applies even if the student still had unused package lessons when training was completed by hand: those can no longer be booked on their own.
Messages:
| Message | Meaning |
|---|---|
| This student has completed their training. Add an extra lesson, or start a new course, before scheduling another lesson. | No extra lesson has been added since completion (or all have been booked). |
| This booking needs N lessons but the student only has M extra lesson(s) left. Add more extra lessons first. | A double/triple or repeat booking needs more extra lessons than are available. |
Typical use: a student fails the driving test (Test Failed) and wants two more lessons. Add two extra lessons; two lessons can then be booked.
Starting a new course clears the "training completed" state: the student returns to In Training with the new package's allowance.
8. How package changes affect the allowance¶
| Change | Effect |
|---|---|
| The package's Number of Lessons is edited | Every student whose active course uses that package gets the new number at once. See Training packages. |
| A new course is started | The allowance restarts from the new package. Lessons and extra lessons of the old course no longer count. Unused lessons of the old course are not carried over. |
| The active course is completed and no new one started | The allowance falls back to "everything the student ever had" (section 3). |
| The student is deactivated | No lessons can be booked or added. Existing bookings are not cancelled. |
9. Worked example¶
Thabo is on "Code B - 10 Driving Lessons".
| Step | Package | Extra | Used | Left to book (Overview "Remaining") | Completed |
|---|---|---|---|---|---|
| Registered | 10 | 0 | 0 | 10 | 0 |
| 6 lessons booked, 4 of them completed | 10 | 0 | 6 | 4 | 4 |
| 1 booked lesson cancelled | 10 | 0 | 5 | 5 | 4 |
| He misses a lesson (No Show) | 10 | 0 | 5 | 5 | 4 |
| Remaining 5 booked; all 9 attended lessons completed | 10 | 0 | 10 | 0 | 9 |
| Manager adds a free extra lesson "Make-up for missed lesson" and books it | 10 | 1 | 11 | 0 | 9 |
| That lesson is completed | 10 | 1 | 11 | 0 | 10 |
At the last row, completed (10) is still less than package + extra (11), because the no-show used a lesson without being completed. Thabo does not move to Training Completed automatically; the manager clicks Complete Training.
Had the missed lesson been cancelled instead of marked No Show, it would have been returned, all 10 would have been completed, and the status would have changed to Training Completed by itself.
10. Limitations and notes¶
- "Remaining" means different things on different screens (section 4). The Lessons tab and Courses tab subtract completed lessons only; the Overview subtracts every lesson that is not cancelled.
- A No Show uses a lesson and blocks automatic training completion (sections 2 and 7.1). There is no setting to change this.
- Instructor comments in Complete Training are not saved. The box collects them, but they are not sent to the server.
- Extra lessons are one at a time, with one invoice each.
- Extra lessons added while the student has no active course do not transfer to a course started later. They are not attached to any course, and an active course only counts its own extra lessons.
- Lessons booked while the student had no active course are likewise not counted against a course started later.
- After-completion counting uses dates. "Extra lessons available after training" is the number of extra lessons added since the completion moment, minus the lessons booked since then, across the whole student. For students whose completion date was never recorded (older records), the student's last change date is used instead.
- Unused lessons are never refunded automatically when training or a course is completed.
- Package validity is not part of the allowance. Lessons do not expire.
- The lesson summary on the Lessons tab uses the active course, or the most recent course if none is active, and includes lessons that are not attached to any course.
- Tests in
DriveFlow.Tests/Lessons(for exampleBookLessonHandlerTests,CompleteLessonHandlerTests,RemoveFreeExtraLessonTests) describe the intended behaviour of these rules.
Related articles¶
- Courses - the active course the allowance is counted on.
- Training packages - the Number of Lessons on a package.
- Package pricing - the lesson price used for extra lessons.
- Student enrolment - starting a new course to restart the allowance.
- Student status management - the Training Completed status.
- Scheduling lessons - booking lessons against the allowance.