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.pdp.businessobject;
017    
018    import java.util.LinkedHashMap;
019    
020    import org.kuali.kfs.pdp.PdpPropertyConstants;
021    import org.kuali.rice.kns.bo.TransientBusinessObjectBase;
022    import org.kuali.rice.kns.util.KualiDecimal;
023    
024    public class DailyReport extends TransientBusinessObjectBase {
025        private String customer;
026        private KualiDecimal amount;
027        private Integer payments;
028        private Integer payees;
029        
030        private PaymentGroup paymentGroup;
031        
032        public DailyReport() {
033            payments = 0;
034            payees = 0;
035            amount = KualiDecimal.ZERO;
036        }
037    
038        public DailyReport(DailyReport dr) {
039            this();
040            customer = dr.customer;
041            paymentGroup = dr.paymentGroup;
042        }
043    
044        public DailyReport(String c, KualiDecimal a, Integer pm, Integer py, PaymentGroup paymentGroup) {
045            this();
046            customer = c;
047            amount = a;
048            payments = pm;
049            payees = py;
050            this.paymentGroup = paymentGroup;
051        }
052    
053        @Override
054        public String toString() {
055            return customer + " " + amount + " " + payments + " " + payees;
056        }
057    
058        public void addRow(DailyReport r) {
059            payments = payments + r.payments;
060            payees = payees + r.payees;
061            amount = amount.add(r.amount);
062        }
063    
064        public KualiDecimal getAmount() {
065            return amount;
066        }
067    
068        public void setAmount(KualiDecimal amount) {
069            this.amount = amount;
070        }
071    
072        public String getCustomer() {
073            return customer;
074        }
075    
076        public void setCustomer(String customer) {
077            this.customer = customer;
078        }
079    
080        public Integer getPayees() {
081            return payees;
082        }
083    
084        public void setPayees(Integer payees) {
085            this.payees = payees;
086        }
087    
088        public Integer getPayments() {
089            return payments;
090        }
091    
092        public void setPayments(Integer payments) {
093            this.payments = payments;
094        }
095    
096        
097        @Override
098        protected LinkedHashMap toStringMapper() {
099            LinkedHashMap m = new LinkedHashMap();
100            
101            m.put(PdpPropertyConstants.DailyReport.CUSTOMER, this.customer);
102            m.put(PdpPropertyConstants.DailyReport.AMOUNT, this.amount);
103            m.put(PdpPropertyConstants.DailyReport.PAYMENTS, this.payments);
104            m.put(PdpPropertyConstants.DailyReport.PAYEES, this.payees);      
105            
106            return m;
107        }
108    
109        public PaymentGroup getPaymentGroup() {
110            return paymentGroup;
111        }
112    
113        public void setPaymentGroup(PaymentGroup paymentGroup) {
114            this.paymentGroup = paymentGroup;
115        }
116    
117        
118    }