{% extends 'base.html' %} {% block content %}
Cannot create new sales until you purchase more meat.
Only {{ available_inventory|kg }} remaining for sales.
| Date | Customer | Weight (kg) | Price/kg | Total | Status | Payment Status | Actions | |
|---|---|---|---|---|---|---|---|---|
| {{ s.date }} | {{ s.customer.name }} | {{ s.weight_kg|kg }} | {{ s.price_per_kg|currency }} | {{ s.total_amount|currency }} | {{ s.status|capitalize }} | {% if s.payment_status == 'unpaid' %} Unpaid {% elif s.payment_status == 'paid_to_admin' %} Paid {% else %} {{ s.payment_status|default('Unpaid') }} {% endif %} | {% if current_user.role == 'admin' %} - {% endif %} | |
| No sales yet. | ||||||||
| Grand Total | {{ (sales|sum(attribute='total_amount'))|currency }} | |||||||
| Customer Name | Phone Number | Total Balance | Total Sales | Total Payments | Orders Count | Last Order | |
|---|---|---|---|---|---|---|---|
|
{{ customer.name[0].upper() }}
{{ customer.name }}
|
{% if customer.phone %} {{ customer.phone }} {% else %} - {% endif %} | {{ customer.email }} |
{{ balance_data.get('balance', 0)|currency }}
{% if balance_data.get('balance', 0) > 0 %}
OWES
{% elif balance_data.get('balance', 0) < 0 %}
CREDIT
{% else %}
ZERO
{% endif %}
|
{{ balance_data.get('total_sales', 0)|currency }} | {{ balance_data.get('total_payments', 0)|currency }} | {{ balance_data.get('sales_count', 0) }} orders | {% if balance_data.get('last_sale') %} {{ balance_data.get('last_sale').strftime('%Y-%m-%d') }} {% else %} No orders {% endif %} |
| No customers found in the system. | |||||||