/
home
/
sjslayjy
/
public_html
/
assets
/
resources
/
views
/
admin
/
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>PO date : <br/><strong>{{$omc->cutomer_po_date}}</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> </div> <div class="row"> <div class="col-lg-3"> <label>Invoice No : <br/><strong>{{$omc->invoice_no}}</strong></label> </div> <div class="col-lg-3"> <label>Invoice Date : <br/><strong>{{$omc->invoice_date}}</strong></label> </div> <div class="col-lg-3"> <label>Invoice Basic Value : <br/><strong>{{$omc->invoice_basic_value}}</strong></label> </div> <div class="col-lg-3"> <label>Site ID : <br/><strong>{{$omc->site_id}}</strong></label> </div> </div> <div class="row"> <div class="col-lg-3"> <label>Site Name : <br/><strong>{{$omc->site_name}}</strong></label> </div> <div class="col-lg-3"> <label>Complain Closure Date : <br/><strong>{{$omc->complaint_closure_date}}</strong></label> </div> <div class="col-lg-3"> <label>Customer Open PO Status : <br/><strong>{{$omc->cust_open_po_status}}</strong></label> </div> <div class="col-lg-3"> <label>Open PO Amount : <br/><strong>{{$omc->open_po_amount}}</strong></label> </div> </div> <div class="row"> <div class="col-lg-3"> <label>Invoice Value : <br/><strong>{{$omc->invoice_value}}</strong></label> </div> <div class="col-lg-3"> <label>Requested BY : <br/><strong>{{$omc->requestedBy($omc->request_by)}}</strong></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>Total</th> </tr> </thead> <tbody id="tbody"> @php $subtotal = 0; $gsttotal = 0; @endphp @foreach($omc_items as $omcitem) @php $total = 0; $rtotal = 0; $rgst = 0; $fgst = 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> @php $fgst = (($omcitem->rate*$omcitem->fresh_qty)*$omcitem->gst)/100; @endphp <td style="text-align: right;">{{ $total = $omcitem->rate*$omcitem->fresh_qty}} Rs</td> @php $subtotal = $subtotal + $total; @endphp </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> @php $rgst = (($rate*$omcitem->repaired_qty)*$omcitem->gst)/100; @endphp <td style="text-align: right;">{{ $rtotal = ($rate*$omcitem->repaired_qty) }} Rs</td> @php $subtotal = $subtotal + $rtotal; @endphp </tr> @endif @endforeach </tbody> <tfoot class="footer"> <tr> <td colspan="5"> Total </td> <td ><span id="sub_total" style="float: right;">{{round($subtotal,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' && (Auth::user()->role == 17 || Auth::user()->role == 23 || Auth::user()->role == 18)) <a onclick="authorized_omc()" class="btn btn-lg fw-bold" style="background-color: #5ced73; color:#ffffff; font-weight: bold; font-size:15px;">Authorize</a> <a onclick="cancle_omc()" class="btn btn-lg fw-bold" style="background-color: #E1341E; color:#ffffff; font-weight: bold; font-size:15px;">Reject</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 cancle_omc() { swal({ title:"Do You Want to Cancle the OMCR ?", text:"If yes then press 'OK' button otherwise press 'Cancel' button to Reject it.", icon:"warning", buttons:true, dangerMode: true }).then((willDelete)=>{ if(willDelete) { var url = window.location.origin+"/admin/cancle-omc" var data = {}; data._token = "{{ csrf_token() }}"; data.omc_id = "{{ $omc->id }}"; $('#loaderAction').show(); $.ajax({ url:url, type:"POST", 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' }); } }); } function authorized_omc(){ swal({ title: "Do you want to authorise the OMCR?", text: "if yes then press 'OK' button otherwise press 'Cancel' button to Reject 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