View Javadoc
1   /*
2    * Copyright 2007 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.gl.businessobject;
17  
18  import java.util.LinkedHashMap;
19  
20  import org.kuali.ole.coa.businessobject.Account;
21  import org.kuali.ole.coa.businessobject.Chart;
22  import org.kuali.ole.coa.businessobject.OrganizationReversionCategory;
23  import org.kuali.ole.coa.businessobject.SubAccount;
24  import org.kuali.rice.core.api.util.type.KualiDecimal;
25  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
26  
27  /**
28   * This class represents a organization reversion unit of work category amount
29   */
30  public class OrgReversionUnitOfWorkCategoryAmount extends PersistableBusinessObjectBase {
31      private String chartOfAccountsCode;
32      private String accountNumber;
33      private String subAccountNumber;
34      private String categoryCode;
35      private KualiDecimal actual = KualiDecimal.ZERO;
36      private KualiDecimal budget = KualiDecimal.ZERO;
37      private KualiDecimal encumbrance = KualiDecimal.ZERO;
38      private KualiDecimal carryForward = KualiDecimal.ZERO;
39      private KualiDecimal available = KualiDecimal.ZERO;
40  
41      private Chart chartOfAccounts;
42      private Account account;
43      private SubAccount subAccount;
44      private OrganizationReversionCategory organizationReversionCategory;
45      private OrgReversionUnitOfWork organizationReversionUnitOfWork;
46  
47      public OrgReversionUnitOfWorkCategoryAmount(String cat) {
48          this.categoryCode = cat;
49      }
50  
51      public OrgReversionUnitOfWorkCategoryAmount(String chartOfAccountsCode, String accountNbr, String subAccountNbr, String cat) {
52          this.chartOfAccountsCode = chartOfAccountsCode;
53          this.accountNumber = accountNbr;
54          this.subAccountNumber = subAccountNbr;
55          categoryCode = cat;
56      }
57  
58      public void addActual(KualiDecimal amount) {
59          actual = actual.add(amount);
60      }
61  
62      public void addBudget(KualiDecimal amount) {
63          budget = budget.add(amount);
64      }
65  
66      public void addEncumbrance(KualiDecimal amount) {
67          encumbrance = encumbrance.add(amount);
68      }
69  
70      public void addCarryForward(KualiDecimal amount) {
71          carryForward = carryForward.add(amount);
72      }
73  
74      public void addAvailable(KualiDecimal amount) {
75          available = available.add(amount);
76      }
77  
78      public KualiDecimal getAvailable() {
79          return available;
80      }
81  
82      public void setAvailable(KualiDecimal available) {
83          this.available = available;
84      }
85  
86      public KualiDecimal getActual() {
87          return actual;
88      }
89  
90      public void setActual(KualiDecimal actual) {
91          this.actual = actual;
92      }
93  
94      public KualiDecimal getBudget() {
95          return budget;
96      }
97  
98      public void setBudget(KualiDecimal budget) {
99          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.krad.bo.BusinessObjectBase#toStringMapper()
272      */
273     
274     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
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 }