/
home
/
sjslayjy
/
public_html
/
mosaram
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title', 'Field Collection'); ?> <?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">Field Collection</li> </ul> </div> <div class="page-content"> <div class="row"> <div class="col-xs-12"> <h3 class="header smaller lighter blue">Field Collection</h3> <div class="row"> <div class="col-xs-12"> <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="collection_user"> Collection user </label> <select class="form-control select2" name="collection_user" id="collection_user"> <option value=""> Select Collection User </option> <?php $__currentLoopData = $collection_user_list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($item->user_id); ?>" <?php echo e(isset($collection_user_id) && $collection_user_id == $item->user_id ? 'selected' : ''); ?>> <?php echo e($item->user->name); ?> </option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <?php if($errors->has('collection_user')): ?> <span class="label label-danger"><?php echo e($errors->first('collection_user')); ?></span> <?php endif; ?> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="collection_payment_mode">Collection Payment Mode</label> <select class="form-control select2" name="collection_payment_mode" id="collection_payment_mode"> <option value="">Select Mode</option> <option value="Cash" selected>Cash</option> <option value="cheque">Cheque</option> </select> <?php if($errors->has('collection_payment_mode')): ?> <span class="label label-danger"><?php echo e($errors->first('collection_payment_mode')); ?></span> <?php endif; ?> </div> </div> <div class="col-md-3"> <div class="form-group"> <button type="submit" id="filter" class="btn btn-primary">Submit</button> </div> </div> </div> </form> </div> </div> <?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">Total Cash Amount<span class="badge badge-success" style="margin-left:5px; font-size: 14px;"><i class="fa fa-rupee"></i> <?php if(isset($field_collections_amount)): ?> <?php echo e($field_collections_amount); ?> <?php endif; ?> </span><span class="badge badge-warning" data-toggle="modal" href='#Denomination' style="margin-left:5px; font-size: 14px;">See Note Denomination</span> <div class="widget-toolbar no-border"> <!--<a class="btn btn-xs bigger btn-warning" href="<?php echo e(URL('/user/pending-company-di')); ?>">--> <!-- Pending Company DIs--> <!-- <i class="ace-icon fa fa-eye icon-on-right"></i>--> <!--</a>--> <!--<a class="btn btn-xs bigger btn-danger" href="<?php echo e(URL('/user/generate-company-di')); ?>">--> <!-- Generate Company DI--> <!-- <i class="ace-icon fa fa-plus icon-on-right"></i>--> <!--</a>--> </div> </div> <?php if(isset($field_collections)): ?> <?php if(count($field_collections)>0): ?> <div class="table-responsive"> <form name="frm-example" id="frm-example"> <div class="dataTables_borderWrap"> <table id="dynamic-table" class="table table-striped table-bordered table-hover"> <thead> <tr> <th>ID</th> <th>Collection User</th> <th>Dealer</th> <th>Retailer</th> <th>Retailer Location</th> <th>Amount</th> <!-- <th>Payment Mode</th> --> <th>Payment Remark</th> <th>Status</th> </tr> </thead> <tbody> <?php $__currentLoopData = $field_collections; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $field_collection): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr id="tr_<?php echo e($field_collection->id); ?>"> <td><?php echo e($field_collection->id); ?></td> <td><?php echo e($field_collection->user->name); ?></td> <td><?php echo e(getModelById('Dealer',$field_collection->dealer_id)->name); ?></td> <td><?php echo e(getModelById('Retailer',$field_collection->retailer_id)->name); ?></td> <td><?php echo e(getModelById('Retailer',$field_collection->retailer_id)->address); ?></td> <td><?php echo e($field_collection->amount); ?></td> <!-- <td><?php echo e($field_collection->mode); ?></td> --> <td><?php echo e($field_collection->reference_no); ?></td> <!--<td><?php echo e($field_collection->status); ?></td>--> <td> <?php if($field_collection->status == 0): ?> <span class="badge badge-warning">Pending</span> <?php elseif($field_collection->status == 1): ?> <span class="badge badge-success">Approved</span> <?php elseif($field_collection->status == 2): ?> <span class="badge badge-danger">Rejected</span> <?php endif; ?> </td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> <tfoot> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td><B>TOTAL = </B><?php echo e($field_collections_amount); ?></td> </tr> </tfoot> </table> <button type="button" id="collectionBtn" class="btn btn-primary" style="float: right;margin-right: 100px;">Collection </button> </div> </form> </div> <?php else: ?> <p style="font-size: 17px;text-align: center;margin-top: 28px;font-weight: bold;">This user has no pending collections</p> <?php endif; ?> <?php endif; ?> </div> </div> </div><!-- /.page-content --> </div> </div><!-- /.main-content --> <!--status update--> <div class="modal fade" id="editItemModal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Update Status</h4> </div> <div class="modal-body" id="EditBodyItem"> </div> </div> </div> </div> <div class="modal fade" id="Denomination"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Note Denomination</h4> </div> <div class="modal-body"> <table class="table table-striped table-bordered table-hover"> <thead> <tr> <th>Currency</th> <th>Count</th> <th>Amount</th> </tr> </thead> <?php if(isset($field_collections) && count($field_collections)>0): ?> <tbody> <?php $total_amount=0; $obj = $field_collections[0]['multipals_cheque_no']; $arr = json_decode($obj,true); ?> <?php $__currentLoopData = $arr; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $currency =>$value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php $currencyCount = 0; ?> <tr> <td><?php echo e($currency); ?></td> <td> <?php $__currentLoopData = $field_collections; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php $arr1 = json_decode($val->multipals_cheque_no,true); $currencyCount += $arr1[$currency]; ?> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php echo e($currencyCount); ?> </td> <td><?php echo e($currency*$currencyCount); ?> <?php $total_amount += $currency*$currencyCount ?></td> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> <tfoot> <tr> <td colspan="2"> <label class="pull-right">Total Amount:</label> </td> <td><b><?php echo e($total_amount); ?></b></td> </tr> </tfoot> <?php endif; ?> </table> </div> <div class="modal-footer"> <!-- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> --> <button type="button" id="" data-dismiss="modal" class="btn btn-primary">Close</button> </div> </div> </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/dataTables.checkboxes.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 var myTable = $('#dynamic-table').DataTable({ bAutoWidth: false, "aaSorting": [], 'columnDefs': [{ 'targets': 0, 'checkboxes': { 'selectRow': true } }], 'select': { 'style': 'multi' }, }); $.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') }); $('#collectionBtn').click(function(e) { e.preventDefault(); var form = this; var rows_selected = myTable.column(0).checkboxes.selected(); var id = [] // Iterate over all selected checkboxes $.each(rows_selected, function(index, rowId) { id.push(rowId) }); $.ajax({ url: "/user/set-status/" + id, type: 'GET', success: function(data) { // console.log(data); $('#EditBodyItem').html(data); $('#editItemModal').modal('toggle'); } }); }); }) function setStatusModal(id) { if (id == "") { swal('Error', 'Id is missing', 'warning'); } else { $.ajax({ url: "/user/set-status/" + id, type: 'GET', success: function(data) { // console.log(data); $('#EditBodyItem').html(data); $('#editItemModal').modal('toggle'); // OnLoad(); } }); } } // function updateStatus() { // $status = $('#status').val(); // $remark = $('#remark').val(); // $.ajaxSetup({ // headers: { // 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') // } // }); // // $.ajax({ // // url: "/user/set-pr-status", // // type: "post", // // data: $('#editStatusForm').serialize(), // // success:function(data){ // // console.log(data); // // if (!data.flag) { // // showError('edit_status_error', data.errors.status); // // } else { // // swal({ // // title: "Success!", // // text: data.message, // // type: "success" // // }); // // window.location.reload(); // // } // // } // // }); // } </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 /home3/pmmsanvp/public_html/sarojMain/resources/views/dashboard/invoice/field-collection.blade.php ENDPATH**/ ?>