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 org.kuali.ole.fp.businessobject.Check;
19 import org.kuali.ole.sys.OLEKeyConstants;
20 import org.kuali.ole.sys.OLEPropertyConstants;
21 import org.kuali.ole.sys.document.validation.GenericValidation;
22 import org.kuali.ole.sys.document.validation.event.AttributedDocumentEvent;
23 import org.kuali.rice.krad.util.GlobalVariables;
24
25
26
27
28 public class CashReceiptCheckAmountPositiveValidation extends GenericValidation {
29 private Check checkForValidation;
30
31
32
33
34
35 public boolean validate(AttributedDocumentEvent event) {
36 if (getCheckForValidation().getAmount().isNegative()) {
37 GlobalVariables.getMessageMap().putError(OLEPropertyConstants.CHECK_AMOUNT, OLEKeyConstants.CashReceipt.ERROR_NEGATIVE_CHECK_AMOUNT, OLEPropertyConstants.CHECKS);
38 return false;
39 }
40 return true;
41 }
42
43
44
45
46
47 public Check getCheckForValidation() {
48 return checkForValidation;
49 }
50
51
52
53
54
55 public void setCheckForValidation(Check checkForValidation) {
56 this.checkForValidation = checkForValidation;
57 }
58 }