View Javadoc

1   /**
2    * Copyright 2004-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.hr.lm.leaveSummary;
17  
18  import java.io.Serializable;
19  import java.math.BigDecimal;
20  import java.util.SortedMap;
21  
22  public class LeaveSummaryRow implements Serializable {
23  	private String accrualCategory;
24      //adding this to have a very simple means of getting the Accrual Category object
25      private String accrualCategoryId;
26      private String accrualCategoryRuleId;
27      private String infractingLeaveBlockId;
28  	private BigDecimal carryOver;
29  	private BigDecimal ytdAccruedBalance;
30  	private BigDecimal ytdApprovedUsage;
31  	private BigDecimal leaveBalance;
32  	private BigDecimal pendingLeaveAccrual;
33  	private BigDecimal pendingLeaveRequests;
34  	private BigDecimal pendingLeaveBalance;
35  	private BigDecimal pendingAvailableUsage;
36  	private BigDecimal usageLimit;
37  	private BigDecimal fmlaUsage;
38  
39  	private boolean transferable;
40  	private boolean payoutable;
41  	private BigDecimal maxCarryOver;
42      private SortedMap<String, BigDecimal> priorYearsTotalAccrued;
43      private SortedMap<String, BigDecimal> priorYearsUsage;
44      private SortedMap<String, BigDecimal> yearlyCarryOver;  //key is year
45  	
46  	public String getAccrualCategory() {
47  		return accrualCategory;
48  	}
49  	public void setAccrualCategory(String accrualCategory) {
50  		this.accrualCategory = accrualCategory;
51  	}
52      public String getAccrualCategoryId() {
53          return accrualCategoryId;
54      }
55      public void setAccrualCategoryId(String accrualCategoryId) {
56          this.accrualCategoryId = accrualCategoryId;
57      }
58      public String getAccrualCategoryRuleId() {
59          return accrualCategoryRuleId;
60      }
61  
62      public void setAccrualCategoryRuleId(String accrualCategoryRuleId) {
63          this.accrualCategoryRuleId = accrualCategoryRuleId;
64      }
65  	public BigDecimal getCarryOver() {
66  		return carryOver;
67  	}
68  	public void setCarryOver(BigDecimal carryOver) {
69  		this.carryOver = carryOver;
70  	}
71  	public BigDecimal getYtdAccruedBalance() {
72  		return ytdAccruedBalance;
73  	}
74  	public void setYtdAccruedBalance(BigDecimal ytdAccruedBalance) {
75  		this.ytdAccruedBalance = ytdAccruedBalance;
76  	}
77  	public BigDecimal getYtdApprovedUsage() {
78  		return ytdApprovedUsage;
79  	}
80  	public void setYtdApprovedUsage(BigDecimal ytdApprovedUsage) {
81  		this.ytdApprovedUsage = ytdApprovedUsage;
82  	}
83  	public BigDecimal getLeaveBalance() {
84  		return leaveBalance;
85  	}
86  	public void setLeaveBalance(BigDecimal leaveBalance) {
87  		this.leaveBalance = leaveBalance;
88  	}
89  	public BigDecimal getPendingLeaveAccrual() {
90  		return pendingLeaveAccrual;
91  	}
92  	public void setPendingLeaveAccrual(BigDecimal pendingLeaveAccrual) {
93  		this.pendingLeaveAccrual = pendingLeaveAccrual;
94  	}
95  	public BigDecimal getPendingLeaveRequests() {
96  		return pendingLeaveRequests;
97  	}
98  	public void setPendingLeaveRequests(BigDecimal pendingLeaveRequests) {
99  		this.pendingLeaveRequests = pendingLeaveRequests;
100 	}
101 	public BigDecimal getPendingLeaveBalance() {
102 		return pendingLeaveBalance;
103 	}
104 	public void setPendingLeaveBalance(BigDecimal pendingLeaveBalance) {
105 		this.pendingLeaveBalance = pendingLeaveBalance;
106 	}
107 	public BigDecimal getPendingAvailableUsage() {
108 		return pendingAvailableUsage;
109 	}
110 	public void setPendingAvailableUsage(BigDecimal pendingAvailableUsage) {
111 		this.pendingAvailableUsage = pendingAvailableUsage;
112 	}
113 	public BigDecimal getUsageLimit() {
114 		return usageLimit;
115 	}
116 	public void setUsageLimit(BigDecimal usageLimit) {
117 		this.usageLimit = usageLimit;
118 	}
119 	public BigDecimal getFmlaUsage() {
120 		return fmlaUsage;
121 	}
122 	public void setFmlaUsage(BigDecimal fmlaUsage) {
123 		this.fmlaUsage = fmlaUsage;
124 	}
125     public BigDecimal getAccruedBalance() {
126         BigDecimal carryOver = getCarryOver() == null ? BigDecimal.ZERO : getCarryOver();
127         BigDecimal ytdAccruedBalance = getYtdAccruedBalance() == null ? BigDecimal.ZERO : getYtdAccruedBalance();
128         BigDecimal ytdApproved = getYtdApprovedUsage() == null ? BigDecimal.ZERO : getYtdApprovedUsage();
129         return carryOver.add(ytdAccruedBalance).subtract(ytdApproved);
130     }
131 	public boolean isTransferable() {
132 		//Leave summary row has all the necessary information to answer the question
133 		//"Is my accrued balance eligible for transfer?". Should implement this method
134 		//to check for rule presence, max balance flag = Y, action at max bal = T
135 		//essentially move logic from BalanceTransferService.getAccrualCategoryRuleIdsForEligibleTransfers.
136 		//having this implemented might be less costly to call on.
137 		return transferable;
138 	}
139 	public void setTransferable(boolean transferable) {
140 		this.transferable = transferable;
141 	}
142 	public boolean isPayoutable() {
143 		return payoutable;
144 	}
145 	public void setPayoutable(boolean payoutable) {
146 		this.payoutable = payoutable;
147 	}
148 
149 
150     public SortedMap<String, BigDecimal> getPriorYearsUsage() {
151         return priorYearsUsage;
152     }
153 
154     public void setPriorYearsUsage(SortedMap<String, BigDecimal> priorYearsUsage) {
155         this.priorYearsUsage = priorYearsUsage;
156     }
157 
158     public SortedMap<String, BigDecimal> getPriorYearsTotalAccrued() {
159         return priorYearsTotalAccrued;
160     }
161 
162     public void setPriorYearsTotalAccrued(SortedMap<String, BigDecimal> priorYearsTotalAccrued) {
163         this.priorYearsTotalAccrued = priorYearsTotalAccrued;
164     }
165     
166 	public BigDecimal getMaxCarryOver() {
167 		return maxCarryOver;
168 	}
169 	
170 	public void setMaxCarryOver(BigDecimal maxCarryOver) {
171 		this.maxCarryOver = maxCarryOver;
172 	}
173 	
174 	public String getInfractingLeaveBlockId() {
175 		return infractingLeaveBlockId;
176 	}
177 	
178 	public void setInfractingLeaveBlockId(String infractingLeaveBlockId) {
179 		this.infractingLeaveBlockId = infractingLeaveBlockId;
180 	}
181 }