1401 lines
39 KiB
PHP
1401 lines
39 KiB
PHP
<script type="text/javascript" src="<?php echo base_url();?>assets/Autocomplete/jquery.autocomplete.js"></script>
|
|
<?php //print_r($dropdownvalues);?>
|
|
<style>
|
|
|
|
/* Style the tab */
|
|
.tab {
|
|
overflow: hidden;
|
|
background-color:#A1887F;
|
|
|
|
}
|
|
.modalfooter
|
|
{
|
|
background-color:white; !important
|
|
}
|
|
/* Style the buttons inside the tab */
|
|
.tab button {
|
|
background-color: inherit;
|
|
float: left;
|
|
border: none;
|
|
outline: none;
|
|
cursor: pointer;
|
|
padding: 14px 16px;
|
|
transition: 0.3s;
|
|
font-size: 17px;
|
|
}
|
|
|
|
/* Change background color of buttons on hover */
|
|
.tab button:hover {
|
|
background-color: #ddd;
|
|
}
|
|
|
|
/* Create an active/current tablink class */
|
|
.tab button.active {
|
|
background-color: #ccc;
|
|
}
|
|
|
|
/* Style the tab content */
|
|
.tabcontent {
|
|
display: none;
|
|
/* padding: 6px 12px; */
|
|
/* border: 1px solid #ccc; */
|
|
/* border-top: none; */
|
|
}
|
|
.autocomplete-suggestion{
|
|
cursor:pointer;
|
|
background-color:skyblue;
|
|
/* background-color: darkgrey; */
|
|
outline: 1px solid slategrey;
|
|
}
|
|
.modal
|
|
{
|
|
padding-right:25% ! important;
|
|
}
|
|
.dataTables_paginate
|
|
{
|
|
margin-top: -5%;
|
|
}
|
|
.dataTables_wrapper {
|
|
padding-bottom: 0px;
|
|
}
|
|
.badge
|
|
{
|
|
color:red; background-color:#fff;
|
|
}
|
|
|
|
legend{
|
|
color:#00c0ef ! important;
|
|
}
|
|
|
|
.content {
|
|
Padding:0% ! important;
|
|
}
|
|
</style>
|
|
<div class="content-wrapper" style="min-height: 537px;">
|
|
<!-- Content Header (Page header) -->
|
|
<section class="content-header">
|
|
<h1>
|
|
<center>Add New Receipt and Payment</center>
|
|
</h1>
|
|
</section>
|
|
|
|
<section class="content">
|
|
<div style="text-align:right;">
|
|
<a href="<?php echo base_url() ?>cashbook/incomeExpenseList" class="btn btn-primary" value="Back"/>Back</a>
|
|
</div><br><br>
|
|
|
|
<div style="">
|
|
<div class="tab">
|
|
<button class="tablinks active" onclick="openEvent(event, 'Receipt')">Receipt</button>
|
|
<button class="tablinks" onclick="openEvent(event, 'Payment')">Payment</button>
|
|
</div>
|
|
</div><!-- tab -->
|
|
|
|
<div id="Receipt" class="tabcontent" style="display: block;">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="box box-primary">
|
|
<div class="box-header">
|
|
<h3 class="box-title">Add New Receipt</h3>
|
|
</div>
|
|
|
|
<!-- <form role="form" id="addIncomeExpense" action="<?php echo base_url() ?>addIncomeExpense" enctype="multipart/form-data" method="post"> -->
|
|
<form role="form" id="addReceipt" action="<?php echo base_url() ?>cashbook/addReceipt" enctype="multipart/form-data" method="post">
|
|
|
|
<div class="box-body">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<!-- <div class="col-md-3">
|
|
<div class="form-group">
|
|
<b><span for="Accountcode">Select Account type:</span> </b> </br></br>
|
|
<input type="radio" onclick = loadAccountType(this.id); id="myradio1" name="myradio" value="1" checked>RECEIPT
|
|
<input type="radio" onclick = loadAccountType(this.id); id="myradio2" name="myradio" value="2" >PAYMENT
|
|
</div>
|
|
</div> -->
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="Accountname">Account Name Select:</span> </b><span style="color:red">*</span></br></br>
|
|
<select class="form-control required " required id="Recepitaccode" required name="accode">
|
|
<option value="-1">Account Name Select</option>
|
|
</select>
|
|
</div></div>
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="AccountDate">Date:</span></b><span style="color:red">*</span></br></br>
|
|
<input type="text" class="form-control required" id="Date" name="Date">
|
|
</div></div>
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="towhome" id="towhom">Received From:</span></b><span style="color:red">*</span></br></br>
|
|
<input type="text" class="form-control required" id="towhome" name="towhome">
|
|
</div></div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<b><span for="Suppliername">Select Supplier:</span> </b><span style="color:red">*</span></br></br>
|
|
<select class="form-control select2 required" id="supplier" name="supplier">
|
|
<option value="-1">Select Supplier</option>
|
|
</select>
|
|
</div></div>
|
|
<a data-target='#Addsup' data-toggle="modal" href="#Addsup">Add New Supplier</a>
|
|
</div><!--/ col-md -12-->
|
|
|
|
|
|
</div><!-- /row -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<input type="checkbox" id="gst" name="gsttoggle"> GST
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row" id="gstarea" style="border:1px dashed; margin-left:0px;margin-right:0px;display:none;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<b><span for="Invoiceno">Invoice No:</span></b>
|
|
<input type="text" class="form-control required" id="Invoiceno" name="Invoiceno">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<b><span for="Merchant">Merchant Name:</span></b>
|
|
<input type="text" class="form-control required" id="merchant" name="merchant">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<b>
|
|
<span for="Merchantgst">Merchant GST No:</span></b>
|
|
<input id="merchantgst" name="Merchantgst" class="form-control">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<b>
|
|
<span for="HSN/SAC Code">HSN/SAC Code:</span></b>
|
|
<input id="hsn" name="hsn" class="form-control" >
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<b>
|
|
<span for="ValuebeforeGST">Value before GST(₹):</span></b>
|
|
<input id="valuebeforegST" name="valuebeforegST" style="text-align:right;" class="form-control" onkeypress="return isNumberKey(event)" onchange="calculateTotal()">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<b>
|
|
<span for="SGST">SGST(₹):</span>
|
|
</b>
|
|
<input type="text" class="form-control" style="text-align:right;" onchange="GSTvalue(this.id)" id="SGST" name="SGST" onkeypress="return isNumberKey(event)">
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<b>
|
|
<span for="CGST">CGST(₹):</span>
|
|
</b>
|
|
<input type="text" class="form-control" id="CGST" style="text-align:right;" name="CGST" onkeypress="return isNumberKey(event)" onchange="GSTvalue(this.id)">
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group">
|
|
<b>
|
|
<span for="IGST">IGST(₹):</span></b>
|
|
|
|
<input type="text" class="form-control" style="text-align:right;" onkeypress="return isNumberKey(event)" onchange = GSTvalue(this.id) id="IGST" name="IGST">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> <!-- /End of GST Area -->
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<b><span for="Total">Total Amount(₹):</span></b><!--<span style="color:red">*</span>-->
|
|
|
|
<input type="text" class="form-control" id="totalamount" name="totalamount" onkeypress="return isNumberKey(event)" style="text-align:right;">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<b><span for="Description">Description:</span></b>
|
|
|
|
<textarea class="form-control" id="description" name="description" >
|
|
</textarea>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<b><span for="Description">File Upload:</span></b>
|
|
<img id="receiptslip" alt="your image" style="width: 139px;"/><br/>
|
|
<input type='file' input accept=".JPG,.PNG,.PDF" onchange="readURL(this,this.id);" id="receiptfile" name="myfile" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div><!-- /.box-body -->
|
|
|
|
<div class="box-footer" style="text-align:right">
|
|
<input type="button" onclick="validate();" class="btn btn-primary" value="Submit" />
|
|
<input type="reset" class="btn btn-primary" value="Reset" />
|
|
</div>
|
|
|
|
</form>
|
|
</div><!-- box-primary div-->
|
|
</div><!-- col-md-12 div-->
|
|
</div><!-- row div-->
|
|
</div><!-- tabcontent-->
|
|
|
|
<!--- Payment tab content start -->
|
|
<div id="Payment" class="tabcontent">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
|
|
<div class="box box-primary">
|
|
<div class="box-header">
|
|
<h3 class="box-title">Add New Payment</h3>
|
|
</div>
|
|
|
|
<form role="form" id="addPayment" action="<?php echo base_url() ?>cashbook/addPayment" enctype="multipart/form-data" method="post">
|
|
<div class="box-body">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="PaymentDate">Date:</span></b><span style="color:red">*</span></br></br>
|
|
<input type="text" class="form-control required" id="PaymentDate" name="PaymentDate" required>
|
|
</div></div>
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="PaymentPaidto" id="Paidto">Paid To</span></b><span style="color:red">*</span></br></br>
|
|
<input type="text" class="form-control required" id="PaymentPaidto" name="PaymentPaidto" required>
|
|
</div></div>
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="Suppliername">Select Supplier:</span> </b><span style="color:red">*</span></br></br>
|
|
<select class="form-control select2 required" id="Paymentsupplier" name="Paymentsupplier">
|
|
<option value="-1">Select Supplier</option>
|
|
</select>
|
|
</div></div>
|
|
<a data-target='#Addsup' data-toggle="modal" href="#Addsup">Add New Supplier</a>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="PaymentMerchant">Merchant Name:</span></b></br></br>
|
|
<input type="text" class="form-control required" id="Paymentmerchant" name="Paymentmerchant">
|
|
</div></div>
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="PaymentMerchantgst">Merchant GST No:</span></b></br></br>
|
|
<input id="Paymentmerchantgst" name="PaymentMerchantgst" class="form-control">
|
|
</div></div>
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="Paymentvoucher">Voucher Code</span></b><span style="color:red">*</span></br></br>
|
|
<input id="Paymentvouchercode" name="Paymentvouchercode" class="form-control" required onkeypress="return isNumberKey(event)" >
|
|
</div></div>
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="HSN/SAC Code">HSN/SAC Code:</span></b></br></br>
|
|
<input id="Paymenthsn" name="Paymenthsn" class="form-control" >
|
|
</div></div>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-12">
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="ValuebeforeGST">Value before GST(₹):</span></b><!--<span style="color:red">*</span>--></br></br>
|
|
<input id="PaymentvaluebeforegST" name="PaymentvaluebeforegST" style="text-align:right;" class="form-control" onkeypress="return isNumberKey(event)" value='0.00' readonly>
|
|
</div></div>
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="SGST">SGST(₹):</span></b></br></br>
|
|
<input type="text" class="form-control" style="text-align:right;" onchange="PaymentGSTvalue(this.id);" id="PaymentSGST" name="PaymentSGST" onkeypress="return isNumberKey(event)">
|
|
</div> </div>
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="CGST">CGST(₹):</span></b></br></br>
|
|
<input type="text" class="form-control" id="PaymentCGST" style="text-align:right;" name="PaymentCGST" onkeypress="return isNumberKey(event)" onchange="PaymentGSTvalue(this.id);">
|
|
</div></div>
|
|
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="IGST">IGST(₹):</span></b></br></br>
|
|
<input type="text" class="form-control" style="text-align:right;" onkeypress="return isNumberKey(event)" onchange = "PaymentGSTvalue(this.id);" id="PaymentIGST" name="PaymentIGST" >
|
|
</div></div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row" style="border:1px dashed; margin-left:0px;margin-right:0px;">
|
|
<div class="col-md-12">
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="PaymentAccname">Account Name Select:</span><span style="color:red">*</span>
|
|
<select class="form-control required Pay" required id="Paymentaccode1" required name="mydata1[Paymentaccode1]" onchange="changevalue();">
|
|
<option value="-1">Account Name Select</option>
|
|
</select>
|
|
</div></div>
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<b><span for="Decription"><b>Account Description:</b></span>
|
|
<input type="text" class="form-control" style="text-align:right;" id="subdescription1" name="mydata1[subdescription1]" requried>
|
|
</div></div>
|
|
|
|
<div class="col-md-3"><div class="form-group">
|
|
<span for="amount"><b>Amount(₹):</b></span><span style="color:red">*</span>
|
|
<input type="text" class="form-control" required style="text-align:right;" id="Paymentamount1" name="mydata1[Paymentamount1]" onchange="paymenttotalamount();" onkeypress="return isNumberKey(event)" requried>
|
|
</div></div>
|
|
|
|
<!-- <div class="col-md-offset-10 col-md-2"> -->
|
|
<div class="col-md-offset-2 col-md-1" style="padding-top:15px;padding-left:0px"><div class="form-group">
|
|
<!-- <input type="button" class="btn btn-primary" id="addmore" value="+ Add More"/> -->
|
|
<input type="button" id ="addmorebutton" onclick="add_more();" value=" + ADD MORE">
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="newdiv"></div><!-- this div for add more section-->
|
|
|
|
<input type="hidden" name="hidecounter" id="hidecounter" value="1" />
|
|
<input type="hidden" name="hideconstant" id="hideconstant" value="1" />
|
|
|
|
<div class="row">
|
|
<div class="col-md-12"><div class="col-md-4">
|
|
<b><span for="Total">Total Amount(₹):</span></b><!--<span style="color:red">*</span>-->
|
|
<input type="text" class="form-control" id="Paymenttotalamount" name="Paymenttotalamount" onkeypress="return isNumberKey(event)" style="text-align:right;" value='0.00' readonly>
|
|
</div></div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<b><span for="Description">Description:</span></b>
|
|
<textarea class="form-control" id="Paymentdescription" name="Paymentdescription" >
|
|
</textarea>
|
|
</div>
|
|
|
|
<div class="col-md-4">
|
|
<!-- <b><span for="fileupload">File Upload:</span></b> -->
|
|
<b><span for="Description">File Upload:</span></b>
|
|
<img id="paymentslip" alt="your image" style="width: 139px;"/><br/>
|
|
<input type='file' input accept=".JPG,.PNG,.PDF" onchange="readURL(this,this.id);" id="paymentfile" name="myfile" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div><!-- /.box-body -->
|
|
|
|
<div class="box-footer" style="text-align:right">
|
|
<input type="button" onclick="valid()" class="btn btn-primary" value="Submit" />
|
|
<input type="reset" class="btn btn-primary" value="Reset" />
|
|
</div>
|
|
|
|
</form>
|
|
</div><!-- box-primary div-->
|
|
</div><!-- col-md-12 div-->
|
|
</div><!-- row div-->
|
|
</div><!-- tabcontent-->
|
|
</section><!-- content section -->
|
|
|
|
<div>
|
|
<div align="right">
|
|
|
|
<div id="Addsup" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<form>
|
|
<div class="modal-content" style="width:1030px;font-size:12px;">
|
|
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
|
|
<center><h4> New Supplier Details</h4></center>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-10 col-md-offset-1"><br/>
|
|
<div class="box-body">
|
|
<div align="left">
|
|
<legend>Supplier Information</legend>
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<span for="SupplierName">Supplier Name</span><span class="badge">*</span>
|
|
<input type="text" name="SupplierName" onkeypress="return onlyAlphabets(event);" maxlength="100" id="supplierName" class="form-control" required>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<span for="ContactNumber">Contact Number</span><span class="badge">*</span>
|
|
<input type="text" name="ContactNumber" onchange="return getContactNumberValidation();" id="ContactNumber" required maxlength="13" class="form-control" title="Please Enter Mobile Number (or) Telephone Number" onkeypress="return isNumberKey(event)">
|
|
</div>
|
|
|
|
|
|
<div class="col-md-3">
|
|
<span for="AlternateContactNumber">Alternate Contact Number</span>
|
|
<input type="text" name="AlternateContactNumber" id="AlternateContactNumber" maxlength="13" class="form-control" title="Please Enter Mobile Number (or) Telephone Number" onkeypress="return isNumberKey(event)">
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<span for="EmailAddress">Email ID</span><span class="badge">*</span>
|
|
<input type="email" name="emailid" id="emailid" required maxlength="100" class="form-control">
|
|
</div>
|
|
|
|
<legend>Address Details</legend>
|
|
<!-- Text input-->
|
|
<div class="col-md-12" >
|
|
<div class="col-md-12"><span for="Address2">Address</span><span class="badge">*</span>
|
|
<input type="text" class="form-control required" id="Address" name="Address" maxlength="500" required>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="box-footer modalfooter" style="text-align:right" >
|
|
<a class="btn btn-primary font AddSupplier" ID="AddSupplier" > <span class="bold">Save</span></a>
|
|
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div><!-- content-wrapper div-->
|
|
|
|
<script>
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
var t = [];
|
|
var ex = [];
|
|
var inc = [];
|
|
var supp =[];
|
|
|
|
$('#SGST').val('0.00');
|
|
$('#CGST').val('0.00');
|
|
$('#IGST').val('0.00');
|
|
$('#PaymentSGST').val('0.00');
|
|
$('#PaymentCGST').val('0.00');
|
|
$('#PaymentIGST').val('0.00');
|
|
|
|
t= <?php echo json_encode($dropdownvalues)?>;
|
|
|
|
var options = '';
|
|
|
|
// console.log(t);
|
|
|
|
$.each(t,function(i,ob){
|
|
if(ob.type == 'RECEIPT')
|
|
{
|
|
options += "<option value="+ob.code+">"+ob.name+"</option>";
|
|
}
|
|
});
|
|
|
|
$('#Recepitaccode').append(options);
|
|
|
|
$.each(t,function(i,item){
|
|
|
|
if(item.type == 'PAYMENT')
|
|
{
|
|
$("#Paymentaccode1").append( $('<option></option>').val(item.code).html(item.name));
|
|
}
|
|
});
|
|
|
|
supp = <?php echo json_encode($getsupplier)?>;
|
|
$.each(supp,function(s,supp){
|
|
$("#supplier,#Paymentsupplier").append( $('<option></option>').val(supp.SupplierID).html(supp.SupplierID+' - '+supp.SupplierName));
|
|
});
|
|
|
|
|
|
$('#gst').click(function(){
|
|
$('#gstarea').toggle();
|
|
});
|
|
// $('#paymentgst').click(function(){
|
|
// $('#paymentgstarea').toggle();
|
|
// });
|
|
$('#towhom').text('Received From:');
|
|
|
|
$("#Date").datepicker({
|
|
//minDate : new Date(year-SIAStartYear,1,1),
|
|
maxDate :'now',
|
|
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,
|
|
});
|
|
/* This is For payment account date */
|
|
$("#PaymentDate").datepicker({
|
|
maxDate :'now',
|
|
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,
|
|
});
|
|
|
|
});
|
|
|
|
|
|
$(document).ready(function()
|
|
{
|
|
|
|
$("#supplier,#Paymentsupplier").select2();
|
|
|
|
/**** autocomplete ****/
|
|
$('#merchant').autocomplete({
|
|
|
|
onSearchStart: function (query) {
|
|
$('#merchant').autocomplete("option", "minLength", 0);
|
|
},
|
|
|
|
serviceUrl: "<?php echo base_url();?>cashbook/autocomplete",
|
|
onSelect: function (suggestion) {
|
|
|
|
var data = suggestion.SupplierName;
|
|
var selectedvalue = $('input[name=merchant]').val();
|
|
if(selectedvalue != ' ' )
|
|
{
|
|
|
|
$.ajax({
|
|
data:{id:selectedvalue},
|
|
type:"POST",
|
|
url:"<?php echo base_url();?>cashbook/getSupplierDtls",
|
|
success:function(data) {
|
|
var supplier_gstno = '';
|
|
if(data != '')
|
|
{
|
|
|
|
data = JSON.parse(data);
|
|
$.each(data,function(i,arr){
|
|
supplier_gstno = arr.GSTNO;
|
|
});
|
|
$("#merchantgst").val(supplier_gstno);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
/**** receipt autocomplete ends here ********/
|
|
|
|
|
|
$('#Paymentmerchant').autocomplete({
|
|
|
|
onSearchStart: function (query) {
|
|
$('#Paymentmerchant').autocomplete("option", "minLength", 0);
|
|
},
|
|
|
|
serviceUrl: "<?php echo base_url();?>cashbook/autocomplete",
|
|
onSelect: function (suggestion) {
|
|
|
|
var data = suggestion.SupplierName;
|
|
var selectedvalue = $('input[name=Paymentmerchant]').val();
|
|
if(selectedvalue != ' ' )
|
|
{
|
|
|
|
$.ajax({
|
|
data:{id:selectedvalue},
|
|
type:"POST",
|
|
url:"<?php echo base_url();?>cashbook/getSupplierDtls",
|
|
success:function(data) {
|
|
var supplier_gstno = '';
|
|
if(data != '')
|
|
{
|
|
|
|
data = JSON.parse(data);
|
|
$.each(data,function(i,arr){
|
|
supplier_gstno = arr.GSTNO;
|
|
});
|
|
$("#Paymentmerchantgst").val(supplier_gstno);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
/**** payment autocomplete ends here ********/
|
|
|
|
});
|
|
function readURL(input,id) {
|
|
|
|
//alert(id);
|
|
if (input.files && input.files[0]) {
|
|
var reader = new FileReader();
|
|
|
|
reader.onload = function (e) {
|
|
|
|
if(id == "receiptfile"){
|
|
$('#receiptslip')
|
|
.attr('src', e.target.result)
|
|
.width(100)
|
|
.height(100);
|
|
}
|
|
else{
|
|
$('#paymentslip')
|
|
.attr('src', e.target.result)
|
|
.width(100)
|
|
.height(100);
|
|
}
|
|
// alert(e.target.result);
|
|
};
|
|
|
|
reader.readAsDataURL(input.files[0]);
|
|
if(id == "receiptfile"){
|
|
$('#receiptslip').val(input.files[0]['name']);}
|
|
else{
|
|
$('#paymentslip').val(input.files[0]['name']);}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
function isNumberKey(evt)
|
|
{
|
|
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
|
if (charCode != 46 && charCode > 31
|
|
&& (charCode < 48 || charCode > 57))
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
function loadAccountType(id)
|
|
{
|
|
//alert('called'+id);
|
|
var id=id;
|
|
var t = [];
|
|
var ex = [];
|
|
var inc = [];
|
|
t= <?php echo json_encode($dropdownvalues)?>;
|
|
|
|
// if(id == 'myradio1')
|
|
// {
|
|
// // alert('INCOME clicked');
|
|
|
|
// $('#Recepitaccode').find('option').remove().end().append('<option value="-1">Select Account Name</option>').val('Select Account Code');
|
|
|
|
// $.each(t,function(i,item){
|
|
// if(item.type == 'RECEIPT')
|
|
// {
|
|
// $("#Recepitaccode").append( $('<option></option>').val(item.code).html(item.name));
|
|
// }
|
|
// });
|
|
|
|
|
|
// }
|
|
// if(id == 'myradio2')
|
|
// {
|
|
// //alert('expense clicked');
|
|
|
|
// $('#Recepitaccode').find('option').remove().end().append('<option value="-1">Select Account Name</option>').val('Select Account Code');
|
|
|
|
// $.each(t,function(i,item){
|
|
// if(item.type == 'PAYMENT')
|
|
// {
|
|
// $("#Recepitaccode").append( $('<option></option>').val(item.code).html(item.name));
|
|
// }
|
|
// });
|
|
|
|
// }
|
|
//alert('final alert');
|
|
}
|
|
|
|
|
|
// $("#accode").append( $('<option></option>').val(item.code).html(item.name));
|
|
|
|
// $('#pages').append(newOption);
|
|
</script>
|
|
|
|
<script>
|
|
var counter = 1;
|
|
var counterConstant = 1;
|
|
|
|
function openEvent(evt, cityName) {
|
|
var i, tabcontent, tablinks;
|
|
tabcontent = document.getElementsByClassName("tabcontent");
|
|
for (i = 0; i < tabcontent.length; i++) {
|
|
tabcontent[i].style.display = "none";
|
|
}
|
|
tablinks = document.getElementsByClassName("tablinks");
|
|
for (i = 0; i < tablinks.length; i++) {
|
|
tablinks[i].className = tablinks[i].className.replace("active", "");
|
|
}
|
|
document.getElementById(cityName).style.display = "block";
|
|
evt.currentTarget.className += " active";
|
|
}
|
|
|
|
|
|
function validate()
|
|
{
|
|
var Recepitaccode = $('#Recepitaccode').val();
|
|
var date = $('#Date').val();
|
|
var towhome = $('#towhome').val();
|
|
var gstcheck = document.getElementById("gst").checked;
|
|
var Invoiceno = $('#Invoiceno').val();
|
|
var merchant = $('#merchant').val();
|
|
var mergst = $('#merchantgst').val();
|
|
var beforegst = $('#valuebeforegST').val();
|
|
var sgst = $('#SGST').val();
|
|
var cgst = $('#CGST').val();
|
|
var igst = $('#IGST').val();
|
|
var total = $('#totalamount').val();
|
|
var errorflag = 0;
|
|
|
|
|
|
if(Recepitaccode < 0)
|
|
{
|
|
errorflag++;
|
|
}
|
|
|
|
if(date == '')
|
|
{
|
|
errorflag++;
|
|
}
|
|
|
|
if(total == '')
|
|
{
|
|
errorflag++;
|
|
}
|
|
|
|
if(towhome == '')
|
|
{
|
|
errorflag++;
|
|
}
|
|
|
|
if(gstcheck == true)
|
|
{
|
|
|
|
if((merchant == '') || (mergst == '') || (Invoiceno == '') || (beforegst == '') || (sgst == '') || (cgst == '') || (igst == ''))
|
|
{
|
|
errorflag++;
|
|
}
|
|
else
|
|
{
|
|
// calculation part
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
if(errorflag != 0)
|
|
{
|
|
alert("Please Provide All Details..!");
|
|
return false;
|
|
}
|
|
|
|
|
|
//$('#addIncomeExpense').submit();
|
|
$('#addReceipt').submit();
|
|
|
|
}
|
|
|
|
function GSTvalue(id)
|
|
{
|
|
|
|
var sgst = $('#SGST').val();
|
|
if(sgst == ''){
|
|
sgst = "0.00" ;
|
|
|
|
}else{
|
|
sgst = sgst;
|
|
}
|
|
var cgst = $('#CGST').val();
|
|
if(cgst == ''){
|
|
cgst = "0.00" ;
|
|
|
|
}else{
|
|
cgst = cgst;
|
|
}
|
|
var igst = $('#IGST').val();
|
|
if(igst == ''){
|
|
igst = "0.00" ;
|
|
}else{
|
|
igst = igst;
|
|
}
|
|
var beforegst = $('#valuebeforegST').val();
|
|
|
|
$('#valuebeforegST').val((parseFloat(beforegst).toFixed(2)));
|
|
if(id == 'SGST')
|
|
{
|
|
$('#CGST').val(parseFloat(sgst).toFixed(2));
|
|
$('#SGST').val(parseFloat(sgst).toFixed(2));
|
|
$('#IGST').val('0.00');
|
|
calculateTotal();
|
|
}
|
|
|
|
if(id == 'CGST')
|
|
{
|
|
$('#CGST').val(parseFloat(cgst).toFixed(2));
|
|
$('#SGST').val(parseFloat(cgst).toFixed(2));
|
|
$('#IGST').val('0.00');
|
|
calculateTotal();
|
|
}
|
|
|
|
if(id == 'IGST')
|
|
{
|
|
$('#CGST').val('0.00');
|
|
$('#SGST').val('0.00');
|
|
$('#IGST').val(parseFloat(igst).toFixed(2));
|
|
calculateTotal();
|
|
}
|
|
|
|
}
|
|
|
|
function calculateTotal()
|
|
{
|
|
var sgst = $('#SGST').val();
|
|
var cgst = $('#CGST').val();
|
|
var igst = $('#IGST').val();
|
|
var beforegst = $('#valuebeforegST').val();
|
|
|
|
var total = parseFloat(sgst)+parseFloat(cgst)+parseFloat(igst)+parseFloat(beforegst);
|
|
|
|
$('#totalamount').val((total.toFixed(2)));
|
|
}
|
|
|
|
// $('#myradio1').click(function(){
|
|
// $('#towhom').text('Received From:');
|
|
// });
|
|
// $('#myradio2').click(function(){
|
|
// $('#towhom').text('Paid To:');
|
|
// });
|
|
|
|
function PaymentGSTvalue(id)
|
|
{
|
|
|
|
var sgst = $('#PaymentSGST').val();
|
|
if(sgst == ''){
|
|
sgst = '0.00' ;
|
|
//alert('qwe'+sgst);
|
|
}else{
|
|
sgst = sgst;
|
|
}
|
|
|
|
var cgst = $('#PaymentCGST').val();
|
|
if(cgst == ''){
|
|
cgst = '0.00' ;
|
|
//alert('qwe'+sgst);
|
|
}else{
|
|
cgst = cgst;
|
|
}
|
|
|
|
var igst = $('#PaymentIGST').val();
|
|
if(igst == ''){
|
|
igst = '0.00' ;
|
|
//alert('qwe'+sgst);
|
|
}else{
|
|
igst = igst;
|
|
}
|
|
|
|
|
|
if(id == 'PaymentSGST')
|
|
{
|
|
$('#PaymentCGST').val(parseFloat(sgst).toFixed(2));
|
|
$('#PaymentSGST').val(parseFloat(sgst).toFixed(2));
|
|
$('#PaymentIGST').val('0.00');
|
|
paymenttotalamount()
|
|
}
|
|
|
|
if(id == 'PaymentCGST')
|
|
{
|
|
$('#PaymentCGST').val(parseFloat(cgst).toFixed(2));
|
|
$('#PaymentSGST').val(parseFloat(cgst).toFixed(2));
|
|
$('#PaymentIGST').val('0.00');
|
|
paymenttotalamount();
|
|
}
|
|
|
|
|
|
if(id == 'PaymentIGST')
|
|
{
|
|
$('#PaymentCGST').val('0.00');
|
|
$('#PaymentSGST').val('0.00');
|
|
$('#PaymentIGST').val(parseFloat(igst).toFixed(2));
|
|
paymenttotalamount()
|
|
}
|
|
|
|
}
|
|
|
|
//var temparray = [];
|
|
//var ddvalue = '';
|
|
function add_more()
|
|
{
|
|
if($("option:selected", $("#Paymentaccode1")).val() == '-1')
|
|
{
|
|
alert('Select/Choose account name');
|
|
$('#Paymentaccode1').focus();
|
|
return false;
|
|
}
|
|
// else if($('#subdescription1').val() == '')
|
|
// {
|
|
// alert("Provide Account description..!");
|
|
// $('#subdescription1').focus();
|
|
// return false;
|
|
// }
|
|
else if($('#Paymentamount1').val() == '')
|
|
{
|
|
alert("Provide Amount data..!");
|
|
$('#Paymentamount1').focus();
|
|
return false;
|
|
|
|
}
|
|
else
|
|
{
|
|
//if(Paymentaccode1 != -1 && subdescription1 !=" " && Paymentamount1 != " "){
|
|
counter++;
|
|
counterConstant++;
|
|
|
|
var div = document.createElement('div');
|
|
div.id = "divid"+counterConstant;
|
|
div.className="row";
|
|
div.style.cssText = "border:1px dashed; margin-left:0px;margin-right:0px;";
|
|
div.innerHTML='<div class="col-md-12"><div class="col-md-3"><div class="form-group"><b>'+
|
|
'<span for="name">Account Name Select:</span>'+
|
|
'<select class="form-control required Pay" required id="Paymentaccode'+counterConstant+'" required onchange="changevalue();" name="mydata'+counterConstant+'[Paymentaccode'+counterConstant+']">'+
|
|
'<option value="-1">Account Name Select</option>'+
|
|
'</select>'+
|
|
'</div></div>'+
|
|
'<div class="col-md-3"><div class="form-group">'+
|
|
'<span for="subDecription"><b>Account Description:</b></span> '+
|
|
'<input type="text" class="form-control required" style="text-align:right;" id="subdescription'+counterConstant+'" name="mydata'+counterConstant+'[subdescription'+counterConstant+']">'+
|
|
'</div></div>'+
|
|
'<div class="col-md-3"><div class="form-group">'+
|
|
'<span for="amount"><b>Amount(₹):</b></span> '+
|
|
'<input type="text" class="form-control required" style="text-align:right;" id="Paymentamount'+counterConstant+'" name="mydata'+counterConstant+'[Paymentamount'+counterConstant+']" onchange="paymenttotalamount();" onkeypress="return isNumberKey(event)">'+
|
|
'</div></div>'+
|
|
'<div class="col-md-offset-2 col-md-1" style="padding-top:15px;padding-left:0px"><div class="form-group">'+
|
|
'<input class="remove_this" type="button" id="removebtn'+counterConstant+'" value="REMOVE" onclick="removeRow(this.id)"></div>'+
|
|
'</div></div></div>';
|
|
$('#newdiv').append(div);
|
|
|
|
$('#hidecounter').val(counter);
|
|
$('#hideconstant').val(counterConstant);
|
|
// }
|
|
// else{
|
|
// alert("check");
|
|
// }
|
|
t= <?php echo json_encode($dropdownvalues) ?>;
|
|
|
|
var option = '';
|
|
|
|
// console.log(t);
|
|
|
|
$.each(t,function(i,obj){
|
|
if(obj.type == 'PAYMENT')
|
|
{
|
|
option += "<option value="+obj.code+">"+obj.name+"</option>";
|
|
}
|
|
});
|
|
|
|
// $('#select-group select option').each(function(){
|
|
// if($.inArray(this.value, values) > -1 && !this.selected)
|
|
// $(this).after('<optgroup label="'+this.value+'"></optgroup>').remove();
|
|
// });
|
|
$('#Paymentaccode'+counterConstant).append(option);
|
|
// var cc = counterConstant-1;
|
|
// var arr_no = counter-2;
|
|
// var ddvalue = $('#Paymentaccode'+cc+' option:selected').val();
|
|
|
|
|
|
// if(ddvalue != -1){ temparray[arr_no] = ddvalue; /*temparray.push(ddvalue);*/ }
|
|
|
|
// $.each(temparray,function(t,temp){
|
|
// $('#Paymentaccode'+counterConstant+' option[value='+temp+']').prop('disabled',true);
|
|
// });
|
|
|
|
}
|
|
}
|
|
|
|
function removeRow(input) {
|
|
|
|
var number = input.replace(/[^0-9]+/ig,"");
|
|
|
|
var lineitemamount = $("#Paymentamount"+number).val();
|
|
var total = $('#Paymenttotalamount').val();
|
|
var valueb4gst = $('#PaymentvaluebeforegST').val();
|
|
var subtracttotal = total - lineitemamount;
|
|
var valuebeforegst = valueb4gst - lineitemamount;
|
|
|
|
|
|
// var accode = $('#Paymentaccode'+number).val();
|
|
|
|
// temparray = jQuery.grep(temparray, function(value) {
|
|
|
|
// return value != accode;
|
|
|
|
// });
|
|
|
|
|
|
if(counter >= 1){
|
|
counter--;
|
|
//var r = $('#Paymentaccode'+number).val();
|
|
$("#divid"+number).remove();
|
|
$('#hidecounter').val(counter);
|
|
}
|
|
|
|
|
|
$('#Paymenttotalamount').val(subtracttotal);
|
|
$('#PaymentvaluebeforegST').val(valuebeforegst);
|
|
}
|
|
|
|
|
|
function paymenttotalamount(){
|
|
|
|
var total = 0;
|
|
var withtax = 0;
|
|
|
|
for(i=1;i<=counterConstant;i++){
|
|
var value = $('#Paymentamount'+i).val();
|
|
value = parseFloat(value);
|
|
|
|
if(isNaN(value)){
|
|
value = 0.00;
|
|
}
|
|
|
|
total = total + parseFloat(value);
|
|
}
|
|
|
|
var sgst = $('#PaymentSGST').val();
|
|
if(sgst == ''){
|
|
sgst = 0 ;
|
|
|
|
}else{
|
|
sgst = sgst;
|
|
}
|
|
|
|
var cgst = $('#PaymentCGST').val();
|
|
if(cgst == ''){
|
|
cgst = 0 ;
|
|
}else{
|
|
cgst = cgst;
|
|
|
|
}
|
|
|
|
var igst = $('#PaymentIGST').val();
|
|
if(igst == ''){
|
|
igst = 0 ;
|
|
}else{
|
|
igst = igst;
|
|
}
|
|
|
|
withtax = parseFloat(total)+parseFloat(sgst)+parseFloat(cgst)+parseFloat(igst);
|
|
//alert('sgst'+sgst+'cgst'+cgst+'igst'+igst);
|
|
$('#PaymentvaluebeforegST').val(parseFloat(total).toFixed(2));
|
|
$('#Paymenttotalamount').val(parseFloat(withtax).toFixed(2));
|
|
|
|
|
|
// $.each(temparray,function(t,temp){
|
|
// $('#Paymentaccode'+counterConstant+' option[value='+temp+']').remove();
|
|
// });
|
|
|
|
|
|
}
|
|
|
|
|
|
function valid(){
|
|
|
|
|
|
// var pay_date = $('#PaymentDate').val();
|
|
// var pay_paidto = $('#PaymentPaidto').val();
|
|
// var pay_voucher = $('#Paymentvouchercode').val();
|
|
// // var merchant = $('#merchant').val();
|
|
// // var mergst = $('#merchantgst').val();
|
|
// // var beforegst = $('#valuebeforegST').val();
|
|
// var pay_sgst = $('#PaymentSGST').val();
|
|
// var pay_cgst = $('#PaymentCGST').val();
|
|
// var pay_igst = $('#PaymentIGST').val();
|
|
// //var total = $('#totalamount').val();
|
|
// var pay_errorflag = 0;
|
|
|
|
|
|
// // if(Recepitaccode < 0)
|
|
// // {
|
|
// // errorflag++;
|
|
// // }
|
|
|
|
if($('#PaymentDate').val() == '')
|
|
{
|
|
alert("Please Provide Date..!");
|
|
$('#PaymentDate').focus();
|
|
return false;
|
|
//pay_errorflag++;
|
|
}
|
|
else if($('#PaymentPaidto').val() == '')
|
|
{
|
|
alert("Please Provide paid to Data..!");
|
|
$('#PaymentPaidto').focus();
|
|
return false;
|
|
}
|
|
else if($('#Paymentvouchercode').val() == '')
|
|
{
|
|
alert("Please Provide voucher code data..!");
|
|
$('#Paymentvouchercode').focus();
|
|
return false;
|
|
|
|
//pay_errorflag++;
|
|
}
|
|
else if($('#PaymentSGST').val() == '')
|
|
{
|
|
alert("Please Provide Sgst data..!");
|
|
$('#PaymentSGST').focus();
|
|
return false;
|
|
|
|
//pay_errorflag++;
|
|
}
|
|
else if($('#PaymentCGST').val() == '')
|
|
{
|
|
alert("Please Provide Cgst data..!");
|
|
$('#PaymentSGST').focus();
|
|
return false;
|
|
}
|
|
else if($("option:selected", $("#Paymentaccode1")).val() == '-1')
|
|
{
|
|
alert('Select/Choose account name');
|
|
$('#Paymentaccode1').focus();
|
|
return false;
|
|
}
|
|
else if($('#subdescription1').val() == '')
|
|
{
|
|
alert("Provide Account description..!");
|
|
$('#subdescription1').focus();
|
|
return false;
|
|
|
|
}
|
|
else if($('#Paymentamount1').val() == '')
|
|
{
|
|
alert("Provide Amount data..!");
|
|
$('#Paymentamount1').focus();
|
|
return false;
|
|
|
|
}
|
|
else
|
|
{
|
|
$('#addPayment').submit();
|
|
}
|
|
|
|
}
|
|
|
|
$('#supplier').change(function() {
|
|
|
|
var drpval = $('#supplier').val();
|
|
if(drpval == 1)
|
|
{
|
|
//alert()
|
|
$('#Addsup').modal('show');
|
|
}
|
|
|
|
});
|
|
|
|
|
|
function onlyAlphabets(evt)
|
|
{
|
|
var charCode;
|
|
if (window.event)
|
|
charCode = window.event.keyCode; //for IE
|
|
else
|
|
charCode = evt.which; //for firefox
|
|
if (charCode == 32) //for <space> symbol
|
|
return true;
|
|
if (charCode > 31 && charCode < 65) //for characters before 'A' in ASCII Table
|
|
return false;
|
|
if (charCode > 90 && charCode < 97) //for characters between 'Z' and 'a' in ASCII Table
|
|
return false;
|
|
if (charCode > 122) //for characters beyond 'z' in ASCII Table
|
|
return false;
|
|
return true;
|
|
}
|
|
|
|
function getContactNumberValidation()
|
|
{
|
|
|
|
var contactNumber = $('#ContactNumber').val();
|
|
var telephone =/^[0-9]{3,4}\s[0-9]{8,9}$/.test(contactNumber);
|
|
var regex = /^[0-9]{4,6}\s[0-9]{5,7}$/.test(contactNumber);
|
|
var mobilephone = /^[0-9]{10,12}$/.test(contactNumber);
|
|
|
|
if(contactNumber!='')
|
|
{
|
|
|
|
if(telephone)
|
|
{
|
|
|
|
return true;
|
|
}
|
|
|
|
else if(regex)
|
|
{
|
|
|
|
return true;
|
|
}
|
|
else if(mobilephone)
|
|
{
|
|
|
|
return true;
|
|
}
|
|
|
|
else
|
|
{
|
|
alert('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210');
|
|
return false;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
|
|
alert('please correct format of contact number');
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function isNumberKey(evt)
|
|
{
|
|
var charCode = (evt.which) ? evt.which : evt.keyCode;
|
|
if (charCode != 46 && charCode != 32 && charCode >= 33
|
|
&& (charCode < 48 || charCode > 57))
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
function validateEmail() {
|
|
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
|
|
|
|
var email = $('#emailid').val();
|
|
|
|
if(email != '')
|
|
{
|
|
if (reg.test(email) == false)
|
|
{
|
|
alert('Please Enter Valid Email Address');
|
|
return (false);
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
alert('Please Enter email id');
|
|
}
|
|
|
|
}
|
|
|
|
|
|
function validatesup()
|
|
{
|
|
// var a= $('#supplierName').val();
|
|
// alert(a);
|
|
|
|
if($("#supplierName").val().length < 1)
|
|
{
|
|
alert('Please Enter Supplier Name');
|
|
$("#supplierName").focus();
|
|
return false;
|
|
}
|
|
|
|
if(!getContactNumberValidation())
|
|
{
|
|
$("#ContactNumber").focus();
|
|
return false;
|
|
}
|
|
|
|
if(!validateEmail())
|
|
{
|
|
$('#emailid').focus();
|
|
return false;
|
|
}
|
|
|
|
if($("#Address").val().length < 1)
|
|
{
|
|
alert('Please Enter Address');
|
|
$("#Address").focus();
|
|
return false;
|
|
}
|
|
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
$('.AddSupplier').click(function()
|
|
{
|
|
if(validatesup())
|
|
{
|
|
var suppliername = $('#supplierName').val();
|
|
var contact = $('#ContactNumber').val();
|
|
var alternatecont = $('#AlternateContactNumber').val();
|
|
var email = $('#emailid').val();
|
|
var Address = $('#Address').val();
|
|
$('#content').loader('show');
|
|
$.ajax({
|
|
|
|
data:{suppliername:suppliername,contact:contact,alternatecont:alternatecont,email:email,Address:Address},
|
|
type:"POST",
|
|
url:"<?php echo base_url() ?>cashbook/addNewSupplierCash",
|
|
|
|
success:function(data)
|
|
{
|
|
// $('#content').loader('hide');
|
|
// alert(data);
|
|
var alertdata=data;
|
|
|
|
$.ajax({
|
|
|
|
type:"POST",
|
|
url:"<?php echo base_url() ?>cashbook/getAllSupplier",
|
|
success:function(data)
|
|
{
|
|
var html = '';
|
|
$('#supplier').find('option:not(:first)').remove();
|
|
|
|
$.each(JSON.parse(data), function (supDet, supobj)
|
|
{
|
|
|
|
// html +="<option value="+supobj.SupplierID+">"+supobj.SupplierName+"</option>";
|
|
|
|
$("#supplier").append( $('<option></option>').val(supobj.SupplierID).html(supobj.SupplierID+' - '+supobj.SupplierName));
|
|
|
|
});
|
|
|
|
//$("#supplier").append(html);
|
|
alert(alertdata);
|
|
$('#content').loader('hide');
|
|
$('#Addsup').modal('hide');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
}
|
|
});
|
|
</script>
|