/
home
/
sjslayjy
/
public_html
/
olddevlok
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title','Payment Rebate Report'); ?> <?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="#">Home</a> </li> <li class="active">Payment Rebate</li> </ul> </div> <div class="page-content"> <div class="row"> <div class="col-xs-12"> <h3 class="header smaller lighter blue">Payment Rebate</h3> <form action="" method="POST" role="form"> <div class="row"> <?php echo e(csrf_field()); ?> <div class="col-md-3"> <div class="form-group"> <label for="master_rake_id">Master Rake</label> <select class="form-control select2" name="master_rake_id" id="master_rake_id"> <option value="">Select Master Rake</option> <?php $__currentLoopData = $master_rakes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $master_rake): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($master_rake->id); ?>" <?php echo e(isset($master_rake_id) && $master_rake_id==$master_rake->id ? "selected":""); ?>><?php echo e($master_rake->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <?php if($errors->has('master_rake_id')): ?> <span class="label label-danger"><?php echo e($errors->first('master_rake_id')); ?></span> <?php endif; ?> </div> </div> <div class="col-md-3"> <div class="form-group"> <button type="submit" class="btn btn-primary">Submit</button> </div> </div> </div> </form> </div> </div> <div class="row"> <div class="col-xs-12"> <?php if(session('success')): ?> <div class="alert alert-success"> <?php echo e(session('success')); ?> </div> <?php endif; ?> <?php if(session('error')): ?> <div class="alert alert-danger"> <?php echo e(session('error')); ?> </div> <?php endif; ?> <div class="clearfix"> <div class="pull-right tableTools-container"> </div> </div> <div class="table-header"> Inventory </div> <div class="table-responsive"> <div class="dataTables_borderWrap"> <table id="dynamic-table" class="table table-striped table-bordered table-hover"> <thead> <tr> <th>Party Name</th> <th>Product</th> <th>Quantity</br>(M.T.)</th> <th>Invoice </br> Number</th> <th>Invoice Date</th> <th>DC Date</th> <th>Due Date</th> <th>Invoice </br>Amount</th> <th>Reciept No</th> <th>Payment Date</th> <th>Payment</br> Amount</th> <th>No.Of Days</th> <th>Approved</br> Credit</th> <th>Operation </br>Period</th> <th>Balance</br> Days</th> <th>Discount <br> Day/MTS </th> <th>Rate </br> per MTS</th> <th>Claim</br>Amount(IN Rs.)</th> <th></th> </tr> </thead> <tbody> <?php $__currentLoopData = $company_dis; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invoice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <td> <?php echo e(getModelById('Dealer',$invoice->dealer_id)->name); ?> (<?php echo e(getModelById('Dealer',$invoice->dealer_id)->address1); ?>) </td> <td><?php echo e($invoice->product); ?></td> <td id="quantity_<?php echo e($invoice->id); ?>"> <?php echo e($invoice->quantity/(1000/getModelById('Product',$invoice->product_id)->weight_in_kg)); ?> </td> <td><?php echo e($invoice->invoice_number); ?></td> <td><?php echo e($invoice->invoice_date); ?></td> <td><?php echo e($invoice->invoice_date); ?></td> <td><?php echo e($invoice->due_date); ?></td> <td id="total_<?php echo e($invoice->id); ?>"><?php echo e($invoice->total); ?></td> <td><?php echo e($invoice->bank_reference_number); ?></td> <td><?php echo e($invoice->payment_date); ?></td> <td><?php echo e($invoice->payment_amount); ?></td> <?php if(is_null($invoice->approved_credit_days)): ?> <td><?php $start = strtotime($invoice->invoice_date); $end = strtotime($invoice->due_date); echo $no_of_days = ceil(abs($end - $start) / 86400); ?></td> <td> <?php if($invoice->is_paid): ?> <input type="text" size="3" id="approved_credit_days_<?php echo e($invoice->id); ?>" onkeyup="calculateBalanceDays(this.value,<?php echo e($invoice->id); ?>)"> <?php endif; ?> </td> <td id="operational_days_<?php echo e($invoice->id); ?>"><?php if($invoice->is_paid): ?> <?php $start = strtotime($invoice->dc_date); $end = strtotime($invoice->payment_date); echo $operational_days = ceil(abs($end - $start) / 86400); ?> <?php endif; ?></td> <td id="balance_days_<?php echo e($invoice->id); ?>"></td> <td> <?php if($invoice->is_paid): ?> <input type="text" size="3" onkeyup="calculateClaim(<?php echo e($invoice->id); ?>)" id="discount_<?php echo e($invoice->id); ?>" > <?php endif; ?> </td> <td id="rate_per_mts_<?php echo e($invoice->id); ?>"></td> <td id="claim_amount_<?php echo e($invoice->id); ?>"></td> <?php else: ?> <td><?php $start = strtotime($invoice->invoice_date); $end = strtotime($invoice->due_date); echo $no_of_days = ceil(abs($end - $start) / 86400); ?></td> <td><?php echo e($invoice->approved_credit_days); ?></td> <td><?php echo e($invoice->operation_period); ?></td> <td><?php echo e($invoice->balance_days); ?></td> <td><?php echo e($invoice->discount_perday_permts); ?></td> <td><?php echo e($invoice->rate_per_mts); ?></td> <td><?php echo e($invoice->claim_amount); ?></td> <?php endif; ?> <td> <?php if(is_null($invoice->approved_credit_days)): ?> <a href="javascript:;" class="btn btn-primary" onclick="saveDiscountDetails(<?php echo e($invoice->id); ?>)">Save</a> <?php endif; ?> </td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </table> </div> </div> </div> </div> </div><!-- /.page-content --> </div> </div> <?php $__env->startSection('script'); ?> <?php echo e(Html::script("assets/js/jquery.dataTables.min.js")); ?> <?php echo e(Html::script("assets/js/jquery.dataTables.bootstrap.min.js")); ?> <?php echo e(Html::script("assets/js/dataTables.buttons.min.js")); ?> <?php echo e(Html::script("assets/js/buttons.flash.min.js")); ?> <?php echo e(Html::script("assets/js/buttons.html5.min.js")); ?> <?php echo e(Html::script("assets/js/buttons.print.min.js")); ?> <?php echo e(Html::script("assets/js/buttons.colVis.min.js")); ?> <?php echo e(Html::script("assets/js/dataTables.select.min.js")); ?> <?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/mdtimepicker.min.js")); ?> <?php echo e(Html::script("assets/js/bootstrap-datepicker.min.js")); ?> <script type="text/javascript"> function calculateClaim(invoice_id){ var discount = $('#discount_'+invoice_id).val(); console.log(discount); if(discount != ""){ discount = parseFloat(discount); var rate_per_mts = discount * parseInt($('#balance_days_'+invoice_id).text()); var claim_amount = rate_per_mts * parseInt($('#quantity_'+invoice_id).text()); $('#rate_per_mts_'+invoice_id).text(rate_per_mts); $('#claim_amount_'+invoice_id).text(claim_amount); }else{ $('#rate_per_mts_'+invoice_id).text(''); $('#claim_amount_'+invoice_id).text(''); } } function calculateBalanceDays(days,invoice_id){ if(days != ""){ var days = parseFloat(days); var balance_days = days - parseInt($('#operational_days_'+invoice_id).text()); $('#balance_days_'+invoice_id).text(balance_days); calculateClaim(invoice_id); }else{ $('#balance_days_'+invoice_id).text(''); } } function saveDiscountDetails(invoice_id){ var approved_credit_days = $('#approved_credit_days_'+invoice_id).val() var operational_days = $('#operational_days_'+invoice_id).text() var balance_days = $('#balance_days_'+invoice_id).text(); var discount = $('#discount_'+invoice_id).val(); var rate_per_mts = $('#rate_per_mts_'+invoice_id).text(); var claim_amount = $('#claim_amount_'+invoice_id).text(); if(approved_credit_days == ""){ swal('Error','Approved Credit Days should not be blank','error'); }else if(operational_days == ""){ swal('Error','Operational Days should not be blank','error'); }else if(balance_days == ""){ swal('Error','Balance Days should not be blank','error'); }else if(discount == ""){ swal('Error','Discount should not be blank','error'); }else if(rate_per_mts == ""){ swal('Error','Rate Per MTS should not be blank','error'); }else if(claim_amount == ""){ swal('Error','Claim Amount should not be blank','error'); }else{ swal({ title: "Are you sure?", text: "You will not be able to edit this details!", type: "warning", showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: 'Yes, I am sure!', cancelButtonText: "No, cancel it!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm){ $.ajaxSetup({ headers: {'X-CSRF-Token': $('meta[name=_token]').attr('content')} }); $.ajax({ url: "<?php echo e(url('/user/save-company-di-discount/')); ?>", type: 'POST', data:{invoice_id:invoice_id,approved_credit_days:approved_credit_days,operational_days:operational_days,balance_days:balance_days,discount:discount,rate_per_mts:rate_per_mts,claim_amount:claim_amount}, success:function(data){ if(data.flag){ swal("Success", data.message, "success"); }else{ swal("Error", data.message, "error"); } } }); } else { swal("Cancelled", "Your Details not Saved :)", "error"); } }); } } </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/inventory/payment-rebate-report.blade.php ENDPATH**/ ?>