PAYROLL CHANGES

This commit is contained in:
velz2020 2017-09-11 19:46:01 +05:30
parent bcdb53b2d3
commit affef22b25
10 changed files with 517 additions and 313 deletions

View File

@ -84,23 +84,44 @@ class emppaydate extends BaseController
$this->load->library('form_validation');
$this->form_validation->set_rules('EmpID','EmpID','required');
$this->form_validation->set_rules('HRA_Rate','HRA_Rate','trim|required');
$EmpID = $this->input->post('EmpID');
$this->form_validation->set_rules('EmpID','EmpID','trim|required');
$this->form_validation->set_rules('HRA_Rate','HRA_Rate','trim|required');
$this->form_validation->set_rules('HRA_Amount','HRA_Amount','trim|required');
$this->form_validation->set_rules('Basic_Pay','Basic_Pay','trim|required');
$this->form_validation->set_rules('Total_salary','Total_salary','trim|required');
$this->form_validation->set_rules('OT_Rate','OT_Rate','trim|required');
$this->form_validation->set_rules('Allowances','Allowances','trim|required');
$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','requried');
$this->form_validation->set_rules('Food_Allowances','Food_Allowances','trim|required');
//$Loan_Amount=$this->input->post('Loan_Amount');
// echo "before if";
// if($Loan_Amount != 0.00 || $Loan_Amount != "")
// {
// echo "indisde ";
// $Load_Issued_date=$this->input->post('loan_issued_date');
// $Due_Amount=$this->input->post('monthly_due');
// $Due_Started=$this->input->post('due_started');
// echo $Load_Issued_date ."-".$Due_Amount."-".$Due_Started;
// if($Load_Issued_date == "" || $Due_Started =="" || $Due_Amount == "" || $Due_Amount == 0)
// //echo "FAIL";die();
// $this->form_validation->set_rules('Loan_Amount','Loan_Amount','trim|required');
// $this->form_validation->set_rules('loan_issued_date','loan_issued_date','trim|required');
// $this->form_validation->set_rules('monthly_due','monthly_due','trim|required');
// $this->form_validation->set_rules('Food_Allodue_startedwances','due_started','trim|required');
// }
//die();
if($this->form_validation->run() == FALSE)
if($this->form_validation->run() == FALSE || $EmpID == -1)
{
$this->addemppaydate();
}
else
{
$Pay_Data_ID=$this->input->post('Pay_Data_ID');
//$Pay_Data_ID=$this->input->post('Pay_Data_ID');
$EmpID = $this->input->post('EmpID');
$Total_Salary=$this->input->post('Total_salary');
$Basic_Pay=$this->input->post('Basic_Pay');
@ -114,10 +135,16 @@ class emppaydate extends BaseController
$Loan_Amount=$this->input->post('Loan_Amount');
$Load_Issued_date=$this->input->post('loan_issued_date');
if(!empty($Load_Issued_date)){
$Load_Issued_date=$this->getDateformat2($Load_Issued_date);
}else{$Load_Issued_date=null;}
$Due_Amount=$this->input->post('monthly_due');
$Due_Started=$this->input->post('due_started');
if(!empty($Due_Started)){
$Due_Started=$this->getDateformat2($Due_Started);
}else{$Due_Started=null;}
$No_Of_Dues=$this->input->post('no_of_due');
$Paid_due=$this->input->post('paid_due');
$Remaining_Due=$this->input->post('remaining_due');
@ -129,9 +156,9 @@ class emppaydate extends BaseController
$chked = $this->input->post('is_Active');
$IsActive = '1';
$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);
$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,'Created_By'=>$CreateBy);
// print_r($emppay);die();
//print_r($emppay);die();
$result = $this->emppaydate_model->addNewemppay($emppay);
if($result > 0)
@ -154,7 +181,7 @@ class emppaydate extends BaseController
/**
* This function is used for editing purpose and it has oldest values only.
*/
function editOldemppay($paydataid= NULL)
function editOldemppay($paydataid="")
{
$data['emppay'] = $this->emppaydate_model->getUserInfo($paydataid);
@ -180,16 +207,16 @@ class emppaydate extends BaseController
$Pay_Data_ID= $this->input->post('Pay_Data_ID');
$this->form_validation->set_rules('Pay_Data_ID','Pay_Data_ID','trim|required');
//$this->form_validation->set_rules('Pay_Data_ID','Pay_Data_ID','trim|required');
$this->form_validation->set_rules('EmpID','EmpID','trim|required');
$this->form_validation->set_rules('total_salary','total_salary','trim|required');
$this->form_validation->set_rules('Total_Salary','Total_Salary','trim|required');
$this->form_validation->set_rules('Basic_Pay','Basic_Pay','trim|required');
$this->form_validation->set_rules('HRA_Rate','HRA_Rate','trim|required');
$this->form_validation->set_rules('OT_Rate','OT_Rate','trim|required');
$this->form_validation->set_rules('Allowances','Allowances','trim|required');
$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');
$this->form_validation->set_rules('Food_Allowances','Food_Allowances','trim|required');
@ -198,7 +225,7 @@ class emppaydate extends BaseController
if($this->form_validation->run() == FALSE)
{
$this->editOldemppay();
$this->editOldemppay($Pay_Data_ID);
}
@ -207,7 +234,7 @@ class emppaydate extends BaseController
$Pay_Data_ID=$this->input->post('Pay_Data_ID');
$EmpID = $this->input->post('EmpID');
$TotalSalary=$this->input->post('total_salary');
$TotalSalary=$this->input->post('Total_Salary');
$Basic_Pay=$this->input->post('Basic_Pay');
$HRA_Rate=$this->input->post('HRA_Rate');
$HRA_Amount=$this->input->post('HRA_Amount');
@ -217,10 +244,14 @@ class emppaydate extends BaseController
$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);
if(!empty($Load_Issued_date)){$Load_Issued_date=$this->getDateformat2($Load_Issued_date);}
else{$Load_Issued_date=null;}
$Due_Amount=$this->input->post('monthly_due');
$Due_Started=$this->input->post('due_started');
$Due_Started=$this->getDateformat2($Due_Started);
$Due_Started=$this->input->post('due_started');
if(!empty($Due_Started)){$Due_Started=$this->getDateformat2($Due_Started);}
else{$Due_Started=null;}
//echo $Load_Issued_date. "-" . $Due_Started;die();
$No_Of_Dues=$this->input->post('no_of_due');
$Paid_due=$this->input->post('paid_due');
@ -230,24 +261,24 @@ class emppaydate extends BaseController
$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');
// $chked = $this->input->post('is_Active');
if( $chked != '')
{
$IsActive = '1';
}
else
{
$IsActive = '0';
}
// if( $chked != '')
// {
// $IsActive = '1';
// }
// else
// {
// $IsActive = '0';
// }
$emppaydatas = array();
//$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,'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);
$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,'Last_Mod_By'=>$Last_Mod_By,'Last_Mod_Time'=>$Last_Mod_Time);
// print_r($emppaydatas);die();
$result = $this->emppaydate_model->editemppay($emppaydatas);

