<!doctype html>
<?php Fun::lang()?>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>NSO POS</title>
    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('assets/css/pos-invoice.css')); ?>">
    <style>

    </style>
</head>
<body>
<?php
$hr = '<div style="width: 100%;border-top: 1px dashed rgba(1,1,1,0.5);margin: 10px 0;"></div>';
$br = mainBranch();
?>
<div class="print_invoice_wholesale print_this_form">
    <table class="tb-header">
        <tr>
            <td><img src="<?php echo e(findImg($br->logo)); ?>" style="width: 90px;"></td>
        </tr>
        <tr>
            <td>
                 <span>
                     <b class="name_logo"><?php echo e($br->name); ?></b><br>
                    <i style="font-size: 11px"><?php echo e($br->address); ?><br><?php echo e($br->phone); ?></i>
                </span>
            </td>
        </tr>
    </table>

    <hr width="40%">
    <table>
        <tr style="text-align: left;">
            <td style="width: 70%;">
                <table>
                    <tr class="font_12">
                        <td><?php echo e(__('administrator.date')); ?> </td>
                        <td>:
                            <b><?php echo e(myDate($master->date)); ?></b>
                        </td>
                    </tr>
                    <tr class="font_12">
                        <td><?php echo e(__('administrator.reference_number')); ?></td>
                        <td>: <?php echo e($master->reference_number); ?></td>
                    </tr>
                    <tr class="font_12">
                        <td><?php echo e(__('administrator.cashier')); ?></td>
                        <td>: <?php echo e($master->user->name??''); ?></td>
                    </tr>
                </table>
            </td>
            <td>
                <table>

                    <tr class="font_12">
                        <td><?php echo e(__('administrator.customer')); ?></td>
                        <td> : <?php echo e($master->customer->name??''); ?></td>
                    </tr>
                    <tr class="font_12">
                        <td><?php echo e(__('administrator.phone')); ?></td>
                        <td> : <?php echo e($master->customer->phone??''); ?></td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <table class="table m-top-30">
        <thead>
        <tr>
            <th width="6%">#</th>
            <th><?php echo e(__('administrator.code')); ?></th>
            <th><?php echo e(__('administrator.products')); ?></th>
            <th><?php echo e(__('administrator.size')); ?></th>
            <th><?php echo e(__('administrator.color')); ?></th>
            <th><?php echo e(__('administrator.qty')); ?></th>
            <th><?php echo e(__('administrator.price')); ?></th>
            <th width="10%"><?php echo e(__('administrator.total')); ?></th>
        </tr>
        </thead>
        <tbody>
        <?php
        $grand_total = 0;
        $key = 0;
        $total_qty = 0;
        $currency = findCurrency($master->currency_id)->symbol;
        ?>

        <?php if($master): ?>
            <?php $__currentLoopData = $master->detail; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php
                $product = getProductById($row->product_id);
                $unit = (findUnit($product->unit_id));
                $total_qty+=$row->qty;
                $op = $row->type==='return'?'+':'-';
                $operation = $row->type==='return'?'-':'+';
                $total = $row->price*$row->qty;
                $grand_total+= (float)("$operation$total");
                ?>
                <tr role="row">
                    <td><?php echo e($key+=1); ?></td>
                    <td><?php echo e($row->barcode); ?></td>
                    <td><?php echo e($product->product_name); ?></td>
                    <td><?php echo e(findSize($row->size_code)->size); ?></td>
                    <td><?php echo e(findColor($row->color_code)->name); ?></td>
                    <td><?php echo e($op.$row->qty.' '.($unit?$unit->name:'')); ?></td>
                    <td><?php echo e($currency.number_format($row->price ,2)); ?></td>
                    <td><?php echo e($currency.number_format($total,2)); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php
                $total_row = 10;
                $total_data = count($master->detail);
                $left_row = $total_row-$total_data;
            ?>
            <?php if($total_row>$total_data): ?>
                <?php for($i=0;$i<$left_row; $i++): ?>
                    <tr>
                        <td><?php echo e($key += 1); ?></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                <?php endfor; ?>
            <?php endif; ?>
        <?php endif; ?>
        </tbody>
        <tr class="">
            <td colspan="6" rowspan="8" class="text-left  delivery_info no-border" style="position: relative;"></td>
            <td style="border-left: none" class="my-customer-border"><span></span><?php echo e(__('administrator.total_item')); ?></td>
            <td class="text-left " style="position: relative;"><?php echo e($total_qty); ?></td>
        </tr>
        <tr>
            <td style="border-left: none" class="my-customer-border"><span></span><?php echo e(__('administrator.grand_total')); ?></td>
            <td class="text-left"><?php echo e($currency); ?><?php echo e(number_format(($grand_total),2)); ?></td>
        </tr>
    </table>
    <hr width="40%">
    <table>
        <tr>
            <td style="text-align: center"><b><?php echo $br->invoice_footer; ?></b></td>
        </tr>
    </table>
</div>
</body>
</html>
<?php /**PATH /home/nsowos/public_html/shr-brand/resources/views/pos/product-return/show.blade.php ENDPATH**/ ?>