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.math.BigDecimal;
19  import java.util.SortedMap;
20  
21  public class LeaveSummaryRow {
22  	private String accrualCategory;
23      //adding this to have a very simple means of getting the Accrual Category object
24      private String accrualCategoryId;
25      private String accrualCategoryRuleId;
26  	private BigDecimal carryOver;
27  	private BigDecimal ytdAccruedBalance;
28  	private BigDecimal ytdApprovedUsage;
29  	private BigDecimal leaveBalance;
30  	private BigDecimal pendingLeaveAccrual;
31  	private BigDecimal pendingLeaveRequests;
32  	private BigDecimal pendingLeaveBalance;
33  	private BigDecimal pendingAvailableUsage;
34  	private BigDecimal usageLimit;
35  	private BigDecimal fmlaUsage;
36  
37  	private boolean transferable;
38  	private boolean payoutable;
39  	private BigDecimal maxCarryOver;
40      private SortedMap<String, BigDecimal> priorYearsTotalAccrued;
41      private SortedMap<String, BigDecimal> priorYearsUsage;
42      private SortedMap<String, BigDecimal> yearlyCarryOver;  //key is year
43  	
44  	public String getAccrualCategory() {
45  		return accrualCategory;
46  	}
47  	public void setAccrualCategory(String accrualCategory) {
48  		this.accrualCategory = accrualCategory;
49  	}
50      public String getAccrualCategoryId() {
51          return accrualCategoryId;
52      }
53      public void setAccrualCategoryId(String accrualCategoryId) {
54          this.accrualCategoryId = accrualCategoryId;
55      }
56      public String getAccrualCategoryRuleId() {
57          return accrualCategoryRuleId;
58      }
59  
60      public void setAccrualCategoryRuleId(String accrualCategoryRuleId) {
61          this.accrualCategoryRuleId = accrualCategoryRuleId;
62      }
63  	public BigDecimal getCarryOver() {
64  		return carryOver;
65  	}
66  	public void setCarryOver(BigDecimal carryOver) {
67  		this.carryOver = carryOver;
68  	}
69  	public BigDecimal getYtdAccruedBalance() {
70  		return ytdAccruedBalance;
71  	}
72  	public void setYtdAccruedBalance(BigDecimal ytdAccruedBalance) {
73  		this.ytdAccruedBalance = ytdAccruedBalance;
74  	}
75  	public BigDecimal getYtdApprovedUsage() {
76  		return ytdApprovedUsage;
77  	}
78  	public void setYtdApprovedUsage(BigDecimal ytdApprovedUsage) {
79  		this.ytdApprovedUsage = ytdApprovedUsage;
80  	}
81  	public BigDecimal getLeaveBalance() {
82  		return leaveBalance;
83  	}
84  	public void setLeaveBalance(BigDecimal leaveBalance) {
85  		this.leaveBalance = leaveBalance;
86  	}
87  	public BigDecimal getPendingLeaveAccrual() {
88  		return pendingLeaveAccrual;
89  	}
90  	public void setPendingLeaveAccrual(BigDecimal pendingLeaveAccrual) {
91  		this.pendingLeaveAccrual = pendingLeaveAccrual;
92  	}
93  	public BigDecimal getPendingLeaveRequests() {
94  		return pendingLeaveRequests;
95  	}
96  	public void setPendingLeaveRequests(BigDecimal pendingLeaveRequests) {
97  		this.pendingLeaveRequests = pendingLeaveRequests;
98  	}
99  	public BigDecimal getPendingLeaveBalance() {
100 		return pendingLeaveBalance;
101 	}
102 	public void setPendingLeaveBalance(BigDecimal pendingLeaveBalance) {
103 		this.pendingLeaveBalance = pendingLeaveBalance;
104 	}
105 	public BigDecimal getPendingAvailableUsage() {
106 		return pendingAvailableUsage;
107 	}
108 	public void setPendingAvailableUsage(BigDecimal pendingAvailableUsage) {
109 		this.pendingAvailableUsage = pendingAvailableUsage;
110 	}
111 	public BigDecimal getUsageLimit() {
112 		return usageLimit;
113 	}
114 	public void setUsageLimit(BigDecimal usageLimit) {
115 		this.usageLimit = usageLimit;
116 	}
117 	public BigDecimal getFmlaUsage() {
118 		return fmlaUsage;
119 	}
120 	public void setFmlaUsage(BigDecimal fmlaUsage) {
121 		this.fmlaUsage = fmlaUsage;
122 	}
123     public BigDecimal getAccruedBalance() {
124         BigDecimal carryOver = getCarryOver() == null ? BigDecimal.ZERO : getCarryOver();
125         BigDecimal ytdAccruedBalance = getYtdAccruedBalance() == null ? BigDecimal.ZERO : getYtdAccruedBalance();
126         BigDecimal ytdApproved = getYtdApprovedUsage() == null ? BigDecimal.ZERO : getYtdApprovedUsage();
127         return carryOver.add(ytdAccruedBalance).subtract(ytdApproved);
128     }
129 	public boolean isTransferable() {
130 		//Leave summary row has all the necessary information to answer the question
131 		//"Is my accrued balance eligible for transfer?". Should implement this method
132 		//to check for rule presence, max balance flag = Y, action at max bal = T
133 		//essentially move logic from BalanceTransferService.getAccrualCategoryRuleIdsForEligibleTransfers.
134 		//having this implemented might be less costly to call on.
135 		return transferable;
136 	}
137 	public void setTransferable(boolean transferable) {
138 		this.transferable = transferable;
139 	}
140 	public boolean isPayoutable() {
141 		return payoutable;
142 	}
143 	public void setPayoutable(boolean payoutable) {
144 		this.payoutable = payoutable;
145 	}
146 
147 
148     public SortedMap<String, BigDecimal> getPriorYearsUsage() {
149         return priorYearsUsage;
150     }
151 
152     public void setPriorYearsUsage(SortedMap<String, BigDecimal> priorYearsUsage) {
153         this.priorYearsUsage = priorYearsUsage;
154     }
155 
156     public SortedMap<String, BigDecimal> getPriorYearsTotalAccrued() {
157         return priorYearsTotalAccrued;
158     }
159 
160     public void setPriorYearsTotalAccrued(SortedMap<String, BigDecimal> priorYearsTotalAccrued) {
161         this.priorYearsTotalAccrued = priorYearsTotalAccrued;
162     }
163     
164 	public BigDecimal getMaxCarryOver() {
165 		return maxCarryOver;
166 	}
167 	
168 	public void setMaxCarryOver(BigDecimal maxCarryOver) {
169 		this.maxCarryOver = maxCarryOver;
170 	}
171 }