1 PACKAGE BODY pay_no_expiry_support AS
2 /*$Header: pynobalexp.pkb 120.0.12000000.1 2007/01/17 23:09:22 appldev noship $
3 */
4 /*---------------------------- next_bimonth_period ----------------------------
5 NAME
6 next_bimonth_period
7 DESCRIPTION
8 Given a date and a payroll action id, returns the date of the day after
9 the end of the containing pay period.
10 NOTES
11 <none>
12 */
13 FUNCTION next_bimonth_period
14 (
15 p_pactid IN NUMBER,
16 p_date IN DATE
17 ) RETURN DATE is
18 l_return_val DATE := NULL;
19 BEGIN
20 SELECT TRUNC(ADD_MONTHS(p_date, DECODE(MOD(TO_CHAR(p_date, 'MM'),2),
21 0, 1,
22 2)), 'MM')
23 INTO l_return_val
24 FROM pay_payroll_actions
25 WHERE payroll_action_id = p_pactid
26 AND effective_date = p_date;
27
28 RETURN l_return_val;
29
30 END next_bimonth_period;
31 /*------------------------------ date_ec ------------------------------------
32 NAME
33 date_ec
34 DESCRIPTION
35 Norway specific Expiry checking code for the following date-related
36 dimensions:
37 -----------------------------------
38 %Bi-Monthly To Date and %Bi Month Period
39 ------------------------------------
40 The Expiry checking code for the rest of the dimensions uses functions
41 delivered in PAY_IP_EXPIRY_SUPPORT.
42
43
44 NOTES
45 This procedure assumes the date portion of the dimension name
46 is always at the end to allow accurate identification since
47 this is used for many dimensions.
48 */
49 PROCEDURE date_ec
50 (
51 p_owner_payroll_action_id IN NUMBER, -- run created balance.
52 p_user_payroll_action_id IN NUMBER, -- current run.
53 p_owner_assignment_action_id IN NUMBER, -- assact created balance.
54 p_user_assignment_action_id IN NUMBER, -- current assact..
55 p_owner_effective_date IN DATE, -- eff date of balance.
56 p_user_effective_date IN DATE, -- eff date of current run.
57 p_dimension_name IN VARCHAR2, -- balance dimension name.
58 p_expiry_information OUT NOCOPY NUMBER-- dimension expired flag.
59 ) is
60
61 l_beg_of_fiscal_year DATE := NULL;
62 l_expiry_date DATE := NULL;
63
64 BEGIN
65
66 IF (p_dimension_name like '%Bi-Monthly To Date') OR (p_dimension_name like '%Bi Month Period') THEN
67 l_expiry_date := next_bimonth_period(p_owner_payroll_action_id,
68 p_owner_effective_date);
69 ELSE
70 hr_utility.set_message(801, 'PAY_376854_NO_NONE_DIM_EXP_CHK');
71 hr_utility.raise_error;
72
73 END IF;
74
75
76 IF p_user_effective_date >= l_expiry_date THEN
77 p_expiry_information := 1;
78 ELSE
79 p_expiry_information := 0;
80 END IF;
81
82
83 END date_ec;
84
85
86 ---------------------------------------------------------------------------------------------------
87
88
89 /* This procedure is the overlaoded function that will take care of the
90 of the requirement of Balance adjustment process.*/
91
92 PROCEDURE date_ec
93 (
94 p_owner_payroll_action_id IN NUMBER, -- run created balance.
95 p_user_payroll_action_id IN NUMBER, -- current run.
96 p_owner_assignment_action_id IN NUMBER, -- assact created balance.
97 p_user_assignment_action_id IN NUMBER, -- current assact..
98 p_owner_effective_date IN DATE, -- eff date of balance.
99 p_user_effective_date IN DATE, -- eff date of current run.
100 p_dimension_name IN VARCHAR2, -- balance dimension name.
101 p_expiry_information OUT NOCOPY DATE -- dimension expired date.
102 ) is
103
104 l_beg_of_fiscal_year DATE := NULL;
105 l_expiry_date DATE := NULL;
106
107 BEGIN
108
109 IF (p_dimension_name like '%Bi-Monthly To Date') OR (p_dimension_name like '%Bi Month Period') THEN
110 p_expiry_information := next_bimonth_period(p_owner_payroll_action_id,
111 p_owner_effective_date);
112 ELSE
113
114 hr_utility.set_message(801, 'PAY_376854_NO_NONE_DIM_EXP_CHK');
115 hr_utility.raise_error;
116
117 END IF;
118
119 END date_ec; /* date p_expiry information procedure overloaded function */
120
121 ---------------------------------------------------------------------------------------------------
122
123
124 END pay_no_expiry_support;