001    /*
002     * Copyright 2011 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     */
016    package org.kuali.kfs.module.ld.document;
017    
018    import java.util.List;
019    
020    import org.kuali.kfs.integration.ld.LaborLedgerPendingEntryForSearching;
021    import org.kuali.kfs.module.ld.businessobject.ExpenseTransferAccountingLine;
022    import org.kuali.kfs.module.ld.businessobject.LaborLedgerPendingEntry;
023    import org.kuali.kfs.module.ld.util.LaborPendingEntryGenerator;
024    import org.kuali.kfs.sys.businessobject.AccountingLine;
025    import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySequenceHelper;
026    
027    /**
028     * Labor Document class for the Benefit Expense Transfer Document and a base class for the year end benefit expense transfer
029     * document
030     */
031    
032    public class BenefitExpenseTransferDocument extends LaborExpenseTransferDocumentBase {
033        protected static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(BenefitExpenseTransferDocument.class);
034    
035        /**
036         * Default Constructor.
037         */
038        public BenefitExpenseTransferDocument() {
039            super();
040        }
041        
042        /**
043         * @see org.kuali.kfs.module.ld.document.LaborExpenseTransferDocumentBase#generateLaborLedgerPendingEntries(org.kuali.kfs.sys.businessobject.AccountingLine, org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySequenceHelper)
044         */
045        public boolean generateLaborLedgerPendingEntries(AccountingLine accountingLine, GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
046            LOG.info("started processGenerateLaborLedgerPendingEntries()");
047            boolean isSuccessful = true;
048            ExpenseTransferAccountingLine expenseTransferAccountingLine = (ExpenseTransferAccountingLine) accountingLine;
049            
050            List<LaborLedgerPendingEntry> expensePendingEntries = LaborPendingEntryGenerator.generateExpensePendingEntries(this, expenseTransferAccountingLine, sequenceHelper);
051            if (expensePendingEntries != null && !expensePendingEntries.isEmpty()) {
052                isSuccessful &= this.getLaborLedgerPendingEntries().addAll(expensePendingEntries);
053            }
054            
055            return isSuccessful;
056        }
057    
058        /**
059         * @see org.kuali.kfs.module.ld.document.LaborExpenseTransferDocumentBase#generateLaborLedgerBenefitClearingPendingEntries(org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySequenceHelper)
060         */
061        public boolean generateLaborLedgerBenefitClearingPendingEntries(GeneralLedgerPendingEntrySequenceHelper sequenceHelper) {
062            return true;
063        }
064        
065        public List getLaborLedgerPendingEntriesForSearching() {
066            return super.getLaborLedgerPendingEntries();
067        }
068        
069    }