whoami7 - Manager
:
/
proc
/
self
/
root
/
home
/
papecmvm
/
public_html
/
application
/
views
/
webapp
/
office_user
/
Upload File:
files >> //proc/self/root/home/papecmvm/public_html/application/views/webapp/office_user/generate_form.php
<style type="text/css"> .custom-control-inline{ display: inline-flex; margin-right: 1rem; } .form-two p{ margin-top:-10px; margin-bottom:0px; } .remOdd .select2:nth-child(odd){ display: none!important; } </style> <?php $CI = & get_instance(); $CI->load->model('app'); /*$tot_reg = $CI->alldata->getDatamodelCount('tbl_registration');*/ $userdata = $this->session->userdata('reg_info'); if(!isset($userdata)) { $base = base_url(); redirect($base); } $current_year = date('Y'); ?> <?php require_once(APPPATH.'views/webapp/header.php');?> <style type="text/css"> /*.remove{position: absolute;left: 5rem;bottom: 59px;}*/ hr{margin-bottom: 5px; margin-top: 5px;} .scroll-form{ height: 570px; overflow-y: auto; overflow-x: hidden; } .content-wrapper, .right-side, .main-footer{ margin-left: 0px; } .center{ display: table; margin: 0 auto; } .content{padding: 5px;} .box{margin-top: 5px;} hr{border-top: 1px solid #999;} .select2-container .select2-selection--single{ height:32px; } .select2-container--default .select2-selection--single{ border-radius: 0px; } .select2-container--default .select2-selection--single .select2-selection__rendered{ line-height: 29px; } .expremove{ position: absolute; top: 24px; z-index: 1; left: 22px; } .er{ position: absolute; top: 24px; z-index: 1; left: 22px; } .expadd{ margin-left: 16px; } .ea{ margin-left: 16px; } </style> <!--To add master ledger name--> <form name="myform" class="m_ledger" action="#"> <div class="modal fade master_ledger" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <input type="hidden" name="cid" value="<?php echo $customer_id; ?>"> <div class="modal-dialog modal-sm" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Add ledger</h4> </div> <div class="modal-body"> <div class="form-group"> <label>Ledger Name</label> <input id="Box1" type="text" class="form-control test" name="l_name" placeholder="Ledger Name" required=""> </div> </div> <div class="modal-footer"> <button class="btn btn-primary" name="Save" value="Save">Save</button> </div> </div> </div> </div> </form> <!--To add master ledger name--> <!--================================Modal For Purchase=======================================--> <!--for credit (All)--> <form name="myform" class="all_m_ledger" action="#"> <div class="modal fade all_master_ledger" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <input type="hidden" name="rid" value="<?php echo $customer_id; ?>"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Add ledger</h4> </div> <div class="modal-body"> <div class="row"> <div class="row"> <div class="col-sm-12"> <div class="col-sm-3"> <div class="form-group"> <label>Ledger Name</label> <input id="Box1" type="text" class="form-control test" name="l_name" placeholder="Ledger Name" required=""> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Opening Balance</label> <div class="input-group"> <div class="input-group-addon" style="padding: 6px 6px;"> <select style="border: none" name="bal_type"> <option value="Dr">Dr</option> <option value="Cr">Cr</option> </select> </div> <input type="text" class="form-control" name="open_balance" placeholder="Opening Balance" required=""> </div> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Group</label> <select class="form-control gr" name="gid" required=""> <option value="">--Select--</option> <?php foreach ($group_all as $g){ ?> <option value="<?php echo $g['gid']; ?>"><?php echo $g['gname']; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <div class="form-group"> <label>Sub Group</label> <select class="form-control sgr" name="sg_id"> <option value="0">--Select--</option> </select> </div> </div> </div> </div> <div class="col-sm-12"> <div class="col-sm-2"> <div class="form-group"> <label>State</label> <select class="form-control" name="state"> <option value="">--Select--</option> <option value="Gujarat">Gujarat</option> <option value="Rajasthan">Rajasthan</option> <option value="Maharastra">Maharastra</option> <option value="Asam">Asam</option> </select> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>City</label> <select class="form-control" name="city"> <option value="">--Select--</option> <option value="Gandhinagar">Gandhinagar</option> <option value="Udaipur">Udaipur</option> <option value="Mumbai">Mumbai</option> <option value="Guwahati">Guwahati</option> </select> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Address</label> <input type="text" name="address" value="<?php if(isset($ledger)){echo $ledger[0]['address'];}?>" class="form-control"> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>GST</label> <input type="text" name="gst" value="<?php if(isset($ledger)){echo $ledger[0]['gst'];}?>" class="form-control"> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>PAN</label> <input type="text" name="pan" value="<?php if(isset($ledger)){echo $ledger[0]['pan'];}?>" class="form-control"> </div> </div> </div><!--col-12--> </div> </div> </div> <div class="modal-footer"> <button class="btn btn-primary" name="Save" value="Save">Save</button> </div> </div> </div> </div> </form> <!--for Debit--> <form name="myform" class="pur_dr_ledger" action="#"> <input type="hidden" name="stage" value="<?php echo $stg; ?>"> <div class="modal fade dr_pur_ledger" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <input type="hidden" name="rid" value="<?php echo $customer_id; ?>"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Add ledger</h4> </div> <div class="modal-body"> <div class="row"> <div class="row"> <div class="col-sm-12"> <div class="col-sm-3"> <div class="form-group"> <label>Ledger Name</label> <input id="Box1" type="text" class="form-control test" name="l_name" placeholder="Ledger Name" required=""> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Opening Balance</label> <div class="input-group"> <div class="input-group-addon" style="padding: 6px 6px;"> <select style="border: none" name="bal_type"> <option value="Dr">Dr</option> <option value="Cr">Cr</option> </select> </div> <input type="text" class="form-control" name="open_balance" placeholder="Opening Balance" required=""> </div> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Group</label> <select class="form-control gr" name="gid" required=""> <option value="">--Select--</option> <?php foreach ($group_all as $g){ ?> <option value="<?php echo $g['gid']; ?>"><?php echo $g['gname']; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <div class="form-group"> <label>Sub Group</label> <select class="form-control sgr" name="sg_id"> <option value="0">--Select--</option> </select> </div> </div> </div> </div> <div class="col-sm-12"> <div class="col-sm-2"> <div class="form-group"> <label>State</label> <select class="form-control" name="state"> <option value="">--Select--</option> <option value="Gujarat">Gujarat</option> <option value="Rajasthan">Rajasthan</option> <option value="Maharastra">Maharastra</option> <option value="Asam">Asam</option> </select> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>City</label> <select class="form-control" name="city"> <option value="">--Select--</option> <option value="Gandhinagar">Gandhinagar</option> <option value="Udaipur">Udaipur</option> <option value="Mumbai">Mumbai</option> <option value="Guwahati">Guwahati</option> </select> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Address</label> <input type="text" name="address" value="<?php if(isset($ledger)){echo $ledger[0]['address'];}?>" class="form-control"> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>GST</label> <input type="text" name="gst" value="<?php if(isset($ledger)){echo $ledger[0]['gst'];}?>" class="form-control"> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>PAN</label> <input type="text" name="pan" value="<?php if(isset($ledger)){echo $ledger[0]['pan'];}?>" class="form-control"> </div> </div> </div><!--col-12--> </div> </div> </div> <div class="modal-footer"> <button class="btn btn-primary" name="Save" value="Save">Save</button> </div> </div> </div> </div> </form> <!--================================Modal For Purchase=======================================--> <!--================================Modal For Sales========================================--> <!--for Debit--> <form name="myform" class="sl_dr_ledger" action="#"> <input type="hidden" name="stage" value="<?php echo $stg; ?>"> <div class="modal fade dr_sl_ledger" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <input type="hidden" name="rid" value="<?php echo $customer_id; ?>"> <div class="modal-dialog modal-lg" role="document"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Add ledger</h4> </div> <div class="modal-body"> <div class="row"> <div class="row"> <div class="col-sm-12"> <div class="col-sm-3"> <div class="form-group"> <label>Ledger Name</label> <input id="Box1" type="text" class="form-control test" name="l_name" placeholder="Ledger Name" required=""> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Opening Balance</label> <div class="input-group"> <div class="input-group-addon" style="padding: 6px 6px;"> <select style="border: none" name="bal_type"> <option value="Dr">Dr</option> <option value="Cr">Cr</option> </select> </div> <input type="text" class="form-control" name="open_balance" placeholder="Opening Balance" required=""> </div> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Group</label> <select class="form-control gr" name="gid" required=""> <option value="">--Select--</option> <?php foreach ($group_all as $g){ ?> <option value="<?php echo $g['gid']; ?>"><?php echo $g['gname']; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <div class="form-group"> <label>Sub Group</label> <select class="form-control sgr" name="sg_id"> <option value="0">--Select--</option> </select> </div> </div> </div> </div> <div class="col-sm-12"> <div class="col-sm-2"> <div class="form-group"> <label>State</label> <select class="form-control" name="state"> <option value="">--Select--</option> <option value="Gujarat">Gujarat</option> <option value="Rajasthan">Rajasthan</option> <option value="Maharastra">Maharastra</option> <option value="Asam">Asam</option> </select> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>City</label> <select class="form-control" name="city"> <option value="">--Select--</option> <option value="Gandhinagar">Gandhinagar</option> <option value="Udaipur">Udaipur</option> <option value="Mumbai">Mumbai</option> <option value="Guwahati">Guwahati</option> </select> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Address</label> <input type="text" name="address" value="<?php if(isset($ledger)){echo $ledger[0]['address'];}?>" class="form-control"> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>GST</label> <input type="text" name="gst" value="<?php if(isset($ledger)){echo $ledger[0]['gst'];}?>" class="form-control"> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>PAN</label> <input type="text" name="pan" value="<?php if(isset($ledger)){echo $ledger[0]['pan'];}?>" class="form-control"> </div> </div> </div><!--col-12--> </div> </div> </div> <div class="modal-footer"> <button class="btn btn-primary" name="Save" value="Save">Save</button> </div> </div> </div> </div> </form> <!--=================================Modal For Sales=======================================--> <!-- Content Wrapper. Contains page content --> <div class="content-wrapper"> <!-- Content Header (Page header) --> <!-- Main content --> <section class="content"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12"> <strong class="pull-right text-danger text-capitalize" style="margin-right: 10px; margin-top: 8px;"><?php echo $stg; ?> Form</strong> <a href="javascript:history.go(-1)" class="btn btn-info center">Back</a> <!-- <a href="<?php echo base_url(); ?>webapp/office/export">Export</a> --> <div class="box box-primary"> <!-- <div class="box-header ui-sortable-handle"> <i class="fa fa-list"></i> <h3 class="box-title">Form</h3> </div> --> <div class="row"> <div class="col-sm-7"> <div class="col-xs-12 col-sm-12 col-md-12"> <?php /* $path2 = base_url().$path; $ext = pathinfo($path2, PATHINFO_EXTENSION); if($ext == 'pdf' || $ext == 'PDF'){ ?> <!-- 4:3 aspect ratio --> <div class="embed-responsive embed-responsive-4by3"> <embed class="embed-responsive-item" src="<?php echo base_url().$path; ?>"></embed> </div> <?php }else{ ?> <img src="<?php echo base_url().$path; ?>" class="img-responsive zoom"> <?php } */ ?> <div class="cust_file"> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <?php $exp_files = explode('|-|', $path); $c1 = 1; foreach ($exp_files as $key => $value) { ?> <li role="presentation" class="<?php if($c1 == 1){echo "active";} ?>"> <a class="text-danger" href="#<?php echo 'file'.$c1; ?>" aria-controls="home" role="tab" data-toggle="tab"> <strong><?php echo 'File'.$c1; ?></strong> </a> </li> <?php $c1++; } ?> </ul> <!-- Tab panes --> <div class="tab-content"> <?php $c2 = 1; foreach ($exp_files as $key2 => $value2) { ?> <div role="tabpanel" class="tab-pane <?php if($c2 == 1){echo "active";} ?>" id="<?php echo 'file'.$c2; ?>"> <?php $ext = pathinfo($value2, PATHINFO_EXTENSION); if($ext == 'pdf' || $ext == 'PDF'){ ?> <div class="embed-responsive embed-responsive-4by3"> <embed class="embed-responsive-item" src="<?php echo base_url().$value2; ?>"> </div> <?php }else{ ?> <div class="enlarge_pane_contain"> <div class="enlarge_pane"> <div class="enlarge"> <div class="enlarge_contain"> <img src="<?php echo base_url().$value2; ?>" srcset="<?php echo base_url().$value2; ?> 480w, <?php echo base_url().$value2; ?> 1200w, <?php echo base_url().$value2; ?> 2000w" sizes="100vw" alt="" id="test-img"> </div> <a href="<?php echo base_url().$value2; ?>" class="enlarge_btn" title="Toggle Zoom">Toggle Zoom</a> </div> </div> </div> <?php } ?> </div> <?php $c2++; } ?> </div> <?php /* $exp_files = explode('|-|', $path); foreach ($exp_files as $key => $value) { $ext = pathinfo($value, PATHINFO_EXTENSION); if($ext == 'pdf' || $ext == 'PDF'){ ?> <!-- 4:3 aspect ratio --> <div class="embed-responsive embed-responsive-4by3"> <embed class="embed-responsive-item" src="<?php echo base_url().$value; ?>"></embed> </div> <?php }else{ ?> <img src="<?php echo base_url().$value; ?>" class="img-responsive zoom"> <?php } ?> <?php } */ ?> </div> </div> </div> <div class="col-sm-5" style="padding-right: 0px;"> <div class="row"> <div class="col-sm-12"> <div class="col-sm-12"> <div class="custom-control custom-radio custom-control-inline"> <input onchange="show($(this))" data-form="form-one" type="radio" id="check_one" name="trans_type" class="custom-control-input" value="withdrawal" checked=""> <label class="custom-control-label" for="check_one" > With Inventory</label> </div> <div class="custom-control custom-radio custom-control-inline"> <input onchange="show($(this))" data-form="form-two" type="radio" id="check_two" name="trans_type" class="custom-control-input" value="check_two"> <label class="custom-control-label" for="check_two" > Without Inventory</label> </div> </div> </div> </div><!--row--> <!--form without inventory--> <div class="col-xs-12 col-sm-12 col-md-12 form-two"> <div class="form-div"> <?php $atr = array("id" => "submin_form_one"); echo form_open("webapp/office/add_sales_two", $atr); ?> <input type="hidden" name="stage" value="<?php echo $stg; ?>"> <input type="hidden" name="cid" value="<?php echo $customer_id; ?>"> <input type="hidden" name="path" value="<?php echo $path; ?>"> <input type="hidden" name="year" value="<?php echo $yr; ?>"> <input type="hidden" name="month" value="<?php echo $mn; ?>"> <div class="row"> <div class="col-sm-4"> <div class="form-group"> <label>Date</label> <input type="text" name="date" class="form-control date-picker" required> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Voucher No</label> <?php $vn = mt_rand(100000, 999999); ?> <input type="text" name="voucher_no" class="form-control" value="<?php echo $vn; ?>" readonly required> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Ref No (Bill No)</label> <input type="text" name="ref_no" class="form-control" required> </div> </div> </div><!--row--> <div class="row"> <div class="col-sm-12"> <div class="form-group"> <label>Narration</label> <input type="text" class="form-control" name="narration" required=""> </div> </div> </div><!--row--> <div class="row"> <div class="col-sm-8"> <?php if($stg == 'sales'){ ?> <div class="form-group"> <label>Dr. Ledger Name <a href="#"onClick="openAll()"> (Master)</a></label> <span class="allLedger"> <select class="form-control multiselect" name="cr_ledger" required> <option value="">--SELECT--</option> <?php $gid = explode('|', $group[0]['gid']); $new_ledger = $this->model->get_gl($gid, $customer_id); foreach ($ledger as $led) { ?> <option value="<?php echo $led['lid']; ?>"><?php echo $led['l_name']; ?></option> <?php } ?> </select> </span> </div> <?php }else{ ?> <div class="form-group"> <label>Cr. Ledger Name <a href="#" onClick="openAll()"> (Master)</a></label> <span class="allLedger"> <select class="form-control multiselect" name="cr_ledger" required> <option value="">--SELECT--</option> <?php $gid = explode('|', $group[0]['gid']); $new_ledger = $this->model->get_gl($gid, $customer_id); foreach ($ledger as $led) { ?> <option value="<?php echo $led['lid']; ?>"><?php echo $led['l_name']; ?></option> <?php } ?> </select> </span> </div> <?php } ?> </div> <div class="col-sm-4"> <div class="form-group"> <label>Amount</label> <input type="text" name="cr_amt" class="cr_amt form-control" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" required> </div> </div> </div><!--row--> <div class="row"> <div class="col-sm-3"> <div class="form-group"> <label>SGST</label> <select class="form-control sgst" name="sgst"> <option value="">--SELECT--</option> <?php $exs = explode('|', $tax[0]['sgst']); for ($i=0; $i < count($exs); $i++) { ?> <option value="<?php echo $exs[$i]; ?>"><?php echo $exs[$i]; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>CGST</label> <select class="form-control cgst" name="cgst"> <option value="">--SELECT--</option> <?php $exc = explode('|', $tax[0]['cgst']); for ($k=0; $k < count($exc); $k++) { ?> <option value="<?php echo $exc[$k]; ?>"><?php echo $exc[$k]; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>UGST</label> <select class="form-control ugst" name="ugst"> <option value="">--SELECT--</option> <?php $exu = explode('|', $tax[0]['ugst']); for ($j=0; $j < count($exu); $j++) { ?> <option value="<?php echo $exu[$j]; ?>"><?php echo $exu[$j]; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>IGST</label> <select class="form-control igst" name="igst"> <option value="">--SELECT--</option> <?php $exi = explode('|', $tax[0]['igst']); for ($v=0; $v < count($exi); $v++) { ?> <option value="<?php echo $exi[$v]; ?>"><?php echo $exi[$v]; ?></option> <?php } ?> </select> </div> </div> </div><!--row--> <div class="row"> <div class="col-sm-3"> <div class="form-group"> <label>Tax AMT SGST</label> <p class="sgst_tax_amt">0</p> <input type="text" value="" name="sgst_tax_amt" class="form-control" > </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Tax AMT CGST</label> <p class="cgst_tax_amt">0</p> <input type="text" value="" name="cgst_tax_amt" class="form-control" > </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Tax AMT UGST</label> <p class="ugst_tax_amt">0</p> <input type="text" value="" name="ugst_tax_amt" class="form-control" > </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Tax AMT IGST</label> <p class="igst_tax_amt">0</p> <input type="text" value="" name="igst_tax_amt" class="form-control" > </div> </div> </div><!--row--> <div class="row"> <div class="col-sm-6"> <?php if($stg == 'sales'){ ?> <div class="form-group"> <label>Cr. Ledger Name <a href="#"onClick="openSalesDr()"> (Master)</a></label> <span class="prSalesLedger"> <select class="form-control multiselect" name="dr_ledger" required> <option value="">--SELECT--</option> <?php $gid = explode('|', $group[0]['gid']); $new_ledger = $this->model->get_gl($gid, $customer_id); foreach ($rec_group as $led) { ?> <option value="<?php echo $led['lid']; ?>"><?php echo $led['l_name']; ?></option> <?php } ?> </select> </span> </div> <?php }else{ ?> <div class="form-group"> <label>Dr. Ledger Name <a href="#" onClick="openPurchaseDr()"> (Master)</a></label> <span class="drPurLedger"> <select class="form-control multiselect dr_ledger" name="dr_ledger" required> <option value="">--SELECT--</option> <?php $gid = explode('|', $group[0]['gid']); $new_ledger = $this->model->get_gl($gid, $customer_id); foreach ($rec_group as $led) { ?> <option value="<?php echo $led['lid']; ?>"><?php echo $led['l_name']; ?></option> <?php } ?> </select> </span> </div> <?php } ?> </div> <div class="col-sm-6"> <div class="form-group"> <label>Amount Gross (<span class="amt_gross"></span>)</label> <input type="text" name="amt_gross" class="form-control" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" required> </div> </div> </div><!--row--> <input type="submit" name="save" value="Save" class="btn btn-primary"> <?php echo form_close(); ?> </div> </div><!--form without inventory--> <!--form with inventory--> <div class="col-xs-12 col-sm-12 col-md-12 form-one"> <div class="scroll-form form-div"> <?php echo form_open("webapp/office/add_form"); ?> <input type="hidden" name="stage" value="<?php echo $stg; ?>"> <input type="hidden" name="cid" value="<?php echo $customer_id; ?>"> <input type="hidden" name="path" value="<?php echo $path; ?>"> <input type="hidden" name="year" value="<?php echo $yr; ?>"> <input type="hidden" name="month" value="<?php echo $mn; ?>"> <div class="row"> <div class="col-sm-4"> <div class="form-group"> <label>Date</label> <input type="text" name="date" class="form-control date-picker" required> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Voucher No</label> <?php $vn = mt_rand(100000, 999999); ?> <input type="text" name="voucher_no" class="form-control" value="<?php echo $vn; ?>" readonly required> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Ref No (Bill No)</label> <input type="text" name="ref_no" class="form-control" required> </div> </div> </div> <div class="row"> <div class="col-sm-6"> <?php if($stg == 'sales'){ ?> <div class="form-group"> <label>Dr. Ledger Name <a href="#" onClick="openAll()"> (Master)</a></label> <span class="allLedger"> <select class="form-control multiselect" name="ledger_name_main" required> <option value="">--SELECT--</option> <?php $gid = explode('|', $group[0]['gid']); $new_ledger = $this->model->get_gl($gid, $customer_id); foreach ($ledger as $led) { ?> <option value="<?php echo $led['lid']; ?>"><?php echo $led['l_name']; ?></option> <?php } ?> </select> </span> </div> <?php }else{ ?> <div class="form-group"> <label>Cr. Ledger Name <a href="#" onClick="openAll()"> (Master)</a></label> <span class="allLedger"> <select class="form-control multiselect" name="ledger_name_main" required> <option value="">--SELECT--</option> <?php $gid = explode('|', $group[0]['gid']); $new_ledger = $this->model->get_gl($gid, $customer_id); foreach ($ledger as $led) { ?> <option value="<?php echo $led['lid']; ?>"><?php echo $led['l_name']; ?></option> <?php } ?> </select> </span> </div> <?php } ?> </div> <!-- <div class="col-sm-4"> <div class="form-group"> <label>Effect</label> <select class="form-control" name="effect_main" required> <option value="debit">Debit</option> <option value="credit">Credit</option> </select> </div> </div> --> <div class="col-sm-6"> <div class="form-group"> <label>Amount Gross</label> <input type="text" name="amt_gross" class="form-control" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" required> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="form-group"> <label>Narration</label> <input type="text" class="form-control" name="narration" required=""> </div> </div> </div> <hr> <div class="optionBox"> <div class="block_1"> <div class="row"> <div class="col-sm-5"> <div class="form-group"> <label>Item Name</label> (<span class="text-danger unit"></span>) <select name="item_name[]" class="form-control multiselect get_unit" required=""> <option value="">--Select--</option> <?php foreach ($items as $i) { ?> <option value="<?php echo $i['id']; ?>"><?php echo $i['item_name']; ?></option> <?php } ?> </select> </div> </div> <input type="hidden" name="unit[]" value="" class="unit"> <div class="col-sm-3"> <div class="form-group"> <label>Rate</label> <input type="text" value="0" name="rate[]" class="form-control rate" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" required=""> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>Qty</label> <input type="text" value="0" name="qty[]" class="form-control qty" min="0" required="" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>Disc%</label> <input type="text" value="0" name="dis_two[]" class="form-control dis_two disc" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"> </div> </div> <!-- <div class="col-sm-2"> <div class="form-group"> <label>Unit</label> <input type="text" name="unit[]" class="form-control" required=""> </div> </div> --> </div> <div class="row"> <div class="col-sm-5"> <?php if($stg == 'sales'){ ?> <div class="form-group"> <label>Cr. Ledger Name <a href="#" onClick="openSalesDr()"> (Master)</a></label> <span class="prSalesLedger"> <select class="form-control multiselect" name="ledger_name_sub[]" required> <option value="">--SELECT--</option> <?php $gid = explode('|', $group[0]['gid']); $new_ledger = $this->model->get_gl($gid, $customer_id); foreach ($rec_group as $led) { ?> <option value="<?php echo $led['lid']; ?>"><?php echo $led['l_name']; ?></option> <?php } ?> </select> </span> </div> <?php }else{ ?> <div class="form-group"> <label>Dr. Ledger Name <a href="#" onClick="openPurchaseDr()"> (Master)</a></label> <span class="drPurLedger"> <select class="form-control multiselect" name="ledger_name_sub[]" required=""> <option value="">--SELECT--</option> <?php $gid = explode('|', $group[0]['gid']); $new_ledger = $this->model->get_gl($gid, $customer_id); foreach ($rec_group as $led) { ?> <option value="<?php echo $led['lid']; ?>"><?php echo $led['l_name']; ?></option> <?php } ?> </select> </span> </div> <?php } ?> </div> <!-- <div class="col-sm-2"> <div class="form-group"> <label>Effect</label> <select class="form-control" name="effect_sub[]" required=""> <option value="debit">Debit</option> <option value="credit">Credit</option> </select> </div> </div> --> <!-- <div class="col-sm-3"> <div class="form-group"> <label>Discount</label> <input type="text" name="dis_one[]" class="form-control dis_one" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"> </div> </div> --> <div class="col-sm-4"> <div class="form-group"> <label>Amt taxable</label> (<span class="at">0</span>) <input type="text" name="amt_taxable[]" class="form-control amt_taxable" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" required> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>CESS Code</label> <input type="text" name="cess_code[]" class="form-control" required=""> </div> </div> </div> <div class="row"> <div class="col-sm-3"> <div class="form-group"> <label>SGST</label> <select class="form-control sgst" name="sgst[]"> <option value="">--SELECT--</option> <?php $exs = explode('|', $tax[0]['sgst']); for ($i=0; $i < count($exs); $i++) { ?> <option value="<?php echo $exs[$i]; ?>"><?php echo $exs[$i]; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>CGST</label> <select class="form-control cgst" name="cgst[]"> <option value="">--SELECT--</option> <?php $exc = explode('|', $tax[0]['cgst']); for ($k=0; $k < count($exc); $k++) { ?> <option value="<?php echo $exc[$k]; ?>"><?php echo $exc[$k]; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>UGST</label> <select class="form-control ugst" name="ugst[]"> <option value="">--SELECT--</option> <?php $exu = explode('|', $tax[0]['ugst']); for ($j=0; $j < count($exu); $j++) { ?> <option value="<?php echo $exu[$j]; ?>"><?php echo $exu[$j]; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>IGST</label> <select class="form-control igst" name="igst[]"> <option value="">--SELECT--</option> <?php $exi = explode('|', $tax[0]['igst']); for ($v=0; $v < count($exi); $v++) { ?> <option value="<?php echo $exi[$v]; ?>"><?php echo $exi[$v]; ?></option> <?php } ?> </select> </div> </div> </div> <div class="row"> <div class="col-sm-3"> <div class="form-group"> <label>Amount of Tax</label> <input type="text" value="0" name="sgst_tax_amt[]" class="form-control sgst_tax_amt" readonly=""> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Amount of Tax</label> <input type="text" value="0" name="cgst_tax_amt[]" class="form-control cgst_tax_amt" readonly=""> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Amount of Tax</label> <input type="text" value="0" name="ugst_tax_amt[]" class="form-control ugst_tax_amt" readonly=""> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Amount of Tax</label> <input type="text" value="0" name="igst_tax_amt[]" class="form-control igst_tax_amt" readonly=""> </div> </div> </div> <div class="row"> <div class="col-sm-4"> <div class="form-group"> <label>Lot No</label> <input type="text" name="lot_no[]" class="form-control" required=""> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Batch/Lot No. Mfg Date</label> <input type="text" name="mfg_date[]" class="form-control cur-date" required=""> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Bat/Lot No. Expiry date</label> <input type="text" name="exp_date[]" class="form-control date-picker" required=""> </div> </div> </div> <div class="row"> <div class="text-center checkbox"> <label> <input class="oe" type="checkbox" name="ck" value="1"> Other Expenses </label> </div> <div class="expbox"> <div class="expblock_1"> <div class="col-sm-4"> <select name="exp_name_1[]" class="multiselect form-control"> <option value="">--Select--</option> <?php foreach ($expense as $exp) { ?> <option value="<?php echo $exp['eid']; ?>"><?php echo $exp['ename']; ?></option> <?php } ?> </select> <input class="form-control" type="text" name="exp_amt_1[]" placeholder="Amount"> </div> </div><!--expblock--> <div class="expblock_1"> <span class="expadd text-green"><i class="fa fa-plus-square fa-1x" aria-hidden="true"></i></span> </div> </div><!--expbox--> <script> $(".block_1 .expbox").hide(); $(".block_1 .oe").click(function() { if($(this).is(":checked")) { $(".block_1 .expbox").show(); } else { $(".block_1 .expbox").hide(); } }); var j = 2; $('.block_1 .expblock_1 .expadd').click(function() { var ecnt = j++; //alert(ecnt); $('.block_1 .expblock_1:last').before('<div class="expblock_'+ecnt+'"><div class="col-sm-4"><span class="expremove text-danger"><i class="fa fa-trash" aria-hidden="true"></i></span><div class="input-group"><div class="input-group-addon"></div><select name="exp_name_1[]" class="multiselect form-control"><option value="">--Select--</option><?php foreach ($expense as $exp) { ?><option value="<?php echo $exp['eid']; ?>"><?php echo $exp['ename']; ?></option><?php } ?></select><input class="form-control" type="text" name="exp_amt_1[]" placeholder="Amount"></div></div></div>'); $(".block_1 .multiselect").select2(); //multi select dropdown }); $('.expbox').on('click','.expremove',function() { $(this).parent().remove(); }); </script> </div><!--row--> <hr> </div><!--block1--> <div class="block"> <span class="add text-success"><i class="fa fa-plus-circle fa-2x" aria-hidden="true"></i></span> </div> </div> <div class="form-group"> <br> <input type="submit" name="save" value="Save" class="btn btn-primary"> </div> <?php echo form_close(); ?> </div> </div> </div> </div> </div> </div> </div> </section><!-- /.content --> </div><!-- /.content-wrapper --> <?php require_once(APPPATH.'views/webapp/footer.php');?> <script type="text/javascript"> var i = 2; $('.add').click(function() { var cnt = i++; var myHtml = $(".hide-block").html(); $('.block:last').before('<div class="block_'+cnt+'">'+myHtml+' <span class="remove text-danger"><i class="fa fa-minus-circle fa-2x" aria-hidden="true"></i></span></div><div class="row"><div class="text-center checkbox"><label><input class="oe_'+cnt+'" type="checkbox" name="ck" value="1"> Other Expenses</label></div> <div class="expbox_'+cnt+'"><div class="expblock_'+cnt+'"><div class="col-sm-4"><select name="exp_name_'+cnt+'[]" class="multiselect form-control"><option value="">--Select--</option><?php foreach ($expense as $exp) { ?><option value="<?php echo $exp['eid']; ?>"><?php echo $exp['ename']; ?></option><?php } ?></select><input class="form-control" type="text" name="exp_amt_'+cnt+'[]" placeholder="Amount"></div> </div><div class="expblock_'+cnt+'"><span class="ea expadd_'+cnt+' text-green"><i class="fa fa-plus-square fa-1x" aria-hidden="true"></i></span></div></div></div><hr>'); $(document).on('change', '.block_'+cnt+' .get_sub_unit', function (e) { var id = this.value; var base_url = '<?php echo site_url(); ?>'; var controller = 'webapp/office'; $.ajax({ url: base_url + controller + '/getUnit/' + id, type: 'POST', dataType: 'json', success: function (data) { $(".block_"+cnt+" .sub_unit").html(data).val(data); // $(".unit_val").val(data); }, }); }); /* var cnt = cnt; var latestBlock = "." + "block_"+cnt; latestBlock = latestBlock + " .pur_leg_block"; alert(latestBlock); var innerHtml = $(latestBlock).html(); console.log('+++++++++++++++++++++++'); console.log(innerHtml); var temp = '2'; $.ajax({ method: "POST", url: '<?php //echo base_url('webapp/master/ledger/test') ?>', data: temp, success: function (result) { result = $.parseJSON(result); if (result.status == 'Success') { $(latestBlock).html(result.html); $('.pur_leg_block').select2({allowClear: true}); } else { $(latestBlock).html(result.html); $('.pur_leg_block').select2({allowClear: true}); } } });*/ //$(".expbox_"+cnt+" .multiselect").select2(); //multi select dropdown //alert(cnt); $(function() { $(".expbox_"+cnt+"").hide(); $(".oe_"+cnt+"").click(function() { if($(this).is(":checked")) { $(".expbox_"+cnt+"").show(); } else { $(".expbox_"+cnt+"").hide(); } }); var k = 2; $('.expadd_'+cnt+'').click(function() { var kcnt = k++; $('.expblock_'+cnt+':last').before('<div class="expblock_'+cnt+'"><div class="col-sm-4"><span class="er expremove_'+cnt+' text-danger"><i class="fa fa-trash" aria-hidden="true"></i></span><div class="input-group"><div class="input-group-addon"></div><select name="exp_name_'+cnt+'[]" class="multiselect form-control"><option value="">--Select--</option><?php foreach ($expense as $exp) { ?><option value="<?php echo $exp['eid']; ?>"><?php echo $exp['ename']; ?></option><?php } ?></select><input class="form-control" type="text" name="exp_amt_'+cnt+'[]" placeholder="Amount"></div></div></div>'); $(".expbox_"+cnt+" .multiselect").select2(); //multi select dropdown }); $('.expbox_'+cnt+'').on('click','.expremove_'+cnt+'',function() { $(this).parent().remove(); }); $(".block_"+cnt+" .rate").keyup(function() { var rate = $(".block_"+cnt+" .rate").val(); var disc = $(".block_"+cnt+" .disc").val(); var qty = $(".block_"+cnt+" .qty").val(); if(qty == 0){ var tot = rate; }else{ var amt = rate*qty; var disc_amt =amt*disc/100; var tot = amt-disc_amt; var tot = tot.toFixed(3); } $(".block_"+cnt+" .at").text(tot); }); $(".block_"+cnt+" .qty").keyup(function() { var rate = $(".block_"+cnt+" .rate").val(); var disc = $(".block_"+cnt+" .disc").val(); var qty = $(".block_"+cnt+" .qty").val(); if(qty == 0){ var tot = rate*qty; }else{ var amt = rate*qty; var disc_amt =amt*disc/100; var tot = amt-disc_amt; var tot = tot.toFixed(3); } $(".block_"+cnt+" .at").text(tot); }); $(".block_"+cnt+" .disc").keyup(function() { var rate = $(".block_"+cnt+" .rate").val(); var disc = $(".block_"+cnt+" .disc").val(); var qty = $(".block_"+cnt+" .qty").val(); var amt = rate*qty; var disc_amt =amt*disc/100; var tot = amt-disc_amt; var tot = tot.toFixed(3); $(".block_"+cnt+" .at").text(tot); }); $(".block_"+cnt+" .sgst").change(function() { if ($(this).val() == "") { $(".block_"+cnt+" .ugst").attr("readonly", false); $(".block_"+cnt+" .igst").attr("readonly", false); $(".block_"+cnt+" .sgst_tax_amt").val(0); }else{ $(".block_"+cnt+" .ugst").attr("readonly", true); $(".block_"+cnt+" .igst").attr("readonly", true); var at = $(".block_"+cnt+" .amt_taxable").val(); var sgst = $(".block_"+cnt+" .sgst").val(); var res = at * sgst/100; $(".block_"+cnt+" .sgst_tax_amt").val(res); //console.log(res); } }); $(".block_"+cnt+" .ugst").change(function() { if ($(this).val() == "") { $(".block_"+cnt+" .sgst").attr("readonly", false); $(".block_"+cnt+" .igst").attr("readonly", false); $(".block_"+cnt+" .ugst_tax_amt").val(res); }else{ $(".block_"+cnt+" .sgst").attr("readonly", true); $(".block_"+cnt+" .igst").attr("readonly", true); var at = $(".block_"+cnt+" .amt_taxable").val(); var ugst = $(".block_"+cnt+" .ugst").val(); var res = at * ugst/100; $(".block_"+cnt+" .ugst_tax_amt").val(res); } }); $(".block_"+cnt+" .igst").change(function() { if ($(this).val() == "") { $(".block_"+cnt+" .sgst").attr("readonly", false); $(".block_"+cnt+" .ugst").attr("readonly", false); $(".block_"+cnt+" .cgst").attr("readonly", false); $(".block_"+cnt+" .igst_tax_amt").val(0); }else{ $(".block_"+cnt+" .sgst").attr("readonly", true); $(".block_"+cnt+" .ugst").attr("readonly", true); $(".block_"+cnt+" .cgst").attr("readonly", true); var at = $(".block_"+cnt+" .amt_taxable").val(); var igst = $(".block_"+cnt+" .igst").val(); var res = at * igst/100; $(".block_"+cnt+" .igst_tax_amt").val(res); } }); $(".block_"+cnt+" .cgst").change(function() { if ($(this).val() == "") { $(".block_"+cnt+" .igst").attr("readonly", false); $(".block_"+cnt+" .cgst_tax_amt").val(0); }else{ $(".block_"+cnt+" .igst").attr("readonly", true); var at = $(".block_"+cnt+" .amt_taxable").val(); var cgst = $(".block_"+cnt+" .cgst").val(); var res = at * cgst/100; $(".block_"+cnt+" .cgst_tax_amt").val(res); } }); $(".block_"+cnt+" .dis_one").keyup(function() { $(".block_"+cnt+" .dis_two").attr("readonly", true); if($('.block_'+cnt+' .dis_one').val() == ''){ $(".block_"+cnt+" .dis_two").attr("readonly", false); } }); $(".block_"+cnt+" .dis_two").keyup(function() { $(".block_"+cnt+" .dis_one").attr("readonly", true); if($('.block_'+cnt+' .dis_two').val() == ''){ $(".block_"+cnt+" .dis_one").attr("readonly", false); } }); }); $( ".cur-date" ).datepicker({ format: "dd-mm-yyyy", endDate: "today", maxDate: "today" }); $( ".date-picker" ).datepicker({ format: "dd-mm-yyyy" }); $(".block_"+cnt+" .multiselect").select2(); //multi select dropdown }); $('.optionBox').on('click','.remove',function() { $(this).parent().remove(); }); $(function() { $(".block_1 .rate").keyup(function() { var rate = $(".block_1 .rate").val(); var disc = $(".block_1 .disc").val(); var qty = $(".block_1 .qty").val(); if(qty == 0){ var tot = rate; }else{ var amt = rate*qty; var disc_amt =amt*disc/100; var tot = amt-disc_amt; var tot = tot.toFixed(3); } $(".block_1 .at").text(tot); }); $(".block_1 .qty").keyup(function() { var rate = $(".block_1 .rate").val(); var disc = $(".block_1 .disc").val(); var qty = $(".block_1 .qty").val(); if(disc == 0){ var tot = rate*qty; var tot = tot.toFixed(3); }else{ var amt = rate*qty; var disc_amt =amt*disc/100; var tot = amt-disc_amt; var tot = tot.toFixed(3); } $(".block_1 .at").text(tot); }); $(".block_1 .disc").keyup(function() { var rate = $(".block_1 .rate").val(); var disc = $(".block_1 .disc").val(); var qty = $(".block_1 .qty").val(); var amt = rate*qty; var disc_amt =amt*disc/100; var tot = amt-disc_amt; var tot = tot.toFixed(3); $(".block_1 .at").text(tot); }); $(".block_1 .sgst").change(function() { if ($(this).val() == "") { $(".block_1 .ugst").attr("readonly", false); $(".block_1 .igst").attr("readonly", false); $(".block_1 .sgst_tax_amt").val(0); }else{ $(".block_1 .ugst").attr("readonly", true); $(".block_1 .igst").attr("readonly", true); var at = $(".block_1 .amt_taxable").val(); var sgst = $(".block_1 .sgst").val(); var res = at * sgst/100; $(".block_1 .sgst_tax_amt").val(res); //console.log(res); } }); $(".block_1 .ugst").change(function() { if ($(this).val() == "") { $(".block_1 .sgst").attr("readonly", false); $(".block_1 .igst").attr("readonly", false); $(".block_1 .ugst_tax_amt").val(res); }else{ $(".block_1 .sgst").attr("readonly", true); $(".block_1 .igst").attr("readonly", true); var at = $(".block_1 .amt_taxable").val(); var ugst = $(".block_1 .ugst").val(); var res = at * ugst/100; $(".block_1 .ugst_tax_amt").val(res); } }); $(".block_1 .igst").change(function() { if ($(this).val() == "") { $(".block_1 .sgst").attr("readonly", false); $(".block_1 .ugst").attr("readonly", false); $(".block_1 .cgst").attr("readonly", false); $(".block_1 .igst_tax_amt").val(0); }else{ $(".block_1 .sgst").attr("readonly", true); $(".block_1 .ugst").attr("readonly", true); $(".block_1 .cgst").attr("readonly", true); var at = $(".block_1 .amt_taxable").val(); var igst = $(".block_1 .igst").val(); var res = at * igst/100; $(".block_1 .igst_tax_amt").val(res); } }); $(".block_1 .cgst").change(function() { if ($(this).val() == "") { $(".block_1 .igst").attr("readonly", false); $(".block_1 .cgst_tax_amt").val(0); }else{ $(".block_1 .igst").attr("readonly", true); var at = $(".block_1 .amt_taxable").val(); var cgst = $(".block_1 .cgst").val(); var res = at * cgst/100; $(".block_1 .cgst_tax_amt").val(res); } }); $(".block_1 .dis_one").keyup(function() { $(".block_1 .dis_two").attr("readonly", true); if($('.block_1 .dis_one').val() == ''){ $(".block_1 .dis_two").attr("readonly", false); } }); $(".block_1 .dis_two").keyup(function() { $(".block_1 .dis_one").attr("readonly", true); if($('.block_1 .dis_two').val() == ''){ $(".block_1 .dis_one").attr("readonly", false); } }); }); </script> <div class="hide-block hide"> <hr> <div class="row"> <div class="col-sm-5"> <div class="form-group"> <label>Item Name</label> (<span class="sub_unit text-danger"></span>) <span class="remOdd"> <select name="item_name[]" class="form-control multiselect get_sub_unit" required=""> <option value="">--Select--</option> <?php foreach ($items as $i) { ?> <option value="<?php echo $i['id']; ?>"><?php echo $i['item_name']; ?></option> <?php } ?> </select> </span> </div> </div> <input type="hidden" name="unit[]" value="" class="sub_unit"> <div class="col-sm-3"> <div class="form-group"> <label>Rate</label> <input type="text" value="0" name="rate[]" class="form-control rate" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" required> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>Quantity</label> <input type="text" value="0" name="qty[]" class="form-control qty" min="0" required oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"> </div> </div> <div class="col-sm-2"> <div class="form-group"> <label>Disc%</label> <input type="text" value="0" name="dis_two[]" class="form-control dis_two disc" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"> </div> </div> <!-- <div class="col-sm-2"> <div class="form-group"> <label>Unit</label> <input type="text" name="unit[]" class="form-control" required> </div> </div> --> </div> <div class="row"> <div class="col-sm-5"> <?php if($stg == 'sales'){ ?> <div class="form-group"> <label>Cr. Ledger Name <a href="#" onClick="openSalesDr()"> (Master)</a></label> <span class="prSalesLedger remOdd"> <select class="form-control multiselect" name="ledger_name_sub[]" required> <option value="">--SELECT--</option> <?php $gid = explode('|', $group[0]['gid']); $new_ledger = $this->model->get_gl($gid, $customer_id); foreach ($rec_group as $led) { ?> <option value="<?php echo $led['lid']; ?>"><?php echo $led['l_name']; ?></option> <?php } ?> </select> </span> </div> <?php }else{ ?> <div class="form-group"> <label>Dr. Ledger Name <a href="#" onClick="openPurchaseDr()"> (Master)</a></label> <span class="drPurLedger remOdd"> <select class="form-control multiselect" name="ledger_name_sub[]" required> <option value="">--SELECT--</option> <?php $gid = explode('|', $group[0]['gid']); $new_ledger = $this->model->get_gl($gid, $customer_id); foreach ($rec_group as $led) { ?> <option value="<?php echo $led['lid']; ?>"><?php echo $led['l_name']; ?></option> <?php } ?> </select> </span> </div> <?php } ?> </div> <!-- <div class="col-sm-2"> <div class="form-group"> <label>Effect</label> <select class="form-control" name="effect_sub[]"> <option value="debit">Debit</option> <option value="credit">Credit</option> </select> </div> </div> --> <!-- <div class="col-sm-3"> <div class="form-group"> <label>Discount</label> <input type="text" name="dis_one[]" class="form-control dis_one" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');"> </div> </div> --> <div class="col-sm-4"> <div class="form-group"> <label>Amount taxable</label> (<span class="at">0</span>) <input type="text" name="amt_taxable[]" class="form-control amt_taxable" oninput="this.value = this.value.replace(/[^0-9.]/g, ''); this.value = this.value.replace(/(\..*)\./g, '$1');" required=""> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>CESS Code</label> <input type="text" name="cess_code[]" class="form-control" required=""> </div> </div> </div> <div class="row"> <div class="col-sm-3"> <div class="form-group"> <label>SGST</label> <select class="form-control sgst" name="sgst[]"> <option value="">--SELECT--</option> <?php $exs = explode('|', $tax[0]['sgst']); for ($i=0; $i < count($exs); $i++) { ?> <option value="<?php echo $exs[$i]; ?>"><?php echo $exs[$i]; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>CGST</label> <select class="form-control cgst" name="cgst[]"> <option value="">--SELECT--</option> <?php $exc = explode('|', $tax[0]['cgst']); for ($k=0; $k < count($exc); $k++) { ?> <option value="<?php echo $exc[$k]; ?>"><?php echo $exc[$k]; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>UGST</label> <select class="form-control ugst" name="ugst[]"> <option value="">--SELECT--</option> <?php $exu = explode('|', $tax[0]['ugst']); for ($j=0; $j < count($exu); $j++) { ?> <option value="<?php echo $exu[$j]; ?>"><?php echo $exu[$j]; ?></option> <?php } ?> </select> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>IGST</label> <select class="form-control igst" name="igst[]"> <option value="">--SELECT--</option> <?php $exi = explode('|', $tax[0]['igst']); for ($v=0; $v < count($exi); $v++) { ?> <option value="<?php echo $exi[$v]; ?>"><?php echo $exi[$v]; ?></option> <?php } ?> </select> </div> </div> </div> <div class="row"> <div class="col-sm-3"> <div class="form-group"> <label>Amount of Tax</label> <input type="text" value="0" name="sgst_tax_amt[]" class="form-control sgst_tax_amt" readonly=""> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Amount of Tax</label> <input type="text" value="0" name="cgst_tax_amt[]" class="form-control cgst_tax_amt" readonly=""> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Amount of Tax</label> <input type="text" value="0" name="ugst_tax_amt[]" class="form-control ugst_tax_amt" readonly=""> </div> </div> <div class="col-sm-3"> <div class="form-group"> <label>Amount of Tax</label> <input type="text" value="0" name="igst_tax_amt[]" class="form-control igst_tax_amt" readonly=""> </div> </div> </div> <div class="row"> <div class="col-sm-4"> <div class="form-group"> <label>Lot No</label> <input type="text" name="lot_no[]" class="form-control" required=""> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Batch/Lot No. Mfg Date</label> <input type="text" name="mfg_date[]" class="form-control cur-date" required=""> </div> </div> <div class="col-sm-4"> <div class="form-group"> <label>Bat/Lot No. Expiry date</label> <input type="text" name="exp_date[]" class="form-control date-picker" required=""> </div> </div> </div> </div> <script> $(".m_ledger").submit(function (event) { event.preventDefault(); //$('#loading_spinner').show(); var form_data = $(".m_ledger").serialize(); var controller = 'webapp/master/ledger'; var base_url = '<?php echo site_url(); ?>'; $.ajax({ url: base_url + controller + '/add_ajax', type: 'POST', data: form_data, dataType: 'json', success: function (data) { $('.m_ledger')[0].reset(); $(".master_ledger").modal('hide'); $(".newLedger").html(data.html); //$(".form-div").load(" .form-div"); //window.location.reload(true); }, error: function () { alert("Something went wrong!"); //$('.errorLabel').show(); } }); }); function openModal(){ $(".master_ledger").modal('show'); $("#Box1").focus(); } //===================================== function openAll(){ $(".all_master_ledger").modal('show'); $("#Box1").focus(); } $(".all_m_ledger").submit(function (event) { event.preventDefault(); //$('#loading_spinner').show(); var form_data = $(".all_m_ledger").serialize(); var controller = 'webapp/master/ledger'; var base_url = '<?php echo site_url(); ?>'; $.ajax({ url: base_url + controller + '/add_ajax', type: 'POST', data: form_data, dataType: 'json', success: function (data) { $('.all_m_ledger')[0].reset(); $(".all_master_ledger").modal('hide'); $(".allLedger").html(data.html); $(".multiselect").select2(); //multi select dropdown //$(".form-div").load(" .form-div"); //window.location.reload(true); }, error: function () { alert("Something went wrong!"); //$('.errorLabel').show(); } }); }); function openPurchaseDr(){ $(".dr_pur_ledger").modal('show'); $("#Box1").focus(); } $(".pur_dr_ledger").submit(function (event) { event.preventDefault(); //$('#loading_spinner').show(); var form_data = $(".pur_dr_ledger").serialize(); var controller = 'webapp/master/ledger'; var base_url = '<?php echo site_url(); ?>'; $.ajax({ url: base_url + controller + '/add_ajax_two', type: 'POST', data: form_data, dataType: 'json', success: function (data) { $('.pur_dr_ledger')[0].reset(); $(".dr_pur_ledger").modal('hide'); $(".drPurLedger").html(data.html); $(".multiselect").select2(); //multi select dropdown //$(".form-div").load(" .form-div"); //window.location.reload(true); }, error: function () { alert("Something went wrong!"); //$('.errorLabel').show(); } }); }); function openSalesDr(){ $(".dr_sl_ledger").modal('show'); $("#Box1").focus(); } $(".sl_dr_ledger").submit(function (event) { event.preventDefault(); //$('#loading_spinner').show(); var form_data = $(".sl_dr_ledger").serialize(); var controller = 'webapp/master/ledger'; var base_url = '<?php echo site_url(); ?>'; $.ajax({ url: base_url + controller + '/add_ajax_two', type: 'POST', data: form_data, dataType: 'json', success: function (data) { $('.sl_dr_ledger')[0].reset(); $(".dr_sl_ledger").modal('hide'); $(".prSalesLedger").html(data.html); $(".multiselect").select2(); //multi select dropdown //$(".form-div").load(" .form-div"); //window.location.reload(true); }, error: function () { alert("Something went wrong!"); //$('.errorLabel').show(); } }); }); function hide(obj){ if (obj.prop("checked")) { $('.cheque').hide(); $('.empty').val(''); $(".empty").prop('required',false); } } $(document).ready(function () { $('.form-two').hide(); }); function show(obj){ var frmCls = obj.attr("data-form"); if(frmCls == "form-one"){ $('.form-one').show(); $('.form-two').hide(); }else{ $('.form-two').show(); $('.form-one').hide(); } } $(".multiselectz").select2(); //multi select dropdown $(document).on('change', '.get_unit', function (e) { var id = this.value; var base_url = '<?php echo site_url(); ?>'; var controller = 'webapp/office'; $.ajax({ url: base_url + controller + '/getUnit/' + id, type: 'POST', dataType: 'json', success: function (data) { $(".unit").html(data).val(data); // $(".unit_val").val(data); }, }); }); </script> <!-- script for form two--> <script type="text/javascript" src="<?php echo base_url(); ?>webapp/js/form_two.js"></script> <script type="text/javascript"> $('.gr').on('change', function(){ var gid = $(this).val(); var controller = 'webapp/master/ledger'; var base_url = '<?php echo site_url(); ?>'; $.ajax({ url: base_url + controller + '/get_subgr/'+gid, type: 'POST', dataType: 'json', success: function (data) { $(".sgr").html(data.html); }, error: function () { alert("Something went wrong!"); //$('.errorLabel').show(); } }); }); </script>s
Copyright ©2021 || Defacer Indonesia