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.leaveplan; 017 018 import java.util.Date; 019 import java.sql.Time; 020 021 import org.apache.commons.lang3.StringUtils; 022 import org.joda.time.DateTime; 023 import org.joda.time.LocalDate; 024 import org.joda.time.LocalTime; 025 import org.kuali.hr.core.KPMEConstants; 026 import org.kuali.hr.time.HrBusinessObject; 027 028 public class LeavePlan extends HrBusinessObject { 029 030 public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE 031 + "/" + "LeavePlan"; 032 033 private static final long serialVersionUID = 1L; 034 private String lmLeavePlanId; 035 private String leavePlan; 036 private String descr; 037 private String calendarYearStart; 038 private Boolean history; 039 private String planningMonths; 040 private String batchPriorYearCarryOverStartDate; 041 private Time batchPriorYearCarryOverStartTime; 042 043 public String getBatchPriorYearCarryOverStartDate() { 044 return batchPriorYearCarryOverStartDate; 045 } 046 047 public void setBatchPriorYearCarryOverStartDate( 048 String batchPriorYearCarryOverStartDate) { 049 this.batchPriorYearCarryOverStartDate = batchPriorYearCarryOverStartDate; 050 } 051 052 public Time getBatchPriorYearCarryOverStartTime() { 053 return batchPriorYearCarryOverStartTime; 054 } 055 056 public void setBatchPriorYearCarryOverStartTime( 057 Time batchPriorYearCarryOverStartTime) { 058 this.batchPriorYearCarryOverStartTime = batchPriorYearCarryOverStartTime; 059 } 060 061 public String getPlanningMonths() { 062 return planningMonths; 063 } 064 065 public void setPlanningMonths(String planningMonths) { 066 this.planningMonths = planningMonths; 067 } 068 069 public String getLmLeavePlanId() { 070 return lmLeavePlanId; 071 } 072 073 public void setLmLeavePlanId(String lmLeavePlanId) { 074 this.lmLeavePlanId = lmLeavePlanId; 075 } 076 077 public String getLeavePlan() { 078 return leavePlan; 079 } 080 081 public void setLeavePlan(String leavePlan) { 082 this.leavePlan = leavePlan; 083 } 084 085 public String getDescr() { 086 return descr; 087 } 088 089 public void setDescr(String descr) { 090 this.descr = descr; 091 } 092 093 public String getCalendarYearStart() { 094 return calendarYearStart; 095 } 096 097 public void setCalendarYearStart(String calendarYearStart) { 098 this.calendarYearStart = calendarYearStart; 099 } 100 101 public String getCalendarYearStartMonth() { 102 if (StringUtils.isEmpty(getCalendarYearStart())) { 103 return "01"; 104 } 105 String[] date = getCalendarYearStart().split("/"); 106 return date[0]; 107 } 108 109 public String getCalendarYearStartDayOfMonth() { 110 if (StringUtils.isEmpty(getCalendarYearStart())) { 111 return "01"; 112 } 113 String[] date = getCalendarYearStart().split("/"); 114 return date[1]; 115 } 116 117 118 public Boolean getHistory() { 119 return history; 120 } 121 122 public void setHistory(Boolean history) { 123 this.history = history; 124 } 125 126 @Override 127 protected String getUniqueKey() { 128 return leavePlan; 129 } 130 131 @Override 132 public String getId() { 133 return getLmLeavePlanId(); 134 } 135 136 @Override 137 public void setId(String id) { 138 setLmLeavePlanId(id); 139 } 140 141 }