<commit_before>{% set shippingAdjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::SHIPPING_ADJUSTMENT') %}
{% set taxAdjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::TAX_ADJUSTMENT') %}

<table class="ui celled padded table">
    <thead>
    <tr>
        <th class="two wide"></th>
        <th>{{ 'sylius.ui.order_item_product'|trans }}</th>
        <th class="one wide">{{ 'sylius.order_item.quantity'|trans }}</th>
        <th class="two wide">{{ 'sylius.ui.unit_price'|trans }}</th>
        <th class="two wide">{{ 'sylius.ui.total'|trans }}</th>
    </tr>
    </thead>
    <tbody>
    {% for item in order.items %}
        {% set variant = item.variant %}
        {% set product = variant.product %}
        <tr>
            <td class="center aligned">
                <a href="{{ path('sylius_backend_product_show', {'id': product.id}) }}" title="View {{ product.name|escape('html_attr') }} details.">
                    <img src="{{ product.image ? product.image.path|imagine_filter('sylius_small') : 'http://placehold.it/90x60' }}" />
                </a>
            </td>
            <td class="single line">
                <a href="{{ path('sylius_backend_product_show', {'id': product.id}) }}">
                    <h4>{{ product.name }}</h4>
                </a>
                {% if product.hasOptions %}
                    <div class="ui list">
                        <div class="item">
                            <strong>{{ 'sylius.ui.sku'|trans }}</strong>: <code>{{ variant.sku|default('SKU') }}</code>
                        </div>
                        {% for option in variant.options %}
                            <div class="item">
                                <strong>{{ option.presentation }}</strong>: {{ option.value  }}
                            </div>
                        {% endfor %}
                    </div>
                {% endif %}
            </td>
            <td class="center aligned">
                {{ item.quantity }}
            </td>
            <td class="center aligned">
                {{ item.unitPrice|sylius_price(order.currency) }}
            </td>
            <td class="right aligned">
                {{ item.total|sylius_price(order.currency) }}
            </td>
        </tr>
    {% endfor %}
    </tbody>
    <tfoot class="full-width">
    <tr>
        <th colspan="5" id="items-total" class="right aligned">
            <strong>{{ 'sylius.ui.items_total'|trans }}</strong>:
            {{ order.itemsTotal|sylius_price(order.currency) }}
        </th>
    </tr>
    <tr>
        <th colspan="2" id="taxes">
            <h5>{{ 'sylius.ui.taxes'|trans }}</h5>
            {% set allOrderAdjustments = order.getAdjustmentsRecursively(taxAdjustment) %}
            {% if not allOrderAdjustments is empty %}
                <div class="ui relaxed divided list">
                    {% for taxLabel, taxAmount in sylius_aggregate_adjustments(allOrderAdjustments) %}
                        <div class="item">
                            {{ taxLabel }} {{ taxAmount|sylius_price(order.currency) }}
                        </div>
                    {% endfor %}
                </div>
            {% else %}
                <p><small>{{ 'sylius.order.no_taxes'|trans }}</small></p>
            {% endif %}
        </th>
        <th colspan="3" id="tax-total" class="right aligned">
            <strong>{{ 'sylius.ui.tax_total'|trans }}</strong>:
            {{ order.getAdjustmentsTotalRecursively(taxAdjustment)|sylius_price(order.currency) }}
        </th>
    </tr>
    <tr>
        <th colspan="2" id="shipping-charges">
            <h5>{{ 'sylius.ui.shipping_charges'|trans }}</h5>
            {% if not order.adjustments(shippingAdjustment).isEmpty() %}
                <div class="ui relaxed divided list">
                    {% for adjustment in order.adjustments(shippingAdjustment) %}
                        <div class="item">
                            {{ adjustment.label }} {{ adjustment.amount|sylius_price(order.currency) }}
                        </div>
                    {% endfor %}
                </div>
            {% else %}
                <p><small>{{ 'sylius.order.no_shipping_charges'|trans }}</small></p>
            {% endif %}
        </th>
        <th colspan="3" id="shipping-total" class="right aligned">
            <strong>{{ 'sylius.ui.shipping_total'|trans }}</strong>:
            {% set shippingTotal = order.adjustmentsTotal(taxAdjustment) + order.adjustmentsTotal(shippingAdjustment) %}
            {{ shippingTotal|sylius_price(order.currency) }}
        </th>
    </tr>
    <tr>
        <th colspan="5" id="total" class="ui large header right aligned">
            <strong>{{ 'sylius.ui.total'|trans }}</strong>:
            {{ order.total|sylius_price(order.currency) }}
        </th>
    </tr>
    </tfoot>
</table><commit_msg>[Admin][Order] Added seeing order's discounts feature<commit_after>{% set promotionAdjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::ORDER_PROMOTION_ADJUSTMENT') %}
{% set shippingAdjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::SHIPPING_ADJUSTMENT') %}
{% set taxAdjustment = constant('Sylius\\Component\\Core\\Model\\AdjustmentInterface::TAX_ADJUSTMENT') %}

<table class="ui celled padded table">
    <thead>
    <tr>
        <th class="two wide"></th>
        <th>{{ 'sylius.ui.order_item_product'|trans }}</th>
        <th class="one wide">{{ 'sylius.order_item.quantity'|trans }}</th>
        <th class="two wide">{{ 'sylius.ui.unit_price'|trans }}</th>
        <th class="two wide">{{ 'sylius.ui.total'|trans }}</th>
    </tr>
    </thead>
    <tbody>
    {% for item in order.items %}
        {% set variant = item.variant %}
        {% set product = variant.product %}
        <tr>
            <td class="center aligned">
                <a href="{{ path('sylius_backend_product_show', {'id': product.id}) }}" title="View {{ product.name|escape('html_attr') }} details.">
                    <img src="{{ product.image ? product.image.path|imagine_filter('sylius_small') : 'http://placehold.it/90x60' }}" />
                </a>
            </td>
            <td class="single line">
                <a href="{{ path('sylius_backend_product_show', {'id': product.id}) }}">
                    <h4>{{ product.name }}</h4>
                </a>
                {% if product.hasOptions %}
                    <div class="ui list">
                        <div class="item">
                            <strong>{{ 'sylius.ui.sku'|trans }}</strong>: <code>{{ variant.sku|default('SKU') }}</code>
                        </div>
                        {% for option in variant.options %}
                            <div class="item">
                                <strong>{{ option.presentation }}</strong>: {{ option.value  }}
                            </div>
                        {% endfor %}
                    </div>
                {% endif %}
            </td>
            <td class="center aligned">
                {{ item.quantity }}
            </td>
            <td class="center aligned">
                {{ item.unitPrice|sylius_price(order.currency) }}
            </td>
            <td class="right aligned">
                {{ item.total|sylius_price(order.currency) }}
            </td>
        </tr>
    {% endfor %}
    </tbody>
    <tfoot class="full-width">
    <tr>
        <th colspan="5" id="items-total" class="right aligned">
            <strong>{{ 'sylius.ui.items_total'|trans }}</strong>:
            {{ order.itemsTotal|sylius_price(order.currency) }}
        </th>
    </tr>
    <tr>
        <th colspan="2" id="taxes">
            <h5>{{ 'sylius.ui.taxes'|trans }}</h5>
            {% set allOrderAdjustments = order.getAdjustmentsRecursively(taxAdjustment) %}
            {% if not allOrderAdjustments is empty %}
                <div class="ui relaxed list">
                    {% for taxLabel, taxAmount in sylius_aggregate_adjustments(allOrderAdjustments) %}
                        <div class="item">
                            {{ taxLabel }} {{ taxAmount|sylius_price(order.currency) }}
                        </div>
                    {% endfor %}
                </div>
            {% else %}
                <p><small>{{ 'sylius.order.no_taxes'|trans }}</small></p>
            {% endif %}
        </th>
        <th colspan="3" id="tax-total" class="right aligned">
            <strong>{{ 'sylius.ui.tax_total'|trans }}</strong>:
            {{ order.getAdjustmentsTotalRecursively(taxAdjustment)|sylius_price(order.currency) }}
        </th>
    </tr>
    <tr>
        <th colspan="2" id="shipping-charges">
            <h5>{{ 'sylius.ui.shipping_charges'|trans }}</h5>
            {% if not order.adjustments(shippingAdjustment).isEmpty() %}
                <div class="ui relaxed list">
                    {% for adjustment in order.adjustments(shippingAdjustment) %}
                        <div class="item">
                            {{ adjustment.label }} {{ adjustment.amount|sylius_price(order.currency) }}
                        </div>
                    {% endfor %}
                </div>
            {% else %}
                <p><small>{{ 'sylius.order.no_shipping_charges'|trans }}</small></p>
            {% endif %}
        </th>
        <th colspan="3" id="shipping-total" class="right aligned">
            <strong>{{ 'sylius.ui.shipping_total'|trans }}</strong>:
            {% set shippingTotal = order.adjustmentsTotal(taxAdjustment) + order.adjustmentsTotal(shippingAdjustment) %}
            {{ shippingTotal|sylius_price(order.currency) }}
        </th>
    </tr>
    <tr>
        <th colspan="2" id="promotion-discounts">
            <h5>{{ 'sylius.checkout.finalize.order.promotion_discount'|trans }}</h5>
            {% if not order.adjustments(promotionAdjustment).isEmpty() %}
                <div class="ui relaxed list">
                    {% for adjustment in order.adjustments(promotionAdjustment) %}
                        <div class="item">
                            {{ adjustment.label }} {{ adjustment.amount|sylius_price(order.currency) }}
                        </div>
                    {% endfor %}
                </div>
            {% else %}
                <p><small>{{ 'sylius.checkout.finalize.order.no_promotion'|trans }}</small></p>
            {% endif %}
        </th>
        <th colspan="3" id="promotion-total" class="right aligned">
            <strong>{{ 'sylius.ui.promotion_total'|trans }}</strong>:
            {{ order.getPromotionsTotalRecursively()|sylius_price(order.currency) }}
        </th>
    </tr>
    <tr>
        <th colspan="5" id="total" class="ui large header right aligned">
            <strong>{{ 'sylius.ui.total'|trans }}</strong>:
            {{ order.total|sylius_price(order.currency) }}
        </th>
    </tr>
    </tfoot>
</table>
{'fraction_non_alphanumeric': 0.1652801901453515, 'fraction_numerical': 0.0032909772374074414, 'mean_word_length': 1.7274993767140363, 'pattern_counts': {'":': 0, '<': 219, '<?xml version=': 0, '>': 219, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4724017', 'n_tokens_mistral': 3353, 'n_tokens_neox': 3095, 'n_words': 553}