1 PACKAGE BODY PAY_PAYHKSOE_XMLP_PKG AS
2 /* $Header: PAYHKSOEB.pls 120.0 2007/12/13 12:17:25 amakrish noship $ */
3
4 function BeforeReport return boolean is
5 begin
6
7 /*srw.user_exit('FND SRWINIT');*/null;
8 P_PAYMENTS_FROM_DATE_DISP := to_char(P_PAYMENTS_FROM_DATE,'DD-MON-YYYY');
9 P_PAYMENTS_TO_DATE_DISP:= to_char(P_PAYMENTS_TO_DATE,'DD-MON-YYYY');
10
11 construct_where_clause;
12 construct_order_by;
13
14
15 return (TRUE);
16 end;
17
18 PROCEDURE construct_order_by IS
19 begin
20 cp_order_by := null;
21
22
23 if P_SORT_ORDER_1 is not null then
24 cp_order_by := P_SORT_ORDER_1;
25 end if;
26
27 if p_sort_order_2 is not null then
28 if cp_order_by is not null then
29 cp_order_by := cp_order_by || ', ' || p_sort_order_2;
30 else
31 cp_order_by := p_sort_order_2;
32 end if;
33 end if;
34
35 if p_sort_order_3 is not null then
36 if cp_order_by is not null then
37 cp_order_by := cp_order_by || ', ' || p_sort_order_3;
38 else
39 cp_order_by := p_sort_order_3;
40 end if;
41 end if;
42
43 if p_sort_order_4 is not null then
44 if cp_order_by is not null then
45 cp_order_by := cp_order_by || ', ' || p_sort_order_4;
46 else
47 cp_order_by := p_sort_order_4;
48 end if;
49 end if;
50
51 if cp_order_by is not null then
52 cp_order_by := ' order by ' || cp_order_by || ', Assignment_ID';
53 else
54 cp_order_by := ' order by Assignment_ID';
55 end if;
56 end;
57
58 PROCEDURE construct_where_clause IS
59
60 begin
61
62 -- cp_where_clause := null;
63 cp_where_clause := ' ';
64
65 if p_Consolidation_Set is not null then
66 cp_where_clause := ' and Consolidation_Set_ID = ' || p_Consolidation_Set;
67 end if;
68
69 if p_Payroll is not null then
70 cp_where_clause := cp_where_clause || ' and Payroll_ID = ' || P_Payroll;
71 end if;
72
73 end;
74
75 function cf_get_balances_totalsformula(assignment_action_id4 in number, tax_unit_id1 in number) return number is
76 begin
77 pay_hk_soe_pkg.balance_totals(assignment_action_id4,
78 tax_unit_id1,
79 cp_Total_Earnings_This_Pay,
80 cp_Total_Earnings_YTD,
81 cp_Total_Deductions_This_pay,
82 cp_Total_Deductions_YTD,
83 cp_Net_Pay_This_pay,
84 cp_Net_Pay_YTD,
85 cp_Direct_Payments_This_Pay,
86 cp_Direct_Payments_YTD,
87 cp_Total_Payment_This_Pay,
88 cp_Total_Payment_YTD);
89
90 RETURN 0;
91 end;
92
93 function AfterReport return boolean is
94 begin
95
96 /*srw.user_exit('FND SRWEXIT');*/null;
97
98 return (TRUE);
99 end;
100
101 function CF_currency_format_maskFormula return VARCHAR2 is
102
103 v_currency_code fnd_currencies.currency_code%type;
104 v_format_mask varchar2(100) := null;
105 v_field_length number(3) := 15;
106
107 begin
108
109 v_currency_code := pay_hk_soe_pkg.business_currency_code(p_business_group_id);
110 v_format_mask := fnd_currency.get_format_mask(v_currency_code, v_field_length);
111
112 return v_format_mask;
113
114 end;
115
116 function CF_MPF_Flag1Formula return Number is
117 begin
118
119 Print_MPF_Flag := 0;
120
121 Return 0;
122
123 end;
124
125 function cf_mpf_flag2formula(CS_Count in number, element_name_sort1 in number) return number is
126 begin
127
128 If CP_Count is null then
129 CP_Count := 0;
130 End if;
131
132 If CS_Count = 0 then
133 Print_MPF_Flag := 0;
134 End if;
135
136 If CP_Count = 0 then
137 Print_MPF_Flag := 0;
138 End if;
139
140 CP_Count := CP_Count + 1;
141
142
143 If element_name_sort1 < 99 then
144 Print_MPF_Flag := 1;
145 If CP_Count = CS_Count then
146 CP_Count := 0;
147 End if;
148 Return 0;
149 End if;
150
151 If CP_Count = CS_Count then
152 CP_Count := 0;
153 End if;
154
155 Return 0;
156
157 end;
158
159 function cf_net_accrualformula(assignment_id3 in number, accrual_plan_id1 in number, payroll_id in number, business_group_id in number, end_date1 in date) return number is
160 begin
161
162 per_accrual_calc_functions.get_net_accrual(p_assignment_id => assignment_id3,
163 p_plan_id => accrual_plan_id1,
164 p_payroll_id => payroll_id,
165 p_business_group_id => business_group_id,
166 p_calculation_date => end_date1,
167 p_start_date => cp_start_date,
168 p_end_date => cp_end_date,
169 p_accrual_end_date => cp_accrual_end_date,
170 p_accrual => cp_accrual,
171 p_net_entitlement => cp_net_entitlement);
172 Return 0;
173
174 Exception
175 when no_data_found then return(null);
176 end;
177
178 --Functions to refer Oracle report placeholders--
179 Function PRINT_MPF_FLAG_p return number is
180 Begin
181 return PRINT_MPF_FLAG;
182 END;
183
184 Function CP_Total_Earnings_This_Pay_p return number is
185 Begin
186 return CP_Total_Earnings_This_Pay;
187 END;
188 Function CP_Total_Deductions_This_Pay_p return number is
189 Begin
190 return CP_Total_Deductions_This_Pay;
191 END;
192 Function CP_Net_Pay_This_Pay_p return number is
193 Begin
194 return CP_Net_Pay_This_Pay;
195 END;
196 Function CP_Direct_Payments_This_Pay_p return number is
197 Begin
198 return CP_Direct_Payments_This_Pay;
199 END;
200 Function CP_Total_Payment_This_Pay_p return number is
201 Begin
202 return CP_Total_Payment_This_Pay;
203 END;
204 Function CP_Total_Earnings_YTD_p return number is
205 Begin
206 return CP_Total_Earnings_YTD;
207 END;
208 Function CP_Total_Deductions_YTD_p return number is
209 Begin
210 return CP_Total_Deductions_YTD;
211 END;
212 Function CP_Net_Pay_YTD_p return number is
213 Begin
214 return CP_Net_Pay_YTD;
215 END;
216 Function CP_Direct_Payments_YTD_p return number is
217 Begin
218 return CP_Direct_Payments_YTD;
219 END;
220 Function CP_Total_Payment_YTD_p return number is
221 Begin
222 return CP_Total_Payment_YTD;
223 END;
224 Function CP_Count_p return number is
225 Begin
226 return CP_Count;
227 END;
228 Function CP_start_date_p return date is
229 Begin
230 return CP_start_date;
231 END;
232 Function CP_End_Date_p return date is
233 Begin
234 return CP_End_Date;
235 END;
236 Function CP_accrual_end_date_p return date is
237 Begin
238 return CP_accrual_end_date;
239 END;
240 Function CP_accrual_p return number is
241 Begin
242 return CP_accrual;
243 END;
244 Function CP_net_entitlement_p return number is
245 Begin
246 return CP_net_entitlement;
247 END;
248 Function cp_order_by_p return varchar2 is
249 Begin
250 return cp_order_by;
251 END;
252 Function CP_sort_by_p return varchar2 is
253 Begin
254 return CP_sort_by;
255 END;
256 Function CP_where_clause_p return varchar2 is
257 Begin
258 return CP_where_clause;
259 END;
260 END PAY_PAYHKSOE_XMLP_PKG ;