/
home
/
sjslayjy
/
public_html
/
assets
/
resources
/
views
/
circle-store
/
Upload File
HOME
@extends('layout.master') @push('plugin-styles') <!-- {!! Html::style('/assets/plugins/plugin.css') !!} --> {!! Html::style('//cdn.datatables.net/1.10.23/css/jquery.dataTables.min.css') !!} <style type="text/css"> .table th, .table td { white-space: break-spaces !important; } .table-responsive{ margin: 20px 0; } .no-results { color: red; } </style> @endpush @section('content') <div class="row"> <div class="col-lg-12 grid-margin"> <div class="card"> <div class="card-body"> <div class="row grid-margin"> <div class="col-lg-8"> <h4 class="card-title">Spares in Circle Stocks</h4> </div> <div class="col-lg-2"> <select class="form-control mr select2" onchange="get_spare_of_warehouse(this)"> @foreach($warehouses as $warehouse) <option value="{{$warehouse}}" {{ $current_warehouse == $warehouse ? 'selected' : ''}}>{{$warehouse}}</option> @endforeach </select> </div> <div class="col-lg-2" > </div> </div> <div class="row"> <div class="col-lg-12"> <ul class="nav nav-tabs" id="myTab" role="tablist"> <li class="nav-item waves-effect waves-light"> <a class="nav-link active" id="fresh_qty" data-toggle="tab" href="#fresh" role="tab" aria-controls="fresh" aria-selected="false">Fresh Spares</a> </li> <li class="nav-item waves-effect waves-light"> <a class="nav-link" id="repaired_qty" data-toggle="tab" href="#repaired" role="tab" aria-controls="repaired" aria-selected="false">Repaired Spares</a> </li> <li class="nav-item waves-effect waves-light"> <a class="nav-link " id="faulty_qty" data-toggle="tab" href="#faulty" role="tab" aria-controls="faulty" aria-selected="true">Faulty Spares</a> </li> </ul> <div class="tab-content" id="myTabContent"> <div class="tab-pane active show fade" id="fresh" role="tabpanel" aria-labelledby="fresh_qty"> <div class="table-responsive"> <table class="table myTable" > <thead> <tr> <th> Item Code </th> <th > Item Description </th> <th> Qty</th> <th> Rate</th> <th> Fresh Value</th> </tr> </thead> <tbody> @foreach($fresh_stocks as $fresh_stock) <tr> <td> {{ $fresh_stock->spare_code }} </td> <td >{{ $fresh_stock->description}}</td> <td> {{ $fresh_stock->available_qty }}</td> <td> {{ $fresh_stock->rate }}</td> <td> {{ $fresh_stock->rate*$fresh_stock->available_qty }} </td> </tr> @endforeach </tbody> </table> </div> </div> <div class="tab-pane fade" id="repaired" role="tabpanel" aria-labelledby="repaired_qty"> <div class="table-responsive"> <table class="table myTable" > <thead> <tr> <th> Item Code </th> <th> Item Description </th> <th> Qty</th> <th> Rate</th> <th> Repaired Value</th> </tr> </thead> <tbody> @foreach($repaired_stocks as $repaired_stock) <tr> <td> {{ $repaired_stock->spare_code }} </td> <td >{{ $repaired_stock->description}}</td> <td> {{ $repaired_stock->available_qty }}</td> <td> {{ $repaired_stock->rate }}</td> <td> {{ $repaired_stock->rate*$repaired_stock->available_qty }} </td> </tr> @endforeach </tbody> </table> </div> </div> <div class="tab-pane fade " id="faulty" role="tabpanel" aria-labelledby="faulty_qty"> <div class="table-responsive"> <table class="table myTable" > <thead> <tr> <th> Item Code </th> <th> Item Description </th> <th> Qty</th> <th> Rate</th> <th> Faulty Value</th> </tr> </thead> <tbody> @foreach($faulty_stocks as $faulty_stock) <tr> <td> {{ $faulty_stock->spare_code }} </td> <td >{{ $faulty_stock->description}}</td> <td> {{ $faulty_stock->available_qty }}</td> <td> {{ $faulty_stock->rate }}</td> <td> {{ $faulty_stock->rate*$faulty_stock->available_qty }} </td> </tr> @endforeach </tbody> </table> </div> </div> </div> </div> </div> </div> </div> </div> <div class="col-lg-12 grid-margin"> <div class="card"> <div class="card-body"> <h3 class="card-title">Spare Quantity in Circle Stocks</h3> <div class="table-responsive"> <table class="table myTable"> <thead> <tr> <th> Item Code </th> <th > Item Description </th> <th> Fresh</th> <th> Repaird </th> <th> Faulty </th> <th> Total </th> </tr> </thead> <tbody id="stock_list"> @foreach($stocks as $part_in_stock) <tr> <td class="font-weight-medium">{{$part_in_stock->spare_code}}</td> <td >{{$part_in_stock->description}}</td> <td><label class="badge badge-success">{{$part_in_stock->fresh_qty}}</label></td> <td><label class="badge badge-warning">{{$part_in_stock->repaired_qty}}</label></td> <td><label class="badge badge-danger">{{$part_in_stock->faulty_qty}}</label></td> <td style="text-align: right !important;">{{ $part_in_stock->fresh_qty + $part_in_stock->repaired_qty + $part_in_stock->faulty_qty}}</td> </tr> @endforeach </tbody> </table> </div> </div> </div> </div> </div> @endsection @push('plugin-scripts') {!! Html::script('/assets/plugins/chartjs/chart.min.js') !!} {!! Html::script('/assets/plugins/jquery-sparkline/jquery.sparkline.min.js') !!} @endpush @push('custom-scripts') {!! Html::script('/assets/js/dashboard.js') !!} {!! Html::script('//cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js') !!} <script type="text/javascript"> $(document).ready( function () { $('.myTable').DataTable(); } ); function get_spare_of_warehouse(t) { var warehouse = $(t).val(); console.log('Warehouse is', warehouse); var url = window.location.origin+'/circle-store/spares-in-stock/?circle='+warehouse; window.location.replace(url); } function downloadNow(){ var warehouse = $(t).val(); var url = window.location.origin+'/circle-store/export-spare-stock/?circle='+warehouse; window.location.href = url; } </script> <script> $(document).ready(function() { // Initialize Select2 with custom placeholder and no cross sign $('.select2').select2({ placeholder: 'Search Warehouses', // Custom placeholder text allowClear: false, // Remove the cross (clear) sign language: { noResults: function() { return '<span class="no-results">No results found!</span>'; } }, escapeMarkup: function (markup) { return markup; // Allows HTML markup to be rendered } }); }); </script> @endpush