1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.kuali.kfs.fp.businessobject;
20
21 import java.sql.Date;
22 import java.util.LinkedHashMap;
23
24 import org.apache.commons.lang.StringUtils;
25 import org.apache.commons.lang.time.DateUtils;
26 import org.kuali.rice.core.api.util.type.KualiDecimal;
27 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
28 import org.springframework.util.ObjectUtils;
29
30
31
32
33
34
35 public class CheckBase extends PersistableBusinessObjectBase implements Check {
36 private String checkNumber;
37 private Date checkDate;
38 private String description;
39 private Integer sequenceId;
40 private KualiDecimal amount;
41 private String documentNumber;
42 private String financialDocumentTypeCode;
43 private String cashieringStatus;
44 private Integer financialDocumentDepositLineNumber;
45
46
47
48
49 public CheckBase() {
50 super();
51 this.sequenceId = new Integer(1);
52 this.amount = KualiDecimal.ZERO;
53 }
54
55
56
57
58
59
60 @Override
61 public Date getCheckDate() {
62 return checkDate;
63 }
64
65
66
67
68
69
70 @Override
71 public void setCheckDate(Date checkDate) {
72 this.checkDate = checkDate;
73 }
74
75
76
77
78
79
80 @Override
81 public String getCheckNumber() {
82 return checkNumber;
83 }
84
85
86
87
88
89
90 @Override
91 public void setCheckNumber(String checkNumber) {
92 this.checkNumber = checkNumber;
93 }
94
95
96
97
98
99
100 @Override
101 public String getDescription() {
102 return description;
103 }
104
105
106
107
108
109
110 @Override
111 public void setDescription(String description) {
112 this.description = description;
113 }
114
115
116
117
118
119
120 @Override
121 public Integer getSequenceId() {
122 return sequenceId;
123 }
124
125
126
127
128
129
130 @Override
131 public void setSequenceId(Integer sequenceId) {
132 this.sequenceId = sequenceId;
133 }
134
135
136
137
138
139
140 @Override
141 public KualiDecimal getAmount() {
142 return amount;
143 }
144
145
146
147
148
149
150 @Override
151 public void setAmount(KualiDecimal amount) {
152 this.amount = amount;
153 }
154
155
156
157
158
159
160
161 @Override
162 public String getDocumentNumber() {
163 return documentNumber;
164 }
165
166
167
168
169
170
171 @Override
172 public void setDocumentNumber(String documentNumber) {
173 this.documentNumber = documentNumber;
174 }
175
176
177
178
179
180
181 @Override
182 public String getCashieringStatus() {
183 return cashieringStatus;
184 }
185
186
187
188
189
190
191 @Override
192 public void setCashieringStatus(String financialDocumentColumnTypeCode) {
193 this.cashieringStatus = financialDocumentColumnTypeCode;
194 }
195
196
197
198
199
200
201 @Override
202 public String getFinancialDocumentTypeCode() {
203 return financialDocumentTypeCode;
204 }
205
206
207
208
209
210
211 @Override
212 public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) {
213 this.financialDocumentTypeCode = financialDocumentTypeCode;
214 }
215
216
217
218
219
220
221 @Override
222 public Integer getFinancialDocumentDepositLineNumber() {
223 return financialDocumentDepositLineNumber;
224 }
225
226
227
228
229
230
231 @Override
232 public void setFinancialDocumentDepositLineNumber(Integer financialDocumentDepositLineNumber) {
233 this.financialDocumentDepositLineNumber = financialDocumentDepositLineNumber;
234 }
235
236
237
238
239 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
240 LinkedHashMap m = new LinkedHashMap();
241
242 m.put("sequenceId", this.sequenceId);
243 m.put("checkNumber", this.checkNumber);
244 m.put("amount", this.amount);
245 m.put("checkDate", this.checkDate);
246 m.put("financialDocumentDepositLineNumber", this.financialDocumentDepositLineNumber);
247 m.put("description", this.description);
248 m.put("documentHeaderId", this.documentNumber);
249 m.put("financialDocumentTypeCode", this.financialDocumentTypeCode);
250 m.put("cashieringStatus", this.cashieringStatus);
251
252 return m;
253 }
254
255
256
257
258
259 @Override
260 public boolean isLike(Check other) {
261 boolean like = false;
262
263 if (StringUtils.equals(checkNumber, other.getCheckNumber())) {
264 if (StringUtils.equals(description, other.getDescription())) {
265 if (StringUtils.equals(financialDocumentTypeCode, other.getFinancialDocumentTypeCode()) && StringUtils.equals(cashieringStatus, other.getCashieringStatus())) {
266 if (StringUtils.equals(documentNumber, other.getDocumentNumber())) {
267 if (ObjectUtils.nullSafeEquals(sequenceId, other.getSequenceId())) {
268 if (ObjectUtils.nullSafeEquals(financialDocumentDepositLineNumber, other.getFinancialDocumentDepositLineNumber())) {
269
270 if (DateUtils.isSameDay(checkDate, other.getCheckDate())) {
271 if ((amount != null) && amount.equals(other.getAmount())) {
272 like = true;
273 }
274 }
275 }
276 }
277 }
278 }
279 }
280 }
281
282 return like;
283 }
284 }