001: /*
002: * Copyright 2006-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.kuali.module.financial.bo;
018:
019: import static org.kuali.kfs.KFSPropertyConstants.ACCOUNT_NUMBER;
020: import static org.kuali.kfs.KFSPropertyConstants.AMOUNT;
021: import static org.kuali.kfs.KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE;
022: import static org.kuali.kfs.KFSPropertyConstants.FINANCIAL_SUB_OBJECT_CODE;
023: import static org.kuali.kfs.KFSPropertyConstants.ORGANIZATION_REFERENCE_ID;
024: import static org.kuali.kfs.KFSPropertyConstants.PROJECT_CODE;
025: import static org.kuali.kfs.KFSPropertyConstants.SUB_ACCOUNT_NUMBER;
026:
027: import java.util.Map;
028:
029: import org.kuali.kfs.bo.AccountingLineParserBase;
030: import org.kuali.kfs.bo.SourceAccountingLine;
031: import org.kuali.kfs.bo.TargetAccountingLine;
032: import org.kuali.kfs.context.SpringContext;
033: import org.kuali.kfs.service.ParameterService;
034: import org.kuali.module.financial.document.IndirectCostAdjustmentDocument;
035: import org.kuali.module.financial.rules.IndirectCostAdjustmentDocumentRuleConstants;
036:
037: /**
038: * This class represents an <code>IndirectCostAdjustmentDocument</code> accounting line parser.
039: *
040: * @see org.kuali.module.financial.document.IndirectCostAdjustmentDocument
041: */
042: public class IndirectCostAdjustmentDocumentAccountingLineParser extends
043: AccountingLineParserBase {
044: private static final String[] FORMAT = { CHART_OF_ACCOUNTS_CODE,
045: ACCOUNT_NUMBER, SUB_ACCOUNT_NUMBER,
046: FINANCIAL_SUB_OBJECT_CODE, PROJECT_CODE,
047: ORGANIZATION_REFERENCE_ID, AMOUNT };
048:
049: /**
050: * @see org.kuali.core.bo.AccountingLineParserBase#getSourceAccountingLineFormat()
051: */
052: @Override
053: public String[] getSourceAccountingLineFormat() {
054: return FORMAT;
055: }
056:
057: /**
058: * @see org.kuali.core.bo.AccountingLineParserBase#getTargetAccountingLineFormat()
059: */
060: @Override
061: public String[] getTargetAccountingLineFormat() {
062: return FORMAT;
063: }
064:
065: /**
066: * @see org.kuali.core.bo.AccountingLineParserBase#performCustomSourceAccountingLinePopulation(java.util.Map,
067: * org.kuali.core.bo.SourceAccountingLine, java.lang.String)
068: */
069: @Override
070: protected void performCustomSourceAccountingLinePopulation(
071: Map<String, String> attributeValueMap,
072: SourceAccountingLine sourceAccountingLine,
073: String accountingLineAsString) {
074: super .performCustomSourceAccountingLinePopulation(
075: attributeValueMap, sourceAccountingLine,
076: accountingLineAsString);
077: String financialObjectCode = SpringContext
078: .getBean(ParameterService.class)
079: .getParameterValue(
080: IndirectCostAdjustmentDocument.class,
081: IndirectCostAdjustmentDocumentRuleConstants.GRANT_OBJECT_CODE);
082: sourceAccountingLine
083: .setFinancialObjectCode(financialObjectCode);
084: }
085:
086: /**
087: * @see org.kuali.core.bo.AccountingLineParserBase#performCustomTargetAccountingLinePopulation(java.util.Map,
088: * org.kuali.core.bo.TargetAccountingLine, java.lang.String)
089: */
090: @Override
091: protected void performCustomTargetAccountingLinePopulation(
092: Map<String, String> attributeValueMap,
093: TargetAccountingLine targetAccountingLine,
094: String accountingLineAsString) {
095: super .performCustomTargetAccountingLinePopulation(
096: attributeValueMap, targetAccountingLine,
097: accountingLineAsString);
098: String financialObjectCode = SpringContext
099: .getBean(ParameterService.class)
100: .getParameterValue(
101: IndirectCostAdjustmentDocument.class,
102: IndirectCostAdjustmentDocumentRuleConstants.RECEIPT_OBJECT_CODE);
103: targetAccountingLine
104: .setFinancialObjectCode(financialObjectCode);
105: }
106:
107: }
|