[Home] [Help]
PACKAGE BODY: APPS.PO_POXRQDDR_XMLP_PKG
Source
1 PACKAGE BODY PO_POXRQDDR_XMLP_PKG AS
2 /* $Header: POXRQDDRB.pls 120.1 2007/12/25 11:48:42 krreddy noship $ */
3
4 USER_EXIT_FAILURE EXCEPTION;
5
6 function BeforeReport return boolean is
7 begin
8
9 DECLARE
10 l_yes_no fnd_lookups.meaning%type;
11 BEGIN
12
13 /*SRW.USER_EXIT('FND SRWINIT');*/null;
14 QTY_PRECISION:=PO_common_xmlp_pkg.GET_PRECISION(P_QTY_PRECISION);
15
16 IF (get_p_chart_of_accounts_id <> TRUE) THEN
17 /*SRW.MESSAGE('1','P_CHART_OF_ACCOUNTS_ID INIT failed.');*/null;
18
19 END IF;
20
21 IF P_FAILED_FUNDS is NULL THEN
22 P_FAILED_FUNDS := 'N';
23 END IF;
24
25 SELECT meaning
26 INTO l_yes_no
27 FROM fnd_lookups
28 WHERE lookup_type = 'YES_NO'
29 AND lookup_code = P_FAILED_FUNDS;
30
31 P_FAILED_FUNDS_DISP := l_yes_no;
32
33
34 null;
35
36
37 null;
38 P_failed_funds_lp := P_FAILED_FUNDS ;
39 RETURN TRUE;
40 END; return (TRUE);
41 end;
42
43 function AfterReport return boolean is
44 begin
45
46
47 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
48 return (TRUE);
49 end;
50
51 procedure get_precision is
52 begin
53 /*srw.attr.mask := SRW.FORMATMASK_ATTR;*/null;
54
55 if P_qty_precision = 0 then /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0';*/null;
56
57 else
58 if P_qty_precision = 1 then /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0.0';*/null;
59
60 else
61 if P_qty_precision = 3 then /*srw.attr.formatmask := '-NN,NNN,NNN,NN0.000';*/null;
62
63 else
64 if P_qty_precision = 4 then /*srw.attr.formatmask := '-N,NNN,NNN,NN0.0000';*/null;
65
66 else
67 if P_qty_precision = 5 then /*srw.attr.formatmask := '-NNN,NNN,NN0.00000';*/null;
68
69 else
70 if P_qty_precision = 6 then /*srw.attr.formatmask := '-NN,NNN,NN0.000000';*/null;
71
72 else /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0.00';*/null;
73
74 end if; end if; end if; end if; end if; end if;
75 /*srw.set_attr(0,srw.attr);*/null;
76
77 end;
78
79 function select_failed_f return character is
80 begin
81 if P_failed_funds = 'Y' then
82 return(',prl.requisition_header_id, gl1.description Description1'); else
83 return(',prl.requisition_header_id,''''');
84 end if;
85 RETURN NULL; end;
86
87 function from_failed_f return character is
88 begin
89 if P_failed_funds = 'Y' then
90 return(',gl_code_combinations gcc, gl_lookups gl1');
91 else
92 return(',gl_code_combinations gcc');
93 end if;
94 RETURN NULL; end;
95
96 function where_failed_f return character is
97 begin
98 if P_failed_funds = 'Y' then
99 return('and gcc.code_combination_id = prd.code_combination_id and prd.failed_funds_lookup_code = gl1.lookup_code and prd.failed_funds_lookup_code like ''F%'' and prd.encumbered_flag <>''Y'' and gl1.lookup_type=''FUNDS_CHECK_RESULT_CODE''');
100 else
101 return('and gcc.code_combination_id = prd.code_combination_id');
102 end if;
103 RETURN NULL; end;
104
105 function get_p_chart_of_accounts_id return boolean is
106
107 l_p_chart_of_accounts_id number;
108
109 begin
110 select gsb.chart_of_accounts_id
111 into l_p_chart_of_accounts_id
112 from gl_sets_of_books gsb,
113 financials_system_parameters fsp
114 where gsb.set_of_books_id = fsp.set_of_books_id;
115
116 P_chart_of_accounts_id := l_p_chart_of_accounts_id;
117
118 return(true);
119
120 RETURN NULL; exception
121 when others then return(false);
122 end;
123
124 function C_WHERE_REQ_NUMFormula return Char is
125 numbering_type varchar2(40);
126 begin
127
128 select psp.manual_req_num_type
129 into numbering_type
130 from po_system_parameters psp;
131
132 if (numbering_type = 'NUMERIC') then
133 RETURN (' AND decode(rtrim(prh.segment1,''0123456789''),NULL,to_number(prh.segment1),-1)
134 BETWEEN decode(rtrim(nvl('||''''||p_req_num_from||''''||',prh.segment1),''0123456789''),NULL,to_number(nvl('||''''||p_req_num_from||''''||',prh.segment1)),-1)
135 AND decode(rtrim(nvl('||''''||p_req_num_to||''''||',prh.segment1),''0123456789''),NULL,to_number(nvl('||''''||p_req_num_to||''''||',prh.segment1)),-1)' );
136 else
137 return(' AND prh.segment1 BETWEEN
138 nvl('||''''||P_req_num_from||''''||',prh.segment1)
139 AND
140 nvl('||''''||P_req_num_to||''''||',prh.segment1)');
141 end if;
142 RETURN NULL;
143 end;
144
145 --Functions to refer Oracle report placeholders--
146
147 END PO_POXRQDDR_XMLP_PKG ;
148