1 PACKAGE BODY AR_ARXPOMR_XMLP_PKG AS
2 /* $Header: ARXPOMRB.pls 120.0 2007/12/27 14:02:03 abraghun noship $ */
3
4 FUNCTION ar_meaning (po_name in varchar2,
5 po_value in varchar2)
6 RETURN varchar2 IS
7 l_meaning varchar2(80);
8 BEGIN
9
10 If po_name = 'AR_CROSS_CURRENCY_RATE_TYPE' then
11 begin
12 SELECT user_conversion_type
13 INTO l_meaning
14 FROM GL_DAILY_CONVERSION_TYPES
15 WHERE conversion_type = po_value;
16 exception when others then
17 null;
18 end;
19 elsif po_name = 'AR_SHOW_BILLING_NUMBER' then
20 begin
21 SELECT meaning
22 INTO l_meaning
23 FROM ar_lookups
24 WHERE lookup_type = 'YES/NO'
25 and lookup_code = po_value;
26 exception when others then
27 null;
28 end;
29 elsif po_name = 'AR_DOC_SEQ_GEN_LEVEL' then
30 begin
31 select MEANING
32 into l_meaning
33 from AR_LOOKUPS
34 where lookup_type='DOC_SEQ_GEN_LEVEL'
35 and lookup_code = po_value;
36 exception when others then
37 null;
38 end;
39 elsif po_name = 'AR_PA_CODE' then
40
41 begin
42 SELECT meaning
43 INTO l_meaning
44 FROM ar_lookups
45 WHERE lookup_type = 'PA_CODE'
46 and to_number(decode(lookup_code,'UNDEFINED','-1',lookup_code))
47 = DECODE(po_value,'UNDEFINED',-1,po_value);
48 exception when others then
49 null;
50 end;
51 null;
52 elsif po_name = 'AR_ZENGIN_CHAR_SET' then
53 begin
54 select MEANING
55 into l_meaning
56 from AR_LOOKUPS
57 where lookup_type = 'AR_ZENGIN_CHAR_SET'
58 and lookup_code = po_value;
59 exception when others then
60 null;
61 end;
62
63 end if;
64 return l_meaning;
65
66 END;
67
68 function cf_1formula(po_name in varchar2, resposibility in varchar2) return varchar2 is
69 begin
70
71 return ar_meaning(po_name,resposibility);
72
73 end;
74
75 FUNCTION p_org_po_id RETURN number IS
76
77 l_po_id number :=0;
78 begin
79 begin
80 SELECT fpo.profile_option_id
81 INTO l_po_id
82 FROM fnd_profile_options fpo,
83 fnd_profile_options_tl fpo_tl
84 WHERE
85 fpo.profile_option_name = 'ORG_ID'
86 AND fpo.profile_option_name = fpo_tl.profile_option_name
87 AND fpo_tl.language = USERENV('LANG');
88 exception
89 when others then
90 null;
91
92 end;
93 return l_po_id;
94
95 END;
96
97 function BeforeReport return boolean is
98
99 begin
100
101 /*srw.user_exit('FND SRWINIT');*/null;
102
103
104 begin
105 SELECT fpo.profile_option_id
106 INTO l_po_id
107 FROM fnd_profile_options fpo,
108 fnd_profile_options_tl fpo_tl
109 WHERE
110 fpo.profile_option_name = 'ORG_ID'
111 AND fpo.profile_option_name = fpo_tl.profile_option_name
112 AND fpo_tl.language = USERENV('LANG');
113 exception
114 when others then
115 null;
116
117 end;
118 L_PO_ID_V:=L_PO_ID;
119 return (TRUE);
120 end;
121
122 function cf_appformula(po_name in varchar2, application in varchar2) return varchar2 is
123 begin
124 return ar_meaning(po_name,application);
125 end;
126
127 function cf_siteformula(po_name in varchar2, site in varchar2) return varchar2 is
128 begin
129 return ar_meaning(po_name,site);
130 end;
131
132 function cf_userformula(po_name in varchar2, us in varchar2) return varchar2 is
133 begin
134 return ar_meaning(po_name,us);
135 end;
136
137 FUNCTION ar_profile_user_name (po_name in varchar2)
138
139 RETURN varchar2 IS
140 l_po_user_name varchar2(80);
141 BEGIN
142
143 begin
144
145 SELECT fpo_tl.user_profile_option_name
146 INTO l_po_user_name
147 FROM fnd_profile_options fpo,
148 fnd_profile_options_tl fpo_tl
149 WHERE
150 fpo.profile_option_name =po_name
151 AND fpo.profile_option_name = fpo_tl.profile_option_name
152 AND fpo_tl.language = USERENV('LANG')
153 ORDER BY fpo.profile_option_name;
154 exception
155 when others then
156 null;
157 end;
158 return l_po_user_name;
159
160 END;
161
162 function AfterReport return boolean is
163 begin
164 /*srw.user_exit('FND SRWEXIT');*/null;
165
166 return (TRUE);
167 end;
168 /*ADDED AS FIX*/
169 function CF_po_user_nameFormula(po_int_name in varchar2) return varchar2 is
170 begin
171 return ar_profile_user_name(po_int_name);
172 end;
173 /* FIX ENDS*/
174 --Functions to refer Oracle report placeholders--
175
176 END AR_ARXPOMR_XMLP_PKG ;
177