@extends('layouts.dashboard')
@section('page_title')
	Purchase Requisition Details
@endsection
@section('page_header_title')
	Purchase Requisition Details
@endsection
@section('page_body')
{{ Breadcrumbs::render('purchaserequisitiondetail') }}
@php($label_list = EF::getWhiteLabel())
 <div class="my-3 my-md-5">
          <div class="container">
            <div class="row">
              <div class="col-md-12">
                <div class="card">
                  <div class="card-header">
                    <h3 class="card-title"><b>Purchase Requisition- RS/PR/000{{$pr->id}} </b> </h3>
                  </div>
                  <div class="card-body">
                    <div class = "card">
                      <div class ="card-body">
                        <div class ="row">
													     <div class="container">
													        <div class="main-section">
													           <center> <h2><u>Purchase Requisition</u></h2></center>
													           <br>
													          <div class="row clear margin">
													            <div class="col margin" style="width: 70%;">
													              <label><b>Entry #: </b>RS/PR/000{{$pr->id}}</label>
													            </div>
													            <div class="col margin" style="width: 30%;">
													              <label><b>Date: </b>{{EF::dateFormat($pr->created_at)}}</label>
													            </div>
													          </div>
													           <div class="row clear margin">
													            <div class="col margin" style="width: 70%;">
													              <label><b>Project: </b>{{ucwords($pr->branch->name)}}</label>
													            </div>
													            <div class="col margin" style="width: 30%;">
													              <label><b>BOQ #: </b>{{$pr->sr_no}}</label>
													            </div>
													          </div>
													              <div class="row clear margin">
													            <div class="col margin" style="width: 100%;">
													              <label><b>Remarks: </b>{{strtoUpper($pr->remarks)}}</label>
													            </div>
													          </div>
													                <div class="row clear" style="margin-bottom:30%;">
													          <table border="1" style="border-collapse: collapse; margin-top:3%; text-align: center; width:100%;">
													            <thead>
													              <tr>
													                 <th style ="width:5%;" >S/N. </th>
																					 <th>Item Name</th>
													                 <th style ="width:60%;">Description</th>
																					 <th>PO</th>
													                  <th>Required Date</th>
													                  <th>Quantity</th>
													                  <th >Unit</th>
																						<th >Status</th>
													              </tr>
													              <tbody>
													                  @php ($totalquantity = 0)
													                @foreach($pr->getBoqItems as $rows)
													                <tr>
													                <td>{{$loop->iteration}}</td>
																					<td>{{$rows->item->name}}</td>
													                 <td>{{$rows->item_description}}</td>
																					 <td>
									 												@if($rows->po->status == "Approved")
									 												{{$rows->po->p_number}}
									 					              @else
									 					                ---
									 					              @endif
									 											</td>
													                 <td>{{EF::dateFormat($rows->created_at)}}</td>
													                  <td>{{EF::numberFormat($rows->quantity)}}</td>
													                  <td>{{$rows->item->inventoryUnit->name}}</td>
																						<td>{{$rows->po->status}}</td>
													               </tr>
													               @php($totalquantity = $totalquantity + ($rows->quantity))
													                @endforeach
													                <tr>
													                  <td colspan="8" >Total <label style = "margin-left:65%;" >{{EF::numberFormat($totalquantity)}}</label> </td>
													                </tr>
													        </tbody>
													            </thead>
													          </table>
													      </div>
													        </div>
													          </div>
                        </div>
                      </div>
                    </div>
                </div>
                </div>
              </div>
            </div>
            </div>
          </div>
@endsection
@section('page_modal')
@endsection
@section('page_script')
@endsection
