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.gl.businessobject;
017
018 import java.util.LinkedHashMap;
019
020 import org.kuali.kfs.coa.businessobject.Account;
021 import org.kuali.kfs.coa.businessobject.Chart;
022 import org.kuali.kfs.coa.businessobject.OrganizationReversionCategory;
023 import org.kuali.kfs.coa.businessobject.SubAccount;
024 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
025 import org.kuali.rice.kns.util.KualiDecimal;
026
027 /**
028 * This class represents a organization reversion unit of work category amount
029 */
030 public class OrgReversionUnitOfWorkCategoryAmount extends PersistableBusinessObjectBase {
031 private String chartOfAccountsCode;
032 private String accountNumber;
033 private String subAccountNumber;
034 private String categoryCode;
035 private KualiDecimal actual = KualiDecimal.ZERO;
036 private KualiDecimal budget = KualiDecimal.ZERO;
037 private KualiDecimal encumbrance = KualiDecimal.ZERO;
038 private KualiDecimal carryForward = KualiDecimal.ZERO;
039 private KualiDecimal available = KualiDecimal.ZERO;
040
041 private Chart chartOfAccounts;
042 private Account account;
043 private SubAccount subAccount;
044 private OrganizationReversionCategory organizationReversionCategory;
045 private OrgReversionUnitOfWork organizationReversionUnitOfWork;
046
047 public OrgReversionUnitOfWorkCategoryAmount(String cat) {
048 this.categoryCode = cat;
049 }
050
051 public OrgReversionUnitOfWorkCategoryAmount(String chartOfAccountsCode, String accountNbr, String subAccountNbr, String cat) {
052 this.chartOfAccountsCode = chartOfAccountsCode;
053 this.accountNumber = accountNbr;
054 this.subAccountNumber = subAccountNbr;
055 categoryCode = cat;
056 }
057
058 public void addActual(KualiDecimal amount) {
059 actual = actual.add(amount);
060 }
061
062 public void addBudget(KualiDecimal amount) {
063 budget = budget.add(amount);
064 }
065
066 public void addEncumbrance(KualiDecimal amount) {
067 encumbrance = encumbrance.add(amount);
068 }
069
070 public void addCarryForward(KualiDecimal amount) {
071 carryForward = carryForward.add(amount);
072 }
073
074 public void addAvailable(KualiDecimal amount) {
075 available = available.add(amount);
076 }
077
078 public KualiDecimal getAvailable() {
079 return available;
080 }
081
082 public void setAvailable(KualiDecimal available) {
083 this.available = available;
084 }
085
086 public KualiDecimal getActual() {
087 return actual;
088 }
089
090 public void setActual(KualiDecimal actual) {
091 this.actual = actual;
092 }
093
094 public KualiDecimal getBudget() {
095 return budget;
096 }
097
098 public void setBudget(KualiDecimal budget) {
099 this.budget = budget;
100 }
101
102 public String getCategoryCode() {
103 return categoryCode;
104 }
105
106 public void setCategoryCode(String categoryCode) {
107 this.categoryCode = categoryCode;
108 }
109
110 public KualiDecimal getEncumbrance() {
111 return encumbrance;
112 }
113
114 public void setEncumbrance(KualiDecimal encumbrance) {
115 this.encumbrance = encumbrance;
116 }
117
118 public KualiDecimal getCarryForward() {
119 return carryForward;
120 }
121
122 public void setCarryForward(KualiDecimal carryForward) {
123 this.carryForward = carryForward;
124 }
125
126 /**
127 * Gets the accountNbr attribute.
128 *
129 * @return Returns the accountNbr.
130 */
131 public String getAccountNumber() {
132 return accountNumber;
133 }
134
135 /**
136 * Sets the accountNbr attribute value.
137 *
138 * @param accountNbr The accountNbr to set.
139 */
140 public void setAccountNumber(String accountNbr) {
141 this.accountNumber = accountNbr;
142 }
143
144 /**
145 * Gets the chartOfAccountsCode attribute.
146 *
147 * @return Returns the chartOfAccountsCode.
148 */
149 public String getChartOfAccountsCode() {
150 return chartOfAccountsCode;
151 }
152
153 /**
154 * Sets the chartOfAccountsCode attribute value.
155 *
156 * @param chartOfAccountsCode The chartOfAccountsCode to set.
157 */
158 public void setChartOfAccountsCode(String chartOfAccountsCode) {
159 this.chartOfAccountsCode = chartOfAccountsCode;
160 }
161
162 /**
163 * Gets the subAccountNbr attribute.
164 *
165 * @return Returns the subAccountNbr.
166 */
167 public String getSubAccountNumber() {
168 return subAccountNumber;
169 }
170
171 /**
172 * Sets the subAccountNbr attribute value.
173 *
174 * @param subAccountNbr The subAccountNbr to set.
175 */
176 public void setSubAccountNumber(String subAccountNbr) {
177 this.subAccountNumber = subAccountNbr;
178 }
179
180 /**
181 * Gets the account attribute.
182 *
183 * @return Returns the account.
184 */
185 public Account getAccount() {
186 return account;
187 }
188
189 /**
190 * Sets the account attribute value.
191 *
192 * @param account The account to set.
193 */
194 public void setAccount(Account account) {
195 this.account = account;
196 }
197
198 /**
199 * Gets the chartOfAccounts attribute.
200 *
201 * @return Returns the chartOfAccounts.
202 */
203 public Chart getChartOfAccounts() {
204 return chartOfAccounts;
205 }
206
207 /**
208 * Sets the chartOfAccounts attribute value.
209 *
210 * @param chartOfAccounts The chartOfAccounts to set.
211 */
212 public void setChartOfAccounts(Chart chartOfAccounts) {
213 this.chartOfAccounts = chartOfAccounts;
214 }
215
216 /**
217 * Gets the organizationReversionCategory attribute.
218 *
219 * @return Returns the organizationReversionCategory.
220 */
221 public OrganizationReversionCategory getOrganizationReversionCategory() {
222 return organizationReversionCategory;
223 }
224
225 /**
226 * Sets the organizationReversionCategory attribute value.
227 *
228 * @param organizationReversionCategory The organizationReversionCategory to set.
229 */
230 public void setOrganizationReversionCategory(OrganizationReversionCategory organizationReversionCategory) {
231 this.organizationReversionCategory = organizationReversionCategory;
232 }
233
234 /**
235 * Gets the organizationReversionUnitOfWork attribute.
236 *
237 * @return Returns the organizationReversionUnitOfWork.
238 */
239 public OrgReversionUnitOfWork getOrganizationReversionUnitOfWork() {
240 return organizationReversionUnitOfWork;
241 }
242
243 /**
244 * Sets the organizationReversionUnitOfWork attribute value.
245 *
246 * @param organizationReversionUnitOfWork The organizationReversionUnitOfWork to set.
247 */
248 public void setOrganizationReversionUnitOfWork(OrgReversionUnitOfWork organizationReversionUnitOfWork) {
249 this.organizationReversionUnitOfWork = organizationReversionUnitOfWork;
250 }
251
252 /**
253 * Gets the subAccount attribute.
254 *
255 * @return Returns the subAccount.
256 */
257 public SubAccount getSubAccount() {
258 return subAccount;
259 }
260
261 /**
262 * Sets the subAccount attribute value.
263 *
264 * @param subAccount The subAccount to set.
265 */
266 public void setSubAccount(SubAccount subAccount) {
267 this.subAccount = subAccount;
268 }
269
270 /**
271 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
272 */
273 @Override
274 protected LinkedHashMap toStringMapper() {
275 LinkedHashMap pkMap = new LinkedHashMap();
276 pkMap.put("chartOfAccountsCode", this.chartOfAccountsCode);
277 pkMap.put("accountNbr", this.accountNumber);
278 pkMap.put("subAccountNbr", this.subAccountNumber);
279 pkMap.put("categoryCode", this.categoryCode);
280 return pkMap;
281 }
282
283 }