View Javadoc

1   /**
2    * Copyright 2004-2012 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.flsa;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import org.joda.time.LocalTime;
22  
23  public class FlsaWeek {
24  	private List<FlsaDay> flsaDays = new ArrayList<FlsaDay>();
25  	private int flsaDayConstant;
26  	private LocalTime flsaTime;
27  	private LocalTime payPeriodBeginTime;
28  	
29  	public FlsaWeek() {
30  		
31  	}
32  	
33  	public FlsaWeek(int dayConstant, LocalTime flsaTime, LocalTime payPeriodBeginTime) {
34  		this.flsaDayConstant = dayConstant;
35  		this.flsaTime = flsaTime;
36  		this.payPeriodBeginTime = payPeriodBeginTime;
37  	}
38  
39  	public List<FlsaDay> getFlsaDays() {
40  		return flsaDays;
41  	}
42  	
43  	public void addFlsaDay(FlsaDay flsaDay) {
44  		flsaDays.add(flsaDay);
45  	}
46  
47  	/**
48  	 * Check to see if the first week is Full or not.
49  	 * 
50  	 * If the first week of a pay period has an FLSA starting time that is before
51  	 * the "Virtual Day" pay period start time, part of the time required for this
52  	 * first day will be in the previous pay period even if we have 7 days.
53  	 * 
54  	 * @return
55  	 */
56  	public boolean isFirstWeekFull() {
57  		if (flsaDays.size() == 7) {
58  			return (flsaTime.isBefore(payPeriodBeginTime)) ? false : true;
59  		} else {
60  			return false;
61  		}
62  	}
63  	
64  	public int getFlsaDayConstant() {
65  		return flsaDayConstant;
66  	}
67  
68  	public void setFlsaDayConstant(int flsaDayConstant) {
69  		this.flsaDayConstant = flsaDayConstant;
70  	}
71  
72  	public LocalTime getFlsaTime() {
73  		return flsaTime;
74  	}
75  
76  	public void setFlsaTime(LocalTime flsaTime) {
77  		this.flsaTime = flsaTime;
78  	}
79  }