View File

@ -154,6 +154,8 @@ function getEmployee()
{
$result = $this->payroll_model->getEmpAll($Payon);
//print_r($result);
//echo "-----------------------------------------";
if($result > 0 )
{
@ -163,7 +165,11 @@ function getEmployee()
$EmpID = $result[$i]['EmpId'];
$Data['PayDetails'] = $this->payroll_model->GetPayslipdata($Payon,$EmpID);
$Data['Count'] = $i;
//print_r($Data['PayDetails']);//die();
$totalsalary =$Data['PayDetails'][0]->LessAdvance;
$totalsalaryinwords = $this->convertNumber(round($totalsalary));
$Data['amtinwords']=$totalsalaryinwords;
//$Data['Count'] = $i;
$this->load->View("payslipgenerateprint", $Data );
@ -175,6 +181,9 @@ function getEmployee()
{
$EmpID = $this->input->post('Employee');
$Data['PayDetails'] = $this->payroll_model->GetPayslipdata($Payon,$EmpID);
$totalsalary =$Data['PayDetails'][0]->LessAdvance;
$totalsalaryinwords = $this->convertNumber(round($totalsalary));
$Data['amtinwords']=$totalsalaryinwords;
$this->load->View("payslipgenerateprint", $Data );
@ -222,12 +231,15 @@ function getEmployee()
function uploadExcel(){
$FNAME = $this->input->post('FileName');
echo "HI" . $FNAME;
echo realpath($FNAME);die();
$PayrollFileName = '';
//Check whether user upload picture
if(!empty($_FILES['userfile']['name']))
{
//echo 'inside if';
echo 'inside if';
$pathinfo = pathinfo($_FILES['userfile']['name']);
$config['upload_path'] = 'uploads/files/';
$config['allowed_types'] = 'xls|xlsx|csv';
@ -363,7 +375,9 @@ function getEmployee()
*/
function uploadExcel2(){
// $FNAME = $this->input->post('FileName');
// echo "HI" . $FNAME . "-";
// echo realpath($FNAME);die();
$PayrollFileName = '';
//Check whether user upload picture
@ -462,7 +476,7 @@ function getEmployee()
}
$FileDataExists = $this->payroll_model->checkFileDetailsExists2($PayOn,$EmpId);
//echo $FileExists;
// echo $FileDataExists;
//die();
@ -509,17 +523,15 @@ function getEmployee()
}
// $data['Success'] = "<script>alert('File Uploaded Successfully!');</script>";
$data['Success'] = "<script>alert('File Uploaded Successfully!');</script>";
// $this->global['pageTitle'] = 'Siddharth : Payroll Data Upload';
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload';
// $this->loadViews("payslipupload2", $this->global, $data , NULL);
$this->loadViews("payslipupload2", $this->global, $data , NULL);
}
else{
$fail++;
}
// $data['Fail'] = "<script>alert('Duplicate Data Found!');</script>";
@ -527,8 +539,10 @@ function getEmployee()
// $this->loadViews("payslipupload2", $this->global, $data , NULL);
}
}
}
else{
$fail++;}
@ -538,28 +552,29 @@ function getEmployee()
//echo $fail;
//$data['success'] = "<script>alert($fail + 'Duplicate Data Found!');</script>";
//echo "DONE";
echo "<script> alert($success +' Data Uploaded sucessfully and ' + $fail + ' Duplicate Data Found'); </script>";
echo "<script>alert($Unknowncount+'-data invalid, and data are'+'$Unknown'+'found at rows'+'$row');</script>";
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload';
$this->loadViews("payslipupload2", $this->global , NULL);
//redirect('monthlyListings');
//redirect('payslip/viewUpload2');
} else
{
$data['Fail'] = "<script>alert('Please select valid Excel file to Upload!');</script>";
//$data['Fail'] = "<script>alert('Please select valid Excel file to Upload!');</script>";
//echo "<script>alert('Please select valid Excel file to Upload!');</script>";
$this->global['pageTitle'] = 'Siddharth : Payroll Data Upload2';
//$this->loadViews("payslipupload2", $this->global, $data , NULL);
$this->loadViews("payslipupload2", $this->global, $data , NULL);
}
}
else
{
$data['Fail'] = "<script>alert('Please select Excel file to Upload!');</script>";
//$data['Fail'] = "<script>alert('Please select Excel file to Upload!');</script>";
//echo "<script>alert('Please select Excel file to Upload!');</script>";
$PayrollFileName = '';
@ -583,6 +598,76 @@ function getEmployee()
$this->loadViews("404", $this->global, NULL, NULL);
}
function convertNumber($amt){
$ShowPaise='0';
$totalAmt=explode(".",$amt);
$number = $totalAmt[0];
$no = $number;
if(!empty($totalAmt[1]) && $totalAmt[1]!=0){
$point = $totalAmt[1];
$ShowPaise='1';
}
else{
$point=0;
$ShowPaise='0';
}
$hundred = null;
$digits_1 = strlen($no);
$i = 0;
$str = array();
$words = array('0' => '', '1' => 'One', '2' => 'Two',
'3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',
'7' => 'Seven', '8' => 'Eight', '9' => 'Nine',
'10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',
'13' => 'Thirteen', '14' => 'Fourteen',
'15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',
'18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',
'30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',
'60' => 'Sixty', '70' => 'Seventy',
'80' => 'Eighty', '90' => 'Ninety');
$digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');
while ($i < $digits_1) {
$divider = ($i == 2) ? 10 : 100;
$number = floor($no % $divider);
$no = floor($no / $divider);
$i += ($divider == 10) ? 1 : 2;
if ($number) {
$plural = (($counter = count($str)) && $number > 9) ? 's' : null;
$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
$str [] = ($number < 21) ? $words[$number] .
" " . $digits[$counter] . $plural . " " . $hundred
:
$words[floor($number / 10) * 10]
. " " . $words[$number % 10] . " "
. $digits[$counter] . $plural . " " . $hundred;
} else $str[] = null;
}
$str = array_reverse($str);
$result = implode('', $str);
$points = ($point) ?
" " . $words[$point / 10] . " " .
$words[$point = $point % 10] : '';
if($ShowPaise=='0'){
$amountInWords = "Rupees " . $result." Only";
}
else{
$amountInWords = "Rupees " . $result ." Paise ". $points." Only";
}
return $amountInWords;
}
}
?>

View File

