{% load i18n %}
{% trans 'Number' %} | {% trans 'Date' %} | {% trans 'Purchased items' %} | {% trans 'Total' %} | {% if loyalty_program_enabled %}{% trans 'Loyalty points' %} | {% endif %}{% trans 'Payment method' %} | {% trans 'Status' %} | {% trans 'Invoice' %} | {% for order in object_list %}
---|---|---|---|---|---|---|---|
{{ order.number }} | {{ order.created }} | {{ order.purchaseditem_set.all|join:', ' }} | {{ order.get_total_display }} | {% if loyalty_program_enabled %}{% with order.loyalty_points_earned as loyalty_points_earned %} {% if loyalty_points_earned > 0 %} +{{ loyalty_points_earned }} {% endif %} {% endwith %} {% with order.loyalty_points_used as loyalty_points_used %} {% if loyalty_points_used > 0 %} -{{ loyalty_points_used }} {% endif %} {% endwith %} | {% endif %}{{ order.payment_method.get_method_display }} | {{ order.get_status_display }} {% if order.total > 0 and order.status == order.STATUS_AWAITING_PAYMENT %} {{ order.render_payment_button }} {% endif %} |
{% for invoice in order.invoices.all %}
{{ invoice }} {% empty %} {% if order.status != order.STATUS_AWAITING_PAYMENT and order.status != order.STATUS_CANCELLED %} {% trans 'Preparing...' %} {% endif %} {% endfor %} |