/
home
/
sjslayjy
/
public_html
/
olddevlok
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title','Rake Summary'); ?> <?php $__env->startSection('style'); ?> <?php echo e(Html::style("assets/css/bootstrap-datepicker3.min.css")); ?> <?php $__env->stopSection(); ?> <?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 class="active"> <?php echo e(__('messages.RakeSummary')); ?></li> <div id="google_translate_element"></div> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'en', includedLanguages: 'hi', layout: google.translate.TranslateElement.InlineLayout.SIMPLE }, 'google_translate_element'); } </script> <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> <button id="btnExport" onclick="fnExcelReport();"style="float: right" id="xls_download" title="Export"><i class="fa fa-2x fa-file-excel-o" aria-hidden="true"></i> </button> <script> response.setHeader("Set-Cookie", "HttpOnly;Secure;SameSite=Strict"); function fnExcelReport() { var tab_text="<table border='2px'><tr bgcolor='#87AFC6'>"; var textRange; var j=0; tab = document.getElementById('dynamic-table'); // id of table for(j = 0 ; j < tab.rows.length ; j++) { tab_text=tab_text+tab.rows[j].innerHTML+"</tr>"; //tab_text=tab_text+"</tr>"; } tab_text=tab_text+"</table>"; tab_text= tab_text.replace(/<A[^>]*>|<\/A>/g, "");//remove if u want links in your table tab_text= tab_text.replace(/<img[^>]*>/gi,""); // remove if u want images in your table tab_text= tab_text.replace(/<input[^>]*>|<\/input>/gi, ""); // reomves input params var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer { txtArea1.document.open("txt/html","replace"); txtArea1.document.write(tab_text); txtArea1.document.close(); txtArea1.focus(); sa=txtArea1.document.execCommand("SaveAs",true,"Say Thanks to Sumit.xls"); } else //other browser not tested on IE 11 sa = window.open('data:application/vnd.ms-excel,' + encodeURIComponent(tab_text)); return (sa); } </script> </ul> </div> <div class="page-content"> <div class="row"> <div class="col-xs-12"> <h3 class="header smaller lighter blue"> <?php echo e(__('messages.RakeSummary')); ?></h3> <form action="" method="POST" role="form" id="FilterForm"> <div class="row"> <?php echo e(csrf_field()); ?> <div class="col-md-3"> <div class="form-group"> <label for="master_rake_id"> <?php echo e(__('messages.masterrake')); ?></label> <select class="form-control select2" name="master_rake_id" id="master_rake_id" onchange="filter()"> <option value=""> <?php echo e(__('messages.SelectMasterRake')); ?></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> <?php if(isset($master_rake_products)): ?> <div class="col-md-3"> <div class="form-group"> <label for="product_id"> <?php echo e(__('messages.Product')); ?></label> <select class="form-control select2" name="product_id" id="product_id"> <option value=""> Select <?php echo e(__('messages.Product')); ?></option> <?php $__currentLoopData = $master_rake_products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $master_rake_product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($master_rake_product->product_id); ?>" <?php echo e(isset($product_id) && $product_id==$master_rake_product->product_id ? "selected":""); ?>><?php echo e(getModelById('Product',$master_rake_product->product_id)->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> </div> </div> <?php endif; ?> <div class="col-md-3"> <div class="form-group"> <button type="submit" class="btn btn-primary">Submit</button> </div> </div> </form> </div> </div> <div class="clearfix"> <div class="pull-right tableTools-container"> </div> </div> <div class="table-header"> <?php echo e(__('messages.RakeSummary')); ?> <?php if(isset($master_rake_id)): ?> <div class="widget-toolbar no-border"> <a href="<?php echo e(URL('user/export-rake-summary/'.$master_rake_id)); ?>" class="btn btn-xs bigger btn-danger"> <?php echo e(__('messages.Export')); ?> </a> </div> <?php endif; ?> </div> <div class="table-responsive"> <div class="dataTables_borderWrap"> <div class="table-responsive"> <table id="" class="table table-striped table-bordered table-hover"> <thead> <tr> <th> <?php echo e(__('messages.Party')); ?> <?php echo e(__('messages.Name')); ?></th> <th> <?php echo e(__('messages.Product')); ?></th> <th> <?php echo e(__('messages.Allotment')); ?> <?php echo e(__('messages.From')); ?><br/> <?php echo e(__('messages.ProductCompany')); ?></th> <?php if(isset($allotments)): ?> <?php $__currentLoopData = $date_range; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$date): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php $total_datewise_quantity[$date] = array(); ?> <th><?php echo e(date('d-m-y',strtotime($date))); ?></th> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> <th> <?php echo e(__('messages.Total')); ?></th> <th> <?php echo e(__('messages.Pending')); ?> <?php echo e(__('messages.Quantity')); ?></th> </tr> </thead> <tbody> <?php if(isset($allotments)): ?> <?php $total_company_allotment = array(); $total_loading_allotment = array(); $pending_allotment = array(); ?> <?php $__currentLoopData = $allotments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $allotment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr id="tr_<?php echo e($allotment->id); ?>"> <td style="word-wrap: break-word; width:350px; padding: 10px;"><?php echo e(getModelById('Dealer',$allotment->dealer_id)->name); ?>(<?php echo e(getModelById('Dealer',$allotment->dealer_id)->address1); ?>)</td> <td> <?php echo e(getModelById('Product',$allotment->product_id)->name); ?> </td> <td><?php echo e($allotment->alloted_quantity); ?></td> <?php if(isset($allotments)): ?> <?php @array_push($total_company_allotment, $allotment->alloted_quantity); $total = 0; ?> <?php $__currentLoopData = $date_range; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$date): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <td> <?php $dates = $date; $date = date('Y-m-d',strtotime($date)); $product_loadings = \App\ProductLoading::where('dealer_id',$allotment->dealer_id) ->where('product_id',$allotment->product_id) ->where('master_rake_id',$allotment->master_rake_id) ->where('from_warehouse_id',null) ->whereRaw('DATE(created_at) = ?', [$date]) ->sum('quantity'); $total_amt = $product_loadings; $total = $total + $product_loadings; array_push($total_datewise_quantity[$dates], $total_amt); ?> <?php echo e($product_loadings); ?> </td> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> <td><?php echo e($total); ?></td> <td><?php echo e($allotment->alloted_quantity-$total); ?></td> </tr> <?php @array_push($total_loading_allotment, $total); @array_push($pending_allotment, $allotment->alloted_quantity-$total); ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <tr> <th> <?php echo e(__('messages.Total')); ?> (<?php echo e(__('messages.with')); ?> <?php echo e(__('messages.Allotment')); ?>)</th> <th></th> <th><?php echo e(array_sum($total_company_allotment)); ?></th> <?php if(isset($allotments)): ?> <?php $__currentLoopData = $date_range; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$date): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <th><?php echo e(array_sum($total_datewise_quantity[$date])); ?></th> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> <th><?php echo e(array_sum($total_loading_allotment)); ?></th> <th><?php echo e(array_sum($pending_allotment)); ?></th> </tr> <?php $__currentLoopData = $warehouse_allotments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $warehouse_allotment): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <td style="word-wrap: break-word; width:350px; padding: 10px;"><?php echo e(getModelById('Warehouse',$warehouse_allotment->warehouse_id)->name); ?>(<?php echo e(getModelById('Warehouse',$warehouse_allotment->warehouse_id)->location); ?>)</td> <td></td> <td></td> <?php $warehouse_total = 0; ?> <?php $__currentLoopData = $date_range; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$date): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <td> <?php $dates = $date; $date = date('Y-m-d',strtotime($date)); if(isset($product_id) && $product_id != ""){ $product_loadings = \App\ProductLoading::where('warehouse_id',$warehouse_allotment->warehouse_id) ->where('product_id',$product_id) ->where('master_rake_id',$master_rake_id) ->whereRaw('DATE(created_at) = ?', [$date]) ->where('loading_slip_type',2) ->sum('quantity'); }else{ $product_loadings = \App\ProductLoading::where('warehouse_id',$warehouse_allotment->warehouse_id) ->whereRaw('DATE(created_at) = ?', [$date]) ->where('master_rake_id',$master_rake_id) ->where('loading_slip_type',2) ->sum('quantity'); } $total_amt = $product_loadings; $warehouse_total = $warehouse_total + $product_loadings; array_push($total_datewise_quantity[$dates], $total_amt); ?> <?php echo e($product_loadings); ?> </td> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <td><?php echo e($warehouse_total); ?></td> <td></td> </tr> <?php @array_push($total_loading_allotment, $warehouse_total); ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <tr> <th><?php echo e(__('messages.Total')); ?> (<?php echo e(__('messages.Allotment')); ?> <?php echo e(__('messages.with')); ?>/<?php echo e(__('messages.without')); ?>)</th> <th></th> <th><?php echo e(array_sum($total_company_allotment)); ?></th> <?php if(isset($allotments)): ?> <?php $__currentLoopData = $date_range; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$date): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <th><?php echo e(array_sum($total_datewise_quantity[$date])); ?></th> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> <th><?php echo e(array_sum($total_loading_allotment)); ?></th> <th><?php echo e(array_sum($pending_allotment)); ?></th> </tr> <tr> <td>RR <?php echo e(__('messages.Quantity')); ?></td> <td></td> <td></td> <td></td> <td></td> <td> <?php if(isset($product_id) && $product_id != ""): ?> <?php $master_rake_product = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->where('product_id',$product_id)->first(); echo $master_rake_product->quantity; ?> <?php else: ?> <?php $total_rr = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->sum('quantity'); echo $total_rr; ?> <?php endif; ?> </td> </tr> <tr> <td>Rake Shortage</td> <td></td> <td></td> <td></td> <td></td> <td> <?php if(isset($product_id) && $product_id != ""): ?> <?php $master_rake_product = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->where('product_id',$product_id)->first(); echo $master_rake_product->shortage_from_company; ?> <?php endif; ?> </td> </tr> <tr> <td>Net Received RR</td> <td></td> <td></td> <td></td> <td></td> <td> <?php if(isset($product_id) && $product_id != ""): ?> <?php $master_rake_product = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->where('product_id',$product_id)->first(); echo ($master_rake_product->quantity - $master_rake_product->shortage_from_company); ?> <?php else: ?> <?php $total_rr = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->sum('quantity'); echo $total_rr; ?> <?php endif; ?> </td> </tr> <?php $returned = 0; ?> <tr> <td>Returned</td> <td></td> <td></td> <td></td> <td></td> <td> <?php if(isset($product_id) && $product_id != ""): ?> <?php $returned = \App\ProductLoading::where('master_rake_id',$master_rake_id)->where('product_id',$product_id)->where('loading_slip_type',1)->where('recieved_quantity','>',0)->sum('recieved_quantity'); echo $returned; ?> <?php else: ?> <?php $returned = \App\ProductLoading::where('master_rake_id',$master_rake_id)->where('loading_slip_type',1)->where('recieved_quantity','>',0)->sum('recieved_quantity'); echo $returned; ?> <?php endif; ?> </td> </tr> <tr> <?php if(isset($product_id) && $product_id != ""): ?> <?php $master_rake_product = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->where('product_id',$product_id)->first(); $excess_shortage = array_sum($total_loading_allotment) - ($master_rake_product->quantity - $master_rake_product->shortage_from_company); ?> <?php else: ?> <?php $total_rr = \App\MasterRakeProduct::where('master_rake_id',$master_rake_id)->sum('quantity'); $excess_shortage = array_sum($total_loading_allotment) - $total_rr ?> <?php endif; ?> <td> <?php if($excess_shortage > 0): ?> <?php echo e(__('messages.Excess')); ?> <?php else: ?> Shortage <?php endif; ?> </td> <td></td> <td></td> <td></td> <td></td> <td> <?php echo e($excess_shortage); ?> </td> </tr> <?php endif; ?> </tbody> </table> </div> </div> </div> </div> <!-- Product Details Modal --> <div class="modal fade" id="productDetailsModal"> <div class="modal-dialog modal-sm"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Alloted Products</h4> </div> <div class="modal-body" id="details"> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> <!-- Product Details Modal --> </div><!-- /.page-content --> </div> </div><!-- /.main-content --> <?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/bootstrap-datepicker.min.js")); ?> <script type="text/javascript"> jQuery(function($) { //initiate dataTables plugin // $('.date-picker').datepicker({ autoclose: true, todayHighlight: true }) .next().on(ace.click_event, function(){ $(this).prev().focus(); }); var myTable = $('#dynamic-table').DataTable( { bAutoWidth: false, "aaSorting": [], } ); $.fn.dataTable.Buttons.defaults.dom.container.className = 'dt-buttons btn-overlap btn-group btn-overlap'; new $.fn.dataTable.Buttons( myTable, { buttons: [ { "extend": "colvis", "text": "<i class='fa fa-search bigger-110 blue'></i> <span class='hidden'>Show/hide columns</span>", "className": "btn btn-white btn-primary btn-bold", columns: ':not(:first):not(:last)' }, { "extend": "copy", "text": "<i class='fa fa-copy bigger-110 pink'></i> <span class='hidden'>Copy to clipboard</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "csv", "text": "<i class='fa fa-database bigger-110 orange'></i> <span class='hidden'>Export to CSV</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "excel", "text": "<i class='fa fa-file-excel-o bigger-110 green'></i> <span class='hidden'>Export to Excel</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "pdf", "text": "<i class='fa fa-file-pdf-o bigger-110 red'></i> <span class='hidden'>Export to PDF</span>", "className": "btn btn-white btn-primary btn-bold" }, { "extend": "print", "text": "<i class='fa fa-print bigger-110 grey'></i> <span class='hidden'>Print</span>", "className": "btn btn-white btn-primary btn-bold", autoPrint: false, message: 'This print was produced using the Print button for DataTables' } ] } ); myTable.buttons().container().appendTo( $('.tableTools-container') ); //style the message box var defaultCopyAction = myTable.button(1).action(); myTable.button(1).action(function (e, dt, button, config) { defaultCopyAction(e, dt, button, config); $('.dt-button-info').addClass('gritter-item-wrapper gritter-info gritter-center white'); }); var defaultColvisAction = myTable.button(0).action(); myTable.button(0).action(function (e, dt, button, config) { defaultColvisAction(e, dt, button, config); if($('.dt-button-collection > .dropdown-menu').length == 0) { $('.dt-button-collection') .wrapInner('<ul class="dropdown-menu dropdown-light dropdown-caret dropdown-caret" />') .find('a').attr('href', '#').wrap("<li />") } $('.dt-button-collection').appendTo('.tableTools-container .dt-buttons') }); }) </script> <script type="text/javascript"> function showProducts(id){ if(id == ""){ swal('Error','Allotment Is Missing'); }else{ $('.loading-bg').show(); $.ajax({ url: "<?php echo e(url('/user/allotment-details/')); ?>"+"/"+id, type: 'GET', success:function(data){ $('.loading-bg').hide(); $('#details').html(data); $('#productDetailsModal').modal('toggle'); } }); } } function filter(){ $('#product_id').val(''); $('#FilterForm').submit(); } </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/srtdev/resources/views/dashboard/rake/rake-summary.blade.php ENDPATH**/ ?>