DBA Data[Home] [Help]

PACKAGE: APPS.PY_ZA_TX

Source


1 PACKAGE py_za_tx AUTHID CURRENT_USER AS
2 /* $Header: pyzatax.pkh 120.2 2005/06/28 00:11:47 kapalani noship $ */
3 
4 /* Function to calculate tax on a given amount, with no rebate taken into account*/
5   PRAGMA RESTRICT_REFERENCES(py_za_tx, WNDS);
6 
7   FUNCTION calc_tax_on_table(
8     payroll_action_id NUMBER, --context
9     p_taxable_amount NUMBER,
10     p_tax_rebate  NUMBER
11   ) RETURN NUMBER;
12 
13 
14 
15 /* Function to calculate arrear pension fund abatement on a monthly basis
16    as well as the arrear excess figure that should be taken over
17    to the next year
18 */
19   FUNCTION arr_pen_mon_check(
20     p_tax_status  IN VARCHAR2,
21     p_start_site IN VARCHAR2,
22     p_site_factor IN NUMBER,
23     p_pen_ind IN VARCHAR2,
24     p_apf_ptd_bal IN NUMBER,
25     p_apf_ytd_bal IN NUMBER,
26     p_apf_exces_bal IN NUMBER,
27     p_periods_left IN NUMBER,
28     p_period_factor IN NUMBER,
29     p_possible_periods_left IN NUMBER,
30     p_max_abate IN NUMBER,
31     p_exces_itd_upd OUT NOCOPY NUMBER
32     ) RETURN NUMBER;
33 
34 /* Function to calculate arrear retirement annuity abatement on a monthly basis
35    as well as the arrear excess figure that should be taken over
36    to the next year
37 */
38   FUNCTION arr_ra_mon_check(
39     p_tax_status  In VARCHAR2,
40     p_start_site  VARCHAR2,
41     p_site_factor  NUMBER,
42     p_ra_ind  VARCHAR2,
43     p_ara_ptd_bal  NUMBER,
44     p_ara_ytd_bal  NUMBER,
45     p_ara_exces_bal  NUMBER,
46     p_periods_left  NUMBER,
47     p_period_factor  NUMBER,
48     p_possible_periods_left  NUMBER,
49     p_max_abate  NUMBER,
50     p_exces_itd_upd OUT NOCOPY NUMBER
51     ) RETURN NUMBER;
52 
53 /* Function: za_site_paye_split to calculate the split between site and paye */
54   FUNCTION site_paye_split(
55     p_total_tax  IN NUMBER,
56     p_tax_on_travel  IN NUMBER,
57     p_tax_on_pub_off  IN NUMBER,
58     p_site_lim  IN NUMBER,
59     p_qual  IN VARCHAR2
60     ) RETURN NUMBER;
61 
62 /* Function: calc_tax_on_perc to calculate tax on a percentage according to tax status */
63   FUNCTION calc_tax_on_perc(
64     p_amount  IN NUMBER,
65     p_tax_status  IN VARCHAR2,
66     p_tax_directive_value  IN NUMBER,
67     p_cc_tax_perc  IN NUMBER,
68     p_temp_tax_perc  IN NUMBER
69     )  RETURN NUMBER;
70 
71 /* Function: tax_period_factor calculates the period factor for the person,
72    i.e. did the person work a full period or a half or even one and a half.
73 */
74   FUNCTION tax_period_factor(
75     p_tax_year_start_date  IN DATE,
76     p_asg_start_date  IN DATE,
77     p_cur_period_start_date  IN DATE,
78     p_cur_period_end_date  IN DATE,
79     p_total_inc_ytd  IN NUMBER,
80     p_total_inc_ptd  IN NUMBER
81     )  RETURN NUMBER;
82 
83 /* Function: pp_factor calculates the possible days the person could work in the year as a factor*/
84   FUNCTION tax_pp_factor(
85     p_tax_year_start_date  IN DATE,
86     p_tax_year_end_date  IN DATE,
87     p_asg_start_date  IN DATE,
88     p_days_in_year  IN NUMBER
89     )  RETURN NUMBER;
90 
91 
92 /* Function: annualise is used to annualise an amount */
93   FUNCTION annualise(
94     p_ytd_income  IN NUMBER,
95     p_ptd_income  IN NUMBER,
96     p_period_left  IN NUMBER,
97     p_pp_factor  IN NUMBER,
98     p_period_factor  IN NUMBER
99     ) RETURN NUMBER;
100 
101 
102 /* Function to determine if employee has been terminated */
103   FUNCTION za_emp_terminated(
104     p_ee_date_to IN DATE,
105     p_cps_date IN DATE,
106     p_cpe_date IN DATE
107     ) RETURN VARCHAR2;
108 
109 
110 /* Function to determine if pay period is a site period or not */
111   FUNCTION za_site_period(
112     p_pay_periods_left IN NUMBER,
113     p_asg_date_to IN DATE,
114     p_current_period_start_date IN DATE,
115     p_current_period_end_date IN DATE
116     ) RETURN VARCHAR2;
117 
118 
119 /* Function to determine number of days worked in a year, including weekends and holidays*/
120   FUNCTION za_days_worked(
121     p_asg_date_from IN DATE,
122     p_asg_date_to IN DATE,
123     p_za_tax_year_from IN DATE,
124     p_za_tax_year_to IN DATE
125     ) RETURN NUMBER;
126 
127 
128 /* Function ytd_days_worked calculates the number of days worked up to the present date */
129   FUNCTION ytd_days_worked(
130     p_tax_year_start  IN DATE,
131     p_asg_date_from  IN DATE,
132     p_cur_period_start  IN DATE
133     ) RETURN NUMBER;
134 
135 
136 /* Function cal_days_worked calculates the number of days worked from 01 JAN to tax year start*/
137   FUNCTION cal_days_worked(
138     p_tax_year_start  IN DATE,
139     p_asg_date_from  IN DATE
140     ) RETURN NUMBER;
141 
142 /* Function get_ytd_bal_val calculates the ytd balance total
143    for balance TRAVELLING_ALLOWANCE_ASG_TAX_YTD.
144    This balance is calculated dynamicly since
145    the global value it must be multiplied with
146    may change during the year and there is no taxable
147    balance that is kept. */
148 
149   FUNCTION get_ytd_car_allow_val (
150     assignment_id  NUMBER,
151     p_tax_year_start_date DATE,
152     p_tax_year_end_date DATE,
153     p_current_period_end_date DATE,
154     p_global_value  VARCHAR2
155     ) RETURN NUMBER;
156 
157 /* Fucntion get_cal_car_allow_val calculates the taxbale value of
158    balance TRAVELLING_ALLOWANCE for the asg_cal_ytd dimention with
159    the applicable global value at the effective time. */
160 
161   FUNCTION get_cal_car_allow_val (
162   assignment_id  NUMBER,
163   p_tax_year_start_date DATE
164   ) RETURN NUMBER;
165 
166 
167 
168 END py_za_tx;