001/*
002 * Copyright 2006 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 */
016package org.kuali.ole.gl;
017
018import java.util.List;
019
020import org.apache.commons.lang.StringUtils;
021import org.kuali.ole.coa.businessobject.A21SubAccount;
022import org.kuali.ole.coa.businessobject.BalanceType;
023import org.kuali.ole.coa.businessobject.ObjectCode;
024import org.kuali.ole.gl.batch.CollectorBatch;
025import org.kuali.ole.gl.businessobject.CollectorDetailFieldUtil;
026import org.kuali.ole.gl.businessobject.OriginEntryFieldUtil;
027import org.kuali.ole.gl.businessobject.OriginEntryFull;
028import org.kuali.ole.sys.OLEPropertyConstants;
029import org.kuali.ole.sys.businessobject.OriginationCode;
030import org.kuali.ole.sys.context.SpringContext;
031import org.kuali.rice.kns.service.DataDictionaryService;
032import org.kuali.rice.krad.datadictionary.AttributeDefinition;
033
034
035/**
036 * This class holds constants specifically for use within the General Ledger module.
037 */
038public class GeneralLedgerConstants {
039
040    public static final String INSERT_CODE = "I";
041    public static final String UPDATE_CODE = "U";
042    public static final String DELETE_CODE = "D";
043    public static final String SELECT_CODE = "S";
044    public static final String EMPTY_CODE = "";
045    public static final String ERROR_CODE = "E";
046    public static final String FINALNCIAL_BALANCE_TYPE_FOR_COLLECTOR_DETAIL_RECORD = "AC";
047
048    //public static final String RETAIN_DAYS = "RETAIN_DAYS";
049
050    public static class DummyBusinessObject {
051        static final public String COST_SHARE_OPTION = "dummyBusinessObject.costShareOption";
052        static final public String PENDING_ENTRY_OPTION = "dummyBusinessObject.pendingEntryOption";
053        static final public String CONSOLIDATION_OPTION = "dummyBusinessObject.consolidationOption";
054        static final public String LINK_BUTTON_OPTION = "dummyBusinessObject.linkButtonOption";
055    }
056
057    public static class PendingEntryOptions {
058        static final public String APPROVED = "Approved";
059        static final public String ALL = "All";
060    }
061
062    public static class ColumnNames {
063        static final public String SUB_ACCOUNT_NUMBER = "SUB_ACCT_NBR";
064        static final public String CURRENT_BDLN_BALANCE_AMOUNT = "CURR_BDLN_BAL_AMT";
065        static final public String ACCOUNTING_LINE_ACTUALS_BALANCE_AMOUNT = "ACLN_ACTLS_BAL_AMT";
066        static final public String ACCOUNTING_LINE_ENCUMBRANCE_BALANCE_AMOUNT = "ACLN_ENCUM_BAL_AMT";
067        static final public String CONSOLIDATION_OBJECT_CODE = "FIN_CONS_OBJ_CD";
068        static final public String REPORT_SORT_CODE = "FIN_REPORT_SORT_CD";
069        static final public String CONSOLIDATION_REPORT_SORT_CODE = "CONS_FIN_REPORT_SORT_CD";
070        static final public String ACCTG_CTGRY_CD = "ACCTG_CTGRY_CD";
071        static final public String OBJECT_LEVEL_CODE = "FIN_OBJ_LVL_CD";
072        static final public String OBJECT_LEVEL_CODE2 = "FIN_OBJ_LEVEL_CD";
073        static final public String OBJECT_CODE = "FIN_OBJECT_CD";
074        // amounts in the balances table
075        static final public String ANNUAL_BALANCE = "ACLN_ANNL_BAL_AMT";
076        static final public String BEGINNING_BALANCE = "FIN_BEG_BAL_LN_AMT";
077        static final public String CONTRACT_AND_GRANTS_BEGINNING_BALANCE = "CONTR_GR_BB_AC_AMT";
078
079        static final public String UNIVERSITY_FISCAL_YEAR = "UNIV_FISCAL_YR";
080        static final public String CHART_OF_ACCOUNTS_CODE = "FIN_COA_CD";
081        static final public String ACCOUNT_NUMBER = "ACCOUNT_NBR";
082        static final public String SUB_OBJECT_CODE = "FIN_SUB_OBJ_CD";
083        static final public String OBJECT_TYPE_CODE = "FIN_OBJ_TYP_CD";
084        static final public String BALANCE_TYPE_CODE = "FIN_BALANCE_TYP_CD";
085        static final public String FISCAL_PERIOD_CODE = "UNIV_FISCAL_PRD_CD";
086        static final public String DEBIT_CREDIT_CODE = "TRN_DEBIT_CRDT_CD";
087        static final public String OBJECT_TYPE_DEBIT_CREDIT_CODE = "FIN_OBJTYP_DBCR_CD";
088        static final public String OFFSET_GENERATION_CODE = "FIN_OFFST_GNRTN_CD";
089        static final public String TRANSACTION_LEDGER_ENTRY_AMOUNT = "TRN_LDGR_ENTR_AMT";
090        static final public String TRANSACTION_DEBIT_CREDIT_CD = "TRN_DEBIT_CRDT_CD";
091
092        static final public String TRANSACTION_DT = "TRANSACTION_DT";
093        static final public String FIN_OBJ_TYP_CODE = "FIN_OBJ_TYP_CODE";
094        static final public String NET_EXP_OBJECT_CD = "NET_EXP_OBJECT_CD";
095        static final public String NET_REV_OBJECT_CD = "NET_REV_OBJECT_CD";
096        static final public String FUND_BAL_OBJ_TYP_CD = "FUND_BAL_OBJ_TYP_CD";
097        static final public String FUND_BAL_OBJECT_CD = "FUND_BAL_OBJECT_CD";
098        static final public String UNIV_DT = "UNIV_DT";
099
100        static final public String FINANCIAL_DOCUMENT_TYPE_CODE = "FDOC_TYP_CD";
101        static final public String ORIGINATION_CODE = "FS_ORIGIN_CD";
102        static final public String DOCUMENT_NUMBER = "FDOC_NBR";
103
104        static final public String CURRENT_BUDGET_LINE_BALANCE_AMOUNT = "CURR_BDLN_BAL_AMT";
105        static final public String ACCOUNT_LINE_ACTUALS_BALANCE_AMOUNT = "ACLN_ACTLS_BAL_AMT";
106        static final public String ACCOUNT_LINE_ENCUMBRANCE_BALANCE_AMOUNT = "ACLN_ENCUM_BAL_AMT";
107
108        static final public String ACCOUNT_LINE_ENCUMBRANCE_AMOUNT = "ACLN_ENCUM_AMT";
109        static final public String ACCOUNT_LINE_ENCUMBRANCE_CLOSED_AMOUNT = "ACLN_ENCUM_CLS_AMT";
110
111        static final public String MONTH_1_ACCT_AMT = "MO1_ACCT_LN_AMT";
112        static final public String MONTH_2_ACCT_AMT = "MO2_ACCT_LN_AMT";
113        static final public String MONTH_3_ACCT_AMT = "MO3_ACCT_LN_AMT";
114        static final public String MONTH_4_ACCT_AMT = "MO4_ACCT_LN_AMT";
115        static final public String MONTH_5_ACCT_AMT = "MO5_ACCT_LN_AMT";
116        static final public String MONTH_6_ACCT_AMT = "MO6_ACCT_LN_AMT";
117        static final public String MONTH_7_ACCT_AMT = "MO7_ACCT_LN_AMT";
118        static final public String MONTH_8_ACCT_AMT = "MO8_ACCT_LN_AMT";
119        static final public String MONTH_9_ACCT_AMT = "MO9_ACCT_LN_AMT";
120        static final public String MONTH_10_ACCT_AMT = "MO10_ACCT_LN_AMT";
121        static final public String MONTH_11_ACCT_AMT = "MO11_ACCT_LN_AMT";
122        static final public String MONTH_12_ACCT_AMT = "MO12_ACCT_LN_AMT";
123        static final public String MONTH_13_ACCT_AMT = "MO13_ACCT_LN_AMT";
124
125    }
126
127    public static class BalanceInquiryDrillDowns {
128        static final public String OBJECT_LEVEL_CODE = "financialObject.financialObjectLevel.financialObjectLevelCode";
129        static final public String REPORTING_SORT_CODE = "financialObject.financialObjectLevel.financialReportingSortCode";
130        static final public String CONSOLIDATION_OBJECT_CODE = "financialObject.financialObjectLevel.financialConsolidationObject.finConsolidationObjectCode";
131    }
132    public static final String BASIC_ACCOUNTING_CATEGORY_REPRESENTING_EXPENSES = "BASIC_ACCOUNTING_CATEGORY_REPRESENTING_EXPENSES";
133
134    public static class LookupableBeanKeys {
135        static final public String PENDING_ENTRY = "glPendingEntryLookupable";
136        public static final String SEGMENTED_LOOKUP_FLAG_NAME = "segmented";
137    }
138
139    public static final String GL_SCRUBBER_GROUP = "ScrubberStep";
140    public static final String GL_ORGANIZATION_REVERSION_SELECTION_GROUP = "OrganizationReversion";
141
142    public static final String ANNUAL_CLOSING_TRANSACTION_DATE_PARM = "ANNUAL_CLOSING_TRANSACTION_DATE";
143    public static final String ANNUAL_CLOSING_FISCAL_YEAR_PARM = "ANNUAL_CLOSING_FISCAL_YEAR";
144    public static final String FISCAL_YEAR_PARM = "FISCAL_YEAR";
145    public static final String ANNUAL_CLOSING_FUND_BALANCE_OBJECT_CODE_PARM = "ANNUAL_CLOSING_FUND_BALANCE_OBJECT_CODE";
146    public static final String ANNUAL_CLOSING_FUND_BALANCE_OBJECT_TYPE_PARM = "ANNUAL_CLOSING_FUND_BALANCE_OBJECT_TYPE";
147    public static final String ANNUAL_CLOSING_DOCUMENT_TYPE = "ANNUAL_CLOSING_DOCUMENT_TYPE";
148
149    public static class GlAccountBalanceGroupParameters {
150        static final public String EXPENSE_OBJECT_TYPE_CODES = "EXPENSE_OBJECT_TYPE_CODES";
151        static final public String EXPENSE_TRANSFER_OBJECT_TYPE_CODES = "EXPENSE_TRANSFER_OBJECT_TYPE_CODES";
152        static final public String INCOME_OBJECT_TYPE_CODES = "INCOME_OBJECT_TYPE_CODES";
153        static final public String INCOME_TRANSFER_OBJECT_TYPE_CODES = "INCOME_TRANSFER_OBJECT_TYPE_CODES";
154    }
155
156    public static class GlScrubberGroupParameters {
157        static final public String CAPITALIZATION_IND = "CAPITALIZATION_IND";
158        static final public String CAPITALIZATION_SUBTYPE_OBJECT = "CAPITALIZATION_OBJECT_CODE_BY_OBJECT_SUB_TYPE";
159
160        static final public String COST_SHARE_OBJECT_CODE_BY_LEVEL_PARM_NM = "COST_SHARE_OBJECT_CODE_BY_OBJECT_LEVEL";
161        static final public String COST_SHARE_OBJECT_CODE_PARM_NM = "COST_SHARE_OBJECT_CODE";
162
163        static final public String LIABILITY_IND = "LIABILITY_IND";
164        static final public String LIABILITY_OBJECT_CODE = "LIABILITY_OBJECT_CODE";
165
166        static final public String PLANT_INDEBTEDNESS_IND = "PLANT_INDEBTEDNESS_IND";
167
168        static final public String SCRUBBER_CUTOFF_TIME = "CUTOFF_TIME";
169    }
170
171    public static class GlScrubberGroupRules {
172        static final public String CAPITALIZATION_DOC_TYPE_CODES = "CAPITALIZATION_DOCUMENT_TYPES";
173        static final public String CAPITALIZATION_FISCAL_PERIOD_CODES = "CAPITALIZATION_FISCAL_PERIODS";
174        static final public String CAPITALIZATION_OBJ_SUB_TYPE_CODES = "CAPITALIZATION_OBJECT_SUB_TYPES";
175        static final public String CAPITALIZATION_SUB_FUND_GROUP_CODES = "CAPITALIZATION_SUB_FUND_GROUPS";
176        static final public String CAPITALIZATION_CHART_CODES = "CAPITALIZATION_CHARTS";
177
178        static final public String COST_SHARE_OBJ_TYPE_CODES = "COST_SHARE_OBJECT_TYPES";
179        static final public String COST_SHARE_FISCAL_PERIOD_CODES = "COST_SHARE_FISCAL_PERIODS";
180
181        static final public String COST_SHARE_ENC_BAL_TYP_CODES = "COST_SHARE_ENCUMBRANCE_BALANCE_TYPES";
182        static final public String COST_SHARE_ENC_DOC_TYPE_CODES = "COST_SHARE_DOCUMENT_TYPES";
183        static final public String COST_SHARE_ENC_FISCAL_PERIOD_CODES = "COST_SHARE_ENCUMBRANCE_FISCAL_PERIODS";
184
185        static final public String LIABILITY_CHART_CODES = "LIABILITY_CHARTS";
186        static final public String LIABILITY_DOC_TYPE_CODES = "LIABILITY_DOCUMENT_TYPES";
187        static final public String LIABILITY_FISCAL_PERIOD_CODES = "LIABILITY_FISCAL_PERIODS";
188        static final public String LIABILITY_OBJ_SUB_TYPE_CODES = "LIABILITY_OBJECT_SUB_TYPES";
189        static final public String LIABILITY_SUB_FUND_GROUP_CODES = "LIABILITY_SUB_FUND_GROUPS";
190
191        static final public String OFFSET_DOC_TYPE_CODES = "OFFSET_GENERATION_DOCUMENT_TYPES";
192        static final public String OFFSET_FISCAL_PERIOD_CODES = "OFFSET_GENERATION_FISCAL_PERIODS";
193
194        static final public String DOCUMENT_TYPES_REQUIRING_FLEXIBLE_OFFSET_BALANCING_ENTRIES = "DOCUMENT_TYPES_REQUIRING_FLEXIBLE_OFFSET_BALANCING_ENTRIES";
195
196        static final public String PLANT_FUND_CAMPUS_OBJECT_SUB_TYPE_CODES = "PLANT_FUND_CAMPUS_OBJECT_SUB_TYPES";
197        static final public String PLANT_FUND_ORG_OBJECT_SUB_TYPE_CODES = "PLANT_FUND_ORGANIZATION_OBJECT_SUB_TYPES";
198
199        static final public String PLANT_INDEBTEDNESS_OBJ_SUB_TYPE_CODES = "PLANT_INDEBTEDNESS_OBJECT_SUB_TYPES";
200        static final public String PLANT_INDEBTEDNESS_SUB_FUND_GROUP_CODES = "PLANT_INDEBTEDNESS_SUB_FUND_GROUPS";
201
202        static final public String CONTINUATION_ACCOUNT_BYPASS_ORIGINATION_CODES = "CONTINUATION_ACCOUNT_BYPASS_ORIGINATIONS";
203        static final public String CONTINUATION_ACCOUNT_BYPASS_BALANCE_TYPE_CODES = "CONTINUATION_ACCOUNT_BYPASS_BALANCE_TYPE_CODES";
204        static final public String CONTINUATION_ACCOUNT_BYPASS_DOCUMENT_TYPE_CODES = "CONTINUATION_ACCOUNT_BYPASS_DOCUMENT_TYPES";
205    }
206
207    public static class GlSummaryReport {
208        static final public String CURRENT_YEAR_LOWER = "CURRENT_YEAR_LOWER";
209        static final public String CURRENT_YEAR_UPPER = "CURRENT_YEAR_UPPER";
210        static final public String CURRENT_AND_LAST_YEAR = "CURRENT_AND_LAST_YEAR";
211    }
212
213    public static class OrganizationReversionProcess {
214        static final public String ORGANIZATION_REVERSION_COA = "ORGANIZATION_REVERSION_COA";
215        static final public String CARRY_FORWARD_OBJECT_CODE = "CARRY_FORWARD_OBJECT_CODE";
216        static final public String DEFAULT_FINANCIAL_SYSTEM_ORIGINATION_CODE = "MANUAL_FEED_ORIGINATION";
217        static final public String DEFAULT_FINANCIAL_BALANCE_TYPE_CODE = "CASH_REVERSION_DEFAULT_BALANCE_TYPE";
218        static final public String DEFAULT_FINANCIAL_BALANCE_TYPE_CODE_YEAR_END = "BUDGET_REVERSION_DEFAULT_BALANCE_TYPE";
219        static final public String DEFAULT_DOCUMENT_NUMBER_PREFIX = "DEFAULT_DOCUMENT_NUMBER_PREFIX";
220        static final public String UNALLOC_OBJECT_CODE_PARM = "UNALLOCATED_OBJECT_CODE";
221    }
222
223    public static class PosterService {
224        static final public String SYMBOL_USE_EXPENDITURE_ENTRY = "@";
225        static final public String SYMBOL_USE_ICR_FROM_ACCOUNT = "#";
226        static final public String ENCUMBRANCE_OPEN_AMOUNT_OVERRIDING_DOCUMENT_TYPES = "ENCUMBRANCE_OPEN_AMOUNT_OVERRIDING_DOCUMENT_TYPES";
227
228    }
229
230    public static class Balancing {
231        public static final String NUMBER_OF_PAST_FISCAL_YEARS_TO_INCLUDE = "NUMBER_OF_PAST_FISCAL_YEARS_TO_INCLUDE";
232        public static final String NUMBER_OF_COMPARISON_FAILURES_TO_PRINT_PER_REPORT = "NUMBER_OF_COMPARISON_FAILURES_TO_PRINT_PER_REPORT";
233    }
234
235    public static class BatchFileSystem {
236        static final public String EXTENSION = ".data";
237        static final public String DONE_FILE_EXTENSION = ".done";
238
239        //static final public String GL_ENTRY = "";
240        static final public String ENTERPRISE_FEED = "gl_glentry_entp";
241        static final public String COLLECTOR_OUTPUT = "gl_glentry_coll";
242        //TODO:- move to OriginEntrySource??
243        static final public String SCRUBBER_ERROR_PREFIX = "scrberr2";
244
245        static final public String AUTO_DISAPPROVE_DOCUMENTS_OUTPUT_FILE = "sys_autoDisapprove_output";
246        static final public String AUTO_DISAPPROVE_DOCUMENTS_ERROR_OUTPUT_FILE = "sys_autoDisapprove_errs";
247        static final public String TEXT_EXTENSION = ".txt";
248
249        static final public String BACKUP_FILE = "gl_glbackup";
250
251        static final public String  COLLECTOR_BACKUP_FILE = "col_glbackup";
252
253        static final public String COLLECTOR_PRE_SCRUBBER = "col_prescrub";
254        static final public String COLLECTOR_SCRUBBER_INPUT_FILE = "col_sortscrb";
255        static final public String COLLECTOR_SCRUBBER_VALID_OUTPUT_FILE = "col_scrbout1";
256        static final public String COLLECTOR_SCRUBBER_ERROR_OUTPUT_FILE = "col_scrberr1";
257        static final public String COLLECTOR_SCRUBBER_EXPIRED_OUTPUT_FILE = "col_expaccts";
258        static final public String COLLECTOR_SCRUBBER_ERROR_SORTED_FILE = "col_sorterr1";
259        static final public String COLLECTOR_DEMERGER_VAILD_OUTPUT_FILE = "col_scrbout2";
260        static final public String COLLECTOR_DEMERGER_ERROR_OUTPUT_FILE = "col_scrberr2";
261
262        static final public String PRE_SCRUBBER_FILE = "gl_prescrub";
263        static final public String SCRUBBER_INPUT_FILE = "gl_sortscrb";
264        static final public String SCRUBBER_VALID_OUTPUT_FILE = "gl_scrbout1";
265        static final public String SCRUBBER_ERROR_OUTPUT_FILE = "gl_scrberr1";
266        static final public String SCRUBBER_EXPIRED_OUTPUT_FILE = "gl_expaccts";
267        static final public String SCRUBBER_ERROR_SORTED_FILE = "gl_sorterr1";
268        static final public String DEMERGER_VAILD_OUTPUT_FILE = "gl_scrbout2";
269        static final public String DEMERGER_ERROR_OUTPUT_FILE = "gl_scrberr2";
270
271        static final public String POSTER_INPUT_FILE = "gl_sortpost";
272        static final public String REVERSAL_POSTER_VALID_OUTPUT_FILE = "gl_workfile";
273        static final public String REVERSAL_POSTER_ERROR_OUTPUT_FILE = "gl_workerrs";
274        static final public String POSTER_VALID_OUTPUT_FILE = "gl_postout";
275
276        static final public String POSTER_ERROR_OUTPUT_FILE = "gl_posterrs";
277        static final public String ICR_TRANSACTIONS_OUTPUT_FILE = "gl_icrtrans";
278        //todo - create sort step
279        static final public String ICR_POSTER_INPUT_FILE = "gl_sorticr";
280
281        static final public String ICR_POSTER_ERROR_OUTPUT_FILE = "gl_icrerrs";
282
283                static final public String NIGHTLY_OUT_FILE = "gl_glentry_kfs";
284                static final public String EXTRACT_TRANSACTION_FILE = "gl_glentry_pdp";
285
286                //year end part
287                static final public String ORGANIZATION_REVERSION_PRE_CLOSING_FILE = "gl_org_reversion_pre_closing";
288                static final public String ORGANIZATION_REVERSION_CLOSING_FILE = "gl_org_reversion_closing";
289                static final public String ENCUMBRANCE_FORWARD_FILE = "gl_encumbrance_forward";
290                static final public String CLOSE_NOMINAL_ACTIVITY_FILE = "gl_close_nominal_activity";
291                static final public String BALANCE_FORWARDS_FILE = "gl_balance_forwards";
292                static final public String BALANCE_FORWARDS_CLOSED_FILE = "gl_balance_forwards_closed";
293
294                static final public String LABOR_GL_ENTRY_FILE = "gl_glentry_lab";
295    }
296
297    public static class PosterOutputSummaryEntry {
298        static final public String ASSET_EXPENSE_OBJECT_TYPE_CODES = "ASSET_EXPENSE_OBJECT_TYPE_CODES";
299    }
300
301    public static class BalanceForwardRule {
302        static final public String BALANCE_TYPES_TO_ROLL_FORWARD_FOR_BALANCE_SHEET = "BALANCE_TYPES_TO_ROLL_FORWARD_FOR_BALANCE_SHEET";
303        static final public String BALANCE_TYPES_TO_ROLL_FORWARD_FOR_INCOME_EXPENSE = "BALANCE_TYPES_TO_ROLL_FORWARD_FOR_INCOME_EXPENSE";
304        static final public String SUB_FUND_GROUPS_FOR_INCEPTION_TO_DATE_REPORTING = "SUB_FUND_GROUPS_FOR_INCEPTION_TO_DATE_REPORTING";
305    }
306
307    public static class EncumbranceClosingOriginEntry {
308        static final public String GENERATED_TRANSACTION_LEDGER_ENTRY_DESCRIPTION = "GENERATED_TRANSACTION_LEDGER_ENTRY_DESCRIPTION";
309        static final public String BEGINNING_FUND_BALANCE_TRANSACTION_LEDGER_ENTRY_DESCRIPTION = "BEGINNING_FUND_BALANCE_TRANSACTION_LEDGER_ENTRY_DESCRIPTION";
310        static final public String OFFSET_OBJECT_CODE_FOR_INTERNAL_ENCUMBRANCE = "OFFSET_OBJECT_CODE_FOR_INTERNAL_ENCUMBRANCE";
311        static final public String OFFSET_OBJECT_CODE_FOR_PRE_ENCUMBRANCE = "OFFSET_OBJECT_CODE_FOR_PRE_ENCUMBRANCE";
312        static final public String OFFSET_OBJECT_CODE_FOR_EXTERNAL_ENCUMBRANCE = "OFFSET_OBJECT_CODE_FOR_EXTERNAL_ENCUMBRANCE";
313        static final public String FORWARDING_ENCUMBRANCE_BALANCE_TYPES = "FORWARDING_ENCUMBRANCE_BALANCE_TYPES";
314        static final public String FORWARD_ENCUMBRANCE_BALANCE_TYPE_AND_ORIGIN_CODE = "FORWARD_ENCUMBRANCE_BALANCE_TYPE_AND_ORIGIN_CODE";
315    }
316
317    public static class Reconciliation {
318        // the case of these strings is not important
319        public static final String TABLE_DEF_STRING = "c";
320        public static final String COLUMN_DEF_STRING = "s";
321        public static final String CHECKSUM_DEF_STRING = "e";
322
323        public static final String COMMENT_STRING = "#";
324    }
325
326    // Some static method calls below that could be done in static variables instead but isn't safe to do during class loading
327    // w/SpringContext.
328    private static String SPACE_UNIVERSITY_FISCAL_PERIOD_CODE = null;
329
330    public static String getSpaceUniversityFiscalPeriodCode() {
331        if (SPACE_UNIVERSITY_FISCAL_PERIOD_CODE == null) {
332            SPACE_UNIVERSITY_FISCAL_PERIOD_CODE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.UNIVERSITY_FISCAL_PERIOD_CODE), ' ');
333        }
334        return SPACE_UNIVERSITY_FISCAL_PERIOD_CODE;
335    }
336
337    private static String SPACE_BALANCE_TYPE_CODE = null;
338
339    public static String getSpaceBalanceTypeCode() {
340        if (SPACE_BALANCE_TYPE_CODE == null) {
341            SPACE_BALANCE_TYPE_CODE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(BalanceType.class, OLEPropertyConstants.CODE), ' ');
342        }
343        return SPACE_BALANCE_TYPE_CODE;
344    }
345
346    private static String SPACE_FINANCIAL_SYSTEM_ORIGINATION_CODE = null;
347
348    public static String getSpaceFinancialSystemOriginationCode() {
349        if (SPACE_FINANCIAL_SYSTEM_ORIGINATION_CODE == null) {
350            SPACE_FINANCIAL_SYSTEM_ORIGINATION_CODE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginationCode.class, OLEPropertyConstants.FINANCIAL_SYSTEM_ORIGINATION_CODE), ' ');
351        }
352        return SPACE_FINANCIAL_SYSTEM_ORIGINATION_CODE;
353    }
354
355    private static String SPACE_DEBIT_CREDIT_CODE = null;
356
357    public static String getSpaceDebitCreditCode() {
358        if (SPACE_DEBIT_CREDIT_CODE == null) {
359            SPACE_DEBIT_CREDIT_CODE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.TRANSACTION_DEBIT_CREDIT_CODE), ' ');
360        }
361        return SPACE_DEBIT_CREDIT_CODE;
362    }
363
364    private static String SPACE_FINANCIAL_OBJECT_CODE = null;
365
366    public static String getSpaceFinancialObjectCode() {
367        if (SPACE_FINANCIAL_OBJECT_CODE == null) {
368            SPACE_FINANCIAL_OBJECT_CODE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(ObjectCode.class, OLEPropertyConstants.FINANCIAL_OBJECT_CODE), ' ');
369        }
370        return SPACE_FINANCIAL_OBJECT_CODE;
371    }
372
373    private static String SPACE_TRANSACTION_DATE = null;
374
375    public static String getSpaceTransactionDate() {
376        if (SPACE_TRANSACTION_DATE == null) {
377            SPACE_TRANSACTION_DATE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.TRANSACTION_DATE), ' ');
378        }
379        return SPACE_TRANSACTION_DATE;
380    }
381
382    private static String SPACE_UNIVERSITY_FISCAL_YEAR = null;
383
384    public static String getSpaceUniversityFiscalYear() {
385        if (SPACE_UNIVERSITY_FISCAL_YEAR == null) {
386            SPACE_UNIVERSITY_FISCAL_YEAR = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR), ' ');
387        }
388        return SPACE_UNIVERSITY_FISCAL_YEAR;
389    }
390
391    private static String SPACE_TRANSACTION_ENTRY_SEQUENCE_NUMBER = null;
392
393    public static String getSpaceTransactionEntrySequenceNumber() {
394        if (SPACE_TRANSACTION_ENTRY_SEQUENCE_NUMBER == null) {
395            SPACE_TRANSACTION_ENTRY_SEQUENCE_NUMBER = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.TRANSACTION_ENTRY_SEQUENCE_NUMBER), ' ');
396        }
397        return SPACE_TRANSACTION_ENTRY_SEQUENCE_NUMBER;
398    }
399
400    private static String SPACE_TRANSACTION_LEDGER_ENTRY_DESCRIPTION = null;
401
402    public static String getSpaceTransactionLedgetEntryDescription() {
403        if (SPACE_TRANSACTION_LEDGER_ENTRY_DESCRIPTION == null) {
404            SPACE_TRANSACTION_LEDGER_ENTRY_DESCRIPTION = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.TRANSACTION_LEDGER_ENTRY_DESC), ' ');
405        }
406        return SPACE_TRANSACTION_LEDGER_ENTRY_DESCRIPTION;
407    }
408
409    private static String SPACE_SUB_ACCOUNT_TYPE_CODE = null;
410
411    public static String getSpaceSubAccountTypeCode() {
412        if (SPACE_SUB_ACCOUNT_TYPE_CODE == null) {
413            SPACE_SUB_ACCOUNT_TYPE_CODE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(A21SubAccount.class, OLEPropertyConstants.SUB_ACCOUNT_TYPE_CODE), ' ');
414        }
415        return SPACE_SUB_ACCOUNT_TYPE_CODE;
416    }
417
418    private static String SPACE_ALL_ORIGIN_ENTRY_FIELDS = null;
419
420    public static String getSpaceAllOriginEntryFields() {
421        if (SPACE_ALL_ORIGIN_ENTRY_FIELDS == null) {
422            List<AttributeDefinition> attributes = SpringContext.getBean(DataDictionaryService.class).getDataDictionary().getBusinessObjectEntry(OriginEntryFull.class.getName()).getAttributes();
423
424            int totalLength = 0;
425
426            for ( AttributeDefinition attributeDefinition : attributes ) {
427
428                if (!(OLEPropertyConstants.ENTRY_GROUP_ID.equals(attributeDefinition.getName()) || OLEPropertyConstants.ENTRY_ID.equals(attributeDefinition.getName()))) {
429                    totalLength += attributeDefinition.getMaxLength();
430                }
431            }
432
433            SPACE_ALL_ORIGIN_ENTRY_FIELDS = StringUtils.rightPad("", totalLength, ' ');
434        }
435
436        return SPACE_ALL_ORIGIN_ENTRY_FIELDS;
437    }
438
439    private static String SPACE_ALL_COLLECTOR_BATCH_HEADER_FIELDS = null;
440
441    public static String getSpaceAllCollectorBatchHeaderFields() {
442        if (SPACE_ALL_COLLECTOR_BATCH_HEADER_FIELDS == null) {
443            List<AttributeDefinition> attributes = SpringContext.getBean(DataDictionaryService.class).getDataDictionary().getBusinessObjectEntry(CollectorBatch.class.getName()).getAttributes();
444
445            int totalLength = 0;
446
447            for ( AttributeDefinition attributeDefinition : attributes ) {
448                if (!(OLEPropertyConstants.TRAILER_RECORD_FIRST_EMPTY_FIELD.equals(attributeDefinition.getName()) ||
449                    OLEPropertyConstants.TOTAL_RECORDS.equals(attributeDefinition.getName()) ||
450                    OLEPropertyConstants.TRAILER_RECORD_SECOND_EMPTY_FIELD.equals(attributeDefinition.getName()) ||
451                    OLEPropertyConstants.TOTAL_AMOUNT.equals(attributeDefinition.getName()))) {
452                    totalLength += attributeDefinition.getMaxLength();
453                }
454            }
455
456            SPACE_ALL_COLLECTOR_BATCH_HEADER_FIELDS = StringUtils.rightPad("", totalLength, ' ');
457        }
458
459        return SPACE_ALL_COLLECTOR_BATCH_HEADER_FIELDS;
460    }
461
462    private static String SPACE_ALL_COLLECTOR_BATCH_TRAILER_FIELDS = null;
463
464    public static String getSpaceAllCollectorBatchTrailerFields() {
465        if (SPACE_ALL_COLLECTOR_BATCH_TRAILER_FIELDS == null) {
466            List<AttributeDefinition> attributes = SpringContext.getBean(DataDictionaryService.class).getDataDictionary().getBusinessObjectEntry(CollectorBatch.class.getName()).getAttributes();
467
468            int totalLength = 0;
469
470            for ( AttributeDefinition attributeDefinition : attributes ) {
471                if ((OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR.equals(attributeDefinition.getName()) ||
472                     OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE.equals(attributeDefinition.getName()) ||
473                     OLEPropertyConstants.ORGANIZATION_CODE.equals(attributeDefinition.getName()) ||
474                     OLEPropertyConstants.TRANSMISSION_DATE.equals(attributeDefinition.getName()) ||
475                     OLEPropertyConstants.COLLECTOR_BATCH_RECORD_TYPE.equals(attributeDefinition.getName()) ||
476                     OLEPropertyConstants.TRAILER_RECORD_FIRST_EMPTY_FIELD.equals(attributeDefinition.getName()) ||
477                     OLEPropertyConstants.TOTAL_RECORDS.equals(attributeDefinition.getName()) ||
478                     OLEPropertyConstants.TRAILER_RECORD_SECOND_EMPTY_FIELD.equals(attributeDefinition.getName()) ||
479                     OLEPropertyConstants.TOTAL_AMOUNT.equals(attributeDefinition.getName()))) {
480                     totalLength += attributeDefinition.getMaxLength();
481                }
482            }
483
484            SPACE_ALL_COLLECTOR_BATCH_TRAILER_FIELDS = StringUtils.rightPad("", totalLength, ' ');
485        }
486
487        return SPACE_ALL_COLLECTOR_BATCH_TRAILER_FIELDS;
488    }
489
490    private static String SPACE_ALL_COLLECTOR_DETAIL_FIELDS = null;
491
492    public static String getSpaceAllCollectorDetailFields() {
493        if (SPACE_ALL_COLLECTOR_DETAIL_FIELDS == null) {
494            CollectorDetailFieldUtil collectorDetailFieldUtil = new CollectorDetailFieldUtil();
495            int totalLength = collectorDetailFieldUtil .getDetailLineTotalLength();
496
497            SPACE_ALL_COLLECTOR_DETAIL_FIELDS = StringUtils.rightPad("", totalLength, ' ');
498        }
499
500        return SPACE_ALL_COLLECTOR_DETAIL_FIELDS;
501    }
502
503
504    private static String ZERO_TRANSACTION_ENTRY_SEQUENCE_NUMBER = null;
505
506    public static String getZeroTransactionEntrySequenceNumber() {
507        if (ZERO_TRANSACTION_ENTRY_SEQUENCE_NUMBER == null) {
508            ZERO_TRANSACTION_ENTRY_SEQUENCE_NUMBER = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.TRANSACTION_ENTRY_SEQUENCE_NUMBER), '0');
509        }
510        return ZERO_TRANSACTION_ENTRY_SEQUENCE_NUMBER;
511    }
512
513    public static String getZeroTransactionLedgerEntryAmount(){
514        OriginEntryFieldUtil oefu = new OriginEntryFieldUtil();
515        int length = oefu.getFieldLengthMap().get(OLEPropertyConstants.TRANSACTION_LEDGER_ENTRY_AMOUNT);
516
517        String amount = "";
518        amount = StringUtils.rightPad("+", length - 3, "0") + ".00";
519
520        return amount;
521    }
522
523    private static String DASH_ORGANIZATION_REFERENCE_ID = null;
524
525    public static String getDashOrganizationReferenceId() {
526        if (DASH_ORGANIZATION_REFERENCE_ID == null) {
527            DASH_ORGANIZATION_REFERENCE_ID = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.ORGANIZATION_REFERENCE_ID), '-');
528        }
529        return DASH_ORGANIZATION_REFERENCE_ID;
530    }
531
532    private static String SPACE_CHART_OF_ACCOUNTS_CODE = null;
533
534    public static String getSpaceChartOfAccountsCode() {
535        if (SPACE_CHART_OF_ACCOUNTS_CODE == null) {
536            SPACE_CHART_OF_ACCOUNTS_CODE = StringUtils.rightPad("", SpringContext.getBean(DataDictionaryService.class).getAttributeMaxLength(OriginEntryFull.class, OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE), ' ');
537        }
538        return SPACE_CHART_OF_ACCOUNTS_CODE;
539    }
540    public static final String INCOME_OR_EXPENSE_TRANSFER_CONSOLIDATION_CODE = "TRSF";
541}