001    /**
002     * Copyright 2004-2013 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.hr.lm.leavedonation;
017    
018    import java.math.BigDecimal;
019    
020    import org.kuali.hr.core.KPMEConstants;
021    import org.kuali.hr.lm.accrual.AccrualCategory;
022    import org.kuali.hr.time.HrBusinessObject;
023    import org.kuali.hr.time.earncode.EarnCode;
024    import org.kuali.rice.kim.api.identity.Person;
025    
026    public class LeaveDonation extends HrBusinessObject {
027        public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "LeaveDonation";
028        private static final long serialVersionUID = 1L;
029    
030        private String lmLeaveDonationId;
031            private String donatedAccrualCategory;
032            private String recipientsAccrualCategory;
033            private BigDecimal amountDonated = new BigDecimal("0.0");
034            private BigDecimal amountReceived = new BigDecimal("0.0");
035            private String donorsPrincipalID;
036            private String recipientsPrincipalID;
037            private String description;
038            
039            private Boolean history;
040            
041            private transient AccrualCategory accrualCategoryObj;
042            private transient Person personObj;
043            private transient EarnCode earnCodeObj;
044            
045            private String donatedEarnCode;
046            private String recipientsEarnCode;
047    
048            public EarnCode getEarnCodeObj() {
049                    return earnCodeObj;
050            }
051    
052            public void setEarnCodeObj(EarnCode earnCodeObj) {
053                    this.earnCodeObj = earnCodeObj;
054            }
055    
056            public String getDonatedEarnCode() {
057                    return donatedEarnCode;
058            }
059    
060            public void setDonatedEarnCode(String donatedEarnCode) {
061                    this.donatedEarnCode = donatedEarnCode;
062            }
063    
064            public String getRecipientsEarnCode() {
065                    return recipientsEarnCode;
066            }
067    
068            public void setRecipientsEarnCode(String recipientsEarnCode) {
069                    this.recipientsEarnCode = recipientsEarnCode;
070            }
071    
072            public String getLmLeaveDonationId() {
073                    return lmLeaveDonationId;
074            }
075    
076            public void setLmLeaveDonationId(String lmLeaveDonationId) {
077                    this.lmLeaveDonationId = lmLeaveDonationId;
078            }
079    
080            public String getDonatedAccrualCategory() {
081                    return donatedAccrualCategory;
082            }
083    
084            public void setDonatedAccrualCategory(String donatedAccrualCategory) {
085                    this.donatedAccrualCategory = donatedAccrualCategory;
086            }
087    
088            public String getRecipientsAccrualCategory() {
089                    return recipientsAccrualCategory;
090            }
091    
092            public void setRecipientsAccrualCategory(String recipientsAccrualCategory) {
093                    this.recipientsAccrualCategory = recipientsAccrualCategory;
094            }
095    
096            public BigDecimal getAmountDonated() {
097                    return amountDonated;
098            }
099    
100            public void setAmountDonated(BigDecimal amountDonated) {
101                    this.amountDonated = amountDonated;
102            }
103    
104            public BigDecimal getAmountReceived() {
105                    return amountReceived;
106            }
107    
108            public void setAmountReceived(BigDecimal amountReceived) {
109                    this.amountReceived = amountReceived;
110            }
111    
112            public String getDonorsPrincipalID() {
113                    return donorsPrincipalID;
114            }
115    
116            public void setDonorsPrincipalID(String donorsPrincipalID) {
117                    this.donorsPrincipalID = donorsPrincipalID;
118            }
119    
120            public String getRecipientsPrincipalID() {
121                    return recipientsPrincipalID;
122            }
123    
124            public void setRecipientsPrincipalID(String recipientsPrincipalID) {
125                    this.recipientsPrincipalID = recipientsPrincipalID;
126            }
127    
128            public String getDescription() {
129                    return description;
130            }
131    
132            public void setDescription(String description) {
133                    this.description = description;
134            }
135    
136            public Boolean getHistory() {
137                    return history;
138            }
139    
140            public void setHistory(Boolean history) {
141                    this.history = history;
142            }
143    
144            public Person getPersonObj() {
145                    return personObj;
146            }
147    
148            public void setPersonObj(Person personObj) {
149                    this.personObj = personObj;
150            }
151    
152            public AccrualCategory getAccrualCategoryObj() {
153                    return accrualCategoryObj;
154            }
155    
156            public void setAccrualCategoryObj(AccrualCategory accrualCategoryObj) {
157                    this.accrualCategoryObj = accrualCategoryObj;
158            }
159    
160            @Override
161            protected String getUniqueKey() {
162                    return getDonorsPrincipalID() +"_"+ getRecipientsPrincipalID() +"_"+ getDonatedAccrualCategory() +"_"+ getRecipientsAccrualCategory();
163            }
164    
165            @Override
166            public String getId() {
167                    return getLmLeaveDonationId();
168            }
169    
170            @Override
171            public void setId(String id) {
172                    setLmLeaveDonationId(id);
173            }
174    
175    }