EVOLUTION-NINJA
Edit File: recent_shipment.php
<style> .cure { width: 75px; } .modal_content_id { width: 246%; margin-left: -410px; } </style> <style> #other_charges_val { font-weight:bold; } </style> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Fabric Recent Shipment </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="#" > Packing List Fabric </a></li> </ul> </div> <?php if(empty($access_row)) { } else { if($access_row->insert_id == '1') { ?> <form action="<?php echo base_url(); ?>packing_list/paking_list_data" method="post" class="form-horizontal"> <b>To insert data click here:</b> <input type="hidden" value="<?php echo $url_val; ?>" id="url_reference_val" name="url_reference_val" style="width: 230px;" > <input type="submit" name="Insert" value="Insert" /> <br><br> </form> <?php } else { ?> <?php } }?> <?php if(empty($access_row)) { } else { if($access_row->vmc_id == '1') { ?> <input type="submit" id="less" value="View More Columns" onclick="show();" /> <input type="submit" id="more" value="View More Columns" onclick="hide();" /> <?php } } ?> <!--<input type="button" name="co" onclick="fabrics_preview()" value="Preview" />--> <!--<input type="button" name="co" onclick="c_invoice_preview()" value="C Invoice" />--> <!--<input type="button" name="co" onclick="b_invoice_preview()" value="B Invoice" />--> <!--<input type="button" name="co" onclick="gst_invoice_preview()" value="HSN Invoice" />--> <!--<input type="button" name="co" onclick="sdf_form_preview()" value="SDF Form" />--> <!--<input type="button" name="co" onclick="sku_preview()" value="SKU" />--> <!--<input type="button" name="co" onclick="pl_preview()" value="PL" />--> <!--<input type="button" name="co" onclick="box_preview()" value="Box" />--> <!--<input type="button" name="co" onclick="pc_preview()" value="PC" />--> <!--<input type="button" name="co" onclick="airway_preview()" value="Airway" />--> <!--<input type="button" name="co" onclick="nd_preview()" value="ND" />--> <!--<input type="button" name="co" onclick="azo_preview()" value="AZO" />--> <!--<input type="button" name="Consignee" onclick="consignee_preview()" value="Consignee" />--> <!--<input type="button" name="co" onclick="co_preview()" value="CO" />--> <!--<input type="button" name="co" onclick="export_preview()" value="Export Doc" />--> <!--<input type="button" name="co" onclick="export_preview2()" value="Export Doc2" />--> <!--<input type="button" name="co" onclick="us_preview()" value="US Customs" />--> <!--<input type="button" name="co" onclick="shipping_bill_preview()" value="Shipping Bill" />--> <!--<input type="button" name="co" onclick="payments()" value="Payment View" />--> <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="details_id" class="details_id" value="<?php if(empty($access_row)){ } else { echo $access_row->details_id; } ?>" > <input type="hidden" id="invoice_id" class="invoice_id" value="<?php if(empty($access_row)){ } else { echo $access_row->invoice_id; } ?>" > <input type="hidden" id="export_doc_id" class="export_doc_id" value="<?php if(empty($access_row)){ } else { echo $access_row->export_doc_id; } ?>" > <input type="hidden" id="export_doc_id2" class="export_doc_id2" value="<?php if(empty($access_row)){ } else { echo $access_row->export_doc_id2; } ?>" > <input type="hidden" id="sdf_form" class="sdf_form" value="<?php if(empty($access_row)){ } else { echo $access_row->sdf_form; } ?>" > <input type="hidden" id="uncheck_id" class="uncheck_id" value="<?php if(empty($access_row)){ } else { echo $access_row->uncheck_id; } ?>" > <input type="hidden" id="ship_id" class="ship_id" value="<?php if(empty($access_row)){ } else { echo $access_row->ship_id; } ?>" > <input type="hidden" id="unship_id" class="unship_id" value="<?php if(empty($access_row)){ } else { echo $access_row->unship_id; } ?>" > <input type="hidden" id="pay_id" class="pay_id" value="<?php if(empty($access_row)){ } else { echo $access_row->pay_id; } ?>" > <input type="hidden" id="unpay_id" class="unpay_id" value="<?php if(empty($access_row)){ } else { echo $access_row->unpay_id; } ?>" > <input type="hidden" id="pkl_id" class="pkl_id" value="<?php if(empty($access_row)){ } else { echo $access_row->pkl_id; } ?>" > <input type="hidden" id="invoice_edit" class="invoice_edit" value="<?php if(empty($access_row)){ } else { echo $access_row->invoice_edit; } ?>" > <input type="hidden" id="pack_edit" class="pack_edit" value="<?php if(empty($access_row)){ } else { echo $access_row->pack_edit; } ?>" > <input type="hidden" id="designation" class="designation" value="<?php echo $emp_details->designation; ?>" > <input type="hidden" id="box_id" class="box_id" value="<?php if(empty($access_row)){ } else { echo $access_row->box_id; } ?>" > <input type="hidden" id="pc_id" class="pc_id" value="<?php if(empty($access_row)){ } else { echo $access_row->pc_id; } ?>" > <!--<input type="hidden" value="<?php echo $ref; ?>" id="ref_id" >--> <input type="hidden" value="<?php echo $fileNo; ?>" id="fileNo" > <input type="hidden" value="<?php echo $orders_Type; ?>" id="orders_Type" > <input type="hidden" value="<?php echo $orders_id; ?>" id="orders_id" > <!--<input type="hidden" value="<?php echo $url_val; ?>" id="url_ref" style="width: 230px;" >--> <!-- modal content Modal --> <div class="modal fade" id="content_modal" role="dialog" > <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content modal_content_id" id="" style="width: 230% !important;margin-left: -315px !important;"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Packing List Details</h4> </div> <div class="row"> <div class="col-sm-12 table-responsive"> <input type="hidden" id="table_ref_id" name="table_ref_id" class="table_ref_id" > <input type="hidden" id="rec_weightt" class="rec_weightt" > <input type="hidden" id="rec_qty" class="rec_qty" > <table class="" border="1" width="100%" style="border-spacing:0;margin-top: 1%;" cellpadding="5px"> <tr> <tr> <th>SL No.</th> <th>SKU No#</th> <th>Buyer Order#</th> <th>Article</th> <th>Width</th> <th>design</th> <th>Shade</th> <th>Qty</th> <th>Wt</th> <th>Unit Price</th> <th>Value</th> <th>Currency</th> <th>Contract Type</th> <th>HSN Code</th> </tr> </tr> <tbody id="dynamicTbody" > </tbody> </table> </div> </div><!--row 1 end--> <br> <div class="row"> <div class="col-sm-3"> <div class="form-group"> <label class="col-sm-2"><b><input type="text" name="discount_name" id="discount_name" class="form-control" value="<?php echo 'Discount'; ?>" style="width: 110px; border: tan; font-weight: bold;"> </b></label> <div class="col-sm-10"> <input type="text" style="margin-left: 55px;" name="discount" id="discount" onkeyup="discount_value()" value="0" class="form-control" style="margin-left: 55px;"> </div> </div> </div> <div class="col-sm-5"> <div class="form-group"> <b><label class="col-sm-4"><input type="text" name="other_charges_val" id="other_charges_val" style="border:none !important;" value="Other Charges" class="form-control" value="Other charges"> </label></b> <div class="col-sm-8"> <input type="text" name="other_chares" id="other_chares" onkeyup="other_value()" class="form-control" value="0"> </div> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label class="col-sm-3"><b>Total Vlaue </b></label> <div class="col-sm-9"> <input type="text" name="total_values" id="total_values" class="form-control"> </div> </div> </div> </div> <br> <div class="modal-footer"> <button id="submit_modal" name="submit" onclick="content_goods_details()" class="btn btn-primary">Submit</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> <!-------------- grid data -----------------------------> <input type="hidden" id="refe_ids" name="refe_ids" class="refe_ids" > <div id="table_pending_indent" style="margin-top:20px;"> <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> </div> </div> <!-- End BEGIN CONTAINER --> <script src="<?php echo base_url(); ?>assets/js/sweetalert.min.js" type="text/javascript"></script> <link href="<?php echo base_url(); ?>assets/css/sweetalert.min.css" rel="stylesheet" type="text/css" > <!-- The link to the CSS that the grid needs --> <!-- BEGIN FOOTER --> <!-- Modal --> <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Payments details</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form class="payment_details"> <div class="modal-body"> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="5px"> <thead> <thead> <tr> <th>Invoice No</th> <th><input type="text" name="invoice_no" readonly class="form-control invoice_no" required="required"></th> </tr> <tr> <th>Invoice Value</th> <input type="hidden" name="id" id="ids_updates" readonly class="form-control"> <th><input type="text" name="invoice_value" readonly class="form-control invoice_value" required="required"></th> </tr> <tr> <th>Currency</th> <th><input type="text" name="currency" readonly class="currency form-control" required="required"></th> </tr> <tr> <th>Received Date</th> <th><input type="text" name="received_date" id="datepicker" readonly style="background-color: white;" class=" form-control" required="required"></th> </tr> <tr> <th>Amount Received</th> <th><input type="text" name="amount_received" onkeypress="if ( isNaN(this.value + String.fromCharCode(event.keyCode) )) return false;" class="amount_received form-control"> </th></th> </tr> <tr> <th>Bank Charges</th> <th><input type="text" name="bank_charged" onkeypress="if ( isNaN(this.value + String.fromCharCode(event.keyCode) )) return false;" class="bank_charged form-control" required="required"></th> </tr> <tr> <th>Bank Realisation Rate</th> <th><input type="text" name="bank_realisation_rate" onkeypress="if ( isNaN(this.value + String.fromCharCode(event.keyCode) )) return false;" class="bank_realisation_rate form-control"></th> </tr> <tr> <th>Bank Reference</th> <th><input type="text" name="bank_reference" class="bank_reference form-control"></th> </tr> <tr> <th>INR Value</th> <th><input type="text" readonly name="inr_value" onkeypress="if ( isNaN(this.value + String.fromCharCode(event.keyCode) )) return false;" class="inr_value form-control"></th> </tr> <tr> <th>Remark</th> <th><textarea name="remark" class="remark form-control"></textarea> </th> </tr> <tr> <th>Created at</th> <th><input type="text" name="created" value="<?php echo date('d-m-Y');?>" class="created form-control"></th> </tr> <tr> <th>Approved By</th> <?php $id=$this->session->userdata('logged_in'); $data['approved_by']=$id['username']; ?> <th><input type="text" readonly name="user_name" value="<?php echo $data['approved_by'];?>" class="user_name form-control"></th> <input type="hidden" readonly name="customer_id" class="customer_id form-control"> <input type="hidden" readonly name="invoice_date" class="invoice_date form-control"> </tr> </thead> </table> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-primary submit">Save changes</button> </div> </form> </div> </div> </div> <!--------------------------------------------------------------------------> <!-- Modal --> <div class="modal fade" id="view_payment_details" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Payments details</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form class="payment_details"> <div class="modal-body"> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="5px"> <thead> <thead> <tr> <th>Invoice No</th> <th><input type="text" name="invoice_no" readonly class="form-control invoice_no1" required="required"></th> </tr> <tr> <th>Invoice Value</th> <input type="hidden" name="id" id="ids_updates" readonly class="form-control"> <th><input type="text" name="invoice_value" readonly class="form-control invoice_value1" required="required"></th> </tr> <tr> <th>Currency</th> <th><input type="text" name="currency" readonly class="currency1 form-control" required="required"></th> </tr> <tr> <th>Received Date</th> <th><input type="text" name="received_date" readonly style="background-color: white;" class="form-control received_date1" required="required"></th> </tr> <tr> <th>Amount Received</th> <th><input type="text" name="amount_received" readonly class="amount_received1 form-control"> </th></th> </tr> <tr> <th>Bank Charged</th> <th><input type="text" name="bank_charged" readonly class="bank_charged1 form-control" required="required"></th> </tr> <tr> <th>Bank Realisation Rate</th> <th><input type="text" name="bank_realisation_rate" readonly class="bank_realisation_rate1 form-control"></th> </tr> <tr> <th>Bank Reference</th> <th><input type="text" name="bank_reference1" readonly class="bank_reference1 form-control"></th> </tr> <tr> <th>INR Value</th> <th><input type="text" readonly name="inr_value" readonly class="inr_value1 form-control"></th> </tr> <tr> <th>Remark</th> <th><textarea name="remark" class="remark1 form-control" readonly></textarea> </th> </tr> <tr> <th>Created at</th> <th><input type="text" name="created" readonly class="created1 form-control"></th> </tr> <tr> <th>Approved By</th> <th><input type="text" readonly name="user_name" readonly class="user_name1 form-control"></th> </tr> </thead> </table> </div> </form> </div> </div> </div> <!--------------------------------------------------------------------------------> <!------------------------------------------------------------------------------> <!-- Modal --> <div class="modal fade" id="view_shipment_details" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel">Shipment details</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <form class="payment_details"> <div class="modal-body"> <table border="1" style="width:100%;border-spacing:0;margin-top: 1%;" cellpadding="5px"> <thead> <thead> <tr> <th>Invoice Date</th> <th><input type="text" name="invoice_no" readonly class="form-control invoice_date2" required="required"></th> </tr> <tr> <th>Invoice No</th> <th><input type="text" name="invoice_no" readonly class="form-control invoice_no2" required="required"></th> </tr> <tr> <th>Customer Name</th> <th><input type="text" name="" readonly class="form-control customer_id2" required="required"></th> </tr> <tr> <th>Invoice Value</th> <input type="hidden" name="id" id="ids_updates" readonly class="form-control"> <th><input type="text" name="invoice_value" readonly class="form-control invoice_value2" required="required"></th> </tr> <tr> <th>Currency</th> <th><input type="text" name="currency" readonly class="currency2 form-control" required="required"></th> </tr> <tr> <th>Customer Ex Rate</th> <th><input type="text" name="currency" readonly class="cuustomer_ex_rate2 form-control" required="required"></th> </tr> <tr> <th>INR Value</th> <th><input type="text" readonly name="inr_value" readonly class="inr_value2 form-control"></th> </tr> <tr> <th>Shipping Bill Date</th> <th><input type="text" name="received_date" readonly class="form-control shipping_date2" required="required"></th> </tr> <tr> <th>Shipping Bill #</th> <th><input type="text" name="" readonly class="form-control shipping_num2" required="required"></th> </tr> <tr> <th>Port Code</th> <th><input type="text" name="amount_received" readonly class="port_code2 form-control"> </th></th> </tr> <tr> <th>Approved By</th> <th><input type="text" readonly name="user_name" readonly class="user_name2 form-control"></th> </tr> </thead> </table> </div> </form> </div> </div> </div> <!----------------------------------------------------------> <!-- 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'); ?>" /> <script> $("#less").click(function() { $("#more").show(); $("#less").hide(); }); </script> <script> $("#more").click(function() { $("#less").show(); $("#more").hide(); }); </script> <style> .tablediv { width:auto !important; overflow-x:scroll; } .ui-jqgrid { text-transform: capitalize !important; } .tablediv { text-transform: uppercase !important; } .ui-jqgrid tr.jqgrow td{ text-transform: uppercase !important; } </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> .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) { } #more { display:none; } </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> $(document).ready(function (){ $('#more').hide(); // var l=$("#ref_id").val(); var fileNo = $("#fileNo").val(); var orders_Type = $("#orders_Type").val(); var orders_id = $("#orders_id").val(); jQuery("#list2").jqGrid({ url:"<?php echo base_url('stock_history/recent_shipping_grid_data')?>/"+fileNo+"/"+orders_Type+"/"+orders_id, datatype: "json", colNames:['Id','Invoice No','Date','Customer ID','Customer Name','Unit','Buyer Order#','DTL#','Width','Article','Design','Shade','Qty','Price','Currency','Terms'], colModel:[ {name:'id',index:'id',hidden:true, width:100,editable:true}, // { name: 'select', label: 'select', width: 120,align: 'center',cellattr: function (rowId, tv, rawObject, cm, rdata) // { // return ' onclick="fun_radio_val($(this))" '; // }, // formatter: function radio(cellValue, option) { // return '<input type="radio" name="radio_' + option.gid + '" />'; // } // }, {name:'invoice_num',index:'invoice_num', width:205,editable:false}, {name:'sys_date',index:'sys_date', width:185,editable:true,editrules:{required: true}}, {name:'customerID',index:'customerID', editable:true,editrules:{required: true},width:200}, {name:'customer_name',index:'customer_name',hidden:true, editable:true,editrules:{required: true},width:240}, {name:'units',index:'units', editable:true,editrules:{required: true},width:140}, {name:'orderNo',index:'orderNo', editable:true,editrules:{required: true},width:185}, {name:'po_no',index:'po_no', editable:true,editrules:{required: true},width:180}, {name:'width',index:'width', editable:true,editrules:{required: true},width:165}, {name:'article',index:'article', editable:true,editrules:{required: true},width:170}, {name:'design',index:'design', editable:true,editrules:{required: true},width:170}, {name:'shades',index:'shades', editable:true,editrules:{required: true},width:170}, {name:'stock_wt',index:'stock_wt', editable:true,editrules:{required: true},width:135}, {name:'unitprice',index:'unitprice', editable:true,editrules:{required: true},width:150}, {name:'currency',index:'currency', editable:true,editrules:{required: true},width:150}, {name:'contarct_type',index:'contarct_type', editable:true,editrules:{required: true},width:170}, ], 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 Recent Shipment", footerrow: true, loadComplete: function () { var sumOfqnty = jQuery("#list2").jqGrid('getCol','stock_wt',false,'sum'); console.log(sumOfqnty); //= 'Rs'.sumOfindian; /*var res=sumOfmaintainance_amount.toString().split("."); //Comma-fies the first part res[0] = res[0].replace(/(\d)(?=(\d\d)+\d$)/g, "$1,"); var sumOfmaintainance_amount_res=res.join("."); var sumOfmaintainance_amount_res = sumOfmaintainance_amount_res+'/-'; $('#total_maintain_amount').html('Total Amount : '+sumOfmaintainance_amount_res);*/ jQuery("#list2").jqGrid('footerData', 'set', {shades: 'Total Qty:', stock_wt: sumOfqnty}); }, 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_history/paking_list_grid_data_subgrid');?>/"+row_id+"/", //data:{'sub_id':123}, mtype : "get", datatype: "json", colNames:['Id','Description'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'description',index:'description', width:300,editable:true,editrules:{required: true}}, ], height: 'auto', rowNum:200000000000000000, 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 show () { // // Position of the name column var colPos = 0; var navGrid = $('#list2'); // alert(navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[colPos + 6].name)); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[colPos].name); // navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[2].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[3].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[4].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[5].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[6].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[7].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[8].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[9].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[10].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[11].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[12].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[13].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[14].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[15].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[16].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[17].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[18].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[19].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[20].name); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[21].name); } function hide() { var colPos = 0; var navGrid = $('#list2'); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[6].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[7].name); //navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[9].name); //navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[10].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[11].name); //navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[12].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[13].name); //navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[14].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[15].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[16].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[17].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[18].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[19].name); // navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[20].name); } function fun_radio_val(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $('#refe_ids').val(as); } function fun_pkg_edit_val(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#pack_edit').val(); //alert(v); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/packing_edit_val"); ?>', data:{'as':as}, async:false, success: function (data) { var objdata = jQuery.parseJSON(data); var obj_fetch_emp= objdata.emp_details; var fetch_res= objdata.fetch; if(fetch_res.confirm == 'Yes') { swal({ title: "This Stock Is Approved, You Can't Edit This", text: "", }); } else { // window.location.href = '<?php echo base_url('packing_list/fabric_packing');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/fabric_packing');?>/'+ '?id='+as,'_blank'); } } }); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } function approve_old_fun(rowId) { var v=$('#approval_id').val(); if(v == 1) { 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('packing_list/add_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"); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else{ } } }); swal({ type: 'success', // title: 'Approved By', // html: '' + email }) }) } else if (confirmMsg==false) { var c=$('#uncheck_id').val(); if(c == 1) { $.ajax({ url:"<?php echo base_url('packing_list/add_no_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ if(data==""){ $("#editmodlist2").remove(); $("#list2").trigger("reloadGrid"); $("#jaytab").trigger("reloadGrid"); $("#jqGrid").trigger("reloadGrid"); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else{ } } }); } else { swal({ title: "You Don't Have Access For This To Uncheck", text: "", }); } } } else { swal({ title: "You Don't Have Access For This Approval", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } // function fabrics_preview() // { // var as= $('#refe_ids').val(); // if(as == '') // { // swal({ // title: "Plese select Invoice", // text: "", // }); // } // else // { // var as= $('#refe_ids').val(); // var v=$('#preview_id').val(); // if(v == 1) // { // $.ajax({ // type:'post', // url:'<?php echo base_url("packing_list/pkg_details_approve_preview"); ?>', // data:{'as':as}, // async:false, // success:function(data) // { // var objdata = jQuery.parseJSON(data); // var obj_fetch= objdata.fetch; // // if(obj_fetch.confirm == 'Yes') // // { // var url_r=$('#url_ref').val(); // if(url_r == '1') // { // //window.location.href = '<?php echo base_url('packing_list/pkg_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/pkg_preview');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '2') // { // //window.location.href = '<?php echo base_url('packing_list/pkg_fabric_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/pkg_fabric_preview');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '3') // { // //window.location.href = '<?php echo base_url('packing_list/pkg_fabric_view');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/pkg_fabric_view');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '4') // { // //window.location.href = '<?php echo base_url('packing_list/pkg_fabric_details');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/pkg_fabric_details');?>/'+ '?id='+as,'_blank'); // } // } // else // { // swal({ // title: "Please approve the stock", // text: "", // }); // } // } // }); // } // else // { // swal({ // title: "You Don't Have Access For This Preview", // text: "", // }); // } // } // } // function c_invoice_preview() // { // var as= $('#refe_ids').val(); // if(as == '') // { // swal({ // title: "Plese select Invoice", // text: "", // }); // } // else // { // var as= $('#refe_ids').val(); // var v=$('#invoice_id').val(); // if(v == 1) // { // $.ajax({ // type:'post', // url:'<?php echo base_url("packing_list/pkg_details_approve_preview"); ?>', // data:{'as':as}, // async:false, // success:function(data) // { // var objdata = jQuery.parseJSON(data); // var obj_fetch= objdata.fetch; // var obj_fetch_emp= objdata.emp_details; // // if(obj_fetch.confirm == 'Yes') // // { // var url_r=$('#url_ref').val(); // if(url_r == '1') // { // //window.location.href = '<?php echo base_url('packing_list/generate_invoice');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/generate_invoice');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '2') // { // //window.location.href = '<?php echo base_url('packing_list/pkg_generate_invoice');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/pkg_generate_invoice');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '3') // { // //window.location.href = '<?php echo base_url('packing_list/packing_generate_invoice');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/packing_generate_invoice');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '4') // { // //window.location.href = '<?php echo base_url('packing_list/generate_invoice_pkg');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/generate_invoice_pkg');?>/'+ '?id='+as,'_blank'); // } // // } // // else // // { // // swal({ // // title: "Please approve the stock", // // text: "", // // }); // // } // } // }); // } // else // { // swal({ // title: "You Don't Have Access For This Preview", // text: "", // }); // } // } // } // function sdf_form_preview() // { // var as= $('#refe_ids').val(); // if(as == '') // { // swal({ // title: "Plese select Invoice", // text: "", // }); // } // else // { // var as= $('#refe_ids').val(); // var v=$('#sdf_form').val(); // if(v == 1){ // $.ajax({ // type:'post', // url:'<?php echo base_url("packing_list/packing_edit_val"); ?>', // data:{'as':as}, // async:false, // success: function (data) // { // var objdata = jQuery.parseJSON(data); // var obj_fetch_emp= objdata.emp_details; // var fetch_res= objdata.fetch; // console.log(fetch_res.confirm); // if(fetch_res.confirm == 'Yes') // { // $.ajax({ // type:'post', // url:'<?php echo base_url("packing_list/pkg_fabric_export_details"); ?>', // data:{'as':as}, // async:false, // success:function(data) // { // $.ajax({ // url:"<?php echo site_url('packing_list/fabric_list_shipment_get_details')?>", // type:"POST", // data:{'id':as}, // success:function(response){ // response=jQuery.parseJSON(response); // //console.log(response); // if(response.result==1) // { // console.log(response.message.shipping_bill_num); // console.log(response.message.shipping_bill_date); // if(response.message.shipping_bill_num != "0"){ // // $('#view_shipment_details').modal('show'); // $('.invoice_date2').val(response.message.sys_date); // $('.invoice_no2').val(response.message.invoice_num); // $('.customer_id2').val(response.message.customer_name); // $('.inr_value2').val(response.message.payment_inr_value); // $('.currency2').val(response.message2.currency); // $('.cuustomer_ex_rate2').val(response.message.shipping_customs_ex_rate); // $('.inr_value2').val(response.message.shipping_customs_inr_val); // $('.shipping_date2').val(response.message.shipping_bill_date); // $('.shipping_num2').val(response.message.shipping_bill_num); // $('.port_code2').val(response.message.shipping_port_code); // $('.user_name2').val(response.message.payment_approved_by); // $('.invoice_value2').val(response.message.total_value); // // window.location.href = '<?php echo base_url('packing_list/shipping_bill_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/sdf_form_preview');?>/'+ '?id='+as,'_blank'); // } // else{ // swal({ // title: "This Stock Is Not Yet Shipped, Please Shipped First", // text: "", // }); // } // } // else // { // swal({ // title: "No Data Found", // text: "", // }); // } // } // }); // } // }); // } // else // { // swal({ // title: "This Stock Is Not Yet Approved, Please Approve First", // text: "", // }); // } // } // }); // } // else // { // swal({ // title: "You Don't Have Access For This Preview", // text: "", // }); // } // } // } // // function gst_invoice_preview() // // { // // var as= $('#refe_ids').val(); // // if(as == '') // // { // // swal({ // // title: "Plese select Invoice", // // text: "", // // }); // // } // // else // // { // // var as= $('#refe_ids').val(); // // var v=$('#invoice_id').val(); // // if(v == 1) // // { // // $.ajax({ // // type:'post', // // url:'<?php echo base_url("packing_list/pkg_details_approve_preview"); ?>', // data:{'as':as}, // async:false, // success:function(data) // { // var objdata = jQuery.parseJSON(data); // var obj_fetch= objdata.fetch; // var obj_fetch_emp= objdata.emp_details; // // if(obj_fetch.confirm == 'Yes') // // { // var url_r=$('#url_ref').val(); // if(url_r == '1') // { // //window.location.href = '<?php echo base_url('packing_list/gst_generate_invoice');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/gst_generate_invoice');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '2') // { // // window.location.href = '<?php echo base_url('packing_list/gst_pkg_generate_invoice');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/gst_pkg_generate_invoice');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '3') // { // //window.location.href = '<?php echo base_url('packing_list/gst_packing_generate_invoice');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/gst_packing_generate_invoice');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '4') // { // //window.location.href = '<?php echo base_url('packing_list/gst_generate_invoice_pkg');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/gst_generate_invoice_pkg');?>/'+ '?id='+as,'_blank'); // } // // } // // else // // { // // swal({ // // title: "Please approve the stock", // // text: "", // // }); // // } // } // }); // } // else // { // swal({ // title: "You Don't Have Access For This Preview", // text: "", // }); // } // } // } // function approve_shipped_fun(rowId) // { // var v=$('#ship_id').val(); // if(v == 1) // { // var id = rowId.closest('tr').attr('id'); // var as=id; // $.ajax({ // type:'post', // url:'<?php echo base_url("packing_list/packing_edit_val"); ?>', // data:{'as':as}, // async:false, // success: function (data) // { // var objdata = jQuery.parseJSON(data); // var obj_fetch_emp= objdata.emp_details; // var fetch_res= objdata.fetch; // if(fetch_res.confirm == 'Yes') // { // if(fetch_res.shipped == 'Yes') // { // var id = rowId.closest('tr').attr('id'); // //alert(id); // var confirmMsg= confirm("This Invoice Is Already Shipped. Do You Want To Uncheck This!"); // if (confirmMsg==true) // { // var c=$('#unship_id').val(); // if(c == 1) // { // $.ajax({ // url:"<?php echo base_url('packing_list/add_ship_no_confirmation')?>", // type:"POST", // data:{'id':id}, // success:function(data){ // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // } // }); // } // else // { // swal({ // title: "You Don't Have Access For To UnCheck This Shipped", // text: "", // }); // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // } // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // } // else if (confirmMsg==false) // { // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // } // } // else // { // var id = rowId.closest('tr').attr('id'); // //alert(id); // var v = $('#'+id).closest('#'+id).find('input:checkbox').attr('value'); // if(v=='yes'){ // var confirmMsg= confirm("Do You Want To Confirm!"); // if (confirmMsg==true) // { // // window.location.href = '<?php echo base_url('packing_list/shipping_bill_preview');?>/'+ '?id='+id; // window.open('<?php echo base_url('packing_list/shipping_bill_preview');?>/'+ '?id='+id,'_blank'); // /*$.ajax({ // //alert(email); // url:"<?php echo base_url('packing_list/add_shipped_yes_confirmation')?>", // type:"POST", // data:{'id':id}, // success:function(data){ // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // } // }); // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid');*/ // } // else if (confirmMsg==false) // { // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // } // }else // { // swal({ // title: "This Stock Is Not Yet Approved, Please Approve First", // text: "", // }); // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // } // } // } // else // { // swal({ // title: "This Stock Is Not Yet Approved, Please Approve First", // text: "", // }); // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // } // } // }); // } // else // { // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // swal({ // title: "You Don't Have Acces To Approve This", // text: "", // }); // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); // } // } /*function approve_payment_fun(rowId) { var v=$('#pay_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("packing_list/packing_edit_val"); ?>', data:{'as':as}, async:false, success: function (data) { var objdata = jQuery.parseJSON(data); var obj_fetch_emp= objdata.emp_details; var fetch_res= objdata.fetch; if(fetch_res.shipped == 'Yes') { if(fetch_res.payment == 'Yes') { var id = rowId.closest('tr').attr('id'); //alert(id); var confirmMsg= confirm("This Invoice Is Already Payed. Do You Want To Unpayed This!"); if (confirmMsg==true) { var c=$('#unpay_id').val(); if(c == 1) { $.ajax({ url:"<?php echo base_url('packing_list/add_pay_no_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); } else { swal({ title: "You Don't Have Access For To UnCheck This Payment", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else if (confirmMsg==false) { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } else { var id = rowId.closest('tr').attr('id'); //alert(id); var confirmMsg= confirm("Do You Want To Confirm This Payment!"); if (confirmMsg==true) { $.ajax({ //alert(email); url:"<?php echo base_url('packing_list/add_payment_yes_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else if (confirmMsg==false) { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } } else { swal({ title: "This Stock Is Not Yet Shipped, Please Ship First", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } }); } else { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); swal({ title: "You Don't Have Acces To Approve This", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }*/ function approve_payment_fun(rowId) { var v=$('#pay_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("packing_list/packing_edit_val"); ?>', data:{'as':as}, async:false, success: function (data) { var objdata = jQuery.parseJSON(data); var obj_fetch_emp= objdata.emp_details; var fetch_res= objdata.fetch; if(fetch_res.payment == 'Yes') { var id = rowId.closest('tr').attr('id'); //alert(id); var confirmMsg= confirm("This Invoice Is Already Payed. Do You Want To Unpayed This!"); if (confirmMsg==true) { var c=$('#unpay_id').val(); if(c == 1) { $.ajax({ url:"<?php echo base_url('packing_list/add_pay_no_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); } else { swal({ title: "You Don't Have Access For To UnCheck This Payment", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } else if (confirmMsg==false) { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } else { if(fetch_res.shipped == 'Yes') { var id = rowId.closest('tr').attr('id'); //alert(id); var confirmMsg= confirm("Do You Want To Confirm This Payment!"); if (confirmMsg==true) { $.ajax({ url:"<?php echo site_url('packing_list/fabric_list_payment_get_details')?>", type:"POST", data:{'id':id}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { $('#exampleModal').modal('show'); $('#ids_updates').val(id); $('.invoice_no').val(response.message.invoice_num); $('.customer_id').val(response.message.customerID); $('.invoice_date').val(response.message.sys_date); $('.invoice_value').val(response.message.total_value); $('.currency').val(response.message2.currency); } else { swal({ title: "No Data Found", text: "", }); } } }); } else if (confirmMsg==false) { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } else { swal({ title: "This Stock Is Not Yet Shipped, Please Ship First", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } } }); } else { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); swal({ title: "You Don't Have Acces To Approve This", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } $(".amount_received").keyup(function(){ var val = this.value; var re = /^([0-9]+[\.]?[0-9]?[0-9]?|[0-9]+)$/g; var re1 = /^([0-9]+[\.]?[0-9]?[0-9]?|[0-9]+)/g; if (re.test(val)) { //do something here } else { val = re1.exec(val); if (val) { this.value = val[0]; } else { this.value = ""; } } }); $(".bank_charged").keyup(function(){ var val = this.value; var re = /^([0-9]+[\.]?[0-9]?[0-9]?|[0-9]+)$/g; var re1 = /^([0-9]+[\.]?[0-9]?[0-9]?|[0-9]+)/g; if (re.test(val)) { //do something here } else { val = re1.exec(val); if (val) { this.value = val[0]; } else { this.value = ""; } } }); $(".bank_realisation_rate,.amount_received").focusout(function(){ var amount_received=$('.amount_received').val(); var bank_realisation_rate=$('.bank_realisation_rate').val(); if(amount_received!='' && bank_realisation_rate!=''){ var final=parseFloat(amount_received)*parseFloat(bank_realisation_rate); var fixed=final.toFixed(2); $('.inr_value').val(fixed); } }); $('.payment_details').submit(function(e){ e.preventDefault(); $(".submit").attr('disabled', 'disabled'); $(".submit").text("Submitting..."); formdata = new FormData($(this)[0]); $.ajax({ type : 'post', url : '<?php echo site_url('packing_list/add_payment_yes_confirmation');?>', data : formdata, contentType: false, processData: false, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { $('.payment_details')[0].reset(); $('#exampleModal').modal('hide'); swal({ title: "Successfully Added", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); $(".submit").text("Submit"); $(".submit").removeAttr('disabled'); } else { swal({ title: "Fail To add, Try Again", text: "", }); $(".submit").text("Submit"); $(".submit").removeAttr('disabled'); } } }); }); $('#datepicker').datepicker({ changeMonth:true, changeYear:true, yearRange: "2000:2030", // dateFormat: 'yy-mm-dd' dateFormat: 'dd-mm-yy' }); function approve_fun(rowId) { var v=$('#approval_id').val(); if(v == 1) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("packing_list/packing_edit_val"); ?>', data:{'as':as}, async:false, success: function (data) { var objdata = jQuery.parseJSON(data); var obj_fetch_emp= objdata.emp_details; var fetch_res= objdata.fetch; if(fetch_res.confirm == 'Yes') { var id = rowId.closest('tr').attr('id'); //alert(id); var confirmMsg= confirm("This Invoice Is Already Approved. Do You Want To Uncheck This!"); if (confirmMsg==true) { swal({ title: 'Remarks', input: 'text', showCancelButton: true, confirmButtonText: 'Submit', showLoaderOnConfirm: true, }).then(function (email) { var c=$('#uncheck_id').val(); var id = rowId.closest('tr').attr('id'); var as=id; //alert(c); if(c == 1) { $.ajax({ url:"<?php echo base_url('packing_list/add_no_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); } else { swal({ title: "You Don't Have Access For To UnCheck This Approval", text: "", }); } $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); }) } else if (confirmMsg==false) { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } else { var confirmMsg= confirm("Do You Want To Confirm!"); if (confirmMsg==true) { var id = rowId.closest('tr').attr('id'); var as=id; swal({ title: 'Remarks', input: 'text', showCancelButton: true, confirmButtonText: 'Submit', showLoaderOnConfirm: true, }).then(function (email) { $.ajax({ //alert(email); url:"<?php echo base_url('packing_list/add_yes_confirmation')?>", type:"POST", data:{'id':id,'remarks':email}, success:function(data){ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); }) } else if (confirmMsg==false) { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } } }); } else { $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); swal({ title: "You Don't Have Access For This Approval", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } // function sku_preview() // { // var as= $('#refe_ids').val(); // if(as == '') // { // swal({ // title: "Plese select Invoice", // text: "", // }); // } // else // { // var as= $('#refe_ids').val(); // $.ajax({ // type:'post', // url:'<?php echo base_url("packing_list/pkg_details_approve_preview"); ?>', // data:{'as':as}, // async:false, // success:function(data) // { // var objdata = jQuery.parseJSON(data); // var obj_fetch= objdata.fetch; // var obj_fetch_emp= objdata.emp_details; // //window.location.href = '<?php echo base_url('packing_list/generate_sku_buyer_invoice');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/generate_sku_buyer_invoice');?>/'+ '?id='+as,'_blank'); // // } // // else // // { // // swal({ // // title: "Please approve the stock", // // text: "", // // }); // // } // } // }); // } // } function Preview_fun(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#box_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_list_box_details"); ?>', data:{'as':as}, async:false, success:function(data) { //window.location.href = '<?php echo base_url('packing_list/pkg_list_box_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_list_box_details');?>/'+ '?id='+as,'_blank'); } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function pc_fun(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#pc_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_list_piece_card"); ?>', data:{'as':as}, async:false, success:function(data) { // window.location.href = '<?php echo base_url('packing_list/pkg_list_piece_card');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_list_piece_card');?>/'+ '?id='+as,'_blank'); } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } // function generate_invoice_sku_fun(rowId) // { // var id = rowId.closest('tr').attr('id'); // var as=id; // //var v=$('#invoice_id').val(); // // if(v == 1) // //{ // $.ajax({ // type:'post', // url:'<?php echo base_url("packing_list/pkg_details_approve_preview"); ?>', // data:{'as':as}, // async:false, // success:function(data) // { // var objdata = jQuery.parseJSON(data); // var obj_fetch= objdata.fetch; // var obj_fetch_emp= objdata.emp_details; //window.location.href = '<?php echo base_url('packing_list/generate_sku_buyer_invoice');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/generate_sku_buyer_invoice');?>/'+ '?id='+as,'_blank'); // } // else // { // swal({ // title: "Please approve the stock", // text: "", // }); // } // } // }); //} // else // { // swal({ // title: "You Don't Have Access For This Preview", // text: "", // }); //} // } function fun_edit_val(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#invoice_edit').val(); var vv=$('#designation').val(); if(v == 1 || vv == 'Super Admin' || vv == 'Admin') { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_edit_val"); ?>', data:{'as':as}, async:false, success: function (data) { var objdata = jQuery.parseJSON(data); var obj_fetch_emp= objdata.emp_details; var fetch_res= objdata.fetch; if(fetch_res.confirm == 'Yes') { swal({ title: "This Stock Is Approved, You Can't Edit This", text: "", }); } else { // if(obj_fetch_emp.designation == 'Super Admin' || obj_fetch_emp.designation == 'Admin' || fetch_res.edited == 'No') // { var obj = objdata.invoice_data; var objj = objdata.fetch; // alert(objj.discount); $('#discount').val(objj.discount); $('#other_charges_val').val(objj.other_charges_des); $('#other_chares').val(objj.other_charges); $('#total_values').val(objj.total_value); var content = ''; $('#dynamicTbody').empty(); var i=1; var tot_val_res=0; $.each(obj,function(key,val1){ tot_val_res += parseFloat(val1.values_es); var ar_new=objdata.desc_data[key]; //alert(ar_new.description); if(val1.description == '') { if(ar_new == '' || ar_new == 'undefined') { content += '<tr id="rowCount1" class="rowCount">'; content += '<td colspan="11"><input type="text" name="" id="" class="form-control desc" /></td>'; content += '</tr>'; } else { content += '<tr id="rowCount1" class="rowCount">'; content += '<td colspan="11"><input type="text" name="" id="" class="form-control desc" value="'+ar_new.description+'" /></td>'; content += '</tr>'; } } else { content += '<tr id="rowCount1" class="rowCount">'; content += '<td colspan="11"><input type="text" name="" id="" class="form-control desc" value="'+val1.description+'" /></td>'; content += '</tr>'; } // alert(val1.customer_name); content += '<tr id="rowCount1" class="rowCount">'; content += '<td><input type="text" name="ourShade[1]" id="" class="form-control" value="'+i+'" /></td>'; content += '<td><input type="text" name="ourShade[1]" id="" class="form-control" value="'+val1.skuno+'" /></td>'; content += '<td><input type="text" name="ourShade[1]" id="" class="form-control" value="'+val1.buyershade+'" /></td>'; // content += '<td><input type="text" name="ourShade[1]" id="" class="form-control" value="'+val1.customer_name+'" /></td>'; content += '<td ><input type="hidden" name="refe_idsr[]" class="form-control refe_idsr" value="'+val1.id+'" readonly/><input type="text" name="po[]" id="" class="form-control" value="'+val1.article+'" readonly/></td>'; var test = val1.width.replace(/"/g, '"'); content += '<td><input type="text" name="ssl_pc_no[]" id="" class="form-control" value="'+test+'" readonly/></td>'; content += '<td><input type="text" name="ourShade[1]" id="" class="form-control" value="'+val1.design+'" readonly/></td>'; content += '<td><input type="text" name="ourShade[1]" id="" class="form-control" value="'+val1.shades+'" readonly /></td>'; content += '<td><input type="text" name="ourShade[1]" id="" class="form-control stock_q'+i+'" value="'+val1.stock_wt+'" readonly/></td>'; content += '<td><input type="text" name="ourShade[1]" id="" class="form-control" value="'+val1.stock_qty+'" readonly/></td>'; content += '<td><input type="text" name="units[]" id="" class="form-control uuu stock_u'+i+'" value="'+val1.unitprice+'" onkeyup="dyeing_unitvalue(this.value,'+i+')" /></td>'; content += '<td><input type="text" name="values[]" id="" class="form-control values_res stock_v'+i+'" value="'+val1.values_es+'" readonly /></td>'; // content += '<td><select class="form-control cure" ><option value="'+val1.currency+'"> '+val1.currency+' </option><option value="USD"> USD </option><option value="GBP"> GBP </option><option value="EUR"> EUR </option><option value="CHF"> CHF </option><option value="INR"> INR </option></select></td>'; if(key == 0) { content += '<td><select class="form-control cure first_currency" onchange="currency_change();"><option value="'+val1.currency+'"> '+val1.currency+' </option><option value="USD"> USD </option><option value="GBP"> GBP </option><option value="EUR"> EUR </option><option value="CHF"> CHF </option><option value="INR"> INR </option></select></td>'; } else { content += '<td><select class="form-control cure second_curreny" ><option value="'+val1.currency+'"> '+val1.currency+' </option><option value="USD"> USD </option><option value="GBP"> GBP </option><option value="EUR"> EUR </option><option value="CHF"> CHF </option><option value="INR"> INR </option></select></td>'; } if(key == 0) { content += '<td><select class="form-control con_type" onchange="contract_change()"><option value="'+val1.contarct_type+'">'+val1.contarct_type+'</option><option value="C&F"> C&F </option><option value="C&I"> C&I </option><option value="CIF">CIF</option>'; content += '<option value="CIF THRU FEDEX">CIF THRU FEDEX</option><option value="FOB">FOB</option><option value="FOB+FRT">FOB+FRT</option><option value="FOB+INS">FOB+INS</option><option value="FOB ICD BENGALURU">FOB ICD BENGALURU</option>'; content += '<option value="FOB CHENNAI">FOB CHENNAI</option><option value="FOB BENGALURU AIRPORT">FOB BENGALURU AIRPORT</option><option value="FOB TUTICORIN">FOB TUTICORIN</option><option value="FOB MUMBAI">FOB MUMBAI</option>'; content += '<option value="EXW BENGALURU">EXW BENGALURU</option><option value="CIF ICD BENGALURU">CIF ICD BENGALURU</option><option value="CIF CHENNAI">CIF CHENNAI</option><option value="CIF BENGALURU AIRPORT">CIF BENGALURU AIRPORT</option>'; content += '<option value="CIF TUTICORIN">CIF TUTICORIN</option><option value="CIF MUMBAI">CIF MUMBAI</option><option value="C&F ICD BENGALURU">C&F ICD BENGALURU</option><option value="C&F CHENNAI">C&F CHENNAI</option>'; content += '<option value="C&F BENGALURU AIRPORT">C&F BENGALURU AIRPORT</option><option value="C&F TUTICORIN">C&F TUTICORIN</option><option value="C&F MUMBAI">C&F MUMBAI</option><option value="C&I ICD BENGALURU">C&I ICD BENGALURU</option>'; content += '<option value="C&I CHENNAI">C&I CHENNAI</option><option value="C&I BENGALURU AIRPORT">C&I BENGALURU AIRPORT</option><option value="C&I TUTICORIN">C&I TUTICORIN</option>'; content += '<option value="C&I MUMBAI">C&I MUMBAI</option><option value="OTHERS">OTHERS</option></select></td>'; } else { content += '<td><select class="form-control con_type contract_types" readonly="readonly"><option value="'+val1.contarct_type+'">'+val1.contarct_type+'</option><option value="C&F"> C&F </option><option value="C&I"> C&I </option><option value="CIF">CIF</option>'; content += '<option value="CIF THRU FEDEX">CIF THRU FEDEX</option><option value="FOB">FOB</option><option value="FOB+FRT">FOB+FRT</option><option value="FOB+INS">FOB+INS</option><option value="FOB ICD BENGALURU">FOB ICD BENGALURU</option>'; content += '<option value="FOB CHENNAI">FOB CHENNAI</option><option value="FOB BENGALURU AIRPORT">FOB BENGALURU AIRPORT</option><option value="FOB TUTICORIN">FOB TUTICORIN</option><option value="FOB MUMBAI">FOB MUMBAI</option>'; content += '<option value="EXW BENGALURU">EXW BENGALURU</option><option value="CIF ICD BENGALURU">CIF ICD BENGALURU</option><option value="CIF CHENNAI">CIF CHENNAI</option><option value="CIF BENGALURU AIRPORT">CIF BENGALURU AIRPORT</option>'; content += '<option value="CIF TUTICORIN">CIF TUTICORIN</option><option value="CIF MUMBAI">CIF MUMBAI</option><option value="C&F ICD BENGALURU">C&F ICD BENGALURU</option><option value="C&F CHENNAI">C&F CHENNAI</option>'; content += '<option value="C&F BENGALURU AIRPORT">C&F BENGALURU AIRPORT</option><option value="C&F TUTICORIN">C&F TUTICORIN</option><option value="C&F MUMBAI">C&F MUMBAI</option><option value="C&I ICD BENGALURU">C&I ICD BENGALURU</option>'; content += '<option value="C&I CHENNAI">C&I CHENNAI</option><option value="C&I BENGALURU AIRPORT">C&I BENGALURU AIRPORT</option><option value="C&I TUTICORIN">C&I TUTICORIN</option>'; content += '<option value="C&I MUMBAI">C&I MUMBAI</option><option value="OTHERS">OTHERS</option></select></td>'; } content += '<td><input type="text" name="hsn[]" id="" class="form-control hsn hsncode'+i+'" value="'+val1.hsn_code+'" /></td>'; content += '</tr>'; i=i+1; }); if(objj.other_charges==0){ $('#total_values').val(tot_val_res); } $("#dynamicTbody").html(content); $('#content_modal').modal('show'); // } // else // { // swal({ // title: "You Don't Have Access For This To Edit", // text: "", // }); // } } } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } function currency_change() { var v=$('.first_currency').val(); $('.second_curreny').val(v); } function contract_change() { var c=$('.con_type').val(); //alert(c); $('.contract_types').val(c); //$('.contract_types option[value!="'+c+'"]').remove(); } function discount_value() { var dis=$('#discount').val(); var other_c=$('#other_chares').val(); var tot=0; $('.values_res').each(function () { var tots=$(this).val(); tot +=parseFloat(tots); //alert(tot); }); var tot_val=parseFloat(tot) - parseFloat(dis); var tot_value=parseFloat(tot_val) + parseFloat(other_c); $('#total_values').val(parseFloat(tot_value)); } function other_value() { var dis=$('#discount').val(); var other_c=$('#other_chares').val(); var tot=0; $('.values_res').each(function () { var tots=$(this).val(); tot +=parseFloat(tots); //alert(tot); }); var tot_val=parseFloat(tot) - parseFloat(dis); var tot_value=parseFloat(tot_val) + parseFloat(other_c); $('#total_values').val(parseFloat(tot_value)); } function dyeing_unitvalue(str,i) { var quty_kgs =$('.stock_q'+i).val(); //alert(quty_kgs); var rate_inr =$('.stock_u'+i).val(); var inr_val = parseFloat(quty_kgs) * parseFloat(rate_inr); $('.stock_v'+i).val(inr_val.toFixed(2)); var tot=0; $('.values_res').each(function () { var tots=$(this).val(); tot +=parseFloat(tots); //alert(tot); }); var dis=$('#discount').val(); var other_c=$('#other_chares').val(); var tot_val=parseFloat(tot) - parseFloat(dis); var tot_value=parseFloat(tot_val) + parseFloat(other_c); $('#total_values').val(parseFloat(tot_value)); } </script> <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> <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> r_ids=[]; val_res=[]; unit_p=[]; currency=[]; contract_type=[]; descr=[]; hsn=[]; function content_goods_details() { r_ids.length=0; val_res.length=0; $('.refe_idsr').each(function () { r_ids.push($(this).val()); }); $('.values_res').each(function () { val_res.push($(this).val()); }); $('.uuu').each(function () { unit_p.push($(this).val()); }); $('.cure').each(function () { currency.push($(this).val()); }); $('.con_type').each(function () { contract_type.push($(this).val()); }); $('.hsn').each(function () { hsn.push($(this).val()); }); $('.desc').each(function () { descr.push($(this).val()); }); var dis=$('#discount').val(); var discount_name=$('#discount_name').val(); var charges_des=$('#other_charges_val').val(); var charges_val=$('#other_chares').val(); var tot_val=$('#total_values').val(); $.ajax({ type:'post', url:'<?php echo base_url("packing_list/packing_list_edit_val"); ?>', data:{'discount_name':discount_name,'dis':dis,'charges_des':charges_des,'charges_val':charges_val,'tot_val':tot_val,'val_res':val_res,'r_ids':r_ids,'unit_p':unit_p,'currency':currency,'contract_type':contract_type,'hsn':hsn,'descr':descr}, async:false, success:function(data) { $('#content_modal').modal('toggle'); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); // } } </script> <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'); ?>', }); }); 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 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> <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:640px){ .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 !important; 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> <script type="text/javascript"> function shipping_bill_preview() { var as= $('#refe_ids').val(); /* var v = $('#'+as).closest('#'+as).find('input:checkbox').attr('value'); if(v=='yes'){*/ if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { $.ajax({ url:"<?php echo site_url('packing_list/fabric_list_shipment_get_details')?>", type:"POST", data:{'id':as}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { $('#view_shipment_details').modal('show'); $('.invoice_date2').val(response.message.sys_date); $('.invoice_no2').val(response.message.invoice_num); $('.customer_id2').val(response.message.customer_name); $('.inr_value2').val(response.message.payment_inr_value); $('.currency2').val(response.message2.currency); $('.cuustomer_ex_rate2').val(response.message.shipping_customs_ex_rate); $('.inr_value2').val(response.message.shipping_customs_inr_val); $('.shipping_date2').val(response.message.shipping_bill_date); $('.shipping_num2').val(response.message.shipping_bill_num); $('.port_code2').val(response.message.shipping_port_code); $('.user_name2').val(response.message.payment_approved_by); $('.invoice_value2').val(response.message.total_value); } else { swal({ title: "No Data Found", text: "", }); } } }); //window.location.href = '<?php echo base_url('packing_list/shipping_bill_preview');?>/'+ '?id='+as; } /*}else { swal({ title: "Plese select Invoice", text: "", }); }*/ } function payments() { var as= $('#refe_ids').val(); //var id = rowId.closest('tr').attr('id'); var v = $('#'+as).closest('#'+as).find('input:checkbox').attr('value'); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { $.ajax({ url:"<?php echo site_url('packing_list/fabric_list_payment_get_details')?>", type:"POST", data:{'id':as}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { if(response.message.total_value == 0) { var tot= parsereFloat(response.message2.values_es)+parsereFloat(other_charges); } else if(response.message.discount == 0 && response.message.other_charges_des == 0) { var tot= parsereFloat(response.message2.values_es)+parsereFloat(other_charges); } else { //var v=response.message.discount; //var s=response.message.total_value; var tot=response.message.total_value; } $('#view_payment_details').modal('show'); $('.received_date1').val(response.message.payment_received_date); $('.amount_received1').val(response.message.payment_amount_received); $('.bank_realisation_rate1').val(response.message.payment_bank_realisation_rate); $('.bank_reference1').val(response.message.bank_reference); $('.inr_value1').val(response.message.payment_inr_value); $('.remark1').val(response.message.payment_remark); var res = response.message.payment_created_date.split("-"); var date=res[2]+'-'+res[1]+'-'+res[0]; $('.created1').val(date); $('.user_name1').val(response.message.payment_approved_by); $('.bank_charged1').val(response.message.payment_bank_charged); $('.invoice_no1').val(response.message.invoice_num); $('.customer_id1').val(response.message.customerID); $('.invoice_date1').val(response.message.sys_date); $('.invoice_value1').val(tot); $('.currency1').val(response.message2.currency); } else { swal({ title: "No Data Found", text: "", }); } } }); } } </script>