diff --git a/application/models/dahsboard_model.php b/application/models/dahsboard_model.php index 5134e1ef..901a1d64 100755 --- a/application/models/dahsboard_model.php +++ b/application/models/dahsboard_model.php @@ -1659,7 +1659,7 @@ if ($cname!= ''){ } - $sql.="group by pono"; + $sql.="group by pono,igrn"; // echo $m; // echo $sid; //echo $sql; diff --git a/application/views/monthlypayinputs.php b/application/views/monthlypayinputs.php index 8f71a052..06a0e0f9 100755 --- a/application/views/monthlypayinputs.php +++ b/application/views/monthlypayinputs.php @@ -234,17 +234,18 @@ $('html').bind('keypress', function(e) Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?> - Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Monthly_Due)){echo $record->Monthly_Due;}else { echo number_format(0.00,2,'.','');} ?> + Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Monthly_Due)){echo $record->Monthly_Due; $totalmonthloan []=$record->Monthly_Due;}else { echo number_format(0.00,2,'.','');} ?> - - + + Key) && !empty($record->Loan_ID)){ echo "contenteditable='true'; style='background-color:#ffcccc;text-align:right' title='Loan Pending'"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" > 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) ?> - - + + Total + + @@ -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)); }