[Home] [Help]
PACKAGE BODY: APPS.OE_DEFAULT_PRICE_BREAK
Source
1 PACKAGE BODY OE_Default_Price_Break AS
2 /* $Header: OEXDDPBB.pls 115.0 99/07/15 19:20:41 porting shi $ */
3
4 -- Global constant holding the package name
5
6 G_PKG_NAME CONSTANT VARCHAR2(30) := 'OE_Default_Price_Break';
7
8 -- Package global used within the package.
9
10 g_Price_Break_rec OE_Pricing_Cont_PUB.Price_Break_Rec_Type;
11
12 -- Get functions.
13
14 FUNCTION Get_Amount
15 RETURN NUMBER
16 IS
17 BEGIN
18
19 RETURN NULL;
20
21 END Get_Amount;
22
23 FUNCTION Get_Discount_Line
24 RETURN NUMBER
25 IS
26 BEGIN
27
28 RETURN NULL;
29
30 END Get_Discount_Line;
31
32 FUNCTION Get_End_Date_Active
33 RETURN DATE
34 IS
35 BEGIN
36
37 RETURN NULL;
38
39 END Get_End_Date_Active;
40
41 FUNCTION Get_Method_Type
42 RETURN VARCHAR2
43 IS
44 BEGIN
45
46 RETURN NULL;
47
48 END Get_Method_Type;
49
50 FUNCTION Get_Percent
51 RETURN NUMBER
52 IS
53 BEGIN
54
55 RETURN NULL;
56
57 END Get_Percent;
58
59 FUNCTION Get_Price
60 RETURN NUMBER
61 IS
62 BEGIN
63
64 RETURN NULL;
65
66 END Get_Price;
67
68 FUNCTION Get_Price_Break_High
69 RETURN NUMBER
70 IS
71 BEGIN
72
73 RETURN NULL;
74
75 END Get_Price_Break_High;
76
77 FUNCTION Get_Price_Break_Low
78 RETURN NUMBER
79 IS
80 BEGIN
81
82 RETURN NULL;
83
84 END Get_Price_Break_Low;
85
86 FUNCTION Get_Start_Date_Active
87 RETURN DATE
88 IS
89 BEGIN
90
91 RETURN NULL;
92
93 END Get_Start_Date_Active;
94
95 FUNCTION Get_Unit
96 RETURN VARCHAR2
97 IS
98 BEGIN
99
100 RETURN NULL;
101
102 END Get_Unit;
103
104 PROCEDURE Get_Flex_Price_Break
105 IS
106 BEGIN
107
108 -- In the future call Flex APIs for defaults
109
110 IF g_Price_Break_rec.attribute1 = FND_API.G_MISS_CHAR THEN
111 g_Price_Break_rec.attribute1 := NULL;
112 END IF;
113
114 IF g_Price_Break_rec.attribute10 = FND_API.G_MISS_CHAR THEN
115 g_Price_Break_rec.attribute10 := NULL;
116 END IF;
117
118 IF g_Price_Break_rec.attribute11 = FND_API.G_MISS_CHAR THEN
119 g_Price_Break_rec.attribute11 := NULL;
120 END IF;
121
122 IF g_Price_Break_rec.attribute12 = FND_API.G_MISS_CHAR THEN
123 g_Price_Break_rec.attribute12 := NULL;
124 END IF;
125
126 IF g_Price_Break_rec.attribute13 = FND_API.G_MISS_CHAR THEN
127 g_Price_Break_rec.attribute13 := NULL;
128 END IF;
129
130 IF g_Price_Break_rec.attribute14 = FND_API.G_MISS_CHAR THEN
131 g_Price_Break_rec.attribute14 := NULL;
132 END IF;
133
134 IF g_Price_Break_rec.attribute15 = FND_API.G_MISS_CHAR THEN
135 g_Price_Break_rec.attribute15 := NULL;
136 END IF;
137
138 IF g_Price_Break_rec.attribute2 = FND_API.G_MISS_CHAR THEN
139 g_Price_Break_rec.attribute2 := NULL;
140 END IF;
141
142 IF g_Price_Break_rec.attribute3 = FND_API.G_MISS_CHAR THEN
143 g_Price_Break_rec.attribute3 := NULL;
144 END IF;
145
146 IF g_Price_Break_rec.attribute4 = FND_API.G_MISS_CHAR THEN
147 g_Price_Break_rec.attribute4 := NULL;
148 END IF;
149
150 IF g_Price_Break_rec.attribute5 = FND_API.G_MISS_CHAR THEN
151 g_Price_Break_rec.attribute5 := NULL;
152 END IF;
153
154 IF g_Price_Break_rec.attribute6 = FND_API.G_MISS_CHAR THEN
155 g_Price_Break_rec.attribute6 := NULL;
156 END IF;
157
158 IF g_Price_Break_rec.attribute7 = FND_API.G_MISS_CHAR THEN
159 g_Price_Break_rec.attribute7 := NULL;
160 END IF;
161
162 IF g_Price_Break_rec.attribute8 = FND_API.G_MISS_CHAR THEN
163 g_Price_Break_rec.attribute8 := NULL;
164 END IF;
165
166 IF g_Price_Break_rec.attribute9 = FND_API.G_MISS_CHAR THEN
167 g_Price_Break_rec.attribute9 := NULL;
168 END IF;
169
170 IF g_Price_Break_rec.context = FND_API.G_MISS_CHAR THEN
171 g_Price_Break_rec.context := NULL;
172 END IF;
173
174 END Get_Flex_Price_Break;
175
176 -- Procedure Attributes
177
178 PROCEDURE Attributes
179 ( p_Price_Break_rec IN OE_Pricing_Cont_PUB.Price_Break_Rec_Type :=
180 OE_Pricing_Cont_PUB.G_MISS_PRICE_BREAK_REC
181 , p_iteration IN NUMBER := 1
182 , x_Price_Break_rec OUT OE_Pricing_Cont_PUB.Price_Break_Rec_Type
183 )
184 IS
185 BEGIN
186
187 -- Check number of iterations.
188
189 IF p_iteration > OE_GLOBALS.G_MAX_DEF_ITERATIONS THEN
190
191 IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
192 THEN
193
194 FND_MESSAGE.SET_NAME('OE','OE_DEF_MAX_ITERATION');
195 OE_MSG_PUB.Add;
196
197 END IF;
198
199 RAISE FND_API.G_EXC_ERROR;
200
201 END IF;
202
203 -- Initialize g_Price_Break_rec
204
205 g_Price_Break_rec := p_Price_Break_rec;
206
207 -- Default missing attributes.
208
209 IF g_Price_Break_rec.amount = FND_API.G_MISS_NUM THEN
210
211 g_Price_Break_rec.amount := Get_Amount;
212
213 IF g_Price_Break_rec.amount IS NOT NULL THEN
214
215 IF OE_Validate_Attr.Amount(g_Price_Break_rec.amount)
216 THEN
217 OE_Price_Break_Util.Clear_Dependent_Attr
218 ( p_attr_id => OE_Price_Break_Util.G_AMOUNT
219 , p_Price_Break_rec => g_Price_Break_rec
220 , x_Price_Break_rec => g_Price_Break_rec
221 );
222 ELSE
223 g_Price_Break_rec.amount := NULL;
224 END IF;
225
226 END IF;
227
228 END IF;
229
230 IF g_Price_Break_rec.discount_line_id = FND_API.G_MISS_NUM THEN
231
232 g_Price_Break_rec.discount_line_id := Get_Discount_Line;
233
234 IF g_Price_Break_rec.discount_line_id IS NOT NULL THEN
235
236 IF OE_Validate_Attr.Discount_Line(g_Price_Break_rec.discount_line_id)
237 THEN
238 OE_Price_Break_Util.Clear_Dependent_Attr
239 ( p_attr_id => OE_Price_Break_Util.G_DISCOUNT_LINE
240 , p_Price_Break_rec => g_Price_Break_rec
241 , x_Price_Break_rec => g_Price_Break_rec
242 );
243 ELSE
244 g_Price_Break_rec.discount_line_id := NULL;
245 END IF;
246
247 END IF;
248
249 END IF;
250
251 IF g_Price_Break_rec.end_date_active = FND_API.G_MISS_DATE THEN
252
253 g_Price_Break_rec.end_date_active := Get_End_Date_Active;
254
255 IF g_Price_Break_rec.end_date_active IS NOT NULL THEN
256
257 IF OE_Validate_Attr.End_Date_Active(g_Price_Break_rec.end_date_active)
258 THEN
259 OE_Price_Break_Util.Clear_Dependent_Attr
260 ( p_attr_id => OE_Price_Break_Util.G_END_DATE_ACTIVE
261 , p_Price_Break_rec => g_Price_Break_rec
262 , x_Price_Break_rec => g_Price_Break_rec
263 );
264 ELSE
265 g_Price_Break_rec.end_date_active := NULL;
266 END IF;
267
268 END IF;
269
270 END IF;
271
272 IF g_Price_Break_rec.method_type_code = FND_API.G_MISS_CHAR THEN
273
274 g_Price_Break_rec.method_type_code := Get_Method_Type;
275
276 IF g_Price_Break_rec.method_type_code IS NOT NULL THEN
277
278 IF OE_Validate_Attr.Method_Type(g_Price_Break_rec.method_type_code)
279 THEN
280 OE_Price_Break_Util.Clear_Dependent_Attr
281 ( p_attr_id => OE_Price_Break_Util.G_METHOD_TYPE
282 , p_Price_Break_rec => g_Price_Break_rec
283 , x_Price_Break_rec => g_Price_Break_rec
284 );
285 ELSE
286 g_Price_Break_rec.method_type_code := NULL;
287 END IF;
288
289 END IF;
290
291 END IF;
292
293 IF g_Price_Break_rec.percent = FND_API.G_MISS_NUM THEN
294
295 g_Price_Break_rec.percent := Get_Percent;
296
297 IF g_Price_Break_rec.percent IS NOT NULL THEN
298
299 IF OE_Validate_Attr.Percent(g_Price_Break_rec.percent)
300 THEN
301 OE_Price_Break_Util.Clear_Dependent_Attr
302 ( p_attr_id => OE_Price_Break_Util.G_PERCENT
303 , p_Price_Break_rec => g_Price_Break_rec
304 , x_Price_Break_rec => g_Price_Break_rec
305 );
306 ELSE
307 g_Price_Break_rec.percent := NULL;
308 END IF;
309
310 END IF;
311
312 END IF;
313
314 IF g_Price_Break_rec.price = FND_API.G_MISS_NUM THEN
315
316 g_Price_Break_rec.price := Get_Price;
317
318 IF g_Price_Break_rec.price IS NOT NULL THEN
319
320 IF OE_Validate_Attr.Price(g_Price_Break_rec.price)
321 THEN
322 OE_Price_Break_Util.Clear_Dependent_Attr
323 ( p_attr_id => OE_Price_Break_Util.G_PRICE
324 , p_Price_Break_rec => g_Price_Break_rec
325 , x_Price_Break_rec => g_Price_Break_rec
326 );
327 ELSE
328 g_Price_Break_rec.price := NULL;
329 END IF;
330
331 END IF;
332
333 END IF;
334
335 IF g_Price_Break_rec.price_break_high = FND_API.G_MISS_NUM THEN
336
337 g_Price_Break_rec.price_break_high := Get_Price_Break_High;
338
339 IF g_Price_Break_rec.price_break_high IS NOT NULL THEN
340
341 IF OE_Validate_Attr.Price_Break_High(g_Price_Break_rec.price_break_high)
342 THEN
343 OE_Price_Break_Util.Clear_Dependent_Attr
344 ( p_attr_id => OE_Price_Break_Util.G_PRICE_BREAK_HIGH
345 , p_Price_Break_rec => g_Price_Break_rec
346 , x_Price_Break_rec => g_Price_Break_rec
347 );
348 ELSE
349 g_Price_Break_rec.price_break_high := NULL;
350 END IF;
351
352 END IF;
353
354 END IF;
355
356 IF g_Price_Break_rec.price_break_low = FND_API.G_MISS_NUM THEN
357
358 g_Price_Break_rec.price_break_low := Get_Price_Break_Low;
359
360 IF g_Price_Break_rec.price_break_low IS NOT NULL THEN
361
362 IF OE_Validate_Attr.Price_Break_Low(g_Price_Break_rec.price_break_low)
363 THEN
364 OE_Price_Break_Util.Clear_Dependent_Attr
365 ( p_attr_id => OE_Price_Break_Util.G_PRICE_BREAK_LOW
366 , p_Price_Break_rec => g_Price_Break_rec
367 , x_Price_Break_rec => g_Price_Break_rec
368 );
369 ELSE
370 g_Price_Break_rec.price_break_low := NULL;
371 END IF;
372
373 END IF;
374
375 END IF;
376
377 IF g_Price_Break_rec.start_date_active = FND_API.G_MISS_DATE THEN
378
379 g_Price_Break_rec.start_date_active := Get_Start_Date_Active;
380
381 IF g_Price_Break_rec.start_date_active IS NOT NULL THEN
382
383 IF OE_Validate_Attr.Start_Date_Active(g_Price_Break_rec.start_date_active)
384 THEN
385 OE_Price_Break_Util.Clear_Dependent_Attr
386 ( p_attr_id => OE_Price_Break_Util.G_START_DATE_ACTIVE
387 , p_Price_Break_rec => g_Price_Break_rec
388 , x_Price_Break_rec => g_Price_Break_rec
389 );
390 ELSE
391 g_Price_Break_rec.start_date_active := NULL;
392 END IF;
393
394 END IF;
395
396 END IF;
397
398 IF g_Price_Break_rec.unit_code = FND_API.G_MISS_CHAR THEN
399
400 g_Price_Break_rec.unit_code := Get_Unit;
401
402 IF g_Price_Break_rec.unit_code IS NOT NULL THEN
403
404 IF OE_Validate_Attr.Unit(g_Price_Break_rec.unit_code)
405 THEN
406 OE_Price_Break_Util.Clear_Dependent_Attr
407 ( p_attr_id => OE_Price_Break_Util.G_UNIT
408 , p_Price_Break_rec => g_Price_Break_rec
409 , x_Price_Break_rec => g_Price_Break_rec
410 );
411 ELSE
412 g_Price_Break_rec.unit_code := NULL;
413 END IF;
414
415 END IF;
416
417 END IF;
418
422 OR g_Price_Break_rec.attribute12 = FND_API.G_MISS_CHAR
419 IF g_Price_Break_rec.attribute1 = FND_API.G_MISS_CHAR
420 OR g_Price_Break_rec.attribute10 = FND_API.G_MISS_CHAR
421 OR g_Price_Break_rec.attribute11 = FND_API.G_MISS_CHAR
423 OR g_Price_Break_rec.attribute13 = FND_API.G_MISS_CHAR
424 OR g_Price_Break_rec.attribute14 = FND_API.G_MISS_CHAR
425 OR g_Price_Break_rec.attribute15 = FND_API.G_MISS_CHAR
426 OR g_Price_Break_rec.attribute2 = FND_API.G_MISS_CHAR
427 OR g_Price_Break_rec.attribute3 = FND_API.G_MISS_CHAR
428 OR g_Price_Break_rec.attribute4 = FND_API.G_MISS_CHAR
429 OR g_Price_Break_rec.attribute5 = FND_API.G_MISS_CHAR
430 OR g_Price_Break_rec.attribute6 = FND_API.G_MISS_CHAR
431 OR g_Price_Break_rec.attribute7 = FND_API.G_MISS_CHAR
432 OR g_Price_Break_rec.attribute8 = FND_API.G_MISS_CHAR
433 OR g_Price_Break_rec.attribute9 = FND_API.G_MISS_CHAR
434 OR g_Price_Break_rec.context = FND_API.G_MISS_CHAR
435 THEN
436
437 Get_Flex_Price_Break;
438
439 END IF;
440
441 IF g_Price_Break_rec.created_by = FND_API.G_MISS_NUM THEN
442
443 g_Price_Break_rec.created_by := NULL;
444
445 END IF;
446
447 IF g_Price_Break_rec.creation_date = FND_API.G_MISS_DATE THEN
448
449 g_Price_Break_rec.creation_date := NULL;
450
451 END IF;
452
453 IF g_Price_Break_rec.last_updated_by = FND_API.G_MISS_NUM THEN
454
455 g_Price_Break_rec.last_updated_by := NULL;
456
457 END IF;
458
459 IF g_Price_Break_rec.last_update_date = FND_API.G_MISS_DATE THEN
460
461 g_Price_Break_rec.last_update_date := NULL;
462
463 END IF;
464
465 IF g_Price_Break_rec.last_update_login = FND_API.G_MISS_NUM THEN
466
467 g_Price_Break_rec.last_update_login := NULL;
468
469 END IF;
470
471 IF g_Price_Break_rec.program_application_id = FND_API.G_MISS_NUM THEN
472
473 g_Price_Break_rec.program_application_id := NULL;
474
475 END IF;
476
477 IF g_Price_Break_rec.program_id = FND_API.G_MISS_NUM THEN
478
479 g_Price_Break_rec.program_id := NULL;
480
481 END IF;
482
483 IF g_Price_Break_rec.program_update_date = FND_API.G_MISS_DATE THEN
484
485 g_Price_Break_rec.program_update_date := NULL;
486
487 END IF;
488
489 IF g_Price_Break_rec.request_id = FND_API.G_MISS_NUM THEN
490
491 g_Price_Break_rec.request_id := NULL;
492
493 END IF;
494
495 -- Redefault if there are any missing attributes.
496
497 IF g_Price_Break_rec.amount = FND_API.G_MISS_NUM
498 OR g_Price_Break_rec.attribute1 = FND_API.G_MISS_CHAR
499 OR g_Price_Break_rec.attribute10 = FND_API.G_MISS_CHAR
500 OR g_Price_Break_rec.attribute11 = FND_API.G_MISS_CHAR
501 OR g_Price_Break_rec.attribute12 = FND_API.G_MISS_CHAR
502 OR g_Price_Break_rec.attribute13 = FND_API.G_MISS_CHAR
503 OR g_Price_Break_rec.attribute14 = FND_API.G_MISS_CHAR
504 OR g_Price_Break_rec.attribute15 = FND_API.G_MISS_CHAR
505 OR g_Price_Break_rec.attribute2 = FND_API.G_MISS_CHAR
506 OR g_Price_Break_rec.attribute3 = FND_API.G_MISS_CHAR
507 OR g_Price_Break_rec.attribute4 = FND_API.G_MISS_CHAR
508 OR g_Price_Break_rec.attribute5 = FND_API.G_MISS_CHAR
509 OR g_Price_Break_rec.attribute6 = FND_API.G_MISS_CHAR
510 OR g_Price_Break_rec.attribute7 = FND_API.G_MISS_CHAR
511 OR g_Price_Break_rec.attribute8 = FND_API.G_MISS_CHAR
512 OR g_Price_Break_rec.attribute9 = FND_API.G_MISS_CHAR
513 OR g_Price_Break_rec.context = FND_API.G_MISS_CHAR
514 OR g_Price_Break_rec.created_by = FND_API.G_MISS_NUM
515 OR g_Price_Break_rec.creation_date = FND_API.G_MISS_DATE
516 OR g_Price_Break_rec.discount_line_id = FND_API.G_MISS_NUM
517 OR g_Price_Break_rec.end_date_active = FND_API.G_MISS_DATE
518 OR g_Price_Break_rec.last_updated_by = FND_API.G_MISS_NUM
519 OR g_Price_Break_rec.last_update_date = FND_API.G_MISS_DATE
520 OR g_Price_Break_rec.last_update_login = FND_API.G_MISS_NUM
521 OR g_Price_Break_rec.method_type_code = FND_API.G_MISS_CHAR
522 OR g_Price_Break_rec.percent = FND_API.G_MISS_NUM
523 OR g_Price_Break_rec.price = FND_API.G_MISS_NUM
524 OR g_Price_Break_rec.price_break_high = FND_API.G_MISS_NUM
525 OR g_Price_Break_rec.price_break_low = FND_API.G_MISS_NUM
526 OR g_Price_Break_rec.program_application_id = FND_API.G_MISS_NUM
527 OR g_Price_Break_rec.program_id = FND_API.G_MISS_NUM
528 OR g_Price_Break_rec.program_update_date = FND_API.G_MISS_DATE
529 OR g_Price_Break_rec.request_id = FND_API.G_MISS_NUM
530 OR g_Price_Break_rec.start_date_active = FND_API.G_MISS_DATE
531 OR g_Price_Break_rec.unit_code = FND_API.G_MISS_CHAR
532 THEN
533
534 OE_Default_Price_Break.Attributes
535 ( p_Price_Break_rec => g_Price_Break_rec
536 , p_iteration => p_iteration + 1
537 , x_Price_Break_rec => x_Price_Break_rec
538 );
539
540 ELSE
541
542 -- Done defaulting attributes
543
544 x_Price_Break_rec := g_Price_Break_rec;
545
546 END IF;
547
548 END Attributes;
549
550 END OE_Default_Price_Break;