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.warning;
17  
18  import org.kuali.hr.time.service.base.TkServiceLocator;
19  import org.kuali.hr.time.timeblock.TimeBlock;
20  import org.kuali.hr.time.timesheet.TimesheetDocument;
21  
22  import java.sql.Date;
23  import java.util.List;
24  
25  public class TkWarningServiceImpl implements TkWarningService {
26      /**
27       * This is used for perpetual warnings that need to stick to the timesheet
28       */
29      @Override
30      public List<String> getWarnings(String documentNumber) {
31          TimesheetDocument td = TkServiceLocator.getTimesheetService().getTimesheetDocument(documentNumber);
32          //Validate accrual hours
33          List<String> warnings;
34          warnings = TkServiceLocator.getTimeOffAccrualService().validateAccrualHoursLimit(td);
35  
36          return warnings;
37      }
38      
39      public List<String> getWarnings(String pId, List<TimeBlock> tbList, Date asOfDate) {
40          //Validate accrual hours
41          List<String> warnings;
42          warnings = TkServiceLocator.getTimeOffAccrualService().validateAccrualHoursLimit(pId, tbList, asOfDate);
43  
44          return warnings;
45      }
46      
47      @Override
48      public List<String> getWarnings(TimesheetDocument td) {
49          //Validate accrual hours
50          List<String> warnings;
51          warnings = TkServiceLocator.getTimeOffAccrualService().validateAccrualHoursLimit(td);
52  
53          return warnings;
54      }
55  
56  }