NEW PAYROLL MODIFICATION

This commit is contained in:
velz2020 2017-08-23 11:02:12 +05:30
parent 1f05f68a9d
commit 58a8b07925
8 changed files with 339 additions and 58 deletions

View File

@ -110,34 +110,26 @@ class emppaydate extends BaseController
$Allowances=$this->input->post('Allowances');
$PF_Rate=$this->input->post('PF_Rate');
$ESI_Rate=$this->input->post('ESI_Rate');
$Food_Allowances=$this->input->post('Food_Allowances');
$Food_Allowances=$this->input->post('Food_Allowances');
$Loan_Amount=$this->input->post('Loan_Amount');
$Load_Issued_date=$this->input->post('loan_issued_date');
$Load_Issued_date=$this->getDateformat2($Load_Issued_date);
$Due_Amount=$this->input->post('monthly_due');
$Due_Started=$this->input->post('due_started');
$Due_Started=$this->getDateformat2($Due_Started);
$No_Of_Dues=$this->input->post('no_of_due');
$Paid_due=$this->input->post('paid_due');
$Remaining_Due=$this->input->post('remaining_due');
$Paid_Amount=$this->input->post('Paid_Amount');
//$All = $this->input->post('All');
$CreateBy = $this->session->userdata ( 'userId' );
$chked = $this->input->post('is_Active');
$IsActive = '1';
// if(EmpID == -1)
// {
// // $this->session->set_flashdata('success', 'New Asset created successfully');
// redirect('emppaydate/addemppaydate','refresh');
// echo "<script>alert('Employee Must be select!');</script>";
// }
//else{
//$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
//$createddt = $dt->format('Y-m-d H:i:s');
// $emppayExists = $this->emppaydate_model->( $emppay);
// Becasue of done cool thinfg of it.
// $emppay = array();
$emppay = array('EmpID'=>$EmpID,'TotalSalary'=>$Total_Salary,'Basic_Pay'=>$Basic_Pay,'HRA_Rate'=>$HRA_Rate,'HRA_Amount'=>$HRA_Amount, 'OT_Rate'=>$OT_Rate, 'Allowances'=>$Allowances, 'PF_Rate'=>$PF_Rate, 'ESI_Rate'=>$ESI_Rate ,'Food_Allowances'=>$Food_Allowances,'is_Active'=>$IsActive,'Created_By'=>$CreateBy);
$emppay = array('EmpID'=>$EmpID,'TotalSalary'=>$Total_Salary,'Basic_Pay'=>$Basic_Pay,'HRA_Rate'=>$HRA_Rate,'HRA_Amount'=>$HRA_Amount, 'OT_Rate'=>$OT_Rate, 'Allowances'=>$Allowances, 'PF_Rate'=>$PF_Rate, 'ESI_Rate'=>$ESI_Rate ,'Food_Allowances'=>$Food_Allowances,'Loan_Amount'=>$Loan_Amount,'Loan_Issued_Date'=>$Load_Issued_date,'Monthly_Due'=>$Due_Amount,'Due_Start_Date'=>$Due_Started,'No_of_Dues'=>$No_Of_Dues,'Paid_Due'=>$Paid_due,'Remaining_Due'=>$Remaining_Due,'Paid_Amount'=>$Paid_Amount,'is_Active'=>$IsActive,'Created_By'=>$CreateBy);
// print_r($emppay);die();
$result = $this->emppaydate_model->addNewemppay($emppay);
@ -198,7 +190,8 @@ class emppaydate extends BaseController
$this->form_validation->set_rules('PF_Rate','PF_Rate','trim|required');
$this->form_validation->set_rules('ESI_Rate','ESI_Rate','trim|required');
$this->form_validation->set_rules('Food_Allowances','Food_Allowances','trim|requried');
@ -222,9 +215,20 @@ class emppaydate extends BaseController
$Allowances=$this->input->post('Allowances');
$PF_Rate=$this->input->post('PF_Rate');
$ESI_Rate=$this->input->post('ESI_Rate');
$Loan_Amount=$this->input->post('Loan_Amount');
$Load_Issued_date=$this->input->post('loan_issued_date');
$Load_Issued_date=$this->getDateformat2($Load_Issued_date);
$Due_Amount=$this->input->post('monthly_due');
$Due_Started=$this->input->post('due_started');
$Due_Started=$this->getDateformat2($Due_Started);
//echo $Load_Issued_date. "-" . $Due_Started;die();
$No_Of_Dues=$this->input->post('no_of_due');
$Paid_due=$this->input->post('paid_due');
$Remaining_Due=$this->input->post('remaining_due');
$Paid_Amount=$this->input->post('Paid_Amount');
$is_Active=$this->input->post('is_Active');
$Last_Mod_By=$this->input->post('Last_Mod_By');
$Last_Mod_Time=$this->input->post('Last_Mod_Time');
$Last_Mod_By=$this->session->userdata('userId');
$Last_Mod_Time=date('d-m-Y h:i:sa');
$Food_Allowances=$this->input->post('Food_Allowances');
$chked = $this->input->post('is_Active');
@ -242,9 +246,9 @@ class emppaydate extends BaseController
$emppaydatas = array();
$emppaydatas = array('Pay_Data_ID'=>$Pay_Data_ID, 'EmpID'=>$EmpID,'TotalSalary'=>$TotalSalary,'Basic_Pay'=>$Basic_Pay, 'HRA_Rate'=>$HRA_Rate,'HRA_Amount'=>$HRA_Amount,'OT_Rate'=>$OT_Rate, 'Allowances'=>$Allowances, 'PF_Rate'=>$PF_Rate, 'ESI_Rate'=>$ESI_Rate,'Food_Allowances'=>$Food_Allowances, 'Last_Mod_By'=>$Last_Mod_By, 'Last_Mod_Time'=>$Last_Mod_Time, 'is_Active'=>$IsActive);
$emppaydatas = array('Pay_Data_ID'=>$Pay_Data_ID,'EmpID'=>$EmpID,'TotalSalary'=>$TotalSalary,'Basic_Pay'=>$Basic_Pay,'HRA_Rate'=>$HRA_Rate,'HRA_Amount'=>$HRA_Amount, 'OT_Rate'=>$OT_Rate, 'Allowances'=>$Allowances, 'PF_Rate'=>$PF_Rate, 'ESI_Rate'=>$ESI_Rate ,'Food_Allowances'=>$Food_Allowances,'Loan_Amount'=>$Loan_Amount,'Loan_Issued_Date'=>$Load_Issued_date,'Monthly_Due'=>$Due_Amount,'Due_Start_Date'=>$Due_Started,'No_of_Dues'=>$No_Of_Dues,'Paid_Due'=>$Paid_due,'Remaining_Due'=>$Remaining_Due,'Paid_Amount'=>$Paid_Amount,'is_Active'=>$IsActive,'Last_Mod_By'=>$Last_Mod_By,'Last_Mod_Time'=>$Last_Mod_Time);
// print_r($emppaydatas);die();
$result = $this->emppaydate_model->editemppay($emppaydatas);
@ -404,6 +408,23 @@ class emppaydate extends BaseController
$this->loadViews("404", $this->global, NULL, NULL);
}
function getDateformat2($Val)
{
$date = new DateTime($Val,new DateTimeZone('Asia/Kolkata'));
$retDate = $date->format('d-m-Y');
return $retDate;
}
function getDateformat($Val)
{
$date = new DateTime($Val,new DateTimeZone('Asia/Kolkata'));
$retDate = $date->format('Y-m-d H:i:s');
return $retDate;
}
}
?>

