{% extends 'base.html' %} {% block title %}Payments{% endblock %} {% block content %}
Clear
{% if payments %}
{% for payment in payments %} {% endfor %}
Payment ID Date Customer Amount Method Status Receipt/Reference Actions
{{ payment.payment_id }} {{ payment.created_at|date:"M j, Y" }}
{{ payment.created_at|time:"H:i" }}
{% if payment.customer %} {{ payment.customer.get_full_name }}
{{ payment.customer.customer_id }} {% elif payment.invoice and payment.invoice.customer %} {{ payment.invoice.customer.get_full_name }}
{{ payment.invoice.customer.customer_id }} {% else %} No customer linked {% endif %}
KES {{ payment.amount|floatformat:2 }} {% if payment.invoice %}
Invoice: {{ payment.invoice.invoice_number }} {% endif %}
{{ payment.get_payment_method_display }} {{ payment.get_status_display }} {% if payment.payment_method == 'mpesa' %} {% if payment.mpesa_receipt_number %} {{ payment.mpesa_receipt_number }} {% else %} Pending... {% endif %} {% elif payment.payment_method == 'cash' %} {% if payment.cash_receipt_number %} {{ payment.cash_receipt_number }} {% else %} Cash Payment {% endif %} {% else %} {% if payment.reference_number %} {{ payment.reference_number }} {% else %} - {% endif %} {% endif %}
{% if payment.status == 'completed' %} {% endif %}
{% if is_paginated %} {% endif %} {% else %}

No payments found

{% if search_query or status_filter %} No payments match your search criteria. {% else %} No payments have been recorded yet. {% endif %}

{% if search_query or status_filter %} View All Payments {% else %} Record First Payment {% endif %}
{% endif %}
{% endblock %}