
<?php $__env->startSection('content'); ?>
    <?php Fun::lang() ?>
    <div class="page-purchases">
        <div class="container-fluid">

            <hr>
            <div class="summary-header">
                <table>
                    <tr>
                        <td>
                            <table class="text-left">
                                <tr>
                                    <td><?php echo e(__('administrator.invoice_number')); ?></td>
                                    <td> : <?php echo e($item->invoice_number); ?> </td>
                                </tr>
                                <tr>
                                    <td><?php echo e(__('administrator.request_by')); ?></td>
                                    <td> : <?php echo e(findUser($item->request_by)->name); ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo e(__('administrator.request_to')); ?></td>
                                    <td> : <?php echo e(findBranch($item->branch_id)->name); ?></td>
                                </tr>
                                <tr>
                                    <td><?php echo e(__('administrator.created_at')); ?></td>
                                    <td> : <?php echo e(date('d-m-Y',strtotime($item['date']))); ?> </td>
                                </tr>
                                <tr>
                                    <td><?php echo e(__('administrator.note')); ?></td>
                                    <td> : <?php echo e($item->note); ?> </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
            <?php
            $readonly = '';
            $status = 3;
            if($item->status===3&&$item->request_to==Auth::user()->branch_id){
                $readonly = 'readonly';
                $status = 4;
            }

            ?>
            <div class="wrapper-table">
                <?php echo Form::open(array('route' => ['request-stock-update-status',$status],'method'=>'GET','class'=>'jform')); ?>


                <input type="hidden" name="id" value="<?php echo e($item->id); ?>">
                <table class="table table-striped table-hover ">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th><?php echo e(__('administrator.barcode')); ?></th>
                        <th><?php echo e(__('administrator.item')); ?></th>
                        <th><?php echo e(__('administrator.size')); ?></th>
                        <th><?php echo e(__('administrator.qty')); ?></th>
                        <th><?php echo e(__('administrator.return_qty')); ?></th>
                    </tr>
                    </thead>
                    <tbody>

                        <?php $__currentLoopData = $item_detail; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                            <tr>
                                <td><?php echo e($key+=1); ?>

                                    <input type="hidden" name="detail_id[]" value="<?php echo e($value->id); ?>">

                                </td>
                                <td><?php echo e($value->barcode); ?> </td>
                                <td><?php echo e(optional($value->getItem)->product_name); ?> </td>
                                <td><?php echo e(optional($value->getSize)->size); ?></td>
                                <td><?php echo e($value->qty); ?> <?php echo e(optional($value->getUnit)->unit); ?></td>
                                <td><?php echo Form::text('return_qty[]',$value->return_qty, ['placeholder'=>__('administrator.return_qty'),'class' => 'form-control number-only','max'=>$value->qty,$readonly]); ?></td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    </tbody>
                </table>
                <?php echo Form::submit('Submit', ['class' => 'hidden']); ?>


                <?php echo Form::close(); ?>


            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.jform', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/nsowos/public_html/shr-brand/resources/views/stock-inventory/item-request/get-return.blade.php ENDPATH**/ ?>