@extends('layouts.dashboard')
@section('page_title')
	Manage BOQ Request
@endsection
@section('page_header_title')
	Manage BOQ Request
@endsection
@section('page_body')
{{ Breadcrumbs::render('managepurchaserequisition',Crypt::encrypt($boq_detail->id)) }}
@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>Manage Purchase Requisition ({{$boq_detail->sr_no}})</b> <span class="label label-danger"> Pending </span></h3>
                  </div>

                  <div class="card-body">
                    <div class = "card">
                      <div class ="card-body">
                        <div class ="row">
                          <div class="col-md-4"> <h5>PR # <b> RS/PR/000{{$boq_detail->id}}</b></h5></div>
                          <div class="col-md-4"> <h5>Project : <b>{{$boq_detail->branch->name}}</b></h5></div>
                          <div class="col-md-4"> <h5>Created At : <b> {{EF::dateFormat($boq_detail->created_at)}}</b></h5></div>
                          <div class="col-md-4"> <h5>Remarks: <b> {{$boq_detail->remarks}}</b></h5></div>
													<div class="col-md-4"> <h5>Prepared By: <b> {{$boq_detail->approvedby->name}}</b></h5></div>
                        </div>
                        <hr style="width:100%;border-top:1px solid #1d55a5 !important">

                        <div class ="row">
                          <div class="col-md-12"> <h3>List of Items requested in Purchase Requisition</h3></div>
                        </div>
{{ Form::open(array('route' => 'boq.acceptfirst', 'id' => 'form_accept_boq', 'class' => 'cls_from ', 'enctype' => 'multipart/form-data')) }}
                        <div class="row">
                          @if(isset($boq_items_lists))

                          <div class="col-md-12 wrapper">
														<table class="table table-bordered table-stripped">
															<thead>
																<tr>
																	<td>Sr#</td>
																	<td>Item Name</td>
																	<td>Type</td>
																	<td>Category</td>
																	<td>Quantity Range</td>
																	<td>Unit</td>
																	<td>Required Qty</td>
																	<td>Required Date</td>
																	<td>Remarks</td>
																</tr>
															</thead>
															<tbody>
																@foreach($boq_items_lists as $row)
																<tr>
																	<td>{{$loop->iteration}}</td>
																	<td>{{$row->item->name}}</td>
																	<td>{{$row->item->type}}</td>
																	<td>{{$row->item->inventoryCategory->name}}</td>
																	<td>{{$row->item->minimum}} - {{$row->item->maximum}}</td>
																	<td>{{$row->item->inventoryUnit->name}}</td>
																	<td>{{$row->quantity}}</td>
																	<td>{{EF::dateFormat($row->created_at)}}</td>
																	<td>{{$row->item_description}}</td>
																</tr>
																@endforeach
															</tbody>
														<table>

                          </div>

														<input type="hidden" value="{{Crypt::encrypt($boq_detail->id)}}" name="boq_id"/>

                          @endif
                          <div class="col-md-12" style="margin-top:15px;">
                            <button class="btn btn-success cls_submit" content="approve purchase requisition " style="width:100%">Approve Purchase Requisition</button>
                          </div>
                        </div>
                        {{ Form::close() }}
                      </div>
                    </div>
                </div>
                </div>
              </div>
            </div>
            </div>
          </div>


@endsection

@section('page_modal')

@endsection

@section('page_script')

   @include('inventory_module.scripts.boq')

@endsection
