{% load simpelcore_tags %}

{% regroup object.items.all by group_verbose as group_list %}
{% for group in group_list %}
  {% if show_group %}
    <tr>
      <td colspan="5"><strong>{{ group.grouper }}</strong></td>
    </tr>
  {% endif %}
  {% for item in group.list %}
    <tr>
      <td>{{ item.inner_id }}</td>
      <td>{{ item.product.name }}</td>
      <td class="text-end" width="130">{{ item.subtotal|currency }}</td>
      <td class="text-end">{{ item.quantity }} {{ item.product.unit }}</td>
      <td class="text-end" width="130">{{ item.total|currency }}</td>
    </tr>
  {% endfor %}
  {% block summary %}{% endblock summary %}
{% endfor %}
