001 /* 002 * Copyright 2011 The Kuali Foundation. 003 * 004 * Licensed under the Educational Community License, Version 2.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/ecl2.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.kfs.module.ld.businessobject; 018 019 import static org.kuali.kfs.sys.KFSPropertyConstants.ACCOUNT_NUMBER; 020 import static org.kuali.kfs.sys.KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE; 021 import static org.kuali.kfs.sys.KFSPropertyConstants.FINANCIAL_OBJECT_CODE; 022 import static org.kuali.kfs.sys.KFSPropertyConstants.FINANCIAL_SUB_OBJECT_CODE; 023 import static org.kuali.kfs.sys.KFSPropertyConstants.ORGANIZATION_REFERENCE_ID; 024 import static org.kuali.kfs.sys.KFSPropertyConstants.POSITION_NUMBER; 025 import static org.kuali.kfs.sys.KFSPropertyConstants.PROJECT_CODE; 026 import static org.kuali.kfs.sys.KFSPropertyConstants.SUB_ACCOUNT_NUMBER; 027 028 import org.kuali.kfs.module.ld.LaborPropertyConstants; 029 import org.kuali.kfs.sys.KFSPropertyConstants; 030 import org.kuali.kfs.sys.businessobject.AccountingLine; 031 import org.kuali.kfs.sys.businessobject.AccountingLineParserBase; 032 import org.kuali.kfs.sys.businessobject.SourceAccountingLine; 033 import org.kuali.kfs.sys.businessobject.TargetAccountingLine; 034 035 /** 036 * Labor Extended class for parsing serialized <code>AccountingLine</code>s for <code>TransactionalDocument</code>s 037 */ 038 public class LaborLedgerAccountingLineParser extends AccountingLineParserBase { 039 040 protected static final String[] LABOR_LEDGER_FORMAT = { CHART_OF_ACCOUNTS_CODE, ACCOUNT_NUMBER, SUB_ACCOUNT_NUMBER, FINANCIAL_OBJECT_CODE, FINANCIAL_SUB_OBJECT_CODE, PROJECT_CODE, ORGANIZATION_REFERENCE_ID, POSITION_NUMBER, LaborPropertyConstants.PAYROLL_END_DATE_FISCAL_YEAR, LaborPropertyConstants.PAYROLL_END_DATE_FISCAL_PERIOD_CODE, LaborPropertyConstants.PAYROLL_TOTAL_HOURS, KFSPropertyConstants.AMOUNT }; 041 042 /** 043 * Constructs a LaborLedgerAccountingLineParser.java. 044 */ 045 public LaborLedgerAccountingLineParser() { 046 } 047 048 /** 049 * Gets the LABOR_LEDGER_FORMAT the SourceAccountingLineFormat. 050 * 051 * @return Returns the LABOR_LEDGER_FORMAT. 052 * @see org.kuali.rice.kns.bo.AccountingLineParser#getSourceAccountingLineFormat() 053 */ 054 @Override 055 public String[] getSourceAccountingLineFormat() { 056 return removeChartFromFormatIfNeeded(LABOR_LEDGER_FORMAT); 057 } 058 059 /** 060 * Gets the LABOR_LEDGER_FORMAT the TargetAccountingLineFormat. 061 * 062 * @return Returns the LABOR_LEDGER_FORMAT. 063 * @see org.kuali.rice.kns.bo.AccountingLineParser#getTargetAccountingLineFormat() 064 */ 065 @Override 066 public String[] getTargetAccountingLineFormat() { 067 return removeChartFromFormatIfNeeded(LABOR_LEDGER_FORMAT); 068 } 069 070 }