<?php Fun::lang() ?>
<div class="print_this_form">
    <h3><?php echo e(__('administrator.transfer_history')); ?></h3>
    <table id="print_table" width="100%" class="table table-striped table-hover " style="margin-top: 30px">
        <thead>
        <tr>
            <th>#</th>
            <th><?php echo e(__('administrator.transfer_date')); ?></th>
            <th><?php echo e(__('administrator.invoice')); ?></th>
            <th><?php echo e(__('administrator.user')); ?></th>
            <th><?php echo e(__('administrator.from_warehouse')); ?></th>
            <th><?php echo e(__('administrator.to_warehouse')); ?></th>
            <th><?php echo e(__('administrator.products')); ?></th>
            <th><?php echo e(__('administrator.barcode')); ?></th>
            <th><?php echo e(__('administrator.status')); ?></th>
            <th><?php echo e(__('administrator.qty')); ?></th>
        </tr>
        </thead>
        <tbody class="tbody">
        <?php $total_qty = 0; ?>
        <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php
            $user = findUser($row->user_id);
            $p_unit = findProductUnitByCode($row->barcode,'product');
            if($p_unit){
                $product = getProductById($p_unit->product_id);
                $size = findSize($p_unit->size_id);
            }else{
                $product=null;
                $size = null;
            }
            $total_qty += $row->qty;
            ?>
            <tr>
                <td><?php echo e($key+1); ?></td>
                <td><?php echo e(date('d-m-Y',strtotime($row->date))); ?></td>
                <td><a class="under-line cursor text-primary btn_show_transfer_stock_public" data-href="<?php echo e(route("transfer-stock.show", $row->id)); ?>?show=1"><?php echo e($row->invoice_number); ?></a></td>
                <td><?php echo e($user->name); ?></td>
                <td><?php echo e(findWarehouse($row->from_warehouse_id)->warehouse_name); ?></td>
                <td><?php echo e(findWarehouse($row->to_warehouse_id)->warehouse_name); ?></td>
                <td><?php echo e($product?$product->product_name:''); ?> <?php echo e($size?('( '.$size->size.' )'):''); ?></td>
                <td><?php echo e($row->barcode); ?></td>
                <td><?php echo checkRequestStatus($row->confirm_status); ?></td>
                <td><?php echo e($row->qty); ?></td>
            </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
        <tfoot>
        <tr>
            <td colspan="9" class="text-right"><?php echo e(__('administrator.total_qty')); ?></td>
            <td><?php echo e($total_qty); ?></td>
        </tr>
        </tfoot>
    </table>
    <div class="col-sm-12 col-xs-12">
        <div class="pagin">
            <?php echo Form::hidden('barcode_hide', @$row?$row->barcode:''); ?>

            <?php echo Form::hidden('warehouse_hide', @$row?$row->from_warehouse_id:''); ?>

            <?php echo Form::hidden('type_hidden', @$row?$row->tr_type:''); ?>

            <?php if(@$data): ?>
                <?php echo $data->render(); ?>

            <?php endif; ?>
        </div>
    </div>
</div>
<?php /**PATH /home/nsowos/public_html/shr-brand/resources/views/administrator/report-stock/view-stock-transfer.blade.php ENDPATH**/ ?>