bankstatement

This commit is contained in:
gayathri1990 2018-04-02 19:44:19 +05:30
parent 1f1496ab14
commit 612b37baa3
9 changed files with 240 additions and 58 deletions

View File

@ -133,6 +133,9 @@ define('ST063', 'ST063');
define('AMOUNT_PAID', 'ST057'); define('AMOUNT_PAID', 'ST057');
define('NO_PAID', 'ST058'); define('NO_PAID', 'ST058');
define('PARTIALLY_PAID', 'ST059'); define('PARTIALLY_PAID', 'ST059');
define('AMOUNT_RECEIVED', 'ST065');
define('NO_RECEIVED', 'ST066');
define('PARTIALLY_RECEIVED', 'ST067');
/* Work status code */ /* Work status code */
define('SERVICE_COMPLETED', 'ST046'); define('SERVICE_COMPLETED', 'ST046');

View File

@ -221,7 +221,7 @@ class cashbook extends BaseController
$total=$directamount+$alreadypaid; $total=$directamount+$alreadypaid;
$ctotal=$directamount+$alreadycreditpaid; $ctotal=$directamount+$alreadycreditpaid;
//echo $totalbankamount; //echo $totalbankamount;
if($amounttype==0) if($amounttype==CREDIT)
{ {
$type=RECEIPT; $type=RECEIPT;
$bankamounttype=CREDIT; $bankamounttype=CREDIT;
@ -338,7 +338,7 @@ class cashbook extends BaseController
{ {
$cashbookstatus = array('Clearbalance'=>$total,'Status'=>$stat); $cashbookstatus = array('Clearbalance'=>$total,'Status'=>$stat);
//print_r($cashbookstatus); //print_r($cashbookstatus);
$res = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid); $res23 = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
} }
@ -608,6 +608,7 @@ class cashbook extends BaseController
$amounttype = $this->input->post('amounttype'); $amounttype = $this->input->post('amounttype');
$bankid=$this->input->post('bankid'); $bankid=$this->input->post('bankid');
$normalid=$this->input->post('normalid'); $normalid=$this->input->post('normalid');
$bankamount=$this->input->post('bankamount');
$document =null; $document =null;
//$document1=$this->input->post('myfile'); //$document1=$this->input->post('myfile');
@ -657,13 +658,20 @@ class cashbook extends BaseController
{ {
$cashamnt=$ca->total; $cashamnt=$ca->total;
} }
if($bankamount==$cashamnt)
{
$status='CLOSE';
}
else
{
$status='OPEN';
}
//print_r($invoiceamount); //print_r($invoiceamount);
if($amounttype=='CREDIT') if($amounttype=='CREDIT')
{ {
$updatecredit=$invam+$cashamnt; $updatecredit=$invam+$cashamnt;
//print_r($updateamount); //print_r($updateamount);
$cashbookstatus1= array('cclearbalance'=>$updatecredit,'cstatus'=>$statu); $cashbookstatus1= array('cclearbalance'=>$updatecredit,'cstatus'=>$status);
//print_r($cashbookstatus1); //print_r($cashbookstatus1);
//die(); //die();
$res1 = $this->cashbook_model->cashcreditupdate($cashbookstatus1,$bankid); $res1 = $this->cashbook_model->cashcreditupdate($cashbookstatus1,$bankid);
@ -672,7 +680,7 @@ class cashbook extends BaseController
else else
{ {
$updatedepit=$poamnt+$cashamnt; $updatedepit=$poamnt+$cashamnt;
$cashbookstatus = array('Clearbalance'=>$updatedepit,'Status'=>$stat); $cashbookstatus = array('Clearbalance'=>$updatedepit,'Status'=>$status);
// print_r($cashbookstatus); // print_r($cashbookstatus);
//die(); //die();
$res = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid); $res = $this->cashbook_model->cashbankupdate($cashbookstatus,$bankid);
@ -744,6 +752,8 @@ class cashbook extends BaseController
$bankid= $_GET['d']; $bankid= $_GET['d'];
$data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid); $data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid);
$data['mapping'] = $this->cashbook_model->debitpolist($bankid); $data['mapping'] = $this->cashbook_model->debitpolist($bankid);
$data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid);
$data['paidpoamount'] = $this->cashbook_model->poamonut($bankid);
$data['supplier'] = $this->cashbook_model->getsupplier(); $data['supplier'] = $this->cashbook_model->getsupplier();
$this->loadViews("banksettlement", $this->global,$data,NULL); $this->loadViews("banksettlement", $this->global,$data,NULL);
@ -759,6 +769,8 @@ class cashbook extends BaseController
$bankid= $_GET['d']; $bankid= $_GET['d'];
$data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid); $data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid);
$data['mappingiv'] = $this->cashbook_model->creditinvoicelist($SupplierName,$fdate,$tdate,$bankid); $data['mappingiv'] = $this->cashbook_model->creditinvoicelist($SupplierName,$fdate,$tdate,$bankid);
$data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid);
$data['invoiceramount'] = $this->cashbook_model->invoiceamonut($bankid);
$data['supplier'] = $this->cashbook_model->getsupplier(); $data['supplier'] = $this->cashbook_model->getsupplier();
$this->loadViews("bankinvoicesettlement", $this->global,$data,NULL); $this->loadViews("bankinvoicesettlement", $this->global,$data,NULL);
@ -1000,6 +1012,17 @@ class cashbook extends BaseController
$result3 = $this->cashbook_model->invoiceupdate1($invoicedata,$invid); $result3 = $this->cashbook_model->invoiceupdate1($invoicedata,$invid);
} }
if($balancetoreceived1==0)
{
$status=AMOUNT_RECEIVED;
}
else
{
$status=PARTIALLY_RECEIVED;
}
$invoicemaster= array('receivedstatus'=>$status);
$result1 = $this->cashbook_model->invoiceamountstatus($invoicemaster,$invid);
echo "<script>alert('Saved Successfully!');window.location.href='Bankingstatement';</script>"; echo "<script>alert('Saved Successfully!');window.location.href='Bankingstatement';</script>";

