EVOLUTION-NINJA
Edit File: stcok_received_grid_old.php
<script> function product_table(str) { if(str == 'Fabrics') { $('#fabric_material').show(); $('#yarn_material').hide(); $('#swan_material').hide(); $('#cs_material').hide(); $('#yarn_twisting_material').hide(); $('#yarn_dyed_material').hide(); } if(str == 'Yarn - Raw') { $('#yarn_material').show(); $('#fabric_material').hide(); $('#swan_material').hide(); $('#cs_material').hide(); $('#yarn_twisting_material').hide(); $('#yarn_dyed_material').hide(); } if(str == 'Yarn - Twisted') { $('#yarn_twisting_material').show(); $('#yarn_material').hide(); $('#fabric_material').hide(); $('#swan_material').hide(); $('#cs_material').hide(); $('#yarn_dyed_material').hide(); } if(str == 'Yarn - Dyed') { $('#yarn_dyed_material').show(); $('#yarn_twisting_material').hide(); $('#yarn_material').hide(); $('#fabric_material').hide(); $('#swan_material').hide(); $('#cs_material').hide(); } if(str == 'Consumables' || str == 'Spares') { $('#cs_material').show(); $('#yarn_dyed_material').hide(); $('#yarn_material').hide(); $('#fabric_material').hide(); $('#swan_material').hide(); $('#yarn_twisting_material').hide(); } if(str == 'swan_yarn_dyed') { $('#swan_material').show(); $('#cs_material').hide(); $('#yarn_material').hide(); $('#fabric_material').hide(); $('#yarn_twisting_material').hide(); $('#yarn_dyed_material').hide(); } } </script> <script> function planningtypes(str) { if(str=="indent_pending") { $('#table_approved_indent').hide(); $('#table_pending_indent').show(); } else if(str=="approved_indent") { $("#list3").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); $('#table_approved_indent').show(); $('#table_pending_indent').hide(); } } </script> <style> .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"> Stock Received Details </h3> <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="#" > Fabric </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="delete_id" class="delete_id" value="<?php if(empty($access_row)){ } else { echo $access_row->delete_id; } ?>" > <input type="hidden" id="approval_id" class="approval_id" value="<?php if(empty($access_row)){ } else { echo $access_row->approval_id; } ?>" > <input type="hidden" id="insert_id" class="insert_id" value="<?php if(empty($access_row)){ } else { echo $access_row->insert_id; } ?>" > <input type="hidden" value="<?php echo $ref; ?>" id="ref_id" > <input type="hidden" value="<?php echo $url_val; ?>" id="url_ref" style="width: 230px;" > <div class="radio-list" style="margin-left: 2%;"> <label class="radio-inline"> <div id="fabric_material"> <div id = "jaytab" class="jaytab"> <table id="list2"></table> <div id="pager2"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="yarn_material" style="display:none;"> <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 id="yarn_twisting_material" style="display:none;"> <div id = "jaytab1" class="jaytab"> <table id="list6"></table> <div id="pager6"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="yarn_dyed_material" style="display:none;"> <div id = "jaytab1" class="jaytab"> <table id="list7"></table> <div id="pager7"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="cs_material" style="display:none;"> <div id = "jaytab1" class="jaytab"> <table id="list4"></table> <div id="pager4"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="swan_material" style="display:none;"> <div id = "jaytab1" class="jaytab"> <table id="list5"></table> <div id="pager5"></div> <div id="dialogSelectRow" title="Warning" style="display:none"> <p>Please select row</p> </div> </div> </div> <div id="myModal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content" class="workorder_application"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> </div> <div class="modal-body"> <div class="row"> <div class="col-md-12"> <div class="form-group"> <label class="control-label col-md-3">Received Quantity :</label> <div class="col-md-7"> <input type="text" class="form-control" id="rec_qua" name="rec_qua" class="rec_qua" > <input type="hidden" class="form-control" id="recqua" name="recqua" class="recqua" > </div> </div> </div> </div> <!-- row -2--> <input type="hidden" class="form-control" id="tr_id" name="tr_id" class="tr_id" > </div> <div class="modal-footer"> <button class="btn btn-default" data-dismiss="modal">Close</button> <button id="submit_modal" name="submit" onclick="goods_details()" class="btn btn-primary">Submit</button> </div> </div> <!-- /.modal-content --> </div> <!-- /.modal-dialog --> </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'); ?>" /> <style> .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; } </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> <!----------------------------------Fabric controll -------------------------------> $(document).ready(function (){ var l=$("#ref_id").val(); var fromdate = 'present_year'; var enddate = ''; jQuery("#list2").jqGrid({ type : 'get', url:"<?php echo base_url('stock/rec_fabric_details')?>/s"+l+"&fromdate="+fromdate+"&enddate="+enddate, datatype: "json", colNames:['Id','Transfer Id','Product Type','Product Location','Transferred Location','Transferred By','Transferred Date','Status','Preview'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'transfer_id',index:'transfer_id', width:120,editable:false}, {name:'product_type',index:'product_type', width:120,editable:false}, {name:'product_location',index:'product_location', width:120,editable:true,editrules:{required: true}}, {name:'transfer_location',index:'transfer_location', editable:true,editrules:{required: true},width:120}, {name:'transfer_by',index:'transfer_by', editable:true,editrules:{required: true},width:120}, {name:'transfer_date',index:'transfer_date', editable:true,editrules:{required: true},width:120}, {name:'grid_status',index:'grid_status', editable:true,editrules:{required: true},width:120}, {name:'',index:'',align: "center",editable:false,editrules:{required: true}, width:200,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_fabric_preview($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' class='fa fa-eye' value='PREVIEW' onclick='some_function' classes='preview' \>"; }} ], height: 'auto', rowNum:50, rowTotal: 200000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager2", sortname:'id', viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", loadonce:true, caption:"Fabric Details", subGrid: true, subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id; //alert(row_id); swan_id=row_id; //alert(swan_id); subgrid_table_id = subgrid_id+"_t"; jQuery("#"+subgrid_id).html("<table id='"+subgrid_table_id+"' class='scroll'></table>"); jQuery("#"+subgrid_table_id).jqGrid({ url:"<?php echo base_url('stock/transfer_subgrid');?>/s"+row_id+"/", //data:{'sub_id':123}, mtype : "get", datatype: "json", colNames:['Id','','PO#','DTL Piece#','Product','Width','Design','Shades','Actual Weight','Actual Quantity','Transferred Weight','Transferred Quantity','Balanced Weight','Balance Quantity','Received','Received Quantity','Confirm','Received By'], colModel:[ {name:'id',index:'id',hidden:false, width:50,editable:true,width:100}, {name:'fabric_id',index:'fabric_id',hidden:true, width:120,editable:false}, {name:'po',index:'po', width:150,editable:true,editrules:{required: true}}, {name:'ssl_piece_no',index:'ssl_piece_no', width:100,editable:true,editrules:{required: true}}, {name:'product',index:'product', editable:true,editrules:{required: true},width:70}, {name:'width',index:'width', editable:true,editrules:{required: true},width:70}, {name:'design', index:'design', width:100,editable:true,editrules:{required: true}}, {name:'shades',index:'shades', editable:true,editrules:{required: true},width:100}, {name:'rec_weight',index:'rec_weight', width:150,editable:true,editrules:{required: true}}, {name:'actual_qua',index:'actual_qua', width:100,editable:true,editrules:{required: true}}, {name:'issue_weight',index:'issue_weight', editable:true,editrules:{required: true},width:70}, {name:'issue_mtrs',index:'issue_mtrs', editable:true,editrules:{required: true},width:70}, {name:'bal_wight', index:'bal_wight',hidden:true, width:100,editable:true,editrules:{required: true}}, {name:'bal_qua',index:'bal_qua',hidden:true, editable:true,editrules:{required: true},width:100}, {name:'modal',index:'modal',editable:false,editrules:{required: true}, width:150,cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun_rec_mtrs($(this))" '; },formatter:function (cellvalue, options, rowObject) { return "<input type='button' value='Received Quantity' onclick='some_function' style='margin-left:20px'\>"; } }, {name:'rec_mtrs', index:'rec_mtrs',hidden:false, width:100,editable:true,editrules:{required: true}}, { name: 'confirm', index: 'confirm', width:80, align: 'center', formatter: 'checkbox', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="fun1($(this))" '; } }, {name:'rec_by',index:'rec_by', editable:true,editrules:{required: true},width:70}, ], height: 'auto', rowNum:20000000, sortname: 'num', sortorder: "asc" }); } }); //$("#list2").jqGrid('filterToolbar',{searchOperators : false}); //for multisearch code,remove if not required jQuery("#list2").jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" }); $("#list2").jqGrid('navGrid','#pager2', {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 fun_rec_mtrs(rowId) { var v=$('#insert_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); $('#tr_id').val(id); $.ajax({ url:"<?php echo base_url('rec_stock/fetch_raw_q')?>", type:"POST", data:{'id':id}, success:function(data){ var objData =JSON.parse(data); console.log(objData); $('#rec_qua').val(objData.issue_mtrs); $('#recqua').val(objData.issue_mtrs); var v=objData.rec_mtrs; if(v == '0') { $('#myModal').modal('toggle'); } else { swal({ title: "This Is Already Received", text: "",}); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } }); } else { swal({ title: "You Don't Have Access To Receive", text: "", }); } } function fun1(rowId) { var v=$('#approval_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); $.ajax({ //alert(email); url:"<?php echo base_url('rec_stock/fetch_raw_q')?>", type:"POST", data:{'id':id}, success:function(data){ var objData =JSON.parse(data); console.log(objData); $('#rec_qua').val(objData.issue_mtrs); $('#recqua').val(objData.issue_mtrs); var v=objData.rec_mtrs; if(v == '0') { 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('rec_stock/add_fabric_yes_confirmation')?>", type:"POST", data:{'id':id,'remarks':email}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); $("#jaytab").trigger("reloadGrid"); $("#jqGrid").trigger("reloadGrid"); //window.location.reload(); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else{ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } }); swal({ type: 'success', // title: 'Approved By', // html: '' + 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(); $("#list2").trigger("reloadGrid"); //window.location.reload(); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else{ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } }); } } else { swal({ title: "This Is Already Received", text: "",}); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } // var row = jQuery(e.target).closest('tr.jqgrow'); // var rowId = row.attr('id'); // var secondSelect = jQuery('#' + rowId + '_stdCellLibrary\\.id')[0]; // jQuery(secondSelect).val(valueToSet); // //how to disable the secondSelect // jQuery(secondSelect).attr("disabled", true); } }); } else { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); swal({ title: "You Don't Have Access To Confirm This", text: "", }); } } function fun_fabric_preview(rowId) { var v=$('#preview_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("rec_stock/fabric_rec_preview"); ?>', data:{'as':as}, async:false, success:function() { var url_r=$('#url_ref').val(); if(url_r == '1') { window.location.href = '<?php echo base_url('rec_stock/fabric_rec_preview');?>/'+ '?id='+as; } else if(url_r == '2') { window.location.href = '<?php echo base_url('rec_stock/fabric_rec_stock_preview');?>/'+ '?id='+as; } else if(url_r == '3') { window.location.href = '<?php echo base_url('rec_stock/fabric_rec_stock_view');?>/'+ '?id='+as; } else if(url_r == '4') { window.location.href = '<?php echo base_url('rec_stock/fabric_rec_view');?>/'+ '?id='+as; } } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } </script> <script type="text/javascript"> function goods_details() { var rec_qua =$('#rec_qua').val(); var tr_id =$('#tr_id').val(); var recqua =$('#recqua').val(); if(rec_qua <= recqua) { $.ajax({ url:"<?php echo base_url('rec_stock/rec_goods_details');?>", type:"POST", data:{'rec_qua':rec_qua,'tr_id':tr_id}, async:false, success:function(data) { swal({ title: "Successfully Received", text: "",}); $('#rec_qua').val(''); $('#myModal').modal('toggle'); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); } else { swal({ title: "Quantity is Exceeded", text: "",}); } } </script> <style> #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>