1 package per_accrual_calc_functions as
2 /* $Header: peaclcal.pkh 120.4.12010000.1 2008/07/28 04:02:01 appldev ship $ */
3 --
4 -- Record type specification
5 --
6 Type g_accrual_plan_rec_type is record (
7 accrual_formula_id number,
8 accrual_plan_element_type_id number
9 );
10
11 --
12 -- Procedure and Function Specifications
13 --
14
15 /* =====================================================================
16 Name : Calculate_Accrual
17 Purpose : Determines whether an assignment is enrolled in a plan, and
18 if so, executes the formula to calculate the accrual for
19 the plan(s).
20 ---------------------------------------------------------------------*/
21 procedure Calculate_Accrual
22 (P_Assignment_ID IN Number
23 ,P_Plan_ID IN Number
24 ,P_Payroll_ID IN Number
25 ,P_Business_Group_ID IN Number
26 ,P_Accrual_formula_ID IN Number
27 ,P_Assignment_Action_ID IN Number default null
28 ,P_Calculation_Date IN Date
29 ,P_Accrual_Start_Date IN Date default null
30 ,P_Accrual_Latest_Balance IN Number default null
31 ,P_Total_Accrued_PTO OUT NOCOPY Number
32 ,P_Effective_Start_Date OUT NOCOPY Date
33 ,P_Effective_End_Date OUT NOCOPY Date
34 ,P_Accrual_End_Date OUT NOCOPY Date);
35 --
36 /* =====================================================================
37 Name : Get_Accrual
38 Purpose :
39 Returns : Total Accrual
40 ---------------------------------------------------------------------*/
41 Procedure Get_Accrual
42 (P_Assignment_ID IN Number
43 ,P_Calculation_Date IN Date
44 ,P_Plan_ID IN Number
45 ,P_Business_Group_ID IN Number
46 ,P_Payroll_ID IN Number
47 ,P_Assignment_Action_ID IN Number default null
48 ,P_Accrual_Start_Date IN Date default null
49 ,P_Accrual_Latest_Balance IN Number default null
50 ,P_Start_Date OUT NOCOPY Date
51 ,P_End_Date OUT NOCOPY Date
52 ,P_Accrual_End_Date OUT NOCOPY Date
53 ,P_Accrual OUT NOCOPY number);
54 --
55 /* =====================================================================
56 Name : Get_Accrual_Plan
57 Purpose :
58 Returns : Table of Accrual Plan Details
59 ---------------------------------------------------------------------*/
60 function Get_Accrual_Plan
61 (P_Plan_ID IN Number) RETURN g_accrual_plan_rec_type;
62 --
63 /* =====================================================================
64 Name : Check_Assignment_Enrollment
65 Purpose :
66 Returns : True if assignment is enrolled, otherwise false.
67 ---------------------------------------------------------------------*/
68 function Check_Assignment_Enrollment
69 (P_Assignment_ID IN Number
70 ,P_Accrual_Plan_Element_Type_ID IN Number
71 ,P_Calculation_Date IN Date) return Boolean;
72 --
73 /* =====================================================================
74 Name : Get_Carry_Over_Values
75 Purpose :
76 Returns : Max Carry over and effective date of carry over. Used by
77 carry over process.
78 ---------------------------------------------------------------------*/
79 procedure Get_Carry_Over_Values
80 (P_CO_Formula_ID IN Number
81 ,P_Assignment_ID IN Number
82 ,P_Accrual_Plan_ID IN Number
83 ,P_Business_Group_ID IN Number
84 ,P_Payroll_ID IN Number
85 ,P_Calculation_Date IN Date
86 ,P_Session_Date IN Date
87 ,P_Accrual_Term IN Varchar2
88 ,P_Effective_Date OUT NOCOPY Date
89 ,P_Expiry_Date OUT NOCOPY Date
90 ,P_Max_Carry_Over OUT NOCOPY Number);
91 --
92 /* =====================================================================
93 Name : Get_Absence
94 Purpose :
95 Returns : Total Absence
96 ---------------------------------------------------------------------*/
97 function Get_Absence
98 (P_Assignment_ID IN Number
99 ,P_Plan_ID IN Number
100 ,P_Calculation_Date IN Date
101 ,P_Start_Date IN Date
102 ,p_absence_attendance_type_id IN NUMBER default NULL
103 ,p_pto_input_value_id IN NUMBER default NULL) return Number;
104 --
105 /* =====================================================================
106 Name : Get_Carry_Over
107 Purpose :
108 Returns : Total Carry Over amount
109 ---------------------------------------------------------------------*/
110 function Get_Carry_Over
111 (P_Assignment_ID IN Number
112 ,P_Plan_ID IN Number
113 ,P_Calculation_Date IN Date
114 ,P_Start_Date IN Date) return Number;
115 --
116 /* =====================================================================
117 Name : Get_Other_Net_Contribution
118 Purpose :
119 Returns :
120 ---------------------------------------------------------------------*/
121 function Get_Other_Net_Contribution
122 (P_Assignment_ID IN Number
123 ,P_Plan_ID IN Number
124 ,P_Calculation_Date IN Date
125 ,P_Start_Date IN Date
126 ,P_Input_Value_ID IN Number default null) return Number;
127 --
128 /* =====================================================================
129 Name : Get_Net_Accrual
130 Purpose :
131 Returns : Total Absence
132 ---------------------------------------------------------------------*/
133 Procedure Get_Net_Accrual
134 (P_Assignment_ID IN Number
135 ,P_Plan_ID IN Number
136 ,P_Payroll_ID IN Number
137 ,P_Business_Group_ID IN Number
138 ,P_Assignment_Action_ID IN Number default -1
139 ,P_Calculation_Date IN Date
140 ,P_Accrual_Start_Date IN Date default null
141 ,P_Accrual_Latest_Balance IN Number default null
142 ,P_Calling_Point IN Varchar2 default 'FRM'
143 ,P_Start_Date OUT NOCOPY Date
144 ,P_End_Date OUT NOCOPY Date
145 ,P_Accrual_End_Date OUT NOCOPY Date
146 ,P_Accrual OUT NOCOPY Number
147 ,P_Net_Entitlement OUT NOCOPY Number);
148 --
149 /* =====================================================================
150 Name : get_asg_inactive_days
151 Purpose : Gets the number of days in a period where the assignment
152 status is not 'Active'.
153 Returns : Number of inactive days in the period.
154 ---------------------------------------------------------------------*/
155 FUNCTION get_asg_inactive_days
156 (p_assignment_id IN NUMBER,
157 p_period_sd IN DATE,
158 p_period_ed IN DATE) RETURN NUMBER;
159 --
160 /* =====================================================================
164 ---------------------------------------------------------------------*/
161 Name : get_working_days
162 Purpose : Gets the number of working days in a given period.
163 Returns : Number of working days in the period.
165 FUNCTION get_working_days
166 (p_start_date IN DATE,
167 p_end_date IN DATE) RETURN NUMBER;
168 --
169 end per_accrual_calc_functions;