templates/admin/fields/orderregels.html.twig line 1

Open in your IDE?
  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 parentEntity = entity.fqcn %}
  5. {% set tab = 'orderregels' %}
  6. {% set maxTextLength = 25 %}
  7. {% set hasBatchActions = 0 %}
  8. {% set countOne = 0 %}
  9.     {% if field.value|length == 1%}
  10. {% set countOne = 1 %}
  11. {% endif %}
  12. {% set urlBatchBestellen = ea_url()
  13.                 .setController('App\\Controller\\Admin\\OrderonderdeelSubController')
  14.                 .setAction('actionBatchBestellen')
  15.                 .unset('entityId')
  16.                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  17.                 .set('parentEntity', ea.getCrud().entityFqcn)
  18.                 .set('parentId', entity.instance.id)
  19.                 .set('tab', tab)
  20.                 .removeReferrer()
  21.                    %}
  22. {% set urlPost = ea_url()
  23.                 .setController('App\\Controller\\Admin\\Orderregel\\Sub\\OrderregelSubController')
  24.                 .unset('entityId')
  25.                 .removeReferrer()
  26.                    %}
  27.     {% if ea.crud.currentAction == 'detail' %}
  28.         <table class="table datagrid"> <thead>
  29.             <tr>
  30.                 {%  if hasBatchActions %}
  31.                     <th>
  32.                         <div class="form-check">
  33.                             <span><input type="checkbox" class="form-check-input form-batch-checkbox-all" id="form-batch-checkbox-all"></span>
  34.                         </div>
  35.                     </th>
  36.                 {%  endif %}
  37.                 <th>
  38.                     <div class="col-10"></div>
  39.                 </th>
  40.                 
  41.                 <th class="text-right">Bedrag</th>
  42.                 <th></th>
  43.             </tr>
  44.         </thead>
  45.         <tbody>
  46.             {% for value in field.value|sort((a, b)=> a.volgorde <=> b.volgorde) %}
  47.                 <tr data_id="{{ value.id}}">
  48.                     {%  if hasBatchActions %}
  49.                         <td
  50.                             class="batch-actions-selector">
  51.                             {# filter op geen bestelling#}
  52.                             {% if value.opslaglocatie %}
  53.                                 {%  if  not value.bestelling and value.opslaglocatie.id == opslaglocatieId %}
  54.                                     <div class="form-check">
  55.                                         <input type="checkbox" class="form-check-input form-batch-checkbox" id="form-batch-checkbox-0" value="{{ value.id }}" data-row-index="0">
  56.                                     </div>
  57.                                 {% endif %}
  58.                             {% endif %}
  59.                         </td>
  60.                     {% endif %}
  61.                     {% set bedrag = value.bedrag/100|number_format %}
  62.                     <td>{{ value.tekst|nl2br }}</td>
  63.                     
  64.                     <td class="align-bottom text-right">{{ bedrag|format_currency('EUR')  }}</td>
  65.                     <td class="actions actions-as-dropdown">
  66.                         <div class="dropdown dropdown-actions">
  67.                             <a class="dropdown" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  68.                                 <svg xmlns="http://www.w3.org/2000/svg" height="21" width="21" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  69.                                     <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"></path>
  70.                                 </svg>
  71.                             </a>
  72.                             <div class="dropdown-menu dropdown-menu-right">
  73.                                 {% set urldetail = ea_url()
  74.                                 .setController('App\\Controller\\Admin\\Orderregel\\Sub\\OrderregelSubController')
  75.                                 .setAction('detail')
  76.                                 .set('entityId' , value.id )
  77.                                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  78.                                 .set('parentEntity', ea.getCrud().entityFqcn)
  79.                                 .set('parentId', entity.instance.id)
  80.                                 .set('tab', tab)
  81.                                 %}
  82.                                 <a class="dropdown-item action-detail" href="{{ urldetail }}" data-action-name="detail">
  83.                                     <span class="action-label">Bekijk</span>
  84.                                     {% set bedrag = value.bedrag/100|number_format %}
  85.                                 </a>
  86.                                 {% set urledit = ea_url()
  87.                                 .setController('App\\Controller\\Admin\\Orderregel\\Sub\\OrderregelSubController')
  88.                                 .setAction('edit')
  89.                                 .set('entityId' , value.id )
  90.                                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  91.                                 .set('parentEntity', ea.getCrud().entityFqcn)
  92.                                 .set('parentId', entity.instance.id)
  93.                                 .set('tab', tab)
  94.                                 .removeReferrer()
  95.                                 %}
  96.                                 <a class="dropdown-item action-edit" href="{{ urledit }}" data-action-name="edit">
  97.                                     <span class="action-label">Bewerken</span>
  98.                                 </a>
  99.                                 {% if (countOne != 1) %}
  100.                                     {% set urlMoveDown = ea_url()
  101.                                 .setController('App\\Controller\\Admin\\Orderregel\\Sub\\OrderregelSubController')
  102.                                 .setAction('moveDown')
  103.                                 .set('entityId' , value.id )
  104.                                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  105.                                 .set('parentEntity', ea.getCrud().entityFqcn)
  106.                                 .set('parentId', entity.instance.id)
  107.                                 .set('tab', tab)
  108.                                 .removeReferrer()
  109.                                 %}
  110.                                     <a class="dropdown-item action-edit" href="{{ urlMoveDown }}" data-action-name="moveDown">
  111.                                         {% if loop.last %}
  112.                                             <span class="action-label">Verplaats
  113.                                                 <i class="fa-solid fa-sort-amount-up"></i>
  114.                                             </span>
  115.                                         {% else %}
  116.                                             <span class="action-label">Verplaats
  117.                                                 <i class="fa-solid fa-long-arrow-alt-down"></i>
  118.                                             </span>
  119.                                         {% endif %}
  120.                                     </a>
  121.                                 {% endif %}
  122.                             </div>
  123.                         </div>
  124.                     </td>
  125.                 </tr>
  126.                 {# <tr><td colspan="13" ></td></tr> #}
  127.             {% endfor %}
  128.             <tr>
  129.                 {% set totaalBerekend = entity.instance.prijsBerekend / 100 %}
  130.                 {% set totaal = entity.instance.prijs / 100 %}
  131.                 {% if (totaal == totaalBerekend) %}
  132.                     <td>&nbsp;</td>
  133.                     <td class="align-bottom text-right"></td>
  134.                     <td></td>
  135.                 {% else %}
  136.                     <td class="text-danger">De berekende prijs is niet gelijk aan de ingevoerde prijs
  137.                         {{ totaal|format_currency('EUR') }}</td>
  138.                     <td class="align-bottom text-right text-danger">{{ totaalBerekend|format_currency('EUR') }}</td>
  139.                     <td></td>
  140.                 {% endif %}
  141.             </tr>
  142.             <tr>
  143.                 {#% set leges = value.leges/100|number_format %#}
  144.                 {% set leges = entity.instance.leges / 100 %}
  145.                 <td class="text-end font-weight-bold">Leges</td>
  146.                 <td class="align-bottom text-right">{{ leges|format_currency('EUR')  }}</td>
  147.                 <td class="actions actions-as-dropdown">
  148.                     <div class="dropdown dropdown-actions">
  149.                         <a class="dropdown" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  150.                             <svg xmlns="http://www.w3.org/2000/svg" height="21" width="21" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  151.                                 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"></path>
  152.                             </svg>
  153.                         </a>
  154.                         <div class="dropdown-menu dropdown-menu-right">
  155.                             {% set urledit = ea_url()
  156.                                 .setController('App\\Controller\\Admin\\Order\\Partial\\OrderPartialControllerLeges')
  157.                                 .setAction('edit')
  158.                                 .set('entityId' , entity.instance.id )
  159.                                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  160.                                 .set('parentEntity', ea.getCrud().entityFqcn)
  161.                                 .set('parentId', entity.instance.id)
  162.                                 .set('tab', tab)
  163.                                 .removeReferrer()
  164.                                 %}
  165.                             <a class="dropdown-item action-edit" href="{{ urledit }}" data-action-name="edit">
  166.                                 <span class="action-label">Bewerken</span>
  167.                             </a>
  168.                         </div>
  169.                     </div>
  170.                 </td>
  171.             </tr>
  172.             <tr>
  173.                 {% set eindTotaalBerekend = (entity.instance.prijsBerekend + entity.instance.leges) / 100 %}
  174.                 <td class="text-end">Totaal</td>
  175.                 <td class="align-bottom text-right">{{ eindTotaalBerekend|format_currency('EUR')  }}</td>
  176.                 <td></td>
  177.             </tr>
  178.         </tbody>
  179.     </table>
  180.     {% set url1 = ea_url()
  181.                 .setController('App\\Controller\\Admin\\Orderregel\\Sub\\OrderregelSubController')
  182.                 .setAction('new')
  183.                 .unset('entityId')
  184.                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  185.                 .set('parentEntity', ea.getCrud().entityFqcn)
  186.                 .set('parentId', entity.instance.id)
  187.                 .set('tab', tab)
  188.                 .removeReferrer()
  189.                 .generateUrl()
  190.               
  191.                 %}{% set url2 = ea_url()
  192.                 .setController('App\\Controller\\Admin\\Orderregel\\Partial\\OrderregelPartialControllerCopyRegel')
  193.                 .setAction('new')
  194.                 .unset('entityId')
  195.                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  196.                 .set('parentEntity', ea.getCrud().entityFqcn)
  197.                 .set('parentId', entity.instance.id)
  198.                 .set('tab', tab)
  199.                 .removeReferrer()
  200.                 .generateUrl()
  201.               
  202.                 %}<br><div class="container p-0">
  203.         <div class="d-flex flex-row-reverse ">
  204.             <div>
  205.                 <a class="action-new btn btn-primary d-inline-block " href="{{ url1 }}&menuIndex=2&submenuIndex=0">
  206.                     <span class="action-label">Maak nieuwe orderregel</span>
  207.                 </a>
  208.             </div>
  209.             <div class="me-2">
  210.                 <a class="action-new btn btn-primary d-inline-block " href="{{ url2 }}&menuIndex=2&submenuIndex=0">
  211.                     <span class="action-label">Kopieer standaardregel</span>
  212.                 </a>
  213.             </div>
  214.         </div>
  215.     </div>
  216. {% else %}
  217.     <span class="badge badge-secondary">{{ field.formattedValue }}</span>
  218. {% endif %}