{% 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 Term, Scope & Due Date
Creates one invoice per active student using mandatory fee structures. Students who already have an invoice for the selected term are skipped automatically. Fee structures must be set up first (Finance → Fee Structures).
{% csrf_token %}

Select the classes to include:

{% for cls in all_classes %} {% endfor %}
{% else %}
Invoices to Create
{{ total_to_create }}
Already Have Invoice
{{ skip_count }} skipped
Total Value
{{ total_amount|floatformat:0 }} XAF
Term
{{ academic_year }} — Term {{ term }}
Due: {{ due_date }}
{% if total_to_create == 0 %}
No invoices to create. Either all matching students already have invoices for this term, or no mandatory fee structures are set up for {{ academic_year }} Term {{ term }}. Check fee structures →
Start Over {% else %}
Preview — {{ total_to_create }} invoice{{ total_to_create|pluralize }} will be created
{{ academic_year }} Term {{ term }}
{% for item in preview %} {% endfor %}
# Student Class Fees Included Subtotal (XAF)
{{ forloop.counter }} {{ item.student.get_full_name }} {{ item.student.current_class }} {% for fee in item.fees %} {{ fee.name }} {% endfor %} {{ item.subtotal|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 }} Term {{ term }}. 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 %}