1 package pay_ie_paye_pkg as
2 /* $Header: pyietax.pkh 120.5 2008/06/02 14:07:27 amakrish noship $ */
3 /*
4 **
5 ** Copyright (C) 1999 Oracle Corporation
6 ** All Rights Reserved
7 **
8 ** IE PAYE package header
9 **
10 ** Change List
11 ** ===========
12 **
13 ** Date Author Reference Description
14 ** -----------+--------+---------+-------------
15 ** 20 JUN 2001 jmhatre N/A Created
16 ** 18 OCT 2001 abhaduri N/A Changes due to SOE form requirement
17 added p_assess_basis and
18 p_certificate_issue_date as OUT parameters
19 to function get_paye_details for feeding
20 them to PAYE details
21 ** 05 DEC 2001 gpadmasa N/A Added dbdrv Commands
22 ** 11 FEB 2002 abhaduri N/A Added input parameters - Reduced Tax Credit,
23 Reduced Std Rate Cut Off and Benefit amt.
24 for P45 data archiving and display.
25 ** 26 JUN 2002 abhaduri N/A Added function get_calculated_period_values
26 for calculating tax credits and cut offs
27 according to user entered values and
28 period types.
29 ** 09-DEC-2002 smrobins N/A Added function get_pps_number, if no pps
30 number exists for the person record
31 linked to the assignment or if the tax
32 basis emergency no pps is specifically
33 selected for the assignment return 1.
34 ** 16-MAY-2003 nsugavan 2943335 Added function Valid_Work_incidents.
35 ** This would return true if the work incident
36 ** entered on the screen exists for the person
37 ** 04-jul-2003 asengar 3030621 Added two procedures insert_element_entry
38 ** and update_element_entry.
39 ** 30-JUL-2003 asengar 3030616 Added four functions get_weekly_tax_credit
40 ** get_weekly_std_rate_cut_off,get_monthly_tax_credit
41 ** get_monthly_std_rate_cut_off.
42 ** 09-FEB-2005 aashokan 4080773 Added a new procedure to create new tax record
43 ** if pay frequency is changed.
44 ** 10-FEB-2005 aashokan Modified dbdrv command.
45 ** 10-Feb-2005 vikgupta 4080773 Modified the proc update_paye_change_freq (included
46 ** P_DATETRACK_UPDATE_MODE)
47 ** 14-Feb-2005 skhandwa 4080773 Modified the proc update_paye_change_freq .
48 Passing all P45 items to hr_api.g_number. Also added
49 validation before Future Change.
50 ** 15-Feb-2005 vikgupta 4080773 Removed dbdrv checkfile for pyietaxd.sql
51 ** 22-Feb-2005 skhandwa 4080773 Added old_payroll_id variable handling
52 ** 15-Dec-2005 vikgupta 4878630 Modified the signature of update_paye_change_freq
53 ** for tax credit upload process.
54 ** 09-Jan-2006 vikgupta 5678929 Made decode_value_char, decode_value_date and
55 ** decode_value_number public
56 ** 19-Feb-2007 vikgupta SR 17140460.6, change the parameter passed to
57 ** update_paye_change_freq
58 ** 09-Apr-2007 rbhardwa 5867343 Modified code to include new functions get_paye_tax_basis,
59 ** get_diff_tax_basis and get_ie_exclude_tax_basis.
60 ** 05-May-2008 knadhan 6929566 Added new parameter to update_paye_change_frequency
61 -------------------------------------------------------------------------------
62 */
63
64 Function get_old_payroll_id return number;
65 Procedure set_old_payroll_id(
66 p_old_payroll_id number
67 );
68 Procedure unset_old_payroll_id;
69
70
71 Function get_paye_tax_basis (p_assignment_id in number /* 5867343 */
72 ,p_payroll_action_id in number
73 ,p_tax_basis out nocopy varchar2)
74 return number;
75
76 Function get_diff_tax_basis(p_assignment_id in number /* 5867343 */
77 ,p_payroll_id in number
78 ,p_date_earned in date)
79 return number;
80
81
82 Function get_ie_exclude_tax_basis(p_assignment_id in number /* 5867343 */
83 ,p_payroll_id in number
84 ,p_date_earned in date)
85 return number;
86
87
88 Function get_paye_details( p_assignment_id in number
89 ,p_payroll_action_id in number
90 ,p_info_source out nocopy varchar2
91 ,p_tax_basis out nocopy varchar2
92 ,p_weekly_tax_credit out nocopy number
93 ,p_monthly_tax_credit out nocopy number
94 ,p_weekly_std_rate_cutoff out nocopy number
95 ,p_monthly_std_rate_cutoff out nocopy number
96 ,p_certificate_start_date out nocopy date
97 ,p_certificate_end_date out nocopy date
98 /*changes for SOE form requirements*/
99 ,p_assess_basis out nocopy varchar2
100 ,p_certificate_issue_date out nocopy date
101 /***********************************************/
102 ,p_reduced_tax_credit out nocopy number
103 ,p_reduced_std_rate_cutoff out nocopy number
104 ,p_benefit_amount out nocopy number)
105 return number;
106
107 Function get_payroll_details( p_payroll_id in number
108 ,p_payroll_action_id in number
109 ,p_period_num out nocopy number
110 ,p_payroll_type out nocopy varchar2)
111 return number;
112
113 Function get_calculated_period_values(p_period_type in varchar2,
114 p_period_ind in varchar2,
115 p_actual_value in number)
116 return number;
117
118 Function get_pps_number( p_assignment_id in number
119 ,p_payroll_action_id in number)
120 return number;
121 -- Bug 2943335 added function to see if work incident exist for the person
122 -- This would return true if the work incident
123 -- entered on the screen exists for the person
124 function Valid_Work_incidents
125 (p_assignment_id in number
126 ,p_date_earned in date
127 ,p_reference in varchar2)
128 return varchar2;
129
130 /* Added following two procedures for BUG 3030621 */
131 -- -------------------------------------------------------------------
132 -- procedure insert_element_entry
133 -- -------------------------------------------------------------------
134
135 procedure insert_element_entry
136 (
137 p_element_entry_id in number
138 );
139 --
140
141 -- -------------------------------------------------------------------
142 -- procedure update_element_entry
143 -- -------------------------------------------------------------------
144
145 procedure update_element_entry
146 (
147 p_element_entry_id in number
148 );
149 /* End of BUG 3030621 */
150 /*ADDED FOUR FUNCTIONS FOR BUG 3030616 */
151 function get_weekly_tax_credit
152 (p_assignment_id in pay_ie_paye_details_f.ASSIGNMENT_ID%TYPE,
153 p_tax_basis in pay_ie_paye_details_f.TAX_BASIS%TYPE)
154 RETURN number;
155 --
156 function get_weekly_std_rate_cut_off
157 (p_assignment_id in pay_ie_paye_details_f.ASSIGNMENT_ID%TYPE,
158 p_tax_basis in pay_ie_paye_details_f.TAX_BASIS%TYPE)
159 RETURN number;
160 --
161 function get_monthly_tax_credit
162 (p_assignment_id in pay_ie_paye_details_f.ASSIGNMENT_ID%TYPE,
163 p_tax_basis in pay_ie_paye_details_f.TAX_BASIS%TYPE)
164 RETURN number;
165 --
166 function get_monthly_std_rate_cut_off
167 (p_assignment_id in pay_ie_paye_details_f.ASSIGNMENT_ID%TYPE,
168 p_tax_basis in pay_ie_paye_details_f.TAX_BASIS%TYPE)
169 RETURN number;
170 /* End of BUG 3030616 */
171
172 /*Bug 4080773*/
173 PROCEDURE update_paye_change_freq(p_assignment_id number
174 ,p_effective_date date
175 ,p_payroll_id number
176 ,P_DATETRACK_UPDATE_MODE VARCHAR2
177 ,p_tax_upload_flag varchar2 default 'X'
178 ,p_tax_basis varchar2 default null
179 ,p_cert_start_date date default null -- 17140460.6
180 ,p_cert_end_date date default null
181 ,p_weekly_tax_credit number default null
182 ,p_monthly_tax_credit number default null
183 ,p_weekly_std_rate_cut_off number default null
184 ,p_monthly_std_rate_cut_off number default null
185 ,p_tax_deducted_to_date number default null
186 ,p_pay_to_date number default null
187 ,p_cert_date date); -- Bug 6929566
188
189 function decode_value_char(p_expression boolean,
190 p_true varchar2,
191 p_false varchar2) return varchar2;
192
193 function decode_value_date(p_expression boolean,
194 p_true date,
195 p_false date) return date;
196
197 function decode_value_number(p_expression boolean,
198 p_true number,
199 p_false number) return number;
200
201 end;
202