1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.lm.leaveadjustment;
17
18 import java.math.BigDecimal;
19 import java.util.LinkedHashMap;
20
21 import org.apache.commons.lang.StringUtils;
22 import org.kuali.hr.lm.accrual.AccrualCategory;
23 import org.kuali.hr.time.HrBusinessObject;
24 import org.kuali.hr.time.earncode.EarnCode;
25 import org.kuali.hr.time.principal.PrincipalHRAttributes;
26 import org.kuali.hr.time.service.base.TkServiceLocator;
27 import org.kuali.rice.kim.api.identity.Person;
28 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
29
30 public class LeaveAdjustment extends HrBusinessObject {
31 private static final long serialVersionUID = 1L;
32 private String lmLeaveAdjustmentId;
33 private String principalId;
34 private String leavePlan;
35 private String accrualCategory;
36 private String earnCode;
37 private String description;
38 private BigDecimal adjustmentAmount = new BigDecimal("0.0");
39 private Person principal;
40 private AccrualCategory accrualCategoryObj;
41 private EarnCode earnCodeObj;
42 private PrincipalHRAttributes principalHRAttrObj;
43
44 public String getEarnCode() {
45 return earnCode;
46 }
47 public void setEarnCode(String earnCode) {
48 this.earnCode = earnCode;
49 }
50 public EarnCode getEarnCodeObj() {
51 return earnCodeObj;
52 }
53 public void setEarnCodeObj(EarnCode earnCodeObj) {
54 this.earnCodeObj = earnCodeObj;
55 }
56 public String getPrincipalId() {
57 return principalId;
58 }
59 public void setPrincipalId(String principalId) {
60 this.principalId = principalId;
61 }
62 public Person getPrincipal() {
63 return principal;
64 }
65 public void setPrincipal(Person principal) {
66 this.principal = principal;
67 }
68 public String getName() {
69 if (principal == null) {
70 principal = KimApiServiceLocator.getPersonService().getPerson(this.principalId);
71 }
72 return (principal != null) ? principal.getName() : "";
73 }
74
75 public String getLeavePlan() {
76 if (!StringUtils.isEmpty(this.principalId)) {
77 principalHRAttrObj = TkServiceLocator.getPrincipalHRAttributeService().getPrincipalCalendar(principalId, this.getEffectiveDate());
78 }
79 return (principalHRAttrObj != null) ? principalHRAttrObj.getLeavePlan() : "";
80 }
81
82 public void setLeavePlan(String leavePlan) {
83 this.leavePlan = leavePlan;
84 }
85 public String getAccrualCategory() {
86 return accrualCategory;
87 }
88 public void setAccrualCategory(String accrualCategory) {
89 this.accrualCategory = accrualCategory;
90 }
91
92 public String getDescription() {
93 return description;
94 }
95 public void setDescription(String description) {
96 this.description = description;
97 }
98 public BigDecimal getAdjustmentAmount() {
99 return adjustmentAmount;
100 }
101 public void setAdjustmentAmount(BigDecimal adjustmentAmount) {
102 this.adjustmentAmount = adjustmentAmount;
103 }
104 public AccrualCategory getAccrualCategoryObj() {
105 return accrualCategoryObj;
106 }
107 public void setAccrualCategoryObj(AccrualCategory accrualCategoryObj) {
108 this.accrualCategoryObj = accrualCategoryObj;
109 }
110 public static long getSerialversionuid() {
111 return serialVersionUID;
112 }
113 public String getLmLeaveAdjustmentId() {
114 return lmLeaveAdjustmentId;
115 }
116 public void setLmLeaveAdjustmentId(String lmLeaveAdjustmentId) {
117 this.lmLeaveAdjustmentId = lmLeaveAdjustmentId;
118 }
119
120 @Override
121 protected String getUniqueKey() {
122 return getLmLeaveAdjustmentId();
123 }
124
125 @Override
126 public String getId() {
127 return getLmLeaveAdjustmentId();
128 }
129
130 @Override
131 public void setId(String id) {
132 setLmLeaveAdjustmentId(id);
133 }
134
135 public PrincipalHRAttributes getPrincipalHRAttrObj() {
136 return principalHRAttrObj;
137 }
138 public void setPrincipalHRAttrObj(PrincipalHRAttributes principalHRAttrObj) {
139 this.principalHRAttrObj = principalHRAttrObj;
140 }
141 }