totalpayslip

This commit is contained in:
venbatechnologies 2018-05-23 19:30:07 +05:30
parent 9ea2111bd3
commit ef6d4810cd
2 changed files with 84 additions and 7 deletions

View File

@ -1659,7 +1659,7 @@ if ($cname!= ''){
} }
$sql.="group by pono"; $sql.="group by pono,igrn";
// echo $m; // echo $m;
// echo $sid; // echo $sid;
//echo $sql; //echo $sql;

View File

@ -234,7 +234,7 @@ $('html').bind('keypress', function(e)
<td id="otHrsWork<?php echo $index?>"<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?></td> <td id="otHrsWork<?php echo $index?>"<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?></td>
<td id="monthDue<?php echo $index?>" <?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Monthly_Due)){echo $record->Monthly_Due;}else { echo number_format(0.00,2,'.','');} ?></td> <td id="monthDue<?php echo $index?>" <?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Monthly_Due)){echo $record->Monthly_Due; $totalmonthloan []=$record->Monthly_Due;}else { echo number_format(0.00,2,'.','');} ?></td>
@ -244,7 +244,8 @@ $('html').bind('keypress', function(e)
<td id="loanRecd<?php echo $index?>" onkeypress="return isCheckKeyCode(event);" onkeyup="changeInput(event);"<?php if(empty($record->Key) && !empty($record->Loan_ID)){ echo "contenteditable='true'; style='background-color:#ffcccc;text-align:right' title='Loan Pending'"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> > <td id="loanRecd<?php echo $index?>" onkeypress="return isCheckKeyCode(event);" onkeyup="changeInput(event);"<?php if(empty($record->Key) && !empty($record->Loan_ID)){ echo "contenteditable='true'; style='background-color:#ffcccc;text-align:right' title='Loan Pending'"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> >
<?php if(!empty($record->Loan_Recovered)) <?php if(!empty($record->Loan_Recovered))
{if(is_numeric($record->Loan_Recovered)){echo number_format($record->Loan_Recovered,2,'.','');}else {echo $record->Loan_Recovered;}}else{echo number_format(0.00,2,'.','');} ?> {if(is_numeric($record->Loan_Recovered)){echo number_format($record->Loan_Recovered,2,'.',''); $totalmanualoan[] = $record->Loan_Recovered;}else {echo $record->Loan_Recovered; $totalmanualoan[] = $record->Loan_Recovered;}}else{echo number_format(0.00,2,'.','');} ?>
@ -317,10 +318,12 @@ $('html').bind('keypress', function(e)
?> ?>
</tbody> </tbody>
<tfoot><tr> <tfoot><tr>
<th colspan="4"></th> <th colspan="5"></th>
<th colspan="3"></th>
<th>Total</th> <th>Total</th>
<th id="manualoan"><?php echo array_sum($totalmonthloan);?></th>
<th id="monthloan"><?php echo array_sum($totalmanualoan);?></th>
<th id="inst"><?php echo array_sum($totalinst);?></th> <th id="inst"><?php echo array_sum($totalinst);?></th>
<th id="other"><?php echo array_sum($totalotherDet);?></th> <th id="other"><?php echo array_sum($totalotherDet);?></th>
<th id="fest"><?php echo array_sum($totalfestival);?></th> <th id="fest"><?php echo array_sum($totalfestival);?></th>
@ -350,6 +353,8 @@ $('html').bind('keypress', function(e)
var estTotal = []; var estTotal = [];
var totalinst = []; var totalinst = [];
var totalotherDet =[]; var totalotherDet =[];
var totalmonthloan =[];
var totalmanualoan =[];
$(function () { $(function () {
var i = 0; var i = 0;
@ -371,6 +376,23 @@ $('html').bind('keypress', function(e)
totalotherDet [i]=$(this).find('td').eq(9).text(); totalotherDet [i]=$(this).find('td').eq(9).text();
}); });
var i = 0;
$('tr.lastvalue').each(function(){
i = i+1;
totalmanualoan [i]=$(this).find('td').eq(6).text();
});
//console.log(totalmanualoan);
var i = 0;
$('tr.lastvalue').each(function(){
i = i+1;
totalmonthloan[i]=$(this).find('td').eq(7).text();
});
console.log(totalmonthloan);
/* $('#monthlylisting').DataTable({ /* $('#monthlylisting').DataTable({
"paging": true, "paging": true,
"lengthChange": true, "lengthChange": true,
@ -568,7 +590,11 @@ function isCheckKeyCode(event){
var paidLeave =parseFloat(document.getElementById('paidLeave'+sno).textContent); var paidLeave =parseFloat(document.getElementById('paidLeave'+sno).textContent);
var otHrsWork =parseFloat(document.getElementById('otHrsWork'+sno).textContent); var otHrsWork =parseFloat(document.getElementById('otHrsWork'+sno).textContent);
var monthDue =parseFloat(document.getElementById('monthDue'+sno).textContent); var monthDue =parseFloat(document.getElementById('monthDue'+sno).textContent);
//totalmonthloan[sno]=monthDue;
var loanRecd=document.getElementById('loanRecd'+sno).textContent; var loanRecd=document.getElementById('loanRecd'+sno).textContent;
//totalmanualoan[sno]=loanRecd;
var incentie=parseFloat(document.getElementById('incentie'+sno).textContent); var incentie=parseFloat(document.getElementById('incentie'+sno).textContent);
@ -636,6 +662,7 @@ totalfestival[sno]= Festival ;
var current_loan_amt = 0; var current_loan_amt = 0;
var autoLoan =parseFloat(monthDue); var autoLoan =parseFloat(monthDue);
console.log(monthDue);
var manualLoan =parseFloat(loanRecd); var manualLoan =parseFloat(loanRecd);
// var manualLoan = Math.min.apply(null, arrayOfNumbers.filter(function(loanRecd) { return !isNaN(loanRecd); })) // var manualLoan = Math.min.apply(null, arrayOfNumbers.filter(function(loanRecd) { return !isNaN(loanRecd); }))
//alert(manualLoan); //alert(manualLoan);
@ -761,6 +788,26 @@ totalfestival[sno]= Festival ;
} }
}); });
$.each(totalmonthloan,function(i,value){
if(sno==i){
totalmonthloan[i] = loanRecd;
}
});
$.each(totalmanualoan,function(i,value){
if(sno==i){
totalmanualoan[i] = monthDue;
}
});
//console.log(totalinst); //console.log(totalinst);
calculategrandtotal(); calculategrandtotal();
@ -825,6 +872,36 @@ function calculategrandtotal(){
sum += tempTotal[i] << 0; sum += tempTotal[i] << 0;
} }
$('#estsal').text(parseFloat(sum).toFixed(2)); $('#estsal').text(parseFloat(sum).toFixed(2));
$.each(totalmonthloan, function( index, value )
{
//var res2 = value.split('-');
tempTotal[index]=parseFloat(value);
});
var sum = 0;
for (var i = 0; i < tempTotal.length; i++) {
sum += tempTotal[i] << 0;
}
$('#monthloan').text(parseFloat(sum).toFixed(2));
console.log(totalmanualoan);
$.each(totalmanualoan, function( index, value )
{
//var res2 = value.split('-');
tempTotal[index]=parseFloat(value);
});
var sum = 0;
for (var i = 0; i < tempTotal.length; i++) {
sum += tempTotal[i] << 0;
}
$('#manualoan').text(parseFloat(sum).toFixed(2));
} }