1 package org.kuali.ole.deliver.bo;
2
3
4 import org.kuali.ole.OLEConstants;
5 import org.kuali.rice.core.api.util.type.KualiDecimal;
6 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
7 import org.kuali.rice.krad.util.GlobalVariables;
8
9 import java.math.BigDecimal;
10 import java.sql.Date;
11 import java.util.ArrayList;
12 import java.util.LinkedHashMap;
13 import java.util.List;
14
15
16
17
18
19 public class PatronBillPayment extends PersistableBusinessObjectBase {
20
21
22 private KualiDecimal totalAmount;
23 private String billNumber;
24 private Date billDate;
25 private FeeType patronFeeType;
26 private String patronId;
27 private String proxyPatronId;
28 private String freeTextNote;
29 private List<FeeType> feeType = new ArrayList<FeeType>();
30 private KualiDecimal unPaidBalance = new KualiDecimal(0);
31 private String paymentMethod;
32 private KualiDecimal paymentAmount;
33 private String paymentOperatorId;
34 private String paymentMachineId;
35 private Date payDate;
36
37 private String machineId;
38 private String note;
39 private String operatorId = "test";
40 private String proxyPatronName;
41 private List<org.kuali.ole.deliver.bo.SystemGeneratedBill> sysGeneratedBill = new ArrayList<org.kuali.ole.deliver.bo.SystemGeneratedBill>();
42 private boolean reviewed;
43 private String firstName;
44 private String lastName;
45 private String patronName;
46 private boolean selectBill;
47 private String paymentStatusCode;
48 private String paymentStatusName;
49 private String errorMessage;
50 private boolean zeroFeeAmount;
51 private boolean requiredFeeAmount;
52 private KualiDecimal paidAmount = new KualiDecimal(0);
53
54 private OlePatronDocument olePatron = new OlePatronDocument();
55
56 public KualiDecimal getPaidAmount() {
57
58
59
60 return paidAmount;
61 }
62
63 public String getPatronName() {
64 if(olePatron!=null){
65 this.patronName = olePatron.getEntity().getNames().get(0).getFirstName() + " " + olePatron.getEntity().getNames().get(0).getLastName();
66 }
67 return patronName;
68 }
69
70
71
72 public void setPaidAmount(KualiDecimal paidAmount) {
73 this.paidAmount = paidAmount;
74 }
75
76 public String getPaymentStatusName() {
77 return paymentStatusName;
78 }
79
80 public void setPaymentStatusName(String paymentStatusName) {
81 this.paymentStatusName = paymentStatusName;
82 }
83
84 public String getPaymentStatusCode() {
85
86 for (FeeType feeTypeObj : feeType) {
87 if (feeTypeObj.getPaymentStatusCode().equalsIgnoreCase(OLEConstants.PAY_STATUS_OUTSTANDING_CODE)) {
88 paymentStatusName = feeTypeObj.getOlePaymentStatus().getPaymentStatusName();
89 return feeTypeObj.getPaymentStatusCode();
90 } else if (feeTypeObj.getPaymentStatusCode().equalsIgnoreCase(OLEConstants.PAY_STATUS_PART_CODE)) {
91 paymentStatusName = feeTypeObj.getOlePaymentStatus().getPaymentStatusName();
92 return feeTypeObj.getPaymentStatusCode();
93 } else if (feeTypeObj.getPaymentStatusCode().equalsIgnoreCase(OLEConstants.PAY_STATUS_ERROR_CODE)) {
94 paymentStatusName = feeTypeObj.getOlePaymentStatus().getPaymentStatusName();
95 return feeTypeObj.getPaymentStatusCode();
96 } else if (feeTypeObj.getPaymentStatusCode().equalsIgnoreCase(OLEConstants.PAY_STATUS_FORGIVEN_CODE)) {
97 paymentStatusName = feeTypeObj.getOlePaymentStatus().getPaymentStatusName();
98 return feeTypeObj.getPaymentStatusCode();
99 } else if (feeTypeObj.getPaymentStatusCode().equalsIgnoreCase(OLEConstants.PAY_STATUS_FULL_CODE)) {
100 paymentStatusName = feeTypeObj.getOlePaymentStatus().getPaymentStatusName();
101 return feeTypeObj.getPaymentStatusCode();
102 } else if (feeTypeObj.getPaymentStatusCode().equalsIgnoreCase(OLEConstants.PAY_STATUS_CANCEL_CODE)) {
103 paymentStatusName = feeTypeObj.getOlePaymentStatus().getPaymentStatusName();
104 return feeTypeObj.getPaymentStatusCode();
105 } else {
106 paymentStatusName = feeTypeObj.getOlePaymentStatus().getPaymentStatusName();
107 return feeTypeObj.getPaymentStatusCode();
108 }
109 }
110 return paymentStatusCode != null ? paymentStatusCode : "";
111 }
112
113 public void setPaymentStatusCode(String paymentStatusCode) {
114 this.paymentStatusCode = paymentStatusCode;
115 }
116
117 public boolean isSelectBill() {
118 return selectBill;
119 }
120
121 public void setSelectBill(boolean selectBill) {
122 this.selectBill = selectBill;
123 }
124
125 public String getFirstName() {
126 return firstName;
127 }
128
129 public void setFirstName(String firstName) {
130 this.firstName = firstName;
131 }
132
133 public String getLastName() {
134 return lastName;
135 }
136
137 public void setLastName(String lastName) {
138 this.lastName = lastName;
139 }
140
141
142
143
144
145
146 public String getNote() {
147 return note;
148 }
149
150
151
152
153
154
155 public void setNote(String note) {
156 this.note = note;
157 }
158
159
160
161
162
163
164 public String getMachineId() {
165 return machineId;
166 }
167
168
169
170
171
172
173 public void setMachineId(String machineId) {
174 this.machineId = machineId;
175 }
176
177
178
179
180
181
182 public String getOperatorId() {
183 return operatorId;
184 }
185
186
187
188
189
190
191 public void setOperatorId(String operatorId) {
192 if (operatorId == null || (operatorId != null && operatorId.isEmpty()))
193 operatorId = GlobalVariables.getUserSession().getLoggedInUserPrincipalName();
194 this.operatorId = operatorId;
195 }
196
197
198
199
200
201
202 public Date getPayDate() {
203 return payDate;
204 }
205
206
207
208
209
210
211 public void setPayDate(Date payDate) {
212 this.payDate = payDate;
213 }
214
215
216
217
218
219
220 public String getPaymentMachineId() {
221 return paymentMachineId;
222 }
223
224
225
226
227
228
229 public void setPaymentMachineId(String paymentMachineId) {
230 this.paymentMachineId = paymentMachineId;
231 }
232
233
234
235
236
237
238 public String getPaymentOperatorId() {
239 return paymentOperatorId;
240 }
241
242
243
244
245
246
247 public void setPaymentOperatorId(String paymentOperatorId) {
248 this.paymentOperatorId = paymentOperatorId;
249 }
250
251
252
253
254
255
256 public String getPaymentMethod() {
257 return paymentMethod;
258 }
259
260
261
262
263
264
265 public void setPaymentMethod(String paymentMethod) {
266 this.paymentMethod = paymentMethod;
267 }
268
269
270
271
272
273
274 public String getPatronId() {
275 return patronId;
276 }
277
278
279
280
281
282
283 public void setPatronId(String patronId) {
284 this.patronId = patronId;
285 }
286
287
288
289
290
291
292 public String getProxyPatronId() {
293 return proxyPatronId;
294 }
295
296
297
298
299
300
301 public void setProxyPatronId(String proxyPatronId) {
302 this.proxyPatronId = proxyPatronId;
303 }
304
305
306
307
308
309
310 public FeeType getPatronFeeType() {
311 return patronFeeType;
312 }
313
314
315
316
317
318
319 public void setPatronFeeType(FeeType patronFeeType) {
320 this.patronFeeType = patronFeeType;
321 }
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343 public Date getBillDate() {
344 return billDate;
345 }
346
347
348
349
350
351
352 public void setBillDate(Date billDate) {
353 this.billDate = billDate;
354 }
355
356
357
358
359
360
361 public String getBillNumber() {
362 return billNumber;
363 }
364
365
366
367
368
369
370 public void setBillNumber(String billNumber) {
371 this.billNumber = billNumber;
372 }
373
374
375
376
377
378
379 public String getFreeTextNote() {
380 return freeTextNote;
381 }
382
383
384
385
386
387
388 public void setFreeTextNote(String freeTextNote) {
389 this.freeTextNote = freeTextNote;
390 }
391
392
393
394
395
396
397 public KualiDecimal getTotalAmount() {
398 return totalAmount;
399 }
400
401
402
403
404
405
406 public void setTotalAmount(KualiDecimal totalAmount) {
407 this.totalAmount = totalAmount;
408 }
409
410
411
412
413
414
415 public KualiDecimal getPaymentAmount() {
416 return paymentAmount;
417 }
418
419
420
421
422
423
424 public void setPaymentAmount(KualiDecimal paymentAmount) {
425 this.paymentAmount = paymentAmount;
426 }
427
428
429
430
431
432
433 public KualiDecimal getUnPaidBalance() {
434 return unPaidBalance;
435 }
436
437
438
439
440
441
442 public void setUnPaidBalance(KualiDecimal unPaidBalance) {
443 this.unPaidBalance = unPaidBalance;
444 }
445
446 public List<org.kuali.ole.deliver.bo.SystemGeneratedBill> getSysGeneratedBill() {
447 return sysGeneratedBill;
448 }
449
450 public void setSysGeneratedBill(List<SystemGeneratedBill> sysGeneratedBill) {
451 this.sysGeneratedBill = sysGeneratedBill;
452 }
453
454 public String getProxyPatronName() {
455 return proxyPatronName;
456 }
457
458 public void setProxyPatronName(String proxyPatronName) {
459 this.proxyPatronName = proxyPatronName;
460 }
461
462
463 public List<FeeType> getFeeType() {
464 return feeType;
465 }
466
467 public void setFeeType(List<FeeType> feeType) {
468 this.feeType = feeType;
469 }
470
471 public boolean isReviewed() {
472 return reviewed;
473 }
474
475 public void setReviewed(boolean reviewed) {
476 this.reviewed = reviewed;
477 }
478
479 public String getErrorMessage() {
480 return errorMessage;
481 }
482
483 public void setErrorMessage(String errorMessage) {
484 this.errorMessage = errorMessage;
485 }
486
487 public OlePatronDocument getOlePatron() {
488 return olePatron;
489 }
490
491 public void setOlePatron(OlePatronDocument olePatron) {
492 this.olePatron = olePatron;
493 }
494
495
496
497
498
499
500 protected LinkedHashMap toStringMapper() {
501 LinkedHashMap toStringMap = new LinkedHashMap();
502 toStringMap.put("billNumber", billNumber);
503 return toStringMap;
504 }
505
506 public boolean isZeroFeeAmount() {
507 return zeroFeeAmount;
508 }
509
510 public void setZeroFeeAmount(boolean zeroFeeAmount) {
511 this.zeroFeeAmount = zeroFeeAmount;
512 }
513
514 public boolean isRequiredFeeAmount() {
515 return requiredFeeAmount;
516 }
517
518 public void setRequiredFeeAmount(boolean requiredFeeAmount) {
519 this.requiredFeeAmount = requiredFeeAmount;
520 }
521 }