bankstatement

This commit is contained in:
gayathri1990 2018-05-10 13:19:42 +05:30
parent 37477d253d
commit 1e0bf0cdbf
5 changed files with 328 additions and 130 deletions

View File

@ -263,10 +263,10 @@
</div>
</div>
</section>
<!-- /.box -->
</div>
</section>
</div>
<!-- /.col -->
<div class="row">
<div class="col-md-12" id="date1"></div>
@ -353,6 +353,9 @@
]
} );
} );
//alert(pono+'array');
var temppo=[];
var tot=0;
var tot1=0;
var intex=1;
@ -370,19 +373,21 @@ function GetPayment(i)
var x = document.getElementById('checkboxcheckbox'+i).checked;
var amount= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
var amount= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val())
//alert(amount);
var negative=0;
if(amount<0)
{
negative=1;
alert("Invalid Amount")
$('#invoicepaymet'+i).val('');
alert('Invalid Amount');
// $('#invoicepaymet'+i).val('');
}
temp=intex;
//alert(temp+'temp');success
if(x==true)
{
//alert(x);
var bankdebitamount=$('#debitamount').val();
var totalvalue=$('#addvalue').val();
var balanceamount=bankdebitamount-totalvalue;
@ -404,6 +409,24 @@ function GetPayment(i)
$('#Rowid').val(row);
var date= document.getElementById ( "date"+i ).innerText;
var pono =document.getElementById ( "pono"+i ).innerText;
var poamount =document.getElementById ( "qw"+i ).innerText;
//alert(invoicepayment+'amny');
//alert(invoicepayment+'amny1');
var ponovalue = pono+'-'+poamount;
temppo.push(ponovalue);
//var res1 = temppo.split('-');
var total=0;
$.each(temppo, function( index, value )
{
var res2 = value.split('-');
var pono=res2[0];
var bam=res2[1];
total=parseFloat(bam)+parseFloat(total);
$('#addvalue').val(parseFloat(total).toFixed(2));
});
//console.log(temppo);
var supname =document.getElementById ("sn"+i ).innerText;
var totalordervalue =document.getElementById ("tov"+i ).innerText;
var invoicepayment =document.getElementById ( "qw"+i ).innerText;
@ -448,19 +471,23 @@ function GetPayment(i)
intex = parseInt(intex)+1;
j=parseInt(j)+1;
j=parseInt(j)+1;
//alert(j+'j');
var to=0;
for(t=1;t<j;t++)
{
//alert(t+'t');
var tt=parseFloat( $('#totala'+t).val() == '' ? '0.00' : $('#totala'+t).val());
to = parseFloat(to) + parseFloat (tt);
$('#addvalue').val(parseFloat(to).toFixed(2));
//var total= $('#addvalue').val();
//total=addvalue;
//alert(total);
// for(t=1;t<j;t++)
// {
// //var pono1 =document.getElementById ( "pono"+i ).innerText;
// //alert(pono1);
// var tt=parseFloat( $('#totala'+t).val() == '' ? '0.00' : $('#totala'+t).val());
// to = parseFloat(to) + parseFloat (tt);
// $('#addvalue').val(parseFloat(to).toFixed(2));
// //var total= $('#addvalue').val();
// //total=addvalue;
// //alert(total);
}
// }
@ -473,18 +500,28 @@ function GetPayment(i)
else
{
//alert(i)
var rr= $('#Rowid').val();
var ro= parseInt(rr)-1;
var Payment= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val());
// alert(Payment)
//var Inid= parseFloat( $('#pono'+i).text() == '' ? '0.00' : $('#pono'+i).text());
var Inid = document.getElementById ('pono'+i ).innerText
var ponovalue = Inid+'-'+Payment;
//alert(Inid+'else');
//temppo.pull(Inid);
var a = temppo.indexOf(ponovalue);
//console.log(a);
if(a!=-1)
{
temppo.splice(a,1);
console.log(temppo);
}
//alert(Inid)
for(s=1;s<=j;s++)
{
// alert(j+'else');
var ch= $('#purchaseono'+s).val();
//alert(ch);
if(Inid==ch)

View File

@ -335,6 +335,7 @@
]
} );
} );
var tempinvoice=[];
var tot=0;
var tot1=0;
var intex=1;
@ -357,19 +358,37 @@ if(amount<0)
temp=intex;
if(x==true)
{
//alert(x);
row= parseInt(row)+1;
//alert(row);
$('#Rowid').val(row);
var date= document.getElementById ( "invoicedate"+i ).innerText;
var invid =document.getElementById ( "invoice_id"+i ).innerText;
var cusname =document.getElementById ("client_name"+i ).innerText;
var invoiceamount =document.getElementById ("invoice_paid"+i ).innerText;
var invoicereceived=document.getElementById ("invoice_balance"+i ).innerText;
$('#invoicereceived'+i).val(invoicereceived);
var RowCount= $('#Rowid').val();
//alert(RowCount);
//alert('advance' + advanceamount);
row= parseInt(row)+1;
//alert(row);
$('#Rowid').val(row);
var date= document.getElementById ( "invoicedate"+i ).innerText;
var invid =document.getElementById ( "invoice_id"+i ).innerText;
//alert(invid+'invid');
var cusname =document.getElementById ("client_name"+i ).innerText;
var invoiceamount =document.getElementById ("invoice_paid"+i ).innerText;
var invoicereceived=document.getElementById ("invoice_balance"+i ).innerText;
//alert(invoicereceived+'invamount');
$('#invoicereceived'+i).val(invoicereceived);
var RowCount= $('#Rowid').val();
var invoicevalue = invid+'-'+invoicereceived;
tempinvoice.push(invoicevalue);
var total=0;
$.each(tempinvoice, function( index, value )
{
var res2 = value.split('-');
var invoiceno=res2[0];
var cam=res2[1];
total=parseFloat(cam)+parseFloat(total);
$('#addvalue').val(parseFloat(total).toFixed(2));
});
$('<input>').attr({
type:'hidden',
@ -429,14 +448,14 @@ if(x==true)
j=parseInt(j)+1;
var to=0;
for(t=1;t<j;t++)
{
//var tt= $('#inv_amount'+t).val();
var tt=parseFloat( $('#invoiceamount1'+t).val() == '' ? '0.00' : $('#invoiceamount1'+t).val());
to = parseFloat(to) + parseFloat (tt);
$('#addvalue').val(parseFloat(to).toFixed(2));
// for(t=1;t<j;t++)
// {
// //var tt= $('#inv_amount'+t).val();
// var tt=parseFloat( $('#invoiceamount1'+t).val() == '' ? '0.00' : $('#invoiceamount1'+t).val());
// to = parseFloat(to) + parseFloat (tt);
// $('#addvalue').val(parseFloat(to).toFixed(2));
}
// }
@ -453,6 +472,17 @@ else
var ro= parseInt(rr)-1;
var Payment= parseFloat( $('#invoicereceived'+i).val() == '' ? '0.00' : $('#invoicereceived'+i).val());
var Inid = document.getElementById ('invoice_id'+i ).innerText
var invoicevalue = Inid+'-'+Payment;
//alert(Inid+'else');
//temppo.pull(Inid);
var a = tempinvoice.indexOf(invoicevalue);
//console.log(a);
if(a!=-1)
{
tempinvoice.splice(a,1);
//console.log(temppo);
}
for(s=1;s<=j;s++)
{

View File

@ -62,7 +62,7 @@ if(!empty($debitmapping))
<div class="content-wrapper">
<section class="content">
<div class="row">
<!-- Left col -->
<div class="col-md-12" >
<!-- TABLE: LATEST ORDERS -->
@ -115,17 +115,61 @@ if(!empty($debitmapping))
<br>
<br>
<div class="row">
<div class="box-body">
<div class="col-md-3 col-md-offset-9">
<div style=" border: 2px solid black;margin-left:0%;margin-top: -55px;font-size:14px;background-color:#ccc;">
<p style="margin-left:62px;padding-top:30px;">Payment ID:&nbsp;&nbsp;<b><?php echo $ap->bankid?></b></p>
<p style="margin-left:41px;">Payment Mode:&nbsp;&nbsp;<b>Bank</b></p>
<p style="margin-left:41px;">Payment Amount:&nbsp;&nbsp;<b><?php echo $totalamount ?></b></p>
</div>
</div>
</div>
</div>
<div class="box-body">
<div class="col-md-3 col-md-offset-9">
<div style=" border: 2px solid black;margin-left:0%;margin-top: -55px;font-size:14px;background-color:#ccc;">
<p style="margin-left:62px;padding-top:30px;">Payment ID:&nbsp;&nbsp;<b><?php echo $ap->bankid?></b></p>
<p style="margin-left:41px;">Payment Mode:&nbsp;&nbsp;<b>Bank</b></p>
<p style="margin-left:41px;">Payment Amount:&nbsp;&nbsp;<b><?php echo $totalamount ?></b></p>
</div>
</div>
</div>
<!--<div class="row">
<div class="col-md-3">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-3">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-3" >
<label for="from_date">
<?php echo 'Customer'; ?>
</label>
<select class="form-control" id="SupplierName" name="SupplierName">
<option value="">Select Supplier</option>
<?php
foreach($supplier as $gs):
{?>
<option value="<?php echo $gs->SupplierName;?>"><?php echo $gs->SupplierName ; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>-->
</form>
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
@ -222,7 +266,7 @@ if(!empty($debitmapping))
<tr>
<th>Date</th>
<th>Account Code</th>
<th>Account Name</th>
<th>Bankid</th>
<th>Amount Type</th>
<th>Total Amount<?php echo '('.$inrsymbol.')' ?></th>
@ -251,7 +295,7 @@ if(!empty($debitmapping))
<td align="left" id="date"><span><?php echo $mc->date?></span></td>
<td align="left" id="date"><span><?php echo $mc->account_code?></span></td>
<td align="left" id="date"><span><?php echo $mc->name?></span></td>
<!--<td align="left" id="pono"><a href="<?= base_url() ?>cashbook/receipt?sid=<?php echo $ap->PONO;?>"><span><?php echo $ap->PONO?></span></a></td>-->
<!--<td align="left"><a href="<?= base_url() ?>cashbook/bankreceipt?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>-->
@ -282,7 +326,6 @@ if(!empty($debitmapping))
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->

View File

@ -55,7 +55,6 @@
</div>-->
<div class="content-wrapper">
<section class="content" style="font-size: 12px;">
<div class="row" >
<div id="content"></div>
@ -162,7 +161,7 @@
</div>
<div class="col-md-2">
<input type="hidden" id="addvalue" name="addvalue">
<input type="text" id="addvalue" name="addvalue">
</div>
</div>
@ -220,12 +219,9 @@
<tr>
<td align="left" id="bankid<?php echo $i ?>"><span><?php echo $t->ID?></span></td>
<td data-name="sell"><input type="checkbox" onchange="checkamount(<?php echo $type ?>,<?php echo $i ?>) "id="checkboxcheckbox<?php echo $i ?>" name="checkbox<?php echo $i ?>";></td>
<!--<?php
// }
// ?> -->
<td align="left" id="date<?php echo $i ?>"><span><?php echo $t->date?></span></td>
<td align="left"><span><?php echo $t->valuedate?></span></td>
<td align="left"><span><?php echo $t->Bankname?></span></td>
@ -283,7 +279,14 @@
<td><?php echo $t->cstatus;?></td>
</tr>
<?php
$i++;
@ -293,17 +296,46 @@
?>
</tbody>
</table>
<!--<tfoot width="100%">
<tr>
<td style="text-align:left;"><strong>Total</strong></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td style="text-align:right"><strong>
<?php
{
echo number_format($ti,2,'.','');
}
?>
</strong>
</td>
<td style="text-align:right"><strong>
<?php
{
echo number_format($tvt,2,'.','');
}
?>
</strong>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</tfoot>-->
</table>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- /.box -->
<!-- </div> -->
<!-- /.col -->
@ -349,6 +381,8 @@ var tcpaid='';
function checkamount(type,ide)
{
//$('#addvalue').val('0.00');
//alert();
var value=ide;
//alert('row id'+value);
i1=value;
@ -369,7 +403,7 @@ function checkamount(type,ide)
if (x==true)
{
//alert('check');
if(overalltype == type || overalltype == undefined) {
if(type==1){ // 1 means Debit, 0 means Credit
@ -378,19 +412,33 @@ if (x==true)
row= parseInt(row)+1;
$('#Rowid').val(row);
var id=document.getElementById ("bankid"+value).innerText;
//alert(id+'id');
var debit=document.getElementById ("btc"+value ).innerText;
// alert(debit+'hd');
//alert(debit+'hd');
debit1=debit;
//alert('bal to pay'+ debit);
//alert('You have selected bankid=' +id+ '\n and your amount is=' +debit+ '\n Please select Poscreen');
var idvalue = id+'-'+debit;
//alert(idvalue);
tempidvalue.push(idvalue);
tot11=parseFloat(tot11)
var total=0;
$.each(tempidvalue, function( index, value )
{
var debited = value.split('-');
var bankid=debited[0];
var debit=debited[1];
total=parseFloat(debit)+parseFloat(total);
$('#addvalue').val(parseFloat(total).toFixed(2));
});
//tot11=0;
//tot11=parseFloat(tot11);
//alert('tot11'+tot11);
tot11=parseFloat(tot11)+parseFloat(debit)
//tot11=parseFloat(tot11)+parseFloat(debit)
//alert('afetr add tot11'+tot11);
$('#addvalue').val(parseFloat(tot11).toFixed(2));
//alert(tot11+'checkvalue');
//$('#addvalue').val(parseFloat(tot11));
if(debit==0)
{
alert('status is closed');
@ -409,38 +457,99 @@ if (x==true)
// alert(tempid+'creditlatest');
//alert('Tempid ='+tempid)
var credit=parseFloat(document.getElementById(tempid).innerText);
//alert(credit+'credit');
credit1=credit;
//alert('You have selected bankid=' +id+ '\n and your amount is=' +credit+ '\n Please select Invoice screen');
var idvalue1 = id+'-'+credit;
tempcredit.push(idvalue1);
tot11=parseFloat(tot11);
//alert('tot11-'+tot11);
tot11=parseFloat(tot11)+parseFloat(credit)
//alert('afetr add tot11-'+tot11);
$('#addvalue').val(parseFloat(tot11).toFixed(2));
console.log(tempcredit);
var totalcredit=0;
$.each(tempcredit, function( index, value)
{
var credited = value.split('-');
var bankidc=credited[0];
var creditc=credited[1];
// alert(creditc+'if');
totalcredit=parseFloat(creditc)+parseFloat(totalcredit);
// alert(totalc+'add');
$('#addvalue').val(parseFloat(totalcredit).toFixed(2));
});
// tot11=parseFloat(tot11);
// tot11=0;
// //alert('tot11-'+tot11);
// tot11=parseFloat(tot11)+parseFloat(credit)
// //alert('afetr add tot11-'+tot11);
// $('#addvalue').val(tot11);
}
}
else{
alert("Miss Match you have select sequentially amount");
window.location.reload();
document.getElementById('checkboxcheckbox'+value).checked = false;
}
else{
alert("Miss Match you have select sequentially amount");
window.location.reload();
document.getElementById('checkboxcheckbox'+value).checked = false;
}
}
else
{
//$('#addvalue').val('0.00');
delamount= document.getElementById ( "debit"+i ).innerText;
//alert('uncheck');
var id=document.getElementById ("bankid"+value).innerText;
delamount= document.getElementById ( "debit"+value ).innerText;
var tempcid = "credited"+value;
delcredit= document.getElementById (tempcid).innerText;
//alert(delcredit+'dc');
var tote= $('#addvalue').val();
var afterdeltot= parseFloat(tote)- parseFloat(delamount);
$('#addvalue').val(parseFloat(afterdeltot).toFixed(2));
var updatetotal=0;
var updatecredit=0;
var debitvalue = id+'-'+delamount;
var creditvalue= id+'-'+delcredit;
var a = tempidvalue.indexOf(debitvalue);
if(a!=-1)
{
tempidvalue.splice(a,1);
$.each(tempidvalue, function( index, value )
{
var debited = value.split('-');
var bankid=debited[0];
var debit=debited[1];
total=parseFloat(debit)+parseFloat(updatetotal);
$('#addvalue').val(parseFloat(total).toFixed(2));
});
}
var a = tempcredit.indexOf(creditvalue);
if(a!=-1)
{
//alert('credit');
tempcredit.splice(a,1);
console.log(tempcredit);
$.each(tempcredit, function( index, value )
{
var credited = value.split('-');
var bankid=credited[0];
var credit=credited[1];
//alert(credit+'credit');
total1=parseFloat(credit)+parseFloat(updatecredit);
//alert(total1+'addvalue');
$('#addvalue').val(parseFloat(total1).toFixed(2));
});
}
//$('#addvalue').val('');
//$('#addvalue').val('0.00');
// $('#addvalue').val(parseFloat(afterdeltot).toFixed(2));
}

View File

@ -523,7 +523,7 @@ function loadAccountType(id)
<!-- /.box-body -->
<div class="box-footer" style="text-align:right">
<input type="button" onclick="amountcheck();" class="btn btn-primary" value="update" />
<input type="button" onclick="validate();" class="btn btn-primary" value="update" />
<input type="reset" class="btn btn-primary" value="Reset" />
</div>
@ -565,53 +565,32 @@ function loadAccountType(id)
</div>
<script>
// function amountcheck()
// {
// var typeofmap = "<?php echo $typeofmap;?>";
function amountcheck()
{
var typeofmap = "<?php echo $typeofmap;?>";
var rembalance="<?php echo $balancetoupdate;?>";
// if(typeofmap=='Bank')
// {
// var bankamount = $('#bankamount').val();
// var cashamount = $('#totalamount').val();
// //alert(cashamount+'mam');
// if(parseFloat(bankamount)>=parseFloat(cashamount))
// {
// validate();
// }
// else
// {
// alert('Your mapping amount is large');
// }
// //alert(rembalance+'rb');
// var cashamount = $('#totalamount').val();
// //var totalupdate=parseFloat(rembalance)+parseFloat(cashamount);
// alert(cashamount+'text');
// alert(totalupdate+'totalupdate');
// // if(parseFloat(totalupdate)>=parseFloat(cashamount))
// // {
// // validate();
// // }
// // else
// // {
// // alert('Your mapping amount is large');
// // }
// }
// else
// {
// validate();
// }
// }
function amountcheck()
{
var typeofmap = "<?php echo $typeofmap;?>";
var rembalance="<?php echo $balancetoupdate;?>";
if(typeofmap=='Bank')
{
//alert(rembalance+'rb');
var cashamount = $('#totalamount').val();
//var totalupdate=parseFloat(rembalance)+parseFloat(cashamount);
alert(cashamount+'text');
alert(totalupdate+'totalupdate');
if(parseFloat(totalupdate)>=parseFloat(cashamount))
{
validate();
}
else
{
alert('Your mapping amount is large');
}
}
else
{
validate();
}
}
function validate()
{