76: p_QUOTE_SHAREE_ID => l_recip_id
77: ,p_party_id => p_party_id
78: ,p_cust_account_id => p_cust_account_id);
79: ELSE
80: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
81: IBE_UTIL.DEBUG('Not saving party and cust_account_id because account_ids do not match');
82: END IF;
83: IF FND_Msg_Pub.Check_Msg_Level (FND_Msg_Pub.G_MSG_LVL_ERROR) THEN
84: FND_Message.Set_Name('IBE', 'IBE_SC_ERR_USERACCESS');
77: ,p_party_id => p_party_id
78: ,p_cust_account_id => p_cust_account_id);
79: ELSE
80: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
81: IBE_UTIL.DEBUG('Not saving party and cust_account_id because account_ids do not match');
82: END IF;
83: IF FND_Msg_Pub.Check_Msg_Level (FND_Msg_Pub.G_MSG_LVL_ERROR) THEN
84: FND_Message.Set_Name('IBE', 'IBE_SC_ERR_USERACCESS');
85: FND_Msg_Pub.Add;
141: x_return_status := FND_API.G_RET_STS_SUCCESS;
142: -------------------------------------------------------------------------------------------------------------
143: --API Body start
144: -------------------------------------------------------------------------------------------------------------
145: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
146: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2: START');
147: IBE_UTIL.DEBUG('saveshare_control_rec.operation_code is '||p_saveshare_control_rec.operation_code);
148: END IF;
149:
142: -------------------------------------------------------------------------------------------------------------
143: --API Body start
144: -------------------------------------------------------------------------------------------------------------
145: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
146: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2: START');
147: IBE_UTIL.DEBUG('saveshare_control_rec.operation_code is '||p_saveshare_control_rec.operation_code);
148: END IF;
149:
150: Validate_share_Update(
143: --API Body start
144: -------------------------------------------------------------------------------------------------------------
145: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
146: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2: START');
147: IBE_UTIL.DEBUG('saveshare_control_rec.operation_code is '||p_saveshare_control_rec.operation_code);
148: END IF;
149:
150: Validate_share_Update(
151: p_api_version_number => 1.0
169:
170: --DBMS_OUTPUT.PUT_LINE('saveshare_control_rec.operation_code is '||p_saveshare_control_rec.operation_code);
171: IF ((p_saveshare_control_rec.operation_code = OP_NAME_CART)
172: OR (p_saveshare_control_rec.operation_code = OP_SAVE_CART_AND_RECIPIENTS)) THEN
173: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
174: IBE_UTIL.DEBUG('calling IBE_Quote_Save_pvt.SAVE to save the quote name');
175: END IF;
176: --DBMS_OUTPUT.PUT_LINE_LINE('calling IBE_Quote_Save_pvt.SAVE to save the quote name');
177: --DBMS_OUTPUT.PUT_LINE_LINE('incoming quote_name :'||P_Quote_header_rec.quote_name);
170: --DBMS_OUTPUT.PUT_LINE('saveshare_control_rec.operation_code is '||p_saveshare_control_rec.operation_code);
171: IF ((p_saveshare_control_rec.operation_code = OP_NAME_CART)
172: OR (p_saveshare_control_rec.operation_code = OP_SAVE_CART_AND_RECIPIENTS)) THEN
173: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
174: IBE_UTIL.DEBUG('calling IBE_Quote_Save_pvt.SAVE to save the quote name');
175: END IF;
176: --DBMS_OUTPUT.PUT_LINE_LINE('calling IBE_Quote_Save_pvt.SAVE to save the quote name');
177: --DBMS_OUTPUT.PUT_LINE_LINE('incoming quote_name :'||P_Quote_header_rec.quote_name);
178: --DBMS_OUTPUT.PUT_LINE_LINE('incoming quote_headeR_id :'||P_Quote_header_rec.quote_header_id);
200: END IF;
201:
202: IF ((p_saveshare_control_rec.operation_code = OP_SAVE_RECIPIENTS)
203: OR (p_saveshare_control_rec.operation_code = OP_SAVE_CART_AND_RECIPIENTS)) THEN
204: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
205: IBE_UTIL.DEBUG('Calling save_recipients to save recipient information');
206: END IF;
207: --DBMS_OUTPUT.PUT_LINE('Calling save_recipients to save recipient information ');
208: --dbms_output.put_line('Comments passed : '||p_notes);
201:
202: IF ((p_saveshare_control_rec.operation_code = OP_SAVE_RECIPIENTS)
203: OR (p_saveshare_control_rec.operation_code = OP_SAVE_CART_AND_RECIPIENTS)) THEN
204: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
205: IBE_UTIL.DEBUG('Calling save_recipients to save recipient information');
206: END IF;
207: --DBMS_OUTPUT.PUT_LINE('Calling save_recipients to save recipient information ');
208: --dbms_output.put_line('Comments passed : '||p_notes);
209: IF(nvl(p_quote_access_tbl.count,0) > 0) THEN
233: END IF;
234:
235:
236: IF(p_saveshare_control_rec.operation_code = OP_APPEND) THEN
237: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
238: IBE_UTIL.DEBUG('cALLING APPEND_QUOTE');
239: END IF;
240: IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE(
241: P_source_quote_header_id => P_source_quote_header_id,
234:
235:
236: IF(p_saveshare_control_rec.operation_code = OP_APPEND) THEN
237: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
238: IBE_UTIL.DEBUG('cALLING APPEND_QUOTE');
239: END IF;
240: IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE(
241: P_source_quote_header_id => P_source_quote_header_id,
242: P_source_last_update_date => P_source_last_update_date,
260: END IF;
261:
262:
263: ELSIF(p_saveshare_control_rec.operation_code = OP_ACTIVATE_QUOTE) THEN
264: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
265: IBE_UTIL.DEBUG('OPERATION_CODE IS: '||p_saveshare_control_rec.operation_code||'CALLING ACTIVATE_QUOTE');
266: END IF;
267: --DBMS_OUTPUT.PUT_LINE_LINE('OPERATION_CODE IS: '||p_saveshare_control_rec.operation_code||'CALLING ACTIVATE_QUOTE');
268: IBE_QUOTE_SAVESHARE_V2_PVT.ACTIVATE_QUOTE(
261:
262:
263: ELSIF(p_saveshare_control_rec.operation_code = OP_ACTIVATE_QUOTE) THEN
264: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
265: IBE_UTIL.DEBUG('OPERATION_CODE IS: '||p_saveshare_control_rec.operation_code||'CALLING ACTIVATE_QUOTE');
266: END IF;
267: --DBMS_OUTPUT.PUT_LINE_LINE('OPERATION_CODE IS: '||p_saveshare_control_rec.operation_code||'CALLING ACTIVATE_QUOTE');
268: IBE_QUOTE_SAVESHARE_V2_PVT.ACTIVATE_QUOTE(
269: P_Quote_header_rec => P_Quote_header_rec ,
285: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
286: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
287: END IF;
288: --DBMS_OUTPUT.PUT_LINE_LINE('Finished calling ACTIVATE_QUOTE ');
289: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
290: IBE_UTIL.DEBUG('Finished calling ACTIVATE_QUOTE');
291: END IF;
292:
293: ELSIF(p_saveshare_control_rec.operation_code = OP_END_WORKING) THEN
286: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
287: END IF;
288: --DBMS_OUTPUT.PUT_LINE_LINE('Finished calling ACTIVATE_QUOTE ');
289: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
290: IBE_UTIL.DEBUG('Finished calling ACTIVATE_QUOTE');
291: END IF;
292:
293: ELSIF(p_saveshare_control_rec.operation_code = OP_END_WORKING) THEN
294: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
290: IBE_UTIL.DEBUG('Finished calling ACTIVATE_QUOTE');
291: END IF;
292:
293: ELSIF(p_saveshare_control_rec.operation_code = OP_END_WORKING) THEN
294: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
295: IBE_UTIL.DEBUG(' Calling IBE_QUOTE_SAVE_SHARE_V2_PVT.END_WORKING');
296: END IF;
297: IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING(
298: P_Quote_access_tbl => p_quote_access_tbl ,
291: END IF;
292:
293: ELSIF(p_saveshare_control_rec.operation_code = OP_END_WORKING) THEN
294: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
295: IBE_UTIL.DEBUG(' Calling IBE_QUOTE_SAVE_SHARE_V2_PVT.END_WORKING');
296: END IF;
297: IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING(
298: P_Quote_access_tbl => p_quote_access_tbl ,
299: p_quote_header_id => p_quote_header_rec.quote_header_id,
316: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
317: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
318: END IF;
319:
320: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
321: IBE_UTIL.DEBUG('Done calling IBE_QUOTE_SAVE_SHARE_V2_PVT.END_WORKING');
322: END IF;
323:
324: ELSIF(p_saveshare_control_rec.operation_code = OP_STOP_SHARING) THEN
317: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
318: END IF;
319:
320: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
321: IBE_UTIL.DEBUG('Done calling IBE_QUOTE_SAVE_SHARE_V2_PVT.END_WORKING');
322: END IF;
323:
324: ELSIF(p_saveshare_control_rec.operation_code = OP_STOP_SHARING) THEN
325: IBE_QUOTE_SAVESHARE_V2_PVT.STOP_SHARING (
341: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
342: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
343: END IF;
344: END IF;--Check for p_saveshare_control_rec.operation_code
345: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
346: IBE_UTIL.DEBUG('P_saveshare_control_rec.deactivate_cart: '||P_saveshare_control_rec.deactivate_cart);
347: END IF;
348: IF ((P_saveshare_control_rec.deactivate_cart = FND_API.G_TRUE)
349: OR (p_saveshare_control_rec.operation_code = OP_DEACTIVATE)) THEN
342: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
343: END IF;
344: END IF;--Check for p_saveshare_control_rec.operation_code
345: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
346: IBE_UTIL.DEBUG('P_saveshare_control_rec.deactivate_cart: '||P_saveshare_control_rec.deactivate_cart);
347: END IF;
348: IF ((P_saveshare_control_rec.deactivate_cart = FND_API.G_TRUE)
349: OR (p_saveshare_control_rec.operation_code = OP_DEACTIVATE)) THEN
350:
347: END IF;
348: IF ((P_saveshare_control_rec.deactivate_cart = FND_API.G_TRUE)
349: OR (p_saveshare_control_rec.operation_code = OP_DEACTIVATE)) THEN
350:
351: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
352: IBE_UTIL.DEBUG('Calling deactivate API');
353: END IF;
354: --DBMS_OUTPUT.PUT_LINE_LINE('Calling deactivate API');
355: IBE_QUOTE_SAVESHARE_V2_PVT.DEACTIVATE_QUOTE (
348: IF ((P_saveshare_control_rec.deactivate_cart = FND_API.G_TRUE)
349: OR (p_saveshare_control_rec.operation_code = OP_DEACTIVATE)) THEN
350:
351: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
352: IBE_UTIL.DEBUG('Calling deactivate API');
353: END IF;
354: --DBMS_OUTPUT.PUT_LINE_LINE('Calling deactivate API');
355: IBE_QUOTE_SAVESHARE_V2_PVT.DEACTIVATE_QUOTE (
356: P_Quote_header_id => P_Quote_header_rec.quote_header_id ,
369:
370: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
371: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
372: END IF;
373: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
374: IBE_UTIL.DEBUG('Deactivate owner cart after sharing:Done');
375: END IF;
376: END IF; --op_code = name_cart with deactivate
377:
370: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
371: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
372: END IF;
373: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
374: IBE_UTIL.DEBUG('Deactivate owner cart after sharing:Done');
375: END IF;
376: END IF; --op_code = name_cart with deactivate
377:
378: IF (p_saveshare_control_rec.operation_code = OP_DELETE_CART) THEN
375: END IF;
376: END IF; --op_code = name_cart with deactivate
377:
378: IF (p_saveshare_control_rec.operation_code = OP_DELETE_CART) THEN
379: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
380: IBE_UTIL.DEBUG('Save_share_v2:Op_code in p_saveshare_control_rec.operation_code: '||p_saveshare_control_rec.operation_code);
381: IBE_UTIL.DEBUG('Save_share_v2:Ready to call IBE_QUOTE_SAVE_PVT.Delete on: '||P_Quote_header_rec.quote_header_id);
382: IBE_UTIL.DEBUG('save_share_v2:Expunge flag passed to delete_cart is: '||p_saveshare_control_rec.delete_source_cart);
383: IBE_UTIL.DEBUG('save_share_v2:P_Quote_header_rec.last_update_date: '||P_Quote_header_rec.last_update_date);
376: END IF; --op_code = name_cart with deactivate
377:
378: IF (p_saveshare_control_rec.operation_code = OP_DELETE_CART) THEN
379: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
380: IBE_UTIL.DEBUG('Save_share_v2:Op_code in p_saveshare_control_rec.operation_code: '||p_saveshare_control_rec.operation_code);
381: IBE_UTIL.DEBUG('Save_share_v2:Ready to call IBE_QUOTE_SAVE_PVT.Delete on: '||P_Quote_header_rec.quote_header_id);
382: IBE_UTIL.DEBUG('save_share_v2:Expunge flag passed to delete_cart is: '||p_saveshare_control_rec.delete_source_cart);
383: IBE_UTIL.DEBUG('save_share_v2:P_Quote_header_rec.last_update_date: '||P_Quote_header_rec.last_update_date);
384: END IF;
377:
378: IF (p_saveshare_control_rec.operation_code = OP_DELETE_CART) THEN
379: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
380: IBE_UTIL.DEBUG('Save_share_v2:Op_code in p_saveshare_control_rec.operation_code: '||p_saveshare_control_rec.operation_code);
381: IBE_UTIL.DEBUG('Save_share_v2:Ready to call IBE_QUOTE_SAVE_PVT.Delete on: '||P_Quote_header_rec.quote_header_id);
382: IBE_UTIL.DEBUG('save_share_v2:Expunge flag passed to delete_cart is: '||p_saveshare_control_rec.delete_source_cart);
383: IBE_UTIL.DEBUG('save_share_v2:P_Quote_header_rec.last_update_date: '||P_Quote_header_rec.last_update_date);
384: END IF;
385: --dbms_output.put_line('Save_share_v2:Op_code in p_saveshare_control_rec.operation_code: '||p_saveshare_control_rec.operation_code);
378: IF (p_saveshare_control_rec.operation_code = OP_DELETE_CART) THEN
379: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
380: IBE_UTIL.DEBUG('Save_share_v2:Op_code in p_saveshare_control_rec.operation_code: '||p_saveshare_control_rec.operation_code);
381: IBE_UTIL.DEBUG('Save_share_v2:Ready to call IBE_QUOTE_SAVE_PVT.Delete on: '||P_Quote_header_rec.quote_header_id);
382: IBE_UTIL.DEBUG('save_share_v2:Expunge flag passed to delete_cart is: '||p_saveshare_control_rec.delete_source_cart);
383: IBE_UTIL.DEBUG('save_share_v2:P_Quote_header_rec.last_update_date: '||P_Quote_header_rec.last_update_date);
384: END IF;
385: --dbms_output.put_line('Save_share_v2:Op_code in p_saveshare_control_rec.operation_code: '||p_saveshare_control_rec.operation_code);
386: --dbms_output.put_line('Save_share_v2:Ready to call IBE_QUOTE_SAVE_PVT.Delete on: '||P_Quote_header_rec.quote_header_id);
379: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
380: IBE_UTIL.DEBUG('Save_share_v2:Op_code in p_saveshare_control_rec.operation_code: '||p_saveshare_control_rec.operation_code);
381: IBE_UTIL.DEBUG('Save_share_v2:Ready to call IBE_QUOTE_SAVE_PVT.Delete on: '||P_Quote_header_rec.quote_header_id);
382: IBE_UTIL.DEBUG('save_share_v2:Expunge flag passed to delete_cart is: '||p_saveshare_control_rec.delete_source_cart);
383: IBE_UTIL.DEBUG('save_share_v2:P_Quote_header_rec.last_update_date: '||P_Quote_header_rec.last_update_date);
384: END IF;
385: --dbms_output.put_line('Save_share_v2:Op_code in p_saveshare_control_rec.operation_code: '||p_saveshare_control_rec.operation_code);
386: --dbms_output.put_line('Save_share_v2:Ready to call IBE_QUOTE_SAVE_PVT.Delete on: '||P_Quote_header_rec.quote_header_id);
387:
406:
407: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
408: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
409: END IF;
410: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
411: IBE_UTIL.DEBUG('Delete owner cart :Done');
412: END IF;
413: END IF; --op_code = OP_DELETE_CART
414:
407: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
408: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
409: END IF;
410: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
411: IBE_UTIL.DEBUG('Delete owner cart :Done');
412: END IF;
413: END IF; --op_code = OP_DELETE_CART
414:
415: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
411: IBE_UTIL.DEBUG('Delete owner cart :Done');
412: END IF;
413: END IF; --op_code = OP_DELETE_CART
414:
415: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
416: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2: END');
417: END IF;
418: EXCEPTION
419: WHEN FND_API.G_EXC_ERROR THEN
412: END IF;
413: END IF; --op_code = OP_DELETE_CART
414:
415: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
416: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2: END');
417: END IF;
418: EXCEPTION
419: WHEN FND_API.G_EXC_ERROR THEN
420: ROLLBACK TO SAVESHARE_V2;
421: x_return_status := FND_API.G_RET_STS_ERROR;
422: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
423: p_count => x_msg_count ,
424: p_data => x_msg_data);
425: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
426: IBE_Util.Debug('Expected Error in IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2()');
427: END IF;
428:
429: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
422: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
423: p_count => x_msg_count ,
424: p_data => x_msg_data);
425: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
426: IBE_Util.Debug('Expected Error in IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2()');
427: END IF;
428:
429: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
430: ROLLBACK TO SAVESHARE_V2;
431: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
432: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
433: p_count => x_msg_count ,
434: p_data => x_msg_data);
435: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
436: IBE_Util.Debug('Unexpected Error in IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2()');
437: END IF;
438:
439: WHEN OTHERS THEN
432: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
433: p_count => x_msg_count ,
434: p_data => x_msg_data);
435: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
436: IBE_Util.Debug('Unexpected Error in IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2()');
437: END IF;
438:
439: WHEN OTHERS THEN
440: ROLLBACK TO SAVESHARE_V2;
445: END IF;
446: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
447: p_count => x_msg_count ,
448: p_data => x_msg_data);
449: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
450: IBE_Util.Debug('Unknown error IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2()');
451: END IF;
452:
453:
446: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
447: p_count => x_msg_count ,
448: p_data => x_msg_data);
449: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
450: IBE_Util.Debug('Unknown error IBE_QUOTE_SAVESHARE_V2_PVT.save_share_v2()');
451: END IF;
452:
453:
454: END;
569: --API Body start
570: -------------------------------------------------------------------------------------------------------------
571:
572:
573: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
574: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.save_recipients: START');
575: END IF;
576: /*Obtain the party id of the user performing the action on the UI from the env*/
577: FOR rec_userenv_partyid in c_userenv_partyid LOOP
570: -------------------------------------------------------------------------------------------------------------
571:
572:
573: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
574: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.save_recipients: START');
575: END IF;
576: /*Obtain the party id of the user performing the action on the UI from the env*/
577: FOR rec_userenv_partyid in c_userenv_partyid LOOP
578: l_sharing_partyid := rec_userenv_partyid.customer_id;
595: and quote_hdr_id available in the input quote access record.
596: This query will tell us if there is already a recipiet record avialable to re-use.*/
597: --Old_access_level will be relevant only when the Op-code in P_Quote_access_tbl(counter) is UPDATE
598: --Old_access_level will be passed to notify_access_change API
599: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
600: IBE_UTIL.DEBUG('Incoming Quote_sharee_id = '||P_Quote_access_tbl(counter).quote_sharee_id);
601: IBE_UTIL.DEBUG('Incoming Quote_header_id = '||P_Quote_access_tbl(counter).quote_header_id);
602: IBE_UTIL.DEBUG('Incoming party_id = '||P_Quote_access_tbl(counter).party_id);
603: END IF;
596: This query will tell us if there is already a recipiet record avialable to re-use.*/
597: --Old_access_level will be relevant only when the Op-code in P_Quote_access_tbl(counter) is UPDATE
598: --Old_access_level will be passed to notify_access_change API
599: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
600: IBE_UTIL.DEBUG('Incoming Quote_sharee_id = '||P_Quote_access_tbl(counter).quote_sharee_id);
601: IBE_UTIL.DEBUG('Incoming Quote_header_id = '||P_Quote_access_tbl(counter).quote_header_id);
602: IBE_UTIL.DEBUG('Incoming party_id = '||P_Quote_access_tbl(counter).party_id);
603: END IF;
604:
597: --Old_access_level will be relevant only when the Op-code in P_Quote_access_tbl(counter) is UPDATE
598: --Old_access_level will be passed to notify_access_change API
599: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
600: IBE_UTIL.DEBUG('Incoming Quote_sharee_id = '||P_Quote_access_tbl(counter).quote_sharee_id);
601: IBE_UTIL.DEBUG('Incoming Quote_header_id = '||P_Quote_access_tbl(counter).quote_header_id);
602: IBE_UTIL.DEBUG('Incoming party_id = '||P_Quote_access_tbl(counter).party_id);
603: END IF;
604:
605: IF(((P_Quote_access_tbl(counter).quote_sharee_id is not null) and
598: --Old_access_level will be passed to notify_access_change API
599: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
600: IBE_UTIL.DEBUG('Incoming Quote_sharee_id = '||P_Quote_access_tbl(counter).quote_sharee_id);
601: IBE_UTIL.DEBUG('Incoming Quote_header_id = '||P_Quote_access_tbl(counter).quote_header_id);
602: IBE_UTIL.DEBUG('Incoming party_id = '||P_Quote_access_tbl(counter).party_id);
603: END IF;
604:
605: IF(((P_Quote_access_tbl(counter).quote_sharee_id is not null) and
606: (P_Quote_access_tbl(counter).quote_sharee_id <> FND_API.G_MISS_NUM))or
642: END IF;
643: EXIT WHEN c_recip_details%notfound;
644: END LOOP;
645: ELSE
646: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
647: IBE_UTIL.DEBUG('Cannot query recipient details ,recipient_id is null or g_miss');
648: IBE_UTIL.DEBUG('Saving recipients for first time?!');
649: END IF;
650: END IF; --if p_quote_access_tbl(counter).quote_sharee_id is not null and g_miss
643: EXIT WHEN c_recip_details%notfound;
644: END LOOP;
645: ELSE
646: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
647: IBE_UTIL.DEBUG('Cannot query recipient details ,recipient_id is null or g_miss');
648: IBE_UTIL.DEBUG('Saving recipients for first time?!');
649: END IF;
650: END IF; --if p_quote_access_tbl(counter).quote_sharee_id is not null and g_miss
651:
644: END LOOP;
645: ELSE
646: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
647: IBE_UTIL.DEBUG('Cannot query recipient details ,recipient_id is null or g_miss');
648: IBE_UTIL.DEBUG('Saving recipients for first time?!');
649: END IF;
650: END IF; --if p_quote_access_tbl(counter).quote_sharee_id is not null and g_miss
651:
652: /*Processing the recipients in the input access table according to the op-codes
653: corresponding to each recipient record*/
654: --Start with 'CREATE' op_code
655: IF( p_quote_access_tbl(counter).operation_code = 'CREATE') THEN
656:
657: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
658: IBE_UTIL.DEBUG('Operation code in quote_access_tbl is '||p_quote_access_tbl(counter).operation_code);
659: END IF;
660: /*Open this cursor to check if there are any inactive(end-dated) rows existing in sh_quote_access
661: for this party, cust and quote combination */
654: --Start with 'CREATE' op_code
655: IF( p_quote_access_tbl(counter).operation_code = 'CREATE') THEN
656:
657: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
658: IBE_UTIL.DEBUG('Operation code in quote_access_tbl is '||p_quote_access_tbl(counter).operation_code);
659: END IF;
660: /*Open this cursor to check if there are any inactive(end-dated) rows existing in sh_quote_access
661: for this party, cust and quote combination */
662: /*If there is an end-dated record present for the given combination of party, cust_account,
660: /*Open this cursor to check if there are any inactive(end-dated) rows existing in sh_quote_access
661: for this party, cust and quote combination */
662: /*If there is an end-dated record present for the given combination of party, cust_account,
663: quote_hdr in quote_access then use this record, else insert a new record*/
664: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
665: IBE_UTIL.DEBUG('Save_recipients: Opening c_get_created_recip');
666: IBE_UTIL.DEBUG('Save_recipients: FND_GLOBAL.USER_ID: '||FND_GLOBAL.USER_ID);
667: END IF;
668: l_quote_access_rec.quote_sharee_id := FND_API.G_MISS_NUM;
661: for this party, cust and quote combination */
662: /*If there is an end-dated record present for the given combination of party, cust_account,
663: quote_hdr in quote_access then use this record, else insert a new record*/
664: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
665: IBE_UTIL.DEBUG('Save_recipients: Opening c_get_created_recip');
666: IBE_UTIL.DEBUG('Save_recipients: FND_GLOBAL.USER_ID: '||FND_GLOBAL.USER_ID);
667: END IF;
668: l_quote_access_rec.quote_sharee_id := FND_API.G_MISS_NUM;
669: FOR rec_get_created_recip in c_get_created_recip(p_quote_access_tbl(counter).quote_header_id,
662: /*If there is an end-dated record present for the given combination of party, cust_account,
663: quote_hdr in quote_access then use this record, else insert a new record*/
664: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
665: IBE_UTIL.DEBUG('Save_recipients: Opening c_get_created_recip');
666: IBE_UTIL.DEBUG('Save_recipients: FND_GLOBAL.USER_ID: '||FND_GLOBAL.USER_ID);
667: END IF;
668: l_quote_access_rec.quote_sharee_id := FND_API.G_MISS_NUM;
669: FOR rec_get_created_recip in c_get_created_recip(p_quote_access_tbl(counter).quote_header_id,
670: p_quote_access_tbl(counter).party_id,
669: FOR rec_get_created_recip in c_get_created_recip(p_quote_access_tbl(counter).quote_header_id,
670: p_quote_access_tbl(counter).party_id,
671: FND_GLOBAL.USER_ID) LOOP
672: l_quote_access_rec.quote_sharee_id := rec_get_created_recip.quote_sharee_id;
673: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
674: IBE_UTIL.DEBUG('Save_recipients: rec_get_created_recip found quote_sharee_id: '||l_quote_access_rec.quote_sharee_id);
675: END IF;
676:
677: EXIT when c_get_created_recip%NOTFOUND;
670: p_quote_access_tbl(counter).party_id,
671: FND_GLOBAL.USER_ID) LOOP
672: l_quote_access_rec.quote_sharee_id := rec_get_created_recip.quote_sharee_id;
673: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
674: IBE_UTIL.DEBUG('Save_recipients: rec_get_created_recip found quote_sharee_id: '||l_quote_access_rec.quote_sharee_id);
675: END IF;
676:
677: EXIT when c_get_created_recip%NOTFOUND;
678: END LOOP;
677: EXIT when c_get_created_recip%NOTFOUND;
678: END LOOP;
679: IF (l_quote_access_rec.quote_sharee_id is not null AND
680: l_quote_access_rec.quote_sharee_id <> FND_API.G_MISS_NUM) THEN
681: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
682: IBE_UTIL.DEBUG('Record found for the recipient in quote_access table, need to update it');
683: END IF;
684:
685: IBE_SH_QUOTE_ACCESS_PKG.update_Row(
678: END LOOP;
679: IF (l_quote_access_rec.quote_sharee_id is not null AND
680: l_quote_access_rec.quote_sharee_id <> FND_API.G_MISS_NUM) THEN
681: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
682: IBE_UTIL.DEBUG('Record found for the recipient in quote_access table, need to update it');
683: END IF;
684:
685: IBE_SH_QUOTE_ACCESS_PKG.update_Row(
686: p_quote_sharee_id => l_quote_access_rec.quote_sharee_id
690: ,p_update_privilege_type_code => p_quote_access_tbl(counter).update_privilege_type_code
691: ,p_contact_point_id => p_quote_access_tbl(counter).contact_point_id
692: ,p_start_date_active => sysdate
693: ,p_end_date_active => null);
694: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
695: IBE_UTIL.DEBUG('Finsihed calling update handler of quote_access table');
696: END IF;
697: --Calling save_contact_point for the updated recipient record just in case the
698: --contact point has changed
691: ,p_contact_point_id => p_quote_access_tbl(counter).contact_point_id
692: ,p_start_date_active => sysdate
693: ,p_end_date_active => null);
694: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
695: IBE_UTIL.DEBUG('Finsihed calling update handler of quote_access table');
696: END IF;
697: --Calling save_contact_point for the updated recipient record just in case the
698: --contact point has changed
699: IF(p_quote_access_tbl(counter).contact_point_id is null and
701: l_call_save_contact_point := FND_API.G_TRUE;
702: END IF;
703:
704: ELSE --Need to create a new record
705: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
706: IBE_UTIL.DEBUG('Record not found for this recipient in quote_access table');
707: END IF;
708: --Obtain the recipient number here
709: select IBE_SH_QUOTE_ACCESS_s1.nextval into l_quote_recip_id
702: END IF;
703:
704: ELSE --Need to create a new record
705: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
706: IBE_UTIL.DEBUG('Record not found for this recipient in quote_access table');
707: END IF;
708: --Obtain the recipient number here
709: select IBE_SH_QUOTE_ACCESS_s1.nextval into l_quote_recip_id
710: from dual;
707: END IF;
708: --Obtain the recipient number here
709: select IBE_SH_QUOTE_ACCESS_s1.nextval into l_quote_recip_id
710: from dual;
711: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
712: IBE_UTIL.DEBUG('sharee id from the sequence is '||l_quote_recip_id );
713: END IF;
714:
715: IBE_QUOTE_SAVESHARE_pvt.GenerateShareeNumber(
708: --Obtain the recipient number here
709: select IBE_SH_QUOTE_ACCESS_s1.nextval into l_quote_recip_id
710: from dual;
711: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
712: IBE_UTIL.DEBUG('sharee id from the sequence is '||l_quote_recip_id );
713: END IF;
714:
715: IBE_QUOTE_SAVESHARE_pvt.GenerateShareeNumber(
716: p_quote_header_id => p_quote_header_id,
716: p_quote_header_id => p_quote_header_id,
717: p_recip_id => l_quote_recip_id,
718: x_sharee_number => l_quote_access_rec.quote_sharee_number);
719:
720: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
721: IBE_UTIL.DEBUG('sharee number is '||l_quote_access_rec.quote_sharee_number );
722: END IF;
723:
724: --Deal with saving the contact point here
717: p_recip_id => l_quote_recip_id,
718: x_sharee_number => l_quote_access_rec.quote_sharee_number);
719:
720: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
721: IBE_UTIL.DEBUG('sharee number is '||l_quote_access_rec.quote_sharee_number );
722: END IF;
723:
724: --Deal with saving the contact point here
725: /*A contact point is created when there is an input e-mail address and a null
727: IF (p_quote_access_tbl(counter).EMAIL_CONTACT_ADDRESS is not null
728: and p_quote_access_tbl(counter).EMAIL_CONTACT_ADDRESS <> fnd_api.g_miss_char
729: and (p_quote_access_tbl(counter).contact_point_id is null or
730: p_quote_access_tbl(counter).contact_point_id = FND_API.G_MISS_NUM)) THEN
731: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
732: IBE_UTIL.DEBUG('saving contact point for the current recipient record');
733: END IF;
734: l_call_save_contact_point := FND_API.G_TRUE;
735:
728: and p_quote_access_tbl(counter).EMAIL_CONTACT_ADDRESS <> fnd_api.g_miss_char
729: and (p_quote_access_tbl(counter).contact_point_id is null or
730: p_quote_access_tbl(counter).contact_point_id = FND_API.G_MISS_NUM)) THEN
731: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
732: IBE_UTIL.DEBUG('saving contact point for the current recipient record');
733: END IF;
734: l_call_save_contact_point := FND_API.G_TRUE;
735:
736: --This is the case when the incoming B2B record has a valid contact_point_id
735:
736: --This is the case when the incoming B2B record has a valid contact_point_id
737: ELSIF((p_quote_access_tbl(counter).contact_point_id is not null )
738: and (p_quote_access_tbl(counter).contact_point_id <> FND_API.G_MISS_NUM)) THEN
739: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
740: IBE_UTIL.DEBUG('Contact point Id found in the input quote access record');
741: END IF;
742: l_contact_point_id := p_quote_access_tbl(counter).contact_point_id;
743:
736: --This is the case when the incoming B2B record has a valid contact_point_id
737: ELSIF((p_quote_access_tbl(counter).contact_point_id is not null )
738: and (p_quote_access_tbl(counter).contact_point_id <> FND_API.G_MISS_NUM)) THEN
739: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
740: IBE_UTIL.DEBUG('Contact point Id found in the input quote access record');
741: END IF;
742: l_contact_point_id := p_quote_access_tbl(counter).contact_point_id;
743:
744: END IF;--save_contact_point
747: END IF;-- existing recip or new recip
748:
749: --Constructing the URL here
750: l_url := p_url||l_quote_access_rec.quote_sharee_number;
751: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
752: IBE_UTIL.DEBUG('URL of shared cart is: '||l_url);
753: END IF;
754:
755: --Saving the contact_point here
748:
749: --Constructing the URL here
750: l_url := p_url||l_quote_access_rec.quote_sharee_number;
751: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
752: IBE_UTIL.DEBUG('URL of shared cart is: '||l_url);
753: END IF;
754:
755: --Saving the contact_point here
756: IF l_call_save_contact_point = FND_API.G_TRUE THEN
771: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
772: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
773: END IF;
774:
775: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
776: IBE_UTIL.DEBUG('Done saving contact point: '||l_contact_point_id);
777: END IF;
778: l_quote_access_rec.contact_point_id := l_contact_point_id;
779:
772: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
773: END IF;
774:
775: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
776: IBE_UTIL.DEBUG('Done saving contact point: '||l_contact_point_id);
777: END IF;
778: l_quote_access_rec.contact_point_id := l_contact_point_id;
779:
780: END IF;-- l_call_save_contact_point
779:
780: END IF;-- l_call_save_contact_point
781:
782: IF (l_call_insert_handler = FND_API.G_TRUE) THEN
783: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
784: IBE_UTIL.DEBUG('calling ins handler ');
785: IBE_UTIL.DEBUG('p_quote_access_tbl(counter).recipient_name: '||p_quote_access_tbl(counter).recipient_name);
786: END IF;
787: IBE_SH_QUOTE_ACCESS_PKG.Insert_Row(
780: END IF;-- l_call_save_contact_point
781:
782: IF (l_call_insert_handler = FND_API.G_TRUE) THEN
783: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
784: IBE_UTIL.DEBUG('calling ins handler ');
785: IBE_UTIL.DEBUG('p_quote_access_tbl(counter).recipient_name: '||p_quote_access_tbl(counter).recipient_name);
786: END IF;
787: IBE_SH_QUOTE_ACCESS_PKG.Insert_Row(
788: p_quote_sharee_id => l_quote_recip_id,
781:
782: IF (l_call_insert_handler = FND_API.G_TRUE) THEN
783: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
784: IBE_UTIL.DEBUG('calling ins handler ');
785: IBE_UTIL.DEBUG('p_quote_access_tbl(counter).recipient_name: '||p_quote_access_tbl(counter).recipient_name);
786: END IF;
787: IBE_SH_QUOTE_ACCESS_PKG.Insert_Row(
788: p_quote_sharee_id => l_quote_recip_id,
789: p_quote_header_id => p_quote_header_id,
792: p_party_id => p_quote_access_tbl(counter).party_id,
793: p_cust_account_id => p_quote_access_tbl(counter).cust_account_id,
794: p_recipient_name => p_quote_access_tbl(counter).recipient_name,
795: p_contact_point_id => l_contact_point_id);
796: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
797: IBE_UTIL.DEBUG('finished inserting ');
798: END IF;
799: END IF;
800: l_quote_access_rec.quote_sharee_id := l_quote_recip_id;
793: p_cust_account_id => p_quote_access_tbl(counter).cust_account_id,
794: p_recipient_name => p_quote_access_tbl(counter).recipient_name,
795: p_contact_point_id => l_contact_point_id);
796: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
797: IBE_UTIL.DEBUG('finished inserting ');
798: END IF;
799: END IF;
800: l_quote_access_rec.quote_sharee_id := l_quote_recip_id;
801: --calling the new shared cart notification API here
825: --DBMS_OUTPUT.PUT_LINE('Done calling the new shared cart notification API ');
826:
827: ELSIF(p_quote_access_tbl(counter).operation_code = 'UPDATE') THEN
828:
829: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
830: IBE_UTIL.DEBUG('Operation code in quote_access_table is UPDATE');
831: END IF;
832: IF((l_quote_access_rec.update_privilege_type_code is not null) and
833: (l_quote_access_rec.update_privilege_type_code <> FND_API.G_MISS_CHAR) and
826:
827: ELSIF(p_quote_access_tbl(counter).operation_code = 'UPDATE') THEN
828:
829: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
830: IBE_UTIL.DEBUG('Operation code in quote_access_table is UPDATE');
831: END IF;
832: IF((l_quote_access_rec.update_privilege_type_code is not null) and
833: (l_quote_access_rec.update_privilege_type_code <> FND_API.G_MISS_CHAR) and
834: (l_old_access_level <> l_quote_access_rec.update_privilege_type_code)) then
831: END IF;
832: IF((l_quote_access_rec.update_privilege_type_code is not null) and
833: (l_quote_access_rec.update_privilege_type_code <> FND_API.G_MISS_CHAR) and
834: (l_old_access_level <> l_quote_access_rec.update_privilege_type_code)) then
835: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
836: IBE_UTIL.DEBUG('Calling IBE_SH_QUOTE_ACCESS_PKG.Update_Row to update the recip record');
837: IBE_UTIL.DEBUG('p_quote_access_tbl(counter).quote_sharee_id: '||p_quote_access_tbl(counter).quote_sharee_id);
838: END IF;
839:
832: IF((l_quote_access_rec.update_privilege_type_code is not null) and
833: (l_quote_access_rec.update_privilege_type_code <> FND_API.G_MISS_CHAR) and
834: (l_old_access_level <> l_quote_access_rec.update_privilege_type_code)) then
835: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
836: IBE_UTIL.DEBUG('Calling IBE_SH_QUOTE_ACCESS_PKG.Update_Row to update the recip record');
837: IBE_UTIL.DEBUG('p_quote_access_tbl(counter).quote_sharee_id: '||p_quote_access_tbl(counter).quote_sharee_id);
838: END IF;
839:
840: IBE_SH_QUOTE_ACCESS_PKG.Update_Row(
833: (l_quote_access_rec.update_privilege_type_code <> FND_API.G_MISS_CHAR) and
834: (l_old_access_level <> l_quote_access_rec.update_privilege_type_code)) then
835: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
836: IBE_UTIL.DEBUG('Calling IBE_SH_QUOTE_ACCESS_PKG.Update_Row to update the recip record');
837: IBE_UTIL.DEBUG('p_quote_access_tbl(counter).quote_sharee_id: '||p_quote_access_tbl(counter).quote_sharee_id);
838: END IF;
839:
840: IBE_SH_QUOTE_ACCESS_PKG.Update_Row(
841: p_QUOTE_HEADER_ID => p_quote_header_id,
841: p_QUOTE_HEADER_ID => p_quote_header_id,
842: p_quote_sharee_id => p_quote_access_tbl(counter).quote_sharee_id,
843: p_UPDATE_PRIVILEGE_TYPE_CODE => p_quote_access_tbl(counter).update_privilege_type_code);
844:
845: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
846: IBE_UTIL.DEBUG('Done IBE_SH_QUOTE_ACCESS_PKG.Update_Row ');
847: END IF;
848:
849: /*If access level is being downgraded to 'read-only' */
842: p_quote_sharee_id => p_quote_access_tbl(counter).quote_sharee_id,
843: p_UPDATE_PRIVILEGE_TYPE_CODE => p_quote_access_tbl(counter).update_privilege_type_code);
844:
845: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
846: IBE_UTIL.DEBUG('Done IBE_SH_QUOTE_ACCESS_PKG.Update_Row ');
847: END IF;
848:
849: /*If access level is being downgraded to 'read-only' */
850: IF(p_quote_access_tbl(counter).UPDATE_PRIVILEGE_TYPE_CODE = 'R') THEN
847: END IF;
848:
849: /*If access level is being downgraded to 'read-only' */
850: IF(p_quote_access_tbl(counter).UPDATE_PRIVILEGE_TYPE_CODE = 'R') THEN
851: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
852: IBE_UTIL.DEBUG('Update privilege type is downgraded to read-only');
853: END IF;
854: FOR rec_check_active_cart in c_check_active_cart(l_quote_access_rec.party_id ,
855: l_quote_access_rec.cust_account_id) loop
848:
849: /*If access level is being downgraded to 'read-only' */
850: IF(p_quote_access_tbl(counter).UPDATE_PRIVILEGE_TYPE_CODE = 'R') THEN
851: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
852: IBE_UTIL.DEBUG('Update privilege type is downgraded to read-only');
853: END IF;
854: FOR rec_check_active_cart in c_check_active_cart(l_quote_access_rec.party_id ,
855: l_quote_access_rec.cust_account_id) loop
856: l_quote_present := rec_check_active_cart.quote_header_id;
853: END IF;
854: FOR rec_check_active_cart in c_check_active_cart(l_quote_access_rec.party_id ,
855: l_quote_access_rec.cust_account_id) loop
856: l_quote_present := rec_check_active_cart.quote_header_id;
857: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
858: IBE_UTIL.DEBUG('Recipient has '||l_quote_present||'as active cart');
859: END IF;
860: IF((l_quote_present is not null) AND (p_quote_header_id = l_quote_present)) THEN
861: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
854: FOR rec_check_active_cart in c_check_active_cart(l_quote_access_rec.party_id ,
855: l_quote_access_rec.cust_account_id) loop
856: l_quote_present := rec_check_active_cart.quote_header_id;
857: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
858: IBE_UTIL.DEBUG('Recipient has '||l_quote_present||'as active cart');
859: END IF;
860: IF((l_quote_present is not null) AND (p_quote_header_id = l_quote_present)) THEN
861: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
862: IBE_UTIL.DEBUG('Recipient has '||l_quote_present||' shared cart as the active-cart , delete this while downgrading level');
857: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
858: IBE_UTIL.DEBUG('Recipient has '||l_quote_present||'as active cart');
859: END IF;
860: IF((l_quote_present is not null) AND (p_quote_header_id = l_quote_present)) THEN
861: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
862: IBE_UTIL.DEBUG('Recipient has '||l_quote_present||' shared cart as the active-cart , delete this while downgrading level');
863: END IF;
864: --if this recipient has this shared cart as the active cart , then need to delete this
865: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
858: IBE_UTIL.DEBUG('Recipient has '||l_quote_present||'as active cart');
859: END IF;
860: IF((l_quote_present is not null) AND (p_quote_header_id = l_quote_present)) THEN
861: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
862: IBE_UTIL.DEBUG('Recipient has '||l_quote_present||' shared cart as the active-cart , delete this while downgrading level');
863: END IF;
864: --if this recipient has this shared cart as the active cart , then need to delete this
865: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
866: IBE_UTIL.DEBUG('Calling delete handler of active_quotes_all table');
861: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
862: IBE_UTIL.DEBUG('Recipient has '||l_quote_present||' shared cart as the active-cart , delete this while downgrading level');
863: END IF;
864: --if this recipient has this shared cart as the active cart , then need to delete this
865: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
866: IBE_UTIL.DEBUG('Calling delete handler of active_quotes_all table');
867: END IF;
868:
869: IBE_ACTIVE_QUOTES_ALL_PKG.UPDATE_ROW(
862: IBE_UTIL.DEBUG('Recipient has '||l_quote_present||' shared cart as the active-cart , delete this while downgrading level');
863: END IF;
864: --if this recipient has this shared cart as the active cart , then need to delete this
865: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
866: IBE_UTIL.DEBUG('Calling delete handler of active_quotes_all table');
867: END IF;
868:
869: IBE_ACTIVE_QUOTES_ALL_PKG.UPDATE_ROW(
870: x_object_version_number => 1,
875: X_CURRENCY_CODE => null,
876: x_last_update_date => sysdate,
877: x_last_updated_by => fnd_global.user_id,
878: x_last_update_login => 1);
879: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
880: IBE_UTIL.DEBUG('Done calling Update handler of active_quotes_all table to erase the quote header id' );
881: END IF;
882: END IF;
883: EXIT WHEN c_check_active_cart%NOTFOUND;
876: x_last_update_date => sysdate,
877: x_last_updated_by => fnd_global.user_id,
878: x_last_update_login => 1);
879: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
880: IBE_UTIL.DEBUG('Done calling Update handler of active_quotes_all table to erase the quote header id' );
881: END IF;
882: END IF;
883: EXIT WHEN c_check_active_cart%NOTFOUND;
884: END LOOP; -- for c_check_active_cart
885: END IF; -- when privelege is read_only
886:
887: -- new access level is available in the quote access record
888: IF(p_quote_access_tbl(counter).notify_flag = FND_API.G_TRUE) THEN
889: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
890: IBE_UTIL.DEBUG('Save_recipients: Ready to call Notify_access_change' );
891: END IF;
892: --dbms_output.put_line('Save_recipients: Ready to call Notify_access_change ');
893: IBE_WORKFLOW_PVT.Notify_access_change(
886:
887: -- new access level is available in the quote access record
888: IF(p_quote_access_tbl(counter).notify_flag = FND_API.G_TRUE) THEN
889: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
890: IBE_UTIL.DEBUG('Save_recipients: Ready to call Notify_access_change' );
891: END IF;
892: --dbms_output.put_line('Save_recipients: Ready to call Notify_access_change ');
893: IBE_WORKFLOW_PVT.Notify_access_change(
894: p_api_version => p_api_version ,
911: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
912: END IF;
913: END IF; -- end if notify flag = true for notify access change email
914: ELSE
915: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
916: IBE_UTIL.DEBUG('Opcode was update but access level has not changed. Consider generic email');
917: IBE_UTIL.DEBUG('view_shared_cart: l_sharing_partyid : ' || l_sharing_partyid);
918: IBE_UTIL.DEBUG('view_shared_cart: l_owner_partyid : ' || l_owner_partyid);
919: IBE_UTIL.DEBUG('view_shared_cart: p_notes : ' || p_notes);
912: END IF;
913: END IF; -- end if notify flag = true for notify access change email
914: ELSE
915: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
916: IBE_UTIL.DEBUG('Opcode was update but access level has not changed. Consider generic email');
917: IBE_UTIL.DEBUG('view_shared_cart: l_sharing_partyid : ' || l_sharing_partyid);
918: IBE_UTIL.DEBUG('view_shared_cart: l_owner_partyid : ' || l_owner_partyid);
919: IBE_UTIL.DEBUG('view_shared_cart: p_notes : ' || p_notes);
920: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.qute_sharee_num: '||l_quote_access_rec.quote_sharee_number);
913: END IF; -- end if notify flag = true for notify access change email
914: ELSE
915: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
916: IBE_UTIL.DEBUG('Opcode was update but access level has not changed. Consider generic email');
917: IBE_UTIL.DEBUG('view_shared_cart: l_sharing_partyid : ' || l_sharing_partyid);
918: IBE_UTIL.DEBUG('view_shared_cart: l_owner_partyid : ' || l_owner_partyid);
919: IBE_UTIL.DEBUG('view_shared_cart: p_notes : ' || p_notes);
920: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.qute_sharee_num: '||l_quote_access_rec.quote_sharee_number);
921: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.party_id: '||l_quote_access_rec.party_id);
914: ELSE
915: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
916: IBE_UTIL.DEBUG('Opcode was update but access level has not changed. Consider generic email');
917: IBE_UTIL.DEBUG('view_shared_cart: l_sharing_partyid : ' || l_sharing_partyid);
918: IBE_UTIL.DEBUG('view_shared_cart: l_owner_partyid : ' || l_owner_partyid);
919: IBE_UTIL.DEBUG('view_shared_cart: p_notes : ' || p_notes);
920: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.qute_sharee_num: '||l_quote_access_rec.quote_sharee_number);
921: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.party_id: '||l_quote_access_rec.party_id);
922: END IF;
915: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
916: IBE_UTIL.DEBUG('Opcode was update but access level has not changed. Consider generic email');
917: IBE_UTIL.DEBUG('view_shared_cart: l_sharing_partyid : ' || l_sharing_partyid);
918: IBE_UTIL.DEBUG('view_shared_cart: l_owner_partyid : ' || l_owner_partyid);
919: IBE_UTIL.DEBUG('view_shared_cart: p_notes : ' || p_notes);
920: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.qute_sharee_num: '||l_quote_access_rec.quote_sharee_number);
921: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.party_id: '||l_quote_access_rec.party_id);
922: END IF;
923: IF ((p_quote_access_tbl(counter).notify_flag = FND_API.G_TRUE) AND
916: IBE_UTIL.DEBUG('Opcode was update but access level has not changed. Consider generic email');
917: IBE_UTIL.DEBUG('view_shared_cart: l_sharing_partyid : ' || l_sharing_partyid);
918: IBE_UTIL.DEBUG('view_shared_cart: l_owner_partyid : ' || l_owner_partyid);
919: IBE_UTIL.DEBUG('view_shared_cart: p_notes : ' || p_notes);
920: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.qute_sharee_num: '||l_quote_access_rec.quote_sharee_number);
921: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.party_id: '||l_quote_access_rec.party_id);
922: END IF;
923: IF ((p_quote_access_tbl(counter).notify_flag = FND_API.G_TRUE) AND
924: (nvl(l_quote_access_rec.party_id,-1) <> l_sharing_partyid)) THEN
917: IBE_UTIL.DEBUG('view_shared_cart: l_sharing_partyid : ' || l_sharing_partyid);
918: IBE_UTIL.DEBUG('view_shared_cart: l_owner_partyid : ' || l_owner_partyid);
919: IBE_UTIL.DEBUG('view_shared_cart: p_notes : ' || p_notes);
920: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.qute_sharee_num: '||l_quote_access_rec.quote_sharee_number);
921: IBE_UTIL.DEBUG('view_shared_cart: l_quote_access_rec.party_id: '||l_quote_access_rec.party_id);
922: END IF;
923: IF ((p_quote_access_tbl(counter).notify_flag = FND_API.G_TRUE) AND
924: (nvl(l_quote_access_rec.party_id,-1) <> l_sharing_partyid)) THEN
925: l_quote_access_rec.UPDATE_PRIVILEGE_TYPE_CODE := l_old_access_level;
922: END IF;
923: IF ((p_quote_access_tbl(counter).notify_flag = FND_API.G_TRUE) AND
924: (nvl(l_quote_access_rec.party_id,-1) <> l_sharing_partyid)) THEN
925: l_quote_access_rec.UPDATE_PRIVILEGE_TYPE_CODE := l_old_access_level;
926: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
927: IBE_UTIL.DEBUG('l_quote_access_rec.UPDATE_PRIVILEGE_TYPE_CODE '||l_quote_access_rec.UPDATE_PRIVILEGE_TYPE_CODE);
928: END IF;
929: IBE_WORKFLOW_PVT.Notify_view_shared_cart(
930: p_api_version => p_api_version ,
923: IF ((p_quote_access_tbl(counter).notify_flag = FND_API.G_TRUE) AND
924: (nvl(l_quote_access_rec.party_id,-1) <> l_sharing_partyid)) THEN
925: l_quote_access_rec.UPDATE_PRIVILEGE_TYPE_CODE := l_old_access_level;
926: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
927: IBE_UTIL.DEBUG('l_quote_access_rec.UPDATE_PRIVILEGE_TYPE_CODE '||l_quote_access_rec.UPDATE_PRIVILEGE_TYPE_CODE);
928: END IF;
929: IBE_WORKFLOW_PVT.Notify_view_shared_cart(
930: p_api_version => p_api_version ,
931: p_init_msg_list => p_init_msg_list ,
948: ELSIF(p_quote_access_tbl(counter).operation_code = 'DELETE') then
949: --ELSE --orig functionality was to default to delete, so we've got to keep it that way
950: --IF(p_quote_access_tbl(counter).operation_code = 'DELETE') THEN --OPERATION_CODE IS DELETE
951: --DBMS_OUTPUT.PUT_LINE('Operation code in save recip is delete: Caling delete_recipient');
952: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
953: IBE_UTIL.DEBUG('Operation code in save recip is delete');
954: IBE_UTIL.DEBUG('Calling delete_recipient');
955: IBE_UTIL.DEBUG('l_quote_access_rec.quote_sharee_id: '||l_quote_access_rec.quote_sharee_id);
956: END IF;
949: --ELSE --orig functionality was to default to delete, so we've got to keep it that way
950: --IF(p_quote_access_tbl(counter).operation_code = 'DELETE') THEN --OPERATION_CODE IS DELETE
951: --DBMS_OUTPUT.PUT_LINE('Operation code in save recip is delete: Caling delete_recipient');
952: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
953: IBE_UTIL.DEBUG('Operation code in save recip is delete');
954: IBE_UTIL.DEBUG('Calling delete_recipient');
955: IBE_UTIL.DEBUG('l_quote_access_rec.quote_sharee_id: '||l_quote_access_rec.quote_sharee_id);
956: END IF;
957:
950: --IF(p_quote_access_tbl(counter).operation_code = 'DELETE') THEN --OPERATION_CODE IS DELETE
951: --DBMS_OUTPUT.PUT_LINE('Operation code in save recip is delete: Caling delete_recipient');
952: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
953: IBE_UTIL.DEBUG('Operation code in save recip is delete');
954: IBE_UTIL.DEBUG('Calling delete_recipient');
955: IBE_UTIL.DEBUG('l_quote_access_rec.quote_sharee_id: '||l_quote_access_rec.quote_sharee_id);
956: END IF;
957:
958: IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT(
951: --DBMS_OUTPUT.PUT_LINE('Operation code in save recip is delete: Caling delete_recipient');
952: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
953: IBE_UTIL.DEBUG('Operation code in save recip is delete');
954: IBE_UTIL.DEBUG('Calling delete_recipient');
955: IBE_UTIL.DEBUG('l_quote_access_rec.quote_sharee_id: '||l_quote_access_rec.quote_sharee_id);
956: END IF;
957:
958: IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT(
959: P_Quote_access_rec => l_quote_access_rec ,
969: END IF;
970: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
971: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
972: END IF;
973: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
974: IBE_UTIL.DEBUG('Done calling delete_recipient');
975: END IF;
976: END IF ;--FOR OPERATION CODE
977: END LOOP; -- end loop over input table of recipients
970: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
971: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
972: END IF;
973: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
974: IBE_UTIL.DEBUG('Done calling delete_recipient');
975: END IF;
976: END IF ;--FOR OPERATION CODE
977: END LOOP; -- end loop over input table of recipients
978:
979: --To send a generic notification to the owner of the cart
980: l_quote_access_rec_owr.party_id := l_owner_partyid;
981: l_quote_access_rec_owr.quote_header_id := P_Quote_header_id;
982:
983: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
984: IBE_UTIL.DEBUG('l_sharing_partyid: '||l_sharing_partyid);
985: IBE_UTIL.DEBUG('l_owner_partyid: '||l_owner_partyid);
986: IBE_UTIL.DEBUG('l_owner_partyid: '||l_owner_accountid);
987: END IF;
980: l_quote_access_rec_owr.party_id := l_owner_partyid;
981: l_quote_access_rec_owr.quote_header_id := P_Quote_header_id;
982:
983: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
984: IBE_UTIL.DEBUG('l_sharing_partyid: '||l_sharing_partyid);
985: IBE_UTIL.DEBUG('l_owner_partyid: '||l_owner_partyid);
986: IBE_UTIL.DEBUG('l_owner_partyid: '||l_owner_accountid);
987: END IF;
988:
981: l_quote_access_rec_owr.quote_header_id := P_Quote_header_id;
982:
983: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
984: IBE_UTIL.DEBUG('l_sharing_partyid: '||l_sharing_partyid);
985: IBE_UTIL.DEBUG('l_owner_partyid: '||l_owner_partyid);
986: IBE_UTIL.DEBUG('l_owner_partyid: '||l_owner_accountid);
987: END IF;
988:
989: IF (l_sharing_partyid <> l_owner_partyid) THEN
982:
983: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
984: IBE_UTIL.DEBUG('l_sharing_partyid: '||l_sharing_partyid);
985: IBE_UTIL.DEBUG('l_owner_partyid: '||l_owner_partyid);
986: IBE_UTIL.DEBUG('l_owner_partyid: '||l_owner_accountid);
987: END IF;
988:
989: IF (l_sharing_partyid <> l_owner_partyid) THEN
990: -- for generic email to owner, we need to add some special parameters since we will not have a retrieval number
988:
989: IF (l_sharing_partyid <> l_owner_partyid) THEN
990: -- for generic email to owner, we need to add some special parameters since we will not have a retrieval number
991: l_url := p_url || '&opid=' || l_owner_partyid || '&oaid=' || l_owner_accountid;
992: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
993: IBE_UTIL.DEBUG('url for generic email to OWNER: '||l_url);
994: END IF;
995: IBE_WORKFLOW_PVT.Notify_view_shared_cart(
996: p_api_version => p_api_version
989: IF (l_sharing_partyid <> l_owner_partyid) THEN
990: -- for generic email to owner, we need to add some special parameters since we will not have a retrieval number
991: l_url := p_url || '&opid=' || l_owner_partyid || '&oaid=' || l_owner_accountid;
992: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
993: IBE_UTIL.DEBUG('url for generic email to OWNER: '||l_url);
994: END IF;
995: IBE_WORKFLOW_PVT.Notify_view_shared_cart(
996: p_api_version => p_api_version
997: ,p_init_msg_list => p_init_msg_list
1022: -- Standard call to get message count and if count is 1, get message info.
1023: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1024: p_count => x_msg_count ,
1025: p_data => x_msg_data);
1026: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1027: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.save_recipients: END');
1028: END IF;
1029:
1030: EXCEPTION
1023: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1024: p_count => x_msg_count ,
1025: p_data => x_msg_data);
1026: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1027: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.save_recipients: END');
1028: END IF;
1029:
1030: EXCEPTION
1031: WHEN FND_API.G_EXC_ERROR THEN
1033: x_return_status := FND_API.G_RET_STS_ERROR;
1034: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1035: p_count => x_msg_count ,
1036: p_data => x_msg_data);
1037: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1038: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.SAVE_RECIPIENTS()');
1039: END IF;
1040:
1041: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1034: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1035: p_count => x_msg_count ,
1036: p_data => x_msg_data);
1037: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1038: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.SAVE_RECIPIENTS()');
1039: END IF;
1040:
1041: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1042: ROLLBACK TO SAVERECIPIENTS_V2;
1043: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1044: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1045: p_count => x_msg_count ,
1046: p_data => x_msg_data);
1047: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1048: IBE_Util.Debug('Unxpected error in IBE_QUOTE_SAVESHARE_V2_PVT.SAVE_RECIPIENTS()');
1049: END IF;
1050:
1051: WHEN OTHERS THEN
1044: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1045: p_count => x_msg_count ,
1046: p_data => x_msg_data);
1047: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1048: IBE_Util.Debug('Unxpected error in IBE_QUOTE_SAVESHARE_V2_PVT.SAVE_RECIPIENTS()');
1049: END IF;
1050:
1051: WHEN OTHERS THEN
1052: ROLLBACK TO SAVERECIPIENTS_V2;
1057: END IF;
1058: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1059: p_count => x_msg_count ,
1060: p_data => x_msg_data);
1061: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1062: IBE_Util.Debug('Unknown exception IBE_QUOTE_SAVESHARE_V2_PVT.SAVE_RECIPIENTS()');
1063: END IF;
1064:
1065: END;
1058: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1059: p_count => x_msg_count ,
1060: p_data => x_msg_data);
1061: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1062: IBE_Util.Debug('Unknown exception IBE_QUOTE_SAVESHARE_V2_PVT.SAVE_RECIPIENTS()');
1063: END IF;
1064:
1065: END;
1066:
1128: BEGIN
1129:
1130: SAVEPOINT ACTIVATEQUOTE_V2;
1131: -- Standard call to check for call compatibility.
1132: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1133: IBE_UTIL.DEBUG('Activate_quote:Before caling the compatible_api_call API');
1134: END IF;
1135: IF NOT FND_API.Compatible_API_Call ( l_api_version,
1136: P_Api_Version,
1129:
1130: SAVEPOINT ACTIVATEQUOTE_V2;
1131: -- Standard call to check for call compatibility.
1132: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1133: IBE_UTIL.DEBUG('Activate_quote:Before caling the compatible_api_call API');
1134: END IF;
1135: IF NOT FND_API.Compatible_API_Call ( l_api_version,
1136: P_Api_Version,
1137: l_api_name,
1147: -- Initialize API return status to success
1148: x_return_status := FND_API.G_RET_STS_SUCCESS;
1149:
1150:
1151: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1152: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: START');
1153: IBE_UTIL.DEBUG('p_party_id : '||p_party_id);
1154: IBE_UTIL.DEBUG('p_cust_account_id: '||p_cust_account_id);
1155: IBE_UTIL.DEBUG('p_retrieval_number: '||p_retrieval_number);
1148: x_return_status := FND_API.G_RET_STS_SUCCESS;
1149:
1150:
1151: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1152: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: START');
1153: IBE_UTIL.DEBUG('p_party_id : '||p_party_id);
1154: IBE_UTIL.DEBUG('p_cust_account_id: '||p_cust_account_id);
1155: IBE_UTIL.DEBUG('p_retrieval_number: '||p_retrieval_number);
1156: IBE_UTIL.DEBUG('p_quote_header_id: '||p_quote_header_rec.quote_header_id);
1149:
1150:
1151: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1152: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: START');
1153: IBE_UTIL.DEBUG('p_party_id : '||p_party_id);
1154: IBE_UTIL.DEBUG('p_cust_account_id: '||p_cust_account_id);
1155: IBE_UTIL.DEBUG('p_retrieval_number: '||p_retrieval_number);
1156: IBE_UTIL.DEBUG('p_quote_header_id: '||p_quote_header_rec.quote_header_id);
1157: END IF;
1150:
1151: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1152: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: START');
1153: IBE_UTIL.DEBUG('p_party_id : '||p_party_id);
1154: IBE_UTIL.DEBUG('p_cust_account_id: '||p_cust_account_id);
1155: IBE_UTIL.DEBUG('p_retrieval_number: '||p_retrieval_number);
1156: IBE_UTIL.DEBUG('p_quote_header_id: '||p_quote_header_rec.quote_header_id);
1157: END IF;
1158: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: START');
1151: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1152: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: START');
1153: IBE_UTIL.DEBUG('p_party_id : '||p_party_id);
1154: IBE_UTIL.DEBUG('p_cust_account_id: '||p_cust_account_id);
1155: IBE_UTIL.DEBUG('p_retrieval_number: '||p_retrieval_number);
1156: IBE_UTIL.DEBUG('p_quote_header_id: '||p_quote_header_rec.quote_header_id);
1157: END IF;
1158: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: START');
1159: FOR rec_check_guest_oneclk in c_check_guest_oneclk(p_quote_header_rec.quote_header_id) LOOP
1152: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: START');
1153: IBE_UTIL.DEBUG('p_party_id : '||p_party_id);
1154: IBE_UTIL.DEBUG('p_cust_account_id: '||p_cust_account_id);
1155: IBE_UTIL.DEBUG('p_retrieval_number: '||p_retrieval_number);
1156: IBE_UTIL.DEBUG('p_quote_header_id: '||p_quote_header_rec.quote_header_id);
1157: END IF;
1158: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: START');
1159: FOR rec_check_guest_oneclk in c_check_guest_oneclk(p_quote_header_rec.quote_header_id) LOOP
1160: l_cart_type := rec_check_guest_oneclk.quote_source_code;
1184: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1185: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1186: END IF;
1187: --DBMS_OUTPUT.PUT_LINE('Opening the cursor to check active cart present in active carts table');
1188: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1189: IBE_UTIL.DEBUG('Opening the cursor to check active cart present in active carts table');
1190: END IF;
1191: /*c_check_ac_aqa will query to check if p_party_id already has an active cart in active_quotes table
1192: If yes then update the quote_header_id of this record to p_quote_header_rec.quote_header_id(new active_cart hdr_id)
1185: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1186: END IF;
1187: --DBMS_OUTPUT.PUT_LINE('Opening the cursor to check active cart present in active carts table');
1188: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1189: IBE_UTIL.DEBUG('Opening the cursor to check active cart present in active carts table');
1190: END IF;
1191: /*c_check_ac_aqa will query to check if p_party_id already has an active cart in active_quotes table
1192: If yes then update the quote_header_id of this record to p_quote_header_rec.quote_header_id(new active_cart hdr_id)
1193: else insert a record into the active_quotes table*/
1201:
1202: IF (l_ac_present is not null) THEN
1203: --There already an active cart for p_party_id in active_quotes_table
1204: --DBMS_OUTPUT.PUT_LINE('active cart present in active carts table for: '||l_quote_header_rec.quote_header_id);
1205: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1206: IBE_UTIL.DEBUG('active cart present in active carts table l_ac_present: '||l_ac_present);
1207: END IF;
1208:
1209: IF(FND_API.G_TRUE=IBE_QUOTE_MISC_PVT.is_quote_usable(l_ac_present,p_party_id,p_cust_account_id)) THEN
1202: IF (l_ac_present is not null) THEN
1203: --There already an active cart for p_party_id in active_quotes_table
1204: --DBMS_OUTPUT.PUT_LINE('active cart present in active carts table for: '||l_quote_header_rec.quote_header_id);
1205: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1206: IBE_UTIL.DEBUG('active cart present in active carts table l_ac_present: '||l_ac_present);
1207: END IF;
1208:
1209: IF(FND_API.G_TRUE=IBE_QUOTE_MISC_PVT.is_quote_usable(l_ac_present,p_party_id,p_cust_account_id)) THEN
1210: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1206: IBE_UTIL.DEBUG('active cart present in active carts table l_ac_present: '||l_ac_present);
1207: END IF;
1208:
1209: IF(FND_API.G_TRUE=IBE_QUOTE_MISC_PVT.is_quote_usable(l_ac_present,p_party_id,p_cust_account_id)) THEN
1210: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1211: IBE_UTIL.DEBUG('current active cart is still validate.');
1212: IBE_UTIL.DEBUG('checking if it is a unnamed cart.');
1213: END IF;
1214: for rec_check_ac_qh in c_check_ac_qh(l_ac_present) loop
1207: END IF;
1208:
1209: IF(FND_API.G_TRUE=IBE_QUOTE_MISC_PVT.is_quote_usable(l_ac_present,p_party_id,p_cust_account_id)) THEN
1210: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1211: IBE_UTIL.DEBUG('current active cart is still validate.');
1212: IBE_UTIL.DEBUG('checking if it is a unnamed cart.');
1213: END IF;
1214: for rec_check_ac_qh in c_check_ac_qh(l_ac_present) loop
1215: --Openin this cursor to check if the active cart name is IBEUNNAMED
1208:
1209: IF(FND_API.G_TRUE=IBE_QUOTE_MISC_PVT.is_quote_usable(l_ac_present,p_party_id,p_cust_account_id)) THEN
1210: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1211: IBE_UTIL.DEBUG('current active cart is still validate.');
1212: IBE_UTIL.DEBUG('checking if it is a unnamed cart.');
1213: END IF;
1214: for rec_check_ac_qh in c_check_ac_qh(l_ac_present) loop
1215: --Openin this cursor to check if the active cart name is IBEUNNAMED
1216: --DBMS_OUTPUT.PUT_LINE('Opened cursor c_check_ac_qh ');
1217: l_qhac_present := rec_check_ac_qh.quote_header_id;
1218: l_qhac_quote_name := rec_check_ac_qh.quote_name;
1219: exit when c_check_ac_qh%notfound;
1220:
1221: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1222: IBE_UTIL.DEBUG('l_qhac_present: '||l_qhac_present);
1223: IBE_UTIL.DEBUG('l_qhac_quote_name: '||l_qhac_quote_name);
1224: END IF;
1225:
1218: l_qhac_quote_name := rec_check_ac_qh.quote_name;
1219: exit when c_check_ac_qh%notfound;
1220:
1221: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1222: IBE_UTIL.DEBUG('l_qhac_present: '||l_qhac_present);
1223: IBE_UTIL.DEBUG('l_qhac_quote_name: '||l_qhac_quote_name);
1224: END IF;
1225:
1226: end loop;
1219: exit when c_check_ac_qh%notfound;
1220:
1221: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1222: IBE_UTIL.DEBUG('l_qhac_present: '||l_qhac_present);
1223: IBE_UTIL.DEBUG('l_qhac_quote_name: '||l_qhac_quote_name);
1224: END IF;
1225:
1226: end loop;
1227: --DBMS_OUTPUT.PUT_LINE('after end loop of c_check_ac_qh ');
1232: l_quote_header_rec.quote_header_id := l_qhac_present;
1233: l_quote_header_rec.quote_name := 'IBE_PRMT_SC_DEFAULTNAMED';
1234: --reasons for calling save here
1235: --to save the IBEUNNAMED cart to IBEDEFAULTNAMED
1236: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1237: IBE_UTIL.DEBUG('Unnamed cart found for: '||l_quote_header_rec.quote_header_id);
1238: IBE_UTIL.DEBUG('renaming it to IBEDEFAULTNAMED...');
1239: END IF;
1240: IBE_Quote_Save_pvt.save(
1233: l_quote_header_rec.quote_name := 'IBE_PRMT_SC_DEFAULTNAMED';
1234: --reasons for calling save here
1235: --to save the IBEUNNAMED cart to IBEDEFAULTNAMED
1236: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1237: IBE_UTIL.DEBUG('Unnamed cart found for: '||l_quote_header_rec.quote_header_id);
1238: IBE_UTIL.DEBUG('renaming it to IBEDEFAULTNAMED...');
1239: END IF;
1240: IBE_Quote_Save_pvt.save(
1241: p_api_version_number => p_api_version ,
1234: --reasons for calling save here
1235: --to save the IBEUNNAMED cart to IBEDEFAULTNAMED
1236: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1237: IBE_UTIL.DEBUG('Unnamed cart found for: '||l_quote_header_rec.quote_header_id);
1238: IBE_UTIL.DEBUG('renaming it to IBEDEFAULTNAMED...');
1239: END IF;
1240: IBE_Quote_Save_pvt.save(
1241: p_api_version_number => p_api_version ,
1242: p_init_msg_list => fnd_api.g_false ,
1250: x_return_status => x_return_status ,
1251: x_msg_count => x_msg_count ,
1252: x_msg_data => x_msg_data);
1253: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
1254: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1255: IBE_UTIL.DEBUG('failed to rename the cart.');
1256: END IF;
1257: RAISE FND_API.G_EXC_ERROR;
1258: END IF;
1251: x_msg_count => x_msg_count ,
1252: x_msg_data => x_msg_data);
1253: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
1254: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1255: IBE_UTIL.DEBUG('failed to rename the cart.');
1256: END IF;
1257: RAISE FND_API.G_EXC_ERROR;
1258: END IF;
1259:
1257: RAISE FND_API.G_EXC_ERROR;
1258: END IF;
1259:
1260: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1261: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1262: IBE_UTIL.DEBUG('failed to rename the cart, unexpected error.');
1263: END IF;
1264: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1265: END IF;
1258: END IF;
1259:
1260: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1261: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1262: IBE_UTIL.DEBUG('failed to rename the cart, unexpected error.');
1263: END IF;
1264: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1265: END IF;
1266:
1265: END IF;
1266:
1267: END IF;--l_qhac_quote_name = 'IBEUNNAMED'
1268: ELSE
1269: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1270: IBE_UTIL.DEBUG('invalid or expired active cart ignored.');
1271: END IF;
1272: END IF; -- end of is_quote_usable
1273: END IF; --l_ac_present
1266:
1267: END IF;--l_qhac_quote_name = 'IBEUNNAMED'
1268: ELSE
1269: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1270: IBE_UTIL.DEBUG('invalid or expired active cart ignored.');
1271: END IF;
1272: END IF; -- end of is_quote_usable
1273: END IF; --l_ac_present
1274:
1272: END IF; -- end of is_quote_usable
1273: END IF; --l_ac_present
1274:
1275: IF (l_ac_party_id is not null) THEN
1276: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1277: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote:User already has a row in active_quotes table');
1278: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote:Calling update row hdlr');
1279: END IF;
1280: --DBMS_OUTPUT.PUT_LINE('Calling update row handler for active carts');
1273: END IF; --l_ac_present
1274:
1275: IF (l_ac_party_id is not null) THEN
1276: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1277: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote:User already has a row in active_quotes table');
1278: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote:Calling update row hdlr');
1279: END IF;
1280: --DBMS_OUTPUT.PUT_LINE('Calling update row handler for active carts');
1281:
1274:
1275: IF (l_ac_party_id is not null) THEN
1276: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1277: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote:User already has a row in active_quotes table');
1278: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote:Calling update row hdlr');
1279: END IF;
1280: --DBMS_OUTPUT.PUT_LINE('Calling update row handler for active carts');
1281:
1282: IBE_ACTIVE_QUOTES_ALL_PKG.update_row(
1293: ELSE
1294:
1295: --no previous active carts present for p_party_id hence inserting a new record
1296: --DBMS_OUTPUT.PUT_LINE('no active carts present for p_party_id hence inserting a new record');
1297: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1298: IBE_UTIL.DEBUG('no active carts present for p_party_id hence inserting a new record');
1299: IBE_UTIL.DEBUG('Quote header id of new active active cart is: '||p_quote_header_rec.quote_header_id);
1300: END IF;
1301: IBE_ACTIVE_QUOTES_ALL_PKG.Insert_row(
1294:
1295: --no previous active carts present for p_party_id hence inserting a new record
1296: --DBMS_OUTPUT.PUT_LINE('no active carts present for p_party_id hence inserting a new record');
1297: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1298: IBE_UTIL.DEBUG('no active carts present for p_party_id hence inserting a new record');
1299: IBE_UTIL.DEBUG('Quote header id of new active active cart is: '||p_quote_header_rec.quote_header_id);
1300: END IF;
1301: IBE_ACTIVE_QUOTES_ALL_PKG.Insert_row(
1302: X_OBJECT_VERSION_NUMBER => 1,
1295: --no previous active carts present for p_party_id hence inserting a new record
1296: --DBMS_OUTPUT.PUT_LINE('no active carts present for p_party_id hence inserting a new record');
1297: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1298: IBE_UTIL.DEBUG('no active carts present for p_party_id hence inserting a new record');
1299: IBE_UTIL.DEBUG('Quote header id of new active active cart is: '||p_quote_header_rec.quote_header_id);
1300: END IF;
1301: IBE_ACTIVE_QUOTES_ALL_PKG.Insert_row(
1302: X_OBJECT_VERSION_NUMBER => 1,
1303: X_QUOTE_HEADER_ID => p_quote_header_rec.quote_header_id,
1319: (P_control_rec.CALCULATE_TAX_FLAG <> FND_API.G_MISS_CHAR) or
1320: (P_control_rec.CALCULATE_FREIGHT_CHARGE_FLAG <> FND_API.G_MISS_CHAR))
1321: then
1322: --1. re-price cart based on the state of control_rec
1323: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1324: IBE_UTIL.DEBUG('Calling SAVE');
1325: IBE_UTIL.DEBUG('reprice cart based on the state of control_rec');
1326: END IF;
1327: if (p_retrieval_number <> FND_API.G_MISS_NUM) then
1320: (P_control_rec.CALCULATE_FREIGHT_CHARGE_FLAG <> FND_API.G_MISS_CHAR))
1321: then
1322: --1. re-price cart based on the state of control_rec
1323: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1324: IBE_UTIL.DEBUG('Calling SAVE');
1325: IBE_UTIL.DEBUG('reprice cart based on the state of control_rec');
1326: END IF;
1327: if (p_retrieval_number <> FND_API.G_MISS_NUM) then
1328: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1321: then
1322: --1. re-price cart based on the state of control_rec
1323: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1324: IBE_UTIL.DEBUG('Calling SAVE');
1325: IBE_UTIL.DEBUG('reprice cart based on the state of control_rec');
1326: END IF;
1327: if (p_retrieval_number <> FND_API.G_MISS_NUM) then
1328: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1329: IBE_UTIL.DEBUG('repricing as recipient; retrieval num: ' || p_retrieval_number);
1324: IBE_UTIL.DEBUG('Calling SAVE');
1325: IBE_UTIL.DEBUG('reprice cart based on the state of control_rec');
1326: END IF;
1327: if (p_retrieval_number <> FND_API.G_MISS_NUM) then
1328: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1329: IBE_UTIL.DEBUG('repricing as recipient; retrieval num: ' || p_retrieval_number);
1330: END IF;
1331:
1332: l_sharee_number := p_retrieval_number;
1325: IBE_UTIL.DEBUG('reprice cart based on the state of control_rec');
1326: END IF;
1327: if (p_retrieval_number <> FND_API.G_MISS_NUM) then
1328: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1329: IBE_UTIL.DEBUG('repricing as recipient; retrieval num: ' || p_retrieval_number);
1330: END IF;
1331:
1332: l_sharee_number := p_retrieval_number;
1333: l_sharee_party_id := p_party_id;
1359: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1360: END IF;
1361: end if;
1362: ELSE
1363: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1364: IBE_UTIL.DEBUG('Cannot activate a '||nvl(l_cart_type,'Invalid ')||' Cart');
1365: END IF;
1366: --DBMS_OUTPUT.PUT_LINE('Cannot activate a '||nvl(l_cart_type,'Invalid ')||' Cart');
1367:
1360: END IF;
1361: end if;
1362: ELSE
1363: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1364: IBE_UTIL.DEBUG('Cannot activate a '||nvl(l_cart_type,'Invalid ')||' Cart');
1365: END IF;
1366: --DBMS_OUTPUT.PUT_LINE('Cannot activate a '||nvl(l_cart_type,'Invalid ')||' Cart');
1367:
1368: END IF; --qute source code check
1365: END IF;
1366: --DBMS_OUTPUT.PUT_LINE('Cannot activate a '||nvl(l_cart_type,'Invalid ')||' Cart');
1367:
1368: END IF; --qute source code check
1369: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1370: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: END');
1371: END IF;
1372:
1373: EXCEPTION
1366: --DBMS_OUTPUT.PUT_LINE('Cannot activate a '||nvl(l_cart_type,'Invalid ')||' Cart');
1367:
1368: END IF; --qute source code check
1369: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1370: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote: END');
1371: END IF;
1372:
1373: EXCEPTION
1374: WHEN FND_API.G_EXC_ERROR THEN
1376: x_return_status := FND_API.G_RET_STS_ERROR;
1377: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1378: p_count => x_msg_count ,
1379: p_data => x_msg_data);
1380: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1381: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote()');
1382: END IF;
1383:
1384: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1377: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1378: p_count => x_msg_count ,
1379: p_data => x_msg_data);
1380: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1381: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote()');
1382: END IF;
1383:
1384: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1385: ROLLBACK TO ACTIVATEQUOTE_V2;
1386: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1387: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1388: p_count => x_msg_count ,
1389: p_data => x_msg_data);
1390: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1391: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote()');
1392: END IF;
1393:
1394: WHEN OTHERS THEN
1387: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1388: p_count => x_msg_count ,
1389: p_data => x_msg_data);
1390: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1391: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote()');
1392: END IF;
1393:
1394: WHEN OTHERS THEN
1395: ROLLBACK TO ACTIVATEQUOTE_V2;
1400: END IF;
1401: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1402: p_count => x_msg_count ,
1403: p_data => x_msg_data);
1404: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1405: IBE_Util.Debug('Unknown error IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote()');
1406: END IF;
1407:
1408: END;
1401: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1402: p_count => x_msg_count ,
1403: p_data => x_msg_data);
1404: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1405: IBE_Util.Debug('Unknown error IBE_QUOTE_SAVESHARE_V2_PVT.activate_quote()');
1406: END IF;
1407:
1408: END;
1409:
1465:
1466: -- Initialize API return status to success
1467: x_return_status := FND_API.G_RET_STS_SUCCESS;
1468:
1469: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1470: IBE_UTIL.debug('Inside Save_contact_point API');
1471: END IF;
1472: --DBMS_OUTPUT.PUT_LINE('Inside Save_contact_point API');
1473: l_contact_points_rec.status := 'A';
1466: -- Initialize API return status to success
1467: x_return_status := FND_API.G_RET_STS_SUCCESS;
1468:
1469: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1470: IBE_UTIL.debug('Inside Save_contact_point API');
1471: END IF;
1472: --DBMS_OUTPUT.PUT_LINE('Inside Save_contact_point API');
1473: l_contact_points_rec.status := 'A';
1474: l_contact_points_rec.owner_table_id := p_owner_table_id;
1476: l_contact_points_rec.application_id := l_application_id;
1477:
1478: IF (p_mode = 'EMAIL') THEN
1479: --DBMS_OUTPUT.PUT_LINE('Mode of contact point is EMAIL');
1480: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1481: IBE_UTIL.debug('Mode of contact point is EMAIL');
1482: END IF;
1483: l_contact_points_rec.contact_point_type := 'EMAIL';
1484: l_contact_points_rec.owner_table_name := 'IBE_SH_QUOTE_ACCESS';
1477:
1478: IF (p_mode = 'EMAIL') THEN
1479: --DBMS_OUTPUT.PUT_LINE('Mode of contact point is EMAIL');
1480: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1481: IBE_UTIL.debug('Mode of contact point is EMAIL');
1482: END IF;
1483: l_contact_points_rec.contact_point_type := 'EMAIL';
1484: l_contact_points_rec.owner_table_name := 'IBE_SH_QUOTE_ACCESS';
1485: l_email_rec.email_address := P_EMAIL;
1483: l_contact_points_rec.contact_point_type := 'EMAIL';
1484: l_contact_points_rec.owner_table_name := 'IBE_SH_QUOTE_ACCESS';
1485: l_email_rec.email_address := P_EMAIL;
1486: elsif (p_mode = 'WEB') THEN
1487: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1488: IBE_UTIL.debug('Mode of contact point is WEB');
1489: END IF;
1490:
1491: l_contact_points_rec.contact_point_type := 'WEB';
1484: l_contact_points_rec.owner_table_name := 'IBE_SH_QUOTE_ACCESS';
1485: l_email_rec.email_address := P_EMAIL;
1486: elsif (p_mode = 'WEB') THEN
1487: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1488: IBE_UTIL.debug('Mode of contact point is WEB');
1489: END IF;
1490:
1491: l_contact_points_rec.contact_point_type := 'WEB';
1492: l_contact_points_rec.owner_table_name := 'IBE_SH_QUOTE_ACCESS';
1501: WHERE owner_table_name = l_contact_points_rec.owner_table_name
1502: AND owner_table_id = l_contact_points_rec.owner_table_id;
1503:
1504: IF l_test = 0 THEN
1505: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1506: IBE_UTIL.DEBUG('call hz_conteact_point_pub.create_contact_points at'
1507: || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
1508: END IF;
1509:
1502: AND owner_table_id = l_contact_points_rec.owner_table_id;
1503:
1504: IF l_test = 0 THEN
1505: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1506: IBE_UTIL.DEBUG('call hz_conteact_point_pub.create_contact_points at'
1507: || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
1508: END IF;
1509:
1510: --DBMS_OUTPUT.PUT_LINE('Create contact point ');
1523: END IF;
1524: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1525: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1526: END IF;
1527: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1528: IBE_UTIL.DEBUG('done hz_conteact_point_pub.create_contact_points at'
1529: || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
1530: END IF;
1531:
1524: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1525: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1526: END IF;
1527: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1528: IBE_UTIL.DEBUG('done hz_conteact_point_pub.create_contact_points at'
1529: || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
1530: END IF;
1531:
1532: else
1536: ,l_contact_points_rec.owner_table_name);
1537: fetch c_getContactInfo into l_contact_points_rec.contact_point_id
1538: ,l_object_version_number;
1539: close c_getContactInfo;
1540: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1541: IBE_UTIL.DEBUG('call hz_conteact_point_pub.update_contact_points at'
1542: || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
1543: END IF;
1544:
1537: fetch c_getContactInfo into l_contact_points_rec.contact_point_id
1538: ,l_object_version_number;
1539: close c_getContactInfo;
1540: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1541: IBE_UTIL.DEBUG('call hz_conteact_point_pub.update_contact_points at'
1542: || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
1543: END IF;
1544:
1545: hz_contact_point_v2pub.update_contact_point(
1558:
1559: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1560: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1561: END IF;
1562: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1563: IBE_UTIL.DEBUG('done hz_conteact_point_pub.update_contact_points at'
1564: || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
1565: END IF;
1566: END IF;
1559: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1560: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1561: END IF;
1562: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1563: IBE_UTIL.DEBUG('done hz_conteact_point_pub.update_contact_points at'
1564: || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
1565: END IF;
1566: END IF;
1567:
1576: p_data => x_msg_data);
1577: EXCEPTION
1578: WHEN FND_API.G_EXC_ERROR THEN
1579: ROLLBACK TO SAVECONTACTPOINT_PVT;
1580: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1581: IBE_UTIL.DEBUG('Expected exception in Ibe_quote_saveshare_v2_pvt.SaveContactPoint');
1582: end if;
1583: x_return_status := FND_API.G_RET_STS_ERROR;
1584: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
1577: EXCEPTION
1578: WHEN FND_API.G_EXC_ERROR THEN
1579: ROLLBACK TO SAVECONTACTPOINT_PVT;
1580: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1581: IBE_UTIL.DEBUG('Expected exception in Ibe_quote_saveshare_v2_pvt.SaveContactPoint');
1582: end if;
1583: x_return_status := FND_API.G_RET_STS_ERROR;
1584: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
1585: p_count => x_msg_count,
1584: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
1585: p_count => x_msg_count,
1586: p_data => x_msg_data);
1587: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1588: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1589: IBE_UTIL.DEBUG('Unexpected exception in Ibe_quote_saveshare_v2_pvt.SaveContactPoint');
1590: end if;
1591:
1592: ROLLBACK TO SAVECONTACTPOINT_PVT;
1585: p_count => x_msg_count,
1586: p_data => x_msg_data);
1587: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1588: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1589: IBE_UTIL.DEBUG('Unexpected exception in Ibe_quote_saveshare_v2_pvt.SaveContactPoint');
1590: end if;
1591:
1592: ROLLBACK TO SAVECONTACTPOINT_PVT;
1593: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1594: FND_MSG_PUB.Count_And_Get(p_encoded => FND_API.G_FALSE,
1595: p_count => x_msg_count,
1596: p_data => x_msg_data);
1597: WHEN OTHERS THEN
1598: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1599: IBE_UTIL.DEBUG('Unknown exception in Ibe_quote_saveshare_v2_pvt.SaveContactPoint');
1600: end if;
1601:
1602: ROLLBACK TO SAVECONTACTPOINT_PVT;
1595: p_count => x_msg_count,
1596: p_data => x_msg_data);
1597: WHEN OTHERS THEN
1598: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1599: IBE_UTIL.DEBUG('Unknown exception in Ibe_quote_saveshare_v2_pvt.SaveContactPoint');
1600: end if;
1601:
1602: ROLLBACK TO SAVECONTACTPOINT_PVT;
1603: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1668: --dbms_output.put_line(' Deactivate API: Trying to deactivate: '||rec_check_active_cart.quote_header_id);
1669: FOR rec_check_active_cart in c_check_active_cart(p_party_id,
1670: p_cust_account_id) LOOP
1671: IF(rec_check_active_cart.quote_header_id is not null) THEN
1672: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1673: IBE_UTIL.DEBUG('Deactivate API: Trying to deactivate: '||rec_check_active_cart.quote_header_id);
1674: --dbms_output.put_line(' Deactivate API: Trying to deactivate: '||rec_check_active_cart.quote_header_id);
1675: END IF;
1676:
1669: FOR rec_check_active_cart in c_check_active_cart(p_party_id,
1670: p_cust_account_id) LOOP
1671: IF(rec_check_active_cart.quote_header_id is not null) THEN
1672: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1673: IBE_UTIL.DEBUG('Deactivate API: Trying to deactivate: '||rec_check_active_cart.quote_header_id);
1674: --dbms_output.put_line(' Deactivate API: Trying to deactivate: '||rec_check_active_cart.quote_header_id);
1675: END IF;
1676:
1677: --DBMS_OUTPUT.PUT_LINE('rec_check_active_cart.quote_header_id '||rec_check_active_cart.quote_header_id );
1674: --dbms_output.put_line(' Deactivate API: Trying to deactivate: '||rec_check_active_cart.quote_header_id);
1675: END IF;
1676:
1677: --DBMS_OUTPUT.PUT_LINE('rec_check_active_cart.quote_header_id '||rec_check_active_cart.quote_header_id );
1678: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1679: IBE_UTIL.DEBUG('Calling update handler of active_quotes_all table');
1680: END IF;
1681: --DBMS_OUTPUT.PUT_LINE('Calling update handler of active_quotes_all table');
1682:
1675: END IF;
1676:
1677: --DBMS_OUTPUT.PUT_LINE('rec_check_active_cart.quote_header_id '||rec_check_active_cart.quote_header_id );
1678: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1679: IBE_UTIL.DEBUG('Calling update handler of active_quotes_all table');
1680: END IF;
1681: --DBMS_OUTPUT.PUT_LINE('Calling update handler of active_quotes_all table');
1682:
1683: --DBMS_OUTPUT.PUT_LINE('P_quote_header_id '||P_quote_header_id);
1693: X_CURRENCY_CODE => null,
1694: x_last_update_date => sysdate,
1695: x_last_updated_by => fnd_global.user_id,
1696: x_last_update_login => 1);
1697: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1698: IBE_UTIL.DEBUG('Done calling Update handler of active_quotes_all table to erase the quote header id' );
1699: END IF;
1700: --DBMS_OUTPUT.PUT_LINE('Done calling delete handler of active_quotes_all table');
1701: END IF;
1694: x_last_update_date => sysdate,
1695: x_last_updated_by => fnd_global.user_id,
1696: x_last_update_login => 1);
1697: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1698: IBE_UTIL.DEBUG('Done calling Update handler of active_quotes_all table to erase the quote header id' );
1699: END IF;
1700: --DBMS_OUTPUT.PUT_LINE('Done calling delete handler of active_quotes_all table');
1701: END IF;
1702: EXIT when c_check_active_cart%notfound;
1706: IF FND_API.To_Boolean( p_commit ) THEN
1707: COMMIT WORK;
1708: END IF;
1709:
1710: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1711: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.deactivate_quote: END');
1712: END IF;
1713:
1714: EXCEPTION
1707: COMMIT WORK;
1708: END IF;
1709:
1710: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1711: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.deactivate_quote: END');
1712: END IF;
1713:
1714: EXCEPTION
1715: WHEN FND_API.G_EXC_ERROR THEN
1713:
1714: EXCEPTION
1715: WHEN FND_API.G_EXC_ERROR THEN
1716: ROLLBACK TO DEACTIVATEQUOTE_V2;
1717: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1718: IBE_UTIL.DEBUG('Expected exception in Ibe_quote_saveshare_v2_pvt.Deactivate_quote');
1719: end if;
1720:
1721: x_return_status := FND_API.G_RET_STS_ERROR;
1714: EXCEPTION
1715: WHEN FND_API.G_EXC_ERROR THEN
1716: ROLLBACK TO DEACTIVATEQUOTE_V2;
1717: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1718: IBE_UTIL.DEBUG('Expected exception in Ibe_quote_saveshare_v2_pvt.Deactivate_quote');
1719: end if;
1720:
1721: x_return_status := FND_API.G_RET_STS_ERROR;
1722: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1721: x_return_status := FND_API.G_RET_STS_ERROR;
1722: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1723: p_count => x_msg_count ,
1724: p_data => x_msg_data);
1725: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1726: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.deactivate_quote');
1727: END IF;
1728:
1729: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1722: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1723: p_count => x_msg_count ,
1724: p_data => x_msg_data);
1725: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1726: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.deactivate_quote');
1727: END IF;
1728:
1729: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1730: ROLLBACK TO DEACTIVATEQUOTE_V2;
1731: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1732: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1733: p_count => x_msg_count ,
1734: p_data => x_msg_data);
1735: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1736: IBE_Util.Debug('Unknown error in IBE_QUOTE_SAVESHARE_V2_PVT.deactivate_quote');
1737: END IF;
1738:
1739: WHEN OTHERS THEN
1732: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1733: p_count => x_msg_count ,
1734: p_data => x_msg_data);
1735: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1736: IBE_Util.Debug('Unknown error in IBE_QUOTE_SAVESHARE_V2_PVT.deactivate_quote');
1737: END IF;
1738:
1739: WHEN OTHERS THEN
1740: ROLLBACK TO DEACTIVATEQUOTE_V2;
1745: END IF;
1746: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1747: p_count => x_msg_count ,
1748: p_data => x_msg_data);
1749: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1750: IBE_Util.Debug('Abnormal end IBE_QUOTE_SAVESHARE_V2_PVT.deactivate_quote');
1751: END IF;
1752:
1753: END;
1746: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1747: p_count => x_msg_count ,
1748: p_data => x_msg_data);
1749: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1750: IBE_Util.Debug('Abnormal end IBE_QUOTE_SAVESHARE_V2_PVT.deactivate_quote');
1751: END IF;
1752:
1753: END;
1754:
1811: x_return_status := FND_API.G_RET_STS_SUCCESS;
1812: -------------------------------------------------------------------------------------------------------------
1813: --API Body start
1814: -------------------------------------------------------------------------------------------------------------
1815: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1816: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: START');
1817: END IF;
1818:
1819: IBE_Quote_Misc_pvt.validate_user_update
1812: -------------------------------------------------------------------------------------------------------------
1813: --API Body start
1814: -------------------------------------------------------------------------------------------------------------
1815: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1816: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: START');
1817: END IF;
1818:
1819: IBE_Quote_Misc_pvt.validate_user_update
1820: (p_quote_header_id => P_source_quote_header_id,
1830: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1831: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1832: END IF;
1833:
1834: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1835: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE:Calling IBE_QUOTE_SAVESHARE_pvt.Copy_lines');
1836: END IF;
1837: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE:Calling IBE_QUOTE_SAVESHARE_pvt.Copy_lines ');
1838:
1831: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1832: END IF;
1833:
1834: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1835: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE:Calling IBE_QUOTE_SAVESHARE_pvt.Copy_lines');
1836: END IF;
1837: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE:Calling IBE_QUOTE_SAVESHARE_pvt.Copy_lines ');
1838:
1839: IBE_QUOTE_SAVESHARE_pvt.COPY_LINES(
1867: --l_hd_shipment_tbl(1) := p_hd_shipment_rec; $$ Verify this part. Ned to pass
1868: --p_to_hd_shipment_rec?? $$
1869: -- l_hd_shipment_tbl(1).quote_header_id := P_target_header_rec.quote_header_id;
1870:
1871: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1872: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE:IBE_QUOTE_SAVESHARE_pvt.Copy_lines End');
1873: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: Calling IBE_Quote_Save_pvt.Save to save target cart');
1874: END IF;
1875: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: Calling IBE_Quote_Save_pvt.Save to save target cart ');
1868: --p_to_hd_shipment_rec?? $$
1869: -- l_hd_shipment_tbl(1).quote_header_id := P_target_header_rec.quote_header_id;
1870:
1871: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1872: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE:IBE_QUOTE_SAVESHARE_pvt.Copy_lines End');
1873: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: Calling IBE_Quote_Save_pvt.Save to save target cart');
1874: END IF;
1875: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: Calling IBE_Quote_Save_pvt.Save to save target cart ');
1876: --DBMS_OUTPUT.PUT_LINE('before save p_target_header_rec.quote_header_id '||p_target_header_rec.quote_header_id);
1869: -- l_hd_shipment_tbl(1).quote_header_id := P_target_header_rec.quote_header_id;
1870:
1871: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1872: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE:IBE_QUOTE_SAVESHARE_pvt.Copy_lines End');
1873: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: Calling IBE_Quote_Save_pvt.Save to save target cart');
1874: END IF;
1875: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: Calling IBE_Quote_Save_pvt.Save to save target cart ');
1876: --DBMS_OUTPUT.PUT_LINE('before save p_target_header_rec.quote_header_id '||p_target_header_rec.quote_header_id);
1877: IBE_Quote_Save_pvt.SAVE
1898: END IF;
1899: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1900: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1901: END IF;
1902: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1903: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: P_delete_source_cart: '||P_delete_source_cart);
1904: END IF;
1905: IF (P_delete_source_cart = FND_API.G_TRUE ) THEN
1906: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1899: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1900: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1901: END IF;
1902: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1903: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: P_delete_source_cart: '||P_delete_source_cart);
1904: END IF;
1905: IF (P_delete_source_cart = FND_API.G_TRUE ) THEN
1906: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1907: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: P_delete_source_cart is true');
1902: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1903: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: P_delete_source_cart: '||P_delete_source_cart);
1904: END IF;
1905: IF (P_delete_source_cart = FND_API.G_TRUE ) THEN
1906: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1907: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: P_delete_source_cart is true');
1908: END IF;
1909: IBE_Quote_Save_pvt.Delete(
1910: p_api_version_number => p_api_version
1903: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: P_delete_source_cart: '||P_delete_source_cart);
1904: END IF;
1905: IF (P_delete_source_cart = FND_API.G_TRUE ) THEN
1906: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1907: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: P_delete_source_cart is true');
1908: END IF;
1909: IBE_Quote_Save_pvt.Delete(
1910: p_api_version_number => p_api_version
1911: ,p_init_msg_list => FND_API.G_FALSE
1923: END IF;
1924: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1925: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1926: END IF;
1927: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1928: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE:Delete on source cart done');
1929: END IF;
1930: END IF;
1931:
1924: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1925: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1926: END IF;
1927: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1928: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE:Delete on source cart done');
1929: END IF;
1930: END IF;
1931:
1932: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1928: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE:Delete on source cart done');
1929: END IF;
1930: END IF;
1931:
1932: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1933: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: END');
1934: END IF;
1935:
1936: EXCEPTION
1929: END IF;
1930: END IF;
1931:
1932: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1933: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.APPEND_QUOTE: END');
1934: END IF;
1935:
1936: EXCEPTION
1937: WHEN FND_API.G_EXC_ERROR THEN
1939: x_return_status := FND_API.G_RET_STS_ERROR;
1940: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1941: p_count => x_msg_count ,
1942: p_data => x_msg_data);
1943: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1944: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.append_quote()');
1945: END IF;
1946:
1947: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1940: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1941: p_count => x_msg_count ,
1942: p_data => x_msg_data);
1943: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1944: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.append_quote()');
1945: END IF;
1946:
1947: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1948: ROLLBACK TO APPENDQUOTE_V2;
1949: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1950: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1951: p_count => x_msg_count ,
1952: p_data => x_msg_data);
1953: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1954: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.append_quote()');
1955: END IF;
1956:
1957: WHEN OTHERS THEN
1950: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1951: p_count => x_msg_count ,
1952: p_data => x_msg_data);
1953: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1954: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.append_quote()');
1955: END IF;
1956:
1957: WHEN OTHERS THEN
1958: ROLLBACK TO APPENDQUOTE_V2;
1963: END IF;
1964: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1965: p_count => x_msg_count ,
1966: p_data => x_msg_data);
1967: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1968: IBE_Util.Debug('Abnormal end IBE_QUOTE_SAVESHARE_V2_PVT.append_quote()');
1969: END IF;
1970:
1971: END;
1964: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
1965: p_count => x_msg_count ,
1966: p_data => x_msg_data);
1967: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
1968: IBE_Util.Debug('Abnormal end IBE_QUOTE_SAVESHARE_V2_PVT.append_quote()');
1969: END IF;
1970:
1971: END;
1972:
2063: x_return_status := FND_API.G_RET_STS_SUCCESS;
2064: -------------------------------------------------------------------------------------------------------------
2065: --API Body start
2066: -------------------------------------------------------------------------------------------------------------
2067: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2068: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.STOP_SHARING: START');
2069: END IF;
2070: -- Stop sharing should deactivate owner's active cart if any.
2071: --dbms_output.put_line('p_quote_header_id: '||p_quote_header_id);
2064: -------------------------------------------------------------------------------------------------------------
2065: --API Body start
2066: -------------------------------------------------------------------------------------------------------------
2067: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2068: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.STOP_SHARING: START');
2069: END IF;
2070: -- Stop sharing should deactivate owner's active cart if any.
2071: --dbms_output.put_line('p_quote_header_id: '||p_quote_header_id);
2072: FOR rec_get_owner in c_get_owner(p_quote_header_id) LOOP
2074: l_owner_cust_account_id := rec_get_owner.cust_account_id;
2075: --dbms_output.put_line('loop one in cursor ');
2076: EXIT when c_get_owner%NOTFOUND;
2077: END LOOP;
2078: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2079: IBE_UTIL.DEBUG('STOP_SHARING:Calling deactivate API');
2080: END IF;
2081: --DBMS_OUTPUT.PUT_LINE('Calling deactivate API to deactivate owner''s cart');
2082: --dbms_output.put_line('PARTY_ID: '||l_owner_party_id);
2075: --dbms_output.put_line('loop one in cursor ');
2076: EXIT when c_get_owner%NOTFOUND;
2077: END LOOP;
2078: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2079: IBE_UTIL.DEBUG('STOP_SHARING:Calling deactivate API');
2080: END IF;
2081: --DBMS_OUTPUT.PUT_LINE('Calling deactivate API to deactivate owner''s cart');
2082: --dbms_output.put_line('PARTY_ID: '||l_owner_party_id);
2083: --dbms_output.put_line('CUST_ACCOUNT_ID: '||l_owner_cust_account_id );
2099:
2100: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
2101: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2102: END IF;
2103: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2104: IBE_UTIL.DEBUG('STOP_SHARING:Deactivation of owner cart :Done');
2105: END IF;
2106: --dbms_output.put_line('STOP_SHARING:Deactivation of owner cart :Done');
2107: --If there is no input quote access tbl then send notification to all recipients.
2100: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
2101: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2102: END IF;
2103: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2104: IBE_UTIL.DEBUG('STOP_SHARING:Deactivation of owner cart :Done');
2105: END IF;
2106: --dbms_output.put_line('STOP_SHARING:Deactivation of owner cart :Done');
2107: --If there is no input quote access tbl then send notification to all recipients.
2108: --dbms_output.put_line('p_quote_access_tbl(1).quote_sharee_id: '||nvl(p_quote_access_tbl(1).quote_sharee_id,0));
2111: l_sharing_party_id := rec_userenv_partyid.customer_id;
2112: exit when c_userenv_partyid%NOTFOUND;
2113: END LOOP;
2114:
2115: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2116: IBE_UTIL.DEBUG('STOP_SHARING: :: l_sharing_party_id: '|| l_sharing_party_id );
2117: END IF;
2118:
2119: --dbms_output.put_line('Input quote access is null ');
2112: exit when c_userenv_partyid%NOTFOUND;
2113: END LOOP;
2114:
2115: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2116: IBE_UTIL.DEBUG('STOP_SHARING: :: l_sharing_party_id: '|| l_sharing_party_id );
2117: END IF;
2118:
2119: --dbms_output.put_line('Input quote access is null ');
2120: FOR rec_get_recipients in c_get_recipients(p_quote_header_id) LOOP
2117: END IF;
2118:
2119: --dbms_output.put_line('Input quote access is null ');
2120: FOR rec_get_recipients in c_get_recipients(p_quote_header_id) LOOP
2121: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2122: IBE_UTIL.DEBUG('STOP_SHARING:: '||tbl_counter||'. quote_sharee_id:'||rec_get_recipients.quote_sharee_id||', party_id:' || rec_get_recipients.party_id );
2123: END IF;
2124:
2125: l_quote_access_tbl(tbl_counter).quote_sharee_id := rec_get_recipients.quote_sharee_id;
2118:
2119: --dbms_output.put_line('Input quote access is null ');
2120: FOR rec_get_recipients in c_get_recipients(p_quote_header_id) LOOP
2121: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2122: IBE_UTIL.DEBUG('STOP_SHARING:: '||tbl_counter||'. quote_sharee_id:'||rec_get_recipients.quote_sharee_id||', party_id:' || rec_get_recipients.party_id );
2123: END IF;
2124:
2125: l_quote_access_tbl(tbl_counter).quote_sharee_id := rec_get_recipients.quote_sharee_id;
2126: l_quote_access_tbl(tbl_counter).party_id := rec_get_recipients.party_id;
2132: l_quote_access_tbl(tbl_counter).email_contact_address := rec_get_recipients.email_address;
2133: l_quote_access_tbl(tbl_counter).shared_by_party_id := rec_get_recipients.shared_by_party_id;
2134: -- 14109131 - STOP SHARED CART NOTIFICATION SENT WHEN RECIPIENT PLACES ORDER
2135: IF (l_sharing_party_id = rec_get_recipients.party_id) THEN
2136: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2137: IBE_UTIL.DEBUG('STOP_SHARING :: sharee party id is party id so making notify flag false ');
2138:
2139: END IF;
2140: l_quote_access_tbl(tbl_counter).notify_flag := FND_API.G_FALSE;
2133: l_quote_access_tbl(tbl_counter).shared_by_party_id := rec_get_recipients.shared_by_party_id;
2134: -- 14109131 - STOP SHARED CART NOTIFICATION SENT WHEN RECIPIENT PLACES ORDER
2135: IF (l_sharing_party_id = rec_get_recipients.party_id) THEN
2136: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2137: IBE_UTIL.DEBUG('STOP_SHARING :: sharee party id is party id so making notify flag false ');
2138:
2139: END IF;
2140: l_quote_access_tbl(tbl_counter).notify_flag := FND_API.G_FALSE;
2141: End IF;
2149: FOR tbl_counter in 1..p_quote_access_tbl.count LOOP
2150: --dbms_output.put_line('p_quote_access_tbl(tbl_counter).quote_sharee_id: '||p_quote_access_tbl(tbl_counter).quote_sharee_id);
2151: FOR rec_get_recipient_info in c_get_recipient_info(l_quote_access_tbl(tbl_counter).quote_sharee_id) LOOP
2152: IF l_sharing_party_id <> rec_get_recipient_info.party_id THEN
2153: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2154: IBE_UTIL.DEBUG('STOP_SHARING: '||tbl_counter||'. quote_sharee_id:'||p_quote_access_tbl(tbl_counter).quote_sharee_id||', party_id:' || rec_get_recipient_info.party_id ||', notify_flag:' || p_quote_access_tbl(tbl_counter).notify_flag );
2155: END IF;
2156:
2157:
2150: --dbms_output.put_line('p_quote_access_tbl(tbl_counter).quote_sharee_id: '||p_quote_access_tbl(tbl_counter).quote_sharee_id);
2151: FOR rec_get_recipient_info in c_get_recipient_info(l_quote_access_tbl(tbl_counter).quote_sharee_id) LOOP
2152: IF l_sharing_party_id <> rec_get_recipient_info.party_id THEN
2153: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2154: IBE_UTIL.DEBUG('STOP_SHARING: '||tbl_counter||'. quote_sharee_id:'||p_quote_access_tbl(tbl_counter).quote_sharee_id||', party_id:' || rec_get_recipient_info.party_id ||', notify_flag:' || p_quote_access_tbl(tbl_counter).notify_flag );
2155: END IF;
2156:
2157:
2158: l_quote_access_tbl(tbl_counter).quote_sharee_id := p_quote_access_tbl(tbl_counter).quote_sharee_id;
2169: EXIT when c_get_recipient_info%notfound;
2170: END LOOP;
2171: END LOOP;
2172: END IF;
2173: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2174: IBE_UTIL.DEBUG('STOP_SHARING:calling delete_recipient on the following recipients:');
2175: END IF;
2176: --dbms_output.put_line('STOP_SHARING:calling delete_recipient on the following recipients:');
2177: FOR i in 1.. l_quote_access_tbl.count LOOP
2170: END LOOP;
2171: END LOOP;
2172: END IF;
2173: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2174: IBE_UTIL.DEBUG('STOP_SHARING:calling delete_recipient on the following recipients:');
2175: END IF;
2176: --dbms_output.put_line('STOP_SHARING:calling delete_recipient on the following recipients:');
2177: FOR i in 1.. l_quote_access_tbl.count LOOP
2178: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2174: IBE_UTIL.DEBUG('STOP_SHARING:calling delete_recipient on the following recipients:');
2175: END IF;
2176: --dbms_output.put_line('STOP_SHARING:calling delete_recipient on the following recipients:');
2177: FOR i in 1.. l_quote_access_tbl.count LOOP
2178: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2179: IBE_UTIL.DEBUG('STOP_SHARING:calling delete_recipient');
2180: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl(i).quote_sharee_id);
2181: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl(i).contact_point_id);
2182: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl(i).party_id);
2175: END IF;
2176: --dbms_output.put_line('STOP_SHARING:calling delete_recipient on the following recipients:');
2177: FOR i in 1.. l_quote_access_tbl.count LOOP
2178: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2179: IBE_UTIL.DEBUG('STOP_SHARING:calling delete_recipient');
2180: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl(i).quote_sharee_id);
2181: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl(i).contact_point_id);
2182: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl(i).party_id);
2183: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':cust_account_id: '||l_quote_access_tbl(i).cust_account_id);
2176: --dbms_output.put_line('STOP_SHARING:calling delete_recipient on the following recipients:');
2177: FOR i in 1.. l_quote_access_tbl.count LOOP
2178: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2179: IBE_UTIL.DEBUG('STOP_SHARING:calling delete_recipient');
2180: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl(i).quote_sharee_id);
2181: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl(i).contact_point_id);
2182: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl(i).party_id);
2183: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':cust_account_id: '||l_quote_access_tbl(i).cust_account_id);
2184: END IF;
2177: FOR i in 1.. l_quote_access_tbl.count LOOP
2178: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2179: IBE_UTIL.DEBUG('STOP_SHARING:calling delete_recipient');
2180: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl(i).quote_sharee_id);
2181: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl(i).contact_point_id);
2182: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl(i).party_id);
2183: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':cust_account_id: '||l_quote_access_tbl(i).cust_account_id);
2184: END IF;
2185: --dbms_output.put_line('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl(i).quote_sharee_id);
2178: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2179: IBE_UTIL.DEBUG('STOP_SHARING:calling delete_recipient');
2180: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl(i).quote_sharee_id);
2181: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl(i).contact_point_id);
2182: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl(i).party_id);
2183: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':cust_account_id: '||l_quote_access_tbl(i).cust_account_id);
2184: END IF;
2185: --dbms_output.put_line('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl(i).quote_sharee_id);
2186: --dbms_output.put_line('Calling delete recipient for the recipient record ');
2179: IBE_UTIL.DEBUG('STOP_SHARING:calling delete_recipient');
2180: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl(i).quote_sharee_id);
2181: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl(i).contact_point_id);
2182: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl(i).party_id);
2183: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':cust_account_id: '||l_quote_access_tbl(i).cust_account_id);
2184: END IF;
2185: --dbms_output.put_line('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl(i).quote_sharee_id);
2186: --dbms_output.put_line('Calling delete recipient for the recipient record ');
2187: IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT(
2220: EXIT when c_get_recipients%notfound;
2221: END LOOP;
2222:
2223: FOR i in 1.. l_quote_access_tbl_tmp.count LOOP
2224: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2225: IBE_UTIL.DEBUG('STOP_SHARING: Concurrency part begins');
2226: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl_tmp(i).quote_sharee_id);
2227: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl_tmp(i).contact_point_id);
2228: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl_tmp(i).party_id);
2221: END LOOP;
2222:
2223: FOR i in 1.. l_quote_access_tbl_tmp.count LOOP
2224: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2225: IBE_UTIL.DEBUG('STOP_SHARING: Concurrency part begins');
2226: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl_tmp(i).quote_sharee_id);
2227: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl_tmp(i).contact_point_id);
2228: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl_tmp(i).party_id);
2229: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':cust_account_id: '||l_quote_access_tbl_tmp(i).cust_account_id);
2222:
2223: FOR i in 1.. l_quote_access_tbl_tmp.count LOOP
2224: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2225: IBE_UTIL.DEBUG('STOP_SHARING: Concurrency part begins');
2226: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl_tmp(i).quote_sharee_id);
2227: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl_tmp(i).contact_point_id);
2228: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl_tmp(i).party_id);
2229: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':cust_account_id: '||l_quote_access_tbl_tmp(i).cust_account_id);
2230: END IF;
2223: FOR i in 1.. l_quote_access_tbl_tmp.count LOOP
2224: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2225: IBE_UTIL.DEBUG('STOP_SHARING: Concurrency part begins');
2226: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl_tmp(i).quote_sharee_id);
2227: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl_tmp(i).contact_point_id);
2228: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl_tmp(i).party_id);
2229: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':cust_account_id: '||l_quote_access_tbl_tmp(i).cust_account_id);
2230: END IF;
2231: --dbms_output.put_line('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl_tmp(i).quote_sharee_id);
2224: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2225: IBE_UTIL.DEBUG('STOP_SHARING: Concurrency part begins');
2226: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl_tmp(i).quote_sharee_id);
2227: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl_tmp(i).contact_point_id);
2228: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl_tmp(i).party_id);
2229: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':cust_account_id: '||l_quote_access_tbl_tmp(i).cust_account_id);
2230: END IF;
2231: --dbms_output.put_line('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl_tmp(i).quote_sharee_id);
2232: --dbms_output.put_line('Calling delete recipient for the recipient record ');
2225: IBE_UTIL.DEBUG('STOP_SHARING: Concurrency part begins');
2226: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl_tmp(i).quote_sharee_id);
2227: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':contact_point_id: '||l_quote_access_tbl_tmp(i).contact_point_id);
2228: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':party_id: '||l_quote_access_tbl_tmp(i).party_id);
2229: IBE_UTIL.DEBUG('STOP_SHARING:l_quote_access_tbl:'||i||':cust_account_id: '||l_quote_access_tbl_tmp(i).cust_account_id);
2230: END IF;
2231: --dbms_output.put_line('STOP_SHARING:l_quote_access_tbl:'||i||':quote_sharee_id: '||l_quote_access_tbl_tmp(i).quote_sharee_id);
2232: --dbms_output.put_line('Calling delete recipient for the recipient record ');
2233: IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT(
2245: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
2246: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2247: END IF;
2248: END LOOP;
2249: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2250: IBE_UTIL.DEBUG('STOP_SHARING: Concurrency part ends');
2251: END IF;
2252:
2253: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2246: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2247: END IF;
2248: END LOOP;
2249: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2250: IBE_UTIL.DEBUG('STOP_SHARING: Concurrency part ends');
2251: END IF;
2252:
2253: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2254: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.STOP_SHARING: END');
2249: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2250: IBE_UTIL.DEBUG('STOP_SHARING: Concurrency part ends');
2251: END IF;
2252:
2253: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2254: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.STOP_SHARING: END');
2255: END IF;
2256:
2257: EXCEPTION
2250: IBE_UTIL.DEBUG('STOP_SHARING: Concurrency part ends');
2251: END IF;
2252:
2253: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2254: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.STOP_SHARING: END');
2255: END IF;
2256:
2257: EXCEPTION
2258:
2261: x_return_status := FND_API.G_RET_STS_ERROR;
2262: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2263: p_count => x_msg_count ,
2264: p_data => x_msg_data);
2265: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2266: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.STOPSHARING_V2');
2267: END IF;
2268:
2269: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2262: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2263: p_count => x_msg_count ,
2264: p_data => x_msg_data);
2265: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2266: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.STOPSHARING_V2');
2267: END IF;
2268:
2269: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2270: ROLLBACK TO STOPSHARING_V2;
2271: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2272: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2273: p_count => x_msg_count ,
2274: p_data => x_msg_data);
2275: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2276: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.STOPSHARING_V2');
2277: END IF;
2278:
2279: WHEN OTHERS THEN
2272: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2273: p_count => x_msg_count ,
2274: p_data => x_msg_data);
2275: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2276: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.STOPSHARING_V2');
2277: END IF;
2278:
2279: WHEN OTHERS THEN
2280: ROLLBACK TO STOPSHARING_V2;
2285: END IF;
2286: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2287: p_count => x_msg_count ,
2288: p_data => x_msg_data);
2289: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2290: IBE_Util.Debug('Unknown error in IBE_QUOTE_SAVESHARE_V2_PVT.STOPSHARING_V2');
2291: END IF;
2292:
2293: END;
2286: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2287: p_count => x_msg_count ,
2288: p_data => x_msg_data);
2289: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2290: IBE_Util.Debug('Unknown error in IBE_QUOTE_SAVESHARE_V2_PVT.STOPSHARING_V2');
2291: END IF;
2292:
2293: END;
2294:
2374: l_initiator_id := rec_userenv_partyid.customer_id;
2375: EXIT when c_userenv_partyid%notfound;
2376: END LOOP;
2377:
2378: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2379: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: START');
2380: END IF;
2381: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: START');
2382: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2375: EXIT when c_userenv_partyid%notfound;
2376: END LOOP;
2377:
2378: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2379: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: START');
2380: END IF;
2381: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: START');
2382: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2383: IBE_UTIL.DEBUG('Opening cursor to retrieve the recipient_id');
2378: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2379: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: START');
2380: END IF;
2381: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: START');
2382: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2383: IBE_UTIL.DEBUG('Opening cursor to retrieve the recipient_id');
2384: END IF;
2385: --DBMS_OUTPUT.PUT_LINE('Opening cursor to retrieve the recipient_id');
2386: --DBMS_OUTPUT.PUT_LINE('p_quote_access_rec.quote_sharee_number: '||p_quote_access_rec.quote_sharee_number);
2379: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: START');
2380: END IF;
2381: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: START');
2382: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2383: IBE_UTIL.DEBUG('Opening cursor to retrieve the recipient_id');
2384: END IF;
2385: --DBMS_OUTPUT.PUT_LINE('Opening cursor to retrieve the recipient_id');
2386: --DBMS_OUTPUT.PUT_LINE('p_quote_access_rec.quote_sharee_number: '||p_quote_access_rec.quote_sharee_number);
2387: --DBMS_OUTPUT.PUT_LINE('p_quote_access_rec.party_id: '||p_quote_access_rec.party_id);
2399: l_quote_access_rec.cust_account_id := p_cust_account_id;
2400: l_quote_access_rec.quote_header_id := rec_get_recip_id.quote_header_id;
2401: EXIT WHEN c_get_recip_id%NOTFOUND;
2402: END LOOP;
2403: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2404: IBE_UTIL.DEBUG('Recipient id obtained is: '||l_quote_access_rec.quote_sharee_id);
2405: END IF;
2406:
2407: --DBMS_OUTPUT.PUT_LINE('Recipient id obtained is: '||l_quote_access_rec.quote_sharee_id);
2400: l_quote_access_rec.quote_header_id := rec_get_recip_id.quote_header_id;
2401: EXIT WHEN c_get_recip_id%NOTFOUND;
2402: END LOOP;
2403: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2404: IBE_UTIL.DEBUG('Recipient id obtained is: '||l_quote_access_rec.quote_sharee_id);
2405: END IF;
2406:
2407: --DBMS_OUTPUT.PUT_LINE('Recipient id obtained is: '||l_quote_access_rec.quote_sharee_id);
2408: IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT(
2438:
2439: -- Assign the quote_sharee_id to l_quote_access_rec (value needed in the notification api,3349991)
2440: l_quote_access_rec_recip.quote_sharee_id := p_quote_access_tbl(counter).quote_sharee_id;
2441:
2442: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2443: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: Ready to call view shared cart');
2444: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:initiator_party_id: '||l_initiator_id);
2445: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient party_id: '||l_quote_access_rec_recip.party_id);
2446: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient number: '||l_quote_access_rec_recip.quote_sharee_number);
2439: -- Assign the quote_sharee_id to l_quote_access_rec (value needed in the notification api,3349991)
2440: l_quote_access_rec_recip.quote_sharee_id := p_quote_access_tbl(counter).quote_sharee_id;
2441:
2442: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2443: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: Ready to call view shared cart');
2444: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:initiator_party_id: '||l_initiator_id);
2445: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient party_id: '||l_quote_access_rec_recip.party_id);
2446: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient number: '||l_quote_access_rec_recip.quote_sharee_number);
2447: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient id: '||l_quote_access_rec_recip.quote_sharee_id);
2440: l_quote_access_rec_recip.quote_sharee_id := p_quote_access_tbl(counter).quote_sharee_id;
2441:
2442: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2443: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: Ready to call view shared cart');
2444: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:initiator_party_id: '||l_initiator_id);
2445: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient party_id: '||l_quote_access_rec_recip.party_id);
2446: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient number: '||l_quote_access_rec_recip.quote_sharee_number);
2447: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient id: '||l_quote_access_rec_recip.quote_sharee_id);
2448: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:contact_point_id: '||l_quote_access_rec_recip.contact_point_id);
2441:
2442: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2443: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: Ready to call view shared cart');
2444: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:initiator_party_id: '||l_initiator_id);
2445: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient party_id: '||l_quote_access_rec_recip.party_id);
2446: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient number: '||l_quote_access_rec_recip.quote_sharee_number);
2447: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient id: '||l_quote_access_rec_recip.quote_sharee_id);
2448: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:contact_point_id: '||l_quote_access_rec_recip.contact_point_id);
2449: END IF;
2442: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2443: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: Ready to call view shared cart');
2444: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:initiator_party_id: '||l_initiator_id);
2445: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient party_id: '||l_quote_access_rec_recip.party_id);
2446: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient number: '||l_quote_access_rec_recip.quote_sharee_number);
2447: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient id: '||l_quote_access_rec_recip.quote_sharee_id);
2448: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:contact_point_id: '||l_quote_access_rec_recip.contact_point_id);
2449: END IF;
2450:
2443: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: Ready to call view shared cart');
2444: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:initiator_party_id: '||l_initiator_id);
2445: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient party_id: '||l_quote_access_rec_recip.party_id);
2446: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient number: '||l_quote_access_rec_recip.quote_sharee_number);
2447: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient id: '||l_quote_access_rec_recip.quote_sharee_id);
2448: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:contact_point_id: '||l_quote_access_rec_recip.contact_point_id);
2449: END IF;
2450:
2451: IBE_WORKFLOW_PVT.Notify_view_shared_cart(
2444: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:initiator_party_id: '||l_initiator_id);
2445: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient party_id: '||l_quote_access_rec_recip.party_id);
2446: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient number: '||l_quote_access_rec_recip.quote_sharee_number);
2447: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:recipient id: '||l_quote_access_rec_recip.quote_sharee_id);
2448: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING:contact_point_id: '||l_quote_access_rec_recip.contact_point_id);
2449: END IF;
2450:
2451: IBE_WORKFLOW_PVT.Notify_view_shared_cart(
2452: p_api_version => p_api_version
2467: END IF;
2468: END IF;
2469: END LOOP;
2470:
2471: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2472: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: END');
2473: END IF;
2474: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: END ');
2475: EXCEPTION
2468: END IF;
2469: END LOOP;
2470:
2471: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2472: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: END');
2473: END IF;
2474: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.END_WORKING: END ');
2475: EXCEPTION
2476: WHEN FND_API.G_EXC_ERROR THEN
2478: x_return_status := FND_API.G_RET_STS_ERROR;
2479: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2480: p_count => x_msg_count ,
2481: p_data => x_msg_data);
2482: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2483: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.ENDWORKING');
2484: END IF;
2485:
2486: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2479: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2480: p_count => x_msg_count ,
2481: p_data => x_msg_data);
2482: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2483: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.ENDWORKING');
2484: END IF;
2485:
2486: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2487: ROLLBACK TO ENDWORKING_V2;
2488: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2489: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2490: p_count => x_msg_count ,
2491: p_data => x_msg_data);
2492: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2493: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.ENDWORKING)');
2494: END IF;
2495:
2496: WHEN OTHERS THEN
2489: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2490: p_count => x_msg_count ,
2491: p_data => x_msg_data);
2492: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2493: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.ENDWORKING)');
2494: END IF;
2495:
2496: WHEN OTHERS THEN
2497: ROLLBACK TO ENDWORKING_V2;
2502: END IF;
2503: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2504: p_count => x_msg_count ,
2505: p_data => x_msg_data);
2506: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2507: IBE_Util.Debug('Unknown error in IBE_QUOTE_SAVESHARE_V2_PVT.ENDWORKING');
2508: END IF;
2509:
2510:
2503: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2504: p_count => x_msg_count ,
2505: p_data => x_msg_data);
2506: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2507: IBE_Util.Debug('Unknown error in IBE_QUOTE_SAVESHARE_V2_PVT.ENDWORKING');
2508: END IF;
2509:
2510:
2511: END;
2564: -------------------------------------------------------------------------------------------------------------
2565: --API Body start
2566: -------------------------------------------------------------------------------------------------------------
2567:
2568: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2569: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: START');
2570: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY:quote_header_id: '||p_quote_header_id);
2571: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: Querying initiator party id');
2572: END IF;
2565: --API Body start
2566: -------------------------------------------------------------------------------------------------------------
2567:
2568: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2569: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: START');
2570: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY:quote_header_id: '||p_quote_header_id);
2571: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: Querying initiator party id');
2572: END IF;
2573:
2566: -------------------------------------------------------------------------------------------------------------
2567:
2568: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2569: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: START');
2570: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY:quote_header_id: '||p_quote_header_id);
2571: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: Querying initiator party id');
2572: END IF;
2573:
2574: FOR rec_userenv_partyid in c_userenv_partyid LOOP
2567:
2568: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2569: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: START');
2570: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY:quote_header_id: '||p_quote_header_id);
2571: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: Querying initiator party id');
2572: END IF;
2573:
2574: FOR rec_userenv_partyid in c_userenv_partyid LOOP
2575: l_initiator_id := rec_userenv_partyid.customer_id;
2575: l_initiator_id := rec_userenv_partyid.customer_id;
2576: EXIT when c_userenv_partyid%notfound;
2577: END LOOP;
2578:
2579: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2580: IBE_UTIL.DEBUG('Building quote access table');
2581: END IF;
2582:
2583: FOR rec_get_recipients in c_get_recipients(p_quote_header_id) LOOP
2576: EXIT when c_userenv_partyid%notfound;
2577: END LOOP;
2578:
2579: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2580: IBE_UTIL.DEBUG('Building quote access table');
2581: END IF;
2582:
2583: FOR rec_get_recipients in c_get_recipients(p_quote_header_id) LOOP
2584:
2585: --Omitting the initiator's details as initiator is not required to get the notification
2586: IF (l_initiator_id <> nvl(rec_get_recipients.party_id,-1) ) THEN
2587: l_quote_access_tbl(tbl_counter).quote_sharee_id := rec_get_recipients.quote_sharee_id;
2588:
2589: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2590: IBE_UTIL.DEBUG('Added sharee quote_sharee_id: '||rec_get_recipients.quote_sharee_id);
2591: END IF;
2592:
2593: l_quote_access_tbl(tbl_counter).update_privilege_type_code := 'R';
2586: IF (l_initiator_id <> nvl(rec_get_recipients.party_id,-1) ) THEN
2587: l_quote_access_tbl(tbl_counter).quote_sharee_id := rec_get_recipients.quote_sharee_id;
2588:
2589: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2590: IBE_UTIL.DEBUG('Added sharee quote_sharee_id: '||rec_get_recipients.quote_sharee_id);
2591: END IF;
2592:
2593: l_quote_access_tbl(tbl_counter).update_privilege_type_code := 'R';
2594: l_quote_access_tbl(tbl_counter).party_id := rec_get_recipients.party_id;
2598: tbl_counter := tbl_counter+1;
2599: END IF;
2600: EXIT when c_get_recipients%notfound;
2601: END LOOP;
2602: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2603: IBE_UTIL.DEBUG('Done building quote access table');
2604: END IF;
2605:
2606: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2599: END IF;
2600: EXIT when c_get_recipients%notfound;
2601: END LOOP;
2602: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2603: IBE_UTIL.DEBUG('Done building quote access table');
2604: END IF;
2605:
2606: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2607: IBE_UTIL.DEBUG('Calling save_recipients to update recipient access level');
2602: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2603: IBE_UTIL.DEBUG('Done building quote access table');
2604: END IF;
2605:
2606: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2607: IBE_UTIL.DEBUG('Calling save_recipients to update recipient access level');
2608: END IF;
2609: IBE_QUOTE_SAVESHARE_V2_PVT.save_recipients(
2610: P_Quote_access_tbl => l_quote_access_tbl ,
2603: IBE_UTIL.DEBUG('Done building quote access table');
2604: END IF;
2605:
2606: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2607: IBE_UTIL.DEBUG('Calling save_recipients to update recipient access level');
2608: END IF;
2609: IBE_QUOTE_SAVESHARE_V2_PVT.save_recipients(
2610: P_Quote_access_tbl => l_quote_access_tbl ,
2611: P_Quote_header_id => P_Quote_header_id ,
2617: x_return_status => x_return_status ,
2618: x_msg_count => x_msg_count ,
2619: x_msg_data => x_msg_data );
2620:
2621: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2622: IBE_UTIL.DEBUG('Done calling save_recipients to update recipient access level');
2623: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: END');
2624: END IF;
2625:
2618: x_msg_count => x_msg_count ,
2619: x_msg_data => x_msg_data );
2620:
2621: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2622: IBE_UTIL.DEBUG('Done calling save_recipients to update recipient access level');
2623: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: END');
2624: END IF;
2625:
2626: EXCEPTION
2619: x_msg_data => x_msg_data );
2620:
2621: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2622: IBE_UTIL.DEBUG('Done calling save_recipients to update recipient access level');
2623: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.SHARE_READONLY: END');
2624: END IF;
2625:
2626: EXCEPTION
2627:
2630: x_return_status := FND_API.G_RET_STS_ERROR;
2631: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2632: p_count => x_msg_count ,
2633: p_data => x_msg_data);
2634: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2635: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.SHAREREADONLY_V2');
2636: END IF;
2637:
2638: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2631: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2632: p_count => x_msg_count ,
2633: p_data => x_msg_data);
2634: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2635: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.SHAREREADONLY_V2');
2636: END IF;
2637:
2638: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2639: ROLLBACK TO STOPSHARING_V2;
2640: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2641: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2642: p_count => x_msg_count ,
2643: p_data => x_msg_data);
2644: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2645: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.SHAREREADONLY_V2');
2646: END IF;
2647:
2648: WHEN OTHERS THEN
2641: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2642: p_count => x_msg_count ,
2643: p_data => x_msg_data);
2644: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2645: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.SHAREREADONLY_V2');
2646: END IF;
2647:
2648: WHEN OTHERS THEN
2649: ROLLBACK TO STOPSHARING_V2;
2654: END IF;
2655: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2656: p_count => x_msg_count ,
2657: p_data => x_msg_data);
2658: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2659: IBE_Util.Debug('Unknown error in IBE_QUOTE_SAVESHARE_V2_PVT.SHAREREADONLY_V2');
2660: END IF;
2661: END;
2662:
2655: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2656: p_count => x_msg_count ,
2657: p_data => x_msg_data);
2658: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2659: IBE_Util.Debug('Unknown error in IBE_QUOTE_SAVESHARE_V2_PVT.SHAREREADONLY_V2');
2660: END IF;
2661: END;
2662:
2663: /*To delete a recipient (a sort of wrapper around the "raw" delete table hander)
2740: -------------------------------------------------------------------------------------------------------------
2741: --API Body start
2742: -------------------------------------------------------------------------------------------------------------
2743:
2744: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2745: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT: START');
2746: END IF;
2747: FOR rec_find_active_cart in c_find_active_cart loop
2748: IF(rec_find_active_cart.quote_header_id is not null) THEN
2741: --API Body start
2742: -------------------------------------------------------------------------------------------------------------
2743:
2744: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2745: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT: START');
2746: END IF;
2747: FOR rec_find_active_cart in c_find_active_cart loop
2748: IF(rec_find_active_cart.quote_header_id is not null) THEN
2749: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2745: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT: START');
2746: END IF;
2747: FOR rec_find_active_cart in c_find_active_cart loop
2748: IF(rec_find_active_cart.quote_header_id is not null) THEN
2749: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2750: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT:user has an active cart');
2751: IBE_UTIL.DEBUG('Calling update row handler to deactivate the cart');
2752: END IF;
2753: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT:user has an active cart');
2746: END IF;
2747: FOR rec_find_active_cart in c_find_active_cart loop
2748: IF(rec_find_active_cart.quote_header_id is not null) THEN
2749: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2750: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT:user has an active cart');
2751: IBE_UTIL.DEBUG('Calling update row handler to deactivate the cart');
2752: END IF;
2753: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT:user has an active cart');
2754:
2747: FOR rec_find_active_cart in c_find_active_cart loop
2748: IF(rec_find_active_cart.quote_header_id is not null) THEN
2749: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2750: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT:user has an active cart');
2751: IBE_UTIL.DEBUG('Calling update row handler to deactivate the cart');
2752: END IF;
2753: --DBMS_OUTPUT.PUT_LINE('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT:user has an active cart');
2754:
2755: IBE_ACTIVE_QUOTES_ALL_PKG.UPDATE_ROW(
2761: X_CURRENCY_CODE => null ,
2762: x_last_update_date => sysdate ,
2763: x_last_updated_by => fnd_global.user_id ,
2764: x_last_update_login => 1);
2765: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2766: IBE_UTIL.DEBUG('Done calling update row handler to deactivate the cart');
2767: END IF;
2768: END IF;
2769: EXIT WHEN c_find_active_cart%NOTFOUND;
2762: x_last_update_date => sysdate ,
2763: x_last_updated_by => fnd_global.user_id ,
2764: x_last_update_login => 1);
2765: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2766: IBE_UTIL.DEBUG('Done calling update row handler to deactivate the cart');
2767: END IF;
2768: END IF;
2769: EXIT WHEN c_find_active_cart%NOTFOUND;
2770: END LOOP;
2767: END IF;
2768: END IF;
2769: EXIT WHEN c_find_active_cart%NOTFOUND;
2770: END LOOP;
2771: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2772: IBE_UTIL.DEBUG('Calling Update row handler on sh_quote_access table to end-date recipient row');
2773: END IF;
2774: --DBMS_OUTPUT.PUT_LINE('Calling Update row handler on sh_quote_access table to end-date recipient row');
2775:
2768: END IF;
2769: EXIT WHEN c_find_active_cart%NOTFOUND;
2770: END LOOP;
2771: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2772: IBE_UTIL.DEBUG('Calling Update row handler on sh_quote_access table to end-date recipient row');
2773: END IF;
2774: --DBMS_OUTPUT.PUT_LINE('Calling Update row handler on sh_quote_access table to end-date recipient row');
2775:
2776: open c_get_contact_point_ovn(P_Quote_access_rec.quote_sharee_id);
2795:
2796: IBE_SH_QUOTE_ACCESS_PKG.update_Row(
2797: p_quote_sharee_id => P_Quote_access_rec.quote_sharee_id
2798: ,p_end_date_active => sysdate);
2799: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2800: IBE_UTIL.DEBUG('Done calling Update row handler on sh_quote_access table to end-date recipient row');
2801: END IF;
2802: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2803: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT: END');
2796: IBE_SH_QUOTE_ACCESS_PKG.update_Row(
2797: p_quote_sharee_id => P_Quote_access_rec.quote_sharee_id
2798: ,p_end_date_active => sysdate);
2799: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2800: IBE_UTIL.DEBUG('Done calling Update row handler on sh_quote_access table to end-date recipient row');
2801: END IF;
2802: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2803: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT: END');
2804: IBE_UTIL.DEBUG('delete_code is: '||p_delete_code);
2798: ,p_end_date_active => sysdate);
2799: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2800: IBE_UTIL.DEBUG('Done calling Update row handler on sh_quote_access table to end-date recipient row');
2801: END IF;
2802: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2803: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT: END');
2804: IBE_UTIL.DEBUG('delete_code is: '||p_delete_code);
2805: END IF;
2806:
2799: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2800: IBE_UTIL.DEBUG('Done calling Update row handler on sh_quote_access table to end-date recipient row');
2801: END IF;
2802: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2803: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT: END');
2804: IBE_UTIL.DEBUG('delete_code is: '||p_delete_code);
2805: END IF;
2806:
2807: IF (p_quote_access_rec.notify_flag = FND_API.G_TRUE) THEN
2800: IBE_UTIL.DEBUG('Done calling Update row handler on sh_quote_access table to end-date recipient row');
2801: END IF;
2802: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2803: IBE_UTIL.DEBUG('IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT: END');
2804: IBE_UTIL.DEBUG('delete_code is: '||p_delete_code);
2805: END IF;
2806:
2807: IF (p_quote_access_rec.notify_flag = FND_API.G_TRUE) THEN
2808: --Notify_finish_sharing API with the appropriate delete_code
2816:
2817: -- notification that goes to the owner (so and so has finished working this cart)
2818: -- for generic email to owner, we need to add some special parameters since we will not have a retrieval number
2819: l_url := p_url || '&opid=' || l_owner_partyid || '&oaid=' || l_owner_accountid;
2820: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2821: IBE_UTIL.DEBUG('url for generic email to OWNER: '||l_url);
2822: END IF;
2823:
2824: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2817: -- notification that goes to the owner (so and so has finished working this cart)
2818: -- for generic email to owner, we need to add some special parameters since we will not have a retrieval number
2819: l_url := p_url || '&opid=' || l_owner_partyid || '&oaid=' || l_owner_accountid;
2820: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2821: IBE_UTIL.DEBUG('url for generic email to OWNER: '||l_url);
2822: END IF;
2823:
2824: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2825: IBE_UTIL.DEBUG('Calling notify_end_working API');
2820: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2821: IBE_UTIL.DEBUG('url for generic email to OWNER: '||l_url);
2822: END IF;
2823:
2824: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2825: IBE_UTIL.DEBUG('Calling notify_end_working API');
2826: END IF;
2827: IBE_WORKFLOW_PVT.Notify_End_Working(
2828: p_api_version => p_api_version ,
2821: IBE_UTIL.DEBUG('url for generic email to OWNER: '||l_url);
2822: END IF;
2823:
2824: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2825: IBE_UTIL.DEBUG('Calling notify_end_working API');
2826: END IF;
2827: IBE_WORKFLOW_PVT.Notify_End_Working(
2828: p_api_version => p_api_version ,
2829: p_init_msg_list => p_init_msg_list ,
2843: END IF;
2844: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
2845: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2846: END IF;
2847: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2848: IBE_UTIL.DEBUG('Done calling notify_end_working API');
2849: END IF;
2850: ELSE
2851: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2844: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
2845: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2846: END IF;
2847: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2848: IBE_UTIL.DEBUG('Done calling notify_end_working API');
2849: END IF;
2850: ELSE
2851: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2852: IBE_UTIL.DEBUG('Calling notify_finish_sharing API');
2847: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2848: IBE_UTIL.DEBUG('Done calling notify_end_working API');
2849: END IF;
2850: ELSE
2851: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2852: IBE_UTIL.DEBUG('Calling notify_finish_sharing API');
2853: END IF;
2854: --DBMS_OUTPUT.PUT_LINE('Calling notify_stop_sharing API ');
2855: -- notification that goes to the member (you no longer have access to this cart)
2848: IBE_UTIL.DEBUG('Done calling notify_end_working API');
2849: END IF;
2850: ELSE
2851: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2852: IBE_UTIL.DEBUG('Calling notify_finish_sharing API');
2853: END IF;
2854: --DBMS_OUTPUT.PUT_LINE('Calling notify_stop_sharing API ');
2855: -- notification that goes to the member (you no longer have access to this cart)
2856: IBE_WORKFLOW_PVT.Notify_Finish_Sharing(
2871: END IF;
2872: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
2873: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2874: END IF;
2875: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2876: IBE_UTIL.DEBUG('Done calling notify_finish_sharing API');
2877: END IF;
2878: END IF; --end working or finish sharing
2879: END IF; --IF notify_flag is true
2872: IF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
2873: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2874: END IF;
2875: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2876: IBE_UTIL.DEBUG('Done calling notify_finish_sharing API');
2877: END IF;
2878: END IF; --end working or finish sharing
2879: END IF; --IF notify_flag is true
2880:
2884: x_return_status := FND_API.G_RET_STS_ERROR;
2885: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2886: p_count => x_msg_count ,
2887: p_data => x_msg_data);
2888: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2889: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT()');
2890: END IF;
2891:
2892: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2885: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2886: p_count => x_msg_count ,
2887: p_data => x_msg_data);
2888: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2889: IBE_Util.Debug('Expected error in IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT()');
2890: END IF;
2891:
2892: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2893: ROLLBACK TO DELETERECIPIENT_V2;
2894: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2895: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2896: p_count => x_msg_count ,
2897: p_data => x_msg_data);
2898: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2899: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT()');
2900: END IF;
2901:
2902: WHEN OTHERS THEN
2895: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2896: p_count => x_msg_count ,
2897: p_data => x_msg_data);
2898: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2899: IBE_Util.Debug('Unexpected error in IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT()');
2900: END IF;
2901:
2902: WHEN OTHERS THEN
2903: ROLLBACK TO DELETERECIPIENT_V2;
2908: END IF;
2909: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2910: p_count => x_msg_count ,
2911: p_data => x_msg_data);
2912: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2913: IBE_Util.Debug('Unknown error in IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT()');
2914: END IF;
2915:
2916: END;
2909: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
2910: p_count => x_msg_count ,
2911: p_data => x_msg_data);
2912: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2913: IBE_Util.Debug('Unknown error in IBE_QUOTE_SAVESHARE_V2_PVT.DELETE_RECIPIENT()');
2914: END IF;
2915:
2916: END;
2917:
2982: rec_get_recipient_info c_get_recipient_info%rowtype;
2983:
2984: BEGIN
2985:
2986: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2987: IBE_UTIL.DEBUG('Begin validate_share_update : ' || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
2988: END IF;
2989:
2990: -- Standard call to check for call compatibility.
2983:
2984: BEGIN
2985:
2986: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
2987: IBE_UTIL.DEBUG('Begin validate_share_update : ' || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
2988: END IF;
2989:
2990: -- Standard call to check for call compatibility.
2991: IF NOT FND_API.Compatible_API_Call (l_api_version,
3007:
3008: -- API body
3009: -- start by returning the input
3010:
3011: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3012: IBE_UTIL.DEBUG('Incoming quote_header_id is :'||p_quote_header_rec.quote_header_id);
3013: IBE_UTIL.DEBUG('Incoming operation_code is :'||p_operation_code);
3014: IBE_UTIL.DEBUG('Incoming party_id is :'||p_party_id);
3015: IBE_UTIL.DEBUG('Incoming account_id is :'||p_cust_account_id);
3008: -- API body
3009: -- start by returning the input
3010:
3011: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3012: IBE_UTIL.DEBUG('Incoming quote_header_id is :'||p_quote_header_rec.quote_header_id);
3013: IBE_UTIL.DEBUG('Incoming operation_code is :'||p_operation_code);
3014: IBE_UTIL.DEBUG('Incoming party_id is :'||p_party_id);
3015: IBE_UTIL.DEBUG('Incoming account_id is :'||p_cust_account_id);
3016: IBE_UTIL.DEBUG('Incoming retrieval_number is :'||p_retrieval_number);
3009: -- start by returning the input
3010:
3011: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3012: IBE_UTIL.DEBUG('Incoming quote_header_id is :'||p_quote_header_rec.quote_header_id);
3013: IBE_UTIL.DEBUG('Incoming operation_code is :'||p_operation_code);
3014: IBE_UTIL.DEBUG('Incoming party_id is :'||p_party_id);
3015: IBE_UTIL.DEBUG('Incoming account_id is :'||p_cust_account_id);
3016: IBE_UTIL.DEBUG('Incoming retrieval_number is :'||p_retrieval_number);
3017: END IF;
3010:
3011: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3012: IBE_UTIL.DEBUG('Incoming quote_header_id is :'||p_quote_header_rec.quote_header_id);
3013: IBE_UTIL.DEBUG('Incoming operation_code is :'||p_operation_code);
3014: IBE_UTIL.DEBUG('Incoming party_id is :'||p_party_id);
3015: IBE_UTIL.DEBUG('Incoming account_id is :'||p_cust_account_id);
3016: IBE_UTIL.DEBUG('Incoming retrieval_number is :'||p_retrieval_number);
3017: END IF;
3018:
3011: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3012: IBE_UTIL.DEBUG('Incoming quote_header_id is :'||p_quote_header_rec.quote_header_id);
3013: IBE_UTIL.DEBUG('Incoming operation_code is :'||p_operation_code);
3014: IBE_UTIL.DEBUG('Incoming party_id is :'||p_party_id);
3015: IBE_UTIL.DEBUG('Incoming account_id is :'||p_cust_account_id);
3016: IBE_UTIL.DEBUG('Incoming retrieval_number is :'||p_retrieval_number);
3017: END IF;
3018:
3019: /* FOR rec_userenv_partyid in c_userenv_partyid LOOP
3012: IBE_UTIL.DEBUG('Incoming quote_header_id is :'||p_quote_header_rec.quote_header_id);
3013: IBE_UTIL.DEBUG('Incoming operation_code is :'||p_operation_code);
3014: IBE_UTIL.DEBUG('Incoming party_id is :'||p_party_id);
3015: IBE_UTIL.DEBUG('Incoming account_id is :'||p_cust_account_id);
3016: IBE_UTIL.DEBUG('Incoming retrieval_number is :'||p_retrieval_number);
3017: END IF;
3018:
3019: /* FOR rec_userenv_partyid in c_userenv_partyid LOOP
3020: l_userenv_party_id := rec_userenv_partyid.customer_id;
3028: ------------ USER VALIDATION - must be either owner or valid recipient ------------------------------
3029: if (l_owner_party_id <> p_party_id) then
3030: l_is_owner := FND_API.G_FALSE;
3031: else
3032: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3033: IBE_Util.Debug('Initiator is OWNER');
3034: END IF;
3035: end if;
3036:
3029: if (l_owner_party_id <> p_party_id) then
3030: l_is_owner := FND_API.G_FALSE;
3031: else
3032: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3033: IBE_Util.Debug('Initiator is OWNER');
3034: END IF;
3035: end if;
3036:
3037: -- if ((l_is_owner = FND_API.G_FALSE) and (p_operation_code <> OP_END_WORKING)) then
3036:
3037: -- if ((l_is_owner = FND_API.G_FALSE) and (p_operation_code <> OP_END_WORKING)) then
3038: if (l_is_owner = FND_API.G_FALSE) then
3039: -- if user is not the owner then we need to make sure he is a valid member
3040: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3041: IBE_Util.Debug('Initiator may be RECIPIENT');
3042: END IF;
3043: if ((p_retrieval_number is not null) and (p_retrieval_number <> FND_API.G_MISS_NUM)) then
3044: FOR rec_get_role_by_retr_num in c_get_role_by_retr_num(p_retrieval_number, p_party_id, p_cust_account_id) LOOP
3037: -- if ((l_is_owner = FND_API.G_FALSE) and (p_operation_code <> OP_END_WORKING)) then
3038: if (l_is_owner = FND_API.G_FALSE) then
3039: -- if user is not the owner then we need to make sure he is a valid member
3040: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3041: IBE_Util.Debug('Initiator may be RECIPIENT');
3042: END IF;
3043: if ((p_retrieval_number is not null) and (p_retrieval_number <> FND_API.G_MISS_NUM)) then
3044: FOR rec_get_role_by_retr_num in c_get_role_by_retr_num(p_retrieval_number, p_party_id, p_cust_account_id) LOOP
3045: l_access_level := rec_get_role_by_retr_num.update_privilege_type_code;
3050: l_access_level := rec_get_role_by_user.update_privilege_type_code;
3051: EXIT when c_get_role_by_user%notfound;
3052: END LOOP;
3053: end if;
3054: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3055: IBE_Util.Debug('RECIPIENT access level: ' || l_access_level);
3056: END IF;
3057: if (l_access_level is null) then
3058: IF FND_Msg_Pub.Check_Msg_Level (FND_Msg_Pub.G_MSG_LVL_ERROR) THEN
3051: EXIT when c_get_role_by_user%notfound;
3052: END LOOP;
3053: end if;
3054: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3055: IBE_Util.Debug('RECIPIENT access level: ' || l_access_level);
3056: END IF;
3057: if (l_access_level is null) then
3058: IF FND_Msg_Pub.Check_Msg_Level (FND_Msg_Pub.G_MSG_LVL_ERROR) THEN
3059: FND_Message.Set_Name('IBE', 'IBE_SC_ERR_USERACCESS');
3100: elsif ((p_operation_code = OP_ACTIVATE_QUOTE) or (p_operation_code = OP_DEACTIVATE)) then
3101: l_check_updates := FND_API.G_FALSE; -- no validations to do here that have not already been done
3102: end if; -- end if else over operation_code
3103:
3104: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3105: IBE_UTIL.DEBUG('l_check_onlynotify is :'||l_check_onlynotify);
3106: IBE_UTIL.DEBUG('l_check_updates is :'||l_check_updates);
3107: END IF;
3108:
3101: l_check_updates := FND_API.G_FALSE; -- no validations to do here that have not already been done
3102: end if; -- end if else over operation_code
3103:
3104: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3105: IBE_UTIL.DEBUG('l_check_onlynotify is :'||l_check_onlynotify);
3106: IBE_UTIL.DEBUG('l_check_updates is :'||l_check_updates);
3107: END IF;
3108:
3109: ------------ VALIDATIONS ON THE INPUT QUOTE ACCESS TABLE ------------------------------
3102: end if; -- end if else over operation_code
3103:
3104: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3105: IBE_UTIL.DEBUG('l_check_onlynotify is :'||l_check_onlynotify);
3106: IBE_UTIL.DEBUG('l_check_updates is :'||l_check_updates);
3107: END IF;
3108:
3109: ------------ VALIDATIONS ON THE INPUT QUOTE ACCESS TABLE ------------------------------
3110: if ((l_check_updates = FND_API.G_TRUE) or (l_check_onlynotify = FND_API.G_TRUE)) then
3109: ------------ VALIDATIONS ON THE INPUT QUOTE ACCESS TABLE ------------------------------
3110: if ((l_check_updates = FND_API.G_TRUE) or (l_check_onlynotify = FND_API.G_TRUE)) then
3111: l_env_user_id := FND_GLOBAL.USER_ID;
3112: FOR i in 1..p_quote_access_tbl.count LOOP
3113: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3114: IBE_UTIL.DEBUG('current quote_sharee_id : '||p_quote_access_tbl(i).quote_sharee_id);
3115: end if;
3116: -- populate a local table with all the db data - but index it according to the input table
3117: -- in this loop, we will check every opcode if necessary
3110: if ((l_check_updates = FND_API.G_TRUE) or (l_check_onlynotify = FND_API.G_TRUE)) then
3111: l_env_user_id := FND_GLOBAL.USER_ID;
3112: FOR i in 1..p_quote_access_tbl.count LOOP
3113: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3114: IBE_UTIL.DEBUG('current quote_sharee_id : '||p_quote_access_tbl(i).quote_sharee_id);
3115: end if;
3116: -- populate a local table with all the db data - but index it according to the input table
3117: -- in this loop, we will check every opcode if necessary
3118: -- down below, we will end up only checking the ones that have a shareeid
3126: l_db_quote_access_tbl(i).end_date_active := rec_get_recipient_info.end_date_active;
3127: l_db_quote_access_tbl(i).update_privilege_type_code := rec_get_recipient_info.update_privilege_type_code;
3128: EXIT when c_get_recipient_info%notfound;
3129: END LOOP;
3130: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3131: IBE_UTIL.DEBUG('input op_code : '||p_quote_access_tbl(i).operation_code);
3132: IBE_UTIL.DEBUG('input last_update_date : '||to_char(p_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3133: IBE_UTIL.DEBUG('db last_update_date : '||to_char(l_db_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3134: IBE_UTIL.DEBUG('input access_level : '||p_quote_access_tbl(i).update_privilege_type_code);
3127: l_db_quote_access_tbl(i).update_privilege_type_code := rec_get_recipient_info.update_privilege_type_code;
3128: EXIT when c_get_recipient_info%notfound;
3129: END LOOP;
3130: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3131: IBE_UTIL.DEBUG('input op_code : '||p_quote_access_tbl(i).operation_code);
3132: IBE_UTIL.DEBUG('input last_update_date : '||to_char(p_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3133: IBE_UTIL.DEBUG('db last_update_date : '||to_char(l_db_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3134: IBE_UTIL.DEBUG('input access_level : '||p_quote_access_tbl(i).update_privilege_type_code);
3135: IBE_UTIL.DEBUG('db access_level : '||l_db_quote_access_tbl(i).update_privilege_type_code);
3128: EXIT when c_get_recipient_info%notfound;
3129: END LOOP;
3130: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3131: IBE_UTIL.DEBUG('input op_code : '||p_quote_access_tbl(i).operation_code);
3132: IBE_UTIL.DEBUG('input last_update_date : '||to_char(p_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3133: IBE_UTIL.DEBUG('db last_update_date : '||to_char(l_db_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3134: IBE_UTIL.DEBUG('input access_level : '||p_quote_access_tbl(i).update_privilege_type_code);
3135: IBE_UTIL.DEBUG('db access_level : '||l_db_quote_access_tbl(i).update_privilege_type_code);
3136: end if;
3129: END LOOP;
3130: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3131: IBE_UTIL.DEBUG('input op_code : '||p_quote_access_tbl(i).operation_code);
3132: IBE_UTIL.DEBUG('input last_update_date : '||to_char(p_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3133: IBE_UTIL.DEBUG('db last_update_date : '||to_char(l_db_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3134: IBE_UTIL.DEBUG('input access_level : '||p_quote_access_tbl(i).update_privilege_type_code);
3135: IBE_UTIL.DEBUG('db access_level : '||l_db_quote_access_tbl(i).update_privilege_type_code);
3136: end if;
3137: -- do the opcode permissions check as we loop
3130: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3131: IBE_UTIL.DEBUG('input op_code : '||p_quote_access_tbl(i).operation_code);
3132: IBE_UTIL.DEBUG('input last_update_date : '||to_char(p_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3133: IBE_UTIL.DEBUG('db last_update_date : '||to_char(l_db_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3134: IBE_UTIL.DEBUG('input access_level : '||p_quote_access_tbl(i).update_privilege_type_code);
3135: IBE_UTIL.DEBUG('db access_level : '||l_db_quote_access_tbl(i).update_privilege_type_code);
3136: end if;
3137: -- do the opcode permissions check as we loop
3138: if (l_check_onlynotify = FND_API.G_TRUE) then
3131: IBE_UTIL.DEBUG('input op_code : '||p_quote_access_tbl(i).operation_code);
3132: IBE_UTIL.DEBUG('input last_update_date : '||to_char(p_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3133: IBE_UTIL.DEBUG('db last_update_date : '||to_char(l_db_quote_access_tbl(i).last_update_date,'mm/dd/yyyy:hh24:MI:SS'));
3134: IBE_UTIL.DEBUG('input access_level : '||p_quote_access_tbl(i).update_privilege_type_code);
3135: IBE_UTIL.DEBUG('db access_level : '||l_db_quote_access_tbl(i).update_privilege_type_code);
3136: end if;
3137: -- do the opcode permissions check as we loop
3138: if (l_check_onlynotify = FND_API.G_TRUE) then
3139: -- make sure we are not creating, deleting, or doing any real updates
3154: end loop; -- end loop over input access tbl
3155: -- second loop to check last update dates
3156: if (l_check_updates = FND_API.G_TRUE) then
3157: FOR i in 1..p_quote_access_tbl.count LOOP
3158: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3159: IBE_UTIL.DEBUG('current quote_sharee_id : '||p_quote_access_tbl(i).quote_sharee_id);
3160: end if;
3161: if ((p_quote_access_tbl(i).quote_sharee_id is not null)
3162: and (p_quote_access_tbl(i).quote_sharee_id <> fnd_api.g_miss_num)) then
3155: -- second loop to check last update dates
3156: if (l_check_updates = FND_API.G_TRUE) then
3157: FOR i in 1..p_quote_access_tbl.count LOOP
3158: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3159: IBE_UTIL.DEBUG('current quote_sharee_id : '||p_quote_access_tbl(i).quote_sharee_id);
3160: end if;
3161: if ((p_quote_access_tbl(i).quote_sharee_id is not null)
3162: and (p_quote_access_tbl(i).quote_sharee_id <> fnd_api.g_miss_num)) then
3163:
3164: if ((p_quote_access_tbl(i).last_update_date <> FND_API.G_MISS_DATE) and
3165: (p_quote_access_tbl(i).last_update_date <> l_db_quote_access_tbl(i).last_update_date)) then
3166: -- i.e. don't throw exception if we want to end a row and it's already enddated.
3167: if ((p_quote_access_tbl(i).operation_code = 'DELETE') and (nvl(l_db_quote_access_tbl(i).end_date_active,sysdate-1) < sysdate)) then
3168: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3169: IBE_UTIL.DEBUG('deleteing an end dated row, allowing it to pass through');
3170: end if;
3171: elsif (l_env_user_id = l_db_quote_access_tbl(i).last_updated_by) then
3172: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3165: (p_quote_access_tbl(i).last_update_date <> l_db_quote_access_tbl(i).last_update_date)) then
3166: -- i.e. don't throw exception if we want to end a row and it's already enddated.
3167: if ((p_quote_access_tbl(i).operation_code = 'DELETE') and (nvl(l_db_quote_access_tbl(i).end_date_active,sysdate-1) < sysdate)) then
3168: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3169: IBE_UTIL.DEBUG('deleteing an end dated row, allowing it to pass through');
3170: end if;
3171: elsif (l_env_user_id = l_db_quote_access_tbl(i).last_updated_by) then
3172: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3173: IBE_UTIL.DEBUG('timestamps do not match, but user was the last to update the row so allowing it to go through');
3168: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3169: IBE_UTIL.DEBUG('deleteing an end dated row, allowing it to pass through');
3170: end if;
3171: elsif (l_env_user_id = l_db_quote_access_tbl(i).last_updated_by) then
3172: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3173: IBE_UTIL.DEBUG('timestamps do not match, but user was the last to update the row so allowing it to go through');
3174: end if;
3175: else
3176: IF FND_Msg_Pub.Check_Msg_Level (FND_Msg_Pub.G_MSG_LVL_ERROR) THEN
3169: IBE_UTIL.DEBUG('deleteing an end dated row, allowing it to pass through');
3170: end if;
3171: elsif (l_env_user_id = l_db_quote_access_tbl(i).last_updated_by) then
3172: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3173: IBE_UTIL.DEBUG('timestamps do not match, but user was the last to update the row so allowing it to go through');
3174: end if;
3175: else
3176: IF FND_Msg_Pub.Check_Msg_Level (FND_Msg_Pub.G_MSG_LVL_ERROR) THEN
3177: FND_Message.Set_Name('IBE', 'IBE_SC_ERR_MEMBERS_OUT_OF_SYNC');
3185: end loop; -- end loop over input quote access tbl
3186: end if; -- end if doing check updates
3187: end if; -- end check of updates
3188:
3189: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3190: IBE_UTIL.DEBUG('End validate_share_update' || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
3191: END IF;
3192:
3193: EXCEPTION
3186: end if; -- end if doing check updates
3187: end if; -- end check of updates
3188:
3189: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3190: IBE_UTIL.DEBUG('End validate_share_update' || to_char(sysdate, 'mm/dd/yyyy:hh24:MI:SS'));
3191: END IF;
3192:
3193: EXCEPTION
3194: WHEN FND_API.G_EXC_ERROR THEN
3195: x_return_status := FND_API.G_RET_STS_ERROR;
3196: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
3197: p_count => x_msg_count ,
3198: p_data => x_msg_data);
3199: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3200: IBE_Util.Debug('End IBE_Quote_Misc_pvt.validate_share_update: expected error');
3201: END IF;
3202: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3203: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3196: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
3197: p_count => x_msg_count ,
3198: p_data => x_msg_data);
3199: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3200: IBE_Util.Debug('End IBE_Quote_Misc_pvt.validate_share_update: expected error');
3201: END IF;
3202: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3203: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3204: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
3203: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3204: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
3205: p_count => x_msg_count ,
3206: p_data => x_msg_data);
3207: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3208: IBE_Util.Debug('End IBE_Quote_Misc_pvt.validate_share_update: unexpected error');
3209: END IF;
3210: WHEN OTHERS THEN
3211: IF FND_Msg_Pub.Check_Msg_Level(FND_Msg_Pub.G_MSG_LVL_UNEXP_ERROR) THEN
3204: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
3205: p_count => x_msg_count ,
3206: p_data => x_msg_data);
3207: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3208: IBE_Util.Debug('End IBE_Quote_Misc_pvt.validate_share_update: unexpected error');
3209: END IF;
3210: WHEN OTHERS THEN
3211: IF FND_Msg_Pub.Check_Msg_Level(FND_Msg_Pub.G_MSG_LVL_UNEXP_ERROR) THEN
3212: FND_Msg_Pub.Add_Exc_Msg(G_PKG_NAME,
3214: END IF;
3215: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
3216: p_count => x_msg_count ,
3217: p_data => x_msg_data);
3218: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3219: IBE_Util.Debug('End IBE_Quote_Misc_pvt.validate_share_update: other exception');
3220: END IF;
3221: END validate_share_update;
3222:
3215: FND_Msg_Pub.Count_And_Get(p_encoded => FND_API.G_FALSE,
3216: p_count => x_msg_count ,
3217: p_data => x_msg_data);
3218: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
3219: IBE_Util.Debug('End IBE_Quote_Misc_pvt.validate_share_update: other exception');
3220: END IF;
3221: END validate_share_update;
3222:
3223: END IBE_QUOTE_SAVESHARE_V2_PVT;