From affef22b2557f0e339b76bfb801b44e38541fb7b Mon Sep 17 00:00:00 2001 From: velz2020 Date: Mon, 11 Sep 2017 19:46:01 +0530 Subject: [PATCH] PAYROLL CHANGES --- application/controllers/emppaydate.php | 89 +++++++---- application/controllers/payslip.php | 119 ++++++++++++-- application/views/addemppaydate.php | 90 +++++++++-- application/views/editOldemppay.php | 150 ++++++++++++------ application/views/editOldmonthly.php | 175 +++++++++++---------- application/views/emppayListing.php | 32 ++-- application/views/monthlyListing.php | 12 +- application/views/payslipgenerate.php | 18 ++- application/views/payslipgenerateprint.php | 80 +--------- application/views/payslipupload2.php | 65 ++++++-- 10 files changed, 517 insertions(+), 313 deletions(-) diff --git a/application/controllers/emppaydate.php b/application/controllers/emppaydate.php index a60df687..637f1699 100755 --- a/application/controllers/emppaydate.php +++ b/application/controllers/emppaydate.php @@ -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); diff --git a/application/controllers/payslip.php b/application/controllers/payslip.php index fe5fbcfa..3f288ec7 100755 --- a/application/controllers/payslip.php +++ b/application/controllers/payslip.php @@ -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'] = ""; + $data['Success'] = ""; - // $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'] = ""; @@ -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'] = ""; + //echo "DONE"; echo ""; echo ""; $this->global['pageTitle'] = 'Siddharth : Payroll Data Upload'; $this->loadViews("payslipupload2", $this->global , NULL); - //redirect('monthlyListings'); + //redirect('payslip/viewUpload2'); } else { - $data['Fail'] = ""; + //$data['Fail'] = ""; //echo ""; $this->global['pageTitle'] = 'Siddharth : Payroll Data Upload2'; - //$this->loadViews("payslipupload2", $this->global, $data , NULL); + $this->loadViews("payslipupload2", $this->global, $data , NULL); } } else { - $data['Fail'] = ""; + //$data['Fail'] = ""; //echo ""; $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; + } + } ?> \ No newline at end of file diff --git a/application/views/addemppaydate.php b/application/views/addemppaydate.php index 04b1a21c..e82facb4 100755 --- a/application/views/addemppaydate.php +++ b/application/views/addemppaydate.php @@ -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({
- * + *
'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({
'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); ?>
@@ -219,7 +220,7 @@ $("#due_started").datepicker({
- * + *
Loan Amount - +
@@ -256,7 +257,7 @@ $("#due_started").datepicker({
Loan Issue(d) Date - +
@@ -266,7 +267,7 @@ $("#due_started").datepicker({
Monthly Due - +
@@ -274,7 +275,7 @@ $("#due_started").datepicker({
Due Started - +
@@ -290,7 +291,7 @@ $("#due_started").datepicker({
Paid Amount - +
@@ -298,7 +299,7 @@ $("#due_started").datepicker({ @@ -348,8 +349,11 @@ $("#due_started").datepicker({ diff --git a/application/views/editOldemppay.php b/application/views/editOldemppay.php index 7344676a..e4af1517 100755 --- a/application/views/editOldemppay.php +++ b/application/views/editOldemppay.php @@ -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))
-
+ - +
@@ -174,10 +179,19 @@ if(!empty($emppay))
Employee Name - +
+ +
+
+
+ Total Salary* + +
+
+
@@ -187,14 +201,7 @@ if(!empty($emppay))
-
-
-
- Total Salary* - -
-
-
+
@@ -213,7 +220,14 @@ if(!empty($emppay))
- +
+
+
+ HRA_Amount* + +
+
+
@@ -228,20 +242,13 @@ if(!empty($emppay))
-
-
-
- HRA_Amount* - -
-
-
+
- OT_Rate* - + OT_Rate(Per Hour)* +
@@ -254,9 +261,7 @@ if(!empty($emppay))
-
-
-
+
PF_Rate(%)* @@ -264,6 +269,9 @@ if(!empty($emppay))
+
+
+
@@ -278,8 +286,8 @@ if(!empty($emppay))
- Food Allowances* - + Food Allowances(Per Day)* +
@@ -310,7 +318,7 @@ if(!empty($emppay))
Loan Issue(d) Date - +
@@ -320,7 +328,7 @@ if(!empty($emppay))
Monthly Due - +
@@ -328,7 +336,7 @@ if(!empty($emppay))
Due Started - +
@@ -401,20 +409,14 @@ if(!empty($emppay))
-
-
-
- Active state
-
-
-
+
@@ -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...!"); + } + } +} \ No newline at end of file diff --git a/application/views/editOldmonthly.php b/application/views/editOldmonthly.php index 73ebd599..2483ec84 100755 --- a/application/views/editOldmonthly.php +++ b/application/views/editOldmonthly.php @@ -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(){ -} +// } @@ -218,7 +219,7 @@ function validateAll(){
LOP Days: - +
@@ -230,7 +231,7 @@ function validateAll(){
OverTime Hours Worked: - +
@@ -239,7 +240,7 @@ function validateAll(){
Loan Recovered: - +
@@ -256,7 +257,7 @@ function validateAll(){
Incentives: - +
@@ -264,7 +265,7 @@ function validateAll(){
Other Deductions: - +
diff --git a/application/views/emppayListing.php b/application/views/emppayListing.php index fea4df3d..13a1668a 100755 --- a/application/views/emppayListing.php +++ b/application/views/emppayListing.php @@ -34,21 +34,21 @@
- + - - - - - - - - - - + + + + + + + + + - + + @@ -60,20 +60,20 @@ ?> - + - + - + - + diff --git a/application/views/monthlyListing.php b/application/views/monthlyListing.php index a60cb82f..a1524ba9 100755 --- a/application/views/monthlyListing.php +++ b/application/views/monthlyListing.php @@ -51,12 +51,12 @@ speed:500 - - + + - - - + + + @@ -73,7 +73,7 @@ speed:500 - + diff --git a/application/views/payslipgenerate.php b/application/views/payslipgenerate.php index 327479ef..08ec5504 100755 --- a/application/views/payslipgenerate.php +++ b/application/views/payslipgenerate.php @@ -84,17 +84,23 @@ $(function() { 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:"payslip/callsp", success:function(result) { - + $('form#PayslipGenerator').submit(); $('#content').loader('hide'); alert("Employees Salary Added Successfully!"); @@ -196,10 +202,10 @@ $(function() {
- + - -
+
diff --git a/application/views/payslipgenerateprint.php b/application/views/payslipgenerateprint.php index 55e3ea60..dd18f7b0 100755 --- a/application/views/payslipgenerateprint.php +++ b/application/views/payslipgenerateprint.php @@ -1,76 +1,4 @@ - '', '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; - } -?> OTWages; $OtherDeductions=$Pay->OtherDeductions; $LoanAdvance=$Pay->Advance; + if($OTWage == '') { $OTWages = '0.00'; @@ -253,7 +184,7 @@ if($RecCount > 0)
@@ -368,8 +299,7 @@ if($RecCount > 0) - + diff --git a/application/views/payslipupload2.php b/application/views/payslipupload2.php index 084ddd0c..cd897394 100755 --- a/application/views/payslipupload2.php +++ b/application/views/payslipupload2.php @@ -20,19 +20,28 @@ - @@ -49,12 +58,14 @@ function checkYearMonthAsEmpty()
-
+
File Name
+ +
@@ -79,13 +90,13 @@ function checkYearMonthAsEmpty() document.getElementById("year").value = year; // $('.date-own').datepicker({ // //minViewMode: 2, // format: 'yyyy' - + // FileUpload2 // });

- +
@@ -93,4 +104,38 @@ function checkYearMonthAsEmpty()
+
Pay Data IDEmployee ID Employee NameTotal SalaryBasic PayHRA RateHRA AmountOT RateAllowancesPF RateESI RateFood AllowancesIs ActiveTotal Salary in ₹Basic Pay in ₹HRA Rate in %HRA Amount in ₹OT Rate in ₹Allowances in ₹PF Ratein %ESI Rate in %Food Allowances in ₹EditAction
Pay_Data_ID ?>EmpID ?> FirstName ." ". $record->LastName?>TotalSalary,0,'',''); ?>TotalSalary; ?> Basic_Pay ?> HRA_Rate ?>HRA_Amount,0,'',''); ?>HRA_Amount; ?> OT_Rate ?> Allowances ?> PF_Rate ?> ESI_Rate ?> Food_Allowances ?>is_Active ? 'Yes' : 'No'?>Employee Id Employee Name LOP DaysOT Hours WorkedLoan RecoveredOT Hours Worked in HrsLoan Recovered in ₹ IncentivesOther DeductionsEditIncentives in RsOther Deductions in ₹Action
FirstName ." ". $record->LastName ?> LOP_Days ?> OT_Hrs_Worked ?>Loan_Recovered ?>Loan_Recovered)){echo number_format($record->Loan_Recovered,2,'.','');}else {echo $record->Loan_Recovered;} ?> Incentives ?> Other_Deductions ?>
-
SIDDHARTH INDUSTRIES
Survey No: 168/1C3,Pennalur Pet Road,Goonipalyam village,
Uthukottai Taluk,Tiruvallur Dist, Chennai,Tamilnadu,Pin code : 602026.
PaySlip for the month of
+
SIDDHARTH INDUSTRIES
Survey No: 168/1C3,Pennalur Pet Road,Goonipalyam village,
Uthukottai Taluk,Tiruvallur Dist, Chennai,Tamilnadu,Pin code : 602026.
PaySlip for the Month of
 
Total Amount In Words  
This is a computer generated document. This document does not require signature.