<commit_before>{% import "Ceres::PageDesign.Macros.LayoutContainer" as LayoutContainer %}
{% import "Ceres::Basket.Macros.GetBasketTotals" as BasketTotals %}

{% set totalsConfigData = config("Ceres.basket.data")|split(', ') %}
{% set basketTotalsCurrency = BasketTotals.getCurrency( orderData ) %}

<div>
    <div class="row">
        <div class="col-md-6 m-b-2">
            <div class="card small">
                <!-- ORDER -->
                <div class="card-header">
                    <h5>{{ trans("Ceres::Template.orderId") }} {{ orderData.order.id }}</h5>
                </div>
                <div class="card-block">
                    <div class="details">
                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderDate") }}</strong>
                            <span class="col-xs-6 col-sm-7">{{ orderData.order.createdAt | date( trans("Ceres::Template.dateTimeFormat") ) }}</span>
                        </div>

                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderStatus") }}</strong>
                            <span class="col-xs-6 col-sm-7">{{ orderData.status.frontendName }}</span>
                        </div>
                    </div>

                    <hr>

                    <div>
                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderInvoiceAddress") }}</strong>
                            <span class="col-xs-6 col-sm-7">
                                                        <div>{{ orderData.order.billingAddress.name1 }}</div>
                                                        <div>{{ orderData.order.billingAddress.name2 }} {{ orderData.order.billingAddress.name3 }}</div>
                                                        <div>{{ orderData.order.billingAddress.name4 }}</div>
                                                        <div>{{ orderData.order.billingAddress.address1 }} {{ orderData.order.billingAddress.address2 }}</div>
                                                        <div>{{ orderData.order.billingAddress.postalCode }} {{ orderData.order.billingAddress.town }}</div>
                                                    </span>
                        </div>

                        <div class="row m-t-1">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderShippingAddress") }}</strong>
                            <span class="col-xs-6 col-sm-7">
                                                        {% if orderData.order.billingAddress.id == orderData.order.deliveryAddress.id %}
                                                            <span>
                                                                {{ trans("Ceres::Template.addressSameAsInvoice") }}
                                                            </span>
                                                        {% else %}
                                                            <span>
                                                                <div>{{ orderData.order.deliveryAddress.name1 }}</div>
                                                                <div>{{ orderData.order.deliveryAddress.name2 }} {{ orderData.order.deliveryAddress.name3 }}</div>
                                                                <div>{{ orderData.order.deliveryAddress.name4 }}</div>
                                                                <div>{{ orderData.order.deliveryAddress.address1 }} {{ orderData.order.deliveryAddress.address2 }}</div>
                                                                <div>{{ orderData.order.deliveryAddress.postalCode }} {{ orderData.order.deliveryAddress.town }}</div>
                                                            </span>
                                                        {% endif %}
                                                    </span>
                        </div>
                    </div>

                    <hr>

                    <div>
                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderPaymentMethod") }}</strong>
                            <span class="col-xs-6 col-sm-7">{{ orderData.paymentMethodName }}</span>
                        </div>
                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderPaymentStatus") }}</strong>

                            {% for propertyKey in orderData.order.properties %}
                                {% if orderData.order.properties[loop.index0].typeId ==  17 and orderData.order.properties[loop.index0].subTypeId == 3 %}
                                    {% set paymentState = orderData.order.properties[loop.index0].value %}
                                {% endif %}
                            {% endfor %}

                            {% if paymentState == "unpaid" %}
                                <span class="col-xs-6 col-sm-7">{{ trans("Ceres::Template.paymentStatus_unpaid") }}</span>
                            {% elseif paymentState == "prepaid" %}
                                <span class="col-xs-6 col-sm-7">{{ trans("Ceres::Template.paymentStatus_prepaid") }}</span>
                            {% elseif paymentState == "partlyPaid" %}
                                <span class="col-xs-6 col-sm-7">{{ trans("Ceres::Template.paymentStatus_partlyPaid") }}</span>
                            {% elseif paymentState == "fullyPaid" %}
                                <span class="col-xs-6 col-sm-7">{{ trans("Ceres::Template.paymentStatus_fullyPaid") }}</span>
                            {% elseif paymentState == "overpaid" %}
                                <span class="col-xs-6 col-sm-7">{{ trans("Ceres::Template.paymentStatus_overpaid") }}</span>
                            {% endif %}
                        </div>

                        {{ LayoutContainer.show("Ceres::OrderConfirmation.AdditionalPaymentInformation", services.customer.getLatestOrder().order) }}

                    </div>

                    <hr>

                    <div>
                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderShippingProfile") }}</strong>
                            <span class="col-xs-6 col-sm-7">{{ orderData.shippingProvider }} - {{ orderData.shippingProfileName }}</span>
                        </div>

                        <div class="row" v-if="shippingDate">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderEstimatedShippingDate") }}</strong>
                            {% for date in orderData.order.dates %}
                                {% if date.typeId == 8 %}
                                    {% set shippingDate = date %}
                                {% endif %}
                            {% endfor %}
                            <span class="col-xs-6 col-sm-7">{{ shippingDate | date( trans("Ceres::Template.dateFormat") ) }}" }}</span>
                        </div>
                    </div>

                </div>
                <!-- ORDER -->
            </div>

        </div>

        <div class="col-md-6">
            <div class="confirmation-order-list">
<commit_msg>use newly implemented twig filter for json encoded dateTime<commit_after>{% import "Ceres::PageDesign.Macros.LayoutContainer" as LayoutContainer %}
{% import "Ceres::Basket.Macros.GetBasketTotals" as BasketTotals %}

