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.fp.businessobject; 017 018 import java.sql.Date; 019 import java.util.LinkedHashMap; 020 021 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase; 022 import org.kuali.rice.kns.util.KualiDecimal; 023 024 /** 025 * This class represents in a cashiering item in process. This cashiering item in process 026 * has an item amount, reduced amount, and remaining amount. It also has a closed and open date. 027 */ 028 public class CashieringItemInProcess extends PersistableBusinessObjectBase { 029 030 private String campusCode; 031 private Integer itemIdentifier; 032 private KualiDecimal itemAmount; 033 private KualiDecimal itemReducedAmount; 034 private KualiDecimal itemRemainingAmount; 035 private KualiDecimal currentPayment; 036 private Date itemOpenDate; 037 private Date itemClosedDate; 038 private String itemDescription; 039 040 /** 041 * Default constructor. 042 */ 043 public CashieringItemInProcess() { 044 } 045 046 /** 047 * Gets the campusCode attribute. 048 * 049 * @return Returns the campusCode 050 */ 051 public String getCampusCode() { 052 return campusCode; 053 } 054 055 /** 056 * Sets the campusCode attribute. 057 * 058 * @param campusCode The campusCode to set. 059 */ 060 public void setCampusCode(String campusCode) { 061 this.campusCode = campusCode; 062 } 063 064 065 /** 066 * Gets the itemIdentifier attribute. 067 * 068 * @return Returns the itemIdentifier 069 */ 070 public Integer getItemIdentifier() { 071 return itemIdentifier; 072 } 073 074 /** 075 * Sets the itemIdentifier attribute. 076 * 077 * @param itemIdentifier The itemIdentifier to set. 078 */ 079 public void setItemIdentifier(Integer itemIdentifier) { 080 this.itemIdentifier = itemIdentifier; 081 } 082 083 084 /** 085 * Gets the itemAmount attribute. 086 * 087 * @return Returns the itemAmount 088 */ 089 public KualiDecimal getItemAmount() { 090 return itemAmount; 091 } 092 093 /** 094 * Sets the itemAmount attribute. 095 * 096 * @param itemAmount The itemAmount to set. 097 */ 098 public void setItemAmount(KualiDecimal itemAmount) { 099 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.kns.bo.BusinessObjectBase#toStringMapper() 217 */ 218 protected LinkedHashMap toStringMapper() { 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 }