1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs.transaction;
17
18 import org.apache.commons.lang.RandomStringUtils;
19 import org.kuali.rice.krad.web.form.UifFormBase;
20
21 import java.util.ArrayList;
22 import java.util.List;
23
24 import java.math.BigDecimal;
25 import java.text.NumberFormat;
26 import java.util.*;
27
28
29
30
31
32
33
34 public class TransactionForm extends UifFormBase {
35
36 private static final long serialVersionUID = -9062785501387603918L;
37 private String testField;
38 private String accountId;
39
40 private String statusMessage;
41
42
43
44
45 private List<TransactionModel> rollupTransactions;
46 private List<TransactionModel> allTransactions;
47
48 private TransactionModel currentTransaction;
49 private List<TransactionModel> currrentTransactionAllocations = new ArrayList<TransactionModel>();
50
51 private List<TransactionModel> deferments;
52
53 private Boolean showInternal = Boolean.FALSE;
54 private Date startingDate;
55 private BigDecimal startingBalance = BigDecimal.ZERO;
56 private Date endingDate;
57 private BigDecimal endingBalance = BigDecimal.ZERO;
58
59 private BigDecimal chargeTotal;
60 private BigDecimal paymentTotal;
61 private BigDecimal defermentTotal;
62 private BigDecimal allocatedTotal;
63 private BigDecimal unallocatedTotal;
64
65 private String newTag;
66
67
68 private String zeroBalanceDate;
69 private Set<Date> zeroBalanceDates;
70 private String studentLookupByName;
71
72 private String selectedPersonName;
73
74
75
76
77
78 private List<Currency> currencies;
79 private Currency currency;
80 private String code;
81 private String currencyName;
82 private String currencyDescription;
83
84
85
86 public TransactionForm(){
87 this.accountId = RandomStringUtils.randomAlphanumeric(4);
88 rollupTransactions = new ArrayList<TransactionModel>();
89 for (int i = 0; i < 10; i++){
90 rollupTransactions.add(new TransactionModel(5));
91 }
92 }
93
94 public String getTestField() {
95 return testField;
96 }
97
98 public void setTestField(String testField) {
99 this.testField = testField;
100 }
101
102 public String getAccountId() {
103 return accountId;
104 }
105
106 public void setAccountId(String accountId) {
107 this.accountId = accountId;
108 }
109
110
111
112
113
114
115
116
117 public String getStudentLookupByName() {
118 return studentLookupByName;
119 }
120
121
122
123
124
125
126
127
128 public void setStudentLookupByName(String studentLookupByName) {
129 this.studentLookupByName = studentLookupByName;
130 }
131
132
133
134
135
136
137 public String getSelectedPersonName() {
138 return selectedPersonName;
139 }
140
141
142
143
144
145
146 public void setSelectedPersonName(String selectedPersonName) {
147 this.selectedPersonName = selectedPersonName;
148 }
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249 public List<Currency> getCurrencies() {
250 return currencies;
251 }
252
253
254
255
256
257
258 public void setCurrencies(List<Currency> currencies) {
259 this.currencies = currencies;
260 }
261
262
263
264
265
266
267 public Currency getCurrency() {
268 return currency;
269 }
270
271
272
273
274
275
276 public void setCurrency(Currency currency) {
277 this.currency = currency;
278 }
279
280
281
282
283
284
285 public String getCode() {
286 return code;
287 }
288
289
290
291
292
293
294 public void setCode(String code) {
295 this.code = code;
296 }
297
298
299
300
301
302
303 public String getCurrencyName() {
304 return currencyName;
305 }
306
307
308
309
310
311
312 public void setCurrencyName(String currencyName) {
313 this.currencyName = currencyName;
314 }
315
316
317
318
319
320
321 public String getCurrencyDescription() {
322 return currencyDescription;
323 }
324
325
326
327
328
329
330 public void setCurrencyDescription(String currencyDescription) {
331 this.currencyDescription = currencyDescription;
332 }
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374 public List<TransactionModel> getRollupTransactions() {
375 return rollupTransactions;
376 }
377
378 public void setRollupTransactions(List<TransactionModel> rollupTransactions) {
379 this.rollupTransactions = rollupTransactions;
380 }
381
382 public List<TransactionModel> getAllTransactions() {
383 return allTransactions;
384 }
385
386 public void setAllTransactions(List<TransactionModel> allTransactions) {
387 this.allTransactions = allTransactions;
388 }
389
390
391
392
393
394
395
396
397
398 public BigDecimal getStartingBalance() {
399 if (this.startingBalance == null) {
400 this.startingBalance = BigDecimal.ZERO;
401 }
402 return startingBalance;
403 }
404
405 public String getFormattedStartingBalance() {
406 NumberFormat percentFormat = NumberFormat.getCurrencyInstance();
407 return percentFormat.format(this.getStartingBalance());
408 }
409
410 public void setStartingBalance(BigDecimal startingBalance) {
411 this.startingBalance = startingBalance;
412 }
413
414 public BigDecimal getEndingBalance() {
415 if (this.endingBalance == null) {
416 this.endingBalance = BigDecimal.ZERO;
417 }
418 return endingBalance;
419 }
420
421 public void setEndingBalance(BigDecimal endingBalance) {
422 this.endingBalance = endingBalance;
423 }
424
425
426
427
428
429 public Date getStartingDate() {
430 return startingDate;
431 }
432
433 public void setStartingDate(Date startingDate) {
434 this.startingDate = startingDate;
435 }
436
437 public Date getEndingDate() {
438 return endingDate;
439 }
440
441 public void setEndingDate(Date endingDate) {
442 this.endingDate = endingDate;
443 }
444
445 public String getStatusMessage() {
446 return statusMessage;
447 }
448
449 public void setStatusMessage(String statusMessage) {
450 this.statusMessage = statusMessage;
451 }
452
453 public List<TransactionModel> getDeferments() {
454 if(deferments == null){
455 return new ArrayList<TransactionModel>();
456 }
457 return deferments;
458 }
459
460 public void setDeferments(List<TransactionModel> deferments) {
461 this.deferments = deferments;
462 }
463
464 public BigDecimal getChargeTotal() {
465 if(this.chargeTotal == null){
466 this.chargeTotal = BigDecimal.ZERO;
467 }
468 return chargeTotal;
469 }
470
471 public void setChargeTotal(BigDecimal chargeTotal) {
472 this.chargeTotal = chargeTotal;
473 }
474
475 public void addChargeTotal(BigDecimal chargeTotal){
476 this.chargeTotal = this.getChargeTotal().add(chargeTotal);
477 }
478
479 public BigDecimal getPaymentTotal() {
480 if(this.paymentTotal == null){
481 this.paymentTotal = BigDecimal.ZERO;
482 }
483 return paymentTotal;
484 }
485
486 public void setPaymentTotal(BigDecimal paymentTotal) {
487 this.paymentTotal = paymentTotal;
488 }
489
490 public void addPaymentTotal(BigDecimal paymentTotal){
491 this.paymentTotal = this.getPaymentTotal().add(paymentTotal);
492 }
493
494 public BigDecimal getDefermentTotal() {
495 if(defermentTotal == null){
496 defermentTotal = BigDecimal.ZERO;
497 }
498 return defermentTotal;
499 }
500
501 public void setDefermentTotal(BigDecimal defermentTotal) {
502 this.defermentTotal = defermentTotal;
503 }
504
505 public void addDefermentTotal(BigDecimal defermentTotal){
506 this.defermentTotal = this.getDefermentTotal().add(defermentTotal);
507 }
508
509 public BigDecimal getAllocatedTotal() {
510 if(allocatedTotal == null){
511 allocatedTotal = BigDecimal.ZERO;
512 }
513 return allocatedTotal;
514 }
515
516 public void setAllocatedTotal(BigDecimal allocatedTotal) {
517 this.allocatedTotal = allocatedTotal;
518 }
519
520 public void addAllocatedTotal(BigDecimal allocatedTotal){
521 this.allocatedTotal = this.getAllocatedTotal().add(allocatedTotal);
522 }
523
524 public void subtractAllocatedTotal(BigDecimal allocatedTotal){
525 this.allocatedTotal = this.getAllocatedTotal().subtract(allocatedTotal);
526 }
527
528 public BigDecimal getUnallocatedTotal() {
529 if(unallocatedTotal == null){
530 unallocatedTotal = BigDecimal.ZERO;
531 }
532 return unallocatedTotal;
533 }
534
535 public void setUnallocatedTotal(BigDecimal unallocatedTotal) {
536 this.unallocatedTotal = unallocatedTotal;
537 }
538
539 public void addUnallocatedTotal(BigDecimal unallocatedTotal){
540 this.unallocatedTotal = this.getUnallocatedTotal().add(unallocatedTotal);
541 }
542
543 public void subtractUnallocatedTotal(BigDecimal unallocatedTotal){
544 this.unallocatedTotal = this.getUnallocatedTotal().subtract(unallocatedTotal);
545 }
546
547 public String getNewTag() {
548 return newTag;
549 }
550
551 public void setNewTag(String newTag) {
552 this.newTag = newTag;
553 }
554
555
556
557
558
559
560
561
562
563 public TransactionModel getCurrentTransaction() {
564 return currentTransaction;
565 }
566
567 public void setCurrentTransaction(TransactionModel currentTransaction) {
568 this.currentTransaction = currentTransaction;
569 }
570
571 public List<TransactionModel> getCurrrentTransactionAllocations() {
572 return currrentTransactionAllocations;
573 }
574
575 public void setCurrrentTransactionAllocations(List<TransactionModel> currrentTransactionAllocations) {
576 this.currrentTransactionAllocations = currrentTransactionAllocations;
577 }
578
579 public Boolean getShowInternal() {
580 return showInternal;
581 }
582
583 public void setShowInternal(Boolean showInternal) {
584 this.showInternal = showInternal;
585 }
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617 public Set<Date> getZeroBalanceDates() {
618 if(zeroBalanceDates == null) {
619 zeroBalanceDates = new HashSet<Date>();
620 }
621 return zeroBalanceDates;
622 }
623
624 public void setZeroBalanceDates(Set<Date> zeroBalanceDates) {
625 this.zeroBalanceDates = zeroBalanceDates;
626 }
627
628
629
630
631
632
633
634
635
636
637
638 public String getZeroBalanceDate() {
639 return zeroBalanceDate;
640 }
641
642 public void setZeroBalanceDate(String zeroBalanceDate) {
643 this.zeroBalanceDate = zeroBalanceDate;
644 }
645 }