Upgrade to v15.0.OS

This commit is contained in:
Thilina Hasantha
2016-02-08 04:25:58 +05:30
parent b99b6f6f77
commit 078396d5d7
91 changed files with 3332 additions and 1720 deletions

View File

@@ -0,0 +1,53 @@
<?php
if(!interface_exists('ReportBuilderInterface')){
include_once APP_BASE_PATH.'admin/reports/reportClasses/ReportBuilderInterface.php';
}
if(!class_exists('LeavesActionManager')){
include_once APP_BASE_PATH.'modules/leaves/api/LeavesActionManager.php';
}
class EmployeeLeaveEntitlementReport implements ReportBuilderInterface{
public function getData($report,$req){
$leaveActionManager = new LeavesActionManager();
$department = $req['department'];
$employeeId = $req['employee'];
if(($employeeId == "NULL" || empty($employeeId)) && ($department == "NULL" || empty($department))){
$emp = new Employee();
$employees = $emp->Find("status = 'Active'",array());
}else if($employeeId != "NULL" && !empty($employeeId)){
$emp = new Employee();
$employees = $emp->Find("id = ?",array($employeeId));
}else{
$emp = new Employee();
$employees = $emp->Find("department = ? and status = 'Active'",array($department));
}
$reportData = array();
$reportData[] = array("Employee ID","Employee","Leave Type","Pending","Approved","Rejected","Canceled","Available","To be Accrued","Carried Forward from Previous Years");
foreach($employees as $employee){
$leaveEntitlements = $leaveActionManager->getEntitlementByEmployee($employee)->getObject();
foreach($leaveEntitlements as $leaveEntitlement){
$reportData[] = array(
$employee->employee_id,
$employee->first_name." ".$employee->last_name,
$leaveEntitlement['name'],
$leaveEntitlement['pendingLeaves'],
$leaveEntitlement['approvedLeaves'],
$leaveEntitlement['rejectedLeaves'],
$leaveEntitlement['cancelRequestedLeaves'],
$leaveEntitlement['availableLeaves'],
$leaveEntitlement['tobeAccrued'],
$leaveEntitlement['carriedForward']
);
}
}
return $reportData;
}
}