001: /*
002: * Copyright 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: package org.kuali.test.fixtures;
017:
018: import org.kuali.module.chart.bo.A21SubAccount;
019: import org.kuali.module.chart.bo.SubAccount;
020:
021: public enum SubAccountFixture {
022: ACTIVE_SUB_ACCOUNT(null, null, null, null, true, null, null, null), INACTIVE_SUB_ACCOUNT(
023: null, null, null, null, false, null, null, null), VALID_SUB_ACCOUNT(
024: "BA", "6044900", "ARREC"), INVALID_SUB_ACCOUNT("ZZ",
025: "0000000", "A"), SUB_ACCOUNT_WITH_REPORTS_TO_ORGANIZATION(
026: "EA", "2367527", "SOCHR", null, true, "EA", "SACT", null), // another
027: // sub
028: // acccount
029: // value
030: // is
031: // SOCON
032: SUB_ACCOUNT_WITHOUT_REPORTS_TO_ORGANIZATION("BL", "1031400", "BLDG"), SUB_ACCOUNT_WITH_BAD_CG_FUND_GROUP(
033: "BL", "2220090", "12345", "A New SubAccount", true, null,
034: null, null), A21_SUB_ACCOUNT_WITH_BAD_CG_ACCOUNT_TYPE("BL",
035: "4831497", "12345", "A New SubAccount", true, null, null,
036: null, "ZZ", null, null, null, null, false, null, null, null), ;
037:
038: private String chartOfAccountsCode;
039: private String accountNumber;
040: private String subAccountNumber;
041: private String subAccountName;
042: private boolean subAccountActiveIndicator;
043: private String financialReportChartCode;
044: private String finReportOrganizationCode;
045: private String financialReportingCode;
046:
047: private A21SubAccount a21;
048:
049: /**
050: * Constructs a SubAccountFixture.java.
051: *
052: * @param chartOfAccountsCode
053: * @param accountNumber
054: * @param subAccountNumber
055: */
056: private SubAccountFixture(String chartOfAccountsCode,
057: String accountNumber, String subAccountNumber) {
058: this .chartOfAccountsCode = chartOfAccountsCode;
059: this .accountNumber = accountNumber;
060: this .subAccountNumber = subAccountNumber;
061: }
062:
063: /**
064: * Constructs a SubAccountFixture.java in order to create a new Sub Account that includes an A21 Sub Account
065: *
066: * @param chartOfAccountsCode
067: * @param accountNumber
068: * @param subAccountNumber
069: * @param subAccountName
070: * @param subAccountActiveIndicator
071: * @param finReportChartCode
072: * @param finReportOrgCode
073: * @param finReportingCode
074: */
075: private SubAccountFixture(String chartOfAccountsCode,
076: String accountNumber, String subAccountNumber,
077: String subAccountName, boolean subAccountActiveIndicator,
078: String finReportChartCode, String finReportOrgCode,
079: String finReportingCode) {
080: this .chartOfAccountsCode = chartOfAccountsCode;
081: this .accountNumber = accountNumber;
082: this .subAccountNumber = subAccountNumber;
083: this .subAccountName = subAccountName;
084: this .subAccountActiveIndicator = subAccountActiveIndicator;
085: this .financialReportChartCode = finReportChartCode;
086: this .finReportOrganizationCode = finReportOrgCode;
087: this .financialReportingCode = finReportingCode;
088: }
089:
090: /**
091: * Constructs a SubAccountFixture.java in order to create a new Sub Account that includes an A21 Sub Account
092: *
093: * @param chartOfAccountsCode
094: * @param accountNumber
095: * @param subAccountNumber
096: * @param subAccountName
097: * @param subAccountActiveIndicator
098: * @param finReportChartCode
099: * @param finReportOrgCode
100: * @param finReportingCode
101: * @param subAccountTypeCode
102: * @param icrTypeCode
103: * @param finSeriesId
104: * @param icrChartCode
105: * @param icrAccountNumber
106: * @param offCampusCode
107: * @param costShareChartCode
108: * @param costShareAccountNumber
109: * @param costShareSubAccountNumber
110: */
111: private SubAccountFixture(String chartOfAccountsCode,
112: String accountNumber, String subAccountNumber,
113: String subAccountName, boolean subAccountActiveIndicator,
114: String finReportChartCode, String finReportOrgCode,
115: String finReportingCode, String subAccountTypeCode,
116: String icrTypeCode, String finSeriesId,
117: String icrChartCode, String icrAccountNumber,
118: boolean offCampusCode, String costShareChartCode,
119: String costShareAccountNumber,
120: String costShareSubAccountNumber) {
121: this .chartOfAccountsCode = chartOfAccountsCode;
122: this .accountNumber = accountNumber;
123: this .subAccountNumber = subAccountNumber;
124: this .subAccountName = subAccountName;
125: this .subAccountActiveIndicator = subAccountActiveIndicator;
126: this .financialReportChartCode = finReportChartCode;
127: this .finReportOrganizationCode = finReportOrgCode;
128: this .financialReportingCode = finReportingCode;
129:
130: a21 = new A21SubAccount();
131: a21.setChartOfAccountsCode(chartOfAccountsCode);
132: a21.setAccountNumber(accountNumber);
133: a21.setSubAccountTypeCode(subAccountTypeCode);
134: a21.setIndirectCostRecoveryTypeCode(icrTypeCode);
135: a21.setFinancialIcrSeriesIdentifier(finSeriesId);
136: a21.setIndirectCostRecoveryChartOfAccountsCode(icrChartCode);
137: a21.setIndirectCostRecoveryAccountNumber(icrAccountNumber);
138: a21.setOffCampusCode(offCampusCode);
139: a21.setCostShareChartOfAccountCode(costShareChartCode);
140: a21.setCostShareSourceAccountNumber(costShareAccountNumber);
141: a21
142: .setCostShareSourceSubAccountNumber(costShareSubAccountNumber);
143:
144: }
145:
146: public SubAccount createSubAccount() {
147: SubAccount subAccount = new SubAccount();
148: subAccount.setChartOfAccountsCode(chartOfAccountsCode);
149: subAccount.setAccountNumber(accountNumber);
150: subAccount.setSubAccountNumber(subAccountNumber);
151: subAccount.setSubAccountName(subAccountName);
152: subAccount
153: .setSubAccountActiveIndicator(subAccountActiveIndicator);
154: subAccount
155: .setFinancialReportChartCode(financialReportChartCode);
156: subAccount
157: .setFinReportOrganizationCode(finReportOrganizationCode);
158: subAccount.setFinancialReportingCode(financialReportingCode);
159: subAccount.setA21SubAccount(a21);
160: return subAccount;
161: }
162:
163: }
|