{% extends "pos/base.html" %}
{% load static %}
{% block content %}
Product / Stock Utilization Report
Sale vs BOM Expected vs Actual Production — Variance Analysis
{# ─── Filter Form ──────────────────────────────────────────────────────────── #}
{% if has_results %}
{# ─── Export Buttons ───────────────────────────────────────────────────────── #}
{# ══════════════════════════════════════════════════════════════════════════ #}
{# SECTION 1 — SALE SUMMARY #}
{# ══════════════════════════════════════════════════════════════════════════ #}
| # |
Product Code |
Product Name |
Company |
Total Sold Qty |
Sale Amount |
{% for r in sale_summary %}
| {{ forloop.counter }} |
{{ r.code }} |
{{ r.name }} |
{{ r.company }} |
{{ r.total_qty|floatformat:2 }} |
{{ r.total_amount|floatformat:2 }} |
{% empty %}
|
Is date range mein koi sales nahi milein.
|
{% endfor %}
{% if sale_summary %}
| Totals: |
{{ total_sale_qty|floatformat:2 }} |
{{ total_sale_amt|floatformat:2 }} |
{% endif %}
{# ══════════════════════════════════════════════════════════════════════════ #}
{# SECTIONS 2 & 3 — EXPECTED (LEFT) + ACTUAL (RIGHT) SIDE BY SIDE #}
{# ══════════════════════════════════════════════════════════════════════════ #}
{# ── LEFT: BOM Expected ── #}
| Raw Code |
Raw Material |
Company |
BOM Qty/Unit |
Sold Qty |
Expected Usage |
Fin. Item |
{% for r in expected_detail %}
{{ r.raw_code }} |
{{ r.raw_name }} |
{{ r.company }} |
{{ r.bom_qty }} |
{{ r.sold_qty|floatformat:2 }} |
{{ r.exp_qty|floatformat:4 }}
|
{{ r.fin_code }} |
{% empty %}
|
Selected items ka koi BOM define nahi hai.
|
{% endfor %}
{% if expected_detail %}
| Total Expected: |
{{ total_exp_qty|floatformat:4 }} |
|
{% endif %}
{# ── RIGHT: Actual Utilization ── #}
| Raw Code |
Raw Material |
Dept |
Actual Qty |
Unit Cost |
Total Cost |
Run # |
{% for r in actual_detail %}
{{ r.raw_code }} |
{{ r.raw_name }} |
{{ r.dept }} |
{{ r.actual_qty|floatformat:4 }}
|
{{ r.unit_cost|floatformat:4 }} |
{{ r.total_cost|floatformat:2 }} |
{{ r.run_no }} |
{% empty %}
|
Is date range mein koi production run nahi mila.
|
{% endfor %}
{% if actual_detail %}
| Totals: |
{{ total_actual_qty|floatformat:4 }} |
|
{{ total_actual_cost|floatformat:2 }} |
|
{% endif %}
{# /row #}
{# ══════════════════════════════════════════════════════════════════════════ #}
{# SECTION 4 — VARIANCE ANALYSIS #}
{# ══════════════════════════════════════════════════════════════════════════ #}
| # |
Raw Code |
Raw Material Name |
Expected Usage |
Actual Usage |
Difference Qty |
Diff % |
Status |
{% for r in variance_rows %}
{# Row background by status #}
{% empty %}
|
Variance calculate karne ke liye pehle date range set karein.
|
{% endfor %}
{# Legend #}
{% elif request.GET %}
Is date range mein koi data nahi mila. Filters check karein.
{% else %}
Upar filters set karein aur Generate Report press karein.
{% endif %}
{% endblock %}
{% block javascripts %}
{% endblock %}