Commit 926185b7 authored by Prayas Jain's avatar Prayas Jain

Added date option in utilization report screen, Updated holidays date, added...

Added date option in utilization report screen, Updated holidays date, added average login hours in login report and added project end date in manage project screen
parent 659e2d68
...@@ -111,7 +111,7 @@ public class LeaveNotificationScheduler { ...@@ -111,7 +111,7 @@ public class LeaveNotificationScheduler {
Employee employee = new Employee(); Employee employee = new Employee();
String empSubStatus = ""; String empSubStatus = "";
if (!MyTeamDateUtils.isTodayHoliday(environment.getProperty("email.holidays.list.2019", "14-01-2019,21-03-2019,19-04-2019,05-06-2019,12-08-2019,15-08-2019,02-09-2019,02-10-2019,08-10-2019,25-12-2019"))) { if (!MyTeamDateUtils.isTodayHoliday(environment.getProperty("email.holidays.list.2020", "01-01-2020,15-01-2020,25-03-2020,10-04-2020,25-05-2020,02-06-2020,31-07-2020,02-10-2020,26-10-2020,25-12-2020"))) {
try { try {
attendenceList = attendanceService.getAttendanciesReport(currentDate, shift); attendenceList = attendanceService.getAttendanciesReport(currentDate, shift);
......
...@@ -149,7 +149,7 @@ public class PdfReportGenerator { ...@@ -149,7 +149,7 @@ public class PdfReportGenerator {
for (EmpLoginData data : empLoginDatas) { for (EmpLoginData data : empLoginDatas) {
if (isFirst && employeeId != 0) { if (isFirst && employeeId != 0) {
Anchor anchorTarget = new Anchor( Anchor anchorTarget = new Anchor(
"Employee Id : " + data.getEmployeeId() + "\nEmployee Name : " + data.getEmployeeName()); "Employee Id : " + data.getEmployeeId() + "\nEmployee Name : " + data.getEmployeeName()+ "\nAverage Login Hour : "+data.getTotalAvgTime() + "(hh:mm)");
isFirst = false; isFirst = false;
paragraph1.add(anchorTarget); paragraph1.add(anchorTarget);
} }
......
...@@ -69,5 +69,5 @@ spring.thymeleaf.view-names:thymeleaf/* ...@@ -69,5 +69,5 @@ spring.thymeleaf.view-names:thymeleaf/*
#email.workAnniversary.notification.cron=00 00 06 * * 1-7 #email.workAnniversary.notification.cron=00 00 06 * * 1-7
email.holidays.list.2019=14-01-2019,21-03-2019,19-04-2019,05-06-2019,12-08-2019,15-08-2019,02-09-2019,02-10-2019,08-10-2019,25-12-2019 email.holidays.list.2020=01-01-2020,15-01-2020,25-03-2020,10-04-2020,25-05-2020,02-06-2020,31-07-2020,02-10-2020,26-10-2020,25-12-2020
message=this is from development message=this is from development
...@@ -70,6 +70,6 @@ email.workAnniversary.notification.subject=Happy Work Anniversary ...@@ -70,6 +70,6 @@ email.workAnniversary.notification.subject=Happy Work Anniversary
email.workAnniversary.notification.cron=00 00 06 * * 1-7 email.workAnniversary.notification.cron=00 00 06 * * 1-7
email.holidays.list.2019=14-01-2019,21-03-2019,19-04-2019,05-06-2019,12-08-2019,15-08-2019,02-09-2019,02-10-2019,08-10-2019,25-12-2019 email.holidays.list.2020=01-01-2020,15-01-2020,25-03-2020,10-04-2020,25-05-2020,02-06-2020,31-07-2020,02-10-2020,26-10-2020,25-12-2020
message=this is from production message=this is from production
\ No newline at end of file
...@@ -66,4 +66,4 @@ email.project.notification.from=mytime.nisum@gmail.com ...@@ -66,4 +66,4 @@ email.project.notification.from=mytime.nisum@gmail.com
email.project.notification.subject=Project EndDate Email Notification email.project.notification.subject=Project EndDate Email Notification
email.project.notification.cron=00 00 15 * * 1-5 email.project.notification.cron=00 00 15 * * 1-5
email.holidays.list.2019=14-01-2019,21-03-2019,19-04-2019,05-06-2019,12-08-2019,15-08-2019,02-09-2019,02-10-2019,08-10-2019,25-12-2019 email.holidays.list.2020=01-01-2020,15-01-2020,25-03-2020,10-04-2020,25-05-2020,02-06-2020,31-07-2020,02-10-2020,26-10-2020,25-12-2020
\ No newline at end of file \ No newline at end of file
...@@ -4,13 +4,17 @@ myApp.directive('hcPieChart', function () { ...@@ -4,13 +4,17 @@ myApp.directive('hcPieChart', function () {
restrict: 'E', restrict: 'E',
template: '<div></div>', template: '<div></div>',
link: function (scope, element) { link: function (scope, element) {
getEmployeeDetails(scope,element[0].baseURI+'reports/getBarChartReport?byType=AllFunctionalGroup','column',element,"Billability For All Functional Group"); 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/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.clickMe= function(reportType) { scope.getBillabilityReportData = function() {
let searchedDate = getFormattedDate(scope.searchedReportDate);
scope.gridOptions.data = []; scope.gridOptions.data = [];
scope.gridOptions.enablePaginationControls = false; scope.gridOptions.enablePaginationControls = false;
if(reportType!=null ) { let reportType = scope.reportType;
if(reportType && searchedDate) {
scope.errorMessage =false;
if(reportType == "Monthly Trends"){ if(reportType == "Monthly Trends"){
getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByMonth','line',element," Billability Monthly Trends"); getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByMonth','line',element," Billability Monthly Trends");
} }
...@@ -22,19 +26,29 @@ myApp.directive('hcPieChart', function () { ...@@ -22,19 +26,29 @@ myApp.directive('hcPieChart', function () {
}else{ }else{
reportTypeApiFormat = reportType; reportTypeApiFormat = reportType;
} }
getEmployeeDetails(scope,element[0].baseURI+'reports/getBarChartReport?byType='+reportTypeApiFormat,'column',element,"Billability For "+reportType); getEmployeeDetails(scope,element[0].baseURI+'reports/getBarChartReport?byType='+reportTypeApiFormat+'&onDate='+searchedDate,'column',element,"Billability For "+reportType);
} }
} }
} else {
scope.errorMessage =true;
scope.alertMsg = 'Please Select Valid Report Type or Date';
}
}
} }
}; }
}).controller('chartsController', function ($scope, $http, myFactory,exportUiGridService, $mdDialog, appConfig) { }).controller('chartsController', function ($scope, $http, myFactory,exportUiGridService, $mdDialog, appConfig) {
$scope.name = []; $scope.name = [];
$scope.records = []; $scope.records = [];
$scope.empSearchId = ""; $scope.empSearchId = "";
$scope.reportType = "All Functional Group" $scope.reportType = "All Functional Group";
$scope.reportTypeList = ["All Functional Group", "Account", "Monthly Trends"]; $scope.reportTypeList = ["All Functional Group", "Account", "Monthly Trends"];
var today = new Date();
$scope.searchedReportDate = today;
$scope.maxReportDate = today;
$scope.errorMessage = false;
$scope.getAllOptions = function() { $scope.getAllOptions = function() {
$http({ $http({
method: "GET", method: "GET",
...@@ -108,16 +122,17 @@ myApp.directive('hcPieChart', function () { ...@@ -108,16 +122,17 @@ myApp.directive('hcPieChart', function () {
}; };
$scope.gridOptions.data = $scope.records; $scope.gridOptions.data = $scope.records;
$scope.gridOptions.enablePaginationControls = false; $scope.gridOptions.enablePaginationControls = false;
$scope.getMyTeamDetails = function(seriesName, category, optionName,title){ $scope.getMyTeamDetails = function(seriesName, category, optionName,title){
console.log(title) let searchedDate = getFormattedDate($scope.searchedReportDate);
if(title.trim() == 'Billability For All Functional Group'){ if(title.trim() == 'Billability For All Functional Group'){
if(category=='I&A'){ if(category=='I&A'){
category = 'I%26A'; category = 'I%26A';
} }
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "reports/fetchEmployeeDetailsByFGAndBillability?fGroup="+category+"&billableStatus="+seriesName url : appConfig.appUri + "reports/fetchEmployeeDetailsByFGAndBillability?fGroup="+category+"&billableStatus="+seriesName+"&onDate="+searchedDate
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
if(response.data.length > 10){ if(response.data.length > 10){
...@@ -133,7 +148,7 @@ myApp.directive('hcPieChart', function () { ...@@ -133,7 +148,7 @@ myApp.directive('hcPieChart', function () {
}else if(title.trim() == 'Billability For Account'){ }else if(title.trim() == 'Billability For Account'){
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "reports/fetchEmployeeDetailsByAccountBillability?account="+category+"&billabilityStatus="+seriesName url : appConfig.appUri + "reports/fetchEmployeeDetailsByAccountBillability?account="+category+"&billabilityStatus="+seriesName+"&onDate="+searchedDate
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
if(response.data.length > 10){ if(response.data.length > 10){
...@@ -166,7 +181,7 @@ myApp.directive('hcPieChart', function () { ...@@ -166,7 +181,7 @@ myApp.directive('hcPieChart', function () {
var fg = $scope.reportType == 'I&A' ? 'I%26A' : $scope.reportType; var fg = $scope.reportType == 'I&A' ? 'I%26A' : $scope.reportType;
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "reports/fetchEmployeeDetailsByFGAccountAndBillability?fGroup="+fg+"&billableStatus="+seriesName+"&acccount="+category url : appConfig.appUri + "reports/fetchEmployeeDetailsByFGAccountAndBillability?fGroup="+fg+"&billableStatus="+seriesName+"&acccount="+category+"&onDate="+searchedDate
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
$scope.gridOptions.data = response.data; $scope.gridOptions.data = response.data;
if(response.data.length > 10){ if(response.data.length > 10){
...@@ -282,4 +297,21 @@ var categoriesList = []; ...@@ -282,4 +297,21 @@ var categoriesList = [];
scope.drawChart(element,chart,result,title,categoriesList); scope.drawChart(element,chart,result,title,categoriesList);
} }
}); });
}
function getFormattedDate(date){
var day = date.getDate();
var month = date.getMonth() + 1;
var year = date.getFullYear();
return year + '-' + (month < 10 ? "0" + month : month) + '-'
+ (day < 10 ? "0" + day : day);
}
function treatAsUTC(date) {
var result = new Date(date);
result.setMinutes(result.getMinutes() - result.getTimezoneOffset());
return result;
}
function daysBetween(fromDate, toDate) {
var millisecondsPerDay = 24 * 60 * 60 * 1000;
return Math.round((treatAsUTC(toDate) - treatAsUTC(fromDate)) / millisecondsPerDay);
} }
\ No newline at end of file
...@@ -41,7 +41,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -41,7 +41,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
// '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>' // '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.getRowData(row,\'Delete\')"></i></p>'
$scope.gridOptions = { $scope.gridOptions = {
paginationPageSizes: [10, 20, 30, 40, 50, 100], paginationPageSizes: [10, 20, 30, 40, 50, 100],
paginationPageSize: 10, paginationPageSize: 10,
pageNumber: 1, pageNumber: 1,
...@@ -54,6 +54,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -54,6 +54,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
//{field : 'managerId',displayName: 'Manager ID ', enableColumnMenu: false, enableSorting: false}, //{field : 'managerId',displayName: 'Manager ID ', enableColumnMenu: false, enableSorting: false},
{ field: 'deliveryLeadIds', displayName: 'Delivery Lead', cellTemplate: '<div ng-repeat= "item in row.entity[col.field]">{{item.employeeName}}<span ng-hide="$last">,</span></div>', enableColumnMenu: false, enableSorting: true, enableFiltering: false }, { field: 'deliveryLeadIds', displayName: 'Delivery Lead', cellTemplate: '<div ng-repeat= "item in row.entity[col.field]">{{item.employeeName}}<span ng-hide="$last">,</span></div>', enableColumnMenu: false, enableSorting: true, enableFiltering: false },
{ field: 'status', displayName: 'Status ', enableColumnMenu: false, enableSorting: true, enableFiltering: true ,width:100}, { field: 'status', displayName: 'Status ', enableColumnMenu: false, enableSorting: true, enableFiltering: true ,width:100},
{ name: 'projectEndDate',width:120, displayName: 'End Date', enableColumnMenu: false, enableSorting: true , cellFilter:'date:"dd-MMM-yyyy"',enableFiltering:false},
{ name: 'Actions', displayName: 'Actions', cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, enableFiltering: false, width:120 } { name: 'Actions', displayName: 'Actions', cellTemplate: getCellTemplate, enableColumnMenu: false, enableSorting: false, enableFiltering: false, width:120 }
] ]
}; };
...@@ -520,8 +521,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -520,8 +521,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
// $("#lead .lead-search .md-select-value span .md-text").css({ // $("#lead .lead-search .md-select-value span .md-text").css({
//  'border': '1px solid #000', // '1px solid #000',
//  'padding': '1px', // '1px',
// }).append('<span class="glyphicon glyphicon-remove" style="margin-left: 5px;"></span>'); // }).append('<span class="glyphicon glyphicon-remove" style="margin-left: 5px;"></span>');
// $(".leads-data").text($("#lead .lead-search .md-select-value span .md-text").text().append('<span class="glyphicon glyphicon-remove" style="margin-left: 5px;"></span>')); // $(".leads-data").text($("#lead .lead-search .md-select-value span .md-text").text().append('<span class="glyphicon glyphicon-remove" style="margin-left: 5px;"></span>'));
} }
......
...@@ -547,7 +547,7 @@ top: 22px; ...@@ -547,7 +547,7 @@ top: 22px;
z-index: 100 !important; z-index: 100 !important;
} }
.md-select-menu-container { .md-select-menu-container {
z-index: 100 !important; z-index: 1000 !important;
} }
.md-dialog-custom-height { .md-dialog-custom-height {
max-height: 95% !important; max-height: 95% !important;
...@@ -714,4 +714,37 @@ cursor: pointer; ...@@ -714,4 +714,37 @@ cursor: pointer;
} }
.manage-open-pool { .manage-open-pool {
height: calc(100vh - 239px) !important; height: calc(100vh - 239px) !important;
} }
\ No newline at end of file .add-space {
margin: 20px 0 10px 0;
}
.search-report-date {
padding-left:0;
}
.search-report-date .md-datepicker-input-container {
width: 74%;
margin:0;
}
.select-report-type {
padding-right: 0;
}
.report-type-selectbox{
padding-right:0;
}
.date-container {
margin-top: 25px;
}
.select-report-type md-select {
margin:0;
}
.report-type-label {
padding-right: 0;
}
.report-search-date-label {
padding: 0 0 0 8px;
}
.search-report-btn {
margin-left:15px;
padding:4px;
}
...@@ -4,16 +4,62 @@ ...@@ -4,16 +4,62 @@
<div class="md-padding" <div class="md-padding"
id="popupContainer" ng-controller="chartsController" ng-init="getAllOptions()"> id="popupContainer" ng-controller="chartsController" ng-init="getAllOptions()">
<div class="text-right"> <div class="row">
Report Type: <select ng-model="reportType" #ref ng-change="clickMe(reportType)"> <div class ="col-lg-6 col-md-6">
<option ng-value="reportType" ng-repeat="reportType in reportTypeList" >Billability : {{reportType}}</option> <hc-pie-chart title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart>
</select> </div>
<div class="col-lg-6 col-md-6 add-space">
</div> <div class="row add-space">
<hc-pie-chart title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart> <div class="col-lg-4 col-md-4"></div>
<div class= "col-lg-8 col-md-8">
<div class="row col-lg-12"> <div class="row">
<label class="col-lg-4 report-search-date-label" for="searchedDate">Select Date: <span class="mandatory"></span></label>
<md-datepicker class="col-lg-8 search-report-date"
ng-model="searchedReportDate" md-placeholder="Select Date"
md-max-date="maxReportDate"
onkeydown="return false">
</md-datepicker>
</div>
</div>
</div>
<div class="row date-container">
<div class="col-lg-4 col-md-4"></div>
<div class="col-lg-8 col-md-8 select-report-type">
<div class="row">
<label class="col-lg-4 col-md-4 report-type-label" for="reportType">Report Type: <span class="mandatory"></span></label>
<md-select class="col-lg-7 col-md-7" ng-model="reportType" #ref
class="report-type-selectbox">
<md-optgroup label="Report Types ">
<md-option ng-value="reportType"
ng-repeat="reportType in reportTypeList">Billability : {{reportType}}
</md-option>
</md-optgroup>
</md-select>
</div>
</div>
</div>
<div class="row date-container">
<div class="col-lg-4 col-md-4"></div>
<div class="col-lg-8 col-md-3">
<div class="row">
<md-button
class="col-lg-3 md-raised md-primary search-report-btn"
ng-click="getBillabilityReportData('click');"> <i
class="fa fa-search fa-1x"></i>
Search
</md-button>
</div>
</div>
</div>
<div class="row alert-container">
<div role="alert" class="col-sm-9 error-msg">
<span ng-if="errorMessage" class="error" style="color: red; text-align:left;">{{alertMsg}}</span>
</div>
</div>
</div>
</div>
<div class="row col-lg-12">
<div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-exporter <div id="gridTest" ui-grid="gridOptions" ui-grid-pagination ui-grid-exporter
class="myGrid utilization-report"> class="myGrid utilization-report">
<div class="watermark" ng-show="!gridOptions.data.length">No <div class="watermark" ng-show="!gridOptions.data.length">No
......
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