Commit 45e1ec52 authored by Prayas Jain's avatar Prayas Jain

Fixed Issues Related to utilization enhancements

parent 7a6fdf36
...@@ -35,7 +35,7 @@ public class ReportService implements IReportService { ...@@ -35,7 +35,7 @@ public class ReportService implements IReportService {
public ReportVo getBarChartReport(String byType,Date onDate) throws MyTeamException { public ReportVo getBarChartReport(String byType,Date onDate) throws MyTeamException {
ReportVo reportVo = new ReportVo(); ReportVo reportVo = new ReportVo();
if(byType.equals("AllFunctionalGroup")) { if(byType.equals("AllFunctionalOrgs")) {
functionalGroupService.getAllFunctionalGroups().stream(). functionalGroupService.getAllFunctionalGroups().stream().
filter(f -> !Arrays.asList("IT","Recruiter","Admin","HR","Accounts","Delivery Org","Global Mobility").contains(f.getName())). filter(f -> !Arrays.asList("IT","Recruiter","Admin","HR","Accounts","Delivery Org","Global Mobility").contains(f.getName())).
forEach(f -> reportVo.getCategoriesList().add(f.getName())); forEach(f -> reportVo.getCategoriesList().add(f.getName()));
...@@ -63,7 +63,7 @@ public class ReportService implements IReportService { ...@@ -63,7 +63,7 @@ public class ReportService implements IReportService {
float billper; float billper;
float nonBillPer; float nonBillPer;
List<Employee> employeeList = new ArrayList<>(); List<Employee> employeeList = new ArrayList<>();
if(byType.equals("AllFunctionalGroup")) { if(byType.equals("AllFunctionalOrgs")) {
employeeList = getEmployeesByFunctionalGroup(category); employeeList = getEmployeesByFunctionalGroup(category);
} else if(byType.equals("Account")){ } else if(byType.equals("Account")){
employeeList = getEmployeeByAccounts(category); employeeList = getEmployeeByAccounts(category);
...@@ -80,7 +80,7 @@ public class ReportService implements IReportService { ...@@ -80,7 +80,7 @@ public class ReportService implements IReportService {
billableC++; billableC++;
}else if(resource!=null && resource.getBillableStatus().equals("Trainee")) { }else if(resource!=null && resource.getBillableStatus().equals("Trainee")) {
traineeC++; traineeC++;
} else{ } else if(resource!=null && resource.getBillableStatus().equals("Non-Billable")){
nonBillableC++; nonBillableC++;
} }
} }
......
...@@ -1148,7 +1148,8 @@ public class ResourceService implements IResourceService { ...@@ -1148,7 +1148,8 @@ public class ResourceService implements IResourceService {
resourceRepo.delete(futureAllocation); resourceRepo.delete(futureAllocation);
} }
if(Objects.nonNull(currentAllocation)) { if(Objects.nonNull(currentAllocation)) {
currentAllocation.setBillingEndDate(endDate); Date projectEndDate = currentAllocation.getBillingEndDate().compareTo(endDate) <= 0 ? currentAllocation.getBillingEndDate() : endDate ;
currentAllocation.setBillingEndDate(projectEndDate);
currentAllocation.setStatus(MyTeamUtils.STATUS_RELEASED); currentAllocation.setStatus(MyTeamUtils.STATUS_RELEASED);
resourceRepo.save(currentAllocation); resourceRepo.save(currentAllocation);
} }
......
...@@ -5,7 +5,7 @@ myApp.directive('hcPieChart', function () { ...@@ -5,7 +5,7 @@ myApp.directive('hcPieChart', function () {
template: '<div></div>', template: '<div></div>',
link: function (scope, element) { link: function (scope, element) {
let onLoadSearchedDate = getFormattedDate(scope.searchedReportDate); let onLoadSearchedDate = getFormattedDate(scope.searchedReportDate);
getEmployeeDetails(scope,element[0].baseURI+'reports/getBarChartReport?byType=AllFunctionalGroup&onDate='+onLoadSearchedDate,'column',element,"Billability For All Functional Group"); getEmployeeDetails(scope,element[0].baseURI+'reports/getBarChartReport?byType=AllFunctionalOrgs&onDate='+onLoadSearchedDate,'column',element,"Billability For All Functional Orgs");
//getEmployeeDetails(scope,element[0].baseURI+'reports/billabilityByFunctionalGroup','column',element,"Billability By Functional Group"); //getEmployeeDetails(scope,element[0].baseURI+'reports/billabilityByFunctionalGroup','column',element,"Billability By Functional Group");
//getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByAccount','column',element,"Billability By Account"); //getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByAccount','column',element,"Billability By Account");
scope.getBillabilityReportData = function() { scope.getBillabilityReportData = function() {
...@@ -21,7 +21,7 @@ myApp.directive('hcPieChart', function () { ...@@ -21,7 +21,7 @@ myApp.directive('hcPieChart', function () {
else { else {
if(reportType=='I&A'){ if(reportType=='I&A'){
reportTypeApiFormat = 'I%26A'; reportTypeApiFormat = 'I%26A';
}else if(reportType == "All Functional Group"){ }else if(reportType == "All Functional Orgs"){
reportTypeApiFormat = reportType.replace(/\s/g, ""); reportTypeApiFormat = reportType.replace(/\s/g, "");
}else{ }else{
reportTypeApiFormat = reportType; reportTypeApiFormat = reportType;
...@@ -41,8 +41,8 @@ myApp.directive('hcPieChart', function () { ...@@ -41,8 +41,8 @@ myApp.directive('hcPieChart', function () {
$scope.name = []; $scope.name = [];
$scope.records = []; $scope.records = [];
$scope.empSearchId = ""; $scope.empSearchId = "";
$scope.reportType = "All Functional Group"; $scope.reportType = "All Functional Orgs";
$scope.reportTypeList = ["All Functional Group", "Account", "Monthly Trends"]; $scope.reportTypeList = ["All Functional Orgs", "Account", "Monthly Trends"];
var today = new Date(); var today = new Date();
$scope.searchedReportDate = today; $scope.searchedReportDate = today;
$scope.maxReportDate = today; $scope.maxReportDate = today;
...@@ -127,8 +127,8 @@ myApp.directive('hcPieChart', function () { ...@@ -127,8 +127,8 @@ myApp.directive('hcPieChart', function () {
$scope.getMyTeamDetails = function(seriesName, category, optionName,title){ $scope.getMyTeamDetails = function(seriesName, category, optionName,title){
let searchedDate = getFormattedDate($scope.searchedReportDate); let searchedDate = getFormattedDate($scope.searchedReportDate);
if(title.trim() == 'Billability For All Functional Group On '+searchedDate || if(title.trim() == 'Billability For All Functional Orgs On '+searchedDate ||
title.trim() == 'Billability For All Functional Group On Today' ){ title.trim() == 'Billability For All Functional Orgs On Today' ){
if(category=='I&A'){ if(category=='I&A'){
category = 'I%26A'; category = 'I%26A';
} }
......
...@@ -247,10 +247,10 @@ ...@@ -247,10 +247,10 @@
<!--row--> </md-dialog-content> <!--row--> </md-dialog-content>
<md-dialog-actions layout="row"> <md-dialog-actions layout="row">
<div role="alert" class="col-sm-9 error-msg"> <div role="alert" class="col-sm-8 error-msg">
<span ng-if="errorMessage" class="error" style="color: red; text-align:left;">{{alertMsg}}</span> <span ng-if="errorMessage" class="error" style="color: red; text-align:left;">{{alertMsg}}</span>
</div> </div>
<div class="col-sm-3 action-content"> <div class="col-sm-4 action-content">
<md-button <md-button
class="md-raised" data-ng-click="validateFields(); button=true" class="md-raised" data-ng-click="validateFields(); button=true"
style="width:120px;background: cadetblue;color:white;"> style="width:120px;background: cadetblue;color:white;">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment