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 {
Employee employee = new Employee();
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 {
attendenceList = attendanceService.getAttendanciesReport(currentDate, shift);
......
......@@ -149,7 +149,7 @@ public class PdfReportGenerator {
for (EmpLoginData data : empLoginDatas) {
if (isFirst && employeeId != 0) {
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;
paragraph1.add(anchorTarget);
}
......
......@@ -69,5 +69,5 @@ spring.thymeleaf.view-names:thymeleaf/*
#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
......@@ -70,6 +70,6 @@ email.workAnniversary.notification.subject=Happy Work Anniversary
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
\ No newline at end of file
......@@ -66,4 +66,4 @@ email.project.notification.from=mytime.nisum@gmail.com
email.project.notification.subject=Project EndDate Email Notification
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
\ No newline at end of file
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
......@@ -4,13 +4,17 @@ myApp.directive('hcPieChart', function () {
restrict: 'E',
template: '<div></div>',
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/getBillabilityDetailsByAccount','column',element,"Billability By Account");
scope.clickMe= function(reportType) {
scope.getBillabilityReportData = function() {
let searchedDate = getFormattedDate(scope.searchedReportDate);
scope.gridOptions.data = [];
scope.gridOptions.enablePaginationControls = false;
if(reportType!=null ) {
let reportType = scope.reportType;
if(reportType && searchedDate) {
scope.errorMessage =false;
if(reportType == "Monthly Trends"){
getEmployeeDetails(scope,element[0].baseURI+'reports/getBillabilityDetailsByMonth','line',element," Billability Monthly Trends");
}
......@@ -22,19 +26,29 @@ myApp.directive('hcPieChart', function () {
}else{
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) {
$scope.name = [];
$scope.records = [];
$scope.empSearchId = "";
$scope.reportType = "All Functional Group"
$scope.reportType = "All Functional Group";
$scope.reportTypeList = ["All Functional Group", "Account", "Monthly Trends"];
var today = new Date();
$scope.searchedReportDate = today;
$scope.maxReportDate = today;
$scope.errorMessage = false;
$scope.getAllOptions = function() {
$http({
method: "GET",
......@@ -109,15 +123,16 @@ myApp.directive('hcPieChart', function () {
$scope.gridOptions.data = $scope.records;
$scope.gridOptions.enablePaginationControls = false;
$scope.getMyTeamDetails = function(seriesName, category, optionName,title){
console.log(title)
let searchedDate = getFormattedDate($scope.searchedReportDate);
if(title.trim() == 'Billability For All Functional Group'){
if(category=='I&A'){
category = 'I%26A';
}
$http({
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) {
$scope.gridOptions.data = response.data;
if(response.data.length > 10){
......@@ -133,7 +148,7 @@ myApp.directive('hcPieChart', function () {
}else if(title.trim() == 'Billability For Account'){
$http({
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) {
$scope.gridOptions.data = response.data;
if(response.data.length > 10){
......@@ -166,7 +181,7 @@ myApp.directive('hcPieChart', function () {
var fg = $scope.reportType == 'I&A' ? 'I%26A' : $scope.reportType;
$http({
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) {
$scope.gridOptions.data = response.data;
if(response.data.length > 10){
......@@ -283,3 +298,20 @@ var 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
......@@ -54,6 +54,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
//{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: '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 }
]
};
......@@ -520,8 +521,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
// $("#lead .lead-search .md-select-value span .md-text").css({
//  'border': '1px solid #000',
//  'padding': '1px',
// '1px solid #000',
// '1px',
// }).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;
z-index: 100 !important;
}
.md-select-menu-container {
z-index: 100 !important;
z-index: 1000 !important;
}
.md-dialog-custom-height {
max-height: 95% !important;
......@@ -715,3 +715,36 @@ cursor: pointer;
.manage-open-pool {
height: calc(100vh - 239px) !important;
}
.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 @@
<div class="md-padding"
id="popupContainer" ng-controller="chartsController" ng-init="getAllOptions()">
<div class="text-right">
Report Type: <select ng-model="reportType" #ref ng-change="clickMe(reportType)">
<option ng-value="reportType" ng-repeat="reportType in reportTypeList" >Billability : {{reportType}}</option>
</select>
</div>
<div class="row">
<div class ="col-lg-6 col-md-6">
<hc-pie-chart title="Browser usage" data="pieData" options="chartOptions">Placeholder for pie chart</hc-pie-chart>
</div>
<div class="col-lg-6 col-md-6 add-space">
<div class="row add-space">
<div class="col-lg-4 col-md-4"></div>
<div class= "col-lg-8 col-md-8">
<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
class="myGrid utilization-report">
<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