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.OLEKeyConstants.AuxiliaryVoucher.ERROR_INVALID_ACCRUAL_REVERSAL_DATE;
19 import static org.kuali.ole.sys.OLEPropertyConstants.REVERSAL_DATE;
20
21 import org.kuali.ole.fp.document.AuxiliaryVoucherDocument;
22 import org.kuali.ole.sys.document.validation.GenericValidation;
23 import org.kuali.ole.sys.document.validation.event.AttributedDocumentEvent;
24 import org.kuali.rice.krad.util.GlobalVariables;
25
26
27
28
29 public class AuxiliaryVoucherReversalDateValidation extends GenericValidation {
30 private AuxiliaryVoucherDocument auxiliaryVoucherDocumentForValidation;
31
32
33
34
35
36 public boolean validate(AttributedDocumentEvent event) {
37 if (getAuxiliaryVoucherDocumentForValidation().isAccrualType() && getAuxiliaryVoucherDocumentForValidation().getReversalDate() == null) {
38 GlobalVariables.getMessageMap().putError(REVERSAL_DATE, ERROR_INVALID_ACCRUAL_REVERSAL_DATE);
39 return false;
40 }
41
42 return true;
43 }
44
45
46
47
48
49 public AuxiliaryVoucherDocument getAuxiliaryVoucherDocumentForValidation() {
50 return auxiliaryVoucherDocumentForValidation;
51 }
52
53
54
55
56
57 public void setAuxiliaryVoucherDocumentForValidation(AuxiliaryVoucherDocument auxiliaryVoucherForValidation) {
58 this.auxiliaryVoucherDocumentForValidation = auxiliaryVoucherForValidation;
59 }
60 }