<?php $__env->startSection('title','Checking Purchase Requisition | Invoice'); ?>

<?php $__env->startSection('content'); ?>

    <!-- Content Header (Page header) -->
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1>Purchase Requisition View</h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="#">Home</a></li>
                        <li class="breadcrumb-item active">Requisition</li>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6"></div>
                <div class="col-sm-6">

                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>
    <section class="content">
        <div class="container-fluid">
            <div class="row">
                <div class="col-12">
                    <!-- Main content -->
                    <div class="invoice p-3 mb-3">
                        <div class="row">
                            <div class="col-12">
                                <h4>
                                    <i class="fas fa-globe"></i> Requisition No : <?php echo e($requisition->requisition->requisition_id); ?> , Requisition Invoice : <?php echo e($requisition->invoice_no); ?>

                                    <small class="float-right"> Date: <label class="label-success" style="padding: 5px 15px"> <?php echo e(\Carbon\Carbon::parse($requisition->created_at)->format('D-d-M-Y')); ?></label> </small>
                                </h4>
                                <br>
                            </div>
                            <!-- /.col -->
                        </div>
                        <!-- Table row -->
                        <div class="row">
                            <div class="col-12 table-responsive">
                                <table class="table table-striped table-bordered">
                                    <thead>
                                    <tr class="bg-info">
                                        <th> #SL</th>
                                        <th>Group</th>
                                        <th>Item Name</th>
                                        <th>Item Brand</th>
                                        <th>Item Code</th>
                                        <th> Unit </th>
                                        <th> Cur Stock</th>
                                        <th> 2 Monts Consum.</th>
                                        <th> present Req.Price</th>
                                        <th> present Req.Qty</th>
                                        <th>  Last Purchase</th>
                                        <th>Remarks</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <?php $i=0; ?>
                                        <?php if($requisition->count()>0): ?>
                                            <?php $__currentLoopData = $requisition->new_requisition_products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php
                                                $last_purchase = $product->product->find($product->product_id);
                                                $last_purchase_date = $last_purchase->last_purchase_date !=null ?  "Date: ". $last_purchase->last_purchase_date : "";
                                                $last_purchase_price = $last_purchase->last_purchase_price !=null ? "Price: ". $last_purchase->last_purchase_price : "";
                                            ?>
                                                <?php if($product->user_id !=null): ?>
                                                    <tr>
                                                        <td><?php echo e(++$i); ?></td>
                                                        <td><?php echo e($product->product->group ? $product->product->group->name  : "N/A"); ?></td>
                                                        <td ><?php echo e($product->product ? $product->product->name  : "N/A"); ?></td>
                                                        <td><?php echo e($product->product->brand ? $product->product->brand->name  : "N/A"); ?></td>
                                                        <td ><?php echo e($product->product ? $product->product->item_code : "N/A"); ?></td>
                                                        <td ><?php echo e($product->product->unit ? $product->product->unit->name : "N/A"); ?></td>
                                                        <td> N/A</td>
                                                        <td> N/A </td>
                                                        <td><?php echo e($product->price); ?></td>
                                                        <td><?php echo e($product->qty); ?></td>
                                                        <td> <?php echo e($last_purchase_date); ?> <br/> <?php echo e($last_purchase_price); ?></td>
                                                        <td><?php echo e($product->note); ?></td>
                                                    </tr>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php endif; ?>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.col -->
                        </div>
                        <!-- /.row -->
                    </div>
                    <!-- /.invoice -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->

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

<?php echo $__env->make('layouts.fixed', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/welluugs/purchase.wellgrouperp.com/resources/views/inventory/requisition/view-approved-requisition-items.blade.php ENDPATH**/ ?>