1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.document.validation.impl;
17
18 import static org.kuali.ole.sys.OLEPropertyConstants.REVERSAL_DATE;
19 import static org.kuali.ole.sys.document.validation.impl.AccountingDocumentRuleBaseConstants.ERROR_PATH.DOCUMENT_ERROR_PREFIX;
20
21 import org.kuali.ole.fp.document.PreEncumbranceDocument;
22 import org.kuali.ole.sys.document.service.AccountingDocumentRuleHelperService;
23 import org.kuali.ole.sys.document.validation.GenericValidation;
24 import org.kuali.ole.sys.document.validation.event.AttributedDocumentEvent;
25
26
27
28
29 public class PreEncumbranceReversalDateValidation extends GenericValidation {
30 private AccountingDocumentRuleHelperService accountingDocumentRuleHelperService;
31 private PreEncumbranceDocument accountingDocumentForValidation;
32
33
34
35
36
37
38 public boolean validate(AttributedDocumentEvent event) {
39 java.sql.Date reversalDate = getAccountingDocumentForValidation().getReversalDate();
40
41 return accountingDocumentRuleHelperService.isValidReversalDate(reversalDate, DOCUMENT_ERROR_PREFIX + REVERSAL_DATE);
42 }
43
44
45
46
47
48 public AccountingDocumentRuleHelperService getAccountingDocumentRuleHelperService() {
49 return accountingDocumentRuleHelperService;
50 }
51
52
53
54
55
56 public void setAccountingDocumentRuleHelperService(AccountingDocumentRuleHelperService accountingDocumentRuleHelperService) {
57 this.accountingDocumentRuleHelperService = accountingDocumentRuleHelperService;
58 }
59
60
61
62
63
64 public PreEncumbranceDocument getAccountingDocumentForValidation() {
65 return accountingDocumentForValidation;
66 }
67
68
69
70
71
72 public void setAccountingDocumentForValidation(PreEncumbranceDocument accountingDocumentForValidation) {
73 this.accountingDocumentForValidation = accountingDocumentForValidation;
74 }
75
76
77
78 }