@extends('layouts.dashboard')
@section('page_title')
	Stock Detail
@endsection
@section('page_header_title')
	Stock Detail
@endsection
@section('page_body')
{{ Breadcrumbs::render('stockdetails',Crypt::encrypt($product_list->id)) }}

 <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>Product Detail</b></h3>
                  </div>

                  <div class="card-body">
                    <div class = "card">
                      <div class ="card-body">
                        <div class ="row">
                          <div class="col-md-7">
                            <div class="row">
                            <h4 class="col-md-12" style="background:#656877;padding:5px;color:white">Product Detail</h4>
                            <div class="col-md-12">
                              <table style="width:100%">
                                <tr>
                                  <th>Product Code</th>
                                  <td>{{$product_list->code}}</td>
                                </tr>
                                <tr>
                                  <th>Product Name</th>
                                  <td>{{$product_list->name}}</td>
                                </tr>
																<tr>
                                  <th>Unit</th>
                                  <td>{{$product_list->inventoryUnit->name}}</td>
                                </tr>
                                <tr>
                                  <th>Category</th>
                                  <td>{{$product_list->inventoryCategory->name}}</td>
                                </tr>
                                <tr>
                                  <th>Stock</th>
                                  <td>{{$product_list->quantity}}
                                    @if($product_list->quantity == 0)
                                    <span class="label label-danger">Out Of Stock</span>
                                    @endif
                                  </td>
                                </tr>
                                <tr>
                                  <th>Description</th>
                                  <td>{{$product_list->description}}</td>
                                </tr>
                              </table>
                            </div>
                          </div>
                        </div>
                            </div>
                        <hr style="width:100%;border-top:1px solid #1d55a5 !important">

                        <div class ="row">
                          <div class="col-md-12"> <h3>Product Stock History</h3></div>
                        </div>

                        <div class="row">
                          <div class="col-md-12">
                            <table class="table table-hover table-outline table-vcenter text-nowrap card-table cls_datatable">
                              <thead>
                                <tr>

                                  <th>#</th>
                                  <th>Stock</th>
                                  <th>Quantity</th>
																	<th>Project</th>
                                  <th>Dated</th>
                                </tr>
                              </thead>
                             <tbody>
                              @if(isset($stock_list))
                              @foreach($stock_list as $rows)
                              <tr>
                                <td>{{$loop->iteration}}</td>
                                @if($rows->in_quantity == null)
                                <td> <i class="fa fa-arrow-down" style="color:red"></i> OUT</td>
                                <td>{{$rows->out_quantity}}</td>
                                @else
                                <td><i class="fa fa-arrow-up" style="color:green"></i> IN</td>
                                <td>{{$rows->in_quantity}}</td>
                                @endif
																<td>{{$rows->branch->name}}</td>
                                <td>{{EF::dateFormat($rows->created_at)}}</td>

                              </tr>
                              @endforeach
                              @endif
                              </tbody>
                            </table>
                          </div>

                        </div>


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


@endsection

@section('page_modal')

@endsection

@section('page_script')

   @include('inventory_module.scripts.boq')

@endsection
