payslip incentives edit

This commit is contained in:
venbatechnologies 2018-05-02 13:43:21 +05:30
parent ce44c0bd75
commit f34c4b8452
4 changed files with 59 additions and 34 deletions

View File

@ -504,9 +504,10 @@ function phpAlert($msg) {
$this->loadViews("payslipupload2", $this->global, NULL);
}
public function monthlyInputs()
public function monthlyInputs()
{
$current = date("m-Y");
//echo $current;
$data['month'] = $this->monthlypay_model->monthlyListing($current);
// $data['fresh'] = $this-> monthlypay_model->getEmpPayDetails($current);
$data['dropdownvalue'] = $current;
@ -526,7 +527,7 @@ foreach($data['fresh'] as $value){
$Paid_leave = $value->Paid_leave; // leave day
$OT_Hrs_Worked = $value->OT_Hrs_Worked; //OT hours
$Monthly_Due= $value->Monthly_Due;// loan due amt
$MasterIncentives=$value->Incentives;//Master values get
$MasterIncentives=$value->MasterIncentives;//Master values get
// echo 'master'.$MasterIncentives;
$Allowances =$value->Allowances;
@ -534,21 +535,21 @@ foreach($data['fresh'] as $value){
$PF_Rate=$value->PF_Rate;
$ESI_Rate=$value->ESI_Rate;
$MonthIncentive = $value->Incent;//T_Monthly_Pay_Inputs,for change month
$MonthIncentive = $value->MonthlyIncentives;//T_Monthly_Pay_Inputs,for change month
//echo 'month'. $MonthIncentive;
$Incentive = 0;
// $Incentive = 0;
if(empty($MonthIncentive))
{
// if(empty($MonthIncentive))
// {
$Incentive = $MasterIncentives;
}
else
{
$Incentive = $MonthIncentive;
// $Incentive = $MasterIncentives;
// }
// else
// {
// $Incentive = $MonthIncentive;
}
// }
//echo $Incentive;
@ -600,7 +601,7 @@ foreach($data['fresh'] as $value){
/** pf amount per day**/
//echo $totalothour;die;
$salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $Incentive;
$salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $MasterIncentives;
$salaryInCurrentday = $salaryInCurrentdays - ($esiAmount + $pfAmount) - $Monthly_Due;
$employeeSalary []= round($salaryInCurrentday);
@ -644,7 +645,7 @@ foreach($data['fresh'] as $value){
$Paid_leave = $value->Paid_leave; // leave day
$OT_Hrs_Worked = $value->OT_Hrs_Worked; //OT hours
$Monthly_Due= $value->Monthly_Due;// loan due amt
$MasterIncentives=$value->Incentives;//Master values get
$MasterIncentives=$value->MasterIncentives;//Master values get
// echo 'master'.$MasterIncentives;
$Allowances =$value->Allowances;
@ -652,7 +653,7 @@ foreach($data['fresh'] as $value){
$PF_Rate=$value->PF_Rate;
$ESI_Rate=$value->ESI_Rate;
$MonthIncentive = $value->Incent;//T_Monthly_Pay_Inputs,for change month
$MonthIncentive = $value->MonthlyIncentives;//T_Monthly_Pay_Inputs,for change month
//echo 'month'. $MonthIncentive;
$Incentive = 0;
@ -731,7 +732,7 @@ foreach($data['fresh'] as $value){
$this->global['pageTitle'] = 'Siddharth : Payroll Monthly Inputs';
$this->loadViews("monthlypayinputs", $this->global,$data,NULL);
}
function saveMonthlyData()
{

View File

@ -10,14 +10,22 @@ class monthlypay_model extends CI_Model
* @param number $segment : This is pagination limit
* @return array $result : This is result
*/
function monthlyListing($current="")
function monthlyListing($current="")
{
//echo $current;
$month = $current;
if(strlen($month) == 6)
{
$month = '0'.$month;
}
//echo $month;
$curr_split = explode('-',$current);
$month_val = $curr_split[0];
$year_val = $curr_split[1];
$date_val =cal_days_in_month(CAL_GREGORIAN,$month_val,$year_val);
$lastdate = $year_val.'-'.$month_val.'-'.$date_val;
//echo $lastdate ;
// $this->db->select('T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Payroll.Key,T_Loan_Master.Loan_ID');
// $this->db->from('T_Monthly_Pay_Inputs');
@ -43,6 +51,7 @@ class monthlypay_model extends CI_Model
return $result;
}
function getEmpPayDetails($current="",$s="")
{
@ -90,21 +99,22 @@ if(strlen($month) == 6)
//echo $lastdate;
//left join T_Payroll on T_Employee_Details.EmpID = T_Payroll.EmpID and month(T_Payroll.PayOn) = month(?) and year(T_Payroll.PayOn) = year(?)
$sql ="select T_Emp_Pay_Data.EmpID, T_Emp_Pay_Data.Incentives,T_Emp_Pay_Data.*,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining,T_Attendance.Days_Worked as Days_worked,T_Attendance.Absent as LOP_Days,T_Attendance.Paid_Leave as Paid_leave,T_Attendance.Total_OTHrs as OT_Hrs_Worked,T_Attendance.NoofDays,T_Loan_Master.Loan_ID,T_Loan_Master.Monthly_Due,T_Payroll.Key,T_Monthly_Pay_Inputs.Incentives as Incent
$sql ="select T_Emp_Pay_Data.EmpID, T_Emp_Pay_Data.Incentives as MasterIncentives,T_Emp_Pay_Data.*,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining,T_Attendance.Days_Worked as Days_worked,T_Attendance.Absent as LOP_Days,T_Attendance.Paid_Leave as Paid_leave,T_Attendance.Total_OTHrs as OT_Hrs_Worked,T_Attendance.NoofDays,T_Loan_Master.Loan_ID,T_Loan_Master.Monthly_Due,T_Payroll.Key,T_Monthly_Pay_Inputs.Incentives as MonthlyIncentives
from T_Emp_Pay_Data
left join T_Employee_Details on T_Employee_Details.EmpID = T_Emp_Pay_Data.EmpID
left join T_Payroll on T_Employee_Details.EmpID = T_Payroll.EmpID and T_Payroll.PayOn = ?
left join T_Attendance on T_Emp_Pay_Data.EmpID = T_Attendance.EmpID
left join T_Monthly_Pay_Inputs on T_Monthly_Pay_Inputs.EmpID = T_Emp_Pay_Data.EmpID
left join T_Monthly_Pay_Inputs on T_Monthly_Pay_Inputs.EmpID = T_Emp_Pay_Data.EmpID and T_Monthly_Pay_Inputs.Month_Year = ?
left join T_Loan_Master on T_Emp_Pay_Data.EmpID = T_Loan_Master.EmpID and T_Loan_Master.is_Active = 1
where T_Employee_Details.DateofJoining <= ?
and month(T_Attendance.Month_Year) = month(?) and year(T_Attendance.Month_Year) = year(?)
order by T_Employee_Details.EmpID";
$query = $this->db->query($sql,array($month,$lastdate,$current,$current));
$query = $this->db->query($sql,array($month,$month,$lastdate,$current,$current));
return $query->result();
}
function getPublicHoldays($current="")
{
if(!empty($current))

View File

@ -49,7 +49,7 @@
<div class="col-md-3">
<label>Nature of Maintenance:</label></br>
<input type="radio" id="radiobtn1" name="radiobtn" value="0" checked>Maintenance &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" id="radiobtn1" name="radiobtn" value="0" checked>Preventive &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" id="radiobtn2" name="radiobtn" value="1" >Breakdown
</div>

View File

@ -1,6 +1,6 @@
<?php
$sample = array_merge($month,$fresh);
// print_r($fresh);
//print_r("month"+$month);
$ex = explode('-',$dropdownvalue);
@ -68,7 +68,7 @@ $('html').bind('keypress', function(e)
</div><!-- /.box-header -->
<?php
print_r($sample);
$year = date("Y");
$current = date("m-Y");
@ -230,7 +230,17 @@ $('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 }?> ><?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,'.','');} ?></td>
<td id="incentie<?php echo $index?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);"<?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?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->Incent)){echo $record->Incent;}else {echo $record->Incentives;} ?></td>
<td id="incentie<?php echo $index?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);"<?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?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->MasterIncentives)){echo $record->MasterIncentives;}else {echo $record->MonthlyIncentives;} ?> -->
<?php if(!empty($record->MonthlyIncentives)){echo $record->MonthlyIncentives;}else {echo $record->MasterIncentives;} ?>
</td>
<!-- else{ echo number_format(0.00,2,'.','');;} -->
<td id ="otherDet<?php echo $index?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);"<?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?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->Other_Deductions)){echo $record->Other_Deductions; }else{ echo number_format(0.00,2,'.','');;} ?></td>
@ -418,11 +428,13 @@ function isCheckKeyCode(event){
{
if(year == 1)
{
$("#savebutton").hide();
// $("#savebutton").hide();
$("#savebutton").show();
}
else
{
$("#savebutton").hide();
//$("#savebutton").hide();
$("#savebutton").show();
}
}
else if(savebuttonstatus < 0 )
@ -434,16 +446,19 @@ function isCheckKeyCode(event){
}
else if(year == 0)
{
$("#savebutton").hide();
// $("#savebutton").hide();
$("#savebutton").show();
}
else
{
$("#savebutton").hide();
//$("#savebutton").hide();
$("#savebutton").show();
}
}
else if(savebuttonstatus == 0 && year == 0)
{
$("#savebutton").hide();
//$("#savebutton").hide();
$("#savebutton").show();
}
else if(savebuttonstatus == 1)
{
@ -464,8 +479,7 @@ function isCheckKeyCode(event){
{
//alert("hello");
var str=event.target.id;
var str=event.target.id;
var sno = str.substr(8);
//alert(sno);
@ -491,7 +505,7 @@ function isCheckKeyCode(event){
var hraAmt =parseFloat(document.getElementById('hraAmt'+sno).value);
//console.log(incentie);
//con(incentie);
var dayWorkPaid=dayWorks+paidLeave;
// console.log("day"+dayWorkPaid);