From 2b5cf4661d92582dc64c9bacf93832d504966c33 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Thu, 18 Jan 2018 16:20:43 +0530 Subject: [PATCH] under payslip - Bonusandincentive report menu added --- application/config/routes.php | 1 + application/controllers/payslip.php | 20 ++- application/models/monthlypay_model.php | 25 ++- application/views/Bonusreport.php | 214 ++++++++++++++++++++++++ application/views/includes/header.php | 5 + 5 files changed, 262 insertions(+), 3 deletions(-) create mode 100644 application/views/Bonusreport.php diff --git a/application/config/routes.php b/application/config/routes.php index 1858010b..8ee55d3e 100755 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -78,6 +78,7 @@ $route['emppayListings/(:num)'] = 'emppaydate/emppayListing/$1'; $route['attendance'] = 'monthlypay/attendanceLoad'; $route['publicholidays'] = 'monthlypay/loadPublicholidays'; $route['loanreports'] = 'payslip/loadLoanReport'; +$route['bonusreports'] = 'payslip/Bonusreport'; // permission slip// diff --git a/application/controllers/payslip.php b/application/controllers/payslip.php index 86d8d669..7a165833 100755 --- a/application/controllers/payslip.php +++ b/application/controllers/payslip.php @@ -21,10 +21,10 @@ class payslip extends BaseController parent::__construct(); $this->load->model('payroll_model'); $this->load->model('monthlypay_model'); - $this->load->library('form_validation'); + $this->load->library('form_validation'); $this->isLoggedIn(); } - + function phpAlert($msg) { echo ''; } @@ -1250,6 +1250,22 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only"; return $amountInWords; } + + + function Bonusreport() + { + //echo"function in controller"; + + $this->global['pageTitle'] = 'Siddharth : Incentive and Bonus Reports'; + + $fin_year = $this->input->post('finyear'); + //echo "values are,".$year.$fin_year; + $data['dropdownvalue'] = $fin_year; + + $data['Reportvalue'] = $this->monthlypay_model->reportvalue($fin_year); + + $this->loadViews("Bonusreport", $this->global,$data,NULL); + } } ?> \ No newline at end of file diff --git a/application/models/monthlypay_model.php b/application/models/monthlypay_model.php index 559c0186..59a43804 100755 --- a/application/models/monthlypay_model.php +++ b/application/models/monthlypay_model.php @@ -347,7 +347,30 @@ join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsA $this->db->where('per.SNO',$SNO ); $query =$this->db->get(); return $query->result(); - } + } + + function reportvalue($fin_year) + { + + + $curr_split = explode('-',$fin_year); + $pre_year = $curr_split[0]; + $curr_year = $curr_split[1]; + + $sql= "select T_Monthly_Pay_Inputs.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,sum(Incentives) as Incentives,sum(Festival_Bonus) as Bonus + from T_Monthly_Pay_Inputs + join T_Employee_Details on T_Monthly_Pay_Inputs.EmpID = T_Employee_Details.EmpID + where + substr(T_Monthly_Pay_Inputs.Month_Year,4) = ? + and substr(T_Monthly_Pay_Inputs.Month_Year,1,2) >= 4 + or substr(T_Monthly_Pay_Inputs.Month_Year,4) = ? + and substr(T_Monthly_Pay_Inputs.Month_Year,1,2) <= 3 + group by T_Monthly_Pay_Inputs.EmpID"; + + $query = $this->db->query($sql,array($pre_year,$curr_year)); + return $query->result(); + } + diff --git a/application/views/Bonusreport.php b/application/views/Bonusreport.php new file mode 100644 index 00000000..c3c1af99 --- /dev/null +++ b/application/views/Bonusreport.php @@ -0,0 +1,214 @@ + + + + + + + + + + +
+ +
+

+
Employee Incentive and Bonus Reports
+

+
+
+ + +
+
+
+ +
+ +
+
+
+ + + + +
+
+ +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S.NoEmployee IdEmployee NameIncentives in ₹Festival Bonus in ₹
EmpID ?>FirstName ." ". $record->LastName ?>Incentives)){$total+=$record->Incentives; echo $record->Incentives;}else{echo "0.00";}?>Bonus)){$totalbonus+=$record->Bonus ;echo $record->Bonus;}else{echo "0.00";} ?>
+ +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/application/views/includes/header.php b/application/views/includes/header.php index 5b157fb8..c0e28ef6 100755 --- a/application/views/includes/header.php +++ b/application/views/includes/header.php @@ -553,6 +553,11 @@ $(function() { Loan Reports +
  • + + Incentives And Bonus Reports + +