{% extends 'base.html' %} {% load humanize %} {% block title %}Customer {{ customer.name }} - Ghana Wholesale{% endblock %} {% block content %}

{{ customer.name }}

Back to Customers New Sale
Customer Information
Customer Code: {{ customer.customer_code }}
Name: {{ customer.name }}
Type: {{ customer.get_customer_type_display }}
Phone: {{ customer.phone }}
Email: {{ customer.email|default:"Not provided" }}
Ghana Card: {{ customer.ghana_card|default:"Not provided" }}
Credit Limit: GH₵ {{ customer.credit_limit|floatformat:2 }}
Current Balance: {% if customer.credit_balance > 0 %} GH₵ {{ customer.credit_balance|floatformat:2 }} {% else %} GH₵ 0.00 {% endif %}
Available Credit: GH₵ {{ customer.available_credit|floatformat:2 }}
Credit Days: {{ customer.credit_days }} days
{% if customer.address %}
Address:

{{ customer.address|linebreaks }}

{% endif %}
{% if customer.is_active %}Active{% else %}Inactive{% endif %} Created: {{ customer.created_at|date:"d M Y" }} | Updated: {{ customer.updated_at|date:"d M Y" }}
Sales History
{% if sales %}
{% for sale in sales %} {% endfor %}
Invoice # Date Shop Items Amount Payment Status Action
{{ sale.invoice_number }} {% if sale.vat_invoice %} VAT {% endif %} {{ sale.created_at|date:"d M, H:i" }} {{ sale.shop.code }} {{ sale.items_count }} GH₵ {{ sale.total_amount|floatformat:2 }} {{ sale.get_payment_method_display|truncatechars:10 }} {% if sale.status == 'completed' %} Completed {% elif sale.status == 'pending' %} Pending {% endif %}
{% else %}

No sales history for this customer

Create First Sale
{% endif %}
Customer Summary
{{ stats.total_sales }}
Total Sales
Total Revenue: GH₵ {{ stats.total_amount|floatformat:2 }}
Outstanding Balance: GH₵ {{ stats.outstanding_balance|floatformat:2 }}
Credit Limit: GH₵ {{ customer.credit_limit|floatformat:2 }}
Credit Used: GH₵ {{ customer.credit_balance|floatformat:2 }}
Available Credit: GH₵ {{ customer.available_credit|floatformat:2 }}

Customer Since
{{ customer.created_at|date:"M Y" }}
{% if customer.is_active %}Active Customer{% else %}Inactive{% endif %}
Credit Status
{% if customer.credit_balance > 0 %}
Outstanding Balance: GH₵ {{ customer.credit_balance|floatformat:2 }}
Credit Days: {{ customer.credit_days }} days
{% if customer.credit_balance >= customer.credit_limit %}
Credit Limit Exceeded!
No more credit available
{% endif %} {% else %}
No Outstanding Balance
Customer is up to date with payments
{% endif %}
{% widthratio customer.credit_balance customer.credit_limit 100 %}% Used
Credit Limit: GH₵ {{ customer.credit_limit|floatformat:2 }}
{% endblock %}