

<?php $__env->startSection('title'); ?>
Purchase Order Receipt
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumb'); ?>
<ol class="breadcrumb pull-right">
        <li><a href="<?php echo e(route('home')); ?>"><i class="fa fa-dashboard"></i> Home</a></li>

        <li class="active">Purchase Order Receipts</li>
      </ol>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
  <div class="container-fluid">
  <div class="row">
                    
    <div class="col-sm-12">
                        <div class="white-box">
                           
                            <div class="table-responsive">
                             
                            <?php if(Session::has('success')): ?>   
                            <div id="successMessage" class="alert alert-success" role="alert">
                            <?php echo e(Session::get('success')); ?>

                            </div>
                            <?php endif; ?>

                            <h3  class="box-title m-b-0">
                            Purchase Order Receipts List
                            </h3>


                            <table id="myTable" class="table table-striped table-bordered dataTable color-table primary-table" role="grid" aria-describedby="myTable_info">
                                    <thead>
                                        <tr role="row">
                                            <th style="color:black;" class="sorting_asc" tabindex="0" aria-controls="myTable" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Name: activate to sort column descending" style="width: 10px;">Id#</th>


                                            <th style="color:black;" class="sorting" tabindex="0" aria-controls="myTable" rowspan="1" colspan="1" aria-label="Office: activate to sort column ascending" style="width: 203px;">Department</th>


                                             <th style="color:black;" class="sorting" tabindex="0" aria-controls="myTable" rowspan="1" colspan="1" aria-label="Office: activate to sort column ascending" style="width: 100px;">Created By</th>


                                              <th style="color:black;" class="sorting" tabindex="0" aria-controls="myTable" rowspan="1" colspan="1" aria-label="Office: activate to sort column ascending" style="width: 200px;">Current Status</th>



                                            <th style="color:black;" class="sorting" tabindex="0" aria-controls="myTable" rowspan="1" colspan="1" aria-label="Office: activate to sort column ascending" style="width: 30px;">Total Receipts</th>


                                            <th style="color:black;" class="sorting" tabindex="0" aria-controls="myTable" rowspan="1" colspan="1" aria-label="Office: activate to sort column ascending" style="width: 100px;">Action </th>

                                        </tr>
                                    </thead>
                                <tbody>
  
                    <?php if( $purchase_requests->count() > 0 ): ?>
                    <?php $__currentLoopData = $purchase_requests; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                     <tr role="row" class="odd">

                         <td>
                            <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'view-purchase-request')): ?>
                            <a target="_blank" href="<?php echo e(route('purchase-requests.view' , [$list->id])); ?>">PR-<?php echo e($list->id); ?> </a>
                        <?php else: ?>
                        PR-<?php echo e($list->id); ?> 
                    <?php endif; ?></td>

                   

                        <td><?php echo e(\App\Department::withTrashed()->find($list->department_id)->department_name); ?>  </td>
                        <td><?php echo e($list->user->name); ?></td>


                         <td>
                             <?php if($list->status == 0): ?>
                               <span style="color:#ffed14;">Pending</span>
                               <?php elseif($list->status == 1): ?>
                               <span style="color:#ffbd02;">In Progress</span>
                               <?php elseif($list->status == 2): ?>
                               <span style="color:red;">Rejected</span>
                                <?php elseif($list->status == 3): ?>
                               <span style="color:#0d6efd;">RFQ</span>
                               <?php elseif($list->status == 4): ?>
                               <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'view-request-for-quotation')): ?>
                               <span style="color:#0d6efd;"><a target="_blank" href="<?php echo e(route('request-for-quotations.view' , [$list->id])); ?>">RFQ SEND</a></span>
                               <?php endif; ?>
                               <?php elseif($list->status == 5): ?>
                               <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'view-comparative-statement')): ?>
                                <span style="color:#0d6efd;"><a target="_blank" href="<?php echo e(route('comparative-statements.view' , [$list->id])); ?>">CS Received</a></span>
                                <?php endif; ?>
                                <?php elseif($list->status == 6): ?>
                                <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'view-purchase-order')): ?>
                                <span style="color:#0d6efd;"><a target="_blank" href="<?php echo e(route('purchase-orders.view' , [$list->id])); ?>">PO Sent</a></span>
                                <?php endif; ?>
                                <?php elseif($list->status == 7): ?>
                                 <?php
                                 $getPrStatus = \App\PurchaseRequest::getPrStatus($list->id);
                                ?>
                                 <?php if( $getPrStatus['pending_po'] > 0): ?>
                                 <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'view-purchase-order')): ?>
                                <span style="color:#0d6efd;"><a style="font-size: 12px;" target="_blank" href="<?php echo e(route('purchase-orders.view' , [$list->id])); ?>">PO PENDING</a> <span style="padding: 0px 5px 0px 5px;border-radius: 50%;color: white;position: relative;bottom: 15px;background: red;"><?php echo e($getPrStatus['pending_po']); ?></span></span>
                                <?php endif; ?>
                                <?php elseif( $getPrStatus['pending_recipt'] > 0): ?>
                                <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'view-po-receipt')): ?>
                                <span style="color:#0d6efd;"><a  style="font-size: 12px;" target="_blank" href="<?php echo e(route('purchase-order-receipts.view' , [$list->id])); ?>">RECEIPT PENDING</a><span style="padding: 0px 5px 0px 5px;border-radius: 50%;color: white;position: relative;bottom: 15px;background: red;"><?php echo e($getPrStatus['pending_recipt']); ?></span></span>
                                <?php endif; ?>

                                <?php elseif($getPrStatus['total_rfq'] > $getPrStatus['total_cs']): ?>
                                <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'view-request-for-quotation')): ?>
                                <span style="color:#0d6efd;font-size: 12px;"><a target="_blank" href="<?php echo e(route('request-for-quotations.view' , [$list->id])); ?>">CS PENDING</a><span style="padding: 0px 5px 0px 5px;border-radius: 50%;color: white;position: relative;bottom: 15px;background: red;"><?php echo e($getPrStatus['total_rfq'] - $getPrStatus['total_cs']); ?></span></span>
                                <?php endif; ?>
                                <?php else: ?>
                                <span style="color:#0ef30e;">Complete</span>
                                <?php endif; ?>

                             <?php endif; ?>
                         </td>

                            <td>
                            <?php
                            $po_receipts = \App\PurchaseOrderReceipt::getTotalReceipt($list->id);
                            ?>
                            [ <?php echo e($po_receipts); ?> ]
                            </td>

                            <td>

                            <?php if($po_receipts > 0): ?>
                            <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'view-po-receipt')): ?>
                            <a style="color:#fdb024;font-size: 1.9rem;"  href="<?php echo e(route('purchase-order-receipts.view',[$list->id] )); ?>"><i style="margin-left: 1rem;" class="fa fa-eye" aria-hidden="true"></i>
                            </a>
                            <?php endif; ?>
                            <?php else: ?>
                            <?php echo e('No Receipts'); ?>

                            <?php endif; ?>
                            </td>
                    </tr>
                 <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>   
                 <?php endif; ?>

                                      
            </tbody>
            </table>

            </div>
            </div>
            </div>
            </div>


    </div>

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

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\akram-city.projecterp.net\resources\views/procurement/purchase-order-receipt/view.blade.php ENDPATH**/ ?>