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