EVOLUTION-NINJA
Edit File: paking_list_grid.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"> Packing List Details </h3> <div class="page-bar"> <ul class="page-breadcrumb"> <li><i class="fa fa-home"></i> <a href="https://swansilk.co/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/customer_packing_list" 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="draft_invoice()" value="DRAFT-Invoice" /> <input type="button" name="co" onclick="c_invoice_preview_gst()" value="C-Invoice GST" /> <input type="button" name="co" onclick="c_invoice_preview()" value="C-Invoice LUT" /> <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="button" name="co" onclick="dbk_func()" value="DBK/RODTEP" /> <input type="button" name="co" onclick="edit_pl()" value="Edit PL" /> <input type="button" name="co" onclick="fun_edit_val()" value="Edit Invoice" /> <input type="button" name="co" onclick="duty_drawack_preview()" value="Duty Drawback" /> <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 $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>HSN Code</th> <th>DBK</th> </tr> </tr> <tbody id="dynamicTbody" > </tbody> </table> </div> </div><!--row 1 end--> <br> <div class="row"> <div class="col-sm-2"> <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-2"> <div class="form-group"> <b><label class="col-sm-6"><b>Currency</b></label></b> <div class="col-sm-6"> <select class="form-control cure first_currency" name = "currency_new" id = "currency_new"> <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> </div> </div> </div> <div class="col-sm-2"> <div class="form-group"> <b><label class="col-sm-4"><b>Custom Ex Rate</b></label></b> <div class="col-sm-8"> <input type="text" name="ex_rate" id="ex_rate" class="form-control" onkeyup = "change_ex_rate()" value="0"> </div> </div> </div> <div class="col-sm-2"> <div class="form-group"> <b><label class="col-sm-4"><b>IGST Rate%</b></label></b> <div class="col-sm-8"> <input type="text" name="igst_rate" id="igst_rate" onkeyup = "change_igst()" class="form-control" value="12"> </div> </div> </div> <div class="col-sm-2"> <div class="form-group"> <b><label class="col-sm-6"><b>Export Under</b></label></b> <div class="col-sm-6"> <select class="form-control cure" name = "expor_under" id = "expor_under"> <option value="GST"> GST </option> <option value="LUT"> LUT </option> </select> </div> </div> </div> </div> <br> <div class="row"> <div class="col-sm-2"> <div class="form-group"> <b><label class="col-sm-12"><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-6"> <input type="text" name="other_chares" id="other_chares" onkeyup="other_value()" class="form-control" value="0"> </div> </div> </div> <div class="col-sm-2"> <div class="form-group"> <b><label class="col-sm-3"><b>Contract Type</b></label></b> <div class="col-sm-9"> <select class="form-control" name = "contract_type_new" id = "contract_type_new"> <option value="C&F">C&F</option> <option value="CIF">CIF</option>'; <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> <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> <option value="FOB NOIDA-UP-INDIA">FOB NOIDA-UP-INDIA</option> <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> <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> <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> <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> <option value="C&I MUMBAI">C&I MUMBAI</option> <option value="OTHERS">OTHERS</option> </select> </div> </div> </div> <div class="col-sm-2"> <div class="form-group"> <b><label class="col-sm-4"><b>Customs INR Value</b></label></b> <div class="col-sm-8"> <input type="text" name="ex_rate_inr" id="ex_rate_inr" class="form-control" value="0" readonly> </div> </div> </div> <div class="col-sm-2"> <div class="form-group"> <b><label class="col-sm-4"><b>IGST INR</b></label></b> <div class="col-sm-8"> <input type="text" name="igst_inr" id="igst_inr" class="form-control" value="0" readonly> </div> </div> </div> <div class="col-sm-2"> <div class="form-group"> <b><label class="col-sm-4"><b>Invoice Value</b></label></b> <div class="col-sm-8"> <input type="text" name="invoice_value" id="invoice_value_new" class="form-control" value="0" readonly> </div> </div> </div> <div class="col-sm-2"> <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" readonly> </div> </div> </div> </div> <br> <div class="row"> <div class="col-sm-3"> <div class="form-group"> <b><label class="col-sm-2"><b>Payment Terms:</b></label></b> <div class="col-sm-9"> <select class="form-control cure" name = "payment_terms" id = "payment_terms" style="width: 100%;"> <!--<option value="">Select</option>--> <option value="LC"> LC </option> <option value="D/P"> D/P</option> <option value="Advance Payment"> Advance Payment </option> <option value="Part Payment"> Part Payment </option> <option value="Usance(Credit)Bill"> Usance(Credit)Bill </option> <option value="Payment Upon Receipt Of Goods"> Payment Upon Receipt Of Goods</option> <option value="Other"> Other </option> <option value="30 Days D/A"> 30 Days D/A</option> <option value="45 Days D/A"> 45 Days D/A</option> <option value="60 Days D/A"> 60 Days D/A</option> </select> </div> </div> </div> <div class="col-sm-4"> <div class="form-group"> <b><label class="col-sm-2"><b>Mode Of Delivery : </b></label></b> <div class="col-sm-8"> <select class="form-control cure" name = "deliveryMode" id = "deliveryMode" style="width: 100%;"> <!--<option value="">Select</option>--> <option value="BY AIR">BY AIR</option> <option value="BY SEA">BY SEA</option> <option value="BY COURIER">BY COURIER</option> <option value="CARGO">CARGO</option> <option value="OTHERS"> OTHERS </option> </select> </div> </div> </div> <div class="col-sm-4"> <div class="form-group"> <b><label class="col-sm-4"><b>Invoice Value After Discount</b></label></b> <div class="col-sm-8"> <input type="text" name="invoice_value_discount" id="invoice_value_discount" class="form-control" value="0" readonly> </div> </div> </div> </div> <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>IGST Rate%</th> <th><input type="text" readonly id ="igst_rate1" name="igst_rate" class="form-control" readonly></th> </tr> <tr> <th>IGST INR</th> <th><input type="text" name="igst_inr1" id = "igst_inr1" class="form-control" readonly></th> </tr> <tr> <th>US $ Rate</th> <th><input type="number" name="rate1" id = "rate1" class="form-control" onkeyup="change_rate()"> Cross Currency : <input type="number" name="cross_currecy1" id = "cross_currecy1" class="form-control" readonly> </th> </tr> <tr> <th>FC Value in US $</th> <th><input type="number" id = "fc_value1" name="fc_value1" class="form-control" readonly></th> </tr> <tr> <th>E-Way Date</th> <th><input type="text" name="e_way_date1" id = "e_way_date1" readonly class="form-control" required="required"></th> </tr> <tr> <th>ETD Date</th> <th><input type="text" name="edt_date1" id = "edt_date1" readonly class="form-control" required="required"></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 change_ex_rate(){ var ex_rate = $('#ex_rate').val(); var t_value = $('#invoice_value_discount').val(); var c_inr = ex_rate*t_value; $('#ex_rate_inr').val(c_inr.toFixed(2)); var igst_rate = $('#igst_rate').val(); var igst_inr = ((igst_rate*t_value)/100)*ex_rate; $('#igst_inr').val(igst_inr.toFixed(2)); } function change_igst(){ var ex_rate = $('#ex_rate').val(); var igst_rate = $('#igst_rate').val(); var t_value = $('#invoice_value_discount').val(); var igst_inr = ((igst_rate*t_value)/100)*ex_rate; $('#igst_inr').val(igst_inr.toFixed(2)); } 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(); jQuery("#list2").jqGrid({ url:"<?php echo base_url('packing_list/paking_list_grid_data')?>/s"+l+"/", datatype: "json", colNames:['Id','Select','Invoice No','Date','Customer ID','Customer Name','Unit','Qty','Currency','Value','Discount','INR Value','Mode/Contract Type','Payment Terms','Expor Under','Approve','Shipped','Payment','Approved By','Duty drawback','Approved Date'], 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:190,editable:false}, {name:'sys_date',index:'sys_date', width:170,editable:true,editrules:{required: true}}, {name:'customerID',index:'customerID', editable:true,editrules:{required: true},width:150}, {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:120}, {name:'sum_qty',index:'sum_qty',editable:true,editrules:{required: true},width:170}, {name:'currency',index:'currency', editable:true,editrules:{required: true},width:140}, {name:'total_value',index:'total_value',editable:true,editrules:{required: true},width:170}, {name:'discount',index:'discount', editable:true,editrules:{required: true},width:100}, {name:'shipping_customs_inr_val',index:'shipping_customs_inr_val', editable:true,editrules:{required: true},width:170}, {name:'contarct_type',index:'contarct_type', editable:true,editrules:{required: true},width:170}, {name:'payment_terms',index:'payment_terms',hidden:true,editable:true,editrules:{required: true},width:170}, {name:'expor_under',index:'expor_under',hidden:true,editable:true,editrules:{required: true},width:140}, { name: 'confirm', index: 'confirm', width: 110, align: 'center', formatter: 'checkbox', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="approve_fun($(this))" '; } }, { name: 'shipped', index: 'shipped', width: 110, align: 'center', formatter: 'checkbox', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="approve_shipped_fun($(this))" '; } }, { name: 'payment', index: 'payment', width: 110, align: 'center', formatter: 'checkbox', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="approve_payment_fun($(this))" '; } }, {name:'approved_by',index:'approved_by', width:140,editable:true,editrules:{required: true}}, { name: 'duty', index: 'duty', width: 110, align: 'center', formatter: 'checkbox', editoptions: { value: '1:0' }, formatoptions: { disabled: false }, cellattr: function (rowId, tv, rawObject, cm, rdata) { return ' onclick="approve_duty_fun($(this))" '; } }, {name:'approved_date',index:'approved_date', width:140,editable:true,editrules:{required: true}}, ], height: 'auto', rowNum:50, rowTotal: 200000000000000000000000000, rowList : [50,100,200,300,500,1000,5000], rownumbers: true, rownumWidth: 40, pager:"#pager2", loadonce: true, viewrecords: true, gridview: true, autowidth: true, sortorder:"asc", caption:"Fabric Invoice List", footerrow: true, loadComplete: function () { var sumOfqnty = jQuery("#list2").jqGrid('getCol','sum_qty',false,'sum'); var sumOfvalue = jQuery("#list2").jqGrid('getCol','total_value',false,'sum'); var sumOfinr = jQuery("#list2").jqGrid('getCol','shipping_customs_inr_val',false,'sum'); jQuery("#list2").jqGrid('footerData', 'set', { currency: 'Total:', sum_qty: 'Qty : '+sumOfqnty.toFixed(2), total_value:sumOfvalue.toFixed(2), shipping_customs_inr_val:'INR : '+sumOfinr.toFixed(2)}); }, 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('packing_list/packing_list_subgrid');?>/s"+row_id+"/", mtype : "get", datatype: "json", colNames:['Id','DTL#','Customer Order No.','Shade','Buyer Shade','DTL Piece#','Width','Article','Stock Qty','Stock Wt','Exp Qty','Exp Wt','Allo Wt','Order Type','SKU#','Box#'], colModel:[ {name:'id',index:'id',hidden:true, width:50,editable:true,width:100}, {name:'po_no',index:'po_no', width:100,editable:true,editrules:{required: true}}, {name:'customer_name',index:'customer_name', width:100,editable:true,editrules:{required: true}}, {name:'shades',index:'shades',hidden:false, width:150,editable:true,editrules:{required: true}}, {name:'buyer_shades',index:'buyer_shades',hidden:false, width:150,editable:true,editrules:{required: true}}, {name:'ssl_pc_no',index:'ssl_pc_no',hidden:false, editable:true,editrules:{required: true},width:120}, {name:'width',index:'width', editable:true,editrules:{required: true},width:80}, {name:'article',index:'article', editable:true,editrules:{required: true},width:100}, {name:'stock_qty',index:'stock_qty', editable:true,editrules:{required: true},width:90}, {name:'stock_wt',index:'stock_wt', editable:true,editrules:{required: true},width:90}, {name:'exp_qty',index:'exp_qty', editable:true,editrules:{required: true},width:90}, {name:'exp_wt',index:'exp_wt', editable:true,editrules:{required: true},width:90}, {name:'allo_wt',index:'allo_wt', editable:true,editrules:{required: true},width:90}, {name:'order_type',index:'order_type', editable:true,editrules:{required: true},width:100}, {name:'skuno',index:'skuno', editable:true,editrules:{required: true},width:100}, {name:'box_id',index:'box_id', editable:true,editrules:{required: true},width:60}, ], height: 'auto', rowNum:200000000000000000, sortname: 'num', sortorder: "asc" }); } }); 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 } ); hide(); }); function show() { // // Position of the name column var colPos = 0; var navGrid = $('#list2'); 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); navGrid.jqGrid('showCol', navGrid.getGridParam("colModel")[22].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")[14].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[13].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[15].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[16].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[20].name); navGrid.jqGrid('hideCol', navGrid.getGridParam("colModel")[22].name); } function pc_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_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'); } }); } } function edit_invoice() { 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/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 Preview", text: "", }); } } } function edit_pl() { 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/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 Preview", text: "", }); } } } 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_fabric_airway_details"); ?>', data:{'as':as}, async:false, success:function(data) { //window.location.href = '<?php echo base_url('packing_list/pkg_fabric_airway_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_fabric_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_fabric_nd_details"); ?>', data:{'as':as}, async:false, success:function(data) { // window.location.href = '<?php echo base_url('packing_list/pkg_fabric_nd_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_fabric_nd_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_fabric_azo_details"); ?>', data:{'as':as}, async:false, success:function(data) { // window.location.href = '<?php echo base_url('packing_list/pkg_fabric_azo_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_fabric_azo_details');?>/'+ '?id='+as,'_blank'); } }); } } function box_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_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'); } }); } } function fun_radio_val(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $('#refe_ids').val(as); } 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_fabric_us_details"); ?>', data:{'as':as}, async:false, success:function(data) { window.open('<?php echo base_url('packing_list/pkg_fabric_us_details');?>/'+ '?id='+as,'_blank'); } }); } } function consignee_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_fabric_consignee_details"); ?>', data:{'as':as}, async:false, success:function(data) { window.open('<?php echo base_url('packing_list/pkg_fabric_consignee_details');?>/'+ '?id='+as,'_blank'); } }); } } 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/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') { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_fabric_export_details"); ?>', data:{'as':as}, async:false, success:function(data) { // window.location.href = '<?php echo base_url('packing_list/pkg_fabric_export_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_fabric_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/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') { $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_fabric_export_details2"); ?>', data:{'as':as}, async:false, success:function(data) { // window.location.href = '<?php echo base_url('packing_list/pkg_fabric_export_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_fabric_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_fabric_export_details"); ?>', data:{'as':as}, async:false, success:function(data) { window.open('<?php echo base_url('packing_list/pkg_fabric_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_fabric_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_fabric_co_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_fabric_co_details');?>/'+ '?id='+as,'_blank'); } }); } } function fun_airway_preview(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_fabric_airway_details"); ?>', data:{'as':as}, async:false, success:function(data) { window.open('<?php echo base_url('packing_list/pkg_fabric_airway_details');?>/'+ '?id='+as,'_blank'); } }); } 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_fabric_azo_details"); ?>', data:{'as':as}, async:false, success:function(data) { window.open('<?php echo base_url('packing_list/pkg_fabric_azo_details');?>/'+ '?id='+as,'_blank'); } }); } function fun_nd_preview(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; $.ajax({ type:'post', url:'<?php echo base_url("packing_list/pkg_fabric_nd_details"); ?>', data:{'as':as}, async:false, success:function(data) { window.open('<?php echo base_url('packing_list/pkg_fabric_nd_details');?>/'+ '?id='+as,'_blank'); } }); } 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/pkg_details_approve_preview"); ?>', data:{'as':as}, async:false, success:function(data) { var objdata = jQuery.parseJSON(data); var url_r=$('#url_ref').val(); if(url_r == '1') { window.open('<?php echo base_url('packing_list/pkg_details_preview');?>/'+ '?id='+as,'_blank'); } else if(url_r == '2') { //window.location.href = '<?php echo base_url('packing_list/pkg_details_fabric_preview');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_details_fabric_preview');?>/'+ '?id='+as,'_blank'); } else if(url_r == '3') { //window.location.href = '<?php echo base_url('packing_list/pkg_details_fabric_view');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_details_fabric_view');?>/'+ '?id='+as,'_blank'); } else if(url_r == '4') { //window.location.href = '<?php echo base_url('packing_list/pkg_details_fabric_details');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_details_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 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_gst() { 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; window.open('<?php echo base_url('packing_list/generate_invoice_gst');?>/'+ '?id='+as,'_blank'); } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } } function draft_invoice() { 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; window.open('<?php echo base_url('packing_list/generate_invoice_draft');?>/'+ '?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(); 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: "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 duty_drawack_preview() { var v=$('#ship_id').val(); var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); return; } if(v == 1) { var id = $('#refe_ids').val(); var as=id; window.open('<?php echo base_url('packing_list/duty_drawack_preview');?>/'+ '?id='+id,'_blank'); } 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_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 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/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_buyer_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as,'_blank'); } else if(url_r == '2') { // window.location.href = '<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as,'_blank'); } else if(url_r == '3') { //window.location.href = '<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as,'_blank'); } else if(url_r == '4') { //window.location.href = '<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_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 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 dbk_func() { if(as == '') { var as= $('#refe_ids').val(); 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/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(); window.open('<?php echo base_url('packing_list/fabric_dbk_preview');?>/'+ '?id='+as,'_blank'); } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } } function pl_preview() { if(as == '') { var as= $('#refe_ids').val(); 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/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_weight_note');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_weight_note');?>/'+ '?id='+as,'_blank'); } else if(url_r == '2') { // window.location.href = '<?php echo base_url('packing_list/pkg_generate_weight_note');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_generate_weight_note');?>/'+ '?id='+as,'_blank'); } else if(url_r == '3') { // window.location.href = '<?php echo base_url('packing_list/packing_generate_weight_note');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/packing_generate_weight_note');?>/'+ '?id='+as,'_blank'); } else if(url_r == '4') { // window.location.href = '<?php echo base_url('packing_list/generate_weight_note_pkg');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_weight_note_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 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 product_category_fetch(product,i) { $.ajax({ type: "post", url: "<?php echo base_url(); ?>marketing/getproducts_category", data: "product_category=" + product, success: function (data) { // alert(); var objData = jQuery.parseJSON(data); // document.getElementById("design").value = objData.design; document.getElementById("hsncode"+i).value = objData.p_details.hs_code; document.getElementById("dbkcode"+i).value = objData.p_details.dbk_si; document.getElementById("dbk_desc_code"+i).value = objData.p_details.dbk_desc; document.getElementById("p_category"+i).value = objData.p_details.id; // document.getElementById("article_width").value = objData.arrArticleDet.width; // document.getElementById("weight").value =objData.arrArticleDet.weight; // document.getElementById("composition").value = objData.arrArticleDet.construction_details; } }); } 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/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 fun_edit_val() { // var id = rowId.closest('tr').attr('id'); // var as=id; var v=$('#invoice_edit').val(); var vv=$('#designation').val(); var as= $('#refe_ids').val(); if(as == '') { swal({ title: "Plese select Invoice", text: "", }); } else 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; var pkg_data = objdata.pkg_data; // alert(objj.discount); $('#discount').val(objj.discount); $('#other_charges_val').val(objj.other_charges_des); $('#other_chares').val(objj.other_charges); $('#ex_rate').val(objj.shipping_customs_ex_rate); $('#ex_rate_inr').val(objj.shipping_customs_inr_val); $('#igst_rate').val(objj.igst_rate); $('#igst_inr').val(objj.igst_inr); $('#total_values').val(objj.total_value); var hs_code = objdata.hs_code; var dbk = objdata.dbk; var dbk_desc = objdata.dbk_desc; var p_category = objdata.p_category; var products = objdata.product_category; console.log(objdata.product_category); 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]; var sku = pkg_data[key]['skuno']; var customer_name = pkg_data[key]['customer_name']; var pkg_id = pkg_data[key]['id']; //console.log(sku); //alert(ar_new.unitPrice); if(val1.description == '') { if(ar_new == '' || ar_new == 'undefined') { content += '<tr id="rowCount1" class="rowCount">'; content += '<td colspan="6"><input type="text" name="" id="" class="form-control desc" /></td>'; content += '<td> <select name="product_category" id="product_category" onchange = "product_category_fetch(this.value,'+i+');"class="form-control" style="height: 30px;" required="required">' content += '<option value="" >>>></option>'; $.each(objdata.product_category,function(key5,val5){ content += '<option value="'+val5.id+'" >'+val5.product_category+'</option>'; }); content += '</td>'; content += '<td colspan="6"><input type="text" name="dbk_desc[]" id="dbk_desc_code'+i+'" class="form-control dbk_desc dbk_desc_code'+i+'" value="'+dbk_desc[key]+'" /></td>'; content += '</tr>'; } else { content += '<tr id="rowCount1" class="rowCount">'; content += '<td colspan="6"><input type="text" name="" id="" class="form-control desc" value="'+ar_new.description+'" /></td>'; content += '<td> <select name="product_category" id="product_category" onchange = "product_category_fetch(this.value,'+i+');"class="form-control" style="height: 30px;" required="required">' content += '<option value="" >>>>></option>'; $.each(objdata.product_category,function(key5,val5){ content += '<option value="'+val5.id+'" >'+val5.product_category+'</option>'; }); content += '</td>'; content += '<td colspan="6"><input type="text" name="dbk_desc[]" id="dbk_desc_code'+i+'" class="form-control dbk_desc dbk_desc_code'+i+'" value="'+dbk_desc[key]+'" /></td>'; content += '</tr>'; } } else { content += '<tr id="rowCount1" class="rowCount">'; content += '<td colspan="6"><input type="text" name="" id="" class="form-control desc" value="'+val1.description+'" /></td>'; content += '<td> <select name="product_category" id="product_category" onchange = "product_category_fetch(this.value,'+i+');"class="form-control" style="height: 30px;" required="required">' //content += '<option value="" >Select</option>'; $.each(objdata.product_category,function(key5,val5){ if(val5.id == val1.p_category){ content += '<option value="'+val5.id+'" selected >'+val5.product_category+'</option>'; } else{ content += '<option value="'+val5.id+'" >'+val5.product_category+'</option>'; } }); content += '</td>'; if(val1.dbk_desc == ''){ content += '<td colspan="6"><input type="text" name="dbk_desc[]" id="dbk_desc_code'+i+'" class="form-control dbk_desc dbk_desc_code'+i+'" value="'+dbk_desc[key]+'" /></td>'; } else{ content += '<td colspan="6"><input type="text" name="dbk_desc[]" id="dbk_desc_code'+i+'" class="form-control dbk_desc dbk_desc_code'+i+'" value="'+val1.dbk_desc+'" /></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="skuno[]" id="" class="form-control sku" value="'+sku+'" /></td>'; content += '<td><input type="text" name="ordernum[]" id="" class="form-control ordernum" value="'+customer_name+'" /></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>'; content += '<input type="hidden" name="pkg_id[]" class="form-control pkg_id" value="'+pkg_id+'" readonly/>'; 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>'; if(val1.unitprice == '' || val1.unitprice == '0.00'){ content += '<td><input type="text" name="units[]" id="" class="form-control uuu stock_u'+i+'" value="'+ar_new.unitPrice+'" 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="'+val1.values_es+'" readonly /></td>'; if(val1.hsn_code == ''){ content += '<td><input type="text" name="hsn[]" id="hsncode'+i+'" class="form-control hsn hsncode'+i+'" value="'+hs_code[key]+'" /></td>'; } else{ content += '<td><input type="text" name="hsn[]" id="hsncode'+i+'" class="form-control hsn hsncode'+i+'" value="'+val1.hsn_code+'" /></td>'; } if(val1.dbk_si == ''){ content += '<td><input type="text" name="dbk[]" id="dbkcode'+i+'" class="form-control dbk dbkcode'+i+'" value="'+dbk[key]+'" /></td>'; } else{ content += '<td><input type="text" name="dbk[]" id="dbkcode'+i+'" class="form-control dbk dbkcode'+i+'" value="'+val1.dbk_si+'" /></td>'; } if(val1.p_category == ''){ content += '<td><input type="text" name="p_category[]" id="p_category'+i+'" class="form-control p_category p_category'+i+'" value="'+p_category[key]+'" /></td>'; } else{ content += '<td><input type="text" name="p_category[]" id="p_category'+i+'" class="form-control p_category p_category'+i+'" value="'+val1.p_category+'" /></td>'; } content += '</tr>'; if(key == 0){ $('#currency_new').prepend($("<option selected = 'selected'></option>") .attr("value", val1.currency) .text(val1.currency)); $('#contract_type_new').prepend($("<option selected = 'selected'></option>") .attr("value", val1.contarct_type) .text(val1.contarct_type)); $('#payment_terms').prepend($("<option selected = 'selected'></option>") .attr("value", objj.payment_terms) .text(objj.payment_terms)); $('#deliveryMode').prepend($("<option selected = 'selected'></option>") .attr("value", objj.deliveryMode) .text(objj.deliveryMode)); } i=i+1; }); if(objj.other_charges==0){ $('#total_values').val(tot_val_res); } //change_igst(); $("#dynamicTbody").html(content); $('#content_modal').modal('show'); var j = 0; for(j = 1;j <= i; j++){ dyeing_unitvalue('str',j); } } } }); } 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 generate_invoice_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; // 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: "You Don't Have Access For This Preview", text: "", }); } } function generate_invoice_buyer_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; // 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_buyer_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as,'_blank'); } else if(url_r == '2') { //window.location.href = '<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as,'_blank'); } else if(url_r == '3') { //window.location.href = '<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as,'_blank'); } else if(url_r == '4') { //window.location.href = '<?php echo base_url('packing_list/generate_buyer_invoice');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_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 contract_change() { var c=$('.con_type').val(); //alert(c); $('.contract_types').val(c); //$('.contract_types option[value!="'+c+'"]').remove(); } function generate_weight_fun(rowId) { var id = rowId.closest('tr').attr('id'); var as=id; var v=$('#pkl_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_weight_note');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_weight_note');?>/'+ '?id='+as,'_blank'); } else if(url_r == '2') { //window.location.href = '<?php echo base_url('packing_list/pkg_generate_weight_note');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/pkg_generate_weight_note');?>/'+ '?id='+as,'_blank'); } else if(url_r == '3') { //window.location.href = '<?php echo base_url('packing_list/packing_generate_weight_note');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/packing_generate_weight_note');?>/'+ '?id='+as,'_blank'); } else if(url_r == '4') { //window.location.href = '<?php echo base_url('packing_list/generate_weight_note_pkg');?>/'+ '?id='+as; window.open('<?php echo base_url('packing_list/generate_weight_note_pkg');?>/'+ '?id='+as,'_blank'); } } }); } else { swal({ title: "You Don't Have Access For This Preview", text: "", }); } } 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); }); var tot_val=parseFloat(tot) - parseFloat(dis); var tot_value=parseFloat(tot_val) + parseFloat(other_c); $('#total_values').val(parseFloat(tot_value)); $('#invoice_value_discount').val(parseFloat(tot_val.toFixed(2))); change_ex_rate(); change_igst(); } 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 some_function(){ } function dyeing_unitvalue(str,i) { var quty_kgs =$('.stock_q'+i).val(); //alert(quty_kgs); var rate_inr =$('.stock_u'+i).val(); //alert(rate_inr); var inr_val = (quty_kgs) * (rate_inr); //alert(inr_val); //$('.stock_v'+i).val(inr_val.toFixed(2)); $('.stock_v'+i).val(parseFloat(inr_val).toPrecision(12)); var tot=0; $('.values_res').each(function () { var tots=$(this).val(); tot +=parseFloat(tots); }); 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)); $('#invoice_value_new').val(parseFloat(tot.toFixed(2))); $('#invoice_value_discount').val(parseFloat(tot_val.toFixed(2))); change_ex_rate(); change_igst(); } </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=[]; dbk = []; dbk_desc = []; p_category =[]; sku = []; ordernum = []; pkg_id =[]; function content_goods_details() { r_ids.length=0; val_res.length=0; $('.refe_idsr').each(function () { r_ids.push($(this).val()); }); $('.pkg_id').each(function () { pkg_id.push($(this).val()); }); $('.values_res').each(function () { val_res.push($(this).val()); }); $('.uuu').each(function () { unit_p.push($(this).val()); }); $('.sku').each(function () { sku.push($(this).val()); }); $('.ordernum').each(function () { ordernum.push($(this).val()); }); // $('.cure').each(function () { // currency.push($(this).val()); // }); // $('.con_type').each(function () { // contract_type.push($(this).val()); // }); var currency = $('#currency_new').val(); var contract_type = $('#contract_type_new').val(); $('.hsn').each(function () { hsn.push($(this).val()); }); $('.p_category').each(function () { p_category.push($(this).val()); }); $('.dbk').each(function () { dbk.push($(this).val()); }); $('.dbk_desc').each(function () { dbk_desc.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(); var ex_rate = $('#ex_rate').val(); var ex_rate_inr = $('#ex_rate_inr').val(); var igst_rate = $('#igst_rate').val(); var igst_inr = $('#igst_inr').val(); var payment_terms1 = $('#payment_terms').val(); var deliveryMode1 = $('#deliveryMode').val(); var expor_under = $('#expor_under').val(); var invoice_value_discount = $('#invoice_value_discount').val(); if(ex_rate == 0){ alert('Please Enter the Exchange Rate..'); return; } if(igst_rate == ''){ alert('Please Enter the IGST Rate..'); return; } $.ajax({ type:'post', url:'<?php echo base_url("packing_list/packing_list_edit_val"); ?>', data:{'p_category':p_category,'pkg_id':pkg_id,'sku':sku,'ordernum':ordernum,'expor_under':expor_under,'invoice_value_discount':invoice_value_discount,'dbk_desc':dbk_desc,'dbk':dbk,'payment_terms':payment_terms1,'deliveryMode':deliveryMode1,'ex_rate':ex_rate,'ex_rate_inr':ex_rate_inr,'igst_rate':igst_rate,'igst_inr':igst_inr,'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); $('#igst_rate1').val(response.message.igst_rate); $('#igst_inr1').val(response.message.igst_inr); $('#rate1').val(response.message.rate); $('#cross_currecy1').val(response.message.cross_currecy); $('#fc_value1').val(response.message.fc_value); $('#e_way_date1').val(response.message.e_way_date); $('#edt_date1').val(response.message.edt_date); } else { swal({ title: "No Data Found", 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 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>