<?php Fun::lang() ?>

<?php
    $hr = '<span style="text-align:center">-----------------------------------------------------------------------<span>';
?>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/css/production.css')); ?>">

<div class="print_form" style="overflow-y: scroll">
    <div class=" col-sm-12 col-xs-12 form-group text-center">
        <h3><?php echo e(__('administrator.return_cut_piece')); ?></h3>
    </div>
    <div class=" col-sm-12 col-xs-12 form-group">
        <table class="inv-header">
            <tr>
                <td><?php echo e(__('administrator.start_date')); ?></td>
                <td width="2%">:</td>
                <td><?php echo e(date('d-m-Y',strtotime($cutting->date))); ?></td>
            </tr>
            <tr>
                <td><?php echo e(__('administrator.invoice_number')); ?></td>
                <td>:</td>
                <td><?php echo e($cutting->invoice_number); ?></td>
            </tr>
            <tr>
                <td><?php echo e(__('administrator.tailor')); ?></td>
                <td>:</td>
                <td><?php echo e(findTailor($cutting->tailor_id)->name); ?></td>
            </tr>
            <tr>
                <td><?php echo $cutting->done_status=='1'?('<span class="label label-success">'.__('administrator.done').'</span>'):''; ?></td>
            </tr>
        </table>
    </div>
    <hr>
    <?php $g_total = 0; ?>
    <?php $__currentLoopData = $return; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class=" col-sm-12 col-xs-12 form-group text-left">
            <table class="inv-header" width="100%">
                <tr>
                    <td><?php echo e(__('administrator.return_date')); ?></td>
                    <td width="2%">:</td>
                    <td><?php echo e(date('d-m-Y',strtotime($row->date))); ?></td>
                    <?php if($row->returner): ?>
                        <td><?php echo e(__('administrator.returner')); ?></td>
                        <td>:</td>
                        <td><?php echo e($row->returner); ?></td>
                    <?php endif; ?>
                </tr>
                <tr>
                    <td><?php echo e(__('administrator.to_warehouse')); ?></td>
                    <td>:</td>
                    <td><?php echo e(findWarehouse($row->warehouse_id)->warehouse_name); ?></td>
                    <?php if($row->receiver): ?>
                        <td><?php echo e(__('administrator.receiver')); ?></td>
                        <td>:</td>
                        <td><?php echo e($row->receiver); ?></td>
                    <?php endif; ?>
                </tr>
            </table>
            <br>
            <table class="table">
                <thead>
                <tr>
                    <th>
                        <?php echo e(__('administrator.barcode')); ?>

                    </th>
                    <th>
                        <?php echo e(__('administrator.size')); ?>

                    </th>
                    <th>
                        <?php echo e(__('administrator.qty')); ?>

                    </th>
                </tr>
                </thead>
                <?php
                    $return_detail = \App\Model\production\cutting\CuttingReturnDetailModel::where('cutting_return_id',$row->id)->get();
                     $total_return_qty = 0;
                ?>
                <tbody>
                <?php $__currentLoopData = $return_detail; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rd): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php  $total_return_qty +=$rd->qty; ?>
                    <tr>
                        <td><?php echo e($rd->barcode); ?></td>
                        <td><?php echo e(findSize($rd->size_id)->size); ?></td>
                        <td><?php echo e($rd->qty); ?> <?php echo e(__('administrator.piece')); ?></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td colspan="2" class="text-right"><?php echo e(__('administrator.total')); ?></td>
                    <td><?php echo e($total_return_qty); ?> <?php echo e(__('administrator.piece')); ?></td>
                </tr>
                </tbody>
            </table>
        </div>
        <?php $g_total+=$total_return_qty;  ?>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    <?php if($return->count()==0): ?>
        <table class="table">
            <thead>
            <tr>
                <th>
                    <h3> <?php echo e(__('administrator.no_data')); ?></h3>
                </th>
            </tr>
            </thead>
        </table>
    <?php endif; ?>
    <table class="table">
        <tr>
            <td class="no-border text-right"> <?php echo e(__('administrator.total_return_cut_piece')); ?></td>
            <td><?php echo e($g_total); ?> <?php echo e(__('administrator.piece')); ?></td>
        </tr>
    </table>
    <table width="70%" class="" style="margin: 0 auto;">
        <tr>
            <td>
                <button type="button"
                        class="print_jquery_confirm button_info form-control"><?php echo e(__('administrator.print')); ?></button>
            </td>
            <td>
                <button type="button"
                        class="close_jquery_confirm button_warning form-control"><?php echo e(__('administrator.close')); ?></button>
            </td>
        </tr>
    </table>
</div>
<script>
    $(document).ready(function () {

    });
</script>
<?php /**PATH /home/nsowos/public_html/shr-brand/resources/views/administrator/production-cutting/return-history.blade.php ENDPATH**/ ?>