1 /*
2 * The Kuali Financial System, a comprehensive financial management system for higher education.
3 *
4 * Copyright 2005-2014 The Kuali Foundation
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as
8 * published by the Free Software Foundation, either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 package org.kuali.kfs.module.cam.document.dataaccess;
20
21 import java.sql.Date;
22 import java.util.Calendar;
23 import java.util.Collection;
24 import java.util.List;
25 import java.util.Map;
26 import java.util.Set;
27
28 import org.kuali.kfs.module.cam.batch.AssetPaymentInfo;
29 import org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry;
30 import org.kuali.rice.core.api.util.type.KualiDecimal;
31
32 /**
33 * Interface declaring DAO methods required by CAMS depreciation batch job
34 */
35 public interface DepreciationBatchDao {
36
37 /**
38 * Updates payments as batch, columns updated are accumulated depreciation amount and current period column decided by fiscal
39 * period
40 *
41 * @param assetPayments Batch of asset payments
42 * @param fiscalPeriod Current fiscal period
43 */
44 public void updateAssetPayments(List<AssetPaymentInfo> assetPayments, Integer fiscalPeriod);
45
46 /**
47 * Sum all period column and set as previous year value and then reset period columns with zero dollar
48 *
49 * @param fiscalMonth Fiscal period
50 * @throws Exception
51 */
52 public void resetPeriodValuesWhenFirstFiscalPeriod(Integer fiscalPeriod) throws Exception;
53
54 /**
55 * Updates depreciation and service date for all the assets created after last fiscal period date
56 *
57 * @param fiscalMonth fiscal month
58 * @param fiscalYear fiscal year
59 */
60 public void updateAssetsCreatedInLastFiscalPeriod(Integer fiscalMonth, Integer fiscalYear);
61
62 /**
63 * Saves a batch of GL Pending entries
64 *
65 * @param glPendingEntries GLPE list to be saved
66 */
67 public void savePendingGLEntries(final List<GeneralLedgerPendingEntry> glPendingEntries);
68
69 /**
70 * Gets the list of depreciable asset payment list and corresponding details
71 *
72 * @param fiscalYear Fiscal year
73 * @param fiscalMonth Fiscal period
74 * @param depreciationDate Depreciation Date
75 * @return List found matching depreciation criteria
76 */
77 public Collection<AssetPaymentInfo> getListOfDepreciableAssetPaymentInfo(Integer fiscalYear, Integer fiscalMonth, Calendar depreciationDate);
78
79 /**
80 * Counts the number of assets which has (SUM(Primary Depreciation Amount - Accumulated Depreciation) - Salvage Amount) is zero
81 *
82 * @return count of assets matching condition
83 */
84 public Integer getFullyDepreciatedAssetCount();
85
86 /**
87 * Primary depreciation base amount for assets with Salvage Value depreciation method code.
88 *
89 * @return Map
90 */
91 public Map<Long, KualiDecimal> getPrimaryDepreciationBaseAmountForSV();
92
93 /**
94 * Retrieves asset and asset payment count eligible for depreciation
95 *
96 * @param fiscalYear
97 * @param fiscalMonth
98 * @param depreciationDate
99 * @param inincludePending
100 * @return
101 */
102 Object[] getAssetAndPaymentCount(Integer fiscalYear, Integer fiscalMonth, final Calendar depreciationDate, boolean includePending);
103
104 /**
105 * This method...
106 *
107 * @param fiscalYear
108 * @param fiscalMonth
109 * @param depreciationDate
110 * @return
111 */
112 Object[] getFederallyOwnedAssetAndPaymentCount(Integer fiscalYear, Integer fiscalMonth, final Calendar depreciationDate);
113
114 /**
115 * Transfer document locked count
116 *
117 * @return
118 */
119 Integer getTransferDocLockedAssetCount();
120
121 /**
122 * Retirement document locked count
123 *
124 * @return
125 */
126 Integer getRetireDocLockedAssetCount();
127
128 /**
129 * Returns the list of locked asset by pending transfer and retirement documents
130 *
131 * @return
132 */
133 public Set<Long> getLockedAssets();
134
135 // CSU 6702 BEGIN
136 /**
137 * No explanation provided
138 * @param fiscalYear
139 * @param fiscalMonth
140 * @param depreciationDate
141 * @param includeRetired
142 * @return
143 */
144 public Collection<AssetPaymentInfo> getListOfDepreciableAssetPaymentInfoYearEnd(Integer fiscalYear, Integer fiscalMonth, Calendar depreciationDate, boolean includeRetired);
145 // CSU 6702 END
146
147 /**
148 * Depreciation (end of year) Period 13 assets incorrect depreciation start date
149 * <P> Get assets in accordance with,
150 * <ul>
151 * <li>Asset type has valid depreciation life time limit;
152 * <li>Asset is created in period 13 of current fiscal year;
153 * <li>Asset has depreciation convention restricted by parameter
154 * <li>Asset are movable assets. Movable assets are defined by system parameter MOVABLE_EQUIPMENT_OBJECT_SUB_TYPES
155 * </ul>
156 * @param lastFiscalYearDate
157 * @param movableEquipmentObjectSubTypes
158 * @param depreciationConventionCd
159 * @return
160 */
161 public List<Map<String, Object>> getAssetsByDepreciationConvention(Date lastFiscalYearDate, List<String> movableEquipmentObjectSubTypes, String depreciationConventionCd);
162
163 /**
164 * Depreciation (end of year) Period 13 assets incorrect depreciation start date
165 * <P> Update asset in service date and depreciation date
166 * @param selectedAssets
167 * @param inServiceDate
168 * @param depreciationDate
169 */
170 public void updateAssetInServiceAndDepreciationDate(List<String>selectedAssets, Date inServiceDate, Date depreciationDate);
171 }