001: /*
002: * Copyright 2006-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:
017: package org.kuali.module.financial.rules;
018:
019: import static org.kuali.module.financial.rules.TransferOfFundsDocumentRuleConstants.YEAR_END_TRANSFER_OF_FUNDS_DOC_TYPE_CODE;
020:
021: import org.kuali.kfs.bo.AccountingLine;
022: import org.kuali.kfs.bo.GeneralLedgerPendingEntry;
023: import org.kuali.kfs.document.AccountingDocument;
024: import org.kuali.module.financial.document.BudgetAdjustmentDocument;
025: import org.kuali.module.financial.document.YearEndDocumentUtil;
026:
027: /**
028: * Business rules applicable to <code>YearEndBudgetAdjustmentDocument</code>
029: */
030: public class YearEndBudgetAdjustmentDocumentRule extends
031: BudgetAdjustmentDocumentRule {
032:
033: /**
034: * This method calls the super class's overridden method to perform the general customization actions, then calls the
035: * YearEndDocumentUtil matching method to perform year end specific customization activities.
036: *
037: * @param accountingDocument The accounting document containing the general ledger pending entries being customized.
038: * @param accountingLine The accounting line the explicit general ledger pending entry was generated from.
039: * @param explicitEntry The explicit general ledger pending entry to be customized.
040: *
041: * @see org.kuali.module.financial.rules.BudgetAdjustmentDocumentRule#customizeExplicitGeneralLedgerPendingEntry(org.kuali.core.document.AccountingDocument,
042: * org.kuali.core.bo.AccountingLine, org.kuali.module.gl.bo.GeneralLedgerPendingEntry)
043: * @see YearEndDocumentUtil#customizeExplicitGeneralLedgerPendingEntry(TransactionalDocument, AccountingLine,
044: * GeneralLedgerPendingEntry)
045: */
046: @Override
047: protected void customizeExplicitGeneralLedgerPendingEntry(
048: AccountingDocument accountingDocument,
049: AccountingLine accountingLine,
050: GeneralLedgerPendingEntry explicitEntry) {
051: super .customizeExplicitGeneralLedgerPendingEntry(
052: accountingDocument, accountingLine, explicitEntry);
053: YearEndDocumentUtil.customizeExplicitGeneralLedgerPendingEntry(
054: accountingDocument, accountingLine, explicitEntry);
055: }
056:
057: /**
058: * This method calls the super class's overridden method to perform the general customization actions, then calls the
059: * YearEndDocumentUtil matching method to perform year end specific customization activities.
060: *
061: * @param accountingDocument The accounting document containing the general ledger pending entries being customized.
062: * @param accountingLine The accounting line the explicit general ledger pending entry was generated from.
063: * @param explicitEntry The explicit general ledger pending entry the offset entry is generated for.
064: * @param offsetEntry The offset general ledger pending entry being customized.
065: * @return True if the customization does not encounter any errors, false otherwise.
066: *
067: * @see org.kuali.module.financial.rules.BudgetAdjustmentDocumentRule#customizeOffsetGeneralLedgerPendingEntry(org.kuali.kfs.document.AccountingDocument,
068: * org.kuali.kfs.bo.AccountingLine, org.kuali.kfs.bo.GeneralLedgerPendingEntry, org.kuali.kfs.bo.GeneralLedgerPendingEntry)
069: * @see YearEndDocumentUtil#customizeExplicitGeneralLedgerPendingEntry(TransactionalDocument, AccountingLine,
070: * GeneralLedgerPendingEntry)
071: */
072: @Override
073: protected boolean customizeOffsetGeneralLedgerPendingEntry(
074: AccountingDocument accountingDocument,
075: AccountingLine accountingLine,
076: GeneralLedgerPendingEntry explicitEntry,
077: GeneralLedgerPendingEntry offsetEntry) {
078: boolean success = super
079: .customizeOffsetGeneralLedgerPendingEntry(
080: accountingDocument, accountingLine,
081: explicitEntry, offsetEntry);
082: YearEndDocumentUtil.customizeExplicitGeneralLedgerPendingEntry(
083: accountingDocument, accountingLine, explicitEntry);
084: return success;
085: }
086:
087: /**
088: * Overriding to return the corresponding parent class BudgetAdjustmentDocument.
089: *
090: * @param financialDocument The financial document the class will be determined for.
091: * @return The class type of the document passed in.
092: *
093: * @see org.kuali.kfs.rules.AccountingDocumentRuleBase#getAccountingLineDocumentClass(org.kuali.kfs.document.AccountingDocument)
094: */
095: @Override
096: protected Class getAccountingLineDocumentClass(
097: AccountingDocument financialDocument) {
098: return BudgetAdjustmentDocument.class;
099: }
100:
101: /**
102: * This method retrieves the year end transfer of funds document type code, which is defined as a constant in
103: * TransferOfFundsDocumentRuleConstants.
104: *
105: * @return The value defined in the constants class for year end transfer of funds document type code.
106: *
107: * @see org.kuali.module.financial.rules.BudgetAdjustmentDocumentRule#getTransferDocumentType()
108: * @see org.kuali.module.financial.rules.TransferOfFundsDocumentRuleConstants#YEAR_END_TRANSFER_OF_FUNDS_DOC_TYPE_CODE
109: */
110: @Override
111: protected String getTransferDocumentType() {
112: return YEAR_END_TRANSFER_OF_FUNDS_DOC_TYPE_CODE;
113: }
114:
115: }
|