View File

@ -172,7 +172,7 @@ class monthlypay extends BaseController
$this->form_validation->set_rules('LOP_Days','LOP_Days','trim|required');
$this->form_validation->set_rules('OT_Hrs_Worked','OT_Hrs_Worked','trim|required');
$this->form_validation->set_rules('Loan_Recovered','Loan_Recovered','trim|required');
$this->form_validation->set_rules('Loan_Balance','Loan_Balance','trim|required');
//$this->form_validation->set_rules('Loan_Balance','Loan_Balance','trim|required');
$this->form_validation->set_rules('Incentives','Incentives','trim|required');
$this->form_validation->set_rules('Other_Deductions','Other_Deductions','trim|required');

View File

@ -25,7 +25,11 @@ class emppaydate_model extends CI_Model
OR PF_Rate LIKE '%".$searchText."%'
OR ESI_Rate LIKE '%".$searchText."%'
OR is_Active LIKE '%".$searchText."%'
OR Food_Allowances LIKE '%".$searchText."%'
OR Loan_Amount LIKE '%".$searchText."%'
OR Loan_Issued_Date LIKE '%".$searchText."%'
OR Monthly_Due LIKE '%".$searchText."%'
OR Monthly_Due LIKE '%".$searchText."%'
OR Due_Start_Date LIKE '%".$searchText."%'
)";
$this->db->where($likeCriteria);
@ -61,6 +65,11 @@ class emppaydate_model extends CI_Model
OR ESI_Rate LIKE '%".$searchText."%'
OR is_Active LIKE '%".$searchText."%'
OR Food_Allowances LIKE '%".$searchText."%'
OR Loan_Amount LIKE '%".$searchText."%'
OR Loan_Issued_Date LIKE '%".$searchText."%'
OR Monthly_Due LIKE '%".$searchText."%'
OR Monthly_Due LIKE '%".$searchText."%'
OR Due_Start_Date LIKE '%".$searchText."%'
)";
$this->db->where($likeCriteria);
@ -95,7 +104,8 @@ class emppaydate_model extends CI_Model
//$this->db->where('roleId !=', 1);
$this->db->where('Pay_Data_ID', $paydataid);
$query = $this->db->get();
//print_r($query->result());
//die();
return $query->result();
}
@ -104,6 +114,8 @@ class emppaydate_model extends CI_Model
{
$paydateid=$emppaydatas['Pay_Data_ID'];
//echo $paydateid;
//print_r($emppaydatas);die();
$this->db->where('Pay_Data_ID' ,$paydateid);
$this->db->update('T_Emp_Pay_Data',$emppaydatas);

View File

@ -1,5 +1,22 @@
<script>
$(document).ready(function(){
$("#loan_issued_date").datepicker({
minDate : 'now',
// maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
});
$("#due_started").datepicker({
minDate :'now',
//maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
});
});
</script>
@ -30,6 +47,9 @@
<div class="box-body">
<div class="col-md-12">
<legend>Pay Details</legend>
</div>
<div class="row">
<!--<div class="col-md-4">
@ -212,6 +232,71 @@
</div><!--row completed div-->
<div class="col-md-12">
<legend>Loan Details</legend>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Pay_Data_ID">Loan Amount</span>
<input type="text" class="form-control" id="Loan_Amount" name="Loan_Amount" value="" pattern="[0-9]{1,6}" title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="EmpID">Loan Issue(d) Date:</span>
<input type="text" class="form-control" id="loan_issued_date" name="loan_issued_date" value="">
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Monthly Due(s):</span>
<input type="text" class="form-control requried" id="monthly_due" name="monthly_due" value="" pattern="[0-9]{1,6}" title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Due Started:</span>
<input type="text" class="form-control requried" id="due_started" name="due_started" value="">
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">No Of Due(s):</span>
<input type="text" class="form-control requried" id="no_of_due" name="no_of_due" value="" pattern="[0-9]{1,2}" title="Minimum 1 digit,Maximum 2 Digit" readonly>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Paid Amount:</span>
<input type="text" class="form-control requried" id="Paid_Amount" name="Paid_Amount" value="0" pattern="[0-9]{1,2}" title="Minimum 1 digit,Maximum 2 Digit" readonly>
</div>
</div>
</div>
<input type="text" id="remaining_due" name="remaining_due">
<input type="text" id="paid_due" name="paid_due" value="0">
</div>
<div class="box-footer" style="text-align:right">
<input type="submit" class="btn btn-info" value="Submit" onmouseover="empcheck();" />
<input type="reset" class="btn btn-info" value="Reset" />
@ -279,6 +364,35 @@ function calculalteHRA()
document.getElementById('HRA_Amount').value=temp;
}
}
function duecalculation()
{
var totaldue=0;
var loan=document.getElementById('Loan_Amount').value;
var due=document.getElementById('monthly_due').value;
//alert(loan+'-'+due);
if(loan != 0)
{
if(due == 0)
{
alert("Enter Monthly Due Amount....!");
$('#monthly_due').focus();
}
else
{
//due=document.getElementById('monthly_due').value;
totaldue=loan/due;
}
}
//alert(totaldue);
document.getElementById('no_of_due').value=Math.ceil(totaldue);
var noofdues=document.getElementById('no_of_due').value;
$('#remaining_due').val(noofdues);
}
</script>

