edit.phtml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. ?>
  6. <?php
  7. /** @var \Magento\Backend\Block\Template $block */
  8. /** @var \Temando\Shipping\ViewModel\Pickup\PickupItems $viewModel */
  9. $viewModel = $block->getData('pickupViewModel');
  10. ?>
  11. <section class="admin__page-section">
  12. <div class="admin__page-section-title">
  13. <span class="title"><?= $block->escapeHtml(__('Items Ordered')) ?></span>
  14. </div>
  15. <div class="admin__table-wrapper">
  16. <table class="data-table admin__table-primary order-shipment-table">
  17. <thead>
  18. <tr class="headings">
  19. <th class="col-product"><span><?= $block->escapeHtml(__('Description')) ?></span></th>
  20. <th class="col-sku"><span><?= $block->escapeHtml(__('Sku')) ?></span></th>
  21. <th class="col-weight"><span><?= $block->escapeHtml(__('Weight')) ?></span></th>
  22. <th class="col-qty-ordered"><span><?= $block->escapeHtml(__('Qty Ordered')) ?></span></th>
  23. <th class="col-qty-fulfilled"><span><?= $block->escapeHtml(__('Qty Fulfilled')) ?></span></th>
  24. <th class="col-qty-prepared"><span><?= $block->escapeHtml(__('Qty Prepared')) ?></span></th>
  25. <th class="col-qty last"><span><?= $block->escapeHtml(__('Qty Packed')) ?></span></th>
  26. </tr>
  27. </thead>
  28. <?php /** @var \Magento\Sales\Model\Order\Item[] $items */ ?>
  29. <?php $items = $viewModel->getAllOrderItems(); ?>
  30. <?php foreach ($items as $index => $item) : ?>
  31. <tbody class="<?= $block->escapeHtml(($index % 2) ? 'even' : 'odd') ?>">
  32. <tr>
  33. <td class="col-product"><div><?= $block->escapeHtml($item->getName()) ?></div></td>
  34. <td class="col-sku"><div><?= $block->escapeHtml($item->getSku()) ?></div></td>
  35. <td class="col-weight"><div><?= $block->escapeHtml($item->getWeight()) ?></div></td>
  36. <td class="col-qty-ordered">
  37. <div><?= $block->escapeHtml((int) $item->getQtyOrdered()) ?></div>
  38. </td>
  39. <td class="col-qty-fulfilled">
  40. <div><?= $block->escapeHtml((int) $item->getQtyShipped()) ?></div>
  41. </td>
  42. <td class="col-qty-prepared">
  43. <div><?= $block->escapeHtml($viewModel->getQtyPrepared($item->getSku())) ?></div>
  44. </td>
  45. <td class="col-qty">
  46. <div>
  47. <?php
  48. $qtyToPack = $item->getQtyToShip() - $viewModel->getQtyPrepared($item->getSku());
  49. $validationClass = sprintf('digits-range-0-%d', $qtyToPack);
  50. ?>
  51. <input type="text"
  52. id="<?= $block->escapeHtml('pickup-qty-packed-' . $item->getItemId())?>"
  53. name="pickup[items][<?= $block->escapeHtml($item->getItemId()) ?>]"
  54. <?php // @codingStandardsIgnoreLine ?>
  55. class="input-text admin__control-text qty-item required-entry validate-digits-range <?= /* @noEscape */ $validationClass ?>"
  56. value="<?= $block->escapeHtml($qtyToPack) ?>"
  57. />
  58. </div>
  59. </td>
  60. </tr>
  61. </tbody>
  62. <?php endforeach; ?>
  63. </table>
  64. </div>
  65. </section>
  66. <section class="admin__page-section-item-content order-totals-actions">
  67. <div class="actions">
  68. <?= /** @noEscape */ $block->getChildHtml('submit_button') ?>
  69. </div>
  70. </section>