View File

@ -87,9 +87,9 @@ class cashbook_model extends CI_Model
} }
function viewdepartment($sid='') function viewdepartment($sid='')
{ {
$sql="SELECT ie.*,br.ID,ac.name,ie.id,date_format(ie.date,'%d-%m-%Y')as date FROM t_income_expense ie $sql="SELECT ie.*,br.ID,ie.totalbankamount,ac.name,ie.id,date_format(ie.date,'%d-%m-%Y')as date FROM t_income_expense ie
join t_accountcode ac on ac.code=ie.account_code left join t_accountcode ac on ac.code=ie.account_code
join T_bankreport br on br.ID=ie.bankid left join T_bankreport br on br.ID=ie.bankid
WHERE ie.id = ?"; WHERE ie.id = ?";
$query = $this->db->query($sql,array($sid)); $query = $this->db->query($sql,array($sid));
//print_r($this->db->last_query()); //print_r($this->db->last_query());
@ -189,6 +189,7 @@ class cashbook_model extends CI_Model
$this->db->join ('ip_invoices iv','iv.invoice_id = iva.invoice_id','left'); $this->db->join ('ip_invoices iv','iv.invoice_id = iva.invoice_id','left');
$this->db->join ('ip_clients ic','ic.client_id = iv.client_id','left'); $this->db->join ('ip_clients ic','ic.client_id = iv.client_id','left');
$this->db->join ('T_Bankinvoicereport BI','BI.invoiceno = iva.invoice_id','left'); $this->db->join ('T_Bankinvoicereport BI','BI.invoiceno = iva.invoice_id','left');
$this->db->where('iva.receivedstatus !=','ST065');
$this->db->where('ic.client_name',$Customer); $this->db->where('ic.client_name',$Customer);
$this->db->or_where('iv.invoice_date_created BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"'); $this->db->or_where('iv.invoice_date_created BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"');
$this->db->group_by('iva.invoice_id'); $this->db->group_by('iva.invoice_id');
@ -223,7 +224,7 @@ function receiptdata()
function debitpolist($bankid) function debitpolist($bankid)
{ {
$this->db->select('mid,Podate,PONO,Suppliername,Totalpoamount, $this->db->select('mid,Podate,PONO,Suppliername,Totalpoamount,
Balancetopay,Amountpaid'); Balancetopay,Amountpaid');
$this->db->from ('T_Bankmappingpo'); $this->db->from ('T_Bankmappingpo');
$this->db->where('mid',$bankid); $this->db->where('mid',$bankid);
@ -233,9 +234,13 @@ function debitpolist($bankid)
return $query->result(); return $query->result();
} }
function paidcbook($bankid)
{
}
function creditinvoicelist($SupplierName,$fdate,$tdate,$bankid) function creditinvoicelist($SupplierName,$fdate,$tdate,$bankid)
{ {
$this->db->select('indate,invoiceno,customername,totinvoiceamount, $this->db->select('indate,invoiceno,customername,totinvoiceamount,bankid as id,
balancetoreceived,amountreceived'); balancetoreceived,amountreceived');
$this->db->from ('T_Bankinvoicereport'); $this->db->from ('T_Bankinvoicereport');
$this->db->where('bankid',$bankid); $this->db->where('bankid',$bankid);
@ -433,7 +438,7 @@ function debitlistpo($SupplierName,$fdate,$tdate,$pono)
} }
public function cashbankupdate($cashbookstatus,$bankid) public function cashbankupdate($cashbookstatus,$bankid)
{ {
echo $bankid;
$this->db->where('ID',$bankid); $this->db->where('ID',$bankid);
$this->db->update('T_bankreport',$cashbookstatus); $this->db->update('T_bankreport',$cashbookstatus);
return TRUE; return TRUE;
@ -549,6 +554,14 @@ function debitlistpo($SupplierName,$fdate,$tdate,$pono)
$r = $this->db->affected_rows(); $r = $this->db->affected_rows();
return $r; return $r;
}
function invoiceamountstatus($invoicemaster,$invid)
{
$this->db->where('invoice_id',$invid);
$this->db->update('ip_invoice_amounts',$invoicemaster);
$r = $this->db->affected_rows();
return $r;
} }
// function poamountstatus1($pomaster1,$pono) // function poamountstatus1($pomaster1,$pono)
// { // {

View File

@ -1,5 +1,8 @@
<?php //print_r($dropdownvalues);?> <?php //print_r($dropdownvalues);?>
<?php
?>
<script> <script>
@ -13,6 +16,7 @@ $(function() {
$.each(t,function(i,item){ $.each(t,function(i,item){
if(item.type == 'RECEIPT') if(item.type == 'RECEIPT')
{ {
$("#accode").append( $('<option></option>').val(item.code).html(item.name)); $("#accode").append( $('<option></option>').val(item.code).html(item.name));
} }
@ -66,7 +70,8 @@ function isNumberKey(evt)
return true; return true;
} }
//$(document).ready(function(id)
//$(document).ready(function()
function loadAccountType(id) function loadAccountType(id)
{ {
//alert('called'+id); //alert('called'+id);
@ -78,13 +83,14 @@ function loadAccountType(id)
if(id == 'myradio1') if(id == 'myradio1')
{ {
// alert('INCOME clicked'); //alert('INCOME clicked');
$('#accode').find('option').remove().end().append('<option value="-1">Select Account Name</option>').val('Select Account Code'); $('#accode').find('option').remove().end().append('<option value="-1">Select Account Name</option>').val('Select Account Code');
$.each(t,function(i,item){ $.each(t,function(i,item){
if(item.type == 'RECEIPT') if(item.type == 'RECEIPT')
{ {
$('#towhom').text('Received From:');
$("#accode").append( $('<option></option>').val(item.code).html(item.name)); $("#accode").append( $('<option></option>').val(item.code).html(item.name));
} }
}); });
@ -100,6 +106,7 @@ function loadAccountType(id)
$.each(t,function(i,item){ $.each(t,function(i,item){
if(item.type == 'PAYMENT') if(item.type == 'PAYMENT')
{ {
$('#towhom').text('Paid To:');
$("#accode").append( $('<option></option>').val(item.code).html(item.name)); $("#accode").append( $('<option></option>').val(item.code).html(item.name));
} }
}); });
@ -116,11 +123,32 @@ if(!empty($cashbanking))
//print_r($cashbanking); //print_r($cashbanking);
foreach($cashbanking as $cb) foreach($cashbanking as $cb)
{ {
$amounttype=$cb->amounttype;
} }
} }
?> ?>
<script>
$(document).ready(function()
{
amounttype= <?php echo json_encode($amounttype)?>;
//alert(amounttype);
if(amounttype=='CREDIT')
{
id='myradio1'
loadAccountType(id);
}
else
{
//alert('debit')
id='myradio2'
loadAccountType(id);
}
});
</script>
<div class="content-wrapper" style="min-height: 537px;"> <div class="content-wrapper" style="min-height: 537px;">
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
@ -351,7 +379,7 @@ if(!empty($cashbanking))
<!-- /.box-body --> <!-- /.box-body -->
<div class="box-footer" style="text-align:right"> <div class="box-footer" style="text-align:right">
<input type="button" onclick="validate();"class="btn btn-primary" value="Submit" /> <input type="button" onclick="amountcheck();"class="btn btn-primary" value="Submit" />
<input type="reset" class="btn btn-primary" value="Reset" /> <input type="reset" class="btn btn-primary" value="Reset" />
</div> </div>
@ -405,8 +433,26 @@ if(!empty($cashbanking))
// $('#towhom').text('Received From:'); // $('#towhom').text('Received From:');
// } // }
// } ); // } );
function amountcheck()
{
var bankamount=$('#totalbankamount').val();
var total = $('#totalamount').val();
if(parseFloat(bankamount)>=parseFloat(total))
{
validate();
}
else
{
alert('your mapping amount is large')
}
}
function validate() function validate()
{ {
//var paidcash=$('#totalbankamount').val();
var accode = $('#accode').val(); var accode = $('#accode').val();
var date = $('#Date').val(); var date = $('#Date').val();
var towhome = $('#towhome').val(); var towhome = $('#towhome').val();
@ -419,6 +465,7 @@ function validate()
var cgst = $('#CGST').val(); var cgst = $('#CGST').val();
var igst = $('#IGST').val(); var igst = $('#IGST').val();
var total = $('#totalamount').val(); var total = $('#totalamount').val();
var errorflag = 0; var errorflag = 0;
@ -510,19 +557,19 @@ function calculateTotal()
$('#totalamount').val((total.toFixed(2))); $('#totalamount').val((total.toFixed(2)));
} }
$('#myradio1').click(function(){ // $('#myradio1').ready(function(){
$('#towhom').ready('Received From:'); // $('#towhom').ready('Received From:');
}); // });
$('#myradio2').ready(function(){ // $('#myradio2').ready(function(){
$('#towhom').text('Paid To:'); // $('#towhom').text('Paid To:');
}); // });
</script> </script>
@ -531,15 +578,3 @@ $('#myradio2').ready(function(){
<script>
// $(document).ready(function() {
// $('#myradio1').click(function(){
// $('#towhom').text('Received From:');
// });
// $('#myradio2').click(function(){
// $('#towhom').text('Paid To:');
// });
// </script>

View File

@ -72,7 +72,7 @@ function checkYearMonthAsEmpty()
<div class="col-md-4"> <div class="col-md-4">
<div class="box-header"> <div class="box-header">
<input type="file" accept=".xlsx,.png" onchange="readURL(this);" id="userfile" name="userfile" /> <input type="file" accept=".xlsx" onchange="readURL(this);" id="userfile" name="userfile" />
<label for="photo">Select Excel File to upload<br/>(only .xls)</label> <label for="photo">Select Excel File to upload<br/>(only .xls)</label>
@ -95,10 +95,11 @@ function checkYearMonthAsEmpty()
<script> <script>
function save() function save()
{ {
var file=$('#userfile').val();
var x=checkYearMonthAsEmpty(); var bank=$('#bankbranchname').val();
//var x=checkYearMonthAsEmpty();
//alert(x); //alert(x);
if(x == 0) if(file!='' && bank!='')
{ {
$('form#upload').submit(); $('form#upload').submit();
@ -107,7 +108,8 @@ var x=checkYearMonthAsEmpty();
}else }
else
{ {
alert("Please Provide All Information Correctly!"); alert("Please Provide All Information Correctly!");
return false; return false;

View File

@ -70,11 +70,53 @@ if(!empty($debitmapping))
<!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>--> <!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>-->
<!--</div>--> <!--</div>-->
<!-- /.box-header --> <!-- /.box-header -->
<?php
if(!empty($mappingiv)){
foreach($mappingiv as $ap)
{
$bankid=$ap->id;
}
}
if(!empty($mappingcashbook))
{
foreach($mappingcashbook as $mc)
{
$bankid=$mc->bankid;
}
}
if(!empty($paidcbook)){
foreach($paidcbook as $pc)
{
$pcamount=$pc->total;
}
}
if(!empty($invoiceramount))
{
foreach($invoiceramount as $ia)
{
$inamount=$ia->amountreceived;
}
}
$totalamount=$pcamount+$inamount;
?>
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>"> <form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Credit Amount Paid Report</b></p></h3></center> <center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Credit Amount Paid Report</b></p></h3></center>
<div class="box-body"> <div class="box-body">
<div style="border-style: solid;width:40%;height:30%;margin-left:30%;font-size:18px;background-color:#ccc;">
<p style="margin-left:10px;"><b>Payment ID:&nbsp;&nbsp;<?php echo $bankid?></b></p>
<p style="margin-left:10px;"><b>Payment Mode:&nbsp;&nbsp;Bank</b></p>
<p style="margin-left:10px;"><b>Payment Amount:&nbsp;&nbsp;<?php echo $totalamount ?></b></p>
</div>
<!--<div class="row"> <!--<div class="row">
<div class="col-md-3"> <div class="col-md-3">

View File

@ -71,11 +71,57 @@ if(!empty($mapping))
<!--</div>--> <!--</div>-->
<!-- /.box-header --> <!-- /.box-header -->
<?php
if(!empty($mappingcashbook)){
foreach($mappingcashbook as $mc)
{
$bankid=$mc->bankid;
}
}
if(!empty($mapping)){
foreach($mapping as $ap)
{
$bankid=$ap->mid;
}
}
?>
<?php
if(!empty($paidcbook)){
foreach($paidcbook as $pc)
{
$pcamount=$pc->total;
}
}
if(!empty($paidpoamount)){
foreach($paidpoamount as $pa)
{
$poamount=$pa->amountpaid;
}
}
?>
<?php
$paymentamount=$pcamount+$poamount;
?>
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>"> <form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Debit Amount Paid Report</b></p></h3></center> <center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Debit Amount Paid Report</b></p></h3></center>
<div class="box-body"> <div class="box-body">
<div style="border-style: solid;width:40%;height:30%;margin-left:30%;font-size:18px;background-color:#ccc;">
<p style="margin-left:10px;"><b>Payment ID:&nbsp;&nbsp;<?php echo $bankid?></b></p>
<p style="margin-left:10px;"><b>Payment Mode:&nbsp;&nbsp;Bank</b></p>
<p style="margin-left:10px;"><b>Payment Amount:&nbsp;&nbsp;<?php echo $paymentamount ?></b></p>
</div>
<!--<div class="row"> <!--<div class="row">
<div class="col-md-3"> <div class="col-md-3">
<label for="from_date"> <label for="from_date">

View File

@ -146,7 +146,7 @@
<div class="row"> <div class="row">
<div class="col-md-12" style="padding:0px;"> <div class="col-md-12" style="padding:0px;">
<div class="col-md-2" style="padding-bottom:10px;"> <div class="col-md-2" style="padding-bottom:10px;">
<select style="height:35px;" name="selectedId" id="selectedId<?php echo $i?>" onchange="checkscreen(<?php echo $type ?>,<?php echo $i ?>);" title="Select Your Option"> <select style="height:35px;" name="selectedId" id="selectedId<?php echo $i?>" onchange="checkscreen();" title="Select Your Option">
<option value="-1" style="color:#FFF;">Select Option</option> <option value="-1" style="color:#FFF;">Select Option</option>
<option value="1">Invoice</option> <option value="1">Invoice</option>
<option value="2">Po screen</option> <option value="2">Po screen</option>
@ -375,7 +375,7 @@ var tempcredit=[];
var overalltype; var overalltype;
var before=''; var before='';
var amounttype=''; var amounttype='';
var bankid=''; var i1='';
var tpaid=''; var tpaid='';
var debit1=''; var debit1='';
var credit1=''; var credit1='';
@ -383,7 +383,7 @@ var tcpaid='';
function checkamount(t,i) function checkamount(t,i)
{ {
value=i; value=i;
bankid=value; i1=value;
type= t; type= t;
amounttype=type; amounttype=type;
var totalpaid= document.getElementById("totalpaid"+value).innerText; var totalpaid= document.getElementById("totalpaid"+value).innerText;
@ -464,24 +464,27 @@ if (x==true)
function checkscreen(t,i) function checkscreen()
{ {
$type=t; var i=i1;
//alert(i);
var avalue= $('#addvalue').val(); var avalue= $('#addvalue').val();
//alert(avalue);
localStorage.setItem('test',avalue); localStorage.setItem('test',avalue);
var damount =$('#debit'+i).val(); var damount =$('#debit'+i).val();
var e = document.getElementById("selectedId"); var e = document.getElementById("selectedId");
var value = e.options[e.selectedIndex].value; var value = e.options[e.selectedIndex].value;
//alert(value+'dd'); //alert(value+'dd');
var text = e.options[e.selectedIndex].text; var text = e.options[e.selectedIndex].text;
var camount =$('#credit'+i).text(); var id=document.getElementById ("bankid"+i).innerText;
var date=document.getElementById ("date"+i).innerText;
var debit=document.getElementById ("debit"+i).innerText;
//var camount =document.getElementById ("#credit"+i).innerText;
var RowCount= $('#Rowid').val(); var RowCount= $('#Rowid').val();
var id=document.getElementById ("bankid"+bankid).innerText;
var date=document.getElementById ("date"+value).innerText;
var debit=document.getElementById ("debit"+value ).innerText;
var idvalue = id+'-'+debit; var idvalue = id+'-'+debit;
var credit=document.getElementById ("credit"+value ).innerText; //var credit=$('#credit'+i).val();
if(avalue=='') if(avalue=='')
{ {
//alert(avalue); //alert(avalue);
@ -519,14 +522,13 @@ if (x==true)
} }
} }
else if(value=='3' && (type=='0' ||type=='1')) else if(value=='3')
{ {
if(avalue>0) if(avalue>0)
{ {
$('#content').loader('show'); $('#content').loader('show');
$.ajax( $.ajax({
{
data:{bankdate:date,bankid:id,type:amounttype,bankamount:avalue,forstatus:avalue,alreadypaid:tpaid,alreadycreditpaid:tcpaid,debitamount:debit1,creditamount:credit1}, data:{bankdate:date,bankid:id,type:amounttype,bankamount:avalue,forstatus:avalue,alreadypaid:tpaid,alreadycreditpaid:tcpaid,debitamount:debit1,creditamount:credit1},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>Payment", url:"<?php echo base_url() ?>Payment",

View File

@ -30,6 +30,7 @@ if(!empty($DepDetails))
$final = base_url().$document; $final = base_url().$document;
//echo $final; //echo $final;
// print_r( $DepDetails);die(); // print_r( $DepDetails);die();
$bankamount=$ded->totalbankamount;
$bankid=$ded->ID; $bankid=$ded->ID;
$normalid=$ded->id; $normalid=$ded->id;
$accountcode1=$ded->account_code; $accountcode1=$ded->account_code;
@ -287,6 +288,7 @@ function loadAccountType(id)
<input type="hidden" class="form-control read_only" id="id1" name="id1" value="<?php echo $id; ?>"> <input type="hidden" class="form-control read_only" id="id1" name="id1" value="<?php echo $id; ?>">
<input type="hidden" class="form-control read_only" id="accode1" name="accode1" value="<?php echo $accountcode1; ?>"> <input type="hidden" class="form-control read_only" id="accode1" name="accode1" value="<?php echo $accountcode1; ?>">
</div> </div>
</div> </div>
@ -397,6 +399,7 @@ function loadAccountType(id)
</div> </div>
<input type="hidden" id="amounttype" name="amounttype" value="<?php echo $amounttype;?>"> <input type="hidden" id="amounttype" name="amounttype" value="<?php echo $amounttype;?>">
<input type="hidden" id="bankid" name="bankid" value="<?php echo $bankid;?>"> <input type="hidden" id="bankid" name="bankid" value="<?php echo $bankid;?>">
<input type="hidden" class="form-control read_only" id="bankamount" name="bankamount" value="<?php echo $bankamount; ?>">
</div> </div>
@ -438,7 +441,7 @@ function loadAccountType(id)
<!-- /.box-body --> <!-- /.box-body -->
<div class="box-footer" style="text-align:right"> <div class="box-footer" style="text-align:right">
<input type="button" onclick="validate();"class="btn btn-primary" value="update" /> <input type="button" onclick="amountcheck();"class="btn btn-primary" value="update" />
<input type="reset" class="btn btn-primary" value="Reset" /> <input type="reset" class="btn btn-primary" value="Reset" />
</div> </div>
@ -480,6 +483,19 @@ function loadAccountType(id)
</div> </div>
<script> <script>
function amountcheck()
{
var bankamount = $('#bankamount').val();
var cashamount = $('#totalamount').val();
if(parseFloat(bankamount)>=parseFloat(cashamount))
{
validate();
}
else
{
alert('Your mapping amount is large');
}
}
function validate() function validate()
{ {