{% extends 'base.html' %} {% load static %} {% block title %}Bulk Invoice Generation — Rapha-Bethel BNPS{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

Bulk Invoice Generation

Create invoices for all active students at once

Back to Invoices
{% if messages %} {% for msg in messages %}
{{ msg }}
{% endfor %} {% endif %} {% if not preview %}
Step 1 — Choose Invoice Type, Scope & Due Date
Creates one invoice per active student using the correct fee structure for their class. Students who already have an invoice of the same type for the selected year are skipped. Fee structures must be set up first (Finance → Fee Structures).
{% csrf_token %}
Select Registration for enrollment fees, 1st/2nd Installment for tuition payments.

Select the classes to include:

{% for cls in all_classes %} {% endfor %}
{% else %}
Invoices to Create
{{ total_to_create }}
Already Invoiced
{{ skip_count }} skipped
Total Value
{{ total_amount|floatformat:0 }} XAF
Type
{{ academic_year }}
{{ invoice_type|title }} — Due: {{ due_date }}
{% if total_to_create == 0 %}
No invoices to create. Either all matching students already have this invoice type for {{ academic_year }}, or no fee structures are set up for this year/section combination. Check fee structures →
Start Over {% else %}
Preview — {{ total_to_create }} invoice{{ total_to_create|pluralize }} will be created
{{ academic_year }} — {{ invoice_type|title }}
{% for item in preview %} {% endfor %}
# Student Class Fee Tier Amount (XAF)
{{ forloop.counter }} {{ item.student.get_full_name }} {% if item.is_new_pupil %} New {% endif %} {{ item.student.current_class }} {{ item.fee.get_section_display }} — {{ item.fee.get_class_group_display }} {{ item.amount|floatformat:0 }}
Grand Total: {{ total_amount|floatformat:0 }} XAF
Step 2 — Confirm & Create

You are about to create {{ total_to_create }} invoice{{ total_to_create|pluralize }} totalling {{ total_amount|floatformat:0 }} XAF for {{ academic_year }} — {{ invoice_type|title }}. All invoices will be created with status Draft.

{% csrf_token %} {% for cid in class_ids %} {% endfor %} Start Over
{% endif %} {% endif %}
{% endblock %} {% block extra_js %} {% endblock %}