EVOLUTION-NINJA
Edit File: dtl_shipment_madeups.php
<style> .cure { width: 75px; } .modal_content_id { width: 246%; margin-left: -410px; } </style> <div class="page-content-wrapper"> <div class="page-content"> <!-- BEGIN PAGE HEADER--> <h3 class="page-title"> Madeups DTL Shipping </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 Madeups </a></li> </ul> </div> <?php if(empty($access_row)) { } else { if($access_row->insert_id == '1') { ?> <form action="<?php echo base_url(); ?>packing_list/madeups_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 } }?> <!--<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="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" style="margin-left: 5px;" onclick="consignee_preview()" value="Consignee" />--> <!--<input type="button" name="co" style="margin-left: 5px;" onclick="co_preview()" value="CO" />--> <!--<input type="button" name="co" style="margin-left: 5px;" onclick="export_preview()" value="Export Doc" />--> <!--<input type="button" name="co" style="margin-left: 5px;" 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="button" name="co" onclick="box_list()" value="Box List" />--> <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="preview_id" class="preview_id" value="<?php if(empty($access_row)){ } else { echo $access_row->preview_id; } ?>" > <input type="hidden" id="cancel_id" class="cancel_id" value="<?php if(empty($access_row)){ } else { echo $access_row->cancel_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="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="pkl_id" class="pkl_id" value="<?php if(empty($access_row)){ } else { echo $access_row->pkl_id; } ?>" > <input type="hidden" id="designation" class="designation" value="<?php echo $emp_details->designation; ?>" > <!--<input type="hidden" value="<?php echo $ref; ?>" id="ref_id" >--> <!--<input type="hidden" value="<?php echo $url_val; ?>" id="url_ref" style="width: 230px;" >--> <input type="hidden" id="refe_ids" name="refe_ids" class="refe_ids" > <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" > <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> <!------------------------------------------- Packing Modal --------------------------------------------------------------------------------> <div class="modal fade" id="packing_content_modal" role="dialog" > <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content modal_content_id" id="modal_content_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"> <table class="" border="1" width="100%" style="border-spacing:0;margin-top: 1%;" cellpadding="5px"> <tr> <th>SL No.</th> <th>DTL No</th> <th>Customer Order #</th> <th>DTL Shade</th> <th>Buyer Shade</th> <th>Batch#</th> <th>Size</th> <th>Article</th> <th>Stock Qty</th> <th>Exp Qty</th> <th>Order Type</th> <th>SKU#</th> </tr> <tbody id="packing_dynamicTbody" > </tbody> </table> </div> </div><!--row 1 end--> <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> <!-------------------------------------------------------------- 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" > <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">×</button> <h4 class="modal-title">Invoice 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%;" id="invoice_table" 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>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: 130px; border: tan; font-weight: bold;"> </b></label> <div class="col-sm-10"> <input type="text" style="margin-left: 90px;" name="discount" id="discount" onkeyup="discount_value()" value="0" class="form-control"> </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 Value </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> <!-- End BEGIN CONTAINER --> <!-- 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_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> <!------------------------------------------------------------> <!-- 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> <!------> <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 --> <!-- 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> .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) { } </style> <!-----------------datepicker-------------> <!-- The link to the CSS that the grid needs --> <script> $(document).ready(function (){ 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/dtl_madeups_list_grid_data')?>/"+fileNo+"/"+orders_Type+"/"+orders_id, datatype: "json", colNames:['Id','Invoice No','Date','Customer ID','Customer Name','Unit','Buyer Order#','DTL#','Size','Article','Design','Shade','Qty','Price','Currency','Terms','Order Type'], colModel:[ {name:'id',index:'id',hidden:true, width:100,editable:true}, {name:'invoice',index:'invoice', 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:'osl_no',index:'osl_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:'buyershade',index:'buyershade', editable:true,editrules:{required: true},width:170}, {name:'stock_qty',index:'stock_qty', 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}, {name:'ordertype',index:'ordertype', 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, onSelectRow: function(id){ if(id && id!==ll){ jQuery('#list2').jqGrid('restoreRow',ll); jQuery('#list2').jqGrid('editRow',id,true);ll=id; } }, editurl: "<?php echo base_url('packing_list/edit_madeups_note');?>", autowidth: true, sortorder:"asc", loadonce:true, caption:"Madeups Recent Shipping", footerrow: true, loadComplete: function () { var sumOfqnty = jQuery("#list2").jqGrid('getCol','stock_qty',false,'sum'); jQuery("#list2").jqGrid('footerData', 'set', {buyershade: 'Total Qty:', stock_qty: sumOfqnty}); }, subGrid: true, subGridRowExpanded: function(subgrid_id, row_id) { var subgrid_table_id; swan_id=row_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/madeups_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:400,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 airway_preview() { var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_airway_details"); ?>', data:{'as':as}, async:false, success:function(data) { //window.location.href = '<?php echo base_url('packing_list/pkg_madeups_airway_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_airway_details');?>/'+ '?id='+as,'_blank'); } }); } } function nd_preview() { var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_nd_details"); ?>', data:{'as':as}, async:false, success:function(data) { // window.location.href = '<?php echo base_url('packing_list/pkg_madeups_nd_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_nd_details');?>/'+ '?id='+as,'_blank'); } }); } } function box_list() { var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_box_details"); ?>', data:{'as':as}, async:false, success:function(data) { //window.location.href = '<?php echo base_url('packing_list/pkg_madeups_box_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_box_details');?>/'+ '?id='+as,'_blank'); } }); } } function azo_preview() { var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_azo_details"); ?>', data:{'as':as}, async:false, success:function(data) { // window.location.href = '<?php echo base_url('packing_list/pkg_madeups_azo_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_azo_details');?>/'+ '?id='+as,'_blank'); } }); } } function us_preview() { var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_us_details"); ?>', data:{'as':as}, async:false, success:function(data) { //var objdata = jQuery.parseJSON(data); //var obj_fetch= objdata.fetch; // if(obj_fetch.confirm == 'Yes') // window.location.href = '<?php echo base_url('packing_list/pkg_madeups_us_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_us_details');?>/'+ '?id='+as,'_blank'); } }); } } function fun_radio_val(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $('#refe_ids').val(as); } function export_preview() { var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { var exports= $('#export_doc_id').val(); if(exports == 1) { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/madeups_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') { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_export_details"); ?>', data:{'as':as}, async:false, success:function(data) { //window.location.href = '<?php echo base_url('packing_list/pkg_madeups_export_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_export_details');?>/'+ '?id='+as,'_blank'); } }); } else { swal({ title: "This Stock Is Not Yet Approved, Please Approve First", text: "", }); } } }); } else { swal({ title: "You Don't Have Access", text: "", }); } } } function export_preview2() { var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { var exports= $('#export_doc_id2').val(); if(exports == 1) { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/madeups_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') { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_export_details2"); ?>', data:{'as':as}, async:false, success:function(data) { //window.location.href = '<?php echo base_url('packing_list/pkg_madeups_export_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_export_details2');?>/'+ '?id='+as,'_blank'); } }); } else { swal({ title: "This Stock Is Not Yet Approved, Please Approve First", text: "", }); } } }); } else { swal({ title: "You Don't Have Access", text: "", }); } } } function exportss_preview() { var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_export_details"); ?>', data:{'as':as}, async:false, success:function(data) { //var objdata = jQuery.parseJSON(data); //var obj_fetch= objdata.fetch; // if(obj_fetch.confirm == 'Yes') //window.location.href = '<?php echo base_url('packing_list/pkg_madeups_export_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_export_details');?>/'+ '?id='+as,'_blank'); } }); } } function co_preview() { var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_co_details"); ?>', data:{'as':as}, async:false, success:function(data) { //var objdata = jQuery.parseJSON(data); //var obj_fetch= objdata.fetch; // if(obj_fetch.confirm == 'Yes') // window.location.href = '<?php echo base_url('packing_list/pkg_madeups_co_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_co_details');?>/'+ '?id='+as,'_blank'); } }); } } function consignee_preview() { var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_consignee_details"); ?>', data:{'as':as}, async:false, success:function(data) { //var objdata = jQuery.parseJSON(data); //var obj_fetch= objdata.fetch; // if(obj_fetch.confirm == 'Yes') //window.location.href = '<?php echo base_url('packing_list/pkg_madeups_consignee_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_consignee_details');?>/'+ '?id='+as,'_blank'); } }); } } function generate_sku_invoice_fun(rowId) { var v=$('#invoice_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/madeups_generate_weight_note1"); ?>', 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') // { // window.location.href = '<?php echo base_url('packing_list/madeups_sku_generate_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/madeups_sku_generate_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_airway_preview(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; //var v=$('#preview_id').val(); //if(v == 1) //{ $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_airway_details"); ?>', data:{'as':as}, async:false, success:function(data) { //var objdata = jQuery.parseJSON(data); //var obj_fetch= objdata.fetch; // if(obj_fetch.confirm == 'Yes') //window.location.href = '<?php echo base_url('packing_list/pkg_madeups_airway_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_airway_details');?>/'+ '?id='+as,'_blank'); } }); //} // else //{ // swal({ //title: "You Don't Have Access For This Preview", //text: "", //}); // } } function fun_nd_preview(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; //var v=$('#preview_id').val(); //if(v == 1) //{ $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_nd_details"); ?>', data:{'as':as}, async:false, success:function(data) { //var objdata = jQuery.parseJSON(data); //var obj_fetch= objdata.fetch; // if(obj_fetch.confirm == 'Yes') //window.location.href = '<?php echo base_url('packing_list/pkg_madeups_nd_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_nd_details');?>/'+ '?id='+as,'_blank'); } }); //} // else //{ // swal({ //title: "You Don't Have Access For This Preview", //text: "", //}); // } } function fun_azo_preview(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; //var v=$('#preview_id').val(); //if(v == 1) //{ $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_azo_details"); ?>', data:{'as':as}, async:false, success:function(data) { //var objdata = jQuery.parseJSON(data); //var obj_fetch= objdata.fetch; // if(obj_fetch.confirm == 'Yes') // window.location.href = '<?php echo base_url('packing_list/pkg_madeups_azo_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_azo_details');?>/'+ '?id='+as,'_blank'); } }); //} // else //{ // swal({ //title: "You Don't Have Access For This Preview", //text: "", //}); // } } ////////////////////////////// cancel //////////////////////////////////////////////////// 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/madeups_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) { // swal({ // title: 'Remarks', // input: 'text', // showCancelButton: true, // confirmButtonText: 'Submit', // showLoaderOnConfirm: true, // }).then(function (email) { var c=$('#unship_id').val(); if(c == 1) { $.ajax({ url:"<?php echo base_url('packing_list/add_madeups_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 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_madeups_ship_yes_confirmation')?>", type:"POST", data:{'id':id}, success:function(data){ $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); */ //window.location.href = '<?php echo base_url('packing_list/madeups_shipping_bill_preview');?>/'+ '?id='+id; window.open('<?php echo base_url('packing_list/madeups_shipping_bill_preview');?>/'+ '?id='+id,'_blank'); $("#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 { $("#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/madeups_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.payment == 'Yes') { var id = rowId.closest('tr').attr('id'); //alert(id); var confirmMsg= confirm("This Invoice Is Already Payed. Do You Want To Unpay This!"); if (confirmMsg==true) { // swal({ // title: 'Remarks', // input: 'text', // showCancelButton: true, // confirmButtonText: 'Submit', // showLoaderOnConfirm: true, // }).then(function (email) { var c=$('#unpay_id').val(); if(c == 1) { $.ajax({ url:"<?php echo base_url('packing_list/add_madeups_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!"); 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_madeups_pay_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/madeups_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 Unpay This!"); if (confirmMsg==true) { // swal({ // title: 'Remarks', // input: 'text', // showCancelButton: true, // confirmButtonText: 'Submit', // showLoaderOnConfirm: true, // }).then(function (email) { var c=$('#unpay_id').val(); if(c == 1) { $.ajax({ url:"<?php echo base_url('packing_list/add_madeups_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.confirm == 'Yes') { 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({ url:"<?php echo site_url('packing_list/madeups_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); $('.customer_id').val(response.message.customer_name); $('.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: "", }); } } }); $("#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'); } } $(".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_madeups_pay_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/madeups_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_madeups_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_madeups_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 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_madeups_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_madeups_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 cancel_fun(rowId) { var v=$('#cancel_id').val(); if(v == 1) { var id = rowId.clos var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("packing_list/madeups_generate_weight_note1"); ?>', 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; //alert(obj_fetch.confirm); if(obj_fetch.confirm == 'No' || obj_fetch.confirm == '') { var confirmMsg= confirm("Do You Want To Cancel!"); 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/cancel_fun')?>", type:"POST", data:{'id':id,'remarks':email}, success:function(data){ // $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); window.location.reload(); } }); swal({ type: 'success', // title: 'Approved By', // html: '' + email }) window.location.reload(); }) } 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(); } else{ } } }); } } else { swal({ title: "This stock is Already Approved, You Can't Cancel this Stock", text: "", }); } } }); } else { swal({ title: "You Don't Have Access For This Cancellation", text: "", }); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } } //////////////////////////////////////////////////////////////////////// packing editing //////////////////////////////////////////////////////////////////////////////////// function fun_pkg_edit_val(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#pack_edit').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/madeups_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/madeups_packing');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/madeups_packing');?>/'+ '?id='+id,'_blank'); } } }); } else { swal({ title: "You Don't Have Access For This Edit", text: "", }); } } //////////////////////////////////////////////////////////////////////// BOX EDIT///////////////////////////////////////////////////////////////////////////// function box_list(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#pack_edit').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/madeups_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 { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_madeups_box_details"); ?>', data:{'as':id}, async:false, success:function(data) { //window.location.href = '<?php echo base_url('packing_list/pkg_madeups_box_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_madeups_box_details');?>/'+ '?id='+as,'_blank'); } }); } } }); } else { swal({ title: "You Don't Have Access For This Edit", 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/madeups_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') // { var obj = objdata.invoice_data; var objj = objdata.fetch; $('#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 updated_tot_val=objj.total_value var content = ''; $('#dynamicTbody').empty(); var i=1; var tot_val_res=0; var total_qty_val=0; $.each(obj,function(key,val1){ // alert(val1.buyer_orderno); tot_val_res += parseFloat(val1.values_es); // var marketing=objdata.marketing[key]; var stock_qty = parseFloat(val1.stock_qty); var unitprice = parseFloat(val1.unitprice); if(unitprice == '' || unitprice == 'NAN') { var unitprice =0; var total_qty_val= 0.00; } else { var total_qty_val= parseFloat(stock_qty) * parseFloat(unitprice); } var ar_new=objdata.inv_dess[key]; var marketing=objdata.marketing[key]; // alert(val1.width); if(val1.description == '') { if(!marketing) { 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="'+marketing.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>'; } 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="skuno[1]" id="" class="form-control" onfocusout="skuchange(this.value,'+val1.made_id+')" value="'+val1.skuno+'" /></td>'; content += '<td><input type="text" name="ourShade[1]" id="" class="form-control" value="'+val1.orderNo+'" /></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.buyershade+'" readonly /></td>'; content += '<td><input type="text" name="ourShade[1]" id="" class="form-control stock_q'+i+'" value="'+val1.stock_qty+'" readonly/></td>'; if(val1.unitprice == '' || val1.unitprice == 'NAN') { content += '<td><input type="text" name="units[]" id="" class="form-control uuu stock_u'+i+'" value="<?php echo '0'; ?>" onkeyup="dyeing_unitvalue(this.value,'+i+')" /></td>'; } else { 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="'+total_qty_val+'" readonly /></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>'; } // 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>'; content += '<td><select class="form-control con_type con_type_val" onchange="contarct_type_change();"><option value="'+val1.contarct_type+'">'+val1.contarct_type+'</option><option value="C&F"> C&F </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>'; content += '<td><input type="text" name="hsn[]" id="" class="form-control hsn hsncode'+i+'" value="'+val1.hsn_code+'" /></td>'; content += '</tr>'; i=i+1; }); //$('#total_values').val(tot_val_res); $('#total_values').val(updated_tot_val); $("#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 Edit", text: "", }); } } function currency_change() { var v=$('.first_currency').val(); $('.second_curreny').val(v); } 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/madeups_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_madeups_export_details2"); ?>', data:{'as':as}, async:false, success:function(data) { $.ajax({ url:"<?php echo site_url('packing_list/madeups_list_shipment_get_details')?>", type:"POST", data:{'id':as}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { 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/madeups_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 contarct_type_change() { var v=$('.con_type').val(); $('.con_type_val').val(v); } // function generate_weight_fun(rowId) // { // var v=$('#pkl_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/madeups_generate_weight_note1"); ?>', // 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/madeups_generate_weight_note');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '2') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '3') // { // // window.location.href = '<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '4') // { // // window.location.href = '<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?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_details_preview(rowId) // { // var id = rowId.closest('tr').attr('id'); // var as=id; // var v=$('#details_id').val(); // if(v == 1) // { // $.ajax({ // type:'post', // url:'<?php echo base_url("packing_list/madeups_details_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('packing_list/madeups_details_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_details_preview');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '2') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_details_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_details_preview');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '3') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_details_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_details_preview');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '4') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_details_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_details_preview');?>/'+ '?id='+as,'_blank'); // } // } // }); // } // else // { // swal({ // title: "You Don't Have Access For This Preview", // text: "", // }); // } // } 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)); } function skuchange(sku,made_id) { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/madeups_updatesku"); ?>', data:{'sku':sku,'made_id':made_id}, async:false, success:function() { } }); } 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 fun_preview(rowId) // { // var id = rowId.closest('tr').attr('id'); // var as=id; // var v=$('#preview_id').val(); // if(v == 1) // { // $.ajax({ // type:'post', // url:'<?php echo base_url("packing_list/madeups_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('packing_list/madeups_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_preview');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '2') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_packing_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_packing_preview');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '3') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_packing_view');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_packing_view');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '4') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_packing_details');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_packing_details');?>/'+ '?id='+as,'_blank'); // } // } // }); // } // else // { // swal({ // title: "You Don't Have Access For This Preview", // text: "", // }); // } // } // 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/madeups_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('packing_list/madeups_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_preview');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '2') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_packing_preview');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_packing_preview');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '3') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_packing_view');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_packing_view');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '4') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_packing_details');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_packing_details');?>/'+ '?id='+as,'_blank'); // } // } // }); // } // 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(); alert(as); var v=$('#invoice_id').val(); if(v == 1) { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/madeups_generate_weight_note1"); ?>', 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') // { //window.location.href = '<?php echo base_url('packing_list/madeups_generate_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/madeups_generate_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 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/madeups_generate_weight_note1"); ?>', 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') // { //window.location.href = '<?php echo base_url('packing_list/madeups_gst_generate_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/madeups_gst_generate_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 b_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/madeups_generate_weight_note1"); ?>', 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') // { //window.location.href = '<?php echo base_url('packing_list/madeups_buyer_generate_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/madeups_buyer_generate_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 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/madeups_generate_weight_note1"); ?>', 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') // { //window.location.href = '<?php echo base_url('packing_list/madeups_sku_generate_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/madeups_sku_generate_invoice');?>/'+ '?id='+as,'_blank'); // } // else // { // swal({ // title: "Please approve the stock", // text: "", // }); // } } }); } } // function pl_preview() // { // var as= $('#refe_ids').val(); // if(as == '') // { // swal({ // title: "Plese select Invoice", // text: "", // }); // } // else // { // var as= $('#refe_ids').val(); // var v=$('#pkl_id').val(); // if(v == 1) // { // $.ajax({ // type:'post', // url:'<?php echo base_url("packing_list/madeups_generate_weight_note1"); ?>', // 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/madeups_generate_weight_note');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '2') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '3') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as,'_blank'); // } // else if(url_r == '4') // { // //window.location.href = '<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as; // window.open('<?php echo base_url('packing_list/madeups_generate_weight_note');?>/'+ '?id='+as,'_blank'); // } // // else // // { // // swal({ // // title: "Please approve the stock", // // text: "", // // }); // // } // } // }); // } // else // { // swal({ // title: "You Don't Have Access For This Preview", // text: "", // }); // } // } // } function generate_buyer_invoice_fun(rowId) { var v=$('#invoice_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/madeups_generate_weight_note1"); ?>', 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') // { //window.location.href = '<?php echo base_url('packing_list/madeups_buyer_generate_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/madeups_buyer_generate_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 generate_invoice_fun(rowId) { var v=$('#invoice_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/madeups_generate_weight_note1"); ?>', 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') // { //window.location.href = '<?php echo base_url('packing_list/madeups_generate_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/madeups_generate_invoice');?>/'+ '?id='+as,'_blank'); // } // else // { // swal({ // title: "Please approve the stock", // text: "", // }); // } } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } </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> <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 src="https://cdnjs.cloudflare.com/ajax/libs/colresizable/1.6.0/colResizable-1.6.min.js" integrity="sha512-pMZ2rgWRGMywzbRAVwGk+auTREN0ldKKjACUSB4cneTgD3kn/6pu//Lxi4l8xSRkY83HENr1vztTnGDySWs0Mg==" crossorigin="anonymous"></script> <script> $("#invoice_table").colResizable({ liveDrag:true, gripInnerHtml:"<div class='grip'></div>", draggingClass:"dragging", resizeMode:'fit' }); $(document).keypress( function(event){ if (event.which == '13') { event.preventDefault(); } }); </script> <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()); }); $('.con_type').each(function () { contract_type.push($(this).val()); }); $('.hsn').each(function () { hsn.push($(this).val()); }); $('.desc').each(function () { descr.push($(this).val()); }); $('.cure').each(function () { currency.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(); alert(tot_val); $.ajax({ type:'post', url:'<?php echo base_url("packing_list/madeups_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,'contract_type':contract_type,'hsn':hsn,'descr':descr,'currency':currency,'unit_p':unit_p}, async:false, success:function(data) { // console.log(data); // return; $('#content_modal').modal('toggle'); $("#list2").jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid'); } }); // } } </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/madeups_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); $('.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.ship_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/madeups_shipping_bill_preview');?>/'+ '?id='+as; } /*}else { swal({ title: "Invoice is not Approved", 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/madeups_list_payment_get_details')?>", type:"POST", data:{'id':as}, success:function(response){ response=jQuery.parseJSON(response); console.log(response); if(response.result==1) { var v=response.message.discount; var s=response.message.total_value; var d=parseFloat(s) - parseFloat(v); $('#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(d.toFixed(2)); $('.currency1').val(response.message2.currency); } else { swal({ title: "No Data Found", text: "", }); } } }); } } </script>