1 package body hr_adp as
2 /* $Header: peadppkg.pkb 120.2 2005/10/28 04:21:43 sgelvi noship $ */
3 -----------------------------------------------------------------------
4 procedure set_adp_extract_date (p_adp_extract_date date,
5 p_ex_employee_months number default null,
6 p_end_deduction_months number default null)
7 ------------------------------------------------------------------------
8 is
9 -- This procedure sets the g_adp_extract_date variable to the given date.
10 --
11 begin
12 g_adp_extract_date := p_adp_extract_date;
13 -- The following two assignments to global variables been done to handle
14 -- cut off date issue.
15 g_ex_employee_months := p_ex_employee_months;
16 g_end_deduction_months := p_end_deduction_months;
17 HR_PAY_INTERFACE_PKG.g_payroll_extract_date := p_adp_extract_date;
18 --
19 end set_adp_extract_date;
20 --
21 -----------------------------------------------------------------------
22 function get_adp_extract_date return date
23 ------------------------------------------------------------------------
24 is
25 -- This function returns the g_adp_extract_date set by the call to
26 -- set_adp_extract_date. If set_adp_extract_date is never called, it
27 -- returns the sysdate as g_adp_extract_date is initialized to
28 -- sysdate.
29 --
30 begin
31 g_adp_extract_date := nvl(g_adp_extract_date, sysdate);
32 RETURN g_adp_extract_date;
33 --
34 end get_adp_extract_date;
35 --
36 -----------------------------------------------------------------------
37 function get_ex_employee_date return date
38 ------------------------------------------------------------------------
39 is
40 -- This function returns the g_adp_extract_date set by the call to
41 -- set_adp_extract_date. If set_adp_extract_date is never called, it
42 -- returns the sysdate as g_adp_extract_date is initialized to
43 -- sysdate.
44 --
45 begin
46 g_ex_employee_date := trunc(add_months(trunc(hr_adp.get_adp_extract_date),-g_ex_employee_months)
47 - to_char(trunc(hr_adp.get_adp_extract_date),'DD') +1);
48 g_ex_employee_date := nvl(g_ex_employee_date, to_date('01/01/0001','DD/MM/YYYY'));
49 RETURN g_ex_employee_date;
50 --
51 end get_ex_employee_date;
52 --
53 -----------------------------------------------------------------------
54 function get_end_deduction_date return date
55 ------------------------------------------------------------------------
56 is
57 -- This function returns the g_adp_extract_date set by the call to
58 -- set_adp_extract_date. If set_adp_extract_date is never called, it
59 -- returns the sysdate as g_adp_extract_date is initialized to
60 -- sysdate.
61 --
62 begin
63 g_end_deduction_date := trunc(add_months(trunc(hr_adp.get_adp_extract_date),-g_end_deduction_months)
64 - to_char(trunc(hr_adp.get_adp_extract_date),'DD') +1) ;
65 g_end_deduction_date := nvl(g_end_deduction_date, to_date('01/01/0001','DD/MM/YYYY'));
66 RETURN g_end_deduction_date;
67 --
68 end get_end_deduction_date;
69 --
70 -----------------------------------------------------------------------
71 function get_max_ppm_priority(p_assignment_id in number)
72 return number is priority number(15);
73 ------------------------------------------------------------------------
74 begin
75 --
76 select max(priority)
77 into priority
78 from pay_personal_payment_methods_f
79 where assignment_id = p_assignment_id
80 and trunc(hr_adp.get_adp_extract_date)
81 between effective_start_date
82 and effective_end_date ;
83 return priority;
84 --
85 end get_max_ppm_priority;
86 --
87 end hr_adp;