1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.core.earncode.validation;
17
18 import org.kuali.kpme.core.api.earncode.EarnCodeContract;
19 import org.kuali.kpme.core.bo.HrBusinessObject;
20 import org.kuali.kpme.core.earncode.EarnCodeBo;
21 import org.kuali.kpme.core.service.HrServiceLocator;
22 import org.kuali.kpme.core.util.TKUtils;
23 import org.kuali.kpme.core.web.KPMEHrObjectNewerVersionPromptBase;
24
25 public class EarnCodeEffectiveDatePrompt extends KPMEHrObjectNewerVersionPromptBase {
26
27 @Override
28 protected boolean doesNewerVersionExist(HrBusinessObject pbo) {
29 boolean futureEffectiveDateExists = false;
30
31 EarnCodeBo earnCode = (EarnCodeBo) pbo;
32 EarnCodeContract lastEarnCode = HrServiceLocator.getEarnCodeService().getEarnCode(earnCode.getEarnCode(), TKUtils.END_OF_TIME);
33 if (lastEarnCode != null && lastEarnCode.getEffectiveLocalDate() != null && earnCode.getEffectiveLocalDate() != null) {
34 futureEffectiveDateExists = lastEarnCode.getEffectiveLocalDate().isAfter(earnCode.getEffectiveLocalDate());
35 }
36
37 return futureEffectiveDateExists;
38 }
39
40 }