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.time.timesheet;
17  
18  import org.kuali.hr.time.calendar.Calendar;
19  import org.kuali.hr.time.calendar.CalendarEntries;
20  import org.kuali.hr.time.service.base.TkServiceLocator;
21  import org.kuali.hr.time.util.TkConstants;
22  import org.kuali.rice.kim.api.identity.Person;
23  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
24  
25  public class TimeSheetInitiate extends PersistableBusinessObjectBase {
26  
27  	/**
28  	 * 
29  	 */
30  	private static final long serialVersionUID = 1L;
31  	private String tkTimeSheetInitId;
32  	private String principalId;
33  	private String hrPyCalendarEntriesId;
34  	private String pyCalendarGroup;
35  	private String documentId;
36  	
37  	private String calendarTypes = TkConstants.CALENDAR_TYPE_PAY;
38  	
39  	private Person principal;
40  	private Calendar payCalendarObj;
41  	
42  	private CalendarEntries payCalendarEntriesObj;
43  	
44  	public String getPrincipalId() {
45  		return principalId;
46  	}
47  
48  	public void setPrincipalId(String principalId) {
49  		this.principalId = principalId;
50  	}
51  	
52  	public Person getPrincipal() {
53  		return principal;
54  	}
55  
56  	public void setPrincipal(Person principal) {
57  		this.principal = principal;
58  	}
59  
60  	
61  	public String getTkTimeSheetInitId() {
62  		return tkTimeSheetInitId;
63  	}
64  
65  	public void setTkTimeSheetInitId(String tkTimeSheetInitId) {
66  		this.tkTimeSheetInitId = tkTimeSheetInitId;
67  	}
68  	
69      public String getHrPyCalendarEntriesId() {
70          return hrPyCalendarEntriesId;
71      }
72  
73      public void setHrPyCalendarEntriesId(String hrPyCalendarEntriesId) {
74          this.hrPyCalendarEntriesId = hrPyCalendarEntriesId;
75      }
76  	
77  	public CalendarEntries getPayCalendarEntriesObj() {
78  		if(hrPyCalendarEntriesId != null) {
79  			setPayCalendarEntriesObj(TkServiceLocator.getCalendarEntriesService().getCalendarEntries(hrPyCalendarEntriesId));
80  		}
81  		return payCalendarEntriesObj;
82  	}
83  
84  	public void setPayCalendarEntriesObj(CalendarEntries payCalendarEntriesObj) {
85  		this.payCalendarEntriesObj = payCalendarEntriesObj;
86  	}
87  
88      public String getPyCalendarGroup() {
89          return pyCalendarGroup;
90      }
91  
92      public void setPyCalendarGroup(String pyCalendarGroup) {
93          this.pyCalendarGroup = pyCalendarGroup;
94      }
95  
96  	public String getDocumentId() {
97  		return documentId;
98  	}
99  
100 	public void setDocumentId(String documentId) {
101 		this.documentId = documentId;
102 	}
103 
104 	public Calendar getPayCalendarObj() {
105 		return payCalendarObj;
106 	}
107 
108 	public void setPayCalendarObj(Calendar payCalendarObj) {
109 		this.payCalendarObj = payCalendarObj;
110 	}
111 
112 	public String getBeginAndEndDateTime() {
113 		if (payCalendarEntriesObj == null && this.getHrPyCalendarEntriesId() != null) {
114 			payCalendarEntriesObj = TkServiceLocator.getCalendarEntriesService().getCalendarEntries(this.getHrPyCalendarEntriesId());
115 	    }
116 	    return (payCalendarEntriesObj != null) ? 
117 	    		payCalendarEntriesObj.getBeginPeriodDateTime().toString() + " - "+ payCalendarEntriesObj.getEndPeriodDateTime().toString() : "";
118 	}
119 
120 	public String getCalendarTypes() {
121 		return calendarTypes;
122 	}
123 
124 	public void setCalendarTypes(String calendarTypes) {
125 		this.calendarTypes = calendarTypes;
126 	}
127 	
128 }