<?php $__env->startSection('page_title'); ?>
Create PO
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page_header_title'); ?>
Create PO
<?php $__env->stopSection(); ?>
<?php ($label_list = EF::getWhiteLabel()); ?>

<?php $__env->startSection('page_body'); ?>
<?php echo e(Breadcrumbs::render('create po')); ?>

	<div class="row row-cards row-deck">
              <div class="col-12">
                <div class="card">
                	  <div class="card-header">



					     <h3 class="card-title">Create PO's</h3>

					  </div>
                	<div class="card-status card-status-left bg-blue"></div>
                  <div class="table-responsive table-height">
                    <table class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
                      <thead>
                        <tr>

                          <th>#</th>
                          <th>PR No</th>
                          <th>BOQ No.</th>
													<!-- <th>PO No.</th> -->
                          <th>Remarks</th>
                          <th>Required Date</th>
                          <th>Status</th>
                          <th>Project</th>


                   <th style="text-align: center;"><i class="dropdown-icon fa fa-cogs"></i></th>
                        </tr>
                      </thead>
                     <tbody>
                      <?php if(isset($boq_list)): ?>
                      <?php $__currentLoopData = $boq_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rows): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
											<?php if($rows->status != "Approved"): ?>
                      <tr>
                        <td><?php echo e($loop->iteration); ?></td>
                        <td>RS/PR/000<?php echo e($rows->id); ?></td>
                        <td><?php echo e($rows->sr_no); ?></td>
												<!-- <td>
												<?php if($rows->status == "Approved"): ?>
												<?php $mpr = $rows->getPOnumber($rows->id);?>

					                <?php $__currentLoopData = $mpr; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
														<?php echo e($mp->p_number); ?>,
													<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
												<?php elseif($rows->status == "In Process"): ?>
						             ---
					              <?php elseif($rows->status == "Pending"): ?>
					                 ---
					              <?php else: ?>
					                ---
					              <?php endif; ?>
											</td> -->

                        <td><p style="word-wrap: break-word;"><?php echo wordwrap($rows->remarks,40,'<br>'); ?></p></td>
                        <td><?php echo e(EF::dateFormat($rows->getBoqItems[0]->created_at)); ?></td>
                        <td>
              <?php if($rows->status == "Approved"): ?>
                <span class="badge badge-success"> <?php echo e($rows->status); ?></span>
							<?php elseif($rows->status == "In Process"): ?>
	               <span class="badge badge-warning"> Pending</span>
              <?php elseif($rows->status == "Pending"): ?>
                <span class="badge badge-danger"> Not approved yet</span>
              <?php else: ?>
                <span class="badge badge-danger"> <?php echo e($rows->status); ?></span>
              <?php endif; ?>
                        </td>

                        <td><?php echo e($rows->branch->name); ?></td>

                                   <td class="text-center">
                                  <div class="item-action dropdown">
																		<?php if($rows->status == 'In Process' || $rows->status == 'Approved'): ?>
                                    <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fa fa-list-ul"></i></a>
																		<?php else: ?>
																		<i class="fa fa-list-ul"></i>
																		<?php endif; ?>

                                  <div class="dropdown-menu dropdown-menu-right">
                                      <?php if($rows->status == 'In Process' && Auth::user()->hasAnyPermission(['All','Accept PO'])): ?>
                                   <a  href="<?php echo e(route('porequest.details',['id' => Crypt::encrypt($rows->id)])); ?>"  class="dropdown-item" content="accept boq"><i class="dropdown-icon fa fa-check "></i> Accept</a>
                                   <?php endif; ?>
                                   <?php if($rows->status == 'In Process' && Auth::user()->hasAnyPermission(['All','Reject PO'])): ?>
                                   <a  href="<?php echo e(route('boq.reject',['id' => Crypt::encrypt($rows->id)])); ?>"  class="dropdown-item cls_delete" content="reject pr"><i class="dropdown-icon fa fa-times "></i> Reject</a>
                                   <?php endif; ?>
																	 <?php if($rows->status == 'Approved' && Auth::user()->hasAnyPermission(['All','Reject PO'])): ?>
																	 <a  href="<?php echo e(route('porqe.detail',['id' => Crypt::encrypt($rows->id)])); ?>"  class="dropdown-item" content="accept boq"><i class="dropdown-icon fa fa-eye "></i> Details</a>
																	 <?php endif; ?>


                                    </div>
                                  </div>
                               </td>
                      </tr>
											<?php endif; ?>
                      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                      <?php endif; ?>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
          </div>
					<?php if(count($alerts) > 0): ?>
					  <!-- Position it -->
					  <!-- <div style="position: fixed; top: 50px; right: 20px;">



							<?php $__currentLoopData = $alerts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ra): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

				<div class="alert alert-danger alert-dismissible">
    <a href="#" class="close" data-dismiss="alert" aria-label="close"></a>
    <strong>Alert!</strong> Purchase Requisition with # "<?php echo e($ra->getBOQById($ra->bill_of_quantity_id)->sr_no); ?>" is pending.
  </div>
			<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

</div> -->
<?php endif; ?>

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

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

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

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

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

<?php echo $__env->make('layouts.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/ubuntu/rebmgisplus/skylite/resources/views/inventory_module/purchase_order/createporequest.blade.php ENDPATH**/ ?>