/
home
/
sjslayjy
/
public_html
/
assets
/
resources
/
views
/
circle-store
/
omc
/
Upload File
HOME
@extends('layout.master') @push('plugin-styles') <!-- {!! Html::style('/assets/plugins/plugin.css') !!} --> @endpush @section('content') <div class="row"> <div class="col-lg-12 grid-margin"> <div class="card"> <div class="card-body"> <h3 class="card-title">Onetime Material Consumption Request (OMCR) Details</h3> <div class="row"> <div class="col-lg-3"> <label>MR Number : <br/><strong>{{$omc->mr_no}}</strong></label> </div> <div class="col-lg-3"> <label>PO No : <br/><strong>{{$omc->po_no}}</strong></label> </div> <div class="col-lg-3"> <label>Requested BY : <br/><strong>{{$omc->requestedBy($omc->request_by)}}</strong></label> </div> <div class="col-lg-3"> <label>Status : <br/> @if( $omc->status == 'authorize') <strong class="badge badge-success">{{$omc->status}}</strong> @else <strong class="badge badge-warning">{{$omc->status}}</strong> @endif </label> </div> @if($omc->authorize_by != null) <div class="col-lg-3"> <label>Authorize BY : <br/><strong>{{$omc->authorizeBy($omc->authorize_by)}}</strong></label> </div> @endif </div> </div> </div> </div> <div class="col-lg-12 grid-margin"> <div class="card"> <div class="card-body"> <div class="row grid-margin"> <div class="col-lg-4"> <h4 class="card-title">Authorized Spare Parts List</h4> </div> </div> <div class="table-responsive"> <table class="table table-striped table-bordered"> <thead> <tr> <th>Item Code</th> <th>Description</th> <th>Rate(Rs)</th> <th>Type</th> <th>Qty</th> <th>Gst</th> <th>Total</th> </tr> </thead> <tbody id="tbody"> @php $subtotal = 0; $gsttotal = 0; @endphp @foreach($omc_items as $omcitem) @php $rtotal = 0; @endphp @if($omcitem->fresh_qty != 0) <tr> <td>{{$omcitem->spare_code}}</td> <td>{{$omcitem->description}}</td> <td>{{$omcitem->rate}}</td> <td>Fresh</td> <td>{{$omcitem->fresh_qty}}</td> <td>{{$omcitem->gst}}%</td> @php $fgst = (($omcitem->rate*$omcitem->fresh_qty)*$omcitem->gst)/100; @endphp <td style="text-align: right;">{{ $total = $omcitem->rate*$omcitem->fresh_qty}} Rs</td> </tr> @endif @if($omcitem->repaired_qty != 0) <tr> <td>{{$omcitem->spare_code}}</td> <td>{{$omcitem->description}}</td> <td>{{$rate = $omcitem->rate}}</td> <td>Repaired</td> <td>{{$omcitem->repaired_qty}}</td> <td>{{$omcitem->gst}}%</td> @php $rgst = (($rate*$omcitem->repaired_qty)*$omcitem->gst)/100; @endphp <td style="text-align: right;">{{ $rtotal = ($rate*$omcitem->repaired_qty) }} Rs</td> </tr> @endif @php $subtotal = $total + $rtotal; $gsttotal = $gsttotal + ($fgst+$rgst); @endphp @endforeach </tbody> <tfoot class="footer"> <tr> <td colspan="6">Sub Total</td> <td ><span id="sub_total" style="float: right;">{{$subtotal}} Rs</span></td> </tr> <tr> <td colspan="6">GST Total</td> <td><span id="gst_total" style="float: right;">{{round($gsttotal,2)}} Rs</span></td> </tr> <tr> <td colspan="6">Grand Total</td> <td><span id="grand_total" style="float: right;">{{round(($subtotal+$gsttotal),2)}} Rs</span></td> </tr> </tfoot> </table> <div id="loaderAction"> <div class="loader"></div> </div> </div> </div> </div> </div> <div class="col-lg-12 grid-margin"> <div class="card"> <div class="card-body"> <div class="row"> <div class="col-lg-8"></div> <div class="col-lg-4"> @if( $omc->status == 'request') <a onclick="authorized_omc()" class="btn btn-lg btn-info" style="color: #fff;">Authorized</a> @endif </div> </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') !!} <script type="text/javascript"> function authorized_omc(){ swal({ title: "Do you want to authorised the OMCR?", text: "if yes then press 'OK' button otherwise press 'Cancel' button to cancel it.", icon: "warning", buttons: true, dangerMode: true, }).then((willDelete) => { if (willDelete) { var url = window.location.origin+"/admin/authorize-omc" var data = {}; data._token = "{{ csrf_token() }}"; data.omc_id = "{{ $omc->id }}"; $('#loaderAction').show(); $.ajax({ type: "POST", url: url, data: data, success:function(res){ console.log(res); if(res.success == true){ swal(res.msg, { icon: "success", }); window.location.href = window.location.origin+"/admin/all-omc-requests"; }else{ swal(res.msg, { icon: "error", }); } $('#loaderAction').hide(); }, error:function(error){ console.log(error); }, dataType: 'json' }); } }); } </script> @endpush