1 PACKAGE BODY PO_POXPOPAR_XMLP_PKG AS
2 /* $Header: POXPOPARB.pls 120.2 2007/12/25 11:18:20 krreddy noship $ */
3 USER_EXIT_FAILURE EXCEPTION;
4 function company(c_company_name_s in varchar2) return character is
5 begin
6 return('glcc.'||c_company_name_s);
7 end;
8 function cost_center(c_cost_center_s in varchar2) return character is
9 begin
10 return('glcc.'||c_cost_center_s);
11 end;
12 procedure get_precision is
13 begin
14 /*srw.attr.mask := SRW.FORMATMASK_ATTR;*/null;
15 if P_qty_precision = 0 then /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0';*/null;
16 else
17 if P_qty_precision = 1 then /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0.0';*/null;
18 else
19 if P_qty_precision = 3 then /*srw.attr.formatmask := '-NN,NNN,NNN,NN0.000';*/null;
20 else
21 if P_qty_precision = 4 then /*srw.attr.formatmask := '-N,NNN,NNN,NN0.0000';*/null;
22 else
23 if P_qty_precision = 5 then /*srw.attr.formatmask := '-NNN,NNN,NN0.00000';*/null;
24 else
25 if P_qty_precision = 6 then /*srw.attr.formatmask := '-NN,NNN,NN0.000000';*/null;
26 else /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0.00';*/null;
27 end if; end if; end if; end if; end if; end if;
28 /*srw.set_attr(0,srw.attr);*/null;
29 end;
30 function orderby_clauseFormula return VARCHAR2 is
31 begin
32 if P_ORDERBY = 'COMPANY'
33 then return('2');
34 elsif P_ORDERBY = 'COST CENTER'
35 then return('3');
36 end if;
37 RETURN NULL; end;
38 function BeforeReport return boolean is
39 begin
40 DECLARE
41 l_sort po_lookup_codes.displayed_field%type;
42 BEGIN
43 FORMAT_MASK:=po_common_XMLp_pkg.GET_PRECISION(P_qty_precision);
44 get_boiler_plates;
45 /*SRW.USER_EXIT('FND SRWINIT');*/null;
46 IF P_ORDERBY IS NOT NULL THEN
47 SELECT displayed_field
48 INTO l_sort
49 FROM po_lookup_codes
50 WHERE lookup_code = P_ORDERBY
51 AND lookup_type = 'SRS ORDER BY';
52 P_ORDERBY_DISPLAYED := l_sort;
53 ELSE
54 P_ORDERBY_DISPLAYED := '';
55 END IF;
56 null;
57 RETURN(TRUE);
58 END ;
59 return (TRUE);
60 end ;
61 function AfterReport return boolean is
62 begin
63 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
64 return (TRUE);
65 end;
66 procedure get_lookup_meaning(p_lookup_type in varchar2,
67 p_lookup_code in varchar2,
68 p_lookup_meaning in out nocopy varchar2)
69 is
70 w_meaning varchar2(80);
71 begin
72 select meaning
73 into w_meaning
74 from fnd_lookups
75 where lookup_type = p_lookup_type
76 and lookup_code = p_lookup_code ;
77 p_lookup_meaning := w_meaning ;
78 exception
79 when no_data_found then
80 p_lookup_meaning := null ;
81 end ;
82 procedure get_boiler_plates is
83 w_industry_code varchar2(20);
84 w_industry_stat varchar2(20);
85 begin
86 if fnd_installation.get(0, 0,
87 w_industry_stat,
88 w_industry_code) then
89 if w_industry_code = 'C' then
90 c_company_title := null ;
91 else
92 get_lookup_meaning('IND_COMPANY',
93 w_industry_code,
94 c_company_title);
95 end if;
96 end if;
97 c_industry_code := w_Industry_code ;
98 end ;
99 function set_display_for_gov return boolean is
100 begin
101 if c_industry_code = 'C' then
102 return(FALSE);
103 else
104 if c_company_title is not null then
105 return(TRUE);
106 else
107 return(FALSE);
108 end if;
109 end if;
110 RETURN NULL; end ;
111 function set_display_for_core return boolean is
112 begin
113 if c_industry_code = 'C' then
114 return(TRUE);
115 else
116 if c_company_title is not null then
117 return(FALSE);
118 else
119 return(TRUE);
120 end if;
121 end if;
122 RETURN NULL; end;
123 function round_amount_list_subtotal_rep(c_amount_open_inv_sum in number, c_currency_precision in number) return number is
124 begin
125 /*srw.reference(c_amount_open_inv_sum);*/null;
126 /*srw.reference(c_currency_precision);*/null;
127 return(round(c_amount_open_inv_sum, c_currency_precision));
128 end;
129 function AfterPForm return boolean is
130 lex_cost_center varchar2(30);
131 lex_company_name varchar2(30);
132 begin
133 /*SRW.USER_EXIT('FND SRWINIT');*/null;
134 SELECT fsa1.application_column_name , fsa2.application_column_name into
135 lex_cost_center,lex_company_name
136 FROM gl_sets_of_books gsb
137 , financials_system_parameters fsp
138 , fnd_segment_attribute_values fsa1
139 , fnd_segment_attribute_values fsa2
140 WHERE gsb.set_of_books_id = fsp.set_of_books_id
141 AND fsa1.id_flex_code = 'GL#'
142 AND fsa1.id_flex_num = gsb.chart_of_accounts_id
143 AND fsa1.segment_attribute_type = 'FA_COST_CTR'
144 AND fsa1.attribute_value = 'Y'
145 AND fsa2.id_flex_code = 'GL#'
146 AND fsa2.id_flex_num = gsb.chart_of_accounts_id
147 AND fsa2.segment_attribute_type = 'GL_BALANCING'
148 AND fsa2.attribute_value = 'Y' ;
149 if p_company_from is not null and p_company_to is not null then
150 if p_company_from = p_company_to then
151 where_clause := 'glcc.'||lex_company_name||'= :p_company_from ' ;
152 else
153 where_clause := 'glcc.'||lex_company_name||' >= :p_company_from and ';
154 where_clause := where_clause||'glcc.'||lex_company_name||' <= :p_company_to ';
155 end if;
156 elsif p_company_from is not null and p_company_to is null then
157 where_clause := 'glcc.'||lex_company_name||' >= :p_company_from ';
158 elsif p_company_from is null and p_company_to is not null then
159 where_clause := 'glcc.'||lex_company_name||' <= :p_company_to ' ;
160 elsif p_company_from is null and p_company_to is null then
161 where_clause := '1 = 1 ' ;
162 end if;
163 if p_costcenter_from is not null and p_costcenter_to is not null then
164 if p_costcenter_from = p_costcenter_to then
165 where_clause := where_clause||' and glcc.'||lex_cost_center||'= :p_costcenter_from ';
166 else
167 where_clause := where_clause||'and glcc.'||lex_cost_center||' >= :p_costcenter_from and ';
168 where_clause := where_clause||'glcc.'||lex_cost_center||' <= :p_costcenter_to ';
169 end if;
170 elsif p_costcenter_from is not null and p_costcenter_to is null then
171 where_clause := where_clause||'and glcc.'||lex_cost_center||' >= :p_costcenter_from ';
172 elsif p_costcenter_from is null and p_costcenter_to is not null then
173 where_clause := where_clause||'and glcc.'||lex_cost_center||'<= :p_costcenter_to ';
174 elsif p_costcenter_from is null and p_costcenter_to is null then
175 where_clause := where_clause||'and 1 = 1' ;
176 end if;
177 if WHERE_CLAUSE is null then WHERE_CLAUSE:='and 1=1'; end if;
178 return (TRUE);
179 end;
180 --Functions to refer Oracle report placeholders--
181 Function C_industry_code_p return varchar2 is
182 Begin
183 return C_industry_code;
184 END;
185 Function C_company_title_p return varchar2 is
186 Begin
187 return C_company_title;
188 END;
189 END PO_POXPOPAR_XMLP_PKG ;
190