EVOLUTION-NINJA
Edit File: yarn_stock.php
<script src="<?php echo base_url('assets/js/jquery.table2excel.js');?>"></script> <script src="<?php echo base_url('assets/js/jspdf.debug.js');?>"></script> <script src="<?php echo base_url('assets/js/jspdf.min.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/shim.min.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/xlsx.full.min.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/Blob.js');?>"></script> <script type="text/javascript" src="<?php echo base_url('assets/js/FileSaver.js');?>"></script> <style> #refresh_list6 { display:none !important; } #refresh_list4 { display:none !important; } #refresh_list5 { display:none !important; } .ui-jqgrid { text-transform: capitalize !important; } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } </style> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Yarn - Raw Stock Details </h3> <?php // echo $this->load->view('templates/nav_menu'); ?> <div class="page-bar"> <ul class="page-breadcrumb"> <li><i class="fa fa-home"></i> <a href="<?php echo base_url(); ?>dashboard/dashboard_fun">Home</a> <i class="fa fa-angle-right"></i> <a href="#" > Yarn - Raw Stock Details </a></li> </ul> </div> <input type="hidden" id="preview_id" class="preview_id" value="<?php if(empty($access_row)){ } else { echo $access_row->preview_id; } ?>" > <input type="hidden" id="edit_id" class="edit_id" value="<?php if(empty($access_row)){ } else { echo $access_row->edit_id; } ?>" > <input type="hidden" id="edit_row_id" class="edit_row_id" value="<?php if(empty($user_type_id)){ } else { echo $user_type_id; } ?>" > <div class="row date_row"> <form action="<?php echo base_url('reports/raw_stock_data'); ?>" method="post" class="form"> <div class="col-md-3"> <div class="form-group"> <label class="control-label col-md-4">From Date :</label> <div class="col-md-8"> <input type="text" class="form-control input-group openDatePicker from_delivery_date_required_on" name="from_delivery_date_required_on" id="from_delivery_date_required_on" data-provide="datepicker"> </div> </div> </div> <div class="col-md-3"> <div class="form-group"> <label class="control-label col-md-4">To Date :</label> <div class="col-md-8"> <input type="text" class="form-control input-group openDatePicker to_delivery_date_required_on" name="to_delivery_date_required_on" id="to_delivery_date_required_on" data-provide="datepicker" > </div> </div> </div> <div class="col-md-3"> <div class="form-group"> <label class="control-label col-md-4">Location :</label> <div class="col-md-8"> <select class="form-control" id="location" name="location"> <option value="all">ALL</option> <?php foreach($loc as $loc){ ?> <option value="<?php echo $loc->consumed_at; ?>"><?php echo $loc->consumed_at; ?></option> <?php } ?> </select> </div> </div> </div> <div class="col-md-3"> <input type="submit" id="" value="Submit" class="" style="margin-right: 22px;"/> <button type="button" onclick="export_page();" style="padding-top: 4px;padding-bottom: 4px;" class="btn btn-primary">Export </button> </div> </form> </div> <!-- row -2--> <input type="submit" id="generate_submit" value="View Piece Card" class="generate_submit" style="float: right; !important;margin-right: 22px;"/> <input type="button" name="sequence" id="sequence" onclick="sequence_master()" value="Update Value" style="float: right; !important;margin-right:15px;"> <form action="<?php echo base_url('stock_history_details/stock_piece_card'); ?>" target="_blank" method="post" class="formids"> <input type="hidden" id="checked_ids" name="checked_ids" class="checked_ids"> <input type="hidden" id="checked_radios" name="checked_radios" class="checked_radios" value="<?php echo 'raw_yarn';?>"> </form> <br><br> <!--<input type="text" id="location" class="location" name="location" value="all" >--> <input type="hidden" id="yarn_type" class="yarn_type" name="yarn_type" value="raw_yarn"> <input type="hidden" id="location" class="location" name="location" value="all" > <input type="hidden" id="yarn_type" class="yarn_type" name="yarn_type" value="raw_yarn"> <div id = "jaytab1" class="jaytab"> <table id="list3"></table> <div id="pager3"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> </div> </div> <div style="display:none;"><table border="1" style="border-spacing: 0px !important;" id="export_table" class="export_table"></table></div> <div id="myModal" class="modal fade" role="dialog" style="color:#000;"> <div class="modal-dialog" > <!-- Modal content--> <div class="modal-content" > <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Update Stock Details</h4> </div> <div class="modal-body"> <fieldset> <!-- Form Name --> <div class="portlet-body" id="portlet-body"> <div class="col-xs-4"> <label class="col-sm-4 col-xs-2" style="padding-right:0 !important;"><b>Search :</b> </label> <input type="text" id="search_warp" class="col-sm-6 col-xs-5" placeholder="Type to search"> </div> <div class="col-xs-4"> <label class="col-sm-4 col-xs-2" style="padding-right:0 !important;"><b>Update Value :</b> </label> <input type="text" name = "new_value" id="new_value" class="col-sm-6 col-xs-5"> </div> <div class="col-xs-4"> <label class="col-sm-4 col-xs-2" style="padding-right:0 !important;"><b>Update Date :</b> </label> <input type="text" name = "date_update" id="date_update" class="col-sm-6 col-xs-5"> </div> <br/><br/> <table class="table table-striped table-bordered table-hover" > <thead> <tr> <th> SI No </th> <th> Purpose </th> <th> Yarn Details </th> <th> Yarn Deniner </th> <th> Yarn Specification </th> <th> lot </th> <th> Bale </th> <th> Issue net weight </th> <th> po no </th> <th> updated unit </th> <th> Value </th> <th> Recieve date </th> </tr> </thead> <tbody id="hidden_table"> </tbody> </table> </div> <div class="modal-footer"> <button id="submit_modal" name="submit" onclick="update_new_val()" class="btn btn-primary">Submit</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </fieldset> </div> </div> </div> </div> <!-- End BEGIN CONTAINER --> <!-- BEGIN FOOTER --> <!-- BEGIN FOOTER --> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <!-- End BEGIN CONTAINER --> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <script> function sequence_master() { $("#myModal").modal('show'); } $("#generate_submit").on('click', function () { var id=''; $("input[type=checkbox]:checked").each(function() { id += $(this).closest('tr').attr('id') + "|"; }); //alert(); $(".checked_ids").val(''); $(".checked_ids").val(id); $(".formids").submit(); }); function export_page() { id = jQuery("#list3").jqGrid('getDataIDs'); var type= $('#type').val(); $.ajax({ type : 'post', url:"<?php echo base_url('out_source/fetch_yarn_raw_data')?>", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); //alert(d); console.log(response); var count =1; $('.export_table').empty(); var received_qty=0; rec_weight =0; issue_net_weight=0; issue_gross_weight=0; variance_mtrs=0; var content = ''; content +='<thead><tr><th><b>SL NO.</b></th><th><b>Purpose</b></th><th><b>Yarn Details</b></th> <th><b>Yarn Denier</b></th> <th><b>Yarn Specification</b></th> <th><b>SSL Shade</b></th> <th><b>Shade</b></th><th><b>Lot</b></th> <th><b>Bale</b></th> <th><b>Gross Weight</b></th> <th><b>Net Weight</b></th> <th><b>PO#</b></th> <th><b>Rate</b></th><th><b>Location</b></th><th><b>Received Date</b></th></tr></thead>'; $.each(response,function(key,vas){ issue_gross_weight +=parseFloat(vas.issue_gross_weight); issue_net_weight +=parseFloat(vas.issue_net_weight); content +='<tr><td>'+count+'</td> <td>'+vas.purpose+'</td> <td>'+vas.yarnname+'</td> <td>'+vas.yarndenier+'</td> <td>'+vas.yarnspecification+'</td><td>'+vas.ssl_shade+'</td> <td>'+vas.shades+'</td><td>'+vas.lot+'</td> <td>'+vas.bale+'</td><td>'+vas.issue_gross_weight+'</td><td>'+vas.issue_net_weight+'</td><td>'+vas.po_no+'</td><td>'+vas.unit+'</td><td>'+vas.consumed_at+'</td><td>'+vas.rec_date+'</td> </tr>'; count++; }); content +='<tr></tr>'; content +='<tr><th><b>TOTAL</b></th><th></th><th></th><th></th> <th></th> <th></th> <th></th><th></th> <th></th> <th><b>'+issue_gross_weight+'</b></th><th><b>'+issue_net_weight+'</b></th><th></th><th></th><th></th><th></th>/tr>'; $('.export_table').append(content); doit('xlsx'); // doit(type, fn, dl); // export_data(); // pdf_download(); } }); } function doit(type, fn, dl) { var elt = document.getElementById('export_table'); var wb = XLSX.utils.table_to_book(elt, {sheet:"Sheet JS"}); return dl ? XLSX.write(wb, {bookType:type, bookSST:true, type: 'base64'}) : XLSX.writeFile(wb, fn || ('Yarn - Raw Stock Report.' + (type || 'xlsx'))); } function tableau(pid, iid, fmt, ofile) { if(typeof Downloadify !== 'undefined') Downloadify.create(pid,{ swf: 'downloadify.swf', downloadImage: 'download.png', width: 100, height: 30, filename: ofile, data: function() { return doit(fmt, ofile, true); }, transparent: false, append: false, dataType: 'base64', onComplete: function(){ alert('Your File Has Been Saved!'); }, onCancel: function(){ alert('You have cancelled the saving of this file.'); }, onError: function(){ alert('You must put something in the File Contents or there will be nothing to save!'); } }); else document.getElementById(pid).innerHTML = ""; } tableau('biff8btn', 'xportbiff8', 'biff8', 'test.xls'); tableau('odsbtn', 'xportods', 'ods', 'test.ods'); tableau('fodsbtn', 'xportfods', 'fods', 'test.fods'); tableau('xlsbbtn', 'xportxlsb', 'xlsb', 'test.xlsb'); tableau('xlsxbtn', 'xportxlsx', 'xlsx', 'test.xlsx'); function export_page_list() { id = jQuery("#list3").jqGrid('getDataIDs'); var type= $('#type').val(); $.ajax({ type : 'post', url:"<?php echo base_url('out_source/fetch_yarn_raw_data')?>", data : {id:id}, success:function(data){ response=jQuery.parseJSON(data); //alert(d); console.log(response); var count =1; $('.export_table').empty(); var received_qty=0; rec_weight =0; issue_net_weight=0; issue_gross_weight=0; variance_mtrs=0; var content = ''; content +='<thead><tr><th><b>SL NO.</b></th><th><b>Purpose</b></th><th><b>Yarn Details</b></th> <th><b>Yarn Denier</b></th> <th><b>Yarn Specification</b></th> <th><b>SSL Shade</b></th> <th><b>Shade</b></th><th><b>Lot</b></th> <th><b>Bale</b></th> <th><b>Gross Weight</b></th> <th><b>Net Weight</b></th> <th><b>Location</b></th><th><b>Received Date</b></th></tr></thead>'; $.each(response,function(key,vas){ issue_gross_weight +=parseFloat(vas.issue_gross_weight); issue_net_weight +=parseFloat(vas.issue_net_weight); content +='<tr><td>'+count+'</td> <td>'+vas.purpose+'</td> <td>'+vas.yarnname+'</td> <td>'+vas.yarndenier+'</td> <td>'+vas.yarnspecification+'</td><td>'+vas.ssl_shade+'</td> <td>'+vas.shades+'</td><td>'+vas.lot+'</td> <td>'+vas.bale+'</td><td>'+vas.issue_gross_weight+'</td><td>'+vas.issue_net_weight+'</td><td>'+vas.consumed_at+'</td><td>'+vas.rec_date+'</td> </tr>'; count++; }); content +='<tr></tr>'; content +='<tr><th><b>TOTAL</b></th><th></th><th></th><th></th> <th></th> <th></th> <th></th><th></th> <th></th> <th><b>'+issue_gross_weight+'</b></th><th><b>'+issue_net_weight+'</b></th><th></th><th></th></tr>'; $('.export_table').append(content); export_data(); pdf_download(); } }); } function export_data() { //alert(); $("#export_table").table2excel({ exclude: ".noExl", name: "Excel Document Name", filename: "Yarn - Raw Stock Details", fileext: ".xls", exclude_img: true, exclude_links: true, exclude_inputs: true }); } // function pdf_download() // { // alert(); // var options = { // }; // var pdf = new jsPDF('p', 'pt', 'a4'); // pdf.addHTML($("#export_table"), 0, 0, options, function() { // pdf.save('inspected_fabric.pdf'); // }); // } $("#export").on("click", function(){ $("#list3").jqGrid("exportToHtml",{ includeLabels : true, includeGroupHeader : true, includeFooter: true, autoPrint : true }); }); $(function(){ $(".from_delivery_date_required_on").datepicker({ dateFormat: 'dd-mm-yy', }).on('changeDate', function(ev){ $('.from_delivery_date_required_on').datepicker('hide'); }); }); $('.from_delivery_date_required_on').on('change', function(){ var date = $(this).val(); $('.to_delivery_date_required_on').datepicker({ dateFormat: 'dd-mm-yy', minDate: date, }); }); </script> <script> $("#osl_button").click(function(e) { var as =$('#osl_num').val(); //alert(as); var yarn_type =$('#yarn_type').val(); var preview_id =$('#preview_id').val(); $.ajax({ type:'post', url:'<?php echo base_url("stock_history_details/outsource_osl_yarn_preview"); ?>', data:{'as':as}, async:false, success:function() { window.location.href = '<?php echo base_url('stock_history_details/outsource_osl_yarn_preview');?>/'+ '?id='+as+'/'+yarn_type+'/'+preview_id; } }); }); </script> <style> #ui-datepicker-div { z-index: 1000 !important; } .date_row { padding-bottom: 3%; } .ss{ padding-right: 0 !important; padding-left: 0 !important; } .form-control { //width:65% !important; height:27px !important; padding: 3px 12px !important; border-radius: 0px !important; //margin-bottom:15px; } label { font-weight: normal; text-align: left; } .hr-line{ border-top: 1px solid #465A81; } .well-sm { padding: 3px !important; border-radius: 0px !important; } input[type="file"] { padding-bottom: 28px !important; height: 25px !important; color:transparent; } .portlet.box.blue-madison { border: 1px solid #fff !important; border-top: 0; background:#fff !important; } #table_approved_indent { display:none; } #refresh_list3 { display:none !important; } @media only screen and (min-width:320px) and (max-width:640px) { } </style> <script> function getDesignAndQuality(articleNo) { $.ajax({ type: "post", url: "<?php echo base_url(); ?>marketing/getDesignAndQuality", data: "articleNo=" + articleNo, success: function (data) { var objData = jQuery.parseJSON(data); document.getElementById("design").value = objData.design; document.getElementById("quality").value = objData.quality; } }); } </script> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <link href="<?php echo base_url('assets/css/sweetalert2.min.css');?>" rel="stylesheet"/> <script src="<?php echo base_url('assets/js/sweetalert2.min.js');?>"></script> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/jquery.jqGrid.min.js'); ?>"></script> <!-- This is the localization file of the grid controlling messages, labels, etc. <!-- We support more than 40 localizations --> <script type="text/ecmascript" src="<?php echo base_url('jqgrid/js/i18n/grid.locale-en.min.js'); ?>"></script> <!-- A link to a jQuery UI ThemeRoller theme, more than 22 built-in and many more custom --> <!-- The link to the CSS that the grid needs --> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid.min.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid-bootstrap.min.css'); ?>" /> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('jqgrid/css/ui.jqgrid-bootstrap-ui.min.css'); ?>" /> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <style type="text/css"> .ss{ padding-right: 0 !important; padding-left: 0 !important; } label { font-weight: normal; text-align: left; } .hr-line{ border-top: 1px solid #465A81; } .well-sm { padding: 3px !important; border-radius: 0px !important; } input[type="file"] { padding-bottom: 28px !important; height: 25px !important; color:transparent; } .portlet.box.blue-madison { border: 1px solid #fff !important; border-top: 0; background:#fff !important; } input[type=file] { display: none; } .ui-jqgrid .ui-jqgrid-caption { text-align: left; background: rgb(72,91,127); color: white; } .ui-jqdialog .ui-jqdialog-titlebar { padding: .1em .1em; min-height: 35px; background: rgb(72,91,127); color: white; } .ui-jqdialog .ui-jqdialog-titlebar-close span { display: block; margin: -9px; } #sData { height: 27px; } #cData { height: 27px; } #dData { height: 27px; } #eData { height: 27px; } .coledit { cursor:pointer; padding-right: 22px !important; padding-left: 23px !important; margin-top: 4px !important; color:bold !important; } .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { overflow: hidden; white-space: pre; } </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> <!----------------------------------access controll -------------------------------> $(document).ready(function (){ var l=$("#location").val(); var ll; var currids =[]; // alert(l); jQuery("#list3").jqGrid({ url:"<?php echo base_url('out_source/fetch_yarn_raw_data')?>", datatype: "json", colNames:['','Id','Purpose','Yarn Details','Yarn Denier','Yarn Specification','Lot','Bale','Gross Weight','Net Weight','PO#','Rate','Updated Rate','Value','Location','Received Date'], colModel:[ {name:'myac', width:50, fixed:true, sortable:false, search:false,resize:false, formatter:'actions', formatoptions:{keys:true,delbutton:false}}, {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, // {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:50,cellattr: function (rowId, tv, rawObject, cm, rdata) // { // return ' onclick="fun_checkbox($(this))" '; // },formatter:function (cellvalue, options, rowObject) { // return "<input type='checkbox' id='check' class='check' value='SELECT' \>"; // }}, {name:'purpose',index:'purpose', width:120,editable:true,editrules:{required: true}}, {name:'yarnname',index:'yarnname', editable:true,editrules:{required: true},width:120}, {name:'yarndenier',index:'yarndenier', width:120,editable:true,editrules:{required: true}}, // {name:'yarnDenier',index:'yarnDenier', width:120,editable:true,editrules:{required: true}}, {name:'yarnspecification',index:'yarnspecification', width:120,editable:true,editrules:{required: true}}, {name:'lot',index:'lot', width:120,editable:true,editrules:{required: true}}, {name:'bale',index:'bale', width:120,editable:true,editrules:{required: true}}, // {name:'issue_gross_weight',index:'issue_gross_weight', width:120,editable:true,editrules:{required: true}}, { name: 'issue_gross_weight', index: 'issue_gross_weight',editable:true, width: 100, align: 'center',formatter: 'number', formatoptions: { decimalSeparator: ".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.0000' }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="gross_fun1($(this))" '; } }, { name: 'issue_net_weight', index: 'issue_net_weight',editable:true, width: 100, align: 'center',formatter: 'number', formatoptions: { decimalSeparator: ".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.0000' }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="net_fun1($(this))" '; } }, {name:'po_no',index:'po_no', width:120,editable:false}, {name:'unit',index:'unit', width:120,editable:false}, {name:'updated_unit',index:'updated_unit', width:120,editable:true}, {name:'val',index:'val', width:120,editable:false,align: 'center',formatter: 'number', formatoptions: { decimalSeparator: ".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.0000' }}, // { // name: 'unit', index: 'unit',editable:true, width: 100, align: 'center',formatter: 'number', // formatoptions: { decimalSeparator: ".", thousandsSeparator: " ", decimalPlaces: 2, defaultValue: '0.0000' }, // cellattr: function (rowId, tv, rawObject, cm, rdata) // { // return ' onclick="unit_fun1($(this))" '; // } // }, {name:'consumed_at',index:'consumed_at', width:100,editable:false,editrules:{required: true}}, {name:'rec_date',index:'rec_date', width:100,editable:true,editrules:{required: true}}, //{name:'issue_net_weight',index:'issue_net_weight', width:120,editable:true,editrules:{required: true}}, ], height: 'auto', rowNum:50, rowTotal: 200000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager3", sortname:'id', viewrecords: true, gridview: true, autowidth: true, multiselect: true, sortorder:"asc", loadonce:true, onSelectRow: function(id) { if(id && id !== ll) { jQuery('#list3').jqGrid('restoreRow',ll); jQuery('#list3').jqGrid('editRow',id,true); ll=id; var id=jQuery("#list3").jqGrid('getGridParam','selrow'); currids.push(id); var result = []; $.each(currids, function(i, e) { if ($.inArray(e, result) == -1) result.push(e); }); changefunction(result); } }, onSelectAll:function(ids) { changefunction(ids); }, editurl: "<?php echo site_url('out_source/update_yarn_data');?>", caption:"Yarn - Raw Stock Details", footerrow: true, loadComplete: function () { var sumOfPrice_issue_net_weight = jQuery("#list3").jqGrid('getCol','issue_net_weight',false,'sum'); var sumOfPrice_issue_gross_weight = jQuery("#list3").jqGrid('getCol','issue_gross_weight',false,'sum'); var sumOfval = jQuery("#list3").jqGrid('getCol','val',false,'sum'); jQuery("#list3").jqGrid('footerData', 'set', { bale: 'Total:', issue_gross_weight: sumOfPrice_issue_gross_weight.toFixed(2) , issue_net_weight: sumOfPrice_issue_net_weight.toFixed(2) ,val:sumOfval.toFixed(2)}); }, }); $("#list3").jqGrid('setColProp', 'purpose', {editrules: {required: true}}); $("#list3").jqGrid('setColProp', 'yarnname', {editrules: {required: true}}); $("#list3").jqGrid('setColProp', 'yarnspecification', {editrules: {required: true}}); $("#list3").jqGrid('setColProp', 'yarndenier', {editrules: {required: true}}); $("#list3").jqGrid('setColProp', 'lot', {editrules: {required: true}}); $("#list3").jqGrid('setColProp', 'bale', {editrules: {required: true}}); $("#list3").jqGrid('setColProp', 'issue_gross_weight', {editrules: {required: true}}); $("#list3").jqGrid('setColProp', 'issue_net_weight', {editrules: {required: true}}); //$("#list2").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required jQuery("#list3").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list3").jqGrid('navGrid','#pager3', {edit:false,add:false,del:false,search:false,refreshstate:"current"}, { }, { }, { }, { sopt:['eq', 'ne', 'lt', 'gt', 'cn', 'bw', 'ew'], closeOnEscape: true, multipleSearch: true, closeAfterSearch: true } ); }); function changefunction(cellValues1) { //alert(cellValues1); $.ajax({ type : 'post', url : '<?php echo site_url("out_source/yarn_selected_stock")?>', data : {'stock':cellValues1}, success:function(response) { response=jQuery.parseJSON(response); console.log(response); if(response) { var con = ''; var a=1; var totSI=0; var rec=0; var act=0; var toteq=0; $.each(response, function(key, val) { totSI=parseFloat(totSI)+parseFloat(a); toteq=parseFloat(toteq)+parseFloat(val.sequence); con += '<tr class="new_product"><td><input type="hidden" class="indent_goods_id" name="goods_id[]" value="'+val.goods_id+'" readonly /><input type="hidden" class="indent_id" name="id[]" value="'+val.id+'" readonly />'+a+'</td><td>'+val.purpose+'</td><td>'+val.yarnname+'</td><td>'+val.yarndenier+'</td><td>'+val.yarnspecification+'</td><td>'+val.lot+'</td><td>'+val.bale+'</td><td>'+val.issue_net_weight+'</td><td>'+val.po_no+'</td><td>'+val.updated_unit+'</td><td>'+val.val+'</td><td>'+val.rec_date+'</td></tr>'; a++; //rec=parseFloat(rec)+parseFloat(val.received_wt); //act=parseFloat(act)+parseFloat(val.received_qty); }); // con += '<tr class="new_product" ><td style="background-color:none !important;border-right:none !important;"><input style="width:50px; border:none !important;" type="text" name="tot_sl_no" value="'+totSI+'" readonly /></td><td style="background-color:none !important;border-right:none !important;border-left:none !important;">TOTAL</td><td style="background-color:none !important;border-right:none !important;border-left:none !important;"></td><td style="background-color:none !important;border-right:none !important;border-left:none !important;"></td><td style="background-color:none !important;border-right:none !important;border-left:none !important;"></td><td style="background-color:none !important;border-right:none !important;border-left:none !important;"></td><td style="background-color:none !important;border-right:none !important;border-left:none !important;"></td><td style="background-color:none !important;border-right:none !important;border-left:none !important;"></td><td style="background-color:none !important;border-right:none !important;border-left:none !important;">'+rec.toFixed(2)+'</td><td style="background-color:none !important;border-right:none !important;border-left:none !important;">'+act.toFixed(2)+'</td><td style="background-color:none !important;border-right:none !important;border-left:none !important;"><input style="width:50px;border:none !important;" type="text" class="seq_tot" name="sequence" value="'+toteq+'" readonly /></td></tr>'; $('#hidden_table').empty(); $('#hidden_table').append(con); /* $(".remove").click(function(){ $(this).closest('.new_product').remove(); });*/ } } }); $('#list2'+i).addClass( "ui-state-highlight" ); $('#edit_modal').modal('hide'); $('.show-remaining').show(); /*} else $( "#dialogSelectRow" ).dialog();*/ } function gross_fun1(rowId) { //var rowid = 123; var id = rowId.closest('tr').attr('id'); // alert(id); $.ajax({ //alert(email); url:"<?php echo base_url('stock_history_details/yarn_stock_modal_val')?>", type:"POST", data:{'id':id}, success:function(data){ var objData = jQuery.parseJSON(data); var g_w = objData.f.issue_gross_weight; var access = objData.d.designation; if(access == 'Super Admin') { if(g_w < 1) { swal({ title: 'Do You Want To Set This Value To Zero', // input: 'text', showCancelButton: true, confirmButtonText: 'OK', showLoaderOnConfirm: true, }).then(function (email) { $.ajax({ //alert(email); url:"<?php echo base_url('stock_history_details/add_gross_zero_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ $("#list3").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); }) ///alert(email); } else { } } else { swal({ title: "You Don't Have Access For This to Set Zero", text: "", }); } } }); } function net_fun1(rowId) { //var rowid = 123; var id = rowId.closest('tr').attr('id'); //alert(id); $.ajax({ //alert(email); url:"<?php echo base_url('stock_history_details/yarn_stock_modal_val')?>", type:"POST", data:{'id':id}, success:function(data){ var objData = jQuery.parseJSON(data); var n_w = objData.f.issue_net_weight; var access = objData.d.designation; if(access == 'Super Admin') { //var n_w = objData.issue_net_weight; if(n_w < 1) { swal({ title: 'Do You Want To Set This Value To 0', // input: 'text', showCancelButton: true, confirmButtonText: 'OK', showLoaderOnConfirm: true, }).then(function (email) { $.ajax({ //alert(email); url:"<?php echo base_url('stock_history_details/add_net_zero_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ $("#list3").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); }) ///alert(email); } else { } } else { swal({ title: "You Don't Have Access For This to Set Zero", text: "", }); } } }); } function fun(rowId) { // var rowid = 123; var id = rowId.closest('tr').attr('id'); //alert(id); var confirmMsg= confirm("Do You Want To Confirm!"); if (confirmMsg==true) { swal({ title: 'Remarks', input: 'text', showCancelButton: true, confirmButtonText: 'Submit', showLoaderOnConfirm: true, }).then(function (email) { $.ajax({ //alert(email); url:"<?php echo base_url('vendor/add_yes_confirmation')?>", type:"POST", data:{'id':id,'remarks':email}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list3").trigger("reloadGrid"); $("#jaytab").trigger("reloadGrid"); $("#jqGrid").trigger("reloadGrid"); window.location.reload(); } else{ } } }); swal({ type: 'success', // title: 'Approved By', // html: '' + email }) }) ///alert(email); } else if (confirmMsg==false) { $.ajax({ url:"<?php echo base_url('vendor/add_no_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list3").trigger("reloadGrid"); window.location.reload(); } else{ } } }); } } </script> <style> #refresh_list4,#refresh_list5 { display:none !important; } .preview { padding-bottom:3px !important; padding-top:3px !important; } </style> <link rel="stylesheet" href="<?php echo base_url('assets/css/code_jquery.min.css');?>"> <script src="<?php echo base_url('assets/js/jquery-ui.min.js'); ?>" type="text/javascript"></script> <link rel="stylesheet" type="text/css" media="screen" href="<?php echo base_url('assets/css/jquery-ui.min.css'); ?>" /> <script> $(document).ready(function() { $( "#customer" ).autocomplete({ source: '<?php echo base_url('request/auto_sea'); ?>', }); }); $(document).ready(function() { var user=$("#edit_row_id").val(); if(user > 2) { $("#list3").hideCol("myac"); } }); function update_new_val() { s_ids=[]; indent_goods_id =[]; $('.indent_id').each(function () { s_ids.push($(this).val()); }); $('.indent_goods_id').each(function () { indent_goods_id.push($(this).val()); }); var value = $('#new_value').val(); var date_update = $('#date_update').val(); $.ajax({ type:'post', url:'<?php echo base_url("out_source/update_yarn_raw_val"); ?>', data:{'indent_id':s_ids,'val':value,'indent_goods_id':indent_goods_id,'date_update':date_update}, async:false, success:function(data) { $('#myModal').modal('toggle'); location.reload(true); //$("#list3").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); } function searchname() { var customer = document.getElementById('customer').value; $.ajax({ url:"<?php echo base_url('request/search_by_fetch')?>", dataType: "json", data:{'customer':customer}, type:"POST", async:true, success:function(data) { // alert('hai'); var obj=JSON.parse(data); document.getElementById('customer_id').value=obj[0].customerID; } }); } </script> <style> .modal-dialog { width: 90%; } .modal-content { padding:0 10px; } #jaytab{ width:100%; overflow:auto; } } #search_list2 { display:none !important; } #list2_122_t { height:0px !important; } list2_136_t { height:12px !important; } .scroll { height:12px !important; } .ui-jqgrid-btable { } .ui-common-table { height:12px !important; } #refresh_list2 { display:none !important; } #client_edit { padding-right:12px !important; } #list2 { width: 1050px; height: 0px !important; } #gbox_list2 { height: auto !important; } #gview_list2 { height: auto !important; } @media only screen and (min-width:320px) and (max-width:641px){ .ui-jqgrid { margin-left: 1px !important; } .radio-list { margin-left:7% !important; } #table_pending_indent{ overflow-x: scroll; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 600px !important; padding-left: 0 !important; } #jaytab1 { margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 300px !important; padding-left: 0 !important; } #editmodlist2 { width:90% !important; } #sData span, #cData span { margin-left: 0 !important; } } @media only screen and (min-width:641px) and (max-width:991px){ .ui-jqgrid { margin-left: 1px !important; } #jaytab{ margin-top: 0 !important; margin-left: 0 !important; overflow-x: scroll; width: 100% !important; padding-left:0 !important; padding-right:9px !important; } } #sData span, #cData span { margin-left: 3px; } #sData { height: 29px; } #cData { height: 29px; } .jqgfirstrow { height: 0px !important; } </style>