Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
mytime
Commits
75ca5ce0
Commit
75ca5ce0
authored
Jun 24, 2019
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addded validation in Billing start date and end date
parent
dc7b673f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
10 deletions
+19
-10
ResourceService.java
...n/java/com/nisum/myteam/service/impl/ResourceService.java
+2
-2
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+14
-5
projectTeamDetails.html
src/main/webapp/WEB-INF/templates/projectTeamDetails.html
+3
-3
No files found.
src/main/java/com/nisum/myteam/service/impl/ResourceService.java
View file @
75ca5ce0
...
...
@@ -226,14 +226,14 @@ public class ResourceService implements IResourceService {
Project
project
=
projectService
.
getProjectByProjectId
(
resource
.
getProjectId
());
log
.
info
(
"Project::"
+
project
);
if
(!
resource
.
getBillingStartDate
().
after
(
project
.
getProjectStartDate
()
))
{
if
(!
(
resource
.
getBillingStartDate
().
compareTo
(
project
.
getProjectStartDate
())>=
0
))
{
log
.
info
(
"Billing start date should be after Project start date"
);
respMap
.
put
(
"statusCode"
,
811
);
respMap
.
put
(
"message"
,
"Billing start date should be after Project start date"
);
isValid
=
false
;
}
if
(!
resource
.
getBillingStartDate
().
before
(
resource
.
getBillingEndDate
()
))
{
if
(!
(
resource
.
getBillingStartDate
().
compareTo
(
resource
.
getBillingEndDate
())<=
0
))
{
log
.
info
(
"Billing start date should be before Billing End Date."
);
respMap
.
put
(
"statusCode"
,
812
);
respMap
.
put
(
"message"
,
"Billing start date should be before Billing End Date."
);
...
...
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
75ca5ce0
...
...
@@ -661,9 +661,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
'Trainee'
]
},
{
name
:
'billingStartDate'
,
width
:
"*"
,
displayName
:
'Start Date'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
enableFiltering
:
false
,
width
:
160
,
cellTemplate
:
'<div class="ui-grid-cell-contents" ng-if="!row.entity.editrow">{{COL_FIELD | date:"dd-MMM-yyyy"}}</div><div ng-if="row.entity.editrow"><md-datepicker ng-model="MODEL_COL_FIELD" md-placeholder="Select Date" id="newBillingStartDate" name="newBillingStartDate" md-min-date="grid.appScope.minBilling
Date" md-max-date="grid.appScope.maxBilling
Date"></md-datepicker></div>'
},
cellTemplate
:
'<div class="ui-grid-cell-contents" ng-if="!row.entity.editrow">{{COL_FIELD | date:"dd-MMM-yyyy"}}</div><div ng-if="row.entity.editrow"><md-datepicker ng-model="MODEL_COL_FIELD" md-placeholder="Select Date" id="newBillingStartDate" name="newBillingStartDate" md-min-date="grid.appScope.minBilling
StartDate" md-max-date="grid.appScope.maxBillingStart
Date"></md-datepicker></div>'
},
{
field
:
'billingEndDate'
,
width
:
"*"
,
displayName
:
'End Date'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
enableFiltering
:
false
,
width
:
160
,
cellTemplate
:
'<div class="ui-grid-cell-contents" ng-if="!row.entity.editrow">{{COL_FIELD | date:"dd-MMM-yyyy"}}</div><div ng-if="row.entity.editrow"><md-datepicker ng-model="MODEL_COL_FIELD" md-placeholder="Select Date" id="endDate" name="endDate" md-min-date="row.entity.billingStartDate" md-max-date="grid.appScope.maxBillingDate"></md-datepicker></div>'
},
cellTemplate
:
'<div class="ui-grid-cell-contents" ng-if="!row.entity.editrow">{{COL_FIELD | date:"dd-MMM-yyyy"}}</div><div ng-if="row.entity.editrow"><md-datepicker ng-model="MODEL_COL_FIELD" md-placeholder="Select Date" id="endDate" name="endDate" md-min-date="row.entity.billingStartDate" md-max-date="grid.appScope.maxBilling
End
Date"></md-datepicker></div>'
},
{
name
:
'Actions'
,
width
:
140
,
displayName
:
'Actions'
,
cellTemplate
:
getCellTemplate1
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
}
]
};
...
...
@@ -747,6 +747,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
edit
=
function
(
rowd
)
{
$scope
.
minBillingStartDate
=
new
Date
(
$scope
.
projectStartDate
);
$scope
.
maxBillingStartDate
=
new
Date
(
$scope
.
projectEndDate
);
$scope
.
maxBillingEndDate
=
new
Date
(
$scope
.
projectEndDate
);
var
row
=
rowd
.
entity
;
var
index
=
$scope
.
gridOptions
.
data
.
indexOf
(
row
);
if
(
$scope
.
previousRow
){
...
...
@@ -1219,12 +1222,19 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}
$scope
.
changeBillableStatusList
=
function
()
{
if
(
$scope
.
empAllocationStatus
==
'Proposed'
)
{
$scope
.
empBillableStatus
=
'Reserved'
;
$scope
.
billableStatuses
=
[
"Reserved"
];
}
$scope
.
minBillingStartDate
=
new
Date
();
$scope
.
maxBillingStartDate
=
new
Date
(
$scope
.
projectEndDate
);
$scope
.
maxBillingEndDate
=
new
Date
(
$scope
.
projectEndDate
)
}
else
if
(
$scope
.
empAllocationStatus
==
'Engaged'
){
$scope
.
empBillableStatus
=
null
;
//$scope.billableStatuses ;
$scope
.
billableStatuses
=
[
"Billable"
,
"Shadow"
,
"Non-Billable"
,
"Trainee"
];
$scope
.
minBillingStartDate
=
new
Date
(
$scope
.
projectStartDate
);
$scope
.
maxBillingStartDate
=
new
Date
();
$scope
.
maxBillingEndDate
=
new
Date
(
$scope
.
projectEndDate
);
}
}
/* $scope.getEditTeammate = function(selectedStatus) {
...
...
@@ -2001,7 +2011,6 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}
return
false
;
}
$scope
.
minBillingDate
=
new
Date
(
$scope
.
projectStartDate
);
$scope
.
maxBillingDate
=
new
Date
(
$scope
.
projectEndDate
);
}
});
src/main/webapp/WEB-INF/templates/projectTeamDetails.html
View file @
75ca5ce0
...
...
@@ -163,8 +163,8 @@
<tr
ng-show=
"empBillableStatus"
>
<td
class=
"Employee"
>
{{empBillableStatus}} Start Date
</td>
<td>
<md-datepicker
ng-model=
"newBillingStartDate"
md-placeholder=
"Please select Date "
id=
"newBillingStartDate "
md-min-date=
"minBillingDate"
md-max-date=
"maxBillingDate"
onkeydown=
"return false "
ng-change=
"currentBillabilityDateChange()"
name=
"newBillingStartDate"
></md-datepicker>
<md-datepicker
ng-model=
"newBillingStartDate"
md-placeholder=
"Please select Date "
id=
"newBillingStartDate "
md-min-date=
"minBilling
Start
Date"
md-max-date=
"maxBilling
Start
Date"
onkeydown=
"return false "
ng-change=
"currentBillabilityDateChange()"
name=
"newBillingStartDate"
></md-datepicker>
</td>
</tr>
<!-- <tr>
...
...
@@ -178,7 +178,7 @@
<tr
ng-show=
"empBillableStatus"
>
<td
class=
"Employee"
>
{{empBillableStatus}} End Date
</td>
<td>
<md-datepicker
ng-model=
"endDate"
md-placeholder=
"Please select Date"
id=
"endDate "
md-min-date=
"newBillingStartDate "
md-max-date=
"maxBillingDate"
<md-datepicker
ng-model=
"endDate"
md-placeholder=
"Please select Date"
id=
"endDate "
md-min-date=
"newBillingStartDate "
md-max-date=
"maxBilling
End
Date"
onkeydown=
"return false "
name=
"endDate"
></md-datepicker>
</td>
</tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment