1 PACKAGE BODY ghr_validate_paywsmee AS
2 /* $Header: ghrwsmee.pkb 115.1 99/10/18 00:35:55 porting ship $ */
3 --
4 -- Pass in WGI due date and this function will return the WGI Pay date
5 -- The WGI Pay date is the same as the due date if the due date is the
6 -- start of a pay period otherwise it is the start of the next pay period.
7 FUNCTION get_wgi_pay_date (p_wgi_due_date IN DATE
8 ,p_payroll_id IN NUMBER)
9 return DATE IS
10 CURSOR cur_tpe IS
11 SELECT tpe.start_date
12 FROM per_time_periods tpe
13 WHERE tpe.payroll_id = p_payroll_id
14 AND tpe.start_date >= p_wgi_due_date
15 ORDER BY tpe.start_date;
16 --
17 BEGIN
18 FOR cur_tpe_rec IN cur_tpe LOOP
19 RETURN(cur_tpe_rec.start_date);
20 END LOOP;
21 --
22 RETURN (NULL);
23 END get_wgi_pay_date;
24 --
25 -- This function checks if the date passed in is the sart of a pay_period
26 -- for the given payroll
27 -- Returns TRUE if it is.
28 FUNCTION check_date_start_of_pay_period (p_date IN DATE
29 ,p_payroll_id IN NUMBER)
30 RETURN BOOLEAN IS
31 CURSOR cur_tpe IS
32 SELECT 1
33 FROM per_time_periods tpe
34 WHERE tpe.payroll_id = p_payroll_id
35 AND tpe.start_date = p_date;
36 --
37 BEGIN
38 FOR cur_tpe_rec IN cur_tpe LOOP
39 RETURN(TRUE);
40 END LOOP;
41 --
42 RETURN (FALSE);
43 END check_date_start_of_pay_period;
44 --
45 END ghr_validate_paywsmee;