{% extends 'core/base.html' %} {% load currency_filters %} {% 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
{% money total_outstanding %}
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 }} {% money c.total_spent %} {% if c.outstanding_balance > 0 %} {% money c.outstanding_balance %} {% 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 }} {% money c.total_owed %} 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" }} {% money o.final_amount %} {% money o.amount_paid %} {% money o.balance_amount %} {% 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" }} {% money o.final_amount %} {{ o.get_payment_method_display }} View
{% else %}
No payment history{% if q %} for "{{ q }}"{% endif %}
{% endif %}
{% endif %}
{% endblock %}