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.fp.businessobject;
17
18 import java.sql.Date;
19 import java.util.LinkedHashMap;
20
21 import org.kuali.rice.core.api.util.type.KualiDecimal;
22 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
23
24 /**
25 * This class represents in a cashiering item in process. This cashiering item in process
26 * has an item amount, reduced amount, and remaining amount. It also has a closed and open date.
27 */
28 public class CashieringItemInProcess extends PersistableBusinessObjectBase {
29
30 private String campusCode;
31 private Integer itemIdentifier;
32 private KualiDecimal itemAmount;
33 private KualiDecimal itemReducedAmount;
34 private KualiDecimal itemRemainingAmount;
35 private KualiDecimal currentPayment;
36 private Date itemOpenDate;
37 private Date itemClosedDate;
38 private String itemDescription;
39
40 /**
41 * Default constructor.
42 */
43 public CashieringItemInProcess() {
44 }
45
46 /**
47 * Gets the campusCode attribute.
48 *
49 * @return Returns the campusCode
50 */
51 public String getCampusCode() {
52 return campusCode;
53 }
54
55 /**
56 * Sets the campusCode attribute.
57 *
58 * @param campusCode The campusCode to set.
59 */
60 public void setCampusCode(String campusCode) {
61 this.campusCode = campusCode;
62 }
63
64
65 /**
66 * Gets the itemIdentifier attribute.
67 *
68 * @return Returns the itemIdentifier
69 */
70 public Integer getItemIdentifier() {
71 return itemIdentifier;
72 }
73
74 /**
75 * Sets the itemIdentifier attribute.
76 *
77 * @param itemIdentifier The itemIdentifier to set.
78 */
79 public void setItemIdentifier(Integer itemIdentifier) {
80 this.itemIdentifier = itemIdentifier;
81 }
82
83
84 /**
85 * Gets the itemAmount attribute.
86 *
87 * @return Returns the itemAmount
88 */
89 public KualiDecimal getItemAmount() {
90 return itemAmount;
91 }
92
93 /**
94 * Sets the itemAmount attribute.
95 *
96 * @param itemAmount The itemAmount to set.
97 */
98 public void setItemAmount(KualiDecimal itemAmount) {
99 this.itemAmount = itemAmount;
100 }
101
102
103 /**
104 * Gets the itemReducedAmount attribute.
105 *
106 * @return Returns the itemReducedAmount
107 */
108 public KualiDecimal getItemReducedAmount() {
109 return itemReducedAmount;
110 }
111
112 /**
113 * Sets the itemReducedAmount attribute.
114 *
115 * @param itemReducedAmount The itemReducedAmount to set.
116 */
117 public void setItemReducedAmount(KualiDecimal itemReducedAmount) {
118 this.itemReducedAmount = itemReducedAmount;
119 }
120
121
122 /**
123 * Gets the itemRemainingAmount attribute.
124 *
125 * @return Returns the itemRemainingAmount
126 */
127 public KualiDecimal getItemRemainingAmount() {
128 return itemRemainingAmount;
129 }
130
131 /**
132 * Sets the itemRemainingAmount attribute.
133 *
134 * @param itemRemainingAmount The itemRemainingAmount to set.
135 */
136 public void setItemRemainingAmount(KualiDecimal itemTotalAmount) {
137 this.itemRemainingAmount = itemTotalAmount;
138 }
139
140
141 /**
142 * Gets the itemOpenDate attribute.
143 *
144 * @return Returns the itemOpenDate
145 */
146 public Date getItemOpenDate() {
147 return itemOpenDate;
148 }
149
150 /**
151 * Sets the itemOpenDate attribute.
152 *
153 * @param itemOpenDate The itemOpenDate to set.
154 */
155 public void setItemOpenDate(Date itemOpenDate) {
156 this.itemOpenDate = itemOpenDate;
157 }
158
159
160 /**
161 * Gets the itemClosedDate attribute.
162 *
163 * @return Returns the itemClosedDate
164 */
165 public Date getItemClosedDate() {
166 return itemClosedDate;
167 }
168
169 /**
170 * Sets the itemClosedDate attribute.
171 *
172 * @param itemClosedDate The itemClosedDate to set.
173 */
174 public void setItemClosedDate(Date itemClosedDate) {
175 this.itemClosedDate = itemClosedDate;
176 }
177
178
179 /**
180 * Gets the itemDescription attribute.
181 *
182 * @return Returns the itemDescription
183 */
184 public String getItemDescription() {
185 return itemDescription;
186 }
187
188 /**
189 * Sets the itemDescription attribute.
190 *
191 * @param itemDescription The itemDescription to set.
192 */
193 public void setItemDescription(String itemDescription) {
194 this.itemDescription = itemDescription;
195 }
196
197 /**
198 * Gets the currentPayment attribute.
199 *
200 * @return Returns the currentPayment.
201 */
202 public KualiDecimal getCurrentPayment() {
203 return currentPayment;
204 }
205
206 /**
207 * Sets the currentPayment attribute value.
208 *
209 * @param currentPayment The currentPayment to set.
210 */
211 public void setCurrentPayment(KualiDecimal currentPayment) {
212 this.currentPayment = currentPayment;
213 }
214
215 /**
216 * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
217 */
218 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
219 LinkedHashMap m = new LinkedHashMap();
220 m.put("campusCode", this.campusCode);
221 if (this.itemIdentifier != null) {
222 m.put("itemIdentifier", this.itemIdentifier.toString());
223 }
224 return m;
225 }
226
227 /**
228 * This method determines if this cashiering item in process was likely filled in by someone Since campusCode is likely
229 * automatically populated, it doesn't count
230 *
231 * @return if this item in process is populated
232 */
233 public boolean isPopulated() {
234 return (this.itemOpenDate != null && itemAmount != null && !itemAmount.equals(KualiDecimal.ZERO));
235 }
236 }