Commit fc48b286 authored by Prayas Jain's avatar Prayas Jain

Updated validation in employee substatus dates

parent bcf385b7
......@@ -441,7 +441,6 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}
$scope.validateFields = function(){
console.log($scope.subStatusStartDate)
var today = new Date();
if($scope.templateTitle == "Add"){
......@@ -495,11 +494,11 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.alertMsg = "Please select a Date Of Joining";
document.getElementById('dateOfJoining').focus();
}
else if(subStatusStartDate == undefined){
else if($scope.templateTitle != "Add" && subStatusStartDate == undefined && empSubStatus != null && empSubStatus != ''){
$scope.alertMsg = "Please select a SubStatus start Date";
document.getElementById('subStatusStartDate').focus();
}
else if(subStatusEndDate == undefined){
else if($scope.templateTitle != "Add" && subStatusStartDate == undefined && empSubStatus != null && empSubStatus != ''){
$scope.alertMsg = "Please select a SubStatus end Date";
document.getElementById('subStatusEndDate').focus();
}
......@@ -556,7 +555,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope.alertMsg = "Please select the exit date less than or equal to current date";
document.getElementById('hasB1').focus();
}
else if (subStatusStartDate >= subStatusEndDate){
else if (subStatusStartDate >= subStatusEndDate && empSubStatus != null && empSubStatus != ''){
$scope.alertMsg = "Start date should not be greater than end date";
}else{
$scope.alertMsg = "";
......
......@@ -605,7 +605,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
};
$scope.status = "Active";
var employeeModel = $scope.employeeModel;
var getCellTemplate1 = '<p class="col-lg-12"><i ng-show="!row.entity.editrow" class="fa fa-pencil-square-o fa-2x" data-placement="center" title="Edit" onmouseenter="$(this).tooltip(\'show\')" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.edit(row)"></i>'+
var getCellTemplate1 = '<p class="col-lg-12"><i ng-show="grid.appScope.showEditIcon(row.entity)" class="fa fa-pencil-square-o fa-2x" data-placement="center" title="Edit" onmouseenter="$(this).tooltip(\'show\')" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.edit(row)"></i>'+
'<i ng-show="row.entity.editrow" class="fa fa-save fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Save" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.saveRow(row.entity,\'Update\')"></i>'
+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i ng-show="row.entity.editrow" id="cancelEdit" class="fa fa-times fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Cancel" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.cancelEdit(row.entity)"></i>'
+'<i ng-show="grid.appScope.showMoveToBenchIcon(row.entity) && !row.entity.editrow" id="moveResource" class="fa fa-arrow-circle-right fa-2x" aria-hidden="true" style="font-size:1.8em;margin-top:3px;cursor:pointer;" data-placement="center" title="Release" onmouseenter="$(this).tooltip(\'show\')" ng-click="grid.appScope.moveToBench(row.entity)"></i>'+
......@@ -689,12 +689,12 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
});
$scope.showMoveToBenchIcon = function(row){
if($scope.status == 'InActive' && row.status == 'Engaged'){
if(row.billingEndDate < new Date() && row.status == 'Engaged'){
return true;
}
}
$scope.showEditIcon = function(row) {
if(row.status =="Engaged" && !row.editrow ) {
if(row.status !="Released" && !row.editrow ) {
return true;
}
}
......
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