/
home
/
sjslayjy
/
public_html
/
devlok
/
storage
/
framework
/
views
/
Upload File
HOME
<?php $__env->startSection('title','Stock 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="#"><?php echo e(__('messages.Home')); ?></a> </li> <li class="active">Warehouse Stock</li> </ul> </div> <div class="page-content"> <h3 class="header smaller lighter blue">Warehouse Stock</h3> <div class="row"> <div class="col-xs-12"> <form action="<?php echo e(url('warehousefilter')); ?>" method="post" role="form"> <div class="row"> <?php echo csrf_field(); ?> <div class="col-md-3"> <div class="form-group"> <label for="master_rake_id">Warehouse Stock</label> <select class="form-control select2" name="session_id" id="session_id"> <option value="">Warehouse Stock</option> <?php $__currentLoopData = $inventories->pluck('warehouse_name')->unique(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $warehouse_name): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value=""><?php echo e($warehouse_name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" style="display: none;"></span> </div> </div> <div class="col-md-3"> <div class="form-group"> <input type="submit" name="filter" id="btn" class="btn btn-sm btn-primary" value="Filter" style="margin-top: 20px;"> </div> </div> </div> </form> <div class="clearfix"> <div class="pull-right tableTools-container"> </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="table-header"> Warehouse Report <div class="widget-toolbar no-border"> <a class="btn btn-xs bigger btn-danger dropdown-toggle" data-toggle="modal" href='#addWarehouseStockModal'> Opening Stock <i class="ace-icon fa fa-plus icon-on-right"></i> </a> </div> </div> <div class="table-responsive"> <div class="dataTables_borderWrap"> <table id="dynamic-table" class="table table-striped table-bordered table-hover"> <thead> <tr> <th>Id</th> <th>Product Company</th> <th>Warehouse</th> <th>Product Brand</th> <th>Product</th> <th>Unit</th> <th>quantity</th> <th>Damage Qty</th> <?php if(Auth::check() && Auth::user()->role_id == 1 && Auth::user()->email == 'admin@gmail.com'): ?> <th>Action</th> <?php endif; ?> </tr> </thead> <tbody> <?php $__currentLoopData = $inventories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invntry=>$inventorie): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <td><?php echo e($invntry+1); ?></td> <td><?php echo e($inventorie->product_companies_name); ?></td> <td><?php echo e($inventorie->warehouse_name); ?></td> <td><?php echo e($inventorie->brand_name); ?></td> <td><?php echo e($inventorie->product_name); ?></td> <td><?php echo e($inventorie->units); ?></td> <td><?php echo e($inventorie->quantity); ?></td> <td><?php echo e($inventorie->damage_qty); ?></td> <?php if(Auth::check() && Auth::user()->role_id == 1 && Auth::user()->email == 'admin@gmail.com'): ?> <td> <div class="btn-group"> <a class="btn btn-xs btn-info" onclick="getEdit(<?php echo e($inventorie->id); ?>)"><i class="ace-icon fa fa-pencil bigger-120"></i></a> </div> </td> <?php endif; ?> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </tbody> </table> </div> </div> </div> </div> </div> </div> </div> <!-- Add Warehouse stock Modal --> <div class="modal fade" id="addWarehouseStockModal"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title">Add New Warehouse Stock</h4> </div> <div class="modal-body"> <form action="" role="form" id="addWarehouseStockForm"> <?php echo csrf_field(); ?> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label for="name">Warehouse List</label> <select class="form-control select2" name="warehouse_id" id="warehouse_id"> <option value="">Select Warehouse List</option> <?php $__currentLoopData = $warehouses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=> $warehosue): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($warehosue->id); ?>"><?php echo e($warehosue->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_warehouse_ist_error" style="display: none;"></span> </div> </div> <div class="col-md-6"> <div class="form-group"> <label for="name">Product Company</label> <select class="form-control select2" name="product_company_id" id="product_company_id1"> <option value="">Select Product Company</option> <option value="1">HeidelbergCement India Limited</option> </select> <span class="label label-danger" id="add_product_company_error" style="display: none;"></span> </div> </div> <div class="clearfix"></div> <div class="col-md-6"> <div class="form-group"> <label for="name">Date</label> <input type="date" class="form-control date-picker" name="date" id="date" placeholder="Date" > <span class="label label-danger" id="add_date_error" style="display: none;"></span> </div> </div> </div> <div class="row"> <div class="col-md-5"> <div class="form-group"> <label for="proruct">Product</label> <select class="form-control select2 checkIfValid" name="product_id[]" id="product_id"> <option value="">Select Product</option> <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=> $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($product->id); ?>" id="product_<?php echo e($product->id); ?>"><?php echo e($product->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_product_id_error" style="display: none;"></span> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="rate">Fresh Quantity</label> <input type="text" class="form-control checkIfValid" name="fresh_qty[]" placeholder="Fresh Quantity"> <span class="label label-danger" id="add_quantity_error" style="display: none;"></span> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="rate">Damage Quantity</label> <input type="text" class="form-control checkIfValid" name="damage_qty[]" placeholder="Damage Quantity"> <span class="label label-danger" id="add_quantity_error" style="display: none;"></span> </div> </div> </div> <div id="addMoreRowSection"> </div> <div class="pull-left"> <button type="button" id="addMoreRow" class="btn btn-danger"><i class="fa fa-plus"></i> Add More </button> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <!-- <button type="button" id="addMasterRakeBtn" class="btn btn-primary">Submit</button> --> <input type="submit" value="submit" class="btn btn-primary" id="openingStockBtn"> </div> </form> </div> </div> </div> <!-- Add Warehouse stock Modal --> <!-- Edit Session Modal --> <div class="modal fade" id="editInventoryModal"> <div class="modal-dialog modal-lg"> <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 Warehouse Stock</h4> </div> <div class="modal-body" id="EditBody"> </div> </div> </div> </div> <!-- Edit Session Modal --> <?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")); ?> <script type="text/javascript"> $('#filter').click(function(){ var warehouse_name = $('#warehouse_name').val(); if(dealer_id !='') { $('#dynamic-table').DataTable().destroy(); display(warehouse_name); }else if(warehouse_name!=''){ $('#dynamic-table').DataTable().destroy(); display(warehouse_name); }else{ alert('Warehouse is required'); } }); jQuery(function($) { $('#openingStockBtn').click(function(e){ e.preventDefault(); var data = $('#addWarehouseStockForm').serialize(); $.ajax({ url: "<?php echo e(url('/stock/add-opening-balance')); ?>", type: 'POST', data: data, success:function(data){ if(data.flag){ swal({ title: "Success!", text: data.message, type: "success" }, function() { window.location.reload(); }); }else{ console.log(data.message); swal({ title: "Error", text: data.message, type: "error" }, function() { window.location.reload(); }); } } }); }); //initiate dataTables plugin 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: true, message: 'IManager', exportOptions: { columns: ':visible' } } ] } ); }) function removeRow(id){ $('#newRow'+id).remove(); } $('#addMoreRow').click(function(){ var count = $('.row').length + 1; console.log(count); var newRow = `<div class="row" id="newRow`+count+`"> <div class="col-md-5"> <div class="form-group"> <label for="product">Product</label> <select class="form-control select2 checkIfValid" name="product_id[]" id="product_id"> <option value="">Select Product</option> <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=> $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <option value="<?php echo e($product->id); ?>" id="product_<?php echo e($product->id); ?>"><?php echo e($product->name); ?></option> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </select> <span class="label label-danger" id="add_product_id_error" style="display: none;"></span> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="rate">Fresh Quantity</label> <input type="text" class="form-control checkIfValid" name="fresh_qty[]" placeholder="Fresh Quantity"> <span class="label label-danger" id="add_quantity_error" style="display: none;"></span> </div> </div> <div class="col-md-3"> <div class="form-group"> <label for="rate">Damage Quantity</label> <input type="text" class="form-control checkIfValid" name="damage_qty[]" placeholder="Damage Quantity"> <span class="label label-danger" id="add_quantity_error" style="display: none;"></span> </div> </div> <div class="col-md-1" style="margin-top: 33px;"> <a href="javascript:;" onclick="removeRow(`+count+`)"><i class="fa fa-close fa-2x"></i></a> </div> </div> `; $('#addMoreRowSection').append(newRow); $('.select2').select2(); }); function getEdit(id){ if(id == ""){ swal('Error','Inventory id is missing','warning'); }else{ $.ajax({ url: "<?php echo e(url('/user/edit-stock/')); ?>"+"/"+id, type: 'GET', success:function(data){ $('#EditBody').html(data); $('#editInventoryModal').modal('toggle'); } }); } } $(document).on('submit', '#editInventoryModal form', function (e) { e.preventDefault(); // Prevent default form submission var form = this; // Use `this` directly as it refers to the form var formData = new FormData(form); // Pass the form element to FormData $.ajax({ url: "<?php echo e(url('/user/edit-inventory')); ?>", type: 'POST', data: formData, processData: false, // Prevent jQuery from processing the data contentType: false, // Prevent jQuery from setting the content type success: function (response) { if (response.flag) { swal({ title: "Success!", text: response.message, type: "success" }, function () { window.location.reload(); }); } else { swal({ title: "Error", text: response.message, type: "error" }); } }, error: function (xhr) { swal({ title: "Error", text: "An error occurred while updating the inventory.", type: "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 /home3/pmmsanvp/public_html/devlokDemo/resources/views/dashboard/stock/warehouse-stock.blade.php ENDPATH**/ ?>