View Javadoc
1   /*
2    * Copyright 2007 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.kuali.ole.gl.businessobject;
18  
19  import java.sql.Date;
20  import java.util.LinkedHashMap;
21  import java.util.Map;
22  
23  import org.apache.commons.lang.StringUtils;
24  import org.kuali.ole.coa.businessobject.Account;
25  import org.kuali.ole.coa.businessobject.BalanceType;
26  import org.kuali.ole.coa.businessobject.Chart;
27  import org.kuali.ole.coa.businessobject.ObjectCode;
28  import org.kuali.ole.coa.businessobject.ObjectType;
29  import org.kuali.ole.coa.service.AccountService;
30  import org.kuali.ole.gl.GeneralLedgerConstants;
31  import org.kuali.ole.sys.OLEConstants;
32  import org.kuali.ole.sys.OLEKeyConstants;
33  import org.kuali.ole.sys.OLEPropertyConstants;
34  import org.kuali.ole.sys.businessobject.UniversityDate;
35  import org.kuali.ole.sys.context.SpringContext;
36  import org.kuali.rice.core.api.util.type.KualiDecimal;
37  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
38  import org.kuali.rice.krad.util.MessageMap;
39  
40  /**
41   * CollectorDetail Business Object.
42   */
43  public class CollectorDetail extends PersistableBusinessObjectBase {
44  
45      private String universityFiscalPeriodCode;
46      private Integer universityFiscalYear;
47      private Date createDate;
48      private Integer transactionLedgerEntrySequenceNumber;
49      private String chartOfAccountsCode;
50      private String accountNumber;
51      private String subAccountNumber;
52      private String financialObjectCode;
53      private String financialSubObjectCode;
54      private String financialBalanceTypeCode;
55      private String financialObjectTypeCode;
56      private String collectorDetailSequenceNumber;
57      private String financialDocumentTypeCode;
58      private String financialSystemOriginationCode;
59      private String documentNumber;
60      private KualiDecimal collectorDetailItemAmount;
61      private String collectorDetailNoteText;
62      private String glCreditCode;
63      
64      private ObjectCode financialObject;
65      private Account account;
66      private Chart chartOfAccounts;
67      private ObjectType objectType;
68      private BalanceType balanceType;
69  
70      private static CollectorDetailFieldUtil collectorDetailFieldUtil;
71      
72      /**
73       * Default constructor.
74       */
75      public CollectorDetail() {
76          setSubAccountNumber(OLEConstants.getDashSubAccountNumber());
77          setFinancialSubObjectCode(OLEConstants.getDashFinancialSubObjectCode());
78      }
79  
80      /**
81       * Gets the universityFiscalPeriodCode attribute.
82       * 
83       * @return Returns the universityFiscalPeriodCode
84       */
85      public String getUniversityFiscalPeriodCode() {
86          return universityFiscalPeriodCode;
87      }
88  
89      /**
90       * Sets the universityFiscalPeriodCode attribute.
91       * 
92       * @param universityFiscalPeriodCode The universityFiscalPeriodCode to set.
93       */
94      public void setUniversityFiscalPeriodCode(String universityFiscalPeriodCode) {
95          this.universityFiscalPeriodCode = universityFiscalPeriodCode;
96      }
97  
98  
99      /**
100      * Gets the universityFiscalYear attribute.
101      * 
102      * @return Returns the universityFiscalYear
103      */
104     public Integer getUniversityFiscalYear() {
105         return universityFiscalYear;
106     }
107 
108     /**
109      * Sets the universityFiscalYear attribute.
110      * 
111      * @param universityFiscalYear The universityFiscalYear to set.
112      */
113     public void setUniversityFiscalYear(Integer universityFiscalYear) {
114         this.universityFiscalYear = universityFiscalYear;
115     }
116 
117 
118     /**
119      * Gets the createDate attribute.
120      * 
121      * @return Returns the createDate
122      */
123     public Date getCreateDate() {
124         return createDate;
125     }
126 
127     /**
128      * Sets the createDate attribute.
129      * 
130      * @param createDate The createDate to set.
131      */
132     public void setCreateDate(Date createDate) {
133         this.createDate = createDate;
134     }
135 
136     /**
137      * Gets the transactionLedgerEntrySequenceNumber attribute. 
138      * @return Returns the transactionLedgerEntrySequenceNumber.
139      */
140     public Integer getTransactionLedgerEntrySequenceNumber() {
141         return transactionLedgerEntrySequenceNumber;
142     }
143 
144     /**
145      * Sets the transactionLedgerEntrySequenceNumber attribute value.
146      * @param transactionLedgerEntrySequenceNumber The transactionLedgerEntrySequenceNumber to set.
147      */
148     public void setTransactionLedgerEntrySequenceNumber(Integer transactionLedgerEntrySequenceNumber) {
149         this.transactionLedgerEntrySequenceNumber = transactionLedgerEntrySequenceNumber;
150     }
151 
152     /**
153      * Gets the chartOfAccountsCode attribute.
154      * 
155      * @return Returns the chartOfAccountsCode
156      */
157     public String getChartOfAccountsCode() {
158         return chartOfAccountsCode;
159     }
160 
161     /**
162      * Sets the chartOfAccountsCode attribute.
163      * 
164      * @param chartOfAccountsCode The chartOfAccountsCode to set.
165      */
166     public void setChartOfAccountsCode(String chartOfAccountsCode) {
167         this.chartOfAccountsCode = chartOfAccountsCode;
168     }
169 
170 
171     /**
172      * Gets the accountNumber attribute.
173      * 
174      * @return Returns the accountNumber
175      */
176     public String getAccountNumber() {
177         return accountNumber;
178     }
179 
180     /**
181      * Sets the accountNumber attribute.
182      * 
183      * @param accountNumber The accountNumber to set.
184      */
185     public void setAccountNumber(String accountNumber) {
186         this.accountNumber = accountNumber;
187     }
188 
189 
190     /**
191      * Gets the subAccountNumber attribute.
192      * 
193      * @return Returns the subAccountNumber
194      */
195     public String getSubAccountNumber() {
196         return subAccountNumber;
197     }
198 
199     /**
200      * Sets the subAccountNumber attribute.
201      * 
202      * @param subAccountNumber The subAccountNumber to set.
203      */
204     public void setSubAccountNumber(String subAccountNumber) {
205         this.subAccountNumber = subAccountNumber;
206     }
207 
208 
209     /**
210      * Gets the financialObjectCode attribute.
211      * 
212      * @return Returns the financialObjectCode
213      */
214     public String getFinancialObjectCode() {
215         return financialObjectCode;
216     }
217 
218     /**
219      * Sets the financialObjectCode attribute.
220      * 
221      * @param financialObjectCode The financialObjectCode to set.
222      */
223     public void setFinancialObjectCode(String financialObjectCode) {
224         this.financialObjectCode = financialObjectCode;
225     }
226 
227 
228     /**
229      * Gets the financialSubObjectCode attribute.
230      * 
231      * @return Returns the financialSubObjectCode
232      */
233     public String getFinancialSubObjectCode() {
234         return financialSubObjectCode;
235     }
236 
237     /**
238      * Sets the financialSubObjectCode attribute.
239      * 
240      * @param financialSubObjectCode The financialSubObjectCode to set.
241      */
242     public void setFinancialSubObjectCode(String financialSubObjectCode) {
243         this.financialSubObjectCode = financialSubObjectCode;
244     }
245 
246 
247     /**
248      * Gets the collectorDetailSequenceNumber attribute.
249      * 
250      * @return Returns the collectorDetailSequenceNumber
251      */
252     public String getCollectorDetailSequenceNumber() {
253         return collectorDetailSequenceNumber;
254     }
255 
256     /**
257      * Sets the collectorDetailSequenceNumber attribute.
258      * 
259      * @param collectorDetailSequenceNumber The collectorDetailSequenceNumber to set.
260      */
261     public void setCollectorDetailSequenceNumber(String collectorDetailSequenceNumber) {
262         this.collectorDetailSequenceNumber = collectorDetailSequenceNumber;
263     }
264 
265 
266     /**
267      * Gets the financialDocumentTypeCode attribute.
268      * 
269      * @return Returns the financialDocumentTypeCode
270      */
271     public String getFinancialDocumentTypeCode() {
272         return financialDocumentTypeCode;
273     }
274 
275     /**
276      * Sets the financialDocumentTypeCode attribute.
277      * 
278      * @param financialDocumentTypeCode The financialDocumentTypeCode to set.
279      */
280     public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) {
281         this.financialDocumentTypeCode = financialDocumentTypeCode;
282     }
283 
284 
285     /**
286      * Gets the financialSystemOriginationCode attribute.
287      * 
288      * @return Returns the financialSystemOriginationCode
289      */
290     public String getFinancialSystemOriginationCode() {
291         return financialSystemOriginationCode;
292     }
293 
294     /**
295      * Sets the financialSystemOriginationCode attribute.
296      * 
297      * @param financialSystemOriginationCode The financialSystemOriginationCode to set.
298      */
299     public void setFinancialSystemOriginationCode(String financialSystemOriginationCode) {
300         this.financialSystemOriginationCode = financialSystemOriginationCode;
301     }
302 
303 
304     /**
305      * Gets the documentNumber attribute.
306      * 
307      * @return Returns the documentNumber
308      */
309     public String getDocumentNumber() {
310         return documentNumber;
311     }
312 
313     /**
314      * Sets the documentNumber attribute.
315      * 
316      * @param documentNumber The documentNumber to set.
317      */
318     public void setDocumentNumber(String documentNumber) {
319         this.documentNumber = documentNumber;
320     }
321 
322 
323     /**
324      * Gets the collectorDetailItemAmount attribute.
325      * 
326      * @return Returns the collectorDetailItemAmount
327      */
328     public KualiDecimal getCollectorDetailItemAmount() {
329         return collectorDetailItemAmount;
330     }
331 
332     /**
333      * Sets the collectorDetailItemAmount attribute.
334      * 
335      * @param collectorDetailItemAmount The collectorDetailItemAmount to set.
336      */
337     public void setCollectorDetailItemAmount(KualiDecimal collectorDetailItemAmount) {
338         this.collectorDetailItemAmount = collectorDetailItemAmount;
339     }
340 
341     public void setCollectorDetailItemAmount(String collectorDetailItemAmount) {
342         this.collectorDetailItemAmount = new KualiDecimal(collectorDetailItemAmount);
343     }
344 
345     public void clearcollectorDetailItemAmount() {
346         this.collectorDetailItemAmount = null;
347     }
348 
349     /**
350      * Gets the collectorDetailNoteText attribute.
351      * 
352      * @return Returns the collectorDetailNoteText
353      */
354     public String getCollectorDetailNoteText() {
355         return collectorDetailNoteText;
356     }
357 
358     /**
359      * Sets the collectorDetailNoteText attribute.
360      * 
361      * @param collectorDetailNoteText The collectorDetailNoteText to set.
362      */
363     public void setCollectorDetailNoteText(String collectorDetailNoteText) {
364         this.collectorDetailNoteText = collectorDetailNoteText;
365     }
366 
367 
368     /**
369      * Gets the financialObject attribute.
370      * 
371      * @return Returns the financialObject
372      */
373     public ObjectCode getFinancialObject() {
374         return financialObject;
375     }
376 
377     /**
378      * Sets the financialObject attribute.
379      * 
380      * @param financialObject The financialObject to set.
381      * @deprecated
382      */
383     public void setFinancialObject(ObjectCode financialObject) {
384         this.financialObject = financialObject;
385     }
386 
387     /**
388      * Gets the account attribute.
389      * 
390      * @return Returns the account
391      */
392     public Account getAccount() {
393         return account;
394     }
395 
396     /**
397      * Sets the account attribute.
398      * 
399      * @param account The account to set.
400      * @deprecated
401      */
402     public void setAccount(Account account) {
403         this.account = account;
404     }
405 
406     /**
407      * Gets the chartOfAccounts attribute.
408      * 
409      * @return Returns the chartOfAccounts
410      */
411     public Chart getChartOfAccounts() {
412         return chartOfAccounts;
413     }
414 
415     /**
416      * Sets the chartOfAccounts attribute.
417      * 
418      * @param chartOfAccounts The chartOfAccounts to set.
419      * @deprecated
420      */
421     public void setChartOfAccounts(Chart chartOfAccounts) {
422         this.chartOfAccounts = chartOfAccounts;
423     }
424 
425     /**
426      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
427      */
428     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
429         LinkedHashMap m = new LinkedHashMap();
430         m.put("universityFiscalPeriodCode", getUniversityFiscalPeriodCode());
431         if (getUniversityFiscalYear() != null) {
432             m.put("universityFiscalYear", getUniversityFiscalYear().toString());
433         }
434         if (getCreateDate() != null) {
435             m.put("createDate", getCreateDate().toString());
436         }
437         m.put("transactionLedgerEntrySequenceNumber", getTransactionLedgerEntrySequenceNumber());
438         m.put("chartOfAccountsCode", getChartOfAccountsCode());
439         m.put("accountNumber", getAccountNumber());
440         m.put("subAccountNumber", getSubAccountNumber());
441         m.put("financialObjectCode", getFinancialObjectCode());
442         m.put("financialSubObjectCode", getFinancialSubObjectCode());
443         m.put("collectorDetailSequenceNumber", getCollectorDetailSequenceNumber());
444         m.put("financialDocumentTypeCode", getFinancialDocumentTypeCode());
445         m.put(OLEPropertyConstants.DOCUMENT_NUMBER, getDocumentNumber());
446         return m;
447     }
448 
449     /**
450      * Gets the balanceTyp attribute.
451      * 
452      * @return Returns the balanceTyp.
453      */
454     public BalanceType getBalanceType() {
455         return balanceType;
456     }
457 
458     /**
459      * Sets the balanceTyp attribute value.
460      * 
461      * @param balanceTyp The balanceTyp to set.
462      */
463     public void setBalanceType(BalanceType balanceTyp) {
464         this.balanceType = balanceTyp;
465     }
466 
467     /**
468      * Gets the financialBalanceTypeCode attribute.
469      * 
470      * @return Returns the financialBalanceTypeCode.
471      */
472     public String getFinancialBalanceTypeCode() {
473         return financialBalanceTypeCode;
474     }
475 
476     /**
477      * Sets the financialBalanceTypeCode attribute value.
478      * 
479      * @param financialBalanceTypeCode The financialBalanceTypeCode to set.
480      */
481     public void setFinancialBalanceTypeCode(String financialBalanceTypeCode) {
482         this.financialBalanceTypeCode = financialBalanceTypeCode;
483     }
484 
485     /**
486      * Gets the financialObjectTypeCode attribute.
487      * 
488      * @return Returns the financialObjectTypeCode.
489      */
490     public String getFinancialObjectTypeCode() {
491         return financialObjectTypeCode;
492     }
493 
494     /**
495      * Sets the financialObjectTypeCode attribute value.
496      * 
497      * @param financialObjectTypeCode The financialObjectTypeCode to set.
498      */
499     public void setFinancialObjectTypeCode(String financialObjectTypeCode) {
500         this.financialObjectTypeCode = financialObjectTypeCode;
501     }
502 
503     /**
504      * Gets the glCreditCode attribute.
505      * 
506      * @return Returns the glCreditCode.
507      */
508     public String getGlCreditCode() {
509         return glCreditCode;
510     }
511 
512     /**
513      * Sets the glCreditCode attribute value.
514      * 
515      * @param glCreditCode The glCreditCode to set.
516      */
517     public void setGLCreditCode(String glCreditCode) {
518         this.glCreditCode = glCreditCode;
519     }
520 
521 
522     /**
523      * Gets the objectType attribute.
524      * 
525      * @return Returns the objectType.
526      */
527     public ObjectType getObjectType() {
528         return objectType;
529     }
530 
531     /**
532      * Sets the objectType attribute value.
533      * 
534      * @param objectType The objectType to set.
535      */
536     public void setObjectType(ObjectType objectType) {
537         this.objectType = objectType;
538     }
539     
540     protected String getValue(String headerLine, int s, int e) {
541         return org.springframework.util.StringUtils.trimTrailingWhitespace(StringUtils.substring(headerLine, s, e));
542     }
543         
544     /**
545      * @return the static instance of the CollectorBatchrFieldUtil
546      */
547     protected static CollectorDetailFieldUtil getCollectorDetailFieldUtil() {
548         if (collectorDetailFieldUtil == null) {
549             collectorDetailFieldUtil = new CollectorDetailFieldUtil();
550         }
551         return collectorDetailFieldUtil;
552     }
553     
554     public void setFromFileForCollectorDetail(String detailLine, Map<String, String>accountRecordBalanceTypeMap, Date curDate, UniversityDate universityDate, int lineNumber, MessageMap messageMap) {
555 
556         try{
557             
558             final Map<String, Integer> pMap = getCollectorDetailFieldUtil().getFieldBeginningPositionMap();
559             
560             detailLine = org.apache.commons.lang.StringUtils.rightPad(detailLine, GeneralLedgerConstants.getSpaceAllCollectorDetailFields().length(), ' ');
561 
562             setCreateDate(curDate);
563             if (!GeneralLedgerConstants.getSpaceUniversityFiscalYear().equals(detailLine.substring(pMap.get(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR), pMap.get(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE)))) {
564                 try {
565                     setUniversityFiscalYear(new Integer(getValue(detailLine, pMap.get(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR), pMap.get(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE))));
566                 }
567                 catch (NumberFormatException e) {
568                     messageMap.putError(OLEConstants.GLOBAL_ERRORS, OLEKeyConstants.ERROR_CUSTOM, "Collector detail university fiscal year " + lineNumber + " string " + detailLine.substring(pMap.get(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR), pMap.get(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE)));
569                     setUniversityFiscalYear(null);
570                 }
571             }
572             else {
573                 setUniversityFiscalYear(null);
574             }
575             
576             if (!GeneralLedgerConstants.getSpaceChartOfAccountsCode().equals(detailLine.substring(pMap.get(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR), pMap.get(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE))))
577                 setChartOfAccountsCode(getValue(detailLine, pMap.get(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE), pMap.get(OLEPropertyConstants.ACCOUNT_NUMBER)));
578             else
579                 setChartOfAccountsCode(GeneralLedgerConstants.getSpaceChartOfAccountsCode());            
580             setAccountNumber(getValue(detailLine, pMap.get(OLEPropertyConstants.ACCOUNT_NUMBER), pMap.get(OLEPropertyConstants.SUB_ACCOUNT_NUMBER)));
581             
582             // if chart code is empty while accounts cannot cross charts, then derive chart code from account number
583             AccountService acctserv = SpringContext.getBean(AccountService.class);
584             if (StringUtils.isEmpty(getChartOfAccountsCode()) && StringUtils.isNotEmpty(getAccountNumber()) && !acctserv.accountsCanCrossCharts()) {
585                 Account account = acctserv.getUniqueAccountForAccountNumber(getAccountNumber());
586                 if (account != null) {
587                     setChartOfAccountsCode(account.getChartOfAccountsCode());
588                 }            
589             }
590                         
591             setSubAccountNumber(getValue(detailLine, pMap.get(OLEPropertyConstants.SUB_ACCOUNT_NUMBER), pMap.get(OLEPropertyConstants.FINANCIAL_OBJECT_CODE)));
592             setFinancialObjectCode(getValue(detailLine, pMap.get(OLEPropertyConstants.FINANCIAL_OBJECT_CODE), pMap.get(OLEPropertyConstants.FINANCIAL_SUB_OBJECT_CODE)));
593             setFinancialSubObjectCode(getValue(detailLine, pMap.get(OLEPropertyConstants.FINANCIAL_SUB_OBJECT_CODE), pMap.get(OLEPropertyConstants.FINANCIAL_BALANCE_TYPE_CODE)));
594             
595             // We are in Collector Detail for ID Billing Details because the value from file positions 26, 27 = DT.  We don not want to set Financial Balance Type Code to detail type code (DT)   
596             // Generate the account record key to retrieve the balance type from the map which contains the balance type from the accounting record/origin entry
597             String accountRecordKey = generateAccountRecordBalanceTypeKey();
598             String financialBalanceTypeCode = accountRecordBalanceTypeMap.get(accountRecordKey);
599             // Default to "AC" if we do not find account record key record from the map
600             setFinancialBalanceTypeCode(StringUtils.defaultIfEmpty(financialBalanceTypeCode, GeneralLedgerConstants.FINALNCIAL_BALANCE_TYPE_FOR_COLLECTOR_DETAIL_RECORD));
601             setFinancialObjectTypeCode(getValue(detailLine, pMap.get(OLEPropertyConstants.FINANCIAL_OBJECT_TYPE_CODE), pMap.get(OLEPropertyConstants.COLLECTOR_DETAIL_SEQUENCE_NUMBER)));
602             setUniversityFiscalPeriodCode(universityDate.getUniversityFiscalAccountingPeriod());
603             setCollectorDetailSequenceNumber(getValue(detailLine, pMap.get(OLEPropertyConstants.COLLECTOR_DETAIL_SEQUENCE_NUMBER), pMap.get(OLEPropertyConstants.FINANCIAL_DOCUMENT_TYPE_CODE)));
604             setFinancialDocumentTypeCode(getValue(detailLine, pMap.get(OLEPropertyConstants.FINANCIAL_DOCUMENT_TYPE_CODE), pMap.get(OLEPropertyConstants.FINANCIAL_SYSTEM_ORIGINATION_CODE)));
605             setFinancialSystemOriginationCode(getValue(detailLine, pMap.get(OLEPropertyConstants.FINANCIAL_SYSTEM_ORIGINATION_CODE), pMap.get(OLEPropertyConstants.DOCUMENT_NUMBER)));
606             setDocumentNumber(getValue(detailLine, pMap.get(OLEPropertyConstants.DOCUMENT_NUMBER), pMap.get(OLEPropertyConstants.COLLECTOR_DETAIL_AMOUNT)));
607             try {
608                 setCollectorDetailItemAmount(getValue(detailLine, pMap.get(OLEPropertyConstants.COLLECTOR_DETAIL_AMOUNT), pMap.get(OLEPropertyConstants.COLLECTOR_DETAIL_GL_CREDIT_CODE)));
609             }
610             catch (NumberFormatException e) {
611                 setCollectorDetailItemAmount(KualiDecimal.ZERO);
612                 messageMap.putError(OLEConstants.GLOBAL_ERRORS, OLEKeyConstants.ERROR_CUSTOM, "Collector detail amount cannot be parsed on line " + lineNumber + " amount string " + detailLine.substring(pMap.get(OLEPropertyConstants.COLLECTOR_DETAIL_AMOUNT), pMap.get(OLEPropertyConstants.GL_CREDIT_CODE)));
613             }
614             if (OLEConstants.GL_CREDIT_CODE.equalsIgnoreCase(getValue(detailLine, pMap.get(OLEPropertyConstants.COLLECTOR_DETAIL_GL_CREDIT_CODE), pMap.get(OLEPropertyConstants.COLLECTOR_DETAIL_NOTE_TEXT)))) {
615                 setCollectorDetailItemAmount(getCollectorDetailItemAmount().negated());
616             }
617             setCollectorDetailNoteText(getValue(detailLine, pMap.get(OLEPropertyConstants.COLLECTOR_DETAIL_NOTE_TEXT), GeneralLedgerConstants.getSpaceAllCollectorDetailFields().length()));
618             
619             if (org.apache.commons.lang.StringUtils.isEmpty(getSubAccountNumber())) {
620                 setSubAccountNumber(OLEConstants.getDashSubAccountNumber());
621             }
622             if (org.apache.commons.lang.StringUtils.isEmpty(getFinancialSubObjectCode())) {
623                 setFinancialSubObjectCode(OLEConstants.getDashFinancialSubObjectCode());
624             }
625             if (org.apache.commons.lang.StringUtils.isEmpty(getCollectorDetailSequenceNumber())) {
626                 setCollectorDetailSequenceNumber(" ");
627             }
628         } catch (Exception e){
629             throw new RuntimeException(e + " occurred in CollectorDetail.setFromFileForCollectorDetail()");
630         }
631     }
632     
633     /**
634      * Account record balance type key 
635      * Fiscal Year - Chart Code - Account Number - Sub-account Number - Object code - Sub-object Code
636      * 
637      * For the two optional fields sub-account and sub-object code, create an additional filter to replace
638      * the usual place holder - with spaces
639      * 
640      * NOTE: this should match the same implementation in CollectorFlatFile generateAccountRecordBalanceTypeKey
641      * 
642      * @return
643      */
644     private String generateAccountRecordBalanceTypeKey() {
645         StringBuilder builder = new StringBuilder();
646         builder.append(getUniversityFiscalYear()).append("|")
647             .append(getChartOfAccountsCode()).append("|")
648             .append(getAccountNumber()).append("|")
649             .append(StringUtils.replace(getSubAccountNumber(), "-", "")).append("|")
650             .append(getFinancialObjectCode()).append("|")
651             .append(StringUtils.replace(getFinancialSubObjectCode(), "-", ""));
652         return builder.toString();
653     }
654 }