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.module.cam.document;
017
018 import java.util.LinkedHashMap;
019 import java.util.List;
020
021 import org.kuali.kfs.module.cam.CamsConstants;
022 import org.kuali.kfs.module.cam.businessobject.BarcodeInventoryErrorDetail;
023 import org.kuali.kfs.sys.document.FinancialSystemTransactionalDocumentBase;
024 import org.kuali.rice.kns.util.TypedArrayList;
025 public class BarcodeInventoryErrorDocument extends FinancialSystemTransactionalDocumentBase {
026 protected static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(BarcodeInventoryErrorDocument.class);
027
028 protected String documentNumber;
029 protected String uploaderUniversalIdentifier;
030
031 //global replace - search fields
032 //*** Old values **************
033 protected String currentTagNumber;
034 protected String currentScanCode;
035 protected String currentCampusCode;
036 protected String currentBuildingNumber;
037 protected String currentRoom;
038 protected String currentSubroom;
039 protected String currentConditionCode;
040
041 //*** New values **************
042 protected String newTagNumber;
043 protected String newScanCode;
044 protected String newCampusCode;
045 protected String newBuildingNumber;
046 protected String newRoom;
047 protected String newSubroom;
048 protected String newConditionCode;
049
050 protected List<BarcodeInventoryErrorDetail> barcodeInventoryErrorDetail;
051
052 /**
053 * Default constructor.
054 */
055 public BarcodeInventoryErrorDocument() {
056 super();
057 this.setBarcodeInventoryErrorDetail(new TypedArrayList(BarcodeInventoryErrorDetail.class));
058 }
059
060 /**
061 * Gets the documentNumber attribute.
062 *
063 * @return Returns the documentNumber
064 *
065 */
066 public String getDocumentNumber() {
067 return documentNumber;
068 }
069
070 /**
071 * Sets the documentNumber attribute.
072 *
073 * @param documentNumber The documentNumber to set.
074 *
075 */
076 public void setDocumentNumber(String documentNumber) {
077 this.documentNumber = documentNumber;
078 }
079
080
081 /**
082 * Gets the uploaderUniversalIdentifier attribute.
083 *
084 * @return Returns the uploaderUniversalIdentifier
085 *
086 */
087 public String getUploaderUniversalIdentifier() {
088 return uploaderUniversalIdentifier;
089 }
090
091 /**
092 * Sets the uploaderUniversalIdentifier attribute.
093 *
094 * @param uploaderUniversalIdentifier The uploaderUniversalIdentifier to set.
095 *
096 */
097 public void setUploaderUniversalIdentifier(String uploaderUniversalIdentifier) {
098 this.uploaderUniversalIdentifier = uploaderUniversalIdentifier;
099 }
100
101 public List<BarcodeInventoryErrorDetail> getBarcodeInventoryErrorDetail() {
102 return barcodeInventoryErrorDetail;
103 }
104
105 public void setBarcodeInventoryErrorDetail(List<BarcodeInventoryErrorDetail> barcodeInventoryErrorDetails) {
106 this.barcodeInventoryErrorDetail = barcodeInventoryErrorDetails;
107 }
108
109
110 /**
111 * Determines the document had all its records corrected
112 *
113 * @return boolean
114 */
115 public boolean isDocumentCorrected() {
116 for(BarcodeInventoryErrorDetail detail:this.getBarcodeInventoryErrorDetail() ) {
117 if (detail.getErrorCorrectionStatusCode().equals(CamsConstants.BarCodeInventoryError.STATUS_CODE_ERROR))
118 return false;
119 }
120 return true;
121 }
122
123
124 /**
125 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
126 */
127 protected LinkedHashMap toStringMapper() {
128 LinkedHashMap m = new LinkedHashMap();
129 m.put("documentNumber", this.documentNumber);
130 return m;
131 }
132
133 public String getCurrentTagNumber() {
134 return currentTagNumber;
135 }
136
137 public void setCurrentTagNumber(String currentTagNumber) {
138 this.currentTagNumber = currentTagNumber;
139 }
140
141 public String getCurrentScanCode() {
142 return currentScanCode;
143 }
144
145 public void setCurrentScanCode(String currentScanCode) {
146 this.currentScanCode = currentScanCode;
147 }
148
149 public String getCurrentCampusCode() {
150 return currentCampusCode;
151 }
152
153 public void setCurrentCampusCode(String currentCampusCode) {
154 this.currentCampusCode = currentCampusCode;
155 }
156
157 public String getCurrentBuildingNumber() {
158 return currentBuildingNumber;
159 }
160
161 public void setCurrentBuildingNumber(String currentBuildingNumber) {
162 this.currentBuildingNumber = currentBuildingNumber;
163 }
164
165 public String getCurrentRoom() {
166 return currentRoom;
167 }
168
169 public void setCurrentRoom(String currentRoom) {
170 this.currentRoom = currentRoom;
171 }
172
173 public String getCurrentSubroom() {
174 return currentSubroom;
175 }
176
177 public void setCurrentSubroom(String currentSubroom) {
178 this.currentSubroom = currentSubroom;
179 }
180
181 public String getCurrentConditionCode() {
182 return currentConditionCode;
183 }
184
185 public void setCurrentConditionCode(String currentConditionCode) {
186 this.currentConditionCode = currentConditionCode;
187 }
188
189 public String getNewTagNumber() {
190 return newTagNumber;
191 }
192
193 public void setNewTagNumber(String newTagNumber) {
194 this.newTagNumber = newTagNumber;
195 }
196
197 public String getNewScanCode() {
198 return newScanCode;
199 }
200
201 public void setNewScanCode(String newScanCode) {
202 this.newScanCode = newScanCode;
203 }
204
205 public String getNewCampusCode() {
206 return newCampusCode;
207 }
208
209 public void setNewCampusCode(String newCampusCode) {
210 this.newCampusCode = newCampusCode;
211 }
212
213 public String getNewBuildingNumber() {
214 return newBuildingNumber;
215 }
216
217 public void setNewBuildingNumber(String newBuildingNumber) {
218 this.newBuildingNumber = newBuildingNumber;
219 }
220
221 public String getNewRoom() {
222 return newRoom;
223 }
224
225 public void setNewRoom(String newRoom) {
226 this.newRoom = newRoom;
227 }
228
229 public String getNewSubroom() {
230 return newSubroom;
231 }
232
233 public void setNewSubroom(String newSubroom) {
234 this.newSubroom = newSubroom;
235 }
236
237 public String getNewConditionCode() {
238 return newConditionCode;
239 }
240
241 public void setNewConditionCode(String newConditionCode) {
242 this.newConditionCode = newConditionCode;
243 }
244
245 public void resetSearchFields() {
246 currentTagNumber="";
247 currentScanCode="";
248 currentCampusCode="";
249 currentBuildingNumber="";
250 currentRoom="";
251 currentSubroom="";
252 currentConditionCode="";
253 newTagNumber="";
254 newScanCode="";
255 newCampusCode="";
256 newBuildingNumber="";
257 newRoom="";
258 newSubroom="";
259 newConditionCode="";
260 }
261 }