{% set total = 0 %}
{% for item in order.data %}
{% set total = total + (item.price * item.qty) %}
{% endfor %}
{% if order.voucher is not null and order.voucher.application == constant('App\\Entity\\Power\\Voucher::APPLICATION_TYPE_PRODUCT') %}
{% if order.voucher.discountType == constant('App\\Entity\\Power\\Voucher::DISCOUNT_TYPE_FIX') %}
{% set total = total - order.voucher.discountValue %}
{% elseif order.voucher.discountType == constant('App\\Entity\\Power\\Voucher::DISCOUNT_TYPE_PERCENT') %}
{% set total = total - (total * (order.voucher.discountValue/100)) %}
{% endif %}
{% set total = (total < 0) ? 0 : total %}
{% endif %}
{{ total }}
{{ order.shippingPrice }}
{{ order.createdAt|date("d/m/Y") }}
{{ order.canal.name is defined ? order.canal.name :'' }}
View
{% if (is_granted('ROLE_ADMIN') or is_granted('ROLE_BATCH_MANAGER') ) and (batch.status == 1 or batch.status == 2) %}
{% endif %}
{% if order.shipper.type == 'first' and order.urlFirstPdf is not null %}
Print
{% endif %}