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>
</div> </div>
</section>
<!-- /.box --> <!-- /.box -->
</div> </div>
</section>
</div>
<!-- /.col --> <!-- /.col -->
<div class="row"> <div class="row">
<div class="col-md-12" id="date1"></div> <div class="col-md-12" id="date1"></div>
@ -353,6 +353,9 @@
] ]
} ); } );
} ); } );
//alert(pono+'array');
var temppo=[];
var tot=0; var tot=0;
var tot1=0; var tot1=0;
var intex=1; var intex=1;
@ -371,18 +374,20 @@ function GetPayment(i)
var x = document.getElementById('checkboxcheckbox'+i).checked; 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; var negative=0;
if(amount<0) if(amount<0)
{ {
negative=1; negative=1;
alert("Invalid Amount") alert('Invalid Amount');
$('#invoicepaymet'+i).val(''); // $('#invoicepaymet'+i).val('');
} }
temp=intex; temp=intex;
//alert(temp+'temp');success //alert(temp+'temp');success
if(x==true) if(x==true)
{ {
//alert(x);
var bankdebitamount=$('#debitamount').val(); var bankdebitamount=$('#debitamount').val();
var totalvalue=$('#addvalue').val(); var totalvalue=$('#addvalue').val();
var balanceamount=bankdebitamount-totalvalue; var balanceamount=bankdebitamount-totalvalue;
@ -404,6 +409,24 @@ function GetPayment(i)
$('#Rowid').val(row); $('#Rowid').val(row);
var date= document.getElementById ( "date"+i ).innerText; var date= document.getElementById ( "date"+i ).innerText;
var pono =document.getElementById ( "pono"+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 supname =document.getElementById ("sn"+i ).innerText;
var totalordervalue =document.getElementById ("tov"+i ).innerText; var totalordervalue =document.getElementById ("tov"+i ).innerText;
var invoicepayment =document.getElementById ( "qw"+i ).innerText; var invoicepayment =document.getElementById ( "qw"+i ).innerText;
@ -449,18 +472,22 @@ function GetPayment(i)
intex = parseInt(intex)+1; intex = parseInt(intex)+1;
j=parseInt(j)+1; j=parseInt(j)+1;
//alert(j+'j');
var to=0; var to=0;
for(t=1;t<j;t++) // 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);
} // //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 else
{ {
//alert(i) //alert(i)
var rr= $('#Rowid').val(); var rr= $('#Rowid').val();
var ro= parseInt(rr)-1; var ro= parseInt(rr)-1;
var Payment= parseFloat( $('#invoicepaymet'+i).val() == '' ? '0.00' : $('#invoicepaymet'+i).val()); 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 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) //alert(Inid)
for(s=1;s<=j;s++) for(s=1;s<=j;s++)
{ {
// alert(j+'else');
var ch= $('#purchaseono'+s).val(); var ch= $('#purchaseono'+s).val();
//alert(ch); //alert(ch);
if(Inid==ch) if(Inid==ch)

View File

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

View File

@ -62,7 +62,7 @@ if(!empty($debitmapping))
<div class="content-wrapper"> <div class="content-wrapper">
<section class="content"> <section class="content">
<div class="row">
<!-- Left col --> <!-- Left col -->
<div class="col-md-12" > <div class="col-md-12" >
<!-- TABLE: LATEST ORDERS --> <!-- TABLE: LATEST ORDERS -->
@ -124,8 +124,52 @@ if(!empty($debitmapping))
</div> </div>
</div> </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>
<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> </form>
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;"> <table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
@ -222,7 +266,7 @@ if(!empty($debitmapping))
<tr> <tr>
<th>Date</th> <th>Date</th>
<th>Account Code</th> <th>Account Name</th>
<th>Bankid</th> <th>Bankid</th>
<th>Amount Type</th> <th>Amount Type</th>
<th>Total Amount<?php echo '('.$inrsymbol.')' ?></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->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" 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>--> <!--<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> </div>
</div>
<!-- /.box --> <!-- /.box -->
</div> </div>
<!-- /.col --> <!-- /.col -->

View File

@ -55,7 +55,6 @@
</div>--> </div>-->
<div class="content-wrapper"> <div class="content-wrapper">
<section class="content" style="font-size: 12px;"> <section class="content" style="font-size: 12px;">
<div class="row" >
<div id="content"></div> <div id="content"></div>
@ -162,7 +161,7 @@
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<input type="hidden" id="addvalue" name="addvalue"> <input type="text" id="addvalue" name="addvalue">
</div> </div>
</div> </div>
@ -223,9 +222,6 @@
<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> <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" 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->valuedate?></span></td>
<td align="left"><span><?php echo $t->Bankname?></span></td> <td align="left"><span><?php echo $t->Bankname?></span></td>
@ -284,6 +280,13 @@
<td><?php echo $t->cstatus;?></td> <td><?php echo $t->cstatus;?></td>
</tr> </tr>
<?php <?php
$i++; $i++;
@ -293,17 +296,46 @@
?> ?>
</tbody> </tbody>
<!--<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> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
</section>
</div>
<!-- /.box --> <!-- /.box -->
<!-- </div> --> <!-- </div> -->
<!-- /.col --> <!-- /.col -->
@ -349,6 +381,8 @@ var tcpaid='';
function checkamount(type,ide) function checkamount(type,ide)
{ {
//$('#addvalue').val('0.00');
//alert();
var value=ide; var value=ide;
//alert('row id'+value); //alert('row id'+value);
i1=value; i1=value;
@ -369,7 +403,7 @@ function checkamount(type,ide)
if (x==true) if (x==true)
{ {
//alert('check');
if(overalltype == type || overalltype == undefined) { if(overalltype == type || overalltype == undefined) {
if(type==1){ // 1 means Debit, 0 means Credit if(type==1){ // 1 means Debit, 0 means Credit
@ -378,19 +412,33 @@ if (x==true)
row= parseInt(row)+1; row= parseInt(row)+1;
$('#Rowid').val(row); $('#Rowid').val(row);
var id=document.getElementById ("bankid"+value).innerText; var id=document.getElementById ("bankid"+value).innerText;
//alert(id+'id');
var debit=document.getElementById ("btc"+value ).innerText; var debit=document.getElementById ("btc"+value ).innerText;
// alert(debit+'hd'); //alert(debit+'hd');
debit1=debit; debit1=debit;
//alert('bal to pay'+ debit); //alert('bal to pay'+ debit);
//alert('You have selected bankid=' +id+ '\n and your amount is=' +debit+ '\n Please select Poscreen'); //alert('You have selected bankid=' +id+ '\n and your amount is=' +debit+ '\n Please select Poscreen');
var idvalue = id+'-'+debit; var idvalue = id+'-'+debit;
//alert(idvalue);
tempidvalue.push(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); //alert('tot11'+tot11);
tot11=parseFloat(tot11)+parseFloat(debit) //tot11=parseFloat(tot11)+parseFloat(debit)
//alert('afetr add tot11'+tot11); //alert('afetr add tot11'+tot11);
$('#addvalue').val(parseFloat(tot11).toFixed(2)); //alert(tot11+'checkvalue');
//$('#addvalue').val(parseFloat(tot11));
if(debit==0) if(debit==0)
{ {
alert('status is closed'); alert('status is closed');
@ -409,15 +457,31 @@ if (x==true)
// alert(tempid+'creditlatest'); // alert(tempid+'creditlatest');
//alert('Tempid ='+tempid) //alert('Tempid ='+tempid)
var credit=parseFloat(document.getElementById(tempid).innerText); var credit=parseFloat(document.getElementById(tempid).innerText);
//alert(credit+'credit');
credit1=credit; credit1=credit;
//alert('You have selected bankid=' +id+ '\n and your amount is=' +credit+ '\n Please select Invoice screen'); //alert('You have selected bankid=' +id+ '\n and your amount is=' +credit+ '\n Please select Invoice screen');
var idvalue1 = id+'-'+credit; var idvalue1 = id+'-'+credit;
tempcredit.push(idvalue1); tempcredit.push(idvalue1);
tot11=parseFloat(tot11); console.log(tempcredit);
//alert('tot11-'+tot11); var totalcredit=0;
tot11=parseFloat(tot11)+parseFloat(credit) $.each(tempcredit, function( index, value)
//alert('afetr add tot11-'+tot11); {
$('#addvalue').val(parseFloat(tot11).toFixed(2)); 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);
} }
@ -435,12 +499,57 @@ if (x==true)
else else
{ {
//alert('uncheck');
//$('#addvalue').val('0.00'); var id=document.getElementById ("bankid"+value).innerText;
delamount= document.getElementById ( "debit"+i ).innerText; delamount= document.getElementById ( "debit"+value ).innerText;
var tempcid = "credited"+value;
delcredit= document.getElementById (tempcid).innerText;
//alert(delcredit+'dc');
var tote= $('#addvalue').val(); var tote= $('#addvalue').val();
var afterdeltot= parseFloat(tote)- parseFloat(delamount); 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 --> <!-- /.box-body -->
<div class="box-footer" style="text-align:right"> <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" /> <input type="reset" class="btn btn-primary" value="Reset" />
</div> </div>
@ -565,53 +565,32 @@ function loadAccountType(id)
</div> </div>
<script> <script>
// function amountcheck()
// {
// var typeofmap = "<?php echo $typeofmap;?>";
// 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');
// }
// }
// else
// {
// validate();
// }
// }
function amountcheck() function amountcheck()
{ {
var typeofmap = "<?php echo $typeofmap;?>"; var typeofmap = "<?php echo $typeofmap;?>";
var rembalance="<?php echo $balancetoupdate;?>"; var rembalance="<?php echo $balancetoupdate;?>";
if(typeofmap=='Bank') // if(typeofmap=='Bank')
{ // {
//alert(rembalance+'rb'); // //alert(rembalance+'rb');
var cashamount = $('#totalamount').val(); // var cashamount = $('#totalamount').val();
//var totalupdate=parseFloat(rembalance)+parseFloat(cashamount); // //var totalupdate=parseFloat(rembalance)+parseFloat(cashamount);
alert(cashamount+'text'); // alert(cashamount+'text');
alert(totalupdate+'totalupdate'); // alert(totalupdate+'totalupdate');
if(parseFloat(totalupdate)>=parseFloat(cashamount)) // // if(parseFloat(totalupdate)>=parseFloat(cashamount))
{ // // {
validate(); // // validate();
} // // }
else // // else
{ // // {
alert('Your mapping amount is large'); // // alert('Your mapping amount is large');
} // // }
} // }
else // else
{ // {
validate(); // validate();
} // }
} }
function validate() function validate()
{ {