{% extends 'reports/base_report.html' %} {% load humanize %} {% block title %}Purchases Report{% endblock %} {% block report_content %}
Purchases Summary
Total Purchases

Ksh {{ total_amount|intcomma }}

Total Orders

{{ purchases.paginator.count }}

Top Suppliers
{% for supplier in suppliers|slice:":3" %}
{{ supplier.name|default:"N/A" }}
Ksh {{ supplier.total_spent|default:0|intcomma }}
{{ supplier.order_count }} order{{ supplier.order_count|pluralize }}
{% endfor %}
{% for po in purchases %} {% empty %} {% endfor %}
Order Date PO Number Supplier Items Total Amount Status Actions
{{ po.order_date|date:"M d, Y" }} {{ po.po_number }} {{ po.supplier.name|default:"N/A" }} {{ po.items.count }} Ksh {{ po.total_amount|intcomma }} {% if po.status == 'completed' %} Completed {% elif po.status == 'cancelled' %} Cancelled {% else %} Pending {% endif %} View
No purchase orders found for the selected period.
Total: Ksh {{ total_amount|intcomma }}
{% if purchases.has_other_pages %} {% endif %}
{% endblock %}