-
Notifications
You must be signed in to change notification settings - Fork 70
/
_shipping.html.twig
33 lines (29 loc) · 1.82 KB
/
_shipping.html.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{% import '@SyliusAdmin/Common/Macro/money.html.twig' as money %}
{% set shipmentRefundType = constant('Sylius\\RefundPlugin\\Model\\RefundType::SHIPMENT') %}
{% for shippingAdjustment in order.getAdjustments('shipping') %}
{% set shipment = shippingAdjustment.shipment %}
<tr class="shipment">
<td class="single line">
{{ 'sylius.ui.shipment'|trans }}: {{ shippingAdjustment.label }}
</td>
<td class="right aligned total">
<span class="unit-total">{{ money.format(shipment.adjustmentsTotal, order.currencyCode) }}</span>
{% set refundedTotal = unit_refunded_total(shippingAdjustment.id, shipmentRefundType) %}
{% if refundedTotal != 0 %}
<br/><strong>{{ 'sylius_refund.ui.refunded'|trans }}:</strong> <span class="unit-refunded-total">{{ money.format(refundedTotal, order.currencyCode) }}</span>
{% endif %}
</td>
<td class="aligned collapsing partial-refund">
<div class="ui labeled input">
<div class="ui label">{{ order.currencyCode|sylius_currency_symbol }}</div>
{% set inputName = "sylius_refund_shipments["~shippingAdjustment.id~"][amount]" %}
<input data-refund-input type="number" step="0.01" name="{{ inputName }}" {% if not can_unit_be_refunded(shippingAdjustment.id, shipmentRefundType) %} disabled{% endif %}/>
</div>
</td>
<td class="aligned collapsing">
<button data-refund="{{ unit_refund_left(shippingAdjustment.id, shipmentRefundType, shipment.adjustmentsTotal) }}" type="button" class="ui button primary" {% if not can_unit_be_refunded(shippingAdjustment.id, shipmentRefundType) %} disabled{% endif %}>
{{ 'sylius_refund.ui.refund'|trans }}
</button>
</td>
</tr>
{% endfor %}