[Home] [Help]
PACKAGE BODY: APPS.PAY_AU_REC_PKG
Source
1 package body pay_au_rec_pkg as
2 /* $Header: pyaurec.pkb 115.7 2002/12/04 08:48:58 ragovind ship $ */
3
4 ------------------------------------------------------------------------
5 -- Sums the Balances for This Pay ,according to the parameters.
6 ------------------------------------------------------------------------
7 procedure run_balances
8 (p_assignment_id in per_all_assignments_f.assignment_id%type,
9 p_assignment_action_id in pay_assignment_actions.assignment_action_id%type,
10 p_effective_date in date,
11 p_balance_name in pay_balance_types.balance_name%type,
12 p_run_balance out NOCOPY number)
13 is
14
15 cursor run_value
16 (c_assignment_id pay_assignment_actions.assignment_id%type,
17 c_assignment_action_id pay_assignment_actions.assignment_action_id%type,
18 c_effective_date date,
19 c_balance_name pay_balance_types.balance_name%type) is
20 select nvl(hr_aubal.calc_asg_run(c_assignment_action_id,
21 balance_type_id,
22 c_effective_date,
23 c_assignment_id),0)
24 from pay_balance_types
25 where balance_name = c_balance_name
26 and legislation_code = 'AU';
27
28 begin
29 open run_value (p_assignment_id,
30 p_assignment_action_id,
31 p_effective_date,
32 p_balance_name);
33 fetch run_value into p_run_balance;
34 close run_value;
35
36 end run_balances;
37 ------------------------------------------------------------------------
38 -- Procedure to merely pass all the balance results back in one hit,
39 -- rather than 5 separate calls.
40 ------------------------------------------------------------------------
41 procedure balance_totals
42 (p_assignment_id in per_all_assignments_f.assignment_id%type,
43 p_assignment_action_id in pay_assignment_actions.assignment_action_id%type,
44 p_effective_date in date,
45 p_gross_this_pay out NOCOPY number,
46 p_other_deductions_this_pay out NOCOPY number,
47 p_tax_deductions_this_pay out NOCOPY number,
48 p_direct_payments_this_pay out NOCOPY number,
49 p_pre_tax_deductions_this_pay out NOCOPY number)
50 is
51 v_earnings_run number;
52 v_direct_payments_run number;
53 v_involuntary_deductions_run number;
54 v_pre_tax_deductions_run number;
55 v_voluntary_deductions_run number;
56 v_tax_deductions_run number;
57 v_termination_payments_run number;
58 v_termination_deductions_run number;
59 v_non_tax_allow_run number;
60
61 begin
62
63 run_balances (p_assignment_id => p_assignment_id,
64 p_assignment_action_id => p_assignment_action_id,
65 p_effective_date => p_effective_date,
66 p_balance_name => 'Earnings_Total',
67 p_run_balance => v_earnings_run);
68
69 run_balances (p_assignment_id => p_assignment_id,
70 p_assignment_action_id => p_assignment_action_id,
71 p_effective_date => p_effective_date,
72 p_balance_name => 'Direct Payments',
73 p_run_balance => v_direct_payments_run);
74
75 run_balances (p_assignment_id => p_assignment_id,
76 p_assignment_action_id => p_assignment_action_id,
77 p_effective_date => p_effective_date,
78 p_balance_name => 'Termination_Payments',
79 p_run_balance => v_termination_payments_run);
80
81 run_balances (p_assignment_id => p_assignment_id,
82 p_assignment_action_id => p_assignment_action_id,
83 p_effective_date => p_effective_date,
84 p_balance_name => 'Involuntary Deductions',
85 p_run_balance => v_involuntary_deductions_run);
86
87 run_balances (p_assignment_id => p_assignment_id,
88 p_assignment_action_id => p_assignment_action_id,
89 p_effective_date => p_effective_date,
90 p_balance_name => 'Pre Tax Deductions',
91 p_run_balance => v_pre_tax_deductions_run);
92
93 run_balances (p_assignment_id => p_assignment_id,
94 p_assignment_action_id => p_assignment_action_id,
95 p_effective_date => p_effective_date,
96 p_balance_name => 'Termination Deductions',
97 p_run_balance => v_termination_deductions_run);
98
99 run_balances (p_assignment_id => p_assignment_id,
100 p_assignment_action_id => p_assignment_action_id,
101 p_effective_date => p_effective_date,
102 p_balance_name => 'Voluntary Deductions',
103 p_run_balance => v_voluntary_deductions_run);
104
105 run_balances (p_assignment_id => p_assignment_id,
106 p_assignment_action_id => p_assignment_action_id,
107 p_effective_date => p_effective_date,
108 p_balance_name => 'Total_Tax_Deductions',
109 p_run_balance => v_tax_deductions_run);
110
111 run_balances (p_assignment_id => p_assignment_id,
112 p_assignment_action_id => p_assignment_action_id,
113 p_effective_date => p_effective_date,
114 p_balance_name => 'Earnings_Non_Taxable',
115 p_run_balance => v_non_tax_allow_run);
116
117 p_gross_this_pay := v_earnings_run +
118 v_termination_payments_run -
119 v_non_tax_allow_run;
120
121 p_other_deductions_this_pay := v_involuntary_deductions_run +
122 v_pre_tax_deductions_run +
123 v_voluntary_deductions_run;
124
125 p_tax_deductions_this_pay := v_tax_deductions_run +
126 v_termination_deductions_run;
127
128 p_direct_payments_this_pay := v_direct_payments_run +
129 v_non_tax_allow_run;
130
131 p_pre_tax_deductions_this_pay := v_pre_tax_deductions_run;
132
133
134 end balance_totals;
135
136
137 ------------------------------------------------------------------------
138 end pay_au_rec_pkg;