{% extends 'base.html' %} {% block body %}

Classification Breakdown

Largest Shortage:

Largest Excess:

Total Shortage:

Total Excess:

Revenue

Shortage

Excess

Top 10 Shortages

Largest Shortage:

{% for sku in shortages %} {% for cur in currency if (cur.id == sku.currency_id) and (loop.index == 1) %} {% set sym = cur.symbol %} {% autoescape false %}

{{ largest.sku.sku_id }}

{{ sym }}{{ "{:,.2f}".format(largest.shortage_cost) }}

{% endautoescape %} {% endfor %} {% endfor %}

{{ largest.shortages }} units

Total Shortage:

{% set total = 0 %} {% for sku in shortages %} {% for cur in currency if (cur.id == sku.currency_id) and (loop.index == 1) %} {% set sym = cur.symbol %} {% autoescape false %}

{{ sym }} {% endautoescape %} {% endfor %} {% set total = total + sku.shortage_cost %} {% if loop.last %} {{ "{:,.2f}".format(total) }}

{% else %} {% endif %} {% endfor %}

Percentage of Top 10 SKUs at Risk of Stock-Out

{% set risk = 0 %} {% for sku in shortages %} {% if sku.traffic_light == 'white' %} {% set risk = risk + 1 %} {% if loop.last %} {{ (risk/10) * 100 }} % {% endif %} {% endif %} {% endfor %}

Most Understocked SKU

{% set net_stock = 0 %} {% set understocked_qty = 0 %} {% for sku in shortages %} {% set net_stock = sku.quantity_on_hand - sku.reorder_level %} {% if ((net_stock |abs) > understocked_qty) %} {% set understocked_sku = sku.sku.sku_id %} {% set understocked_rol = sku.reorder_level %} {% set understocked_qoh = sku.quantity_on_hand %} {% endif %} {% if (loop.last) %}

{{ understocked_sku }}

qty on hand: {{ understocked_qoh }} units

reorder level: {{ understocked_rol }} units

{% endif %} {% endfor %}

Top 10 Shortage Cost by SKU

Top 10 Shortage Cost by Classification

{% for sku in shortages %} {% for cur in currency if (cur.id == sku.currency_id) %} {% autoescape false %} {% set sym = cur.symbol %} {% endautoescape %} {% endfor %} {% endfor %}
SKU Quantity on Hand Average Orders Shortage Shortage Cost Safety Stock Reorder Level Percentage Contribution Revenue Rank Classification
{{ sku.sku.sku_id }} {{ "{:,}".format(sku.quantity_on_hand) }} {{ "{:,}".format(sku.average_orders) }} {{ "{:,}".format(sku.shortages) }} {{ sym }}{{ "{:,.2f}".format(sku.shortage_cost) }} {{ "{:,}".format(sku.safety_stock) }} {{ "{:,}".format(sku.reorder_level) }} {{ "{:,.2f}".format(sku.percentage_contribution_revenue) }} {{ "{:,}".format(sku.revenue_rank) }} {{ sku.abc_xyz_classification }}

Top 10 Excess

Top Excess:

{% for sku in excess %} {% for cur in currency if (cur.id == sku.currency_id) and (loop.index == 1) %} {% set sym = cur.symbol %} {% autoescape false %}

{{ largest_excess.sku.sku_id }}

{{ sym }}{{ "{:,.2f}".format(largest_excess.excess_cost) }}

{{ "{:,}".format(largest_excess.excess_stock) }} units

{% endautoescape %} {% endfor %} {% endfor %}

Total Excess:

{% set total = 0.0 %} {% for sku in excess %} {% for cur in currency if (cur.id == sku.currency_id) and (loop.index == 1) %} {% set sym = cur.symbol %} {% autoescape false %}

{{ sym }} {% endautoescape %} {% endfor %} {% set total = (total| float) + (sku.excess_cost|float) %} {% if loop.last %} {{ "{:,.2f}".format(total) }}

{% endif %} {% endfor %}

Top 10 Excess as % of Inventory Value:

{% set total = 0 %} {% set top_excess = 0 %} {% set count = 0 %} {% for sku in excess %} {% for cur in currency if (cur.id == sku.currency_id) and (loop.index == 1) %} {% set sym = cur.symbol %} {% autoescape false %}

{% endautoescape %} {% endfor %} {% set total = (total |float) + (sku.excess_cost |float) %} {% set count = (count |int) + 1 %} {% if loop.last %} {{ "{:,.2f}".format(((total| float)/(count| int) * 100) )}}

{% endif %} {% endfor %}

Excess Holding Cost

{% set total = 0 %} {% set total_holding_cost = 0 %} {% for sku in excess %} {% for cur in currency if (cur.id == sku.currency_id) and (loop.index == 1) %} {% set sym = cur.symbol %} {% autoescape false %}

{{ sym }} {% endautoescape %} {% endfor %} {% set total_holding_cost = total_holding_cost + ((sku.quantity_on_hand |float) * ((sku.unit_cost |float) * 0.25)) %} {% if loop.last %} {{ "{:,.2f}".format(total_holding_cost) }}

{% else %} {% endif %} {% endfor %}

Top 10 Excess Cost by SKU

Top 10 Excess Cost by Classification

{% for sku in excess %} {% for cur in currency if (cur.id == sku.currency_id) %} {% autoescape false %} {% set sym = cur.symbol %} {% endautoescape %} {% endfor %} {% endfor %}
SKU Quantity on Hand Average Orders Excess Excess Cost Safety Stock Reorder Level Percentage Contribution Revenue Rank Classification
{{ sku.sku.sku_id }} {{ "{:,}".format(sku.quantity_on_hand) }} {{ "{:,}".format(sku.average_orders) }} {{ "{:,}".format(sku.excess_stock) }} {{ sym }}{{ "{:,.2f}".format(sku.excess_cost) }} {{ "{:,}".format(sku.safety_stock) }} {{ "{:,}".format(sku.reorder_level) }} {{ "{:,.2f}".format(sku.percentage_contribution_revenue) }} {{ "{:,}".format(sku.revenue_rank) }} {{ sku.abc_xyz_classification }}
{% endblock %}