{% if wireFrame.wireFrameFile is defined and wireFrame.wireFrameFile != null %}
{% set wireFrameFile = wireFrame.wireFrameFile %}
{% else %}
{% set wireFrameFile = 'eshopLayoutBasic.html.twig' %}
{% endif %}
{% extends wireFrameFile %}
{% block title %}{{ 'eshop.customer'|trans|raw }}{% endblock %}
{% block page_contents %}
<h1>{{ 'eshop.customer'|trans }}</h1>
<div class="customerMenuItem">
{% if contact is defined %}
{% set firstName = contact.firstName %}
{% set lastName = contact.lastName %}
{% else %}
{% set firstName = '' %}
{% set lastName = '' %}
{% endif %}
<span>{{ firstName }} {{ lastName }}</span>
<span><a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/editContact" class="greenButtonLink">{{'eshop.customer_edit'|trans }}</a></span>
<span><a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/logout" class="greenButtonLink">{{'eshop.logout'|trans }}</a></span>
<span><a href="{{ path('root') }}eshop/{{ eshop.eshopId }}" class="greenButtonLink">{{'PAGETYPE_HOMEPAGE'|trans }}</a></span>
</div>
<h2>{{'eshop.orders_history'|trans }}</h2>
<table class="itemList" cellspacing="0" cellpadding="0">
<tr>
<th class="itemListTitle">id</th>
<th class="itemListTitle">{{'system.date'|trans }}</th>
<th class="itemListTitle">{{'eshop.customer'|trans }}</th>
<th class="itemListTitle">{{'eshop.price'|trans }}</th>
<th class="itemListTitle">{{'system.items_upper'|trans }}</th>
<th class="itemListTitle">{{'eshop.order_status'|trans }}</th>
<th class="itemListTitle">{{'eshop.delivery'|trans }}</th>
<th class="itemListTitle">{{'eshop.payment'|trans }}</th>
<th class="itemListTitle">{{'eshop.payment_status'|trans }}</th>
<th class="itemListTitle">{{'system.ip'|trans }}</th>
<th class="itemListTitle"></th>
</tr>
{% for order in orderList %}
{% if order.eshopPayment is defined %}
{% set paymentName = order.eshopPayment.eshopPaymentName %}
{% else %}
{% set paymentName = '' %}
{% endif %}
<tr class="itemListRow">
<td class="itemListCell">{{ order.orderId }}</td>
<td class="itemListCell">
{% if order.dateCreated is defined %}
{{ order.dateCreated|date("Y-m-d h:i:s") }}
{% endif %}
</td>
<td class="itemListCell">
<strong>
{% set customerName = order.eshopContact.firstName ~ " " ~ order.eshopContact.lastName %}
{% set companyName = order.eshopContact.companyName %}
{{ customerName }} {{ companyName }}
</strong>
</td>
<td class="itemListCell">{{ orderPrices[order.orderId] }} {{ order.currencyKey }}</td>
<td class="itemListCell">{{ order.orderItems|length }}</td>
<td class="itemListCell">{{ order.status }}</td>
<td class="itemListCell">{{ order.eshopDelivery.eshopDeliveryName }}</td>
<td class="itemListCell">{{ paymentName }}</td>
<td class="itemListCell">{{ order.paymentStatus }}</td>
<td class="itemListCell">{{ order.ip }}</td>
<td class="itemListCell"><a href="{{ path('root') }}eshop/{{ eshop.eshopId }}/eshopOrderContact/{{ order.orderId }}" class="greenButtonLink">{{'system.view'|trans }}</a></td>
</tr>
{% endfor %}
</table>
<br><br>
{% if topProductContent is defined and topProductContent != '' %}
{{ topProductContent|raw }}
{% endif %}
{% endblock %}