1 package SSP_APAD_PKG AUTHID CURRENT_USER as
2 /*$Header: spapadapi.pkh 120.0 2010/11/27 18:02:27 npannamp noship $
3 +==============================================================================+
4 | Copyright (c) 1994 Oracle Corporation |
5 | Redwood Shores, California, USA |
6 | All rights reserved. |
7 +==============================================================================+
8 --
9 Name
10 Additional Statutory Paternity Pay Adoption Business Process
11 --
12 Purpose
13 To perform calculation of entitlement and payment for APAD purposes
14 --
15 History
16 17 Nov 10 npannamp 9897338 Created from SSP_PAD_PKG
17 */
18 --------------------------------------------------------------------------------
19 -- ***************************************************************************
20 -- * Performs actions required by the UK legislation for Additional Statutory
21 -- * Paternity Pay Adoption. See the High Level Design document for general
22 -- * details of the functionality and use of GB_ADDL_PAT_ADO.
23 -- ***************************************************************************
24 --
25 c_APAD_element_name constant varchar2(80) := 'Additional Statutory Paternity Pay Adoption';
26 c_APAD_Corr_element_name constant varchar2(80) := 'ASPP Adoption Corrections';
27 c_APAD_creator_type constant varchar2(3) := 'M';
28 c_APAD_entry_type constant varchar2(1) := 'E';
29 c_week_commencing_name constant varchar2(30) := 'Week Commencing';
30 c_amount_name constant varchar2(30) := 'Amount';
31 c_recoverable_amount_name constant varchar2(30) := 'Recoverable Amount';
32 c_rate_name constant varchar2(30) := 'Rate';
33 --
34 -- Get the element details for APAD
35 --
36 -- Get the legislative parameters for APAD, which are held in the
37 -- Developer descriptive Flexfield of the element.
38 --
39 cursor CSR_APAD_ELEMENT_DETAILS (p_effective_date date default sysdate,
40 p_element_name varchar2 default c_APAD_element_name) is
41 select ele1.element_type_id,
42 ele1.effective_start_date,
43 ele1.effective_end_date,
44 to_number (ele1.element_information1) *7 EARLIEST_START_OF_ASPPP,
45 to_number (ele1.element_information2) *7 QUALIFYING_WEEK,
46 to_number (ele1.element_information3) *7 CONTINUOUS_EMPLOYMENT_PERIOD,
47 to_number (ele1.element_information4) MAXIMUM_ASPPP_WEEKS,
48 to_number (ele1.ELEMENT_INFORMATION5) MAXIMUM_ASPPP_MOM_DEATH_WEEKS,
49 to_number (ele1.element_information6) /100 ASPP_RATE,
50 to_number (ele1.element_information7) /100 RECOVERY_RATE,
51 to_number (ele1.element_information8) STANDARD_RATE,
52 to_number (ele1.element_information9) LATEST_END_OF_APL,
53 to_number (ele1.element_information10) MIN_APL_WEEKS,
54 to_number (ele1.element_information11) MAX_APL_WEEKS,
55 to_number (ele1.element_information12) MAX_APL_MOM_DEATH_WEEKS,
56 to_number (ele1.element_information13) EARLIEST_START_MOM_DEATH_ASPPP,
57 to_number (ele1.element_information14) ASPP_NOTICE_REQUIREMENT,
58 to_number (ele1.element_information15) ASPP_CHANGE_NOTICE_REQUIREMENT,
59 to_number (ele1.element_information16) *7 DEATH_OF_CHILD_WEEK,
60 ssp_smp_support_pkg.element_input_value_id
61 (ele1.element_type_id, c_rate_name)
62 RATE_ID,
63 ssp_smp_support_pkg.element_input_value_id
64 (ele1.element_type_id, c_week_commencing_name)
65 WEEK_COMMENCING_ID,
66 ssp_smp_support_pkg.element_input_value_id
67 (ele1.element_type_id, c_amount_name)
68 AMOUNT_ID,
69 ssp_smp_support_pkg.element_input_value_id
70 (ele1.element_type_id, c_recoverable_amount_name)
71 RECOVERABLE_AMOUNT_ID
72 from pay_element_types_f ele1
73 where ele1.element_name = p_element_name
74 and p_effective_date between ele1.effective_start_date
75 and ele1.effective_end_date;
76
77 --------------------------------------------------------------------------------
78 function MATERNITY_RECORD_EXISTS (p_person_id in number) return boolean;
79 --
80 -- Returns TRUE if there is a maternity record for the person
81 --
82 pragma restrict_references (maternity_record_exists, WNPS,WNDS);
83
84 function MATCHING_WEEK_OF_ADOPTION (p_matching_date in date) return date;
85 --
86 -- Returns the start date of the Matching Week
87 -- for SAP, based on the matching date.
88 --
89 pragma restrict_references (MATCHING_WEEK_OF_ADOPTION, WNPS,WNDS);
90
91 function Earliest_ASPPP_start_date (p_placement_date in date) return date;
92 --
93 -- Returns the earliest date a person may start their Paternity Pay
94 -- Period, based on the expected date.
95 --
96 pragma restrict_references (Earliest_ASPPP_start_date, WNPS,WNDS);
97
98 function Latest_ASPPP_start_date (p_placement_date in date, p_mpp_start_date in date) return date;
99 --
100 -- Returns the latest date a person may start their Paternity Pay
101 -- Period, based on the placement date.
102 --
103 pragma restrict_references (Latest_ASPPP_start_date, WNPS,WNDS);
104
105 function Continuous_employment_date (p_matching_date in date) return date;
106 --
107 -- Returns the start date of the period ending with the Qualifying
108 -- Week, for which the woman must have been continuously employed
109 -- in order to qualify for APAD
110 --
111 pragma restrict_references (Continuous_employment_date, WNPS,WNDS);
112
113 function partner_app_end_date (p_partner_app_start_date in date, p_partner_return_to_work in date) return date;
114 --
115 -- Returns the End date of mother/partners MPP/SAP.
116 -- Date on which partner returns to work - 1.
117 --
118 pragma restrict_references (partner_app_end_date, WNPS,WNDS);
119 --
120
121
122 procedure APAD_control (p_maternity_id in number,
123 p_deleting in boolean default FALSE);
124 --
125 end ssp_APAD_pkg;