001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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.module.pdp.bo;
017:
018: import java.math.BigDecimal;
019:
020: public class DailyReport implements Comparable {
021: private boolean pymtAttachment;
022: private boolean pymtSpecialHandling;
023: private boolean processImmediate;
024: private String customer;
025: private BigDecimal amount;
026: private Integer payments;
027: private Integer payees;
028:
029: public DailyReport() {
030: payments = 0;
031: payees = 0;
032: amount = new BigDecimal("0");
033: }
034:
035: public DailyReport(DailyReport dr) {
036: this ();
037: pymtAttachment = dr.pymtAttachment;
038: pymtSpecialHandling = dr.pymtSpecialHandling;
039: processImmediate = dr.processImmediate;
040: customer = dr.customer;
041: }
042:
043: public DailyReport(boolean att, boolean spec, boolean immed,
044: String c, BigDecimal a, Integer pm, Integer py) {
045: this ();
046: pymtAttachment = att;
047: pymtSpecialHandling = spec;
048: processImmediate = immed;
049: customer = c;
050: amount = a;
051: payments = pm;
052: payees = py;
053: }
054:
055: public String getSortGroupId() {
056: if (isProcessImmediate()) {
057: return "B";
058: } else if (isPymtSpecialHandling()) {
059: return "C";
060: } else if (isPymtAttachment()) {
061: return "D";
062: } else {
063: return "E";
064: }
065: }
066:
067: public String getSortGroupName() {
068: String sortGroup = getSortGroupId();
069: if ("B".equals(sortGroup)) {
070: return "Immediate ";
071: } else if ("C".equals(sortGroup)) {
072: return "Special Handling";
073: } else if ("D".equals(sortGroup)) {
074: return "Attachment ";
075: } else {
076: return "Other ";
077: }
078: }
079:
080: @Override
081: public String toString() {
082: return pymtAttachment + " " + pymtSpecialHandling + " "
083: + processImmediate + " " + customer + " " + amount
084: + " " + payments + " " + payees;
085: }
086:
087: public int compareTo(Object o) {
088: DailyReport dro = (DailyReport) o;
089: return getKey().compareTo(dro.getKey());
090: }
091:
092: public String getKey() {
093: return getSortGroupId() + customer;
094: }
095:
096: public void addRow(DailyReport r) {
097: payments = payments + r.payments;
098: payees = payees + r.payees;
099: amount = amount.add(r.amount);
100: }
101:
102: public BigDecimal getAmount() {
103: return amount;
104: }
105:
106: public void setAmount(BigDecimal amount) {
107: this .amount = amount;
108: }
109:
110: public String getCustomer() {
111: return customer;
112: }
113:
114: public void setCustomer(String customer) {
115: this .customer = customer;
116: }
117:
118: public Integer getPayees() {
119: return payees;
120: }
121:
122: public void setPayees(Integer payees) {
123: this .payees = payees;
124: }
125:
126: public Integer getPayments() {
127: return payments;
128: }
129:
130: public void setPayments(Integer payments) {
131: this .payments = payments;
132: }
133:
134: public boolean isProcessImmediate() {
135: return processImmediate;
136: }
137:
138: public void setProcessImmediate(boolean processImmediate) {
139: this .processImmediate = processImmediate;
140: }
141:
142: public boolean isPymtAttachment() {
143: return pymtAttachment;
144: }
145:
146: public void setPymtAttachment(boolean pymtAttachment) {
147: this .pymtAttachment = pymtAttachment;
148: }
149:
150: public boolean isPymtSpecialHandling() {
151: return pymtSpecialHandling;
152: }
153:
154: public void setPymtSpecialHandling(boolean pymtSpecialHandling) {
155: this.pymtSpecialHandling = pymtSpecialHandling;
156: }
157:
158: }
|