[Home] [Help]
PACKAGE BODY: APPS.OE_LINE_REPRICE
Source
1 PACKAGE BODY OE_LINE_REPRICE AS
2 /* $Header: OEXVREPB.pls 120.1.12020000.5 2013/01/23 09:54:55 kadiraju ship $ */
3
4 G_PKG_NAME CONSTANT VARCHAR2(30) := 'OE_Line_REPRICE';
5
6
7 PROCEDURE Reprice_Line
8 (
9 p_line_rec IN OE_Order_Pub.Line_Rec_Type
10 , p_Repricing_date IN VARCHAR2
11 , p_Repricing_event IN VARCHAR2
12 , p_Honor_Price_Flag IN VARCHAR2
13 , x_return_status OUT NOCOPY /* file.sql.39 change */ VARCHAR2
14 )
15 IS
16 CURSOR check_event_cur(p_repricing_event IN VARCHAR2) IS
17 SELECT qp.modifier_level_code
18 FROM qp_pricing_phases qp, qp_event_phases qe
19 WHERE qp.pricing_phase_id = qe.pricing_phase_id
20 AND qe.pricing_event_code = p_repricing_event;
21
22 l_control_rec OE_GLOBALS.Control_Rec_Type;
23 l_return_status VARCHAR2(1);
24 l_Price_Control_Rec QP_PREQ_GRP.control_record_type;
25 l_x_line_tbl OE_Order_Pub.Line_Tbl_Type;
26 l_line_rec OE_Order_Pub.Line_Rec_Type := p_line_rec;
27 l_line_tbl OE_Order_Pub.Line_Tbl_Type;
28 l_old_line_tbl OE_Order_Pub.Line_Tbl_Type;
29 l_price_flag VARCHAR2(1);
30
31 --
32 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
33 --
34 BEGIN
35
36 IF l_debug_level > 0 THEN
37 oe_debug_pub.add( 'ENTERING OE_LINE_REPRICE.REPRICE_LINE '|| TO_CHAR ( P_LINE_REC.LINE_ID ) , 1 ) ;
38 END IF;
39
40 x_return_status := FND_API.G_RET_STS_SUCCESS;
41 -- check if repricing event is LINE level event
42 FOR l_event_rec IN check_event_cur(p_repricing_event) LOOP
43 IF l_debug_level > 0 THEN
44 oe_debug_pub.add( 'EVENT LEVEL CODE IS: '||L_EVENT_REC.MODIFIER_LEVEL_CODE , 1 ) ;
45 END IF;
46 IF NVL(l_event_rec.modifier_level_code, 'ORDER') <> 'LINE' THEN
47 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
48 FND_MESSAGE.SET_NAME('ONT','ONT_REPRICE_INVALID_EVENT');
49 OE_MSG_PUB.Add;
50 oe_line_reprice.set_reprice_status('REPRICE_INVALID_SETUP', p_line_rec.line_id);
51 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
52 EXIT;
53 END IF;
54 END LOOP;
55
56 If (p_Repricing_Date = 'ACTUAL_SHIPMENT_DATE') THEN
57 l_line_rec.Pricing_Date := p_line_rec.Actual_Shipment_Date;
58 Elsif (p_Repricing_Date = 'SCHEDULE_SHIP_DATE') THEN
59 l_line_rec.Pricing_Date := p_line_rec.Schedule_Ship_Date;
60 Elsif (p_Repricing_Date = 'FULFILLMENT_DATE') THEN
61 l_line_rec.Pricing_Date := p_line_rec.fulfillment_date;
62 Elsif (p_Repricing_Date = 'PROMISE_DATE') THEN
63 l_line_rec.Pricing_Date := p_line_rec.Promise_Date;
64 Elsif (p_Repricing_Date = 'REQUEST_DATE') THEN
65 l_line_rec.Pricing_Date := p_line_rec.Request_Date;
66 Elsif (p_Repricing_Date = 'SYSDATE') THEN
67 l_line_rec.Pricing_Date := sysdate;
68 ELSE
69 -- No change to Pricing Date
70 NULL;
71 End If;
72
73 IF l_debug_level > 0 THEN
74 oe_debug_pub.add( 'REPRICING DATE IS: '||P_REPRICING_DATE , 1 ) ;
75 END IF;
76
77 IF l_line_rec.Pricing_Date IS NULL THEN
78 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
79 FND_MESSAGE.SET_NAME('ONT','ONT_REPRICE_INVALID_DATE');
80 oe_line_reprice.set_reprice_status('REPRICE_INVALID_SETUP', p_line_rec.line_id);
81 OE_MSG_PUB.Add;
82 return;
83 -- do not raise error, instead, exit out of Reprice activity.
84 -- RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
85 END IF;
86
87 l_Price_Control_Rec.pricing_event := p_Repricing_Event;
88 l_Price_Control_Rec.calculate_flag := QP_PREQ_GRP.G_SEARCH_N_CALCULATE;
89 l_Price_Control_Rec.Simulation_Flag := 'N';
90 l_line_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
91
92 l_x_line_tbl(1) := l_line_rec;
93
94 IF l_debug_level > 0 THEN
95 oe_debug_pub.add( 'REPRICING EVENT '||P_REPRICING_EVENT , 2 ) ;
96 oe_debug_pub.add( 'REPRICING DATE '||L_X_LINE_TBL ( 1 ) .PRICING_DATE , 2 ) ;
97 END IF;
98
99 oe_order_adj_pvt.Price_line(
100 X_Return_Status => l_Return_Status
101 ,p_Line_id => NULL
102 ,p_Request_Type_code=> 'ONT'
103 ,p_Control_rec => l_Price_Control_Rec
104 ,p_Write_To_Db => TRUE --- ?????????????
105 ,x_Line_Tbl => l_x_Line_Tbl
106 ,p_honor_price_flag => p_honor_price_flag);
107
108
109 IF l_return_status <> FND_API.G_RET_STS_SUCCESS then
110 oe_line_reprice.set_reprice_status('REPRICE_PRICING_ERROR', p_line_rec.line_id);
111 END IF;
112
113 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
114 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
115 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
116 RAISE FND_API.G_EXC_ERROR;
117 END IF;
118 -- sol_ord_er #16014165
119 IF NVL(l_x_line_tbl(1).service_bill_option_code,'FBOM') = 'FPOM' THEN
120 IF l_debug_level > 0 THEN
121 oe_debug_pub.add( 'Recalculating Service First Bill Amount' , 2 ) ;
122 oe_debug_pub.add( 'First Bill Amount Value Before Reprice = '
123 ||l_x_line_tbl(1).service_first_period_amount , 2 ) ;
124 END IF;
125 oe_delayed_requests_util.First_period_bill_amt (
126 p_header_id => '',
127 p_line_id => l_x_line_tbl(1).line_id,
128 x_return_status => l_return_status);
129 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
130 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
131 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
132 RAISE FND_API.G_EXC_ERROR;
133 END IF;
134 End IF;
135 -- sol_ord_er #16014165 end
136
137 x_return_status := l_return_status;
138
139 EXCEPTION
140 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
141 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
142
143 IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
144 THEN
145 OE_MSG_PUB.Add_Exc_Msg
146 ( G_PKG_NAME,
147 'Reprice_Line'
148 );
149 END IF;
150
151 WHEN FND_API.G_EXC_ERROR THEN
152 x_return_status := FND_API.G_RET_STS_ERROR;
153 WHEN OTHERS THEN
154 oe_line_reprice.set_reprice_status('REPRICE_UNEXPECTED_ERROR',p_line_rec.line_id);
155 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
156 OE_MSG_PUB.set_msg_context(
157 p_entity_code => 'LINE'
158 ,p_entity_id => l_line_rec.line_id
159 ,p_header_id => l_line_rec.header_id
160 ,p_line_id => l_line_rec.line_id
161 ,p_order_source_id => l_line_rec.order_source_id
162 ,p_orig_sys_document_ref => l_line_rec.orig_sys_document_ref
163 ,p_orig_sys_document_line_ref => l_line_rec.orig_sys_line_ref
164 ,p_orig_sys_shipment_ref => l_line_rec.orig_sys_shipment_ref
165 ,p_change_sequence => l_line_rec.change_sequence
166 ,p_source_document_type_id => l_line_rec.source_document_type_id
167 ,p_source_document_id => l_line_rec.source_document_id
168 ,p_source_document_line_id => l_line_rec.source_document_line_id );
169
170 IF l_debug_level > 0 THEN
171 oe_debug_pub.add( 'ERROR MESSAGE : '||SUBSTR ( SQLERRM , 1 , 200 ) , 1 ) ;
172 oe_debug_pub.add('In others of Reprice line');
173 END IF;
174
175 IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
176 THEN
177 OE_MSG_PUB.Add_Exc_Msg
178 ( G_PKG_NAME,
179 'Reprice_Line'
180 );
181 END IF;
182
183 END Reprice_Line;
184
185 /*
186 This procedure is to get the work flow activity attribute for a given
187 item type, item key, activity id and attribute name using work flow
188 engine API GetActivityAttrText.
189 */
190
191 PROCEDURE Get_Activity_Attribute
192 (
193 p_item_type IN VARCHAR2
194 , p_item_key IN VARCHAR2
195 , p_activity_id IN VARCHAR2
196 , p_Reprice_attr_name IN VARCHAR2
197 , x_attribute_value OUT NOCOPY /* file.sql.39 change */ VARCHAR2
198 , x_return_status OUT NOCOPY /* file.sql.39 change */ VARCHAR2
199 )
200 IS
201 l_errname VARCHAR2(30);
202 l_errmsg VARCHAR2(2000);
203 l_errstack VARCHAR2(2000);
204 --
205 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
206 --
207 l_header_id NUMBER;
208 l_orig_sys_line_ref VARCHAR2(50);
209 l_orig_sys_shipment_ref VARCHAR2(50);
210 l_order_source_id NUMBER;
211 l_orig_sys_document_ref VARCHAR2(50);
212 l_change_sequence VARCHAR2(50);
213 l_source_document_type_id NUMBER;
214 l_source_document_id NUMBER;
215 l_source_document_line_id NUMBER;
216 BEGIN
217 x_attribute_value := wf_engine.GetActivityAttrText(p_item_type,p_item_key,p_activity_id,p_Reprice_attr_name);
218
219 x_return_status := FND_API.G_RET_STS_SUCCESS;
220
221 EXCEPTION
222 WHEN OTHERS THEN
223 oe_line_reprice.set_reprice_status('REPRICE_UNEXPECTED_ERROR',to_number(p_item_key));
224 select header_id, order_source_id, orig_sys_document_ref,
225 orig_sys_line_ref, orig_sys_shipment_ref, change_sequence,
226 source_document_type_id,source_document_id,source_document_line_id
227 into l_header_id, l_order_source_id, l_orig_sys_document_ref,
228 l_orig_sys_line_ref, l_orig_sys_shipment_ref, l_change_sequence,
229 l_source_document_type_id, l_source_document_id, l_source_document_line_id
230 from oe_order_lines_all
231 where line_id = to_number(p_item_key);
232 OE_MSG_PUB.set_msg_context(
233 p_entity_code => 'LINE'
234 ,p_entity_id => to_number(p_item_key)
235 ,p_header_id => l_header_id
236 ,p_line_id => to_number(p_item_key)
237 ,p_order_source_id => l_order_source_id
238 ,p_orig_sys_document_ref => l_orig_sys_document_ref
239 ,p_orig_sys_document_line_ref => l_orig_sys_line_ref
240 ,p_orig_sys_shipment_ref => l_orig_sys_shipment_ref
241 ,p_change_sequence => l_change_sequence
242 ,p_source_document_type_id => l_source_document_type_id
243 ,p_source_document_id => l_source_document_id
244 ,p_source_document_line_id => l_source_document_line_id );
245
246 IF l_debug_level > 0 THEN
247 oe_debug_pub.add( 'WORK FLOW ERROR HAS OCCURED ' , 1 ) ;
248 END IF;
249 WF_CORE.Get_Error(l_errname, l_errmsg, l_errstack);
250 IF l_errname = 'WFENG_ACTIVITY_ATTR' THEN
251 IF l_debug_level > 0 THEN
252 oe_debug_pub.add( 'ERROR MESSAGE '||L_ERRMSG , 1 ) ;
253 END IF;
254 x_attribute_value := 'NONE';
255 x_return_status := FND_API.G_RET_STS_SUCCESS;
256 ELSE
257 IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
258 THEN
259 OE_MSG_PUB.Add_Exc_Msg
260 ( G_PKG_NAME
261 , 'Get_Activity_Attribute'
262 );
263 END IF;
264 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
265 END IF;
266
267 END Get_Activity_Attribute;
268
269 /*
270 This procedure is called when a line reaches Reprice_LINE work flow
271 activity. It gets the Repricing date and Repricing Event attribute
272 and calls reprice_line to reprice the line.
273 */
274
275 PROCEDURE Process_Repricing
276 (
277 p_api_version_number IN NUMBER
278 , p_line_id IN NUMBER
279 , p_activity_id IN NUMBER
280 , x_result_out OUT NOCOPY /* file.sql.39 change */ VARCHAR2
281 , x_return_status OUT NOCOPY /* file.sql.39 change */ VARCHAR2
282 , x_msg_count OUT NOCOPY /* file.sql.39 change */ VARCHAR2
283 , x_msg_data OUT NOCOPY /* file.sql.39 change */ VARCHAR2
284 )
285 IS
286
287 l_line_rec OE_Order_Pub.Line_Rec_Type;
288 l_return_status VARCHAR2(1);
289 l_item_key VARCHAR2(240);
290 l_Repricing_date_attr VARCHAR2(30):='REPRICE_DATE';
291 l_Repricing_date VARCHAR2(30);
292 l_Repricing_event_attr VARCHAR2(30):='REPRICE_EVENTS';
293 l_Repricing_event VARCHAR2(30);
294 l_Honor_Price_Flag_attr VARCHAR2(30):='HONOR_PRICE_FLAG';
295 l_Honor_Price_Flag VARCHAR2(30);
296 l_item_type VARCHAR2(8) := OE_GLOBALS.G_WFI_LIN;
297 --
298 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
299 --
300 --CC Reversal ER#16014135 Start
301 l_msg_count NUMBER := 0;
302 l_msg_data VARCHAR2(2000);
303 l_result_out VARCHAR2(30);
304 l_cc_rev_reauth_code VARCHAR2(30);
305 l_header_rec OE_Order_PUB.Header_Rec_Type;
306 --CC Reversal ER#16014135 End
307 BEGIN
308
309 IF l_debug_level > 0 THEN
310 oe_debug_pub.add( 'ENTERING OE_LINE_REPRICE.PROCESS_REPRICING '|| TO_CHAR ( P_LINE_ID ) , 1 ) ;
311 END IF;
312
313 x_result_out := 'COMPLETE';
314
315 OE_Line_Util.Query_Row(p_line_id => p_line_id,
316 x_line_rec => l_line_rec);
317
318 OE_MSG_PUB.set_msg_context(
319 p_entity_code => 'LINE'
320 ,p_entity_id => l_line_rec.line_id
321 ,p_header_id => l_line_rec.header_id
322 ,p_line_id => l_line_rec.line_id
323 ,p_order_source_id => l_line_rec.order_source_id
324 ,p_orig_sys_document_ref => l_line_rec.orig_sys_document_ref
325 ,p_orig_sys_document_line_ref => l_line_rec.orig_sys_line_ref
326 ,p_orig_sys_shipment_ref => l_line_rec.orig_sys_shipment_ref
327 ,p_change_sequence => l_line_rec.change_sequence
328 ,p_source_document_type_id => l_line_rec.source_document_type_id
329 ,p_source_document_id => l_line_rec.source_document_id
330 ,p_source_document_line_id => l_line_rec.source_document_line_id );
331
332
333 -- It is a non shippable line, complete the Reprice activity
334 -- with a result of complete:not_eligible.Fix for bug 2883913.
335
336 /*
337 Commented for bug 7592279 start
338 Removed the condition below to enable repricing of Non Shippable lines
339
340 IF nvl(l_line_rec.shippable_flag, 'N') <> 'Y' THEN
341 x_result_out := 'COMPLETE:NOT_ELIGIBLE';
342 oe_line_reprice.set_reprice_status('REPRICE_NOT_ELIGIBLE', p_line_id);
343 return;
344 END IF;
345 Commented for bug 7592279 end*/
346
347 IF l_debug_level > 0 THEN
348 oe_debug_pub.add( 'ACTIVTITY ID : '||TO_CHAR ( P_ACTIVITY_ID ) , 3 ) ;
349 END IF;
350 l_item_key := to_char(p_line_id);
351
352 IF l_debug_level > 0 THEN
353 oe_debug_pub.add( 'CALLING GET REPRICING ACTIVITY ' , 3 ) ;
354 END IF;
355
356 Get_Activity_Attribute
357 (
358 p_item_type => l_item_type,
359 p_item_key => l_item_key,
360 p_activity_id => p_activity_id,
361 p_Reprice_attr_name => l_Repricing_date_attr,
362 x_attribute_value => l_Repricing_date,
363 x_return_status => l_return_status
364 );
365
366 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
367 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
368 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
369 RAISE FND_API.G_EXC_ERROR;
370 END IF;
371
372 IF l_debug_level > 0 THEN
373 oe_debug_pub.add( 'REPRICING DATE : '|| L_REPRICING_DATE , 3 ) ;
374 oe_debug_pub.add( 'CALLING GET ATTRIBUTE - REPRICING EVENT ' , 3 ) ;
375 END IF;
376
377 Get_Activity_Attribute
378 (
379 p_item_type => l_item_type,
380 p_item_key => l_item_key,
381 p_activity_id => p_activity_id,
382 p_Reprice_attr_name => l_Repricing_Event_Attr,
383 x_attribute_value => l_Repricing_Event,
384 x_return_status => l_return_status
385 );
386
387 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
388 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
389 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
390 RAISE FND_API.G_EXC_ERROR;
391 END IF;
392
393 IF l_Repricing_Event IS NULL THEN
394 l_Repricing_Event := 'REPRICE_LINE';
395 End If;
396
397 IF l_debug_level > 0 THEN
398 oe_debug_pub.add( 'REPRICING EVENT : '|| L_REPRICING_EVENT , 3 ) ;
399 END IF;
400
401 Get_Activity_Attribute
402 (
403 p_item_type => l_item_type,
404 p_item_key => l_item_key,
405 p_activity_id => p_activity_id,
406 p_Reprice_attr_name => l_Honor_Price_Flag_attr,
407 x_attribute_value => l_Honor_Price_Flag,
408 x_return_status => l_return_status
409 );
410
411 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
412 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
413 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
414 RAISE FND_API.G_EXC_ERROR;
415 END IF;
416
417 IF l_Honor_Price_Flag IS NULL THEN
418 l_Honor_Price_Flag := 'Y';
419 End If;
420
421 IF l_debug_level > 0 THEN
422 oe_debug_pub.add( 'HONOR PRICE FLAG : '|| L_HONOR_PRICE_FLAG , 3 ) ;
423 END IF;
424
425 Reprice_Line
426 (
427 p_line_rec => l_line_rec,
428 p_Repricing_date => l_Repricing_date,
429 p_Repricing_event => l_Repricing_event,
430 p_Honor_Price_Flag => l_Honor_Price_Flag,
431 x_return_status => l_return_status
432 );
433
434 IF l_debug_level > 0 THEN
435 oe_debug_pub.add( 'RETURN STATUS FROM REPRICE LINE : '||L_RETURN_STATUS , 3 ) ;
436 END IF;
437
438 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
439 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
440 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
441 RAISE FND_API.G_EXC_ERROR;
442 END IF;
443
444 --CC Reversal ER#16014135 Start
445 IF l_debug_level > 0 THEN
446 OE_DEBUG_PUB.ADD('Checking credit card reversal/re-auth parameter',5);
447 END IF;
448 l_cc_rev_reauth_code:= OE_VERIFY_PAYMENT_PUB.Get_CC_Rev_Reauth_Code(l_line_rec.header_id);
449 IF l_cc_rev_reauth_code is not null and l_cc_rev_reauth_code IN ('REV_REAUTH_AT_REPRICE_FULFILL','REV_REAUTH','CC_HOLD') THEN
450 BEGIN
451 IF l_debug_level > 0 THEN
452 OE_DEBUG_PUB.ADD('Calling OE_Verify_Payment_PUB.Authorize_MultiPayments',5);
453 END IF;
454 OE_Header_UTIL.Query_Row
455 (p_header_id => l_line_rec.header_id
456 ,x_header_rec => l_header_rec
457 );
458 OE_Verify_Payment_PUB.Authorize_MultiPayments
459 ( p_header_rec => l_header_rec
460 , p_calling_action => 'REVERSAL_REAUTH'
461 , p_msg_count => l_msg_count
462 , p_msg_data => l_msg_data
463 , p_result_out => l_result_out
464 , p_return_status => l_return_status
465 );
466
467 IF l_debug_level > 0 THEN
468 oe_debug_pub.add('After call to Authorizat Payment return status : ' || l_return_status);
469 END IF;
470
471 IF l_return_status = FND_API.G_RET_STS_ERROR THEN
472 RAISE FND_API.G_EXC_ERROR;
473 ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
474 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
475 END IF;
476 END;
477 END IF;
478 --CC Reversal ER#16014135 End
479
480 IF l_debug_level > 0 THEN
481 oe_debug_pub.add( 'EXITING FROM OE_LINE_REPRICE.PROCESS_REPRICING : '||X_RETURN_STATUS , 1 ) ;
482 END IF;
483
484 EXCEPTION
485 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
486 IF l_debug_level > 0 THEN
487 oe_debug_pub.add( 'PROCESS_REPRICING : EXITING WITH UNEXPECTED ERROR'||SUBSTR ( SQLERRM , 1 , 200 ) , 1 ) ;
488 END IF;
489 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
490 x_result_out := 'INCOMPLETE';
491 /* IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
492 THEN
493 OE_MSG_PUB.Add_Exc_Msg
494 ( G_PKG_NAME,
495 'Process_Repricing'
496 );
497 END IF; */
498
499 WHEN FND_API.G_EXC_ERROR THEN
500 x_return_status := FND_API.G_RET_STS_ERROR;
501 x_result_out := 'INCOMPLETE';
502 WHEN OTHERS THEN
503 IF l_debug_level > 0 THEN
504 oe_debug_pub.add('In others of Process_Reprice ');
505 oe_debug_pub.add( 'PROCESS_REPRICING : EXITING WITH OTHERS ERROR' , 1 ) ;
506 oe_debug_pub.add( 'ERROR MESSAGE : '||SUBSTR ( SQLERRM , 1 , 200 ) , 1 ) ;
507 END IF;
508 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
509 x_result_out := 'INCOMPLETE';
510 oe_line_reprice.set_reprice_status('REPRICE_UNEXPECTED_ERROR', p_line_id);
511 IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
512 THEN
513 OE_MSG_PUB.Add_Exc_Msg
514 ( G_PKG_NAME
515 , 'Process_Repricing'
516 );
517 END IF;
518
519 -- Get message count and data
520
521 OE_MSG_PUB.Count_And_Get
522 ( p_count => x_msg_count
523 , p_data => x_msg_data
524 );
525
526 END Process_Repricing;
527
528 Procedure set_reprice_status (p_flow_status IN VARCHAR2,
529 p_line_id IN NUMBER)
530 IS
531
532 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
533
534 BEGIN
535
536 IF l_debug_level > 0 THEN
537 oe_debug_pub.add('Setting Flow Stauts code to '||p_flow_status || 'for line id ' ||p_line_id);
538 END IF;
539
540 IF oe_code_control.code_release_level>='110510' THEN
541 Update oe_order_lines_all
542 Set flow_status_code = p_flow_status
543 Where line_id = p_line_id;
544 End IF;
545
546 END set_reprice_status;
547
548 END OE_LINE_REPRICE;
549