src/IlaveU/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. {# hire #}
  11. {% if adjustedFullRestAmount < 0 %}
  12. {% set adjustedFullRestAmount = 0 %}
  13. {% endif %}
  14. {% set orderAmount = order.commercialTotalAmount %}
  15. {% if reductionPromo %}
  16. {% set orderAmount = order.commercialTotalAmount - reductionPromo %}
  17. {% endif %}
  18. {# end #}
  19. {% set badgeStyle = "badge-warning" %}
  20. {#{% if adjustedFullRestAmount  > 0 and  adjustedFullRestAmount < order.fullTotalAmount %}#}
  21. {% if adjustedFullRestAmount  > 0 and  adjustedFullRestAmount < orderAmount %}
  22. {% set badgeStyle = "badge-danger" %}
  23. {% elseif adjustedFullRestAmount == 0 %}
  24. {% set badgeStyle = "badge-success" %}
  25. {% endif %}
  26. <span class="badge {{badgeStyle}}" >
  27. <b>
  28. {{ adjustedFullRestAmount}} {{settings.get.currency}}
  29. </b>
  30. </span>
  31.