{% extends "inventory/base.html" %} {% block title %}Import{% endblock %} {% block content %}

Import movements (CSV)

Required columns: date, sku, warehouse, kind, qty. Optional: unit_cost, reference, to_warehouse, expiry_date. Kinds: receipt (needs unit_cost), issue, transfer (needs to_warehouse), adjustment (signed qty), return. The whole file is rejected if any row is invalid, or if it would drive any warehouse stock negative.

{% csrf_token %}
{% if result %}
{% if result.errors %}

{{ result.errors|length }} problem{{ result.errors|length|pluralize }} found - nothing imported

{% for line, msg in result.errors %}{% endfor %}
LineProblem
{{ line }}{{ msg }}
{% else %}

{{ result.rows|length }} valid rows

File is valid. Use "Validate and import" to load it.

{% for r in result.rows|slice:":15" %}{% endfor %}
LineDateSKUWarehouseKindQtyUnit cost
{{ r.line }}{{ r.date }}{{ r.sku }}{{ r.warehouse }}{{ r.kind }}{{ r.qty }}{{ r.unit_cost|default_if_none:"" }}
{% endif %}
{% endif %} {% endblock %}