{% extends "management/base.html" %} {% load i18n lucide ui %} {% block heading %}{% trans "Dues & billing" %}{% endblock heading %} {% block topbar_context %} {% if selected_season %} {{ selected_season.start_date|date:"Y" }}–{{ selected_season.end_date|date:"Y" }} {% endif %} {% endblock topbar_context %} {% block actions %}
{% csrf_token %}
{% lucide "file-down" size=16 %} {% trans "Export to PDF" %} {% endblock actions %} {% block filter_strip %}
{% lucide "search" size=15 %}
{% lucide "x" size=16 %} {% trans "Reset" %}
{% endblock filter_strip %} {% block panel %} {% if not current_season %}
{% lucide "calendar-x" size=20 %} {% trans "No season covers today, so there's nothing to show fee status for yet." %}
{% else %} {# Same anatomy as the Overview dashboard's own KPI row (home.html): a plain white .card, no colour-coded border -- status lives in the number's own colour (neutral ink unless there's something to flag) plus a caption line, not a border accent. #}
{% trans "Registered" %}
{{ kpi_total }}
{% trans "This season" %}
{% trans "Paid" %}
{{ kpi_paid }}
{% trans "Fully settled" %}
{% trans "Partially paid" %}
{{ kpi_partial }}
{% trans "Still owe a balance" %}
{% trans "Unpaid" %}
{{ kpi_unpaid }}
{% trans "Nothing paid yet" %}
{% trans "Waived" %}
{{ kpi_waived }}
{% trans "Fee waived" %}
{% trans "Paid rate" %}
{% if kpi_paid_rate is None %}{% trans "N/A" %}{% else %}{{ kpi_paid_rate }}%{% endif %}
{% trans "Of everyone registered" %}
{% endif %}
{% csrf_token %}
{% blocktrans count counter=memberships|length %}{{ counter }} membership{% plural %}{{ counter }} memberships{% endblocktrans %}
{% for membership in memberships %} {% empty %} {% endfor %}
{% trans "Name" %} {% trans "Email" %} {% trans "Family" %} {% trans "Status" %} {% trans "Fee status" %} {% trans "Owed" %} {% trans "Paid" %} {% trans "License" %} {% trans "Invoice" %}
{{ membership.member.last_name }}, {{ membership.member.first_name }} {{ membership.member.contact_email|default:"-" }} {% if membership.member.family_memberships_display %} {% for fm in membership.member.family_memberships_display %} {{ fm.family }}{% if not forloop.last %}, {% endif %} {% endfor %} {% else %} - {% endif %} {{ membership.get_status_display }} {{ membership.get_fee_status_display }} € {{ membership.fee_amount }} € {{ membership.amount_paid }} {% if membership.record_payment_form and membership.fee_amount %}
{% blocktrans with remaining=membership.remaining_balance_display %}{{ remaining }} left{% endblocktrans %}
{% endif %}
{{ membership.license|default:"-" }} {% if membership.dues_invoice %} {% if membership.dues_invoice.is_paid %}{% trans "Paid" %}{% elif membership.dues_invoice.is_overdue %}{% trans "Overdue" %}{% else %}{% trans "Sent" %}{% endif %}
{{ membership.dues_invoice.sent_at|date:"j M" }}{% if membership.dues_invoice.reminder_count %}, {% blocktrans count counter=membership.dues_invoice.reminder_count %}{{ counter }} reminder{% plural %}{{ counter }} reminders{% endblocktrans %}{% endif %}
{% else %} {% trans "Not sent" %} {% endif %}
{% if membership.record_payment_form %}
{% endif %}
{% trans "Nobody matches these filters." %}
{# due_in_days's widget carries form="membership-form" (see SendDuesInvoicesForm), so it and the submit button below (via its own form=) post through the *same* form as the row checkboxes, just to a different action, overridden with formaction. #} {% trans "Record payment" as record_payment_title %} {% trans "Record" as record_payment_submit_label %} {% for membership in memberships %} {% if membership.record_payment_form %} {# A standalone form, not nested inside the bulk form above -- its submit button lives in the table row and links back here via the form="..." attribute. #}
{% csrf_token %}
{% url 'management:membership_record_payment' membership.pk as record_payment_url %} {% blocktrans with name=membership.member asvar record_payment_blurb %}For {{ name }}. Any amount is fine -- partial payments accumulate until the fee is settled.{% endblocktrans %} {% include "controlpanel/_modal_form.html" with modal_id=membership.pk|dom_id:"record_payment_modal" title=record_payment_title form=membership.record_payment_form action_url=record_payment_url submit_label=record_payment_submit_label submit_icon="receipt" blurb=record_payment_blurb %} {% endif %} {% endfor %} {% endblock panel %} {% block extra_body %} {% endblock extra_body %}