@ -85,7 +85,8 @@ $("#due_started").datepicker({
}
}
//$data=array('name'=>'EmpID','value'=>$Employee,'id'=>'EmpID','class' => 'form-control');
echo form_dropdown('EmpID', $Employee,set_value('EmpID'),'class="form-control",id="xxx"');
$js = array('id'=> 'emp');
echo form_dropdown('EmpID', $Employee,set_value('EmpID'),'class="form-control"',$js);
//echo form_dropdown($data);
?>
@ -157,11 +158,11 @@ $("#due_started").datepicker({
<div class="col-md-4">
<div class="form-group">
<label for="OT_Rate">OT Rate</label><font color="Red">*</font>
<label for="OT_Rate">OT Rate(Per Hour)</label><font color="Red">*</font>
<div class="form-group">
<?php
$data = array('name' => 'OT_Rate','value' => set_value('OT_Rate'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;','pattern="([0-9]{1,2}([.][0-9]{1,2})?' ,'title'=>'Enter the Valid OT Rate, Minimum 1 digit, Maximum 4 digit');
$data = array('name' => 'OT_Rate','value' => set_value('OT_Rate'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;','pattern="([0-9]{1,3}([.][0-9]{1,2})?' ,'title'=>'Enter the Valid OT Rate, Minimum 1 digit, Maximum 2 digit');
echo form_input($data);
?>
@ -184,7 +185,7 @@ $("#due_started").datepicker({
<div class="form-group">
<?php
$data = array('name' => 'Allowances','value' => set_value('Allowances'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;','pattern'=>'([0-9]{1,5}([.][0-9]{1,2})?)','title'=>'Enter the Valid Allowances,Minimum 1 digit , Maximum 4 digit ');
$data = array('name' => 'Allowances','value' => set_value('Allowances'), 'class' => 'form-control' ,'style'=>'text-transform:uppercase;','pattern'=>'([0-9]{1,5}([.][0-9]{1,2})?)','title'=>'Enter the Valid Allowances,Minimum 1 digit , Maximum 5 digit ');
echo form_input($data);
?>
</div>
@ -219,7 +220,7 @@ $("#due_started").datepicker({
<!--for food allowances-->
<div class="col-md-4">
<div class="form-group">
<label for="Food_Allowances">Food Allowances</label><font color="Red">*</font>
<label for="Food_Allowances">Food Allowances(Per Day)</label><font color="Red">*</font>
<div class="form-group">
<?php
@ -244,7 +245,7 @@ $("#due_started").datepicker({
<span for="Pay_Data_ID">Loan Amount</span>
<input type="text" value="0" class="form-control" id="Loan_Amount" name="Loan_Amount" value="" pattern="([0-9]{1,7}([.][0-9]{1,2})?)" title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
<input type="text" class="form-control" id="Loan_Amount" name="Loan_Amount" value="0.00" pattern="([0-9]{1,7}([.][0-9]{1,2})?)" title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
</div>
</div>
</div>
@ -256,7 +257,7 @@ $("#due_started").datepicker({
<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="">
<input type="text" class="form-control" id="loan_issued_date" name="loan_issued_date" value="" onchange="dateCalulation();">
</div>
</div>
</div>
@ -266,7 +267,7 @@ $("#due_started").datepicker({
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Monthly Due</span>
<input type="text" value="0" 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();">
<input type="text" value="0.00" class="form-control" id="monthly_due" name="monthly_due" value="" pattern="([0-9]{1,7}([.][0-9]{1,2})?)" title="Minimum 1 digit,Maximum 6 Digit" onchange="duecalculation();">
</div>
</div>
</div>
@ -274,7 +275,7 @@ $("#due_started").datepicker({
<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="">
<input type="text" class="form-control requried" id="due_started" name="due_started" value="" onchange="dateCalulation();">
</div>
</div>
</div>
@ -290,7 +291,7 @@ $("#due_started").datepicker({
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Paid Amount</span>
<input type="text" value="0" class="form-control requried" id="Paid_Amount" name="Paid_Amount" value="0" pattern="[([0-9]{1,7}([.][0-9]{1,2})?)" title="Minimum 1 digit,Maximum 2 Digit" readonly>
<input type="text" value="0.00" class="form-control requried" id="Paid_Amount" name="Paid_Amount" value="0" pattern="([0-9]{1,7}([.][0-9]{1,2})?)" title="Minimum 1 digit,Maximum 2 Digit" readonly>
</div>
</div>
</div>
@ -298,7 +299,7 @@ $("#due_started").datepicker({
<input type="hidden" 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="submit" class="btn btn-info" value="Submit" onmouseover="finalCheck();"/>
<input type="reset" class="btn btn-info" value="Reset" />
</div>
@ -348,8 +349,11 @@ $("#due_started").datepicker({
<script>
function calculalteHRA()
{
var Totalsalary = document.getElementById('Total_salary').value;;
//var empid=document.getElementById('emp').value;
//alert(empid);
var Totalsalary = document.getElementById('Total_salary').value;
var HRA=document.getElementById('HRA_Rate').value;
//if(EmpID == -1){alert("Select Employee ID..!");}
if(HRA==''){
alert("Please Enter HRA RATE..");
document.getElementById('HRA_Rate').focus();
@ -373,6 +377,11 @@ function duecalculation()
var loan=document.getElementById('Loan_Amount').value;
var due=document.getElementById('monthly_due').value;
//alert(loan+'-'+due);
// if(loan == ""){
// $('#Loan_Amount').val(0.00);
// $('#monthly_due').val(0.00);
// }
if(loan != 0)
{
if(due == 0)
@ -383,16 +392,63 @@ function duecalculation()
else
{
//due=document.getElementById('monthly_due').value;
totaldue=loan/due;
totaldue=loan/due;
if(totaldue < 1)
{
alert("Please Enter Correct Due Amount..!");
$('#monthly_due').focus();
}
else{
document.getElementById('no_of_due').value=Math.ceil(totaldue);
var noofdues=document.getElementById('no_of_due').value;
$('#remaining_due').val(noofdues);
}
}
}
}//else if(loan == "" || loan == 0)
//alert(totaldue);
document.getElementById('no_of_due').value=Math.ceil(totaldue);
var noofdues=document.getElementById('no_of_due').value;
$('#remaining_due').val(noofdues);
dateCalulation();
}
function dateCalulation()
{
//alert('j');
var loanamount=document.getElementById('Loan_Amount').value;
if(loanamount == 0.00 || loanamount == "")
{
$('#loan_issued_date').val("");
$('#due_started').val("");
$('#monthly_due').val("0.00");
$('#remaining_due').val(0);
$('#no_of_due').val(0);
$('#Loan_Amount').val("0.00");
$('#paid_due').val(0);
$('#Paid_Amount').val("0.00");
}
}
function finalCheck()
{
var loanamount=document.getElementById('Loan_Amount').value;
if(loanamount != "" && loanamount != 0.00)
{
var idate=document.getElementById('loan_issued_date').value;
var due=document.getElementById('monthly_due').value;
var dsdate=document.getElementById('due_started').value;
if(idate == "" || due == "" || due == 0.00 || dsdate == ""){
alert("Enter All Loan Information Correctly...!");
}
}
}
</script>

View File

@ -95,11 +95,16 @@ if(!empty($emppay))
$is_Active=$ep->is_Active;
$Food_Allowances=$ep->Food_Allowances;
$Loan_Amount=$ep->Loan_Amount;
if( !empty($ep->Loan_Issued_Date) ){
$Loan_issued_date=new DateTime( $ep->Loan_Issued_Date, new DateTimeZone('Asia/Kolkata'));
$Loan_issued_date=$Loan_issued_date->format('d-m-Y');
$Loan_issued_date=$Loan_issued_date->format('d-m-Y');}
else{$Loan_issued_date=null;}
$Monthly_due=$ep->Monthly_Due;
if(!empty($ep->Due_Start_Date)){
$Due_start_date=new DateTime( $ep->Due_Start_Date, new DateTimeZone('Asia/Kolkata'));
$Due_start_date=$Due_start_date->format('d-m-Y');
$Due_start_date=$Due_start_date->format('d-m-Y');}
else{$Due_start_date=null;}
$No_of_dues=$ep->No_of_Dues;
$Paid_Due=$ep->Paid_Due;
$Remaining_Due=$ep->Remaining_Due;
@ -147,7 +152,7 @@ if(!empty($emppay))
</div>
<div class="row">
<div class="col-md-4">
<!-- <div class="col-md-4">
<div class="form-group">
<div class="form-group">
@ -156,11 +161,11 @@ if(!empty($emppay))
<input type="text" class="form-control" readonly id="Pay_Data_ID" name="Pay_Data_ID" value="<?php echo $Pay_Data_ID; ?>">
</div>
</div>
</div>
</div> -->
<input type="hidden" readonly id="Pay_Data_ID" name="Pay_Data_ID" value="<?php echo $Pay_Data_ID; ?>">
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
@ -174,10 +179,19 @@ if(!empty($emppay))
<div class="form-group">
<div class="form-group">
<span for ="Food_Allowances">Employee Name</span>
<input type="text" class="form-control" id="EmpName" name="EmpName" value="<?php echo $Empname; ?>" readonly>
<input type="text" class="form-control" id="Food_Allowances" name="Food_Allowances" value="<?php echo $Empname; ?>" readonly>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Total Salary</span><font color="Red">*</font>
<input type="text" class="form-control requried" id="Total_Salary" name="Total_Salary" value="<?php echo number_format($TotalSalary,0,'',''); ?>" pattern="([0-9]{1,8}([.][0-9]{1,2})?)" title="Minimum 4 digit,Maximum 6 Digit" onchange="calculateBasic();">
</div>
</div>
</div>
@ -187,14 +201,7 @@ if(!empty($emppay))
<div class="row">
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Total Salary</span><font color="Red">*</font>
<input type="text" class="form-control requried" id="total_salary" name="total_salary" value="<?php echo number_format($TotalSalary,0,'',''); ?>" pattern="([0-9]{1,8}([.][0-9]{1,2})?)" title="Minimum 4 digit,Maximum 6 Digit" onchange="calculateBasic();">
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
@ -213,7 +220,14 @@ if(!empty($emppay))
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="HRA_Rate">HRA_Amount</span><font color="Red">*</font>
<input type="text" class="form-control required" id="HRA_Amount" name="HRA_Amount" value="<?php echo number_format($HRA_Amount,0,'',''); ?>" readonly>
</div>
</div>
</div>
@ -228,20 +242,13 @@ if(!empty($emppay))
<div class="row">
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="HRA_Rate">HRA_Amount</span><font color="Red">*</font>
<input type="text" class="form-control required" id="HRA_Amount" name="HRA_Amount" value="<?php echo number_format($HRA_Amount,0,'',''); ?>" readonly>
</div>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="OT_Rate">OT_Rate</span><font color="Red">*</font>
<input type="text" class="form-control required" id="OT_Rate" name="OT_Rate" value="<?php echo $OT_Rate; ?>" pattern="([0-9]{1,2}([.][0-9]{1,2})?)" title="Minimum 1 digit,Maximum 4 Digit">
<span for="OT_Rate">OT_Rate(Per Hour)</span><font color="Red">*</font>
<input type="text" class="form-control required" id="OT_Rate" name="OT_Rate" value="<?php echo $OT_Rate; ?>" pattern="([0-9]{1,3}([.][0-9]{1,2})?)" title="Minimum 1 digit,Maximum 4 Digit">
</div>
</div>
</div>
@ -254,9 +261,7 @@ if(!empty($emppay))
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for="PF_Rate">PF_Rate(%)</span><font color="Red">*</font>
@ -264,6 +269,9 @@ if(!empty($emppay))
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
@ -278,8 +286,8 @@ if(!empty($emppay))
<div class="col-md-4">
<div class="form-group">
<div class="form-group">
<span for ="Food_Allowances">Food Allowances</span><font color="Red">*</font>
<input type="text" class="form-control" id="Food_Allowances" name="Food_Allowances" value="<?php echo $Food_Allowances; ?>" pattern="([0-9]{1,3}([.][0-9]{1,2})?)" title="Minimum 1 digit,Maximum 4 Digit">
<span for ="Food_Allowances">Food Allowances(Per Day)</span><font color="Red">*</font>
<input type="text" class="form-control required" id="Food_Allowances" name="Food_Allowances" value="<?php echo $Food_Allowances; ?>" pattern="([0-9]{1,3}([.][0-9]{1,2})?)" title="Minimum 1 digit,Maximum 3 Digit">
</div>
</div>
</div>
@ -310,7 +318,7 @@ if(!empty($emppay))
<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;?>">
<input type="text" class="form-control" id="loan_issued_date" name="loan_issued_date" value="<?php echo $Loan_issued_date;?>" onchange="dateCalulation();">
</div>
</div>
</div>
@ -320,7 +328,7 @@ if(!empty($emppay))
<div class="form-group">
<div class="form-group">
<span for="Basic_Pay">Monthly Due</span>
<input type="text" class="form-control requried" id="monthly_due" name="monthly_due" value="<?php echo $Monthly_due; ?>" pattern="[0-9]{1,6}" title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
<input type="text" class="form-control requried" id="monthly_due" name="monthly_due" value="<?php echo $Monthly_due; ?>" pattern="([0-9]{1,7}([.][0-9]{1,2})?)" title="Minimum 4 digit,Maximum 6 Digit" onchange="duecalculation();">
</div>
</div>
</div>
@ -328,7 +336,7 @@ if(!empty($emppay))
<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; ?>">
<input type="text" class="form-control requried" id="due_started" name="due_started" value="<?php echo $Due_start_date; ?>" onchange="dateCalulation();">
</div>
</div>
</div>
@ -401,20 +409,14 @@ if(!empty($emppay))
</div>
<div class="row">
<div class="offset col-md-7">
<div class="form-group">
<input type="checkbox" name="is_Active" />Active state<br>
</div>
</div>
</div>
</div><!--row completed div-->
<div id="content">
<div class="box-footer" style="text-align:right">
<input type="submit" class="btn btn-info" value="Submit"/>
<input type="submit" class="btn btn-info" value="Submit" onmouseover="finalCheck();"/>
<input type="reset" class="btn btn-info" value="Reset" />
</div>
@ -472,14 +474,14 @@ if(!empty($emppay))
function calculateBasic()
{
var Totalsalary = document.getElementById('total_salary').value;;
var Totalsalary = document.getElementById('Total_Salary').value;;
var HRA=document.getElementById('HRA_Rate').value;
if(HRA==''){
alert("Please Enter HRA RATE..");
document.getElementById('HRA_Rate').focus();
}else if(Totalsalary==''){
alert("Please Enter Total Salary..");
document.getElementById('total_salary').focus();
document.getElementById('Total_Salary').focus();
}
else{
var temp=(Totalsalary*(HRA/100));
@ -500,6 +502,11 @@ function duecalculation()
var loan=document.getElementById('Loan_Amount').value;
var due=document.getElementById('monthly_due').value;
//alert(loan+'-'+due);
// if(loan == ""){
// $('#Loan_Amount').val(0.00);
// $('#monthly_due').val(0.00);
// }
if(loan != 0)
{
if(due == 0)
@ -510,21 +517,64 @@ function duecalculation()
else
{
//due=document.getElementById('monthly_due').value;
totaldue=loan/due;
totaldue=loan/due;
if(totaldue < 1)
{
alert("Please Enter Correct Due Amount..!");
$('#monthly_due').focus();
}
else{
document.getElementById('no_of_due').value=Math.ceil(totaldue);
var noofdues=document.getElementById('no_of_due').value;
$('#remaining_due').val(noofdues);
$('#Paid_Amount').val("0.00");
$('#paid_due').val(0);
}
}
}
}//else if(loan == "" || loan == 0)
//alert(totaldue);
document.getElementById('no_of_due').value=Math.ceil(totaldue);
var noofdues=document.getElementById('no_of_due').value;
$('#remaining_due').val(noofdues);
$("#paid_due").val(0);
$("#Paid_Amount").val(0);
dateCalulation();
}
function dateCalulation()
{
//alert('j');
var loanamount=document.getElementById('Loan_Amount').value;
if(loanamount == 0.00 || loanamount == "")
{
$('#loan_issued_date').val("");
$('#due_started').val("");
$('#monthly_due').val("0.00");
$('#remaining_due').val(0);
$('#no_of_due').val(0);
$('#Loan_Amount').val("0.00");
$('#paid_due').val(0);
$('#Paid_Amount').val("0.00");
}
}
function finalCheck()
{
//alert("final check");
var loanamount=document.getElementById('Loan_Amount').value;
if(loanamount != "" && loanamount != 0.00)
{
var idate=document.getElementById('loan_issued_date').value;
var due=document.getElementById('monthly_due').value;
var dsdate=document.getElementById('due_started').value;
if(idate == "" || due == "" || due == 0.00 || dsdate == ""){
alert("Enter All Loan Information Correctly...!");
}
}
}
</script>
<script>
</script>

View File

@ -47,111 +47,112 @@ if(!empty($monthly))
function validateLOP(){
//alert("h");
var x = $("#LOPDays").val();
//alert(x);
//var ck_lopdays = /^[0-9]{1,2}([.][0-9]{1,2})$/;
if( x > 32){
alert("LOP Days 0 to 31 Days Allowed.")
//$("#LOPDays").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
//$("#LOPDays").attr("title","0 to 31 Days Only");
}}
// else{
// $("#LOPDays").css({"border-style":"","border-color":"","border-width":"","background-color":""});
// }
// }
// function validateOTHRS(){
// var x = $("#OT_Hrs_Worked").val();
var ck_lopdays = /^([0-9]{1,2}([.][0-9]{1,2})$/;
if(!(ck_lopdays.test(x) && x<=31)){
// var ck_lopdays = /^[0-9]{1,2}([.][0-9]{1,2})$/;//[0-9]{1,2}([.][0-9]{1,2}
// if(!(ck_lopdays.test(x) && x<=150)){
$("#LOPDays").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
$("#LOPDays").attr("title","0 to 31 Days Only");
}
else{
$("#LOPDays").css({"border-style":"","border-color":"","border-width":"","background-color":""});
}
}
// $("#OT_Hrs_Worked").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
// $("#OT_Hrs_Worked").attr("title","Three Digits, not more then 150hrs");
// }
// else{
// $("#OT_Hrs_Worked").css({"border-style":"","border-color":"","border-width":"","background-color":""});
// }
// }
function validateOTHRS(){
var x = $("#OT_Hrs_Worked").val();
// function validateL(){
// var x = $("#Loan_Recovered").val();
var ck_lopdays = /^[0-9]{1,2}([.][0-9]{1,2}$/;//[0-9]{1,2}([.][0-9]{1,2}
if(!(ck_lopdays.test(x) && x<=150)){
// var ck_lopdays = /^[0-9]{1,6}([.][0-9]{1,2})?$/;
// if(!(ck_lopdays.test(x) && x<=100000)){
$("#OT_Hrs_Worked").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
$("#OT_Hrs_Worked").attr("title","Three Digits, not more then 150hrs");
}
else{
$("#OT_Hrs_Worked").css({"border-style":"","border-color":"","border-width":"","background-color":""});
}
}
// $("#Loan_Recovered").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
// $("#Loan_Recovered").attr("title","Positive Nos Only,Maximun Six Digits");
// }
// else{
// $("#Loan_Recovered").css({"border-style":"","border-color":"","border-width":"","background-color":""});
// }
// }
function validateL(){
var x = $("#Loan_Recovered").val();
// function validateLB(){
// var x = $("#Loan_Balance").val();
var ck_lopdays = /^[0-9]{1,6}([.][0-9]{1,2})?$/;
if(!(ck_lopdays.test(x) && x<=100000)){
// var ck_lopdays = /^[0-9 ]{1,6}$/;
// if(!(ck_lopdays.test(x) && x<=100000)){
$("#Loan_Recovered").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
$("#Loan_Recovered").attr("title","Positive Nos Only,Maximun Six Digits");
}
else{
$("#Loan_Recovered").css({"border-style":"","border-color":"","border-width":"","background-color":""});
}
}
// $("#Loan_Balance").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
// $("#Loan_Balance").attr("title","Positive Nos Only,Maximun Six Digitss");
// }
// else{
// $("#Loan_Balance").css({"border-style":"","border-color":"","border-width":"","background-color":""});
// }
// }
function validateLB(){
var x = $("#Loan_Balance").val();
// function validateLB(){
// var x = $("#Loan_Balance").val();
var ck_lopdays = /^[0-9 ]{1,6}$/;
if(!(ck_lopdays.test(x) && x<=100000)){
// var ck_lopdays = /^[0-9 ]{1,6}$/;
// if(!(ck_lopdays.test(x) && x<=100000)){
$("#Loan_Balance").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
$("#Loan_Balance").attr("title","Positive Nos Only,Maximun Six Digitss");
}
else{
$("#Loan_Balance").css({"border-style":"","border-color":"","border-width":"","background-color":""});
}
}
// $("#Loan_Balance").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
// $("#Loan_Balance").attr("title","Positive Nos Only,Maximun Six Digits");
// }
// else{
// $("#Loan_Balance").css({"border-style":"","border-color":"","border-width":"","background-color":""});
// }
// }
function validateLB(){
var x = $("#Loan_Balance").val();
// function validateINC(){
// var x = $("#Incentives").val();
var ck_lopdays = /^[0-9 ]{1,6}$/;
if(!(ck_lopdays.test(x) && x<=100000)){
// var ck_lopdays = /^[0-9]{1,5}([.][0-9]{1,2})?$/;
// if(!(ck_lopdays.test(x))){
$("#Loan_Balance").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
$("#Loan_Balance").attr("title","Positive Nos Only,Maximun Six Digits");
}
else{
$("#Loan_Balance").css({"border-style":"","border-color":"","border-width":"","background-color":""});
}
}
// $("#Incentives").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
// $("#Incentives").attr("title","Positive Nos Only,Maximun Six Digits");
// }
// else{
// $("#Incentives").css({"border-style":"","border-color":"","border-width":"","background-color":""});
// }
// }
function validateINC(){
var x = $("#Incentives").val();
// function validateODD(){
// var x = $("#Other_Deductions").val();
var ck_lopdays = /^[0-9]{1,5}([.][0-9]{1,2})?$/;
if(!(ck_lopdays.test(x))){
// var ck_lopdays = /^[0-9]{1,6}([.][0-9]{1,2})?$/;
// if(!(ck_lopdays.test(x))){
$("#Incentives").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
$("#Incentives").attr("title","Positive Nos Only,Maximun Six Digits");
}
else{
$("#Incentives").css({"border-style":"","border-color":"","border-width":"","background-color":""});
}
}
// $("#Other_Deductions").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
// $("#Other_Deductions").attr("title","Positive Nos Only,Maximun Six Digits");
// }
// else{
// $("#Other_Deductions").css({"border-style":"","border-color":"","border-width":"","background-color":""});
// }
// }
function validateODD(){
var x = $("#Other_Deductions").val();
var ck_lopdays = /^[0-9]{1,6}([.][0-9]{1,2})?$/;
if(!(ck_lopdays.test(x))){
$("#Other_Deductions").css({"border-style":"dotted","border-color":"#ff8080","border-width":"2px","background-color":"#ffe6e6"});
$("#Other_Deductions").attr("title","Positive Nos Only,Maximun Six Digits");
}
else{
$("#Other_Deductions").css({"border-style":"","border-color":"","border-width":"","background-color":""});
}
}
function validateAll(){
// function validateAll(){
}
// }
</script>
@ -218,7 +219,7 @@ function validateAll(){
<div class="form-group">
<div class="form-group">
<span for="LOP_Days">LOP Days:</span>
<input type="text" class="form-control requried" id="LOPDays" onfocusout="validateLOP();" title="lopdays" name="LOP_Days" pattern="([0-9]{1,2}([.][0-9]{1,2})" value="<?php echo $LOP_Days; ?>">
<input type="text" class="form-control requried" id="LOPDays" onfocusout="validateLOP();" title="lopdays" name="LOP_Days" pattern="[0-9]{1,2}([.][0-9]{1,2})?" value="<?php echo $LOP_Days; ?>">
</div>
</div>
</div>
@ -230,7 +231,7 @@ function validateAll(){
<div class="form-group">
<div class="form-group">
<span for="OT_Hrs_Worked">OverTime Hours Worked:</span>
<input type="text" class="form-control required" id="OT_Hrs_Worked" name="OT_Hrs_Worked" onfocusout="validateOTHRS();" pattern="([0-9]{1,2}([.][0-9]{1,2})?" value="<?php echo $OT_Hrs_Worked; ?>">
<input type="text" class="form-control required" id="OT_Hrs_Worked" name="OT_Hrs_Worked" pattern="[0-9]{1,3}([.][0-9]{1,2})?" value="<?php echo $OT_Hrs_Worked; ?>">
</div>
</div>
</div>
@ -239,7 +240,7 @@ function validateAll(){
<div class="form-group">
<div class="form-group">
<span for="Loan_Recovered">Loan Recovered:</span>
<input type="text" class="form-control required" id="Loan_Recovered" name="Loan_Recovered" onfocusout="validateLR();" value="<?php echo $Loan_Recovered; ?>">
<input type="text" class="form-control required" id="Loan_Recovered" name="Loan_Recovered" value="<?php echo $Loan_Recovered; ?>"> <!-- pattern="[0-9]{1,7}([.][0-9]{1,2})?"-->
</div>
</div>
</div>
@ -256,7 +257,7 @@ function validateAll(){
<div class="form-group">
<div class="form-group">
<span for="Incentives">Incentives:</span>
<input type="text" class="form-control required" id="Incentives" onfocusout="validateINC();" name="Incentives" pattern="[0-9]{1,5}([.][0-9]{1,2})?" value="<?php echo $Incentives; ?>">
<input type="text" class="form-control required" id="Incentives" name="Incentives" pattern="[0-9]{1,7}([.][0-9]{1,2})?" value="<?php echo $Incentives; ?>">
</div>
</div>
</div>
@ -264,7 +265,7 @@ function validateAll(){
<div class="form-group">
<div class="form-group">
<span for="Other_Deductions">Other Deductions:</span>
<input type="text" class="form-control required" id="Other_Deductions" onfocusout="validateODD();" name="Other_Deductions" pattern="[0-9]{1,6}([.][0-9]{1,2})?" value="<?php echo $Other_Deductions; ?>">
<input type="text" class="form-control required" id="Other_Deductions" name="Other_Deductions" pattern="[0-9]{1,6}([.][0-9]{1,2})?" value="<?php echo $Other_Deductions; ?>">
</div>
</div>
</div>

View File

@ -34,21 +34,21 @@
<div class="box-body table-responsive no-padding" >
<table id="datatable" class="table table-hover tableSorter" >
<tr bgcolor="steelblue">
<th>Pay Data ID</th>
<th>Employee ID</th>
<th>Employee Name</th>
<th>Total Salary</th>
<th>Basic Pay</th>
<th>HRA Rate</th>
<th>HRA Amount</th>
<th>OT Rate</th>
<th>Allowances</th>
<th>PF Rate</th>
<th>ESI Rate</th>
<th>Food Allowances</th>
<th>Is Active</th>
<th>Total Salary in </th>
<th>Basic Pay in </th>
<th>HRA Rate in %</th>
<th>HRA Amount in </th>
<th>OT Rate in </th>
<th>Allowances in </th>
<th>PF Ratein %</th>
<th>ESI Rate in %</th>
<th>Food Allowances in </th>
<th>Edit</th>
<th>Action</th>
</tr>
@ -60,20 +60,20 @@
?>
<tr>
<td><?php echo $record->Pay_Data_ID ?></td>
<td><?php echo $record->EmpID ?></td>
<td><?php echo $record->FirstName ." ". $record->LastName?></td>
<td><?php echo number_format($record->TotalSalary,0,'',''); ?></td>
<td><?php echo $record->TotalSalary; ?></td>
<td><?php echo $record->Basic_Pay ?></td>
<td><?php echo $record->HRA_Rate ?></td>
<td><?php echo number_format($record->HRA_Amount,0,'',''); ?></td>
<td><?php echo $record->HRA_Amount; ?></td>
<td><?php echo $record->OT_Rate ?></td>
<td><?php echo $record->Allowances ?></td>
<td><?php echo $record->PF_Rate ?></td>
<td><?php echo $record->ESI_Rate ?></td>
<td><?php echo $record->Food_Allowances ?></td>
<td><?php echo $record->is_Active ? 'Yes' : 'No'?></td>

View File

@ -51,12 +51,12 @@ speed:500
<th>Employee Id</th>
<th>Employee Name</th>
<th>LOP Days</th>
<th>OT Hours Worked</th>
<th>Loan Recovered</th>
<th>OT Hours Worked in Hrs</th>
<th>Loan Recovered in </th>
<!-- <th>Loan Balance</th> -->
<th>Incentives</th>
<th>Other Deductions</th>
<th>Edit</th>
<th>Incentives in Rs</th>
<th>Other Deductions in </th>
<th>Action</th>
</tr>
@ -73,7 +73,7 @@ speed:500
<td><?php echo $record->FirstName ." ". $record->LastName ?></td>
<td><?php echo $record->LOP_Days ?></td>
<td><?php echo $record->OT_Hrs_Worked ?></td>
<td><?php echo $record->Loan_Recovered ?></td>
<td><?php if(is_numeric($record->Loan_Recovered)){echo number_format($record->Loan_Recovered,2,'.','');}else {echo $record->Loan_Recovered;} ?></td>
<!-- <td><?php echo $record->Loan_Balance ?></td> -->
<td><?php echo $record->Incentives ?></td>
<td><?php echo $record->Other_Deductions ?></td>

View File

@ -84,17 +84,23 @@ $(function() {
url:"<?php echo base_url();?>payslip/callsp",
success:function(result){
$('form#PayslipGenerator').submit();
$('#content').loader('hide');
//alert("Procedure Called Sucessfully!");
}
});
//AJAX ENDED
// CALCULATE PAY AJAX ENDED
});
alert(count + " Employees Salary Added Successfully!");
} // else for select all not selected
else{
@ -106,7 +112,7 @@ $(function() {
url:"<?php echo base_url();?>payslip/callsp",
success:function(result) {
$('form#PayslipGenerator').submit();
$('#content').loader('hide');
alert("Employees Salary Added Successfully!");
@ -196,10 +202,10 @@ $(function() {
<div class="col-md-4 col-md-offset-6" align = "right">
<input type="button" class="btn btn-info" id="Calculate" value="Calculate Pay"/>
<input type="submit" class="btn btn-info" id="Generate" value="Generate"/>
<!-- <input type="submit" class="btn btn-info" id="Generate" value="Generate"/>-->
<a href="<?php echo base_url(); ?>payslip/updatepayroll" ><input type="submit" class="btn btn-info" value="Update" /></a>
</div>
<!-- <a href="<?php echo base_url(); ?>payslip/updatepayroll" ><input type="submit" class="btn btn-info" value="Update" /></a>
</div> -->
</div>
<div class="row" >

View File

@ -1,76 +1,4 @@
<?php
// This Function For Converting number to words
$invoiceTotalAmountInWords='';
function convertNumber($amt){
$ShowPaise='0';
$totalAmt=explode(".",$amt);
$number = $totalAmt[0];
$no = $number;
if(!empty($totalAmt[1]) && $totalAmt[1]!=0){
$point = $totalAmt[1];
$ShowPaise='1';
}
else{
$point=0;
$ShowPaise='0';
}
$hundred = null;
$digits_1 = strlen($no);
$i = 0;
$str = array();
$words = array('0' => '', '1' => 'One', '2' => 'Two',
'3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',
'7' => 'Seven', '8' => 'Eight', '9' => 'Nine',
'10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',
'13' => 'Thirteen', '14' => 'Fourteen',
'15' => 'Fifteen', '16' => 'Sixteen', '17' => 'Seventeen',
'18' => 'Eighteen', '19' =>'Nineteen', '20' => 'Twenty',
'30' => 'Thirty', '40' => 'Forty', '50' => 'Fifty',
'60' => 'Sixty', '70' => 'Seventy',
'80' => 'Eighty', '90' => 'Ninety');
$digits = array('', 'Hundred', 'Thousand', 'Lakh', 'Crore');
while ($i < $digits_1) {
$divider = ($i == 2) ? 10 : 100;
$number = floor($no % $divider);
$no = floor($no / $divider);
$i += ($divider == 10) ? 1 : 2;
if ($number) {
$plural = (($counter = count($str)) && $number > 9) ? 's' : null;
$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
$str [] = ($number < 21) ? $words[$number] .
" " . $digits[$counter] . $plural . " " . $hundred
:
$words[floor($number / 10) * 10]
. " " . $words[$number % 10] . " "
. $digits[$counter] . $plural . " " . $hundred;
} else $str[] = null;
}
$str = array_reverse($str);
$result = implode('', $str);
$points = ($point) ?
" " . $words[$point / 10] . " " .
$words[$point = $point % 10] : '';
if($ShowPaise=='0'){
$amountInWords = "Rupees " . $result." Only";
}
else{
$amountInWords = "Rupees " . $result ." Paise ". $points." Only";
}
return $amountInWords;
}
?>
<?php
$PayOn = '';
@ -116,12 +44,14 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
$OtherDeductions='0.00';
$LoanAdvance='0.00';
$Otherallowances='0.00';
$TotalAmountInWords='';
if(!empty($Count))
{
$RecCount = $Count;
}
//echo $RecCount;
if(!empty($PayDetails))
{
@ -162,6 +92,7 @@ if(!empty($PayDetails))
$OTWage = $Pay->OTWages;
$OtherDeductions=$Pay->OtherDeductions;
$LoanAdvance=$Pay->Advance;
if($OTWage == '')
{
$OTWages = '0.00';
@ -253,7 +184,7 @@ if($RecCount > 0)
<td colspan="1" style="background:#2c0000;"> <center> <img width="80" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA11JREFUeNrsnT9IHEEYxWfFw8rgpUhlo5URi2gTbIUUSrq1ui4oRLRIY9JIKrGKTQrBgJLuuutEi4CtSSOpPIuATdIEcid2YpN9C3sc8c6bf7uZmX0P7k7ultm7337zzXxvZjGaiaIfQoiqoHTUHk6eniSPUbLQUmUoebojB23dDZGBmQiQAAmQAAmQIkACJEACpAiweA3bbvDV5mb6+iKOxfTc3MDjf15dicbBQfr3591d7wBGM1H0J3l9bNLI84UFsby6mkIzFWACJMCafJ9PJyfSx29vbHQuoqJaxl34zc5O+mVtwIPi5EIcXV52IjnoLvx+by/9wXkIF8aHbq0dgYi4vOB1Q7QV2c4BXM4Z3r+RGBTAR9VqmqhVBoZnIyOdx9taTXqQGJ+YUDqXFwBV4WGU69aXRkNsr69LtyEzHfIKIKJCVl9PT3u+/63P+6bnC64SuWm3jdsYn5xkKcdamCJAAiwjQJcHAC8ATs/OBg1Qy0y4ub6WPhb1cuPwUFycn9/77OPWlvXzeQGw2QPGQ9o/PhZrS0v3IPpooFrpwgChYniidq6fnTnvrBSaA3Uc3A/1uvPuSmEA0f0uFLsyBKcZDjaisvSj8DsFW6pbcHPQpV12WQoBCHhri4taEOGwhJAXjeeBgFebn1eyp0LKi1Ym0rCsXieRqLk06HVetFqJwHmWnRz3yotHzabT9n0hpRxGZ0SjjpGKCEQkxgUtWDlbCyMfIi/qTHMgrDf7srCem5mQDS5YQNKRD2vCuQLMhCVM3bwIiK4PLIUYqrp5EXPFeGWFALO8CEdGddId7NYOHWFQUa1cUO4Fty78/fZW6tFrjx7gqfqAT0PbmWAqVCwq+bDUOxMeyokh6L8B1J1kE2BgIkACJMDyAbSx56/cACV3CoyOjfX9rNSrcrI7E/qVYYCnYhKY3LXkJECVOdx+Us51m6Nwm7HVQyUCf4UGEJuFZPMgIhC+XlYfw21WWQ/GxXJ50q09iBS1MSjYW73ww3SXMVXOobsk4MU80GQZc5DQbl5tOzWRRpS8nJqy1tUAzWZ7ecvKDdfdggWfTV0GbdnA4JB1UdhbHjo0LesAS6YWa2GaCQRIgARIESABEiABUgRIgARYRoAVYtBWBfcL/xb8hwS6av8VYADVjF2M5sTWJAAAAABJRU5ErkJggg=="></center>
</td>
<td colspan="10">
<center><b>SIDDHARTH INDUSTRIES</b><br/> Survey No: 168/1C3,Pennalur Pet Road,Goonipalyam village, <br/>Uthukottai Taluk,Tiruvallur Dist, Chennai,Tamilnadu,Pin code : 602026. <br/> PaySlip for the month of <?php echo $PayOn ?></center>
<center><b>SIDDHARTH INDUSTRIES</b><br/> Survey No: 168/1C3,Pennalur Pet Road,Goonipalyam village, <br/>Uthukottai Taluk,Tiruvallur Dist, Chennai,Tamilnadu,Pin code : 602026. <br/> PaySlip for the Month of <?php echo $PayOn ?></center>
</td>
</tr>
<tr>
@ -368,8 +299,7 @@ if($RecCount > 0)
<td style="text-align: right;" colspan="1"><?php echo number_format(round($LessAdvance),2,'.','') ?>&nbsp;</td>
</tr>
<tr><th style="text-align: right;" colspan="1">Total Amount In Words &nbsp;</th>
<td style="text-align: right;" colspan="3"><?php $invoiceTotalAmountInWords=convertNumber(round($LessAdvance));
echo ($invoiceTotalAmountInWords); ?></td>
<td style="text-align: right;" colspan="3"><?php if(!empty($amtinwords)){ print_r($amtinwords);} ?></td>
</tr>
<tr><td style="text-align: center;font-size:12px;" colspan="4">This is a computer generated document. This document does not require signature.</td></tr>
</tbody>

View File

@ -20,19 +20,28 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/js/bootstrap-datepicker.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.0/css/bootstrap-datepicker.css" rel="stylesheet">
<script>
function checkYearMonthAsEmpty()
{
if($("#mon").val() == "") {
alert("No Month Selected!");
var i=0;
if($("#mon").val() == "") {
i++;
// alert("No Month Selected!");
}
if($("#yr").val() == "") {
alert("No Year Selected!");}
i++;
//alert("No Year Selected!");
}
var m=$("#mon").val();
var y=$("#yr").val();
// alert(m+y);
if($("#FileName").val() == "") {
i++;
//alert("No File Uploaded!");
}
// alert(i);
return i;
}
</script>
@ -49,12 +58,14 @@ function checkYearMonthAsEmpty()
<div class="col-md-8 col-md-offset-2" style="border:2px dotted;padding:2%;">
<form id="upload" action="<?php echo base_url() ?>FileUpload2" method="post" role="form" enctype="multipart/form-data"> <div class="col-md-5 col-md-offset-2">
<form id="upload" method="post" action="<?php echo base_url() ?>FileUpload2"; role="form" enctype="multipart/form-data"> <div class="col-md-5 col-md-offset-2">
<span for="FileName">File Name</span>
<input type="text" class="form-control required" id="FileName" name="FileName" readonly>
</div>
<div class="box-header">
<input type="file" accept=".xlsx" onchange="readURL(this);" id="userfile" name="userfile"/>
<label for="photo">Select Excel File to upload<br/>(only .xls)</label>
</div>
<div class="col-md-2 col-md-offset-2">
@ -79,13 +90,13 @@ function checkYearMonthAsEmpty()
document.getElementById("year").value = year; // $('.date-own').datepicker({
// //minViewMode: 2,
// format: 'yyyy'
// <?php echo base_url() ?>FileUpload2
// });
</script>
</div>
<br/>
<div class="col-md-1 col-md-offset-1">
<input type="submit" class="btn btn-info" value="upload" onmouseover="checkYearMonthAsEmpty();"/>
<input type="button" class="btn btn-info" value="upload" onclick="save();"/>
</div>
</div>
@ -93,4 +104,38 @@ function checkYearMonthAsEmpty()
</section>
</div>
<script>
function save()
{
var x=checkYearMonthAsEmpty();
//alert(x);
if(x == 0)
{
//alert($('#userfile').val());
//$_FILES['userfile']['name']=
// $.ajax({
// data:$('#upload').serialize(),
// type:"POST",
// //enctype: 'multipart/form-data',
// url:"<?php echo base_url();?>payslip/uploadExcel2",
// success:function(result){
// $('#content').loader('hide');
// alert("File Uploaded Sucessfully!");
// alert(result);
// window.location="purchaseorderListing";
// //alert("redirect");
$('form#upload').submit();
//window.location="ExcelUpload2";
// }
//});
}else
{
alert("Please Provide All Informatin Correctly!");
return false;
}
}
</script>