src/Flexy/FrontBundle/Themes/IlaveU/templates/admin/shopadmin/order/field/fullRestAmount.html.twig line 1

  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #}
  3. {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
  4. {% set order = entity.instance %}
  5. {% set reductionPromo = 0 %}
  6. {% if order.metaData|length >  0 %}
  7. {% set reductionPromo = getMetaDataValue(order.metaData,"applied_cashback_amt") %}
  8. {% endif %}
  9. {% set adjustedFullRestAmount = order.fullRestAmount - reductionPromo %}
  10. {% set badgeStyle = "badge-warning" %}
  11. {% if adjustedFullRestAmount  > 0 and  adjustedFullRestAmount < order.fullTotalAmount %}
  12. {% set badgeStyle = "badge-danger" %}
  13. {% elseif adjustedFullRestAmount == 0 %}
  14. {% set badgeStyle = "badge-success" %}
  15. {% endif %}
  16. <span class="badge {{badgeStyle}}" >
  17. <b>
  18. {{ adjustedFullRestAmount}} {{settings.get.currency}}
  19. </b>
  20. </span>
  21.