DBA Data[Home] [Help]

PACKAGE BODY: APPS.QP_DEFAULT_PLL_PRICING_ATTR

Source


4 --  Global constant holding the package name
1 PACKAGE BODY QP_Default_pll_pricing_attr AS
2 /* $Header: QPXDPLAB.pls 120.2 2005/07/07 04:03:57 appldev ship $ */
3 
5 
6 G_PKG_NAME                    CONSTANT VARCHAR2(30) := 'Qp_Default_pll_pricing_attr';
7 
8 --  Package global used within the package.
9 
10 g_PRICING_ATTR_rec            QP_Price_List_PUB.Pricing_Attr_Rec_Type;
11 
12 --  Get functions.
13 
14 FUNCTION Get_Accumulate
15 RETURN VARCHAR2
16 IS
17 BEGIN
18 
19     RETURN 'N';
20 
21 END Get_Accumulate;
22 
23 FUNCTION Get_Attribute_Grouping_No
24 RETURN NUMBER
25 IS
26 l_attribute_grouping_no number;
27 BEGIN
28 
29    select attribute_grouping_no
30    into l_attribute_grouping_no
31    from qp_pricing_attributes
32    where list_line_id = g_Pricing_Attr_rec.list_line_id
33    and rownum < 2;
34 
35    return l_attribute_grouping_no;
36 
37 EXCEPTION
38 
39    WHEN NO_DATA_FOUND THEN
40 
41      select qp_pricing_attr_group_no_s.nextval
42      into l_attribute_grouping_no
43      from dual;
44 
45      return l_attribute_grouping_no;
46 
47   WHEN OTHERS THEN RETURN NULL;
48 
49 
50 END Get_Attribute_Grouping_No;
51 
52 FUNCTION Get_Excluder
53 RETURN VARCHAR2
54 IS
55 BEGIN
56 
57     RETURN 'N';
58 
59 END Get_Excluder;
60 
61 FUNCTION Get_List_Line
62 RETURN NUMBER
63 IS
64 BEGIN
65 
66     RETURN NULL;
67 
68 END Get_List_Line;
69 
70 FUNCTION Get_Qualification_Ind
71 RETURN NUMBER
72 IS
73 BEGIN
74     RETURN NULL;
75 END Get_Qualification_Ind;
76 
77 FUNCTION Get_List_Header(a_list_line_id   IN   NUMBER)
78 RETURN NUMBER
79 IS
80 l_list_header_id  NUMBER;
81 
82 BEGIN
83 
84     SELECT list_header_id
85     INTO   l_list_header_id
86     FROM   qp_list_lines
87     WHERE  list_line_id = a_list_line_id;
88 
89     RETURN l_list_header_id;
90 
91 EXCEPTION
92     WHEN OTHERS THEN
93          RETURN NULL;
94 END Get_List_Header;
95 
96 FUNCTION Get_Pricing_Phase
97 RETURN NUMBER
98 IS
99 BEGIN
100 
101     RETURN 1;
102 
103 END Get_Pricing_Phase;
104 
105 FUNCTION Get_Pricing_Attribute_Id
106 RETURN VARCHAR2
107 IS
108 l_pricing_attribute_id number;
109 BEGIN
110 
111    select qp_pricing_attributes_s.nextval
115    RETURN l_pricing_attribute_id;
112    into l_pricing_attribute_id
113    from dual;
114 
116 
117 EXCEPTION
118 
119   WHEN OTHERS THEN RETURN NULL;
120 
121 END Get_Pricing_Attribute_Id;
122 
123 FUNCTION Get_Pricing_Attribute_Context
124 RETURN VARCHAR2
125 IS
126 BEGIN
127 
128     RETURN NULL;
129 
130 END Get_Pricing_Attribute_Context;
131 
132 FUNCTION Get_Pricing_Attribute
133 RETURN NUMBER
134 IS
135 BEGIN
136 
137     RETURN NULL;
138 
139 END Get_Pricing_Attribute;
140 
141 FUNCTION Get_Pricing_Attribute_Datatype( pric_attribute_context  IN VARCHAR2,
142                                          pric_attribute  IN VARCHAR2,
143                                          pric_attr_value   IN VARCHAR2)
144 RETURN VARCHAR2
145 IS
146 
147 l_context_flag                VARCHAR2(1);
148 l_attribute_flag              VARCHAR2(1);
149 l_value_flag                  VARCHAR2(1);
150 l_datatype                    VARCHAR2(1);
151 l_precedence                  NUMBER;
152 l_error_code                  NUMBER := 0;
153 
154 BEGIN
155 
156     QP_UTIL.validate_qp_flexfield(flexfield_name         =>'QP_ATTR_DEFNS_PRICING'
157 			 ,context                        =>pric_attribute_context
158 			 ,attribute                      =>pric_attribute
159 			 ,value                          =>pric_attr_value
160                 ,application_short_name         => 'QP'
161 			 ,context_flag                   =>l_context_flag
162 			 ,attribute_flag                 =>l_attribute_flag
163 			 ,value_flag                     =>l_value_flag
164 			 ,datatype                       =>l_datatype
165 			 ,precedence                      =>l_precedence
166 			 ,error_code                     =>l_error_code
167 			 );
168 
169 oe_debug_pub.add('error code = '|| to_char(l_error_code));
170        IF l_error_code = 0
171 	  THEN
172 
173          RETURN l_datatype;
174 
175        ELSE
176 
177          RETURN NULL;
178 
179       END IF;
180 
181 END Get_Pricing_Attribute_Datatype;
182 
183 FUNCTION Get_Product_Attribute_Datatype( prod_attribute_context  IN VARCHAR2,
184                                          prod_attribute  IN VARCHAR2,
185                                          prod_attr_value   IN VARCHAR2)
186 RETURN VARCHAR2
187 IS
188 
189 l_context_flag                VARCHAR2(1);
190 l_attribute_flag              VARCHAR2(1);
191 l_value_flag                  VARCHAR2(1);
192 l_datatype                    VARCHAR2(1);
193 l_precedence                  NUMBER;
194 l_error_code                  NUMBER := 0;
195 
196 BEGIN
197 
198     QP_UTIL.validate_qp_flexfield(flexfield_name         =>'QP_ATTR_DEFNS_PRICING'
199 			 ,context                        =>prod_attribute_context
200 			 ,attribute                      =>prod_attribute
201 			 ,value                          =>prod_attr_value
202                 ,application_short_name         => 'QP'
203 			 ,context_flag                   =>l_context_flag
204 			 ,attribute_flag                 =>l_attribute_flag
205 			 ,value_flag                     =>l_value_flag
206 			 ,datatype                       =>l_datatype
207 			 ,precedence                      =>l_precedence
208 			 ,error_code                     =>l_error_code
209 			 );
210 
211 oe_debug_pub.add('error code = '|| to_char(l_error_code));
212 
213        IF l_error_code = 0
214 	  THEN
215 
216          RETURN l_datatype;
217 
218        ELSE
219 
220          RETURN NULL;
221 
222       END IF;
223 
224 END Get_Product_Attribute_Datatype;
225 
226 FUNCTION Get_Pricing_Attr_Value_From
227 RETURN VARCHAR2
228 IS
229 BEGIN
230 
231     RETURN NULL;
232 
233 END Get_Pricing_Attr_Value_From;
234 
235 FUNCTION Get_Pricing_Attr_Value_To
236 RETURN VARCHAR2
237 IS
238 BEGIN
239 
240     RETURN NULL;
241 
242 END Get_Pricing_Attr_Value_To;
243 
244 FUNCTION Get_Comparison_Operator_Code
245 RETURN VARCHAR2
246 IS
247 BEGIN
248 
249   RETURN 'BETWEEN';
250 
251 END Get_Comparison_Operator_Code;
252 
253 FUNCTION Get_From_Rltd_Modifier_Id
254 RETURN NUMBER
255 IS
256 BEGIN
257 
258    RETURN NULL;
259 
260 END;
261 
262 FUNCTION Get_Product_Attribute
263 RETURN VARCHAR2
264 IS
265 l_prod_attr VARCHAR2(30) := NULL;
266 BEGIN
267 
268    IF ( g_Pricing_Attr_rec.from_rltd_modifier_id is not null
269 	  and g_Pricing_Attr_rec.from_rltd_modifier_id <> FND_API.G_MISS_NUM) THEN
270 
271     select product_attribute
272     into l_prod_attr
273     from qp_pricing_attributes
274     where list_line_id = g_Pricing_Attr_rec.from_rltd_modifier_id
275     and excluder_flag = 'N'
276     and rownum < 2;
277 
278     oe_debug_pub.add('prod attr  3 : ' || l_prod_attr );
279 
280    ELSIF ( g_Pricing_Attr_rec.list_line_id is not null
281 	  and g_Pricing_Attr_rec.list_line_id <> FND_API.G_MISS_NUM) THEN
282 
283     select product_attribute
284     into l_prod_attr
285     from qp_pricing_attributes
286     where list_line_id = g_Pricing_Attr_rec.list_line_id
287     and excluder_flag = 'N'
288     and rownum < 2;
289 
290    END IF;
291 
292     return l_prod_attr;
293 
294 EXCEPTION
295 
299 
296     WHEN OTHERS THEN RETURN NULL;
297 
298 END Get_Product_Attribute;
300 FUNCTION Get_Product_Attribute_Context
301 RETURN VARCHAR2
302 IS
303 l_prod_attr_cont VARCHAR2(30) := NULL;
304 BEGIN
305 
306    oe_debug_pub.add('parent line id 1 :' || g_PRICING_ATTR_REC.FROM_RLTD_MODIFIER_ID );
307 
308    IF ( g_Pricing_Attr_rec.from_rltd_modifier_id is not null
309 	  and g_Pricing_Attr_rec.from_rltd_modifier_id <> FND_API.G_MISS_NUM) THEN
310 
311     select product_attribute_context
312     into l_prod_attr_cont
313     from qp_pricing_attributes
314     where list_line_id = g_Pricing_Attr_rec.from_rltd_modifier_id
315     and excluder_flag = 'N'
316     and rownum < 2;
317 
318     oe_debug_pub.add('prod attr cont 1 : ' || l_prod_attr_cont );
319 
320    ELSIF ( g_Pricing_Attr_rec.list_line_id is not null
321 	  and g_Pricing_Attr_rec.list_line_id <> FND_API.G_MISS_NUM) THEN
322 
323     select product_attribute_context
324     into l_prod_attr_cont
325     from qp_pricing_attributes
326     where list_line_id = g_Pricing_Attr_rec.list_line_id
327     and excluder_flag = 'N'
328     and rownum < 2;
329 
330    END IF;
331 
332     return l_prod_attr_cont;
333 
334 EXCEPTION
335 
336     WHEN OTHERS THEN RETURN NULL;
337 
338 END Get_Product_Attribute_Context;
339 
340 FUNCTION Get_Product_Attr_Value
341 RETURN VARCHAR2
342 IS
343 l_prod_attr_value VARCHAR2(240) := NULL;
344 BEGIN
345 
346    IF ( g_Pricing_Attr_rec.from_rltd_modifier_id is not null
347 	  and g_Pricing_Attr_rec.from_rltd_modifier_id <> FND_API.G_MISS_NUM) THEN
348 
349     select product_attr_value
350     into l_prod_attr_value
351     from qp_pricing_attributes
352     where list_line_id = g_Pricing_Attr_rec.from_rltd_modifier_id
353     and excluder_flag = 'N'
354     and rownum < 2;
355 
356     oe_debug_pub.add('prod attr value 2 : ' || l_prod_attr_value );
357 
358    ELSIF ( g_Pricing_Attr_rec.list_line_id is not null
359 	  and g_Pricing_Attr_rec.list_line_id <> FND_API.G_MISS_NUM) THEN
360 
361     select product_attr_value
362     into l_prod_attr_value
363     from qp_pricing_attributes
364     where list_line_id = g_Pricing_Attr_rec.list_line_id
365     and excluder_flag = 'N'
366     and rownum < 2;
367 
368    END IF;
369 
370    return l_prod_attr_value;
371 
372 EXCEPTION
373 
374     WHEN OTHERS THEN RETURN NULL;
375 
376 END Get_Product_Attr_Value;
377 
378 FUNCTION Get_Product_Uom
379 RETURN VARCHAR2
380 IS
381 l_prod_uom VARCHAR2(3) := NULL;
382 BEGIN
383 
384    IF ( g_Pricing_Attr_rec.from_rltd_modifier_id is not null
385 	  and g_Pricing_Attr_rec.from_rltd_modifier_id <> FND_API.G_MISS_NUM) THEN
386 
387     select product_uom_code
388     into l_prod_uom
389     from qp_pricing_attributes
390     where list_line_id = g_Pricing_Attr_rec.from_rltd_modifier_id
391     and excluder_flag = 'N'
392     and rownum < 2;
393 
394     oe_debug_pub.add('uom 4: ' || l_prod_uom );
395 
396    ELSIF ( g_Pricing_Attr_rec.list_line_id is not null
397 	  and g_Pricing_Attr_rec.list_line_id <> FND_API.G_MISS_NUM) THEN
398 
399     select product_uom_code
400     into l_prod_uom
401     from qp_pricing_attributes
402     where list_line_id = g_Pricing_Attr_rec.list_line_id
403     and excluder_flag = 'N'
404     and rownum < 2;
405 
406    END IF;
407 
408    return l_prod_uom;
409 
410 EXCEPTION
411 
412     WHEN OTHERS THEN RETURN NULL;
413 
414 END Get_Product_Uom;
415 
416 PROCEDURE Get_Flex_Pricing_Attr
417 IS
418 BEGIN
419 
420     --  In the future call Flex APIs for defaults
421 
422     IF g_PRICING_ATTR_rec.attribute1 = FND_API.G_MISS_CHAR THEN
423         g_PRICING_ATTR_rec.attribute1  := NULL;
424     END IF;
425 
426     IF g_PRICING_ATTR_rec.attribute10 = FND_API.G_MISS_CHAR THEN
427         g_PRICING_ATTR_rec.attribute10 := NULL;
428     END IF;
429 
430     IF g_PRICING_ATTR_rec.attribute11 = FND_API.G_MISS_CHAR THEN
431         g_PRICING_ATTR_rec.attribute11 := NULL;
432     END IF;
433 
434     IF g_PRICING_ATTR_rec.attribute12 = FND_API.G_MISS_CHAR THEN
435         g_PRICING_ATTR_rec.attribute12 := NULL;
436     END IF;
437 
438     IF g_PRICING_ATTR_rec.attribute13 = FND_API.G_MISS_CHAR THEN
439         g_PRICING_ATTR_rec.attribute13 := NULL;
440     END IF;
441 
442     IF g_PRICING_ATTR_rec.attribute14 = FND_API.G_MISS_CHAR THEN
443         g_PRICING_ATTR_rec.attribute14 := NULL;
444     END IF;
445 
446     IF g_PRICING_ATTR_rec.attribute15 = FND_API.G_MISS_CHAR THEN
447         g_PRICING_ATTR_rec.attribute15 := NULL;
448     END IF;
449 
450     IF g_PRICING_ATTR_rec.attribute2 = FND_API.G_MISS_CHAR THEN
451         g_PRICING_ATTR_rec.attribute2  := NULL;
452     END IF;
453 
454     IF g_PRICING_ATTR_rec.attribute3 = FND_API.G_MISS_CHAR THEN
455         g_PRICING_ATTR_rec.attribute3  := NULL;
456     END IF;
457 
458     IF g_PRICING_ATTR_rec.attribute4 = FND_API.G_MISS_CHAR THEN
459         g_PRICING_ATTR_rec.attribute4  := NULL;
460     END IF;
461 
462     IF g_PRICING_ATTR_rec.attribute5 = FND_API.G_MISS_CHAR THEN
466     IF g_PRICING_ATTR_rec.attribute6 = FND_API.G_MISS_CHAR THEN
463         g_PRICING_ATTR_rec.attribute5  := NULL;
464     END IF;
465 
467         g_PRICING_ATTR_rec.attribute6  := NULL;
468     END IF;
469 
470     IF g_PRICING_ATTR_rec.attribute7 = FND_API.G_MISS_CHAR THEN
471         g_PRICING_ATTR_rec.attribute7  := NULL;
472     END IF;
473 
474     IF g_PRICING_ATTR_rec.attribute8 = FND_API.G_MISS_CHAR THEN
475         g_PRICING_ATTR_rec.attribute8  := NULL;
476     END IF;
477 
478     IF g_PRICING_ATTR_rec.attribute9 = FND_API.G_MISS_CHAR THEN
479         g_PRICING_ATTR_rec.attribute9  := NULL;
480     END IF;
481 
482     IF g_PRICING_ATTR_rec.context = FND_API.G_MISS_CHAR THEN
483         g_PRICING_ATTR_rec.context     := NULL;
484     END IF;
485 
486 END Get_Flex_Pricing_Attr;
487 
488 --  Procedure Attributes
489 
490 PROCEDURE Attributes
491 (   p_PRICING_ATTR_rec              IN  QP_Price_List_PUB.Pricing_Attr_Rec_Type :=
492                                         QP_Price_List_PUB.G_MISS_PRICING_ATTR_REC
493 ,   p_iteration                     IN  NUMBER := 1
494 ,   x_PRICING_ATTR_rec              OUT NOCOPY /* file.sql.39 change */ QP_Price_List_PUB.Pricing_Attr_Rec_Type
495 )
496 IS
497  g_p_PRICING_ATTR_rec         QP_Price_List_PUB.Pricing_Attr_Rec_Type;
498 BEGIN
499 
500     --  Check number of iterations.
501 
502     IF p_iteration > QP_GLOBALS.G_MAX_DEF_ITERATIONS THEN
503 
504         IF oe_msg_pub.Check_Msg_Level(oe_msg_pub.G_MSG_LVL_ERROR)
505         THEN
506 
507             FND_MESSAGE.SET_NAME('QP','OE_DEF_MAX_ITERATION');
508             oe_msg_pub.Add;
509 
510         END IF;
511 
512         RAISE FND_API.G_EXC_ERROR;
513 
514     END IF;
515 
516     --  Initialize g_PRICING_ATTR_rec
517 
518     g_PRICING_ATTR_rec := p_PRICING_ATTR_rec;
519 
520     --  Default missing attributes.
521 
522     IF g_PRICING_ATTR_rec.accumulate_flag = FND_API.G_MISS_CHAR THEN
523 
524         g_PRICING_ATTR_rec.accumulate_flag := Get_Accumulate;
525 
526         IF g_PRICING_ATTR_rec.accumulate_flag IS NOT NULL THEN
527 
528             IF QP_Validate.Accumulate(g_PRICING_ATTR_rec.accumulate_flag)
529             THEN
530                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
531                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
532                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_ACCUMULATE
533                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
534                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
535                 );
536             ELSE
537                 g_PRICING_ATTR_rec.accumulate_flag := NULL;
538             END IF;
539 
540         END IF;
541 
542     END IF;
543 
544     IF g_PRICING_ATTR_rec.attribute_grouping_no = FND_API.G_MISS_NUM THEN
545 
546         g_PRICING_ATTR_rec.attribute_grouping_no := Get_Attribute_Grouping_No;
547 
548         IF g_PRICING_ATTR_rec.attribute_grouping_no IS NOT NULL THEN
549 
550             IF QP_Validate.Attribute_Grouping_No(g_PRICING_ATTR_rec.attribute_grouping_no)
551             THEN
552                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
553                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
554                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_ATTRIBUTE_GROUPING_NO
555                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
556                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
557                 );
558             ELSE
559                 g_PRICING_ATTR_rec.attribute_grouping_no := NULL;
560             END IF;
561 
562         END IF;
563 
564     END IF;
565 
566     IF g_PRICING_ATTR_rec.excluder_flag = FND_API.G_MISS_CHAR THEN
567 
568         g_PRICING_ATTR_rec.excluder_flag := Get_Excluder;
569 
570         IF g_PRICING_ATTR_rec.excluder_flag IS NOT NULL THEN
571 
572             IF QP_Validate.Excluder(g_PRICING_ATTR_rec.excluder_flag)
573             THEN
574                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
575                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
576                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_EXCLUDER
577                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
578                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
579                 );
580             ELSE
581                 g_PRICING_ATTR_rec.excluder_flag := NULL;
582             END IF;
583 
584         END IF;
585 
586     END IF;
587 
588     IF g_PRICING_ATTR_rec.list_line_id = FND_API.G_MISS_NUM THEN
589 
590         g_PRICING_ATTR_rec.list_line_id := Get_List_Line;
591 
592         IF g_PRICING_ATTR_rec.list_line_id IS NOT NULL THEN
593 
594             IF QP_Validate.List_Line(g_PRICING_ATTR_rec.list_line_id)
595             THEN
596                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
597                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
598                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_LIST_LINE
599                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
600                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
601                 );
602             ELSE
603                 g_PRICING_ATTR_rec.list_line_id := NULL;
604             END IF;
605 
606         END IF;
607 
608     END IF;
609 
610     IF g_PRICING_ATTR_rec.qualification_ind = FND_API.G_MISS_NUM THEN
614     END IF;
611 
612         g_PRICING_ATTR_rec.qualification_ind := Get_Qualification_Ind;
613 
615 
616     IF g_PRICING_ATTR_rec.list_header_id = FND_API.G_MISS_NUM THEN
617 
618         g_PRICING_ATTR_rec.list_header_id :=
619 				Get_List_Header(p_PRICING_ATTR_rec.list_line_id);
620 
621         IF g_PRICING_ATTR_rec.list_header_id IS NOT NULL THEN
622 
623             IF QP_Validate.List_Header(g_PRICING_ATTR_rec.list_header_id)
624             THEN
625                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
626                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
627                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_LIST_HEADER
628                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
629                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
630                 );
631             ELSE
632                 g_PRICING_ATTR_rec.list_header_id := NULL;
633             END IF;
634 
635         END IF;
636 
637     END IF;
638 
639     IF g_PRICING_ATTR_rec.pricing_phase_id = FND_API.G_MISS_NUM THEN
640 
641         g_PRICING_ATTR_rec.pricing_phase_id := Get_Pricing_Phase;
642 
643         IF g_PRICING_ATTR_rec.pricing_phase_id IS NOT NULL THEN
644 
645             IF QP_Validate.Pricing_Phase(g_PRICING_ATTR_rec.pricing_phase_id)
646             THEN
647                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
648                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
649                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_LIST_HEADER
650                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
651                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
652                 );
653             ELSE
654                 g_PRICING_ATTR_rec.pricing_phase_id := NULL;
655             END IF;
656 
657         END IF;
658 
659     END IF;
660 
661     IF g_PRICING_ATTR_rec.pricing_attribute_context = FND_API.G_MISS_CHAR THEN
662 
663         g_PRICING_ATTR_rec.pricing_attribute_context := Get_Pricing_Attribute_Context;
664 
665         IF g_PRICING_ATTR_rec.pricing_attribute_context IS NOT NULL THEN
666 
667             IF QP_Validate.Pricing_Attribute_Context(g_PRICING_ATTR_rec.pricing_attribute_context)
668             THEN
669                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
670                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
671                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRICING_ATTRIBUTE_CONTEXT
672                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
673                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
674                 );
675             ELSE
676                 g_PRICING_ATTR_rec.pricing_attribute_context := NULL;
677             END IF;
678 
679         END IF;
680 
681     END IF;
682 
683     IF g_PRICING_ATTR_rec.pricing_attribute = FND_API.G_MISS_CHAR THEN
684 
685         g_PRICING_ATTR_rec.pricing_attribute := Get_Pricing_Attribute;
686 
687         IF g_PRICING_ATTR_rec.pricing_attribute IS NOT NULL THEN
688 
689             IF QP_Validate.Pricing_Attribute(g_PRICING_ATTR_rec.pricing_attribute)
690             THEN
691                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
692                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
693                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRICING_ATTRIBUTE
694                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
695                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
696                 );
697             ELSE
698                 g_PRICING_ATTR_rec.pricing_attribute := NULL;
699             END IF;
700 
701         END IF;
702 
703     END IF;
704 
705     IF g_PRICING_ATTR_rec.pricing_attr_value_from = FND_API.G_MISS_CHAR THEN
706 
707         g_PRICING_ATTR_rec.pricing_attr_value_from := Get_Pricing_Attr_Value_From;
708 
709         IF g_PRICING_ATTR_rec.pricing_attr_value_from IS NOT NULL THEN
710 
711             IF QP_Validate.Pricing_Attr_Value_From(g_PRICING_ATTR_rec.pricing_attr_value_from)
712             THEN
713                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
714                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
715                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRICING_ATTR_VALUE_FROM
716                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
717                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
718                 );
719             ELSE
720                 g_PRICING_ATTR_rec.pricing_attr_value_from := NULL;
721             END IF;
722 
723         END IF;
724 
725     END IF;
726 
727     IF g_PRICING_ATTR_rec.pricing_attr_value_to = FND_API.G_MISS_CHAR THEN
728 
729         g_PRICING_ATTR_rec.pricing_attr_value_to := Get_Pricing_Attr_Value_To;
730 
731         IF g_PRICING_ATTR_rec.pricing_attr_value_to IS NOT NULL THEN
732 
733             IF QP_Validate.Pricing_Attr_Value_To(g_PRICING_ATTR_rec.pricing_attr_value_to)
734             THEN
735                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
736                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
737                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRICING_ATTR_VALUE_TO
738                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
739                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
740                 );
741             ELSE
742                 g_PRICING_ATTR_rec.pricing_attr_value_to := NULL;
743             END IF;
747     END IF;
744 
745         END IF;
746 
748 
749     IF g_PRICING_ATTR_rec.pricing_attribute_datatype = FND_API.G_MISS_CHAR THEN
750 
751       g_PRICING_ATTR_rec.pricing_attribute_datatype :=
752  Get_Pricing_Attribute_Datatype(p_PRICING_ATTR_rec.pricing_attribute_context,
753 	                                  p_PRICING_ATTR_rec.pricing_attribute,
754 	                                  p_PRICING_ATTR_rec.pricing_attr_value_from);
755 
756 
757         IF g_PRICING_ATTR_rec.pricing_attribute_datatype IS NOT NULL THEN
758 
759             IF QP_Validate.Pricing_Attribute_Datatype(g_PRICING_ATTR_rec.pricing_attribute_datatype)
760             THEN
761                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
762                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
763                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRICING_ATTRIBUTE_DATATYPE
764                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
765                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
766                 );
767             ELSE
768                 g_PRICING_ATTR_rec.pricing_attribute_datatype := NULL;
769             END IF;
770 
771         END IF;
772 
773     END IF;
774 
775     IF g_PRICING_ATTR_rec.pricing_attribute_id = FND_API.G_MISS_NUM THEN
776 
777         g_PRICING_ATTR_rec.pricing_attribute_id := Get_Pricing_Attribute_Id;
778 
779         IF g_PRICING_ATTR_rec.pricing_attribute_id IS NOT NULL THEN
780 
781             IF QP_Validate.Pricing_Attribute(g_PRICING_ATTR_rec.pricing_attribute_id)
782             THEN
783                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
784                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
785                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRICING_ATTRIBUTE
786                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
787                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
788                 );
789             ELSE
790                 g_PRICING_ATTR_rec.pricing_attribute_id := NULL;
791             END IF;
792 
793         END IF;
794 
795     END IF;
796 
797     IF g_PRICING_ATTR_rec.comparison_operator_code = FND_API.G_MISS_CHAR THEN
798 
799 	 g_PRICING_ATTR_rec.comparison_operator_code := Get_Comparison_Operator_Code;
800 
801         IF g_PRICING_ATTR_rec.comparison_operator_code IS NOT NULL THEN
802 
803             IF QP_Validate.comparison_operator(g_PRICING_ATTR_rec.comparison_operator_code)
804             THEN
805                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
806                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
807                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_COMPARISON_OPERATOR_CODE
808                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
809                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
810                 );
811             ELSE
812                 g_PRICING_ATTR_rec.comparison_operator_code := NULL;
813             END IF;
814 
815         END IF;
816 
817     END IF;
818 
819 
820     IF g_PRICING_ATTR_rec.from_rltd_modifier_id = FND_API.G_MISS_NUM THEN
821 
822         g_PRICING_ATTR_rec.from_rltd_modifier_id := Get_From_Rltd_Modifier_Id;
823 
824 	   oe_debug_pub.add('get rltd modifier');
825 
826        /*
827 
828         IF g_PRICING_ATTR_rec.from_rltd_modifier_id IS NOT NULL THEN
829 
830             IF QP_Validate.From_Rltd_Modifier_Id(g_PRICING_ATTR_rec.from_rltd_modifier_id)
831             THEN
832                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
833                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_FROM_RLTD_MODIFIER
834                 ,   p_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
835                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
836                 );
837             ELSE
838                 g_PRICING_ATTR_rec.from_rltd_modifier_id := NULL;
839             END IF;
840 
841         END IF;
842 
843          */
844 
845     END IF;
846 
847     IF g_PRICING_ATTR_rec.product_attribute_context = FND_API.G_MISS_CHAR THEN
848 
849         g_PRICING_ATTR_rec.product_attribute_context := Get_Product_Attribute_Context;
850 
851         IF g_PRICING_ATTR_rec.product_attribute_context IS NOT NULL THEN
852 
853             IF QP_Validate.Product_Attribute_Context(g_PRICING_ATTR_rec.product_attribute_context)
854             THEN
855                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
856                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
857                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRODUCT_ATTRIBUTE_CONTEXT
858                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
859                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
860                 );
861             ELSE
862                 g_PRICING_ATTR_rec.product_attribute_context := NULL;
863             END IF;
864 
865         END IF;
866 
867     END IF;
868 
869     IF g_PRICING_ATTR_rec.product_attribute = FND_API.G_MISS_CHAR THEN
870 
871         g_PRICING_ATTR_rec.product_attribute := Get_Product_Attribute;
872 
873         IF g_PRICING_ATTR_rec.product_attribute IS NOT NULL THEN
874 
875             IF QP_Validate.Product_Attribute(g_PRICING_ATTR_rec.product_attribute)
876             THEN
877                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
878                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
879                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRODUCT_ATTRIBUTE
883             ELSE
880                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
881                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
882                 );
884                 g_PRICING_ATTR_rec.product_attribute := NULL;
885             END IF;
886 
887         END IF;
888 
889     END IF;
890 
891 
892     IF g_PRICING_ATTR_rec.product_attr_value = FND_API.G_MISS_CHAR THEN
893 
894         g_PRICING_ATTR_rec.product_attr_value := Get_Product_Attr_Value;
895 
896         IF g_PRICING_ATTR_rec.product_attr_value IS NOT NULL THEN
897 
898             IF QP_Validate.Product_Attr_Value(g_PRICING_ATTR_rec.product_attr_value)
899             THEN
900                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
901                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
902                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRODUCT_ATTR_VALUE
903                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
904                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
905                 );
906             ELSE
907                 g_PRICING_ATTR_rec.product_attr_value := NULL;
908             END IF;
909 
910         END IF;
911 
912     END IF;
913 
914     IF g_PRICING_ATTR_rec.product_attribute_datatype = FND_API.G_MISS_CHAR THEN
915 
916         g_PRICING_ATTR_rec.product_attribute_datatype :=
917 	   Get_Product_Attribute_Datatype(g_PRICING_ATTR_rec.product_attribute_context,
918 	                                  g_PRICING_ATTR_rec.product_attribute,
919 	                                  g_PRICING_ATTR_rec.product_attr_value);
920 
921 
922         IF g_PRICING_ATTR_rec.product_attribute_datatype IS NOT NULL THEN
923 
924             IF QP_Validate.Product_Attribute_Datatype(g_PRICING_ATTR_rec.product_attribute_datatype)
925             THEN
926                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
927                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
928                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRODUCT_ATTRIBUTE_DATATYPE
929                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
930                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
931                 );
932             ELSE
933                 g_PRICING_ATTR_rec.product_attribute_datatype := NULL;
934             END IF;
935 
936         END IF;
937 
938     END IF;
939 
940     oe_debug_pub.add('product attr datatype is : ' || g_PRICING_ATTR_rec.product_attribute_datatype);
941 
942     IF g_PRICING_ATTR_rec.product_uom_code = FND_API.G_MISS_CHAR THEN
943 
944         g_PRICING_ATTR_rec.product_uom_code := Get_Product_Uom;
945 
946         IF g_PRICING_ATTR_rec.product_uom_code IS NOT NULL THEN
947 
948             IF QP_Validate.Product_Uom(g_PRICING_ATTR_rec.product_uom_code)
949             THEN
950                 g_p_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
951                 Qp_pll_pricing_attr_Util.Clear_Dependent_Attr
952                 (   p_attr_id                     => Qp_pll_pricing_attr_Util.G_PRODUCT_UOM
953                 ,   p_PRICING_ATTR_rec            => g_p_PRICING_ATTR_rec
954                 ,   x_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
955                 );
956             ELSE
957                 g_PRICING_ATTR_rec.product_uom_code := NULL;
958             END IF;
959 
960         END IF;
961 
962     END IF;
963 
964     IF g_PRICING_ATTR_rec.attribute1 = FND_API.G_MISS_CHAR
965     OR  g_PRICING_ATTR_rec.attribute10 = FND_API.G_MISS_CHAR
966     OR  g_PRICING_ATTR_rec.attribute11 = FND_API.G_MISS_CHAR
967     OR  g_PRICING_ATTR_rec.attribute12 = FND_API.G_MISS_CHAR
968     OR  g_PRICING_ATTR_rec.attribute13 = FND_API.G_MISS_CHAR
969     OR  g_PRICING_ATTR_rec.attribute14 = FND_API.G_MISS_CHAR
970     OR  g_PRICING_ATTR_rec.attribute15 = FND_API.G_MISS_CHAR
971     OR  g_PRICING_ATTR_rec.attribute2 = FND_API.G_MISS_CHAR
972     OR  g_PRICING_ATTR_rec.attribute3 = FND_API.G_MISS_CHAR
973     OR  g_PRICING_ATTR_rec.attribute4 = FND_API.G_MISS_CHAR
974     OR  g_PRICING_ATTR_rec.attribute5 = FND_API.G_MISS_CHAR
975     OR  g_PRICING_ATTR_rec.attribute6 = FND_API.G_MISS_CHAR
976     OR  g_PRICING_ATTR_rec.attribute7 = FND_API.G_MISS_CHAR
977     OR  g_PRICING_ATTR_rec.attribute8 = FND_API.G_MISS_CHAR
978     OR  g_PRICING_ATTR_rec.attribute9 = FND_API.G_MISS_CHAR
979     OR  g_PRICING_ATTR_rec.context = FND_API.G_MISS_CHAR
980     THEN
981 
982         Get_Flex_Pricing_Attr;
983 
984     END IF;
985 
986     IF g_PRICING_ATTR_rec.created_by = FND_API.G_MISS_NUM THEN
987 
988         g_PRICING_ATTR_rec.created_by := NULL;
989 
990     END IF;
991 
992     IF g_PRICING_ATTR_rec.creation_date = FND_API.G_MISS_DATE THEN
993 
994         g_PRICING_ATTR_rec.creation_date := NULL;
995 
996     END IF;
997 
998     IF g_PRICING_ATTR_rec.last_updated_by = FND_API.G_MISS_NUM THEN
999 
1000         g_PRICING_ATTR_rec.last_updated_by := NULL;
1001 
1002     END IF;
1003 
1004     IF g_PRICING_ATTR_rec.last_update_date = FND_API.G_MISS_DATE THEN
1005 
1006         g_PRICING_ATTR_rec.last_update_date := NULL;
1007 
1008     END IF;
1009 
1010     IF g_PRICING_ATTR_rec.last_update_login = FND_API.G_MISS_NUM THEN
1011 
1012         g_PRICING_ATTR_rec.last_update_login := NULL;
1013 
1014     END IF;
1015 
1016     IF g_PRICING_ATTR_rec.program_application_id = FND_API.G_MISS_NUM THEN
1017 
1018         g_PRICING_ATTR_rec.program_application_id := NULL;
1019 
1020     END IF;
1021 
1022     IF g_PRICING_ATTR_rec.program_id = FND_API.G_MISS_NUM THEN
1023 
1024         g_PRICING_ATTR_rec.program_id := NULL;
1025 
1026     END IF;
1027 
1028     IF g_PRICING_ATTR_rec.program_update_date = FND_API.G_MISS_DATE THEN
1029 
1030         g_PRICING_ATTR_rec.program_update_date := NULL;
1031 
1032     END IF;
1033 
1034     IF g_PRICING_ATTR_rec.request_id = FND_API.G_MISS_NUM THEN
1035 
1036         g_PRICING_ATTR_rec.request_id := NULL;
1037 
1038     END IF;
1039 
1040     --  Redefault if there are any missing attributes.
1041 
1042     IF  g_PRICING_ATTR_rec.accumulate_flag = FND_API.G_MISS_CHAR
1043     OR  g_PRICING_ATTR_rec.attribute1 = FND_API.G_MISS_CHAR
1044     OR  g_PRICING_ATTR_rec.attribute10 = FND_API.G_MISS_CHAR
1045     OR  g_PRICING_ATTR_rec.attribute11 = FND_API.G_MISS_CHAR
1046     OR  g_PRICING_ATTR_rec.attribute12 = FND_API.G_MISS_CHAR
1047     OR  g_PRICING_ATTR_rec.attribute13 = FND_API.G_MISS_CHAR
1048     OR  g_PRICING_ATTR_rec.attribute14 = FND_API.G_MISS_CHAR
1049     OR  g_PRICING_ATTR_rec.attribute15 = FND_API.G_MISS_CHAR
1050     OR  g_PRICING_ATTR_rec.attribute2 = FND_API.G_MISS_CHAR
1051     OR  g_PRICING_ATTR_rec.attribute3 = FND_API.G_MISS_CHAR
1052     OR  g_PRICING_ATTR_rec.attribute4 = FND_API.G_MISS_CHAR
1053     OR  g_PRICING_ATTR_rec.attribute5 = FND_API.G_MISS_CHAR
1054     OR  g_PRICING_ATTR_rec.attribute6 = FND_API.G_MISS_CHAR
1055     OR  g_PRICING_ATTR_rec.attribute7 = FND_API.G_MISS_CHAR
1056     OR  g_PRICING_ATTR_rec.attribute8 = FND_API.G_MISS_CHAR
1057     OR  g_PRICING_ATTR_rec.attribute9 = FND_API.G_MISS_CHAR
1058     OR  g_PRICING_ATTR_rec.attribute_grouping_no = FND_API.G_MISS_NUM
1059     OR  g_PRICING_ATTR_rec.context = FND_API.G_MISS_CHAR
1060     OR  g_PRICING_ATTR_rec.created_by = FND_API.G_MISS_NUM
1061     OR  g_PRICING_ATTR_rec.creation_date = FND_API.G_MISS_DATE
1062     OR  g_PRICING_ATTR_rec.excluder_flag = FND_API.G_MISS_CHAR
1063     OR  g_PRICING_ATTR_rec.last_updated_by = FND_API.G_MISS_NUM
1064     OR  g_PRICING_ATTR_rec.last_update_date = FND_API.G_MISS_DATE
1065     OR  g_PRICING_ATTR_rec.last_update_login = FND_API.G_MISS_NUM
1066     OR  g_PRICING_ATTR_rec.list_line_id = FND_API.G_MISS_NUM
1067     OR  g_PRICING_ATTR_rec.pricing_attribute = FND_API.G_MISS_CHAR
1068     OR  g_PRICING_ATTR_rec.pricing_attribute_context = FND_API.G_MISS_CHAR
1069     OR  g_PRICING_ATTR_rec.pricing_attribute_id = FND_API.G_MISS_NUM
1070     OR  g_PRICING_ATTR_rec.pricing_attr_value_from = FND_API.G_MISS_CHAR
1071     OR  g_PRICING_ATTR_rec.pricing_attr_value_to = FND_API.G_MISS_CHAR
1072     OR  g_PRICING_ATTR_rec.from_rltd_modifier_id = FND_API.G_MISS_NUM
1073     OR  g_PRICING_ATTR_rec.product_attribute = FND_API.G_MISS_CHAR
1074     OR  g_PRICING_ATTR_rec.product_attribute_context = FND_API.G_MISS_CHAR
1075     OR  g_PRICING_ATTR_rec.product_attr_value = FND_API.G_MISS_CHAR
1076     OR  g_PRICING_ATTR_rec.product_uom_code = FND_API.G_MISS_CHAR
1077     OR  g_PRICING_ATTR_rec.program_application_id = FND_API.G_MISS_NUM
1078     OR  g_PRICING_ATTR_rec.program_id = FND_API.G_MISS_NUM
1079     OR  g_PRICING_ATTR_rec.program_update_date = FND_API.G_MISS_DATE
1080     OR  g_PRICING_ATTR_rec.request_id = FND_API.G_MISS_NUM
1081     OR  g_PRICING_ATTR_rec.comparison_operator_code = FND_API.G_MISS_CHAR
1082     OR  g_PRICING_ATTR_rec.pricing_attribute_datatype = FND_API.G_MISS_CHAR
1083     OR  g_PRICING_ATTR_rec.product_attribute_datatype = FND_API.G_MISS_CHAR
1084     THEN
1085 
1086         Qp_Default_pll_pricing_attr.Attributes
1087         (   p_PRICING_ATTR_rec            => g_PRICING_ATTR_rec
1088         ,   p_iteration                   => p_iteration + 1
1089         ,   x_PRICING_ATTR_rec            => x_PRICING_ATTR_rec
1090         );
1091 
1092     ELSE
1093 
1094         --  Done defaulting attributes
1095 
1096         x_PRICING_ATTR_rec := g_PRICING_ATTR_rec;
1097 
1098     END IF;
1099 
1100 END Attributes;
1101 
1102 END QP_Default_pll_pricing_attr;