View Javadoc
1   /*
2    * Copyright 2005 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.fp.document;
18  
19  import org.kuali.ole.fp.document.service.YearEndPendingEntryService;
20  import org.kuali.ole.sys.businessobject.AccountingLine;
21  import org.kuali.ole.sys.businessobject.GeneralLedgerPendingEntry;
22  import org.kuali.ole.sys.businessobject.GeneralLedgerPendingEntrySourceDetail;
23  import org.kuali.ole.sys.context.SpringContext;
24  import org.kuali.ole.sys.document.AccountingDocument;
25  import org.kuali.ole.sys.document.AmountTotaling;
26  
27  
28  /**
29   * Year End version of the <code>TransferOfFundsDocument</code> functionally the only difference is the accounting period code
30   * used on the glpe entries
31   */
32  public class YearEndTransferOfFundsDocument extends TransferOfFundsDocument implements YearEndDocument, AmountTotaling {
33  
34      /**
35       * Constructs a YearEndTransferOfFundsDocument.java.
36       */
37      public YearEndTransferOfFundsDocument() {
38          super();
39      }
40      
41      /**
42       * This method calls the super class's overridden method to perform the general customization actions, then calls the 
43       * YearEndDocumentUtil matching method to perform year end specific customization activities.
44       * 
45       * @param accountingDocument The accounting document containing the general ledger pending entries being customized.
46       * @param accountingLine The accounting line the explicit general ledger pending entry was generated from.
47       * @param explicitEntry The explicit general ledger pending entry to be customized.
48       * 
49       * @see org.kuali.ole.fp.document.validation.impl.TransferOfFundsDocumentRule#customizeExplicitGeneralLedgerPendingEntry(org.kuali.ole.sys.document.AccountingDocument,
50       *      org.kuali.ole.sys.businessobject.AccountingLine, org.kuali.ole.sys.businessobject.GeneralLedgerPendingEntry)
51       * @see YearEndDocumentUtil#customizeExplicitGeneralLedgerPendingEntry(TransactionalDocument, AccountingLine,
52       *      GeneralLedgerPendingEntry)
53       */
54      @Override
55      public void customizeExplicitGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail postable, GeneralLedgerPendingEntry explicitEntry) {
56          super.customizeExplicitGeneralLedgerPendingEntry(postable, explicitEntry);
57          AccountingLine accountingLine = (AccountingLine)postable;
58          SpringContext.getBean(YearEndPendingEntryService.class).customizeExplicitGeneralLedgerPendingEntry(this, accountingLine, explicitEntry);
59      }
60  
61      /**
62       * Overridden to populate object code from last year's offset definition
63       * @see org.kuali.ole.sys.document.AccountingDocumentBase#customizeOffsetGeneralLedgerPendingEntry(org.kuali.ole.sys.businessobject.GeneralLedgerPendingEntrySourceDetail, org.kuali.ole.sys.businessobject.GeneralLedgerPendingEntry, org.kuali.ole.sys.businessobject.GeneralLedgerPendingEntry)
64       */
65      @Override
66      public boolean customizeOffsetGeneralLedgerPendingEntry(GeneralLedgerPendingEntrySourceDetail accountingLine, GeneralLedgerPendingEntry explicitEntry, GeneralLedgerPendingEntry offsetEntry) {
67          boolean success = super.customizeOffsetGeneralLedgerPendingEntry(accountingLine, explicitEntry, offsetEntry);
68          success &= SpringContext.getBean(YearEndPendingEntryService.class).customizeOffsetGeneralLedgerPendingEntry(this, accountingLine, explicitEntry, offsetEntry);
69          return success;
70      }
71      
72      @Override
73      public Class<? extends AccountingDocument> getDocumentClassForAccountingLineValueAllowedValidation() {
74          return TransferOfFundsDocument.class;
75      }
76  }