{% set totalsConfigData = config("Ceres.basket.data")|split(', ') %}
{% set basketTotalsCurrency = BasketTotals.getCurrency( orderData ) %}

<div>
    <div class="row">
        <div class="col-md-6 m-b-2">
            <div class="card small">
                <!-- ORDER -->
                <div class="card-header">
                    <h5>{{ trans("Ceres::Template.orderId") }} {{ orderData.order.id }}</h5>
                </div>
                <div class="card-block">
                    <div class="details">
                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderDate") }}</strong>
                            <span class="col-xs-6 col-sm-7">{{ orderData.order.createdAt | formatDateTime | date( trans("Ceres::Template.dateTimeFormat") ) }}</span>
                        </div>

                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderStatus") }}</strong>
                            <span class="col-xs-6 col-sm-7">{{ orderData.status.frontendName }}</span>
                        </div>
                    </div>

                    <hr>

                    <div>
                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderInvoiceAddress") }}</strong>
                            <span class="col-xs-6 col-sm-7">
                                                        <div>{{ orderData.order.billingAddress.name1 }}</div>
                                                        <div>{{ orderData.order.billingAddress.name2 }} {{ orderData.order.billingAddress.name3 }}</div>
                                                        <div>{{ orderData.order.billingAddress.name4 }}</div>
                                                        <div>{{ orderData.order.billingAddress.address1 }} {{ orderData.order.billingAddress.address2 }}</div>
                                                        <div>{{ orderData.order.billingAddress.postalCode }} {{ orderData.order.billingAddress.town }}</div>
                                                    </span>
                        </div>

                        <div class="row m-t-1">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderShippingAddress") }}</strong>
                            <span class="col-xs-6 col-sm-7">
                                                        {% if orderData.order.billingAddress.id == orderData.order.deliveryAddress.id %}
                                                            <span>
                                                                {{ trans("Ceres::Template.addressSameAsInvoice") }}
                                                            </span>
                                                        {% else %}
                                                            <span>
                                                                <div>{{ orderData.order.deliveryAddress.name1 }}</div>
                                                                <div>{{ orderData.order.deliveryAddress.name2 }} {{ orderData.order.deliveryAddress.name3 }}</div>
                                                                <div>{{ orderData.order.deliveryAddress.name4 }}</div>
                                                                <div>{{ orderData.order.deliveryAddress.address1 }} {{ orderData.order.deliveryAddress.address2 }}</div>
                                                                <div>{{ orderData.order.deliveryAddress.postalCode }} {{ orderData.order.deliveryAddress.town }}</div>
                                                            </span>
                                                        {% endif %}
                                                    </span>
                        </div>
                    </div>

                    <hr>

                    <div>
                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderPaymentMethod") }}</strong>
                            <span class="col-xs-6 col-sm-7">{{ orderData.paymentMethodName }}</span>
                        </div>
                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderPaymentStatus") }}</strong>

                            {% for propertyKey in orderData.order.properties %}
                                {% if orderData.order.properties[loop.index0].typeId ==  17 and orderData.order.properties[loop.index0].subTypeId == 3 %}
                                    {% set paymentState = orderData.order.properties[loop.index0].value %}
                                {% endif %}
                            {% endfor %}

                            {% if paymentState == "unpaid" %}
                                <span class="col-xs-6 col-sm-7">{{ trans("Ceres::Template.paymentStatus_unpaid") }}</span>
                            {% elseif paymentState == "prepaid" %}
                                <span class="col-xs-6 col-sm-7">{{ trans("Ceres::Template.paymentStatus_prepaid") }}</span>
                            {% elseif paymentState == "partlyPaid" %}
                                <span class="col-xs-6 col-sm-7">{{ trans("Ceres::Template.paymentStatus_partlyPaid") }}</span>
                            {% elseif paymentState == "fullyPaid" %}
                                <span class="col-xs-6 col-sm-7">{{ trans("Ceres::Template.paymentStatus_fullyPaid") }}</span>
                            {% elseif paymentState == "overpaid" %}
                                <span class="col-xs-6 col-sm-7">{{ trans("Ceres::Template.paymentStatus_overpaid") }}</span>
                            {% endif %}
                        </div>

                        {{ LayoutContainer.show("Ceres::OrderConfirmation.AdditionalPaymentInformation", services.customer.getLatestOrder().order) }}

                    </div>

                    <hr>

                    <div>
                        <div class="row">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderShippingProfile") }}</strong>
                            <span class="col-xs-6 col-sm-7">{{ orderData.shippingProvider }} - {{ orderData.shippingProfileName }}</span>
                        </div>

                        <div class="row" v-if="shippingDate">
                            <strong class="col-xs-6 col-sm-5">{{ trans("Ceres::Template.orderEstimatedShippingDate") }}</strong>
                            {% for date in orderData.order.dates %}
                                {% if date.typeId == 8 %}
                                    {% set shippingDate = date %}
                                {% endif %}
                            {% endfor %}
                            <span class="col-xs-6 col-sm-7">{{ shippingDate | date( trans("Ceres::Template.dateFormat") ) }}</span>
                        </div>
                    </div>

                </div>
                <!-- ORDER -->
            </div>

        </div>

        <div class="col-md-6">
            <div class="confirmation-order-list">

{'fraction_non_alphanumeric': 0.13455292636044278, 'fraction_numerical': 0.008616689865447074, 'mean_word_length': 1.0427836447332792, 'pattern_counts': {'":': 0, '<': 217, '<?xml version=': 0, '>': 217, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 96, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5819959', 'n_tokens_mistral': 3636, 'n_tokens_neox': 3387, 'n_words': 559}