totalpayslip
This commit is contained in:
parent
9ea2111bd3
commit
ef6d4810cd
@ -1659,7 +1659,7 @@ if ($cname!= ''){
|
||||
|
||||
}
|
||||
|
||||
$sql.="group by pono";
|
||||
$sql.="group by pono,igrn";
|
||||
// echo $m;
|
||||
// echo $sid;
|
||||
//echo $sql;
|
||||
|
||||
@ -234,17 +234,18 @@ $('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="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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<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))
|
||||
{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>
|
||||
<tfoot><tr>
|
||||
<th colspan="4"></th>
|
||||
<th colspan="3"></th>
|
||||
<th colspan="5"></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="other"><?php echo array_sum($totalotherDet);?></th>
|
||||
<th id="fest"><?php echo array_sum($totalfestival);?></th>
|
||||
@ -350,6 +353,8 @@ $('html').bind('keypress', function(e)
|
||||
var estTotal = [];
|
||||
var totalinst = [];
|
||||
var totalotherDet =[];
|
||||
var totalmonthloan =[];
|
||||
var totalmanualoan =[];
|
||||
|
||||
$(function () {
|
||||
var i = 0;
|
||||
@ -370,7 +375,24 @@ $('html').bind('keypress', function(e)
|
||||
i = i+1;
|
||||
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({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
@ -568,7 +590,11 @@ function isCheckKeyCode(event){
|
||||
var paidLeave =parseFloat(document.getElementById('paidLeave'+sno).textContent);
|
||||
var otHrsWork =parseFloat(document.getElementById('otHrsWork'+sno).textContent);
|
||||
var monthDue =parseFloat(document.getElementById('monthDue'+sno).textContent);
|
||||
//totalmonthloan[sno]=monthDue;
|
||||
|
||||
var loanRecd=document.getElementById('loanRecd'+sno).textContent;
|
||||
|
||||
//totalmanualoan[sno]=loanRecd;
|
||||
var incentie=parseFloat(document.getElementById('incentie'+sno).textContent);
|
||||
|
||||
|
||||
@ -636,6 +662,7 @@ totalfestival[sno]= Festival ;
|
||||
|
||||
var current_loan_amt = 0;
|
||||
var autoLoan =parseFloat(monthDue);
|
||||
console.log(monthDue);
|
||||
var manualLoan =parseFloat(loanRecd);
|
||||
// var manualLoan = Math.min.apply(null, arrayOfNumbers.filter(function(loanRecd) { return !isNaN(loanRecd); }))
|
||||
//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);
|
||||
|
||||
calculategrandtotal();
|
||||
@ -825,6 +872,36 @@ function calculategrandtotal(){
|
||||
sum += tempTotal[i] << 0;
|
||||
}
|
||||
$('#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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user