View File

@ -1,4 +1,21 @@
<script>
$(document).ready(function(){
$("#loan_issued_date").datepicker({
minDate : 'now',
// maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
});
$("#due_started").datepicker({
minDate :'now',
//maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
});
});
</script>
<?php
@ -17,8 +34,16 @@
$Created_Time='';
$Last_Mod_By='';
$Last_Mod_Time='';
$HRA_Amount='';
$TotalSalary='';
$HRA_Amount=0.0;
$TotalSalary=0.0;
$Loan_Amount='';
$Loan_issued_date='';
$Monthly_due='';
$Due_start_date='';
$No_of_dues='';
$Remaining_Due='';
$Paid_Due='';
$Paid_Amount=0;
if(!empty($emppay))
@ -41,6 +66,16 @@ if(!empty($emppay))
$ESI_Rate=$ep->ESI_Rate;
$is_Active=$ep->is_Active;
$Food_Allowances=$ep->Food_Allowances;
$Loan_Amount=$ep->Loan_Amount;
$Loan_issued_date=new DateTime( $ep->Loan_Issued_Date, new DateTimeZone('Asia/Kolkata'));
$Loan_issued_date=$Loan_issued_date->format('d-m-Y');
$Monthly_due=$ep->Monthly_Due;
$Due_start_date=new DateTime( $ep->Due_Start_Date, new DateTimeZone('Asia/Kolkata'));
$Due_start_date=$Due_start_date->format('d-m-Y');
$No_of_dues=$ep->No_of_Dues;
$Paid_Due=$ep->Paid_Due;
$Remaining_Due=$ep->Remaining_Due;
$Paid_Amount=$ep->Paid_Amount;
$Created_By=$ep->Created_By;
$Created_Time=$ep->Created_Time;
$Last_Mod_By=$ep->Last_Mod_By;
@ -79,6 +114,9 @@ if(!empty($emppay))
<form role="form" id="edit" action="<?php echo base_url() ?>emppaydate/editemppay" method="post">
<div class="box-body">
<div class="col-md-12">
<legend>Pay Details</legend>
</div>
<div class="row">
<div class="col-md-4">
@ -202,9 +240,72 @@ if(!empty($emppay))
</div>
</div>
</div>
<div class="col-md-12">
<legend>Loan Details</legend>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Pay_Data_ID">Loan Amount</span>
<input type="text" class="form-control" id="Loan_Amount" name="Loan_Amount" value="<?php echo $Loan_Amount; ?>" pattern="[0-9]{4,6}" title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="EmpID">Loan Issue(d) Date:</span>
<input type="text" class="form-control" id="loan_issued_date" name="loan_issued_date" value="<?php echo $Loan_issued_date;?>">
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Monthly Due(s):</span>
<input type="text" class="form-control requried" id="monthly_due" name="monthly_due" value="<?php echo $Monthly_due; ?>" pattern="[0-9]{4,6}" title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Due Started:</span>
<input type="text" class="form-control requried" id="due_started" name="due_started" value="<?php echo $Due_start_date; ?>">
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">No Of Due(s):</span>
<input type="text" class="form-control requried" id="no_of_due" name="no_of_due" value="<?php echo $No_of_dues; ?>" pattern="[0-9]{1,2}" title="Minimum 1 digit,Maximum 2 Digit" readonly>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Paid Amount:</span>
<input type="text" class="form-control requried" id="Paid_Amount" name="Paid_Amount" value="<?php echo $Paid_Amount; ?>" pattern="[0-9]{1,2}" title="Minimum 1 digit,Maximum 2 Digit" readonly>
</div>
</div>
</div>
RD<input type="text" id="remaining_due" name="remaining_due" value="<?php echo $Remaining_Due;?>">
PD<input type="text" id="paid_due" name="paid_due" value="<?php echo $Paid_Due;?>">
</div>
@ -247,7 +348,7 @@ if(!empty($emppay))
<div class="form-group">
<div class="form-group">
<!--<span for ="Last_Mod_Time">Last Modified Time:</span>-->
<input type="hidden" class="form-control required" id="Last Modified Time" name="Last Modified Time" value="<?php echo $Last_Mod_Time; ?>">
<input type="hidden" class="form-control required" id="Last_Modified_Time" name="Last_Modified_Time" value="<?php echo $Last_Mod_Time; ?>">
</div>
</div>
</div>
@ -320,7 +421,7 @@ if(!empty($emppay))
</section>
</div>
<script src="<?php echo base_url(); ?>assets/js/editUser.js" type="text/javascript"></script>
<script>
function calculateBasic()
@ -344,4 +445,35 @@ function calculateBasic()
}
function duecalculation()
{
var totaldue=0;
var loan=document.getElementById('Loan_Amount').value;
var due=document.getElementById('monthly_due').value;
//alert(loan+'-'+due);
if(loan != 0)
{
if(due == 0)
{
alert("Enter Monthly Due Amount....!");
$('#monthly_due').focus();
}
else
{
//due=document.getElementById('monthly_due').value;
totaldue=loan/due;
}
}
//alert(totaldue);
document.getElementById('no_of_due').value=Math.ceil(totaldue);
var noofdues=document.getElementById('no_of_due').value;
$('#remaining_due').val(noofdues);
}
</script>
<script>
</script>

