001 /** 002 * Copyright 2004-2012 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.time.flsa; 017 018 import java.util.ArrayList; 019 import java.util.List; 020 021 import org.joda.time.LocalTime; 022 023 public class FlsaWeek { 024 private List<FlsaDay> flsaDays = new ArrayList<FlsaDay>(); 025 private int flsaDayConstant; 026 private LocalTime flsaTime; 027 private LocalTime payPeriodBeginTime; 028 029 public FlsaWeek() { 030 031 } 032 033 public FlsaWeek(int dayConstant, LocalTime flsaTime, LocalTime payPeriodBeginTime) { 034 this.flsaDayConstant = dayConstant; 035 this.flsaTime = flsaTime; 036 this.payPeriodBeginTime = payPeriodBeginTime; 037 } 038 039 public List<FlsaDay> getFlsaDays() { 040 return flsaDays; 041 } 042 043 public void addFlsaDay(FlsaDay flsaDay) { 044 flsaDays.add(flsaDay); 045 } 046 047 /** 048 * Check to see if the first week is Full or not. 049 * 050 * If the first week of a pay period has an FLSA starting time that is before 051 * the "Virtual Day" pay period start time, part of the time required for this 052 * first day will be in the previous pay period even if we have 7 days. 053 * 054 * @return 055 */ 056 public boolean isFirstWeekFull() { 057 if (flsaDays.size() == 7) { 058 return (flsaTime.isBefore(payPeriodBeginTime)) ? false : true; 059 } else { 060 return false; 061 } 062 } 063 064 public int getFlsaDayConstant() { 065 return flsaDayConstant; 066 } 067 068 public void setFlsaDayConstant(int flsaDayConstant) { 069 this.flsaDayConstant = flsaDayConstant; 070 } 071 072 public LocalTime getFlsaTime() { 073 return flsaTime; 074 } 075 076 public void setFlsaTime(LocalTime flsaTime) { 077 this.flsaTime = flsaTime; 078 } 079 }