DBA Data[Home] [Help]

PACKAGE: APPS.PY_ZA_TX_UTL_01032007

Source


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