{% extends 'base.html.twig' %} {% set titleName = "Orders" %} {% block title %} POWER DATA | {{titleName}} {% endblock %} {% block page %}{{titleName}}{% endblock %} {% block breadcrumb %} {% if titleName != "Home" %} {{titleName}} {% endif %} {% endblock %} {% block css %} {% endblock %} {% block content %}
{% for message in app.flashes('success') %} {% endfor %} {% for message in app.flashes('error') %} {% endfor %}

DataTable with default features

{% for order in orders %} {% set region = order.region is defined ? order.region : '' %} {% if order.region is defined and order.shipper.type == "jax" %} {% set region = region_jax[region] %} {% elseif order.region is defined and order.shipper.type == "tunisiaExpress" %} {% set region = region_tunisia_express[region] %} {% endif %} {% endfor %}
Dolibarr Created At Created By Canal Shipper Region Total FullName Phone Action
{{ order.dolibarId }} {{ order.createdAt|date("d/m/Y") }} {{ order.createdBy.firstName }} {{ order.createdBy.lastName }} {{ order.canal.name }} {{ order.shipper.name }}[{{ order.shipper.type }}] {{ region }} {% 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 %} {% set total = order.shippingPrice + total %} {{ total }} {{ order.fullName is defined ? order.fullName : '' }} {{ order.phone is defined ? order.phone : '' }} {% if order.batch %} View {% endif %}
Dolibarr Created At Created By Canal Shipper Region Total FullName Phone Action
{% endblock %} {% block script %} {% endblock %}