/
home
/
sjslayjy
/
public_html
/
devlok
/
resources
/
views
/
dashboard
/
stock
/
Upload File
HOME
<form action="{{URL('/stock/stock-transfer-by-road')}}" role="form" id="stocktransferByRoad" method="POST"> <input type="hidden" name="by_road_id" value="{{$by_roads->id}}"> <div class="row"> <div class="clearfix"></div> <div class="col-md-6"> <div class="form-group"> <label for="name">Product Company</label> <select class="form-control" name="product_company_id" id="edit_product_company_id"> <option value="">Select Product Company</option> @foreach($product_companies as $product_company) <option value="{{$product_company->id}}" {{$product_company->id == $by_roads->product_company_id? "selected":""}}>{{$product_company->name}}</option> @endforeach() </select> <span class="label label-danger" id="edit_product_company_error" style="display: none;"></span> </div> </div> <div class="col-md-5"> <div class="form-group"> <label for="name">Warehouse</label> <select class="form-control select2" name="warehouse_id" id="warehouse_id"> <option value="">Select Warehouse</option> @foreach($warehouse as $warehouses) <option value="{{$warehouses->id}}">{{$warehouses->name}}</option> @endforeach() </select> <span class="label label-danger" id="add_product_company_error" style="display: none;"></span> </div> </div> <div class="clearfix"></div> </div> <div class="row"> <div class="col-md-12"> <div class="form-group" style="overflow-x:auto;"> <label for="product_id">{{__('messages.Product')}}</label> <table class="table table-striped table-bordered"> <thead> <tr> <th> Product Name</th> <th> Quantity</th> <th> Fresh Quantity</th> <th> Damage Quantity</th> </tr> </thead> <tbody id="tbody"> @foreach($by_roads->by_road_products as $by_road_product) @if($by_road_product->remaining_quantity!=0) <tr id="{{$by_road_product->product_id}}"> <td><input type="hidden" name="product_id[]" value="{{$by_road_product->product_id}}"><input type="hidden" id="input_{{$by_road_product->product_id}}" onkeypress="return onlyCurrency(event)" onblur="check_zero(this)" data-id="id_{{$by_road_product->product_id}}_{{$by_road_product->product_id}}" name="product_name[{{$by_road_product->product_id}}]" onkeyup="getvalue(this,{{$by_road_product->product_id}})" value="{{getModelById('Product',$by_road_product->product_id)->name}}" style="width:100px;" />{{getModelById('Product',$by_road_product->product_id)->name}} </td> {{-- <td>{{getModelById('Product',$by_road_product->product_id)->name}}</td> --}} <td>{{$by_road_product->remaining_quantity}}</td> <td><input type="text" id="input1_{{$by_road_product->product_id}}" onkeyup="is_valid({{$by_road_product->remaining_quantity}},{{$by_road_product->product_id}})" data-id="id_{{$by_road_product->product_id}}_{{$by_road_product->product_id}}" name="fresh_qty[{{$by_road_product->product_id}}]"/></td> <td><input type="text" id="input2_{{$by_road_product->product_id}}" onkeyup="is_valid({{$by_road_product->remaining_quantity}},{{$by_road_product->product_id}})" data-id="id_{{$by_road_product->product_id}}_{{$by_road_product->product_id}}" name="demage_qty[{{$by_road_product->product_id}}]"/></td> </tr> @endif @endforeach </tbody> </table> <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="Quantity"> <span class="label label-danger" id="add_quantity_error" style="display: none;"></span> </div> </div> <div class="col-md-2"> <div class="form-group"> <label for="wharfage">Damage Qty</label> <input type="text" class="form-control" name="damage_qty" id="Damage" placeholder="Damage"> <span class="label label-danger" id="add_wharfage_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="stocktransferByRoadBtn" class="btn btn-primary">Submit</button> </div> </form> <script> $(document).ready(function() { console.log($('#stocktransferByRoad').attr('action')); $('#stocktransferByRoadBtn').click(function(e){ swal({ title: "Are you sure by road stock transfer in warehouse?", // text: "SUMIT", type: "success", confirmButtonText: 'Ok', showCancelButton: true, },(function(isConfirm) { if (isConfirm) { $('.loading-bg').show(); // alert($('#stocktransferByRoad').attr('action')); e.preventDefault(); $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content') } }); $.ajax({ url: $('#stocktransferByRoad').attr('action'), method: 'POST', data: $('#stocktransferByRoad').serialize(), success: function(data){ $('.loading-bg').hide(); if(!data.flag){ // showError('add_rake_point_error',data.errors.rake_point); // showError('add_from_warehouse_id_error',data.errors.from_warehouse_id); // showError('add_despatch_location_error',data.errors.despatch_location); // showError('add_dealer_id_error',data.errors.dealer_id); // showError('add_product_company_id_error',data.errors.product_company_id); // showError('add_product_id_error',data.errors.product_id); // showError('add_retailer_id_error',data.errors.retailer_id); // showError('add_quantity_error',data.errors.quantity); // showError('add_unit_id_error',data.errors.unit_id); }else{ swal({ title: "Success!", text: data.message, type: "success" },function() { window.location.reload(); }); $('#modalPopup').modal('toggle') $('#dynamic-table').DataTable().draw(); // window.location.reload(); } } }); } else { location.reload(); } }) ); }); }); </script>