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