View File

@ -239,23 +239,8 @@ function validateAll(){
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="Loan_Balance">Loan Balance:</span>
<input type="text" class="form-control required" id="Loan_Balance" name="Loan_Balance" onfocusout="validateLB();"pattern="[0-9 ]{1,6}" value="<?php echo $Loan_Balance; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="Incentives">Incentives:</span>
@ -263,6 +248,23 @@ function validateAll(){
</div>
</div>
</div>
<!-- <div class="col-md-6">
<div class="form-group">
<div class="form-group">
<span for="Loan_Balance">Loan Balance:</span>
<input type="text" class="form-control required" id="Loan_Balance" name="Loan_Balance" onfocusout="validateLB();"pattern="[0-9 ]{1,6}" value="<?php echo $Loan_Balance; ?>">
</div>
</div>
</div> -->
</div>
<div class="row">
<div class="col-md-6">

View File

@ -61,10 +61,10 @@
<td><?php echo $record->Pay_Data_ID ?></td>
<td><?php echo $record->EmpID ?></td>
<td><?php echo $record->TotalSalary ?></td>
<td><?php echo number_format($record->TotalSalary,0,'',''); ?></td>
<td><?php echo $record->Basic_Pay ?></td>
<td><?php echo $record->HRA_Rate ?></td>
<td><?php echo $record->HRA_Amount ?></td>
<td><?php echo number_format($record->HRA_Amount,0,'',''); ?></td>
<td><?php echo $record->OT_Rate ?></td>
<td><?php echo $record->Allowances ?></td>
<td><?php echo $record->PF_Rate ?></td>

View File

@ -52,7 +52,7 @@ speed:500
<th>LOP Days</th>
<th>OT Hours Worked</th>
<th>Loan Recovered</th>
<th>Loan Balance</th>
<!-- <th>Loan Balance</th> -->
<th>Incentives</th>
<th>Other Deductions</th>
<th>Edit</th>
@ -72,7 +72,7 @@ speed:500
<td><?php echo $record->LOP_Days ?></td>
<td><?php echo $record->OT_Hrs_Worked ?></td>
<td><?php echo $record->Loan_Recovered ?></td>
<td><?php echo $record->Loan_Balance ?></td>
<!-- <td><?php echo $record->Loan_Balance ?></td> -->
<td><?php echo $record->Incentives ?></td>
<td><?php echo $record->Other_Deductions ?></td>