/
home
/
sjslayjy
/
public_html
/
olddevlok
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title','Freight Payment'); ?> <?php $__env->startSection('content'); ?> <div class="main-content"> <div class="main-content-inner"> <div class="breadcrumbs ace-save-state" id="breadcrumbs"> <ul class="breadcrumb"> <li> <i class="ace-icon fa fa-home home-icon"></i> <a href="#"><?php echo e(__('messages.Home')); ?></a> </li> <li><a href="<?php echo e('/user/freight-payments'); ?>"> <?php echo e(__('messages.FreightPayments')); ?> </a></li> <li class="active"> <?php echo e(__('messages.FreightPayment')); ?></li> </ul> </div> <div class="page-content"> <div class="page-header"> <h1> <?php echo e(__('messages.FreightPayment')); ?> </h1> </div><!-- /.page-header --> <form action="<?php echo e(url('/user/freight-payment')); ?>" method="post" role="form" id="freightPaymentForm" onsubmit="return validateForm()"> <?php echo e(csrf_field()); ?> <div class="container"> <div class="row"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title"> <?php echo e(__('messages.FreightPayment')); ?> <?php echo e(__('messages.Form')); ?> </h3> </div> <div class="panel-body"> <div class="col-md-4"> <div class="form-group"> <label for="qr_data"> <?php echo e(__('messages.LoadingSlip')); ?></label> <input type="text" class="form-control" name="qr_data" id="qr_data" onchange="getLoadingSlipDetails(this.value)"> </div> </div> <div class="clearfix"></div> <div id="details" style="display: none;"> <input type="hidden" name="product_loading_id" id="product_loading_id"> <div class="col-md-4"> <div class="form-group"> <label for="product_company"> <?php echo e(__('messages.ProductCompany')); ?></label> <input type="text" class="form-control" name="product_company" id="product_company" readonly=""> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="product"><?php echo e(__('messages.Product')); ?></label> <input type="text" class="form-control" name="product" id="product" readonly=""> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="party_name"><?php echo e(__('messages.Party')); ?> <?php echo e(__('messages.Name')); ?></label> <input type="text" class="form-control" name="party_name" id="party_name" readonly=""> </div> </div> <div class="clearfix"></div> <div class="col-md-4"> <div class="form-group"> <label for="transporter"> <?php echo e(__('messages.Transporter')); ?></label> <input type="text" class="form-control" name="transporter" id="transporter" readonly=""> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="truck_number"> <?php echo e(__('messages.TruckNumber')); ?></label> <input type="text" class="form-control" name="truck_number" id="truck_number" readonly=""> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="quantity"> <?php echo e(__('messages.Quantity')); ?></label> <input type="text" class="form-control" name="quantity" id="quantity" readonly=""> </div> </div> <div class="clearfix"></div> <div class="col-md-4"> <div class="form-group"> <label for="destination"> <?php echo e(__('messages.Destination')); ?></label> <select class="form-control select2" name="destination" id="destination"> <option value="00"> <?php echo e(__('messages.Destination')); ?> <?php echo e(__('messages.Select')); ?></option> <?php $__currentLoopData = $freight_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $freight): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($freight->freight); ?>"><?php echo e($freight->destination); ?> (<?php echo e($freight->freight); ?>)</option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="freight_rate"><?php echo e(__('messages.Freight')); ?></label> <input type="text" class="form-control" name="freight_rate" id="freight_rate" readonly=""> </div> </div> <div class="col-md-4" id="toll_tax"> <div class="form-group"> <label for="toll_tax_amount">Toll Tax Amount</label> <input type="text" class="form-control" name="toll_tax_amount" id="toll_tax_amount" value="0" onkeyup="reCalculateFreight(this.value)"> </div> </div> <div class="col-md-4"> <div class="form-group"> <label for="freight"> <?php echo e(__('messages.Total')); ?> <?php echo e(__('messages.Freight')); ?></label> <input type="text" class="form-control" name="freight" id="freight" readonly=""> </div> </div> <div class="clearfix"></div> <div class="pull-right"> <a href="<?php echo e(URL('/user/generate-loading-slip-invoice')); ?>" class="btn btn-default" >Reset</a> <button type="button" id="saveInvoiceDetails" name="saveFreightPaymentForm" class="btn btn-primary">Save Freight Payment</button> </div> </div> <div class="clearfix"></div> <div class="freight-error" style="display: none;"> <div class="col-md-offset-4"> <span id="freight_error_span" style="font-size: 30px; color: red; text-align: center;"></span> </div> </div> </div> </div> </div> </div> </form> </div> </div><!-- /.page-content --> </div><!-- /.main-content --> <?php $__env->startSection('script'); ?> <?php echo e(Html::script("assets/js/ace-elements.min.js")); ?> <?php echo e(Html::script("assets/js/ace.min.js")); ?> <?php echo e(Html::script("assets/js/bootstrap-datepicker.min.js")); ?> <script type="text/javascript"> $(document).ready(function() { $("#qr_data").focus(); $('.date-picker').datepicker({ format: 'dd/mm/yyyy', endDate: '+0d', autoclose: true }); // $("#destination").change(function(event) { // event.preventDefault(); // var destination_freight = $("#destination").val(); // var quantity = $("#quantity").val(); // if (destination_freight == "00") { // swal('Error','Please Select Destination','error'); // $("#freight").val(''); // } else { // var freight = parseFloat(destination_freight) * parseInt(quantity); // $("#freight").val(freight); // } // }); $("#saveInvoiceDetails").click(function(event) { event.preventDefault(); $(".loading-bg").show(); $.ajax({ url: $("#freightPaymentForm").attr('action'), type: 'POST', data: $("#freightPaymentForm").serialize(), success:function(data){ console.log(data); $(".loading-bg").show(); if (data.flag) { swal({ title : "Success", text : data.message, type : "success" }, function(){ window.location.reload(); }); } else { swal({ title : "Error", text : data.message, type : "error" }, function(){ window.location.reload(); }); } } }) .done(function() { console.log("success"); }) .fail(function() { console.log("error"); }) .always(function() { console.log("complete"); }); }); }); function validateForm(){ if($('#destination').val() == ""){ swal({ title : 'Error', text : 'Please Select Destination', type : 'error' }, function(){ $("#destination").select2('open'); }); return false; }else{ return true; } } function getLoadingSlipDetails(qr_value){ var url ="<?php echo e(url('get-loading-slip-details')); ?>"; if (qr_value == "") { swal({ title : 'Loading Slip Missing!', text : 'Please Scan Loading Slip QR Code', type : 'error' }, function(){ $("#qr_data").focus(); $("#token_id").val(''); $("#product_company").val(''); $("#product").val(''); $("#party_name").val(''); $("#transporter").val(''); $("#truck_number").val(''); $("#quantity").val(''); $("#destination").select2("val", "00"); $("#freight").val(''); }); } else { $(".loading-bg").show(); $.ajax({ url: url+"/"+qr_value, type: 'GET', success:function(data){ console.log(data); $(".loading-bg").hide(); if (data.flag) { $("#qr_data").attr('readonly', true); $("#product_loading_id").val(data.product_loading.id); $("#product_company").val(data.product_loading.product_company_name); $("#product").val(data.product_loading.product_name); $("#party_name").val(data.product_loading.dealer_name); $("#transporter").val(data.product_loading.transporter_name); $("#truck_number").val(data.product_loading.truck_number); $("#quantity").val(data.product_loading.quantity); $("#freight_rate").val(data.product_loading.freight); if(data.product_loading.master_rake_id !== null){ if(data.product_loading.warehouse_id !== null){ var freight = parseFloat(data.product_loading.freight) * parseInt(data.product_loading.recieved_quantity); }else{ var freight = parseFloat(data.product_loading.freight) * parseInt(data.product_loading.quantity); } }else{ var freight = parseFloat(data.product_loading.freight) * parseInt(data.product_loading.quantity); } $("#freight").val(freight); if(data.product_loading.loading_slip_type == "2"){ $("#toll_tax").show(); } $("#details").show(); } else { $("#freight_error_span").text(data.message); $(".freight-error").show(); } } }); } $('.date-picker').datepicker({ format: 'dd/mm/yyyy', endDate: '+0d', autoclose: true }); } function reCalculateFreight(value){ if(value == ""){ var toll_tax = 0; }else{ var toll_tax = parseFloat(value); var freight = parseFloat($("#freight_rate").val()) * parseInt($("#quantity").val()); $("#freight").val(freight + toll_tax); } } </script> <?php $__env->stopSection(); ?> <?php $__env->stopSection(); ?> <?php echo $__env->make('dashboard.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/pmmsanvp/public_html/srt/resources/views/dashboard/token/freight-payment.blade.php ENDPATH**/ ?>