|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% macro list_reduction_credits(reductionCredits, user) %} |
|
|
{% macro list_reduction_credits(reductionCredits, user) %} |
|
|
|
|
|
{% set merchant_current = merchantUtils.getMerchantCurrent() %} |
|
|
<table class="table table-condensed"> |
|
|
<table class="table table-condensed"> |
|
|
<thead> |
|
|
<thead> |
|
|
<tr> |
|
|
<tr> |
|
|
|
|
|
|
|
|
</thead> |
|
|
</thead> |
|
|
<tbody> |
|
|
<tbody> |
|
|
{% for reductionCredit in reductionCredits %} |
|
|
{% for reductionCredit in reductionCredits %} |
|
|
{% set isUsed = orderUtils.isReductionCreditUsed(reductionCredit, user) %} |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>{{ reductionCredit.title }}</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
{{ reductionCredit.value|format_price(false) }} |
|
|
|
|
|
</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
{% include '@EasyAdmin/default/field_boolean.html.twig' with {value: reductionCredit.status} %} |
|
|
|
|
|
</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
{% include '@EasyAdmin/default/field_boolean.html.twig' with {value: isUsed} %} |
|
|
|
|
|
</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
{% if isUsed == false %} |
|
|
|
|
|
{{ _self.button('ReductionCredit', 'edit', reductionCredit.id, 'primary') }} |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
|
|
|
{% if reductionCredit.getMerchant() == merchant_current %} |
|
|
|
|
|
{% set isUsed = orderUtils.isReductionCreditUsed(reductionCredit, user) %} |
|
|
|
|
|
<tr> |
|
|
|
|
|
<td>{{ reductionCredit.title }}</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
{{ reductionCredit.value|format_price(false) }} |
|
|
|
|
|
</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
{% include '@EasyAdmin/default/field_boolean.html.twig' with {value: reductionCredit.status} %} |
|
|
|
|
|
</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
{% include '@EasyAdmin/default/field_boolean.html.twig' with {value: isUsed} %} |
|
|
|
|
|
</td> |
|
|
|
|
|
<td> |
|
|
|
|
|
{% if isUsed == false %} |
|
|
|
|
|
{{ _self.button('ReductionCredit', 'edit', reductionCredit.id, 'primary') }} |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
</td> |
|
|
|
|
|
</tr> |
|
|
|
|
|
{% endif %} |
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
</tbody> |
|
|
</tbody> |
|
|
</table> |
|
|
</table> |