DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_POXPOSTD_XMLP_PKG

Source


1 PACKAGE BODY PO_POXPOSTD_XMLP_PKG AS
2 /* $Header: POXPOSTDB.pls 120.1 2007/12/25 11:22:10 krreddy noship $ */
3 
4 USER_EXIT_FAILURE EXCEPTION;
5 
6 function BeforeReport return boolean is
7 begin
8 
9 
10 
11 BEGIN
12 
13   IF (GET_P_STRUCT_NUM <> TRUE)
14    THEN /*SRW.MESSAGE('1','P_STRUCT_NUM_INIT FAILED');*/null;
15 
16   END IF;
17   FORMAT_MASK := PO_COMMON_xmlp_pkg.GET_PRECISION(P_QTY_PRECISION);
18 END;
19 
20 BEGIN
21 
22  null;
23 
24 
25  null;
26 
27 
28  null;
29 
30 
31  null;
32 
33   RETURN TRUE;
34 END;  return (TRUE);
35 end;
36 
37 procedure get_precision is
38 begin
39 /*srw.attr.mask        :=  SRW.FORMATMASK_ATTR;*/null;
40 
41 if P_qty_precision = 0 then /*srw.attr.formatmask  := '-NNN,NNN,NNN,NN0';*/null;
42 
43 else
44 if P_qty_precision = 1 then /*srw.attr.formatmask  := '-NNN,NNN,NNN,NN0.0';*/null;
45 
46 else
47 if P_qty_precision = 3 then /*srw.attr.formatmask  :=  '-NN,NNN,NNN,NN0.000';*/null;
48 
49 else
50 if P_qty_precision = 4 then /*srw.attr.formatmask  :=   '-N,NNN,NNN,NN0.0000';*/null;
51 
52 else
53 if P_qty_precision = 5 then /*srw.attr.formatmask  :=     '-NNN,NNN,NN0.00000';*/null;
54 
55 else
56 if P_qty_precision = 6 then /*srw.attr.formatmask  :=      '-NN,NNN,NN0.000000';*/null;
57 
58 else /*srw.attr.formatmask  :=  '-NNN,NNN,NNN,NN0.00';*/null;
59 
60 end if; end if; end if; end if; end if; end if;
61 /*srw.set_attr(0,srw.attr);*/null;
62 
63 end;
64 
65 FUNCTION GET_P_STRUCT_NUM RETURN BOOLEAN IS
66 
67 L_P_STRUCT_NUM  NUMBER;
68 
69 BEGIN
70 SELECT STRUCTURE_ID INTO L_P_STRUCT_NUM
71 FROM MTL_DEFAULT_SETS_VIEW
72 WHERE FUNCTIONAL_AREA_ID = 2;
73 
74 P_STRUCT_NUM := L_P_STRUCT_NUM;
75 
76 RETURN(TRUE);
77 
78 RETURN NULL; EXCEPTION
79 WHEN OTHERS THEN
80   RETURN(FALSE);
81 END;
82 
83 function AfterReport return boolean is
84 begin
85 
86 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
87 
88 RETURN(TRUE);  return (TRUE);
89 end;
90 
91 function c_amount_agr_round(C_AMOUNT_AGR in number, C_FND_PRECISION in number) return number is
92 BEGIN
93 
94 	/*SRW.REFERENCE(C_AMOUNT_AGR);*/null;
95 
96 	/*SRW.REFERENCE(C_FND_PRECISION);*/null;
97 
98 	RETURN(ROUND(C_AMOUNT_AGR, C_FND_PRECISION));
99 
100 END;
101 
102 function AfterPForm return boolean is
103 begin
104 
105   /*srw.user_exit('FND SRWINIT');*/null;
106 
107    begin
108        SELECT  psp.manual_po_num_type        manual_po_num_type
109        into    P_po_num_type
110        FROM    po_system_parameters psp;
111 
112    exception
113         when no_data_found then
114              P_po_num_type := 'ALPHANUMERIC';
115    end;
116 
117   If P_po_num_from = P_po_num_to THEN
118 	P_single_po_print := 1;
119   END IF;
120 
121 
122   if (P_single_po_print = 1) then
123     where_performance := ' AND   :P_single_po_print = 1 AND poh.segment1 = :P_po_num_from ';
124   else
125     if (P_PO_num_type = 'NUMERIC') then
126         where_performance := ' AND :P_SINGLE_PO_PRINT <> 1
127                                 AND :P_PO_NUM_TYPE = ''NUMERIC''
128                                 AND  decode(rtrim(poh.segment1,''0123456789''),NULL,to_number(poh.segment1),-1) BETWEEN
129                                 decode(rtrim(nvl(:P_po_num_from,0),''0123456789''),NULL,to_number(nvl(:P_po_num_from,0)),-9)  AND
130                                 decode(rtrim(nvl(:P_po_num_to,999999999999999999999),''0123456789''),NULL,to_number(nvl(:P_po_num_to,999999999999999999999)),-9)
131                               ';
132        elsif (P_PO_num_type = 'ALPHANUMERIC') and
133              (P_po_num_from is not null)    and
134              (P_po_num_to   is not null)    then
135         where_performance :=   ' AND   :P_single_po_print <> 1
136                                   AND   :P_Po_num_type = ''ALPHANUMERIC''
137                                   AND   :P_po_num_from IS NOT NULL AND :P_po_num_to IS NOT NULL
138                                   AND   poh.segment1 >= :P_po_num_from AND poh.segment1 <= :P_po_num_to ';
139        elsif (P_PO_num_type = 'ALPHANUMERIC') and
140              (P_po_num_from is not null)    and
141              (P_po_num_to   is  null)      then
142         where_performance :=   ' AND   :P_single_po_print <> 1
143                                   AND   :p_Po_num_type = ''ALPHANUMERIC''
144                                   AND   :P_po_num_from IS NOT NULL AND :P_po_num_to IS NULL
145                                   AND   poh.segment1 >= :P_po_num_from ';
146        elsif (P_PO_num_type = 'ALPHANUMERIC') and
147              (P_po_num_from is  null)       and
148              (P_po_num_to   is  not null)  then
149         where_performance :=  ' AND   :P_single_po_print <> 1
150                                  AND   :p_Po_num_type = ''ALPHANUMERIC''
151                                  AND   :P_po_num_from IS NULL AND :P_po_num_to IS NOT NULL
152                                  AND    poh.segment1 <= :P_po_num_to ' ;
153        elsif (P_PO_num_type = 'ALPHANUMERIC') and
154              (P_po_num_from is  null)       and
155              (P_po_num_to   is  null)      then
156         where_performance := ' AND   :P_single_po_print <> 1
157                                 AND   :p_Po_num_type = ''ALPHANUMERIC''
158                                 AND   :P_po_num_from IS NULL AND :P_po_num_to IS NULL ';
159         end if;
160     end if;
161 
162   return (TRUE);
163 end;
164 
165 --Functions to refer Oracle report placeholders--
166 
167 END PO_POXPOSTD_XMLP_PKG ;
168