1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.select.document;
17
18 import org.kuali.ole.fp.businessobject.GECSourceAccountingLine;
19 import org.kuali.ole.fp.businessobject.GECTargetAccountingLine;
20 import org.kuali.ole.fp.document.GeneralErrorCorrectionDocument;
21 import org.kuali.ole.sys.OLEConstants;
22
23 import java.util.List;
24
25 public class OleGeneralErrorCorrectionDocument extends GeneralErrorCorrectionDocument {
26
27
28
29
30
31
32 @Override
33 public boolean answerSplitNodeQuestion(String nodeName) throws UnsupportedOperationException {
34 if (nodeName.equals(OLEConstants.HAS_VENDOR_DEPOSIT_ACCOUNT))
35 return hasVendorDepositAccount();
36 throw new UnsupportedOperationException("Cannot answer split question for this node you call \"" + nodeName + "\"");
37 }
38
39 private boolean hasVendorDepositAccount() {
40 List<GECSourceAccountingLine> sourceAccounts = this.getSourceAccountingLines();
41 List<GECTargetAccountingLine> targetAccounts = this.getTargetAccountingLines();
42 for (GECSourceAccountingLine sourceAccount : sourceAccounts) {
43 if (sourceAccount.getAccount().getSubFundGroupCode().equalsIgnoreCase(OLEConstants.CLEARING_ACCOUNT_CODE)) {
44 return true;
45 }
46 }
47 for (GECTargetAccountingLine targetAccount : targetAccounts) {
48 if (targetAccount.getAccount().getSubFundGroupCode().equalsIgnoreCase(OLEConstants.CLEARING_ACCOUNT_CODE)) {
49 return true;
50 }
51 }
52 return false;
53 }
54
55 }