1 package SSP_PAD_PKG as
2 /*$Header: sppadapi.pkh 120.0.12000000.1 2007/01/17 14:14:47 appldev noship $
3 +==============================================================================+
4 | Copyright (c) 1994 Oracle Corporation |
5 | Redwood Shores, California, USA |
6 | All rights reserved. |
7 +==============================================================================+
8 --
9 Name
10 Statutory Paternity Pay Adoption Business Process
11 --
12 Purpose
13 To perform calculation of entitlement and payment for PAD purposes
14 --
15 History
16 30 Oct 02 A Blinko 2690305 Created from SSP_SMP_PKG
17 */
18 --------------------------------------------------------------------------------
19 -- ***************************************************************************
20 -- * Performs actions required by the UK legislation for Statutory
21 -- * Paternity Pay Adoption. See the High Level Design document for general
22 -- * details of the functionality and use of GB_PAT_ADO.
23 -- ***************************************************************************
24 --
25 c_PAD_element_name constant varchar2(80) := 'Statutory Paternity Pay Adoption';
26 c_PAD_Corr_element_name constant varchar2(80) := 'SPP Adoption Corrections';
27 c_PAD_creator_type constant varchar2(3) := 'M';
28 c_PAD_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 PAD
35 --
36 -- Get the legislative parameters for PAD, which are held in the
37 -- Developer descriptive Flexfield of the element.
38 --
39 cursor CSR_PAD_ELEMENT_DETAILS (p_effective_date date default sysdate,
40 p_element_name varchar2 default c_PAD_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_PPP,
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_PPP,
48 to_number(ele1.element_information5) MPP_NOTICE_REQUIREMENT,
49 to_number(ele1.element_information6) /100 SPP_RATE,
50 to_number(ele1.element_information7) /100 RECOVERY_RATE,
51 to_number(ele1.element_information8) STANDARD_RATE,
52 to_number(ele1.element_information9) *7 LATEST_END_OF_PPP,
53 ssp_smp_support_pkg.element_input_value_id
54 (ele1.element_type_id,
55 c_rate_name) RATE_ID,
56 ssp_smp_support_pkg.element_input_value_id
57 (ele1.element_type_id,
58 c_week_commencing_name) WEEK_COMMENCING_ID,
59 ssp_smp_support_pkg.element_input_value_id
60 (ele1.element_type_id,
61 c_amount_name) AMOUNT_ID,
62 ssp_smp_support_pkg.element_input_value_id
63 (ele1.element_type_id,
64 c_recoverable_amount_name) RECOVERABLE_AMOUNT_ID
65 from pay_element_types_f ele1
66 where ele1.element_name = p_element_name
67 and p_effective_date between ele1.effective_start_date
68 and ele1.effective_end_date;
69 --------------------------------------------------------------------------------
70 function MATERNITY_RECORD_EXISTS (p_person_id in number) return boolean;
71 --
72 -- Returns TRUE if there is a maternity record for the person
73 --
74 pragma restrict_references (maternity_record_exists, WNPS,WNDS);
75
76 function MATCHING_WEEK_OF_ADOPTION (p_matching_date in date) return date;
77 --
78 -- Returns the start date of the Matching Week
79 -- for SAP, based on the matching date.
80 --
81 pragma restrict_references (MATCHING_WEEK_OF_ADOPTION, WNPS,WNDS);
82
83 function Earliest_PPP_start_date (p_due_date in date) return date;
84 --
85 -- Returns the earliest date a person may start their Paternity Pay
86 -- Period, based on the expected date.
87 --
88 pragma restrict_references (Earliest_PPP_start_date, WNPS,WNDS);
89
90 function Latest_PPP_start_date (p_placement_date in date) return date;
91 --
92 -- Returns the latest date a person may start their Paternity Pay
93 -- Period, based on the placement date.
94 --
95 pragma restrict_references (Latest_PPP_start_date, WNPS,WNDS);
96
97 function Continuous_employment_date (p_matching_date in date) return date;
98 --
99 -- Returns the start date of the period ending with the Qualifying
100 -- Week, for which the woman must have been continuously employed
101 -- in order to qualify for PAD
102 --
103 pragma restrict_references (Continuous_employment_date, WNPS,WNDS);
104
105 procedure PAD_control (p_maternity_id in number,
106 p_deleting in boolean default FALSE);
107 --
108 end ssp_pad_pkg;