<?php
/**
 * @author Aitoc Team
 * @copyright Copyright (c) 2020 Aitoc (https://www.aitoc.com)
 * @package Aitoc_PreOrders
 */
?>
<?php
/**
 * Copyright © 2018 Aitoc. All rights reserved.
 * Developed by Alex Yakimovich
 */

// @codingStandardsIgnoreFile

?>
<?php
$item = $block->getItem();
$preOrderMessage = __('Pre-Ordered items can\'t be shipped');
?>
<tr>
    <td class="col-product">
        <?php if ($item->getIsPreOrder()): ?>
            <b>* <?= /* @escapeNotVerified */ __('Pre-Order') ?></b><br/>
        <?php endif; ?>
        <?= $block->getColumnHtml($item, 'name') ?>
    </td>
    <td class="col-ordered-qty"><?= $block->getColumnHtml($item, 'qty') ?></td>
    <td class="col-qty <?php if ($block->isShipmentRegular()): ?>last<?php endif; ?>">
        <?php if ($block->canShipPartiallyItem()): ?>
            <?php if ($item->getIsCanBeShipped()): ?>
                <input type="text"
                       class="input-text admin__control-text qty-item"
                       name="shipment[items][<?= /* @escapeNotVerified */ $item->getOrderItemId() ?>]"
                       value="<?= /* @escapeNotVerified */ $item->getQty()*1 ?>" />
            <?php else: ?>
                <input type="hidden"
                       name="shipment[items][<?= /* @escapeNotVerified */ $item->getOrderItemId() ?>]"
                       value="0" />
                <b><?= /* @escapeNotVerified */ $preOrderMessage ?></b>
            <?php endif; ?>
        <?php else: ?>
            <?= /* @escapeNotVerified */ $item->getQty()*1 ?>
        <?php endif; ?>
    </td>
    <?php if (!$block->canShipPartiallyItem()): ?>
        <?php if (!$item->getIsCanBeShipped()): ?>
            <td class="col-ship last">
                <input type="hidden" name="shipment[items][<?= /* @escapeNotVerified */ $item->getOrderItemId() ?>]" value="0" />
                <input type="checkbox" name="shipment[items][<?= /* @escapeNotVerified */ $item->getOrderItemId() ?>]" value="<?= /* @escapeNotVerified */ $item->getQty()*1 ?>" checked />
            </td>
        <?php else: ?>
            <input type="hidden"
                   name="shipment[items][<?= /* @escapeNotVerified */ $item->getOrderItemId() ?>]"
                   value="0" />
            <b><?= /* @escapeNotVerified */ $preOrderMessage ?></b>
        <?php endif; ?>

    <?php endif; ?>
</tr>
