DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_PAYKRSPL_XMLP_PKG

Source


1 PACKAGE BODY PAY_PAYKRSPL_XMLP_PKG AS
2 /* $Header: PAYKRSPLB.pls 120.0 2007/12/13 12:21:42 amakrish noship $ */
3 
4 function BeforeReport return boolean is
5 begin
6   /*srw.user_exit('FND SRWINIT');*/null;
7 
8   frame_counter  := 0;
9   total          := 0;
10   assignment_id  := 0;
11   if p_sort_by = 'COST_CENTER' then
12     p_selection_value := 'Cost_Center';
13   elsif p_sort_by ='ESTABLISHMENT_ID' then
14     p_selection_value := 'Establishment_name';
15   elsif p_sort_by ='GRADE' then
16     p_selection_value := 'Grade_Name';
17   end if;
18   return (TRUE);
19 end;
20 
21 function AfterReport return boolean is
22 begin
23   /*srw.user_exit('FND SRWEXIT');*/null;
24 
25   return (TRUE);
26 end;
27 
28 function CF_business_groupFormula return VARCHAR2 is
29   v_business_group  hr_all_organization_units.name%type;
30 
31 begin
32   v_business_group := hr_reports.get_business_group(p_business_group_id);
33   return v_business_group;
34 end;
35 
36 function CF_legislation_codeFormula return VARCHAR2 is
37 
38   v_legislation_code    hr_organization_information.org_information9%type := null;
39 
40   cursor legislation_code
41     (c_business_group_id hr_organization_information.organization_id%type) is
42 
43   select org_information9
44   from   hr_organization_information
45   where  organization_id  = c_business_group_id
46   and    org_information9 is not null
47   and    org_information_context = 'Business Group Information';
48 begin
49   open legislation_code (p_business_group_id);
50   fetch legislation_code into v_legislation_code;
51   close legislation_code;
52 
53   return v_legislation_code;
54 end;
55 
56 function cf_currency_format_maskformula(cf_legislation_code in varchar2) return varchar2 is
57 
58   v_currency_code    fnd_currencies.currency_code%type;
59   v_format_mask      varchar2(100) := null;
60   v_field_length     number(3)    := 14;
61 
62   cursor currency_format_mask
63     (c_territory_code in fnd_currencies.issuing_territory_code%type) is
64   select currency_code,name
65   from   fnd_currencies_vl
66   where  issuing_territory_code = c_territory_code;
67 
68 begin
69   open currency_format_mask (cf_legislation_code);
70   fetch currency_format_mask into v_currency_code,cp_unit;
71   close currency_format_mask;
72 
73   v_format_mask := fnd_currency.get_format_mask(v_currency_code, v_field_length);
74   return v_format_mask;
78 BEGIN
75 end;
76 
77 PROCEDURE set_currency_format_mask IS
79 
80   /*SRW.SET_FORMAT_MASK(CF_currency_format_mask);*/null;
81 
82 
83 END;
84 
85 function P_BUSINESS_GROUP_IDValidTrigge return boolean is
86 begin
87   return (TRUE);
88 end;
89 
90 function CF_PERIOD_NAMEFormula return Char is
91 v_period_name varchar2(70);
92 begin
93    select period_name
94      into v_period_name
95     from per_time_periods
96    where time_period_id=p_selection_date;
97 return (v_period_name);
98 end;
99 
100 function BetweenPage return boolean is
101 begin
102   frame_counter:=0;
103   total:=0;
104   return (TRUE);
105 end;
106 
107 function cf_average_salaryformula(average_salary_me in number, average_salary_ybon in number, average_salary_alr in number) return number is
108 begin
109   return(average_salary_me + average_salary_ybon + average_salary_alr);
110 end;
111 
112 function CF_DATE_FORMAT_MASKFormula return Char is
113 begin
114   return('YYYY.MM.DD');
115 end;
116 
117 function cf_page_totalformula(cs_total in number) return number is
118 begin
119       return(cs_total - total);
120 end;
121 
122 function cf_separation_payformula(separation_pay in number, liability_rate in varchar2) return number is
123 begin
124     return(separation_pay * 100/liability_rate);
125 end;
126 
127 function cf_format_working_periodformul(working_period in varchar2, proportion in number, assignment_id_1 in number) return char is
128  l_working_period varchar2(10) := working_period;
129  l_cost           number := proportion ;
130  len              number :=0;
131  l_year           number :=0;
132  l_month          number :=0;
133  p_month          varchar2(100);
134  l_days           number :=0;
135  invalid_format exception;
136  begin
137    len := length(l_working_period);
138    if ( len = 4 and (working_period = to_char(to_date(working_period,'YYMM'),'YYMM')) ) then
139      l_year   :=  to_number(substr(l_working_period,1,2)) * 12;
140      l_month  :=  l_year + to_number(substr(l_working_period,3,2)) * 1;
141      l_month  :=  round(l_month * l_cost);
142      if l_month > 12 then
143        l_year  :=   floor(l_month/12);
144        l_month :=  mod(l_month,12);
145        p_month := lpad(to_char(l_year),2,0)||lpad(to_char(l_month),2,0);
146      else
147        p_month := '00'||lpad(to_char(l_month),2,0);
148      end if;
149    elsif ( len = 6 and (working_period = to_char(to_date(working_period,'YYMMDD'),'YYMMDD')) ) then
150      l_year   :=  to_number(substr(l_working_period,1,2)) * 365;
151      l_month  :=  l_year + (to_number(substr(l_working_period,3,2)) * 30);
152      l_days   :=  to_number(l_month) + to_number(substr(l_working_period,5,2));
153      l_days   :=  round(l_days * l_cost);
154        if (l_days < 365) then
155          p_month := '00';
156          l_month := round(l_days/365*12) ;
157          l_days  := mod(l_days,30);
158          p_month := p_month||(lpad(l_month,2,0))||(lpad(l_days,2,0));
159        else
160          l_year  := floor(l_days/365);
161          l_month := floor(mod((l_days/365),l_year) * 12);
162          l_days  := round(mod(mod((l_days/365),l_year) * 12,l_month) * 30);
163          p_month := (lpad(l_year,2,0))||(lpad(l_month,2,0))||(lpad(l_days,2,0));
164        end if;
165   else
166     return(null);
167   end if;
168   if proportion < 1 then
169     return(p_month||'('||working_period||')');
170   else
171   	return(p_month);
172   end if;
173 exception
174   when others then
175   if (assignment_id <> assignment_id_1) then
176     /*srw.message(99999,'Invalid Working Period  '||working_period||' for assignment id '||assignment_id_1);*/null;
177 
178     assignment_id := assignment_id_1;
179   end if;
180     return(null);
181 end;
182 
183 --Functions to refer Oracle report placeholders--
184 
185  Function CP_Unit_p return varchar2 is
186 	Begin
187 	 return CP_Unit;
188 	 END;
189 END PAY_PAYKRSPL_XMLP_PKG ;