1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.document.validation.impl;
17
18 import org.kuali.ole.module.purap.PurapConstants;
19 import org.kuali.ole.module.purap.businessobject.PurApAccountingLine;
20 import org.kuali.ole.select.OleSelectConstant;
21 import org.kuali.ole.select.constants.OleSelectPropertyConstants;
22 import org.kuali.ole.sys.businessobject.AccountingLine;
23 import org.kuali.ole.sys.document.validation.GenericValidation;
24 import org.kuali.ole.sys.document.validation.event.AttributedDocumentEvent;
25 import org.kuali.rice.krad.util.GlobalVariables;
26
27 public class PurchasingAccountingLinePercentValidation extends GenericValidation {
28
29 private AccountingLine updatedAccountingLine;
30
31 @Override
32 public boolean validate(AttributedDocumentEvent event) {
33 boolean valid = true;
34
35
36
37
38
39
40
41
42
43 return valid;
44 }
45
46 public AccountingLine getUpdatedAccountingLine() {
47 return updatedAccountingLine;
48 }
49
50 public void setUpdatedAccountingLine(AccountingLine updatedAccountingLine) {
51 this.updatedAccountingLine = updatedAccountingLine;
52 }
53
54
55
56
57
58
59
60 public boolean validatePercent() {
61 boolean valid = true;
62 PurApAccountingLine purapAccountingLine = (PurApAccountingLine) updatedAccountingLine;
63
64 if (purapAccountingLine.getAccountLinePercent().intValue() > OleSelectConstant.ACCOUNTINGLINE_PERCENT_HUNDRED) {
65 GlobalVariables.getMessageMap().putError(PurapConstants.ITEM_TAB_ERROR_PROPERTY, OleSelectPropertyConstants.ERROR_ACCOUNTINGLINE_PERCENT_GT_HUNDRED);
66 valid = false;
67 }
68 return valid;
69
70 }
71
72 }