Commit c6881717 authored by Prayas Jain's avatar Prayas Jain

Updated Reserved and proposed Functionality

parent 3e359ddb
...@@ -231,7 +231,6 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export ...@@ -231,7 +231,6 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
{field : 'projectStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150}, {field : 'projectStartDate',displayName: 'Start Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150},
{field : 'projectEndDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"' ,minWidth : 100,width: 150}, {field : 'projectEndDate',displayName: 'End Date', enableColumnMenu: false, enableSorting: false, cellFilter: 'date:"dd-MMM-yyyy"' ,minWidth : 100,width: 150},
{field : 'projectStatus',displayName: 'Status', enableColumnMenu: false,enableSorting: false,minWidth : 100,width: 150} {field : 'projectStatus',displayName: 'Status', enableColumnMenu: false,enableSorting: false,minWidth : 100,width: 150}
] ]
}; };
...@@ -281,26 +280,30 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export ...@@ -281,26 +280,30 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
columnDefs : [ columnDefs : [
{field : 'projectName',displayName: 'Project', enableColumnMenu: true, enableSorting: true,minWidth : 100,width: 150}, {field : 'projectName',displayName: 'Project', enableColumnMenu: true, enableSorting: true,minWidth : 100,width: 150},
{field : 'accountName',displayName: 'Account', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150}, {field : 'accountName',displayName: 'Account', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field: 'billingStartDate',displayName: 'Start Date', {field: 'billingStartDate',displayName: 'Billing Start Date',
cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150 cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150
}, },
{ {
field: 'billingEndDate', field: 'billingEndDate',
displayName: 'End Date', displayName: 'Billing End Date',
cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150 cellFilter: 'date:"dd-MMM-yyyy"',minWidth : 100,width: 150
}, },
{field : 'comments',displayName: 'Comments', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150}, {field : 'billableStatus',displayName: 'Billability Status', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'resourceStatus',displayName: 'Status',enableColumnMenu: false, enableSorting: false,enableCellEdit: false,minWidth : 100,width: 150} {field : 'resourceRole',displayName: 'Role', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150},
{field : 'resourceStatus',displayName: 'Allocation Status', enableColumnMenu: false, enableSorting: false,minWidth : 100,width: 150}
] ]
}; };
$http({ $http({
method : "GET", method : "GET",
url : appConfig.appUri + "resources/billing?employeeId="+$scope.profile.employeeId url : appConfig.appUri + "resources/billing?employeeId="+$scope.profile.employeeId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
//alert("response"+response);
// alert("response"+response.data);
$scope.gridOptionsEmpBillability.data = response.data; $scope.gridOptionsEmpBillability.data = response.data;
if(response.data.length > 10){
$scope.gridOptions.enablePaginationControls = true;
}
else{
$scope.gridOptions.enablePaginationControls = false;
}
}, function myError(response) { }, function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
}); });
...@@ -308,9 +311,13 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export ...@@ -308,9 +311,13 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
method : "GET", method : "GET",
url : appConfig.appUri + "resources/getMyProjectAllocations?employeeId="+$scope.profile.employeeId url : appConfig.appUri + "resources/getMyProjectAllocations?employeeId="+$scope.profile.employeeId
}).then(function mySuccess(response) { }).then(function mySuccess(response) {
//alert("response"+response);
// alert("response"+response.data);
$scope.gridOptionsProjectAllocatons.data = response.data.records; $scope.gridOptionsProjectAllocatons.data = response.data.records;
if(response.data.records.length > 10){
$scope.gridOptions.enablePaginationControls = true;
}
else{
$scope.gridOptions.enablePaginationControls = false;
}
}, function myError(response) { }, function myError(response) {
showAlert("Something went wrong while fetching data!!!"); showAlert("Something went wrong while fetching data!!!");
}); });
......
...@@ -84,6 +84,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -84,6 +84,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope.refreshPage = function () { $scope.refreshPage = function () {
$scope.empSearchId = ""; $scope.empSearchId = "";
$scope.getProjects(); $scope.getProjects();
...@@ -403,9 +404,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -403,9 +404,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope.projectModel; $scope.projectModel;
$scope.isSecondTab = false; $scope.isSecondTab = false;
$scope.prjctStses=["Active","Completed","On Hold","Proposed"]; $scope.prjctStses=["Active","Completed","On Hold","Proposed"];
$scope.billableStatuses = ["Billable", "Shadow", "Non-Billable", "Reserved", "Trainee"]; $scope.billableStatuses = ["Billable", "Shadow", "Non-Billable", "Trainee"];
$scope.allocationStatuses = ["Engaged" , "Proposed"]; $scope.allocationStatuses = ["Engaged" , "Proposed"];
$scope.empAllocationStatus = 'Engaged'; // $scope.empAllocationStatus = 'Engaged';
$scope.employeeShifts = myFactory.getShifts(); $scope.employeeShifts = myFactory.getShifts();
$scope.deliveryLeadIds = dataToPass.deliveryLeadIds; $scope.deliveryLeadIds = dataToPass.deliveryLeadIds;
var allAccounts = myFactory.getAccounts(); var allAccounts = myFactory.getAccounts();
...@@ -458,6 +459,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -458,6 +459,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope.empBillableStatus = undefined; $scope.empBillableStatus = undefined;
$scope.newBillingStartDate = undefined; $scope.newBillingStartDate = undefined;
$scope.employeeShift = undefined; $scope.employeeShift = undefined;
$scope.empAllocationStatus = undefined;
$scope.employeeModel = {}; $scope.employeeModel = {};
$('.md-datepicker-input')[0].value = null; $('.md-datepicker-input')[0].value = null;
$('.md-datepicker-input')[1].value = null; $('.md-datepicker-input')[1].value = null;
...@@ -479,7 +481,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -479,7 +481,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$('.md-select-value')[0].childNodes[0].innerHTML = null $('.md-select-value')[0].childNodes[0].innerHTML = null
$('.md-select-value')[1].childNodes[0].innerHTML = null $('.md-select-value')[1].childNodes[0].innerHTML = null
$('.md-select-value')[2].childNodes[0].innerHTML = null $('.md-select-value')[2].childNodes[0].innerHTML = null
// $('.md-select-value')[3].childNodes[0].innerHTML = null $('.md-select-value')[3].childNodes[0].innerHTML = null
$('.md-datepicker-input')[0].value = null; $('.md-datepicker-input')[0].value = null;
$('.md-datepicker-input')[1].value = null; $('.md-datepicker-input')[1].value = null;
$('.md-datepicker-input')[2].value = null; $('.md-datepicker-input')[2].value = null;
...@@ -487,6 +490,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -487,6 +490,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
} }
} }
$scope.selectedTab = 0; $scope.selectedTab = 0;
$scope.templateTitle = 'View';
document.getElementsByClassName("md-tab")[1].style.visibility = "hidden" ; document.getElementsByClassName("md-tab")[1].style.visibility = "hidden" ;
document.getElementsByClassName("md-tab")[2].style.visibility = "hidden" ; document.getElementsByClassName("md-tab")[2].style.visibility = "hidden" ;
$scope.isSecondTab = !$scope.isSecondTab; $scope.isSecondTab = !$scope.isSecondTab;
...@@ -836,6 +840,10 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -836,6 +840,10 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
} }
$scope.changeAllocationStatusToEngaged = function (row) { $scope.changeAllocationStatusToEngaged = function (row) {
if(row.billableStatus == "Reserved"){
$scope.alertMsg = 'Please Update Your Billability Status From Reserved and then Move to Engage';
}else {
$scope.alertMsg ='';
var loginEmpId = myFactory.getEmpId(); var loginEmpId = myFactory.getEmpId();
var record = {"id":row.id,"employeeId":row.employeeId,"projectId":row.projectId,"billableStatus":row.billableStatus,"billingEndDate":row.billingEndDate,"resourceRole":row.resourceRole,"billingStartDate":row.billingStartDate,"status":"Engaged"}; var record = {"id":row.id,"employeeId":row.employeeId,"projectId":row.projectId,"billableStatus":row.billableStatus,"billingEndDate":row.billingEndDate,"resourceRole":row.resourceRole,"billingStartDate":row.billingStartDate,"status":"Engaged"};
var urlRequest = appConfig.appUri+ "resources?loginEmpId="+loginEmpId; var urlRequest = appConfig.appUri+ "resources?loginEmpId="+loginEmpId;
...@@ -864,6 +872,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -864,6 +872,8 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}, function myError(response){ }, function myError(response){
$scope.result = "Error"; $scope.result = "Error";
}); });
}
} }
...@@ -997,6 +1007,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -997,6 +1007,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope.getTeamMates = function(){ $scope.getTeamMates = function(){
getProjectDetails($scope.projectId,$scope.status); getProjectDetails($scope.projectId,$scope.status);
$scope.alertMsg = '';
} }
/* $scope.updateTeamMate = function(action, userData){ /* $scope.updateTeamMate = function(action, userData){
$scope.updateTab(); $scope.updateTab();
...@@ -1187,6 +1198,16 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -1187,6 +1198,16 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$('.md-datepicker-input')[3].value = new Date(dataToPass.projectEndDate); $('.md-datepicker-input')[3].value = new Date(dataToPass.projectEndDate);
} }
} }
$scope.changeBillableStatusList = function() {
if($scope.empAllocationStatus == 'Proposed') {
$scope.empBillableStatus = 'Reserved' ;
$scope.billableStatuses = ["Reserved"];
}
else if ($scope.empAllocationStatus == 'Engaged'){
$scope.empBillableStatus = null ; //$scope.billableStatuses ;
$scope.billableStatuses = ["Billable", "Shadow", "Non-Billable", "Trainee"];
}
}
/* $scope.getEditTeammate = function(selectedStatus) { /* $scope.getEditTeammate = function(selectedStatus) {
if(selectedStatus) { if(selectedStatus) {
$scope.showEditDisplay = true; $scope.showEditDisplay = true;
...@@ -1459,6 +1480,10 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -1459,6 +1480,10 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope.alertMsg = "Please select a employee role"; $scope.alertMsg = "Please select a employee role";
angular.element(document.getElementById('empRole')).focus(); angular.element(document.getElementById('empRole')).focus();
} }
else if(action === "Add" && $scope.empAllocationStatus == undefined){
$scope.alertMsg = "Please select a employee Allocation Status";
angular.element(document.getElementById('empAllocationStatus')).focus();
}
else if($scope.empBillableStatus == undefined){ else if($scope.empBillableStatus == undefined){
$scope.alertMsg = "Please select a billable status"; $scope.alertMsg = "Please select a billable status";
angular.element(document.getElementById('empBillableStatus')).focus(); angular.element(document.getElementById('empBillableStatus')).focus();
...@@ -1482,9 +1507,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor ...@@ -1482,9 +1507,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
else if(!(($scope.newBillingStartDate >= new Date(dataToPass.projectStartDate)) && ($scope.newBillingStartDate <= $scope.endDate))){ else if(!(($scope.newBillingStartDate >= new Date(dataToPass.projectStartDate)) && ($scope.newBillingStartDate <= $scope.endDate))){
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between project start date and end date"; $scope.alertMsg = $scope.empBillableStatus + " start date should be in between project start date and end date";
} }
else if (!(($scope.newBillingStartDate >= $scope.parentData.newBillingStartDate) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){ // else if (!(($scope.newBillingStartDate >= $scope.parentData.newBillingStartDate) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between previous Billing start date and end date"; // $scope.alertMsg = $scope.empBillableStatus + " start date should be in between previous Billing start date and end date";
} // }
else if($scope.endDate > new Date(dataToPass.projectEndDate)){ else if($scope.endDate > new Date(dataToPass.projectEndDate)){
$scope.alertMsg = "End date should not exceed project end date"; $scope.alertMsg = "End date should not exceed project end date";
} }
......
...@@ -195,7 +195,7 @@ ...@@ -195,7 +195,7 @@
<div class="row col-lg-12" style="margin-left: 0px;"> <div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridProjectAllocatons" ui-grid="gridOptionsProjectAllocatons" <div id="gridProjectAllocatons" ui-grid="gridOptionsProjectAllocatons"
class="myGrid" style="width:99%;height:200px;" ng-show="showProjectAllocations"> class="myGrid" style="width:85%;height:200px;" ng-show="showProjectAllocations">
<div class="watermark" ng-show="!gridOptionsProjectAllocatons.data.length">No <div class="watermark" ng-show="!gridOptionsProjectAllocatons.data.length">No
data available</div> data available</div>
</div> </div>
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
<legend style="font-size: 18px;">Billability Details <i style="margin-top:3px;color:blue;cursor:pointer;font-size: 14px;" ng-click="toggleBillability()">{{showOrHideBD}}</i></legend> <legend style="font-size: 18px;">Billability Details <i style="margin-top:3px;color:blue;cursor:pointer;font-size: 14px;" ng-click="toggleBillability()">{{showOrHideBD}}</i></legend>
<div class="row col-lg-12" style="margin-left: 0px;"> <div class="row col-lg-12" style="margin-left: 0px;">
<div id="gridEmpBillability" ui-grid="gridOptionsEmpBillability" <div id="gridEmpBillability" ui-grid="gridOptionsEmpBillability"
class="myGrid" style="width:99%;height:200px;" ng-show="showBillable"> class="myGrid" style="width:85%;height:200px;" ng-show="showBillable">
<div class="watermark" ng-show="!gridOptionsEmpBillability.data.length">No <div class="watermark" ng-show="!gridOptionsEmpBillability.data.length">No
data available</div> data available</div>
</div> </div>
......
...@@ -141,11 +141,21 @@ ...@@ -141,11 +141,21 @@
</td> </td>
</tr> --> </tr> -->
<tr> <tr>
<td class="Employee">Allocation Status</td>
<td>
<md-select ng-model="empAllocationStatus " md-selected-text="getSelectedAllocationStatus()" id="empAllocationStatus" name="empAllocationStatus" ng-change="changeBillableStatusList()">
<md-optgroup label="allocation statuses ">
<md-option ng-value="allocationStatus " ng-repeat="allocationStatus in allocationStatuses ">{{allocationStatus}}</md-option>
</md-optgroup>
</md-select>
</td>
</tr>
<tr ng-show="empAllocationStatus">
<td class="Employee">Billability Status</td> <td class="Employee">Billability Status</td>
<td> <td>
<md-select ng-model="empBillableStatus " md-selected-text="getSelectedBillableStatus() " id="empBillableStatus" name="empBillableStatus" ng-change="changeEmpBillableStatus()"> <md-select ng-model="empBillableStatus " md-selected-text="getSelectedBillableStatus() " id="empBillableStatus" name="empBillableStatus" ng-change="changeEmpBillableStatus()">
<md-optgroup label="billable statuses "> <md-optgroup label="billable statuses ">
<md-option ng-value="billableStatus " ng-repeat="billableStatus in billableStatuses ">{{billableStatus}}</md-option> <md-option ng-value="billableStatus " ng-repeat="billableStatus in billableStatuses">{{billableStatus}}</md-option>
</md-optgroup> </md-optgroup>
</md-select> </md-select>
</td> </td>
...@@ -172,16 +182,6 @@ ...@@ -172,16 +182,6 @@
onkeydown="return false " name="endDate"></md-datepicker> onkeydown="return false " name="endDate"></md-datepicker>
</td> </td>
</tr> </tr>
<tr>
<td class="Employee">Allocation Status</td>
<td>
<md-select ng-model="empAllocationStatus " md-selected-text="getSelectedAllocationStatus() " id="empAllocationStatus" name="empAllocationStatus">
<md-optgroup label="allocation statuses ">
<md-option ng-value="allocationStatus " ng-repeat="allocationStatus in allocationStatuses ">{{allocationStatus}}</md-option>
</md-optgroup>
</md-select>
</td>
</tr>
</table> </table>
<div ng-if ='templateTitle == "Add"' role="alert"> <div ng-if ='templateTitle == "Add"' role="alert">
......
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