/
home
/
sjslayjy
/
public_html
/
assets
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startPush('plugin-styles'); ?> <!-- <?php echo Html::style('/assets/plugins/plugin.css'); ?> --> <?php $__env->stopPush(); ?> <?php $__env->startSection('content'); ?> <div class="row"> <div class="col-lg-12 grid-margin"> <div class="card"> <div class="card-body"> <h3 class="card-title">Requested Indent</h3> <div class="row"> <div class="col-lg-3"> <label>Indent Number : <br/><strong><?php echo e($indent->indent_no); ?></strong></label> </div> <div class="col-lg-3"> <label>Indent Date : <br/><strong><?php echo e($indent->indent_date); ?></strong></label> </div> <div class="col-lg-3"> <label>Indent Placed By : <br/><strong><?php echo e($indent->addedBy($indent->indent_placed_by)); ?></strong></label> </div> <div class="col-lg-3"> <label>Indent Status : <br/><strong><?php echo e($indent->status); ?></strong></label> </div> </div> <div class="row"> <div class="col-lg-3"> <label>Business Type : <br/><strong><?php echo e($indent->business_type); ?></strong></label> </div> <div class="col-lg-3"> <label>Customer Code : <br/><strong><?php echo e($indent->customer_code); ?></strong></label> </div> <div class="col-lg-3"> <label>Customer Name : <br/><strong><?php echo e($indent->customer_name); ?></strong></label> </div> <div class="col-lg-3"> <label>Customer PO : <br/><strong><?php echo e($indent->customer_po); ?></strong></label> </div> </div> <div class="row"> <div class="col-lg-3"> <label>Cutomer PO Date : <br/><strong><?php echo e($indent->cutomer_po_date); ?></strong></label> </div> <div class="col-lg-3"> <label>Requested From Warehouse : <br/><strong><?php echo e($indent->ware_house); ?></strong></label> </div> <div class="col-lg-6"> <label>Remarks: <br/><strong><?php echo e($indent->remarks); ?></strong></label> </div> </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">Spare Parts List</h4> </div> <!--div class="col-lg-6"> <input type="text" class="form-control" id="spareCode" placeholder="Enter Spare Code"> </div> <div class="col-lg-2"> <button type="button" class="btn btn-success btn-fw" onclick="addselectedItem()">Add Into Indent</button> </div--> </div> <div class="table-responsive"> <table class="table table-striped table-bordered"> <thead> <tr> <th> Item Code</th> <th> Description</th> <th> UOM</th> <th> Category</th> <th> Qty</th> <th> --- </th> </tr> </thead> <tbody id="tbody"> <?php $__currentLoopData = $indent->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr class="row_<?php echo e($item->id); ?>"> <td class="font-weight-medium"><?php echo e($item->spare_code); ?></td> <td><?php echo e($item->spareParts($item->spare_code)->description); ?></td> <td><?php echo e($item->spareParts($item->spare_code)->uom); ?></td> <td><?php echo e($item->spareParts($item->spare_code)->category); ?></td> <td><?php echo e($item->qty); ?></td> <td><!--a href="#" onclick="removeItem('<?php echo e($item->id); ?>')"><i class="mdi mdi-delete-forever"></i></a--></td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </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-9"></div> <!--div class="col-lg-3"><button type="button" onclick="place_indent()" class="btn btn-warning btn-fw">Place Indent</button></div--> </div> </div> </div> </div> </div> <?php $__env->stopSection(); ?> <?php $__env->startPush('plugin-scripts'); ?> <?php echo Html::script('/assets/plugins/chartjs/chart.min.js'); ?> <?php echo Html::script('/assets/plugins/jquery-sparkline/jquery.sparkline.min.js'); ?> <?php $__env->stopPush(); ?> <?php $__env->startPush('custom-scripts'); ?> <?php echo Html::script('/assets/js/dashboard.js'); ?> <script type="text/javascript"> function init_cart(){ var mydata = {}; mydata.items = []; localStorage.setItem('mydata', JSON.stringify(mydata)); } function removeItem(id){ var mydata = JSON.parse(localStorage.getItem('mydata')); var items = mydata.items; $(items).each(function (index){ if(items[index].id == id){ items.splice(index,1); // This will remove the object that first name equals to Test1 return false; // This will stop the execution of jQuery each loop. } }); mydata.items = items; localStorage.setItem('mydata',JSON.stringify(mydata)); showSelectedItems(); } function addselectedItem(){ var code = $('#spareCode').val(); if(code != ""){ var url = window.location.origin+"/admin/get-spare-part" var data = {}; data.code = code; data._token = "<?php echo e(csrf_token()); ?>"; $('#loaderAction').show(); $.ajax({ type: "POST", url: url, data: data, success:function(res){ if(res.success == true){ var spare_part = res.spare_part; var mydata = JSON.parse(localStorage.getItem('mydata')); var is_added = false; $.each(mydata.items,function(key,val){ if(parseInt(val.id) == spare_part.id){ is_added = true; } }); if(is_added == false){ var sparts = spare_part; sparts.qty = 0; mydata.items.push(spare_part); } localStorage.setItem('mydata',JSON.stringify(mydata)); showSelectedItems(); }else{ swal("Invailid Spare Code !", { icon: "error", }); } $('#loaderAction').hide(); }, error:function(error){ console.log(error); }, dataType: 'json' }); }else{ swal("Please Enter Spare Code in Textbox !", { icon: "error", }); } } function showSelectedItems(){ var mydata = JSON.parse(localStorage.getItem('mydata')); var html = ''; var n = 0; $.each(mydata.items,function(key,spare_part){ html +=`<tr class="row_`+spare_part.id+`"> <td class="font-weight-medium">`+spare_part.code+`</td> <td>`+spare_part.description+`</td> <td>`+spare_part.uom+`</td> <td>`+spare_part.category+`</td> <td><input type="text" name="qty" onkeyup="calculate(this,`+spare_part.id+`)" style="width: 80px;" value="`+spare_part.qty+`"/></td> <td><a href="#" onclick="removeItem(`+spare_part.id+`)"><i class="mdi mdi-delete-forever"></i></a></td> </tr>`; }); $('#tbody').html(html); } function calculate(t,id){ var qty = parseInt($(t).val()); if(qty != ""){ var rate = parseInt($('#rate_'+id).val()); var total = qty*rate; $('#total_'+id).text(total+' Rs'); addCartValueInKey(id,'qty',qty); } } function addCartValueInKey(id,key,value){ var mydata = JSON.parse(localStorage.getItem('mydata')); $.each(mydata.items,function(k,val){ if(parseInt(val.id) == id){ mydata.items[k][key] = value; } }); localStorage.setItem('mydata',JSON.stringify(mydata)); } function place_indent(){ swal({ title: "Is Your Spare Parts Verified ?", text: "if you verified your items then press 'Ok',otherwise press 'Cancel' and check again.", icon: "warning", buttons: true, dangerMode: true, }).then((willDelete) => { if (willDelete) { var url = window.location.origin+"/circle-store/place-indent" var mydata = JSON.parse(localStorage.getItem('mydata')); mydata._token = "<?php echo e(csrf_token()); ?>"; $('#loaderAction').show(); $.ajax({ type: "POST", url: url, data: mydata, success:function(res){ console.log(res); if(res.success == true){ swal(res.msg, { icon: "success", }); init_cart(); showSelectedItems(); }else{ swal(res.msg, { icon: "error", }); } $('#loaderAction').hide(); }, error:function(error){ console.log(error); }, dataType: 'json' }); } }); } $(document).ready(function(){ }); </script> <?php $__env->stopPush(); ?> <?php echo $__env->make('layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/assets/resources/views/circle-store/indent/requested-indent.blade.php ENDPATH**/ ?>