{% from 'batches/form.html' import batch_add_form %} {% macro pane_details(batch, form) %} {% if batch.is_empty %}
{% else %}
{% endif %}
{{ batch.supplier }} {{ batch.article_number }}

Ordered on {{ batch.date_ordered | format_date }}

{% if current_user.has_permission('Add consumable batches') %} {% if (not batch.in_use) and (batch.date_emptied is none) %} Mark open {% endif %} {% if batch.in_use and batch.date_emptied is none %} Mark empty {% endif %} {% endif %}

Storage place

{{ batch.storage_place }}

Lot number

{{ batch.lot }}

Amount

{{ batch.amount }}

Price

{{ batch.price }}€

{{ batch_add_form(form(None, obj=batch), "batches.edit", "PUT", batch.id, batch.consumable_id) }} {% endmacro %} {% macro batch_pane(status, pane_id, consumable, form) %}

Batches

{% if current_user.has_permission('Add consumable batches') %} {% endif %}
{% for batch in consumable.batches %} {{ pane_details(batch, form) }} {% else %}
No batches found!
{% endfor %} {{ batch_add_form(form(), "batches.add", "POST", -1, consumable.id) }}
{% endmacro %}