1 PACKAGE py_za_tx_utl_01032005 AS
2 /* $Header: pyzatu06.pkh 120.0 2005/05/29 10:33:30 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_01032005.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 22/12/2004 115.0 Next Version of Main ZA Tax
110 Package.
111 For detail history see
112 py_za_tx_utl_01032004
113 */
114
115 -------------------------------------------------------------------------------
116 -- PACKAGE GLOBAL AREA --
117 -------------------------------------------------------------------------------
118 -- hr_utility wrapper globals
119 g_HrTraceEnabled BOOLEAN DEFAULT FALSE;
120 g_HrTracePipeName VARCHAR2(30);
121
122 -- Tax Specific Subtypes
123 SUBTYPE t_balance IS NUMBER(15,2);
124 -------------------------------------------------------------------------------
125 -- PACKAGE SPECIFICATION --
126 -------------------------------------------------------------------------------
127
128 -- StartHrTrace
129 -- Wrapper for hr_utility.trace_on
130 PROCEDURE StartHrTrace;
131
132 -- StartHrTrace
133 -- Function wrapper for hr_utility.trace_on
134 FUNCTION StartHrTrace(
135 p_HrTracePipeName VARCHAR2
136 ) RETURN VARCHAR2;
137
138 -- StopHrTrace
139 -- Wrapper for hr_utility.trace_off
140 PROCEDURE StopHrTrace;
141
142 -- StopHrTrace
143 -- Function wrapper for hr_utility.trace_off
144 FUNCTION StopHrTrace RETURN VARCHAR2;
145
146 -- WriteHrTrace
147 -- Wrapper for hr_utility.trace
148 PROCEDURE WriteHrTrace(
149 p_Buffer VARCHAR2
150 );
151
152
153
154 -- Tax Utility Functions
155 --
156
157 FUNCTION GlbVal
158 (p_GlbNme ff_globals_f.global_name%TYPE
159 ,p_EffDte DATE
160 ) RETURN ff_globals_f.global_value%TYPE;
161
162 FUNCTION NegPtd RETURN BOOLEAN;
163
164 FUNCTION LatePayPeriod RETURN BOOLEAN;
165
166 FUNCTION LstPeriod RETURN BOOLEAN;
167
168 FUNCTION EmpTermInPeriod RETURN BOOLEAN;
169
170 FUNCTION EmpTermPrePeriod RETURN BOOLEAN;
171
172 FUNCTION PreErnPeriod RETURN BOOLEAN;
173
174 FUNCTION SitePeriod RETURN BOOLEAN;
175
176 PROCEDURE PeriodFactor;
177
178
179 PROCEDURE PossiblePeriodsFactor;
180
181
182 FUNCTION Annualise
183 (p_YtdInc IN NUMBER
184 ,p_PtdInc IN NUMBER
185 ) RETURN NUMBER;
186
187 PROCEDURE SetRebates;
188
189 PROCEDURE Abatements;
190
191 PROCEDURE ArrearExcess;
192
193 FUNCTION TaxLiability
194 (p_Amt IN NUMBER
195 )RETURN NUMBER;
196
197
198 FUNCTION DeAnnualise
199 (p_Liab IN NUMBER
200 ,p_TxOnYtd IN NUMBER
201 ,p_TxOnPtd IN NUMBER
202 ) RETURN NUMBER;
203
204
205 PROCEDURE TrvAll;
206
207
208
209 PROCEDURE ValidateTaxOns(
210 p_Rf IN BOOLEAN DEFAULT FALSE -- Refund Allowed Regardless
211 );
212
213
214 -- DaysWorked
215 /* Returns the number of days that the person has worked
216 This could be a negative number that would indicate
217 a LatePayePeriod
218 */
219 FUNCTION DaysWorked RETURN NUMBER;
220
221
222 PROCEDURE SitPaySplit;
223
224
225 -- Trace Function
226 --
227 PROCEDURE Trace;
228
229 PROCEDURE ClearGlobals;
230
231 END py_za_tx_utl_01032005;
232