1 PACKAGE py_za_tx_utl_01032004 AS
2 /* $Header: pyzatu05.pkh 120.0 2005/05/29 10:33:08 appldev noship $ */
3 /* Copyright (c) Oracle Corporation 2000. All rights reserved. */
4 /*
5 PRODUCT
6 Oracle Payroll - ZA Localisation Tax Module
7
8 NAME
9 py_za_tx_utl_01032004.pkh
10
11 DESCRIPTION
12 This is the ZA Tax Module utility package. It contains
13 functions and procedures used by the main tax package.
14
15 PUBLIC FUNCTIONS
16 GlbVal
17 Returns the value of a Oracle Application Global
18 date effectively
19 NegPtd
20 Boolean function returns true if any current PTD
21 total balance value is negative
22 LatePayPeriod
23 Boolean function returns true if the current period
24 is a Late Payment Period, i.e. a payment over the
25 tax year boundary.
26 LstPeriod
27 Boolean function returns true if current period is the
28 last period in the current tax year.
29 EmpTermInPeriod
30 Boolean function returns true if the assignment was terminated
31 in the current pay period.
32 EmpTermPrePeiod
33 Boolean function returns true if the assignment was terminated
34 before the current period.
35 PreErnPeriod
36 Boolean function returns true if this run is deemed to be
37 a Pre-Earnings Calculation Run.
38 For a complete description see the tax module design document.
39 SitePeriod
40 Boolean function returns true if it is a tax site period.
41 For a complete description see the tax module design document.
42 Annualise
43 Returns annualised value to the calling object.
44 For a complete description see the tax module design document.
45 TaxLiability
46 Returns the gross tax liability on passed value.
47 For a complete description see the tax module design document.
48 DeAnnualise
49 Returns the de-annualised value to the calling object.
50 For a complete description see the tax module design document.
51 DaysWorked
52 Returns the number of days worked for the assignment.
53 For a complete description see the tax module design document.
54
55 PUBLIC PROCEDURES
56 StartHrTrace
57 Sets package global that determines if extra trace information
58 will be written to file - hr_utility
59 StopHrTrace
60 Stops trace information from being written to file
61 WriteHrTrace
62 Writes extra trace information to file if global
63 has been set
64 PeriodFactor
65 Calculates the period factor for the assignment.
66 For a complete description see the tax module design document.
67 PossiblePeriodsFactor
68 Calculates the possible period factor for the assignment.
69 For a complete description see the tax module design document.
70 SetRebates
71 Calculate tax Rebate and Threshold values.
72 For a complete description see the tax module design document.
73 Abatements
74 Calculates all necessary abatements.
75 For a complete description see the tax module design document.
76 ArrearExcess
77 Calculates the arrear excess figure to 'effectively' update the
78 Asg_Itd dimension of the arrear excess pension and retirement
79 annuity balances. Will only fire on siteperiod.
80 TrvAll
81 Calculates the taxable travel allowance over a period of
82 time based on the effective global values at the time.
83 For a complete description see the tax module design document.
84 ValidateTaxOns
85 Validates the calculated category liabilities.
86 For a complete description see the tax module design document.
87 SitPaySplit
88 Calculates the site paye split of tax liabilities.
89 For a complete description see the tax module design document.
90 Trace
91 Traces the tax calculation.
92 For a complete description see the tax module design document.
93 ClearGlobals
94 Clears any set package globals.
95 For a complete description see the tax module design document.
96
97 PRIVATE FUNCTIONS
98 see package body
99
100 PRIVATE PROCEDURES
101 see package body
102
103 NOTES
104 .
105
106 MODIFICATION HISTORY
107 Person Date Version Comments
108 --------- ---------------- ------- -----------------------------------
109 J.N. Louw 18/12/2004 115.1 Bug 3931259
110 J.N. Louw 11/02/2004 115.0 Next Version of Main ZA Tax
111 Package.
112 For detail history see
113 py_za_tx_utl_01032002
114 */
115
116 -------------------------------------------------------------------------------
117 -- PACKAGE GLOBAL AREA --
118 -------------------------------------------------------------------------------
119 -- hr_utility wrapper globals
120 g_HrTraceEnabled BOOLEAN DEFAULT FALSE;
121 g_HrTracePipeName VARCHAR2(30);
122
123 -- Tax Specific Subtypes
124 SUBTYPE t_balance IS NUMBER(15,2);
125 -------------------------------------------------------------------------------
126 -- PACKAGE SPECIFICATION --
127 -------------------------------------------------------------------------------
128
129 -- StartHrTrace
130 -- Wrapper for hr_utility.trace_on
131 PROCEDURE StartHrTrace;
132
133 -- StartHrTrace
134 -- Function wrapper for hr_utility.trace_on
135 FUNCTION StartHrTrace(
136 p_HrTracePipeName VARCHAR2
137 ) RETURN VARCHAR2;
138
139 -- StopHrTrace
140 -- Wrapper for hr_utility.trace_off
141 PROCEDURE StopHrTrace;
142
143 -- StopHrTrace
144 -- Function wrapper for hr_utility.trace_off
145 FUNCTION StopHrTrace RETURN VARCHAR2;
146
147 -- WriteHrTrace
148 -- Wrapper for hr_utility.trace
149 PROCEDURE WriteHrTrace(
150 p_Buffer VARCHAR2
151 );
152
153
154
155 -- Tax Utility Functions
156 --
157
158 FUNCTION GlbVal
159 (p_GlbNme ff_globals_f.global_name%TYPE
160 ,p_EffDte DATE
161 ) RETURN ff_globals_f.global_value%TYPE;
162
163 FUNCTION NegPtd RETURN BOOLEAN;
164
165 FUNCTION LatePayPeriod RETURN BOOLEAN;
166
167 FUNCTION LstPeriod RETURN BOOLEAN;
168
169 FUNCTION EmpTermInPeriod RETURN BOOLEAN;
170
171 FUNCTION EmpTermPrePeriod RETURN BOOLEAN;
172
173 FUNCTION PreErnPeriod RETURN BOOLEAN;
174
175 FUNCTION SitePeriod RETURN BOOLEAN;
176
177 PROCEDURE PeriodFactor;
178
179
180 PROCEDURE PossiblePeriodsFactor;
181
182
183 FUNCTION Annualise
184 (p_YtdInc IN NUMBER
185 ,p_PtdInc IN NUMBER
186 ) RETURN NUMBER;
187
188 PROCEDURE SetRebates;
189
190 PROCEDURE Abatements;
191
192 PROCEDURE ArrearExcess;
193
194 FUNCTION TaxLiability
195 (p_Amt IN NUMBER
196 )RETURN NUMBER;
197
198
199 FUNCTION DeAnnualise
200 (p_Liab IN NUMBER
201 ,p_TxOnYtd IN NUMBER
202 ,p_TxOnPtd IN NUMBER
203 ) RETURN NUMBER;
204
205
206 PROCEDURE TrvAll;
207
208
209
210 PROCEDURE ValidateTaxOns(
211 p_Rf IN BOOLEAN DEFAULT FALSE -- Refund Allowed Regardless
212 );
213
214
215 -- DaysWorked
216 /* Returns the number of days that the person has worked
217 This could be a negative number that would indicate
218 a LatePayePeriod
219 */
220 FUNCTION DaysWorked RETURN NUMBER;
221
222
223 PROCEDURE SitPaySplit;
224
225
226 -- Trace Function
227 --
228 PROCEDURE Trace;
229
230 PROCEDURE ClearGlobals;
231
232 END py_za_tx_utl_01032004;
233