1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.fp.businessobject;
18
19 import static org.kuali.ole.sys.OLEPropertyConstants.ACCOUNT_NUMBER;
20 import static org.kuali.ole.sys.OLEPropertyConstants.AMOUNT;
21 import static org.kuali.ole.sys.OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE;
22 import static org.kuali.ole.sys.OLEPropertyConstants.FINANCIAL_SUB_OBJECT_CODE;
23 import static org.kuali.ole.sys.OLEPropertyConstants.ORGANIZATION_REFERENCE_ID;
24 import static org.kuali.ole.sys.OLEPropertyConstants.PROJECT_CODE;
25 import static org.kuali.ole.sys.OLEPropertyConstants.SUB_ACCOUNT_NUMBER;
26
27 import java.util.Map;
28
29 import org.kuali.ole.fp.document.IndirectCostAdjustmentDocument;
30 import org.kuali.ole.fp.document.validation.impl.IndirectCostAdjustmentDocumentRuleConstants;
31 import org.kuali.ole.sys.businessobject.AccountingLineParserBase;
32 import org.kuali.ole.sys.businessobject.SourceAccountingLine;
33 import org.kuali.ole.sys.businessobject.TargetAccountingLine;
34 import org.kuali.ole.sys.context.SpringContext;
35 import org.kuali.rice.coreservice.framework.parameter.ParameterService;
36
37
38
39
40
41
42 public class IndirectCostAdjustmentDocumentAccountingLineParser extends AccountingLineParserBase {
43 protected static final String[] ICA_FORMAT = { CHART_OF_ACCOUNTS_CODE, ACCOUNT_NUMBER, SUB_ACCOUNT_NUMBER, FINANCIAL_SUB_OBJECT_CODE, PROJECT_CODE, ORGANIZATION_REFERENCE_ID, AMOUNT };
44
45
46
47
48 @Override
49 public String[] getSourceAccountingLineFormat() {
50 return removeChartFromFormatIfNeeded(ICA_FORMAT);
51 }
52
53
54
55
56 @Override
57 public String[] getTargetAccountingLineFormat() {
58 return removeChartFromFormatIfNeeded(ICA_FORMAT);
59 }
60
61
62
63
64
65 @Override
66 protected void performCustomSourceAccountingLinePopulation(Map<String, String> attributeValueMap, SourceAccountingLine sourceAccountingLine, String accountingLineAsString) {
67 super.performCustomSourceAccountingLinePopulation(attributeValueMap, sourceAccountingLine, accountingLineAsString);
68 String financialObjectCode = SpringContext.getBean(ParameterService.class).getParameterValueAsString(IndirectCostAdjustmentDocument.class, IndirectCostAdjustmentDocumentRuleConstants.GRANT_OBJECT_CODE);
69 sourceAccountingLine.setFinancialObjectCode(financialObjectCode);
70 }
71
72
73
74
75
76 @Override
77 protected void performCustomTargetAccountingLinePopulation(Map<String, String> attributeValueMap, TargetAccountingLine targetAccountingLine, String accountingLineAsString) {
78 super.performCustomTargetAccountingLinePopulation(attributeValueMap, targetAccountingLine, accountingLineAsString);
79 String financialObjectCode = SpringContext.getBean(ParameterService.class).getParameterValueAsString(IndirectCostAdjustmentDocument.class, IndirectCostAdjustmentDocumentRuleConstants.RECEIPT_OBJECT_CODE);
80 targetAccountingLine.setFinancialObjectCode(financialObjectCode);
81 }
82
83 }