1 package body pyfrexc as
2 /* $Header: pyfrexc.pkb 115.2 2002/11/28 18:00:26 asnell noship $ */
3 /* Copyright (c) Oracle Corporation 1994. All rights reserved. */
4 /*
5 PRODUCT
6 Oracle*Payroll
7 NAME
8 pyfrexc.pkb - PaYroll Test FR legislation EXpiry Checking code.
9 DESCRIPTION
10 Contains the expiry checking code that was contained as part
11 of the dimensions created by pyfrbdim.sql.
12 PUBLIC FUNCTIONS
13 <none>
14 PRIVATE FUNCTIONS
15 <none>
16 NOTES
17 based on UK package pyfrexc.pkb
18
19 MODIFIED (DD/MM/YY)
20 asnell 21/06/00 - first created.
21 asnell 25/11/02 - added nocopy to out parms
22 asnell 28/11/02 - bug 2352944 changes keep expiry code in step
23 with route changes
24 */
25 /*------------------------------ ASG_RUN_EC ----------------------------*/
26 /*
27 NAME
28 ASG_RUN_EC - Assignment Run to Date expiry check.
29 DESCRIPTION
30 Expiry checking code for the following:
31 FR Assignment-level Run To Date Balance Dimension
32 NOTES
33 The associated dimension is expiry checked at payroll action level
34 */
35 procedure ASG_RUN_EC
36 (
37 p_owner_payroll_action_id in number, -- run created balance.
38 p_user_payroll_action_id in number, -- current run.
39 p_owner_assignment_action_id in number, -- assact created balance.
40 p_user_assignment_action_id in number, -- current assact..
41 p_owner_effective_date in date, -- eff date of balance.
42 p_user_effective_date in date, -- eff date of current run.
43 p_dimension_name in varchar2, -- balance dimension name.
44 p_expiry_information out nocopy number -- dimension expired flag.
45 ) is
46
47 begin
48 if p_user_payroll_action_id = p_owner_payroll_action_id then
49 p_expiry_information := 0;
50 else
51 p_expiry_information := 1;
52 end if;
53
54 end ASG_RUN_EC;
55
56 /*------------------------------ ASG_PROC_PTD_EC ----------------------------*/
57 /*
58 NAME
59 ASG_PTD_EC - Assignment Processing Period to Date expiry check.
60 DESCRIPTION
61 Expiry checking code for the following:
62 FR Assignment-level Process Period To Date Balance Dimension
63 NOTES
64 The associated dimension is expiry checked at payroll action level
65 */
66 procedure ASG_PTD_EC
67 (
68 p_owner_payroll_action_id in number, -- run created balance.
69 p_user_payroll_action_id in number, -- current run.
70 p_owner_assignment_action_id in number, -- assact created balance.
71 p_user_assignment_action_id in number, -- current assact..
72 p_owner_effective_date in date, -- eff date of balance.
73 p_user_effective_date in date, -- eff date of current run.
74 p_dimension_name in varchar2, -- balance dimension name.
75 p_expiry_information out nocopy number -- dimension expired flag.
76 ) is
77 begin
78
79 if p_owner_effective_date >= trunc(p_user_effective_date,'MM') then
80 p_expiry_information := 0;
81 else
82 p_expiry_information := 1;
83 end if;
84
85 end ASG_PTD_EC;
86
87 /*------------------------------ ASG_PROC_YTD_EC ----------------------------*/
88 /*
89 NAME
90 ASG_YTD_EC - Assignment Processing Year to Date expiry check.
91 DESCRIPTION
92 Expiry checking code for the following:
93 FR Assignment-level Process Year To Date Balance Dimension
94 NOTES
95 The associated dimension is expiry checked at payroll action level
96 */
97 procedure ASG_PROC_YTD_EC
98 (
99 p_owner_payroll_action_id in number, -- run created balance.
100 p_user_payroll_action_id in number, -- current run.
101 p_owner_assignment_action_id in number, -- assact created balance.
102 p_user_assignment_action_id in number, -- current assact..
103 p_owner_effective_date in date, -- eff date of balance.
104 p_user_effective_date in date, -- eff date of current run.
105 p_dimension_name in varchar2, -- balance dimension name.
106 p_expiry_information out nocopy number -- dimension expired flag.
107 ) is
108
109 begin
110 --
111 if p_owner_effective_date >= trunc(p_user_effective_date,'Y') then
112 p_expiry_information := 0;
113 else
114 p_expiry_information := 1;
115 end if;
116
117 end ASG_PROC_YTD_EC;
118 /*------------------------------ feed_month ---------------------------------*/
119 /*
120 NAME
121 feed_month - only feed in the correct month for the dimension
122 DESCRIPTION
123 Feed checking code for the following:
124 FR ASG Month
125 NOTES
126 <none>
127 */
128 procedure feed_month
129 (
130 p_payroll_action_id in number,
131 p_assignment_action_id in number,
132 p_assignment_id in number,
133 p_effective_date in date,
134 p_dimension_name in varchar2,
135 p_balance_contexts in varchar2,
136 p_feed_flag in out nocopy number
137 ) is
138
139 begin
140 hr_utility.trace('feed checking p_balance_contexts:'||p_balance_contexts);
141
142 -- this code is called from all the month dimensions. So extract
143 -- the month number from the dimension name and check against
144 -- cached month
145 if trunc(p_effective_date,'MM') = substr(p_dimension_name,32,2) then p_feed_flag := 1;
146 else p_feed_flag := 0;
147 end if;
148
149 end feed_month;
150
151 end pyfrexc;