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.cam.document.dataaccess;
017    
018    import java.util.Calendar;
019    import java.util.Collection;
020    import java.util.List;
021    import java.util.Map;
022    import java.util.Set;
023    
024    import org.kuali.kfs.module.cam.batch.AssetPaymentInfo;
025    import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry;
026    import org.kuali.rice.kns.util.KualiDecimal;
027    
028    /**
029     * Interface declaring DAO methods required by CAMS depreciation batch job
030     */
031    public interface DepreciationBatchDao {
032    
033        /**
034         * Updates payments as batch, columns updated are accumulated depreciation amount and current period column decided by fiscal
035         * period
036         * 
037         * @param assetPayments Batch of asset payments
038         * @param fiscalPeriod Current fiscal period
039         */
040        public void updateAssetPayments(List<AssetPaymentInfo> assetPayments, Integer fiscalPeriod);
041    
042        /**
043         * Sum all period column and set as previous year value and then reset period columns with zero dollar
044         * 
045         * @param fiscalMonth Fiscal period
046         * @throws Exception
047         */
048        public void resetPeriodValuesWhenFirstFiscalPeriod(Integer fiscalPeriod) throws Exception;
049    
050        /**
051         * Updates depreciation and service date for all the assets created after last fiscal period date
052         * 
053         * @param fiscalMonth fiscal month
054         * @param fiscalYear fiscal year
055         */
056        public void updateAssetsCreatedInLastFiscalPeriod(Integer fiscalMonth, Integer fiscalYear);
057    
058        /**
059         * Saves a batch of GL Pending entries
060         * 
061         * @param glPendingEntries GLPE list to be saved
062         */
063        public void savePendingGLEntries(final List<GeneralLedgerPendingEntry> glPendingEntries);
064    
065        /**
066         * Gets the list of depreciable asset payment list and corresponding details
067         * 
068         * @param fiscalYear Fiscal year
069         * @param fiscalMonth Fiscal period
070         * @param depreciationDate Depreciation Date
071         * @return List found matching depreciation criteria
072         */
073        public Collection<AssetPaymentInfo> getListOfDepreciableAssetPaymentInfo(Integer fiscalYear, Integer fiscalMonth, Calendar depreciationDate);
074    
075        /**
076         * Counts the number of assets which has (SUM(Primary Depreciation Amount - Accumulated Depreciation) - Salvage Amount) is zero
077         * 
078         * @return count of assets matching condition
079         */
080        public Integer getFullyDepreciatedAssetCount();
081    
082        /**
083         * Primary depreciation base amount for assets with Salvage Value depreciation method code.
084         * 
085         * @return Map
086         */
087        public Map<Long, KualiDecimal> getPrimaryDepreciationBaseAmountForSV();
088    
089        /**
090         * Retrieves asset and asset payment count eligible for depreciation
091         * 
092         * @param fiscalYear
093         * @param fiscalMonth
094         * @param depreciationDate
095         * @param inincludePending
096         * @return
097         */
098        Object[] getAssetAndPaymentCount(Integer fiscalYear, Integer fiscalMonth, final Calendar depreciationDate, boolean includePending);
099    
100        /**
101         * This method...
102         * 
103         * @param fiscalYear
104         * @param fiscalMonth
105         * @param depreciationDate
106         * @return
107         */
108        Object[] getFederallyOwnedAssetAndPaymentCount(Integer fiscalYear, Integer fiscalMonth, final Calendar depreciationDate);
109    
110        /**
111         * Transfer document locked count
112         * 
113         * @return
114         */
115        Integer getTransferDocLockedAssetCount();
116    
117        /**
118         * Retirement document locked count
119         * 
120         * @return
121         */
122        Integer getRetireDocLockedAssetCount();
123    
124        /**
125         * Returns the list of locked asset by pending transfer and retirement documents
126         * 
127         * @return
128         */
129        public Set<Long> getLockedAssets();
130    
131    }