View Javadoc
1   /*
2    * The Kuali Financial System, a comprehensive financial management system for higher education.
3    * 
4    * Copyright 2005-2014 The Kuali Foundation
5    * 
6    * This program is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Affero General Public License as
8    * published by the Free Software Foundation, either version 3 of the
9    * License, or (at your option) any later version.
10   * 
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Affero General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Affero General Public License
17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  
20  package org.kuali.kfs.module.ld.businessobject;
21  
22  import static org.kuali.kfs.sys.KFSPropertyConstants.ACCOUNT_NUMBER;
23  import static org.kuali.kfs.sys.KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE;
24  import static org.kuali.kfs.sys.KFSPropertyConstants.FINANCIAL_OBJECT_CODE;
25  import static org.kuali.kfs.sys.KFSPropertyConstants.FINANCIAL_SUB_OBJECT_CODE;
26  import static org.kuali.kfs.sys.KFSPropertyConstants.ORGANIZATION_REFERENCE_ID;
27  import static org.kuali.kfs.sys.KFSPropertyConstants.POSITION_NUMBER;
28  import static org.kuali.kfs.sys.KFSPropertyConstants.PROJECT_CODE;
29  import static org.kuali.kfs.sys.KFSPropertyConstants.SUB_ACCOUNT_NUMBER;
30  
31  import org.kuali.kfs.module.ld.LaborPropertyConstants;
32  import org.kuali.kfs.sys.KFSPropertyConstants;
33  import org.kuali.kfs.sys.businessobject.AccountingLineParserBase;
34  
35  /**
36   * Labor Extended class for parsing serialized <code>AccountingLine</code>s for <code>TransactionalDocument</code>s
37   */
38  public class LaborLedgerAccountingLineParser extends AccountingLineParserBase {
39  
40      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 };
41  
42      /**
43       * Constructs a LaborLedgerAccountingLineParser.java.
44       */
45      public LaborLedgerAccountingLineParser() {
46      }
47  
48      /**
49       * Gets the LABOR_LEDGER_FORMAT the SourceAccountingLineFormat.
50       * 
51       * @return Returns the LABOR_LEDGER_FORMAT.
52       * @see org.kuali.rice.krad.bo.AccountingLineParser#getSourceAccountingLineFormat()
53       */
54      @Override
55      public String[] getSourceAccountingLineFormat() {
56          return removeChartFromFormatIfNeeded(LABOR_LEDGER_FORMAT);
57      }
58  
59      /**
60       * Gets the LABOR_LEDGER_FORMAT the TargetAccountingLineFormat.
61       * 
62       * @return Returns the LABOR_LEDGER_FORMAT.
63       * @see org.kuali.rice.krad.bo.AccountingLineParser#getTargetAccountingLineFormat()
64       */
65      @Override
66      public String[] getTargetAccountingLineFormat() {
67          return removeChartFromFormatIfNeeded(LABOR_LEDGER_FORMAT);
68      }
69  
70  }