1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.coa.document.validation.impl;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.ole.coa.businessobject.Account;
20 import org.kuali.ole.coa.businessobject.IndirectCostRecoveryExclusionAccount;
21 import org.kuali.rice.kns.document.MaintenanceDocument;
22 import org.kuali.rice.krad.util.ObjectUtils;
23
24
25
26
27
28 public class IndirectCostRecoveryExclusionAccountPreRules extends MaintenancePreRulesBase {
29
30 protected IndirectCostRecoveryExclusionAccount indirectCostRecoveryExclusionAccount;
31
32
33 public IndirectCostRecoveryExclusionAccountPreRules() {
34
35 }
36
37
38
39
40
41
42
43 protected boolean doCustomPreRules(MaintenanceDocument document) {
44 setupConvenienceObjects(document);
45 checkForContinuationAccounts();
46
47 LOG.debug("done with continuation account, proceeeding with remaining pre rules");
48
49
50 return true;
51 }
52
53
54
55
56 protected void checkForContinuationAccounts() {
57 LOG.debug("entering checkForContinuationAccounts()");
58
59 if (StringUtils.isNotBlank(indirectCostRecoveryExclusionAccount.getAccountNumber())) {
60 Account account = checkForContinuationAccount("Account Number", indirectCostRecoveryExclusionAccount.getChartOfAccountsCode(), indirectCostRecoveryExclusionAccount.getAccountNumber(), "");
61 if (ObjectUtils.isNotNull(account)) {
62 indirectCostRecoveryExclusionAccount.setAccountNumber(account.getAccountNumber());
63 indirectCostRecoveryExclusionAccount.setChartOfAccountsCode(account.getChartOfAccountsCode());
64 }
65 }
66 }
67
68
69
70
71
72
73
74
75 protected void setupConvenienceObjects(MaintenanceDocument document) {
76
77
78 indirectCostRecoveryExclusionAccount = (IndirectCostRecoveryExclusionAccount) document.getNewMaintainableObject().getBusinessObject();
79 }
80 }