{% extends 'core/base.html' %} {% load static %} {% block title %}Customers — SwiftPOS{% endblock %} {% block topbar_title %}Customers{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{% if messages %}
{% for message in messages %} {% endfor %}
{% endif %}
Customers
Manage registered customers, credit accounts & payment history
New Customer
Total Customers
{{ customers.count }}
On Credit
{{ total_credit_customers }}
Total Outstanding
{{ currency_symbol }}{{ total_outstanding|floatformat:2 }}
Paid Recently
{{ payment_history.count }}
{% if q %}Clear{% endif %}
All Customers {{ customers.count }} Pending Payments {{ total_credit_customers }} Payment History
{% if tab == 'all' %}
{% if customers %}
{% for c in customers %} {% endfor %}
Name Phone Email Orders Total Spent Outstanding
{{ c.name }} {{ c.phone|default:"—" }} {{ c.email|default:"—" }} {{ c.total_orders }} {{ currency_symbol }}{{ c.total_spent|floatformat:2 }} {% if c.outstanding_balance > 0 %} {{ currency_symbol }}{{ c.outstanding_balance|floatformat:2 }} {% else %} Clear {% endif %} View Edit
{% else %}
{% if q %}No customers match "{{ q }}"{% else %}No customers yet — Add one{% endif %}
{% endif %}
{% endif %} {% if tab == 'credit' %}
Customers with Outstanding Balances
{% if credit_summary %}
{% for c in credit_summary %} {% endfor %}
Customer Phone Orders Total Owed Action
{{ c.customer_name|default:"Anonymous" }} {{ c.customer_phone|default:"—" }} {{ c.orders_count }} {{ currency_symbol }}{{ c.total_owed|floatformat:2 }} History
{% else %}
No outstanding balances {% if q %}matching "{{ q }}"{% endif %} 🎉
{% endif %}
{% if credit_orders %}
Individual Credit Orders
{% for o in credit_orders %} {% endfor %}
Order # Customer Date Total Paid Balance Status
{{ o.order_number }} {{ o.customer_name|default:"—" }} {{ o.created_at|date:"d M Y" }} {{ currency_symbol }}{{ o.final_amount|floatformat:2 }} {{ currency_symbol }}{{ o.amount_paid|floatformat:2 }} {{ currency_symbol }}{{ o.balance_amount|floatformat:2 }} {% if o.payment_status == 'credit' %}Credit {% else %}Partial{% endif %}
View {% if o.balance_amount > 0 %} Clear {% endif %}
{% endif %} {% endif %} {% if tab == 'history' %}
Completed Payments
{% if payment_history %}
{% for o in payment_history %} {% endfor %}
Order # Customer Phone Date Paid Amount Method
{{ o.order_number }} {{ o.customer_name }} {{ o.customer_phone|default:"—" }} {{ o.updated_at|date:"d M Y" }} {{ currency_symbol }}{{ o.final_amount|floatformat:2 }} {{ o.get_payment_method_display }} View
{% else %}
No payment history{% if q %} for "{{ q }}"{% endif %}
{% endif %}
{% endif %}
{% endblock %}