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