{% load humanize %} Weekly Business Report - {{ business_name }}
{% if business_logo %} {{ business_name }} {% endif %}

Weekly Performance Report

{{ metadata.week_label }}

Credit Management

Overview of customer credit accounts and payment status

{% if credit_management.has_alerts %}
Action Required: {{ credit_management.overdue_count }} overdue payment{% if credit_management.overdue_count != 1 %}s{% endif %} totaling KES {{ credit_management.total_overdue|floatformat:2|intcomma|default:"0.00" }}
{% endif %} {% if credit_management.top_outstanding %} {% for item in credit_management.top_outstanding %} {% endfor %}
Customer Due Date Location Status Amount
{{ item.customer_name }} {{ item.due_date|date:"M d, Y" }} {% if item.is_overdue %}
({{ item.days_outstanding }} days late) {% endif %}
{{ item.location }} {% if item.is_overdue %} Overdue {% else %} Current {% endif %} {{ item.amount|floatformat:2|intcomma }}
{% else %}
Excellent! No outstanding credits at this time.
{% endif %}
Total Outstanding KES {{ credit_management.total_outstanding|floatformat:2|intcomma }}
Overdue Amount KES {{ credit_management.total_overdue|floatformat:2|intcomma }}
Customers with Credit {{ credit_management.customers_with_credit }}

Sales Performance

Your sales metrics and top-performing products this week

Total Revenue
KES {{ sales_performance.total_revenue|floatformat:0|intcomma }}
{% if sales_performance.growth_percentage >= 0 %}▲{% else %}▼{% endif %} {{ sales_performance.growth_percentage|floatformat:1 }}% vs last week
Total Profit
KES {{ sales_performance.total_profit|floatformat:0|intcomma }}
{% widthratio sales_performance.total_profit sales_performance.total_revenue 100 as margin %} Margin: {{ margin|floatformat:1 }}%
{{ sales_performance.total_sales }}
Transactions
{{ sales_performance.avg_sale_value|floatformat:0|intcomma }}
Avg Sale
{{ sales_performance.prev_week_revenue|floatformat:0|intcomma }}
Last Week
{{ sales_performance.commissions.sales_count }}
Commissions
{% if sales_performance.top_products %}

Top Selling Products

{% for product in sales_performance.top_products %} {% endfor %}
# Product Category Units Revenue
{{ forloop.counter }} {{ product.name }} {{ product.category }} {{ product.units_sold }} {{ product.revenue|floatformat:0|intcomma }}
{% else %}
No sales recorded this week
{% endif %} {% if sales_performance.sales_by_location %}

Sales by Location

{% for location in sales_performance.sales_by_location %} {% endfor %}
{{ location.location }} {{ location.sales_count }} sales {{ location.revenue|floatformat:0|intcomma }}
{% endif %}

Expenses

Business expenses breakdown for this week

Total Expenses This Week KES {{ expenses.total_expenses|floatformat:2|intcomma }}
Previous Week KES {{ expenses.prev_week_expenses|floatformat:2|intcomma }}
Change {% if expenses.change_percentage >= 0 %}+{% endif %}{{ expenses.change_percentage|floatformat:1 }}%
{% if expenses.top_expenses %}

Top 10 Expenses

{% for expense in expenses.top_expenses %} {% endfor %}
# Description Category Date Amount
{{ forloop.counter }} {{ expense.reason }} {{ expense.category }} {{ expense.date|date:"M d" }} {{ expense.amount|floatformat:2|intcomma }}
{% endif %} {% if expenses.category_breakdown %}

By Category

{% for cat in expenses.category_breakdown %} {% endfor %}
Category Transactions Total Amount
{{ cat.category }} {{ cat.count }} {{ cat.amount|floatformat:2|intcomma }}
{% endif %} {% if not expenses.top_expenses and not expenses.category_breakdown %}
No expenses recorded this week
{% endif %}

Inventory Alerts

Stock levels requiring attention

{% if inventory_alerts.has_critical_alerts %}
Critical Alert: {{ inventory_alerts.out_of_stock_count }} product{% if inventory_alerts.out_of_stock_count != 1 %}s{% endif %} out of stock
{% endif %} {% if inventory_alerts.low_stock_items %}

Low Stock Items

{% for item in inventory_alerts.low_stock_items %} {% endfor %}
Product Category Quantity Est. Value
{{ item.name }} {{ item.category }} {{ item.quantity }} left {{ item.estimated_value|floatformat:2|intcomma }}
{% endif %} {% if inventory_alerts.out_of_stock_items %}

Out of Stock

{% for item in inventory_alerts.out_of_stock_items %} {% endfor %}
Product Category Status
{{ item.name }} {{ item.category }} Out of Stock
{% endif %} {% if not inventory_alerts.low_stock_items and not inventory_alerts.out_of_stock_items %}
Excellent! All inventory levels are within acceptable ranges.
{% endif %}