{% extends "pos/base.html" %} {% load static %} {% block title %}FIFO Audit & Reconcile{% endblock %} {% block stylesheets %} {% endblock %} {% block content %}

FIFO Audit & Reconcile

Products where FIFO layer qty ≠ present_stock
Total Mismatches
{{ total_mismatch }}
Stock > FIFO (Excess)
{{ total_excess }}
Stock < FIFO (Deficit)
{{ total_deficit }}
Showing {{ total_mismatch }} products
{% if mismatches %} {% for m in mismatches %} {# data-dbid = Django PK used for reconcile API #} {% endfor %}
Product Present Stock FIFO Total Difference Layers Action
{{ m.name }}
prod_id: {{ m.prod_id }}  |  db_id: {{ m.db_id }}
{{ m.present_stock|floatformat:4 }} {{ m.fifo_total|floatformat:4 }} {% if m.diff > 0 %}+{% endif %}{{ m.diff|floatformat:4 }} {{ m.layer_count }} {# Pass db_id to reconcile function #}
{% for layer in m.layers %} {% empty %} {% endfor %}
# Layer ID Qty Purchase Rate Layer Value
{{ forloop.counter }} {{ layer.id }} {{ layer.quantity|floatformat:4 }} {{ layer.purchase|floatformat:2 }} {{ layer.quantity|floatformat:2 }}
No FIFO layers — product has stock but no layers
{% else %}
All FIFO Layers Are In Sync!

Every product's FIFO layer total matches its present_stock.

{% endif %}
Reconciling…
{% endblock %} {% block javascripts %} {% endblock %}