[Home] [Help]
PACKAGE BODY: APPS.PO_DOC_STYLE_GRP
Source
1 PACKAGE BODY PO_DOC_STYLE_GRP AS
2 /* $Header: PO_DOC_STYLE_GRP.plb 120.5 2006/03/01 01:02:09 scolvenk noship $ */
3
4 g_pkg_name CONSTANT VARCHAR2(30) := 'PO_DOC_STYLE_GRP';
5
6 --------------------------------------------------------------------------------
7 --Start of Comments
8 --Name: is_style_alias_conflict
9 --Pre-reqs:
10 -- None.
11 --Modifies:
12 -- None.
13 --Locks:
14 -- None.
15 --Function:
16 -- This procedure check if the display name has conflict with styles.
17 --Parameters:
18 --IN:
19 --p_name
20 -- One of the display names of the style.
21 -- The style id of the style which we want to exclude the this check.
22 --OUT:
23 -- Y if there is a conflict with the display name.
24 -- N if there is no conflict.
25 --End of Comments
26 -------------------------------------------------------------------------------
27
28 FUNCTION is_style_alias_conflict (
29 p_name IN VARCHAR2
30 , p_style_id IN NUMBER default NULL)
31 RETURN VARCHAR2
32 IS
33 l_api_name CONSTANT VARCHAR2(30) := 'is_style_alias_conflict';
34 l_progress VARCHAR2(3);
35 l_return_value VARCHAR2(1);
36 l_count NUMBER;
37 BEGIN
38
39 l_progress := '010';
40
41 l_return_value := 'N';
42
43 SELECT count(1)
44 INTO l_count
45 FROM dual
46 WHERE exists (
47 SELECT NULL
48 FROM po_doc_style_headers pdsh,
49 po_doc_style_lines_vl pdsl
50 WHERE pdsl.display_name = p_name
51 AND pdsh.style_id = pdsl.style_id
52 AND pdsh.status = 'ACTIVE'
53 AND pdsl.style_id <> nvl(p_style_id, -9999));
54
55 l_progress := '020';
56
57 IF l_count > 0 THEN
58 l_return_value := 'Y';
59 END IF;
60
61 l_progress := '030';
62
63
64 RETURN l_return_value;
65
66 EXCEPTION
67 WHEN OTHERS THEN
68 PO_MESSAGE_S.sql_error(g_pkg_name,l_api_name,l_progress,SQLCODE,SQLERRM);
69 RAISE;
70 END;
71
72 --------------------------------------------------------------------------------
73 --Start of Comments
74 --Name: is_style_name_conflict
75 --Pre-reqs:
76 -- None.
77 --Modifies:
78 -- None.
79 --Locks:
80 -- None.
81 --Function:
82 -- This procedure check if the style name has conflict with styles.
83 --Parameters:
84 --IN:
85 --p_name
86 -- One of the display names of the style.
87 -- The style id of the style which we want to exclude the this check.
88 --OUT:
89 -- Y if there is a conflict with the display name.
90 -- N if there is no conflict.
91 --End of Comments
92 -------------------------------------------------------------------------------
93
94 FUNCTION is_style_name_conflict (
95 p_name IN VARCHAR2
96 , p_style_id IN NUMBER default NULL)
97 RETURN VARCHAR2
98 IS
99 l_api_name CONSTANT VARCHAR2(30) := 'is_style_name_conflict';
100 l_progress VARCHAR2(3);
101 l_return_value VARCHAR2(1);
102 l_count NUMBER;
103 BEGIN
104
105 l_progress := '010';
106
107 l_return_value := 'N';
108
109 SELECT count(1)
110 INTO l_count
111 FROM dual
112 WHERE exists (
113 SELECT NULL
114 FROM po_doc_style_headers pdsh
115 WHERE pdsh.style_name = p_name
116 AND pdsh.style_id <> nvl(p_style_id, -9999));
117
118 l_progress := '020';
119
120 IF l_count > 0 THEN
121 l_return_value := 'Y';
122 END IF;
123
124 l_progress := '030';
125
126 RETURN l_return_value;
127
128 EXCEPTION
129 WHEN OTHERS THEN
130 PO_MESSAGE_S.sql_error(g_pkg_name,l_api_name,l_progress,SQLCODE,SQLERRM);
131 RAISE;
132 END;
133
134
135
136
137 --------------------------------------------------------------------------------
138 --Start of Comments
139 --Name: is_standard_doc_style
140 --Pre-reqs:
141 -- None.
142 --Modifies:
143 -- None.
144 --Locks:
145 -- None.
146 --Function:
147 -- This procedure check if the document styles with the supplied style id
148 -- is of STANDARD type.
149 --Parameters:
150 --IN:
151 --p_style_id
152 -- The style id.
153 --OUT:
154 -- Y if the style is of type STANDARD.
155 -- N if the style is not of type STANDARD.
156 --End of Comments
157 -------------------------------------------------------------------------------
158
159 FUNCTION is_standard_doc_style (p_style_id IN NUMBER)
160 RETURN VARCHAR2
161 IS
162 l_api_name CONSTANT VARCHAR2(30) := 'is_standard_doc_style';
163 l_progress VARCHAR2(3);
164 l_return_value VARCHAR2(1);
165 l_count NUMBER;
166 BEGIN
167
168 l_progress := '010';
169
170 l_return_value := 'N';
171
172 SELECT count(1)
173 INTO l_count
174 FROM dual
175 WHERE exists (
176 SELECT NULL
177 FROM po_doc_style_headers pdhs
178 WHERE style_type = 'STANDARD'
179 and style_id = p_style_id);
180
181 l_progress := '020';
182
183 IF l_count > 0 THEN
184 l_return_value := 'Y';
185 END IF;
186
187 l_progress := '030';
188
189 RETURN l_return_value;
190
191 EXCEPTION
192 WHEN OTHERS THEN
193 PO_MESSAGE_S.sql_error(g_pkg_name,l_api_name,l_progress,SQLCODE,SQLERRM);
194 RAISE;
195 END;
196
197
198 --------------------------------------------------------------------------------
199 --Start of Comments
200 --Name: get_standard_doc_style
201 --Pre-reqs:
202 -- None.
203 --Modifies:
204 -- None.
205 --Locks:
206 -- None.
207 --Function:
208 -- This procedure return the style if of the SYSTEM style.
209 --Parameters:
210 --IN:
211 --None.
212 --OUT:
213 -- The style id of the STANDARD style.
214 --End of Comments
215 -------------------------------------------------------------------------------
216 FUNCTION get_standard_doc_style
217 RETURN NUMBER
218 IS
219 l_api_name CONSTANT VARCHAR2(30) := 'get_standard_doc_style';
220 l_progress VARCHAR2(3);
221 l_style_id NUMBER;
222 BEGIN
223
224 l_progress := '010';
225
226 SELECT style_id
227 INTO l_style_id
228 FROM po_doc_style_headers pdhs
229 WHERE style_type = 'STANDARD';
230
231 l_progress := '020';
232
233 return l_style_id;
234
235 EXCEPTION
236 WHEN OTHERS THEN
237 PO_MESSAGE_S.sql_error(g_pkg_name,l_api_name,l_progress,SQLCODE,SQLERRM);
238 RAISE;
239 END;
240
241
242
243 --------------------------------------------------------------------------------
244 --Start of Comments
245 --Name: get_document_style_settings
246 --Pre-reqs:
247 -- None.
248 --Modifies:
249 -- None.
250 --Locks:
251 -- None.
252 --Function:
253 -- This procedure return the style settings.
254 --Parameters:
255 --IN:
256 --p_api_version:
257 -- Version number of API that caller expects. It should match the constant
258 -- 'l_api_version' defined in the procedure.
259 --p_style_id
260 -- style id
261 --None.
262 --OUT:
263 --x_style_name
264 -- style name
265 --x_style_description
266 -- style description
267 --x_style_type
268 -- style tyle
269 --x_status
270 -- style status
271 --x_advances_flag
272 -- advances flag
273 --x_retainage_flag
274 -- retainage flag
275 --x_price_breaks_flag
276 -- price breaks flag
277 --x_price_differentials_flag
278 -- price differentials flag
279 --x_progress_payment_flag
280 -- progress payment flag
281 --x_contract_financing_flag
282 -- contract financing flag
283 --x_line_type_allowed
284 -- line type allowed
285 --End of Comments
286 -------------------------------------------------------------------------------
287
288 PROCEDURE get_document_style_settings(
289 p_api_version IN NUMBER
290 , p_style_id IN NUMBER
291 , x_style_name OUT NOCOPY VARCHAR2
292 , x_style_description OUT NOCOPY VARCHAR2
293 , x_style_type OUT NOCOPY VARCHAR2
294 , x_status OUT NOCOPY VARCHAR2
295 , x_advances_flag OUT NOCOPY VARCHAR2
296 , x_retainage_flag OUT NOCOPY VARCHAR2
297 , x_price_breaks_flag OUT NOCOPY VARCHAR2
298 , x_price_differentials_flag OUT NOCOPY VARCHAR2
299 , x_progress_payment_flag OUT NOCOPY VARCHAR2
300 , x_contract_financing_flag OUT NOCOPY VARCHAR2
301 , x_line_type_allowed OUT NOCOPY VARCHAR2)
302 IS
303 l_api_version CONSTANT NUMBER := 1.0;
304 l_api_name CONSTANT VARCHAR2(30) := 'get_document_style_settings';
305 l_progress VARCHAR2(3);
306
307 BEGIN
308
309 l_progress := '010';
310
311 -- Standard call to check for call compatibility
312 IF NOT FND_API.compatible_api_call(l_api_version,
313 p_api_version,
314 l_api_name,
315 g_pkg_name) THEN
316 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
317 END IF;
318
319 l_progress := '020';
320
321 SELECT
322 pdsh.style_name
323 , pdsh.style_description
324 , pdsh.style_type
325 , pdsh.status
326 , pdsh.advances_flag
327 , pdsh.retainage_flag
328 , pdsh.price_breaks_flag
329 , pdsh.price_differentials_flag
330 , pdsh.progress_payment_flag
331 , pdsh.contract_financing_flag
332 , pdsh.line_type_allowed
333 INTO
334 x_style_name
335 , x_style_description
336 , x_style_type
337 , x_status
338 , x_advances_flag
339 , x_retainage_flag
340 , x_price_breaks_flag
341 , x_price_differentials_flag
342 , x_progress_payment_flag
343 , x_contract_financing_flag
344 , x_line_type_allowed
345 FROM po_doc_style_headers pdsh
346 WHERE pdsh.style_id = p_style_id;
347
348 l_progress := '030';
349
350 EXCEPTION
351 WHEN OTHERS THEN
352 PO_MESSAGE_S.sql_error(g_pkg_name,l_api_name,l_progress,SQLCODE,SQLERRM);
353 RAISE;
354 END;
355
356 -- GRP call for the PVT procedure
357
358 PROCEDURE style_validate_req_attrs(p_api_version IN NUMBER DEFAULT 1.0,
359 p_init_msg_list IN VARCHAR2 default FND_API.G_FALSE,
360 x_return_status OUT NOCOPY VARCHAR2,
361 x_msg_count OUT NOCOPY NUMBER,
362 x_msg_data OUT NOCOPY VARCHAR2,
363 p_doc_style_id IN NUMBER,
364 p_document_id IN NUMBER,
365 p_line_type_id IN VARCHAR2,
366 p_purchase_basis IN VARCHAR2,
367 p_destination_type IN VARCHAR2,
368 p_source IN VARCHAR2) IS
369
370 l_api_version CONSTANT NUMBER := 1.0;
371 l_api_name CONSTANT VARCHAR2(30) := 'style_validate_req_attrs';
372 l_progress VARCHAR2(3);
373
374 BEGIN
375
376 l_progress := '010';
377
378 -- Standard call to check for call compatibility
379 IF NOT FND_API.compatible_api_call(l_api_version,
380 p_api_version,
381 l_api_name,
382 g_pkg_name) THEN
383 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
384 END IF;
385
386 l_progress := '020';
387
388 PO_DOC_STYLE_PVT.STYLE_VALIDATE_REQ_ATTRS(p_api_version => p_api_version,
389 p_init_msg_list => p_init_msg_list,
390 x_return_status => x_return_status,
391 x_msg_count => x_msg_count,
392 x_msg_data => x_msg_data,
393 p_doc_style_id => p_doc_style_id,
394 p_document_id => p_document_id,
395 p_line_type_id => p_line_type_id,
396 p_purchase_basis => p_purchase_basis,
397 p_destination_type => p_destination_type,
398 p_source => p_source);
399
400
401 EXCEPTION
402 WHEN OTHERS THEN
403 PO_MESSAGE_S.sql_error(g_pkg_name,l_api_name,l_progress,SQLCODE,SQLERRM);
404 RAISE;
405 END;
406
407
408
409 END PO_DOC_STYLE_GRP;