[Home] [Help]
PACKAGE BODY: APPS.JG_ZZ_OM_COMMON_PKG
Source
1 PACKAGE BODY JG_ZZ_OM_COMMON_PKG AS
2 /* $Header: jgzzomcb.pls 120.13 2005/10/06 01:15:16 appradha ship $ */
3
4 PG_DEBUG NUMBER ;
5
6 /*----------------------------------------------------------------------------*
7 | PUBLIC FUNCTIONS/PROCEDURES |
8 *----------------------------------------------------------------------------*/
9
10 /*----------------------------------------------------------------------------*
11 | PROCEDURE |
12 | copy_gdff |
13 | |
14 | DESCRIPTION |
15 | For each row created in the current submission of OM Invoicing process, |
16 | this procedure copies required global attribute columns to the interface|
17 | table. |
18 | |
19 | PARAMETERS |
20 | INPUT |
21 | p_interface_line_rec OE_Invoice_PUB.OE_GDF_Rec_Type |
22 | Interface line record declared in OEXPINVS.pls|
23 | OUTPUT |
24 | x_interface_line_rec OE_Invoice_PUB.OE_GDF_Rec_Type |
25 | Interface line record declared in OEXPINVS.pls|
26 | x_error_buffer VARCHAR2 -- Error Message |
27 | x_return_code NUMBER -- Error Code. |
28 | 0 - Success, 2 - Failure. |
29 | |
30 | HISTORY |
31 | |
32 | 24-JAN-2000 Harsh Takle Created. |
33 | 01-SEP-2000 Satyadeep Chandrashekar Added debug messages(bug 1395908) |
34 *----------------------------------------------------------------------------*/
35 PROCEDURE copy_gdff (
36 p_interface_line_rec IN OE_Invoice_PUB.OE_GDF_Rec_Type,
37 x_interface_line_rec IN OUT NOCOPY OE_Invoice_PUB.OE_GDF_Rec_Type,
38 x_return_code IN OUT NOCOPY NUMBER,
39 x_error_buffer IN OUT NOCOPY VARCHAR2) IS
40
41 --
42 l_country_code VARCHAR2(2);
43 BEGIN
44
45 x_error_buffer := NULL;
46 x_return_code := 0;
47 l_country_code := NULL;
48 x_interface_line_rec := p_interface_line_rec;
49
50 --Following line is commented as a part of bug 2133665
51 --l_country_code := fnd_profile.value('JGZZ_COUNTRY_CODE');
52 --
53 l_country_code := SUBSTR(p_interface_line_rec.line_gdf_attr_category,4,2);
54 --
55 OE_DEBUG_PUB.ADD('JG pkg Country Code is ' || l_country_code);
56
57 IF NVL(l_country_code,'$') IN ('BR','AR','CO') THEN
58
59 IF (PG_DEBUG > 0) THEN
60 OE_DEBUG_PUB.ADD('JG pkg calling JL Pkg ');
61 END IF;
62 JL_ZZ_RECEIV_INTERFACE.copy_gdff (p_interface_line_rec,
63 x_interface_line_rec,
64 x_return_code,
65 x_error_buffer);
66
67 END IF;
68
69 EXCEPTION
70 WHEN OTHERS THEN
71 IF (PG_DEBUG > 0) THEN
72 OE_DEBUG_PUB.ADD('JG-Exception when others');
73 END IF;
74 x_error_buffer := SQLERRM;
75 x_return_code := 2;
76
77 END copy_gdff;
78
79 /*----------------------------------------------------------------------------*
80 | PROCEDURE |
81 | default_gdff |
82 | |
83 | DESCRIPTION |
84 | When the item is entered on Sales Order Line, if inventory item id is |
85 | not null then this procedure will default global descriptive flexfield |
86 | values if they are null |
87 | |
88 | PARAMETERS |
89 | INPUT |
90 | p_line_rec oe_order_pub.line_rec_type Interface line |
91 | record declared in OEXPORDS.pls |
92 | OUTPUT |
93 | x_line_rec oe_order_pub.line_rec_type Interface line |
94 | record declared in OEXPORDS.pls |
95 | x_error_buffer VARCHAR2 -- Error Message |
96 | x_return_code NUMBER -- Error Code. |
97 | 0 - Success, 2 - Failure. |
98 | |
99 | HISTORY |
100 | |
101 | 24-JAN-2000 Harsh Takle Created. |
102 *----------------------------------------------------------------------------*/
103 PROCEDURE default_gdff
104 (p_line_rec IN oe_order_pub.line_rec_type,
105 x_line_rec OUT NOCOPY oe_order_pub.line_rec_type,
106 x_return_code IN OUT NOCOPY NUMBER,
107 x_error_buffer IN OUT NOCOPY VARCHAR2
108 ) IS
109 --
110 l_country_code VARCHAR2(2);
111 l_org_id NUMBER;
112 BEGIN
113 l_org_id := MO_GLOBAL.get_current_org_id;
114
115 x_error_buffer := NULL;
116 x_return_code := 0;
117 l_country_code := NULL;
118 x_line_rec := p_line_rec;
119
120 --Bug 2354736
121 --l_country_code := FND_PROFILE.VALUE('JGZZ_COUNTRY_CODE');
122 l_country_code := JG_ZZ_SHARED_PKG.GET_COUNTRY(l_org_id, null);
123
124 IF NVL(l_country_code,'$') IN ('BR','AR','CO') THEN
125 JL_ZZ_RECEIV_INTERFACE.default_gdff (p_line_rec,
126 x_line_rec,
127 x_return_code,
128 x_error_buffer,
129 l_org_id); --Bug fix 2354736);
130
131 END IF;
132
133 EXCEPTION
134 WHEN OTHERS THEN
135 x_error_buffer := SQLERRM;
136 x_return_code := 2;
137
138 END default_gdff;
139
140 /*----------------------------------------------------------------------------*
141 | PROCEDURE |
142 | copy_gdf |
143 | |
144 | DESCRIPTION |
145 | For each row created in the current submission of OM Invoicing process, |
146 | this procedure copies required global attribute columns to the interface|
147 | table. |
148 | |
149 | PARAMETERS |
150 | OUTPUT |
151 | x_interface_line_rec OE_Invoice_PUB.OE_GDF_Rec_Type |
152 | Interface line record declared in OEXPINVS.pls|
153 | x_error_buffer VARCHAR2 -- Error Message |
154 | x_return_code NUMBER -- Error Code. |
155 | 0 - Success, 2 - Failure. |
156 | |
157 | HISTORY |
158 | |
159 | 01-AUG-2001 Sudhir Sekuri Created. |
160 *----------------------------------------------------------------------------*/
161 PROCEDURE copy_gdf ( x_interface_line_rec IN OUT NOCOPY OE_Invoice_PUB.OE_GDF_Rec_Type,
162 x_return_code IN OUT NOCOPY NUMBER,
163 x_error_buffer IN OUT NOCOPY VARCHAR2) IS
164
165 l_country_code VARCHAR2(2);
166 BEGIN
167
168 x_error_buffer := NULL;
169 x_return_code := 0;
170 l_country_code := NULL;
171
172 --Following line is commented as a part of bug 2133665
173 --l_country_code := fnd_profile.value('JGZZ_COUNTRY_CODE');
174 --
175 l_country_code := SUBSTR(x_interface_line_rec.line_gdf_attr_category,4,2);
176 --
177 IF (PG_DEBUG > 0) THEN
178 OE_DEBUG_PUB.ADD('JG pkg Country Code is ' || l_country_code);
179 END IF;
180
181 IF NVL(l_country_code,'$') IN ('BR','AR','CO') THEN
182
183 IF (PG_DEBUG > 0) THEN
184 OE_DEBUG_PUB.ADD('JG pkg calling JL Pkg ');
185 END IF;
186 JL_ZZ_RECEIV_INTERFACE.copy_gdf (x_interface_line_rec,
187 x_return_code,
188 x_error_buffer);
189
190 END IF;
191
192 EXCEPTION
193 WHEN OTHERS THEN
194 IF (PG_DEBUG > 0) THEN
195 OE_DEBUG_PUB.ADD('JG-Exception when others');
196 END IF;
197 x_error_buffer := SQLERRM;
198 x_return_code := 2;
199
200 END copy_gdf;
201
202 /*----------------------------------------------------------------------------*
203 | PROCEDURE |
204 | default_gdf |
205 | |
206 | DESCRIPTION |
207 | When the item is entered on Sales Order Line, if inventory item id is |
208 | not null then this procedure will default global descriptive flexfield |
209 | values if they are null |
210 | |
211 | PARAMETERS |
212 | OUTPUT |
213 | x_line_rec oe_order_pub.line_rec_type Interface line |
214 | record declared in OEXPORDS.pls |
215 | x_error_buffer VARCHAR2 -- Error Message |
216 | x_return_code NUMBER -- Error Code. |
217 | 0 - Success, 2 - Failure. |
218 | |
219 | HISTORY |
220 | |
221 | 06-AUG-2001 Sudhir Sekuri Created. |
222 *----------------------------------------------------------------------------*/
223 PROCEDURE default_gdf
224 (x_line_rec IN OUT NOCOPY oe_order_pub.line_rec_type,
225 x_return_code IN OUT NOCOPY NUMBER,
226 x_error_buffer IN OUT NOCOPY VARCHAR2
227 ) IS
228
229 l_country_code VARCHAR2(2);
230 l_org_id NUMBER;
231 BEGIN
232 l_org_id := MO_GLOBAL.get_current_org_id;
233
234 x_error_buffer := NULL;
235 x_return_code := 0;
236 l_country_code := NULL;
237
238 --Bug 2354736
239 --l_country_code := FND_PROFILE.VALUE('JGZZ_COUNTRY_CODE');
240 l_country_code := JG_ZZ_SHARED_PKG.GET_COUNTRY(l_org_id, null);
241
242 IF NVL(l_country_code,'$') IN ('BR','AR','CO') THEN
243 JL_ZZ_RECEIV_INTERFACE.default_gdf (x_line_rec,
244 x_return_code,
245 x_error_buffer,
246 l_org_id); --Bug fix 2354736
247
248 END IF;
249
250 EXCEPTION
251 WHEN OTHERS THEN
252 x_error_buffer := SQLERRM;
253 x_return_code := 2;
254
255 END default_gdf;
256
257 BEGIN
258
259 PG_DEBUG := to_number(NVL(FND_PROFILE.value('ONT_DEBUG_LEVEL'), '0'));
260
261 END JG_ZZ_OM_COMMON_PKG;