47: into x_auction_header_id
48: from pon_bid_headers
49: where bid_number = p_contracts_doc_id;
50:
51: x_return_status := fnd_api.g_ret_sts_success;
52: exception
53: when others then
54: x_return_status := fnd_api.g_ret_sts_error;
55: x_msg_data := 'Bad Bid Number ' || p_contracts_doc_id;
50:
51: x_return_status := fnd_api.g_ret_sts_success;
52: exception
53: when others then
54: x_return_status := fnd_api.g_ret_sts_error;
55: x_msg_data := 'Bad Bid Number ' || p_contracts_doc_id;
56: x_msg_count := 1;
57: end;
58: else
55: x_msg_data := 'Bad Bid Number ' || p_contracts_doc_id;
56: x_msg_count := 1;
57: end;
58: else
59: x_return_status := fnd_api.g_ret_sts_error;
60: x_msg_data := 'Unknown doctype ' || p_contracts_doctype;
61: x_msg_count := 1;
62: end if;
63:
61: x_msg_count := 1;
62: end if;
63:
64: -- success!
65: x_return_status := fnd_api.g_ret_sts_success;
66: END get_auction_header_id;
67:
68:
69: FUNCTION get_response_doc_type(p_doc_type_id IN NUMBER) RETURN VARCHAR2 IS
111:
112: -- read the global variable that stores the profile option.
113:
114: IF (g_contracts_installed_flag = 'Y') THEN
115: RETURN FND_API.G_TRUE;
116: ELSE
117: RETURN FND_API.G_FALSE;
118: END IF;
119:
113:
114: IF (g_contracts_installed_flag = 'Y') THEN
115: RETURN FND_API.G_TRUE;
116: ELSE
117: RETURN FND_API.G_FALSE;
118: END IF;
119:
120: EXCEPTION
121: WHEN OTHERS THEN
269:
270: l_api_name CONSTANT VARCHAR2(30) := 'activateDeliverables';
271: l_api_version CONSTANT NUMBER := 1.0;
272:
273: l_init_msg_list VARCHAR2(1) := FND_API.G_FALSE;
274: l_doc_type_id NUMBER;
275: l_bus_doc_type VARCHAR2(30) ;
276: l_open_date DATE;
277: l_close_date DATE;
296:
297:
298: BEGIN
299:
300: x_result := FND_API.g_ret_sts_success;
301:
302: select doctype_id, open_bidding_date, close_bidding_date, org_id
303: into l_doc_type_id, l_open_date, l_close_date, l_org_id
304: from pon_auction_headers_all
314: if (p_old_bid_number <>-1) then
315: select bid_status into l_old_bid_status from pon_bid_headers where bid_number = p_old_bid_number;
316: end if;
317:
318: if (is_contracts_installed() = FND_API.G_TRUE) then
319:
320: begin
321: --{
322: --
334: -- bug 3608706 - new api to update the status history
335:
336: OKC_MANAGE_DELIVERABLES_GRP.postDelStatusChanges (
337: p_api_version => 1.0,
338: p_init_msg_list => FND_API.G_FALSE,
339: p_commit => FND_API.G_FALSE,
340: p_bus_doc_id => p_new_bid_number,
341: p_bus_doc_type => l_bus_doc_type,
342: p_bus_doc_version => -99,
335:
336: OKC_MANAGE_DELIVERABLES_GRP.postDelStatusChanges (
337: p_api_version => 1.0,
338: p_init_msg_list => FND_API.G_FALSE,
339: p_commit => FND_API.G_FALSE,
340: p_bus_doc_id => p_new_bid_number,
341: p_bus_doc_type => l_bus_doc_type,
342: p_bus_doc_version => -99,
343: x_msg_data => l_msg_data,
356: -- activate deliverables for the new bid
357:
358: OKC_MANAGE_DELIVERABLES_GRP.activateDeliverables (
359: p_api_version => 1.0,
360: p_init_msg_list => FND_API.G_FALSE,
361: p_commit => FND_API.G_FALSE,
362: p_bus_doc_id => p_new_bid_number,
363: p_bus_doc_type => l_bus_doc_type,
364: p_bus_doc_version => -99,
357:
358: OKC_MANAGE_DELIVERABLES_GRP.activateDeliverables (
359: p_api_version => 1.0,
360: p_init_msg_list => FND_API.G_FALSE,
361: p_commit => FND_API.G_FALSE,
362: p_bus_doc_id => p_new_bid_number,
363: p_bus_doc_type => l_bus_doc_type,
364: p_bus_doc_version => -99,
365: p_event_code => PON_CONTERMS_UTL_PVT.RESPONSE_RECEIVED,
370: x_return_status => l_return_status);
371:
372: -- keep logging
373:
374: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
375: x_result := FND_API.G_RET_STS_ERROR;
376: x_error_code := '20001';
377: x_error_message := 'ACTIVATE_FAILED';
378:
371:
372: -- keep logging
373:
374: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
375: x_result := FND_API.G_RET_STS_ERROR;
376: x_error_code := '20001';
377: x_error_message := 'ACTIVATE_FAILED';
378:
379: IF (g_fnd_debug = 'Y') THEN
383: module => g_module_prefix || l_api_name,
384: message => l_msg_data);
385: END IF;
386: END IF;
387: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
388: END IF;
389:
390: OKC_MANAGE_DELIVERABLES_GRP.enableNotifications(
391: p_api_version => 1.0,
388: END IF;
389:
390: OKC_MANAGE_DELIVERABLES_GRP.enableNotifications(
391: p_api_version => 1.0,
392: p_init_msg_list => FND_API.G_FALSE,
393: p_commit => FND_API.G_FALSE,
394: p_bus_doc_id => p_new_bid_number,
395: p_bus_doc_type => l_bus_doc_type,
396: p_bus_doc_version => -99,
389:
390: OKC_MANAGE_DELIVERABLES_GRP.enableNotifications(
391: p_api_version => 1.0,
392: p_init_msg_list => FND_API.G_FALSE,
393: p_commit => FND_API.G_FALSE,
394: p_bus_doc_id => p_new_bid_number,
395: p_bus_doc_type => l_bus_doc_type,
396: p_bus_doc_version => -99,
397: x_msg_data => l_msg_data,
397: x_msg_data => l_msg_data,
398: x_msg_count => l_msg_count,
399: x_return_status => l_return_status);
400:
401: IF (l_return_status < FND_API.G_RET_STS_SUCCESS) THEN
402: x_result := FND_API.G_RET_STS_ERROR;
403: x_error_code := '20002';
404: x_error_message := 'ENABLE_NOTIF_FAILED';
405:
398: x_msg_count => l_msg_count,
399: x_return_status => l_return_status);
400:
401: IF (l_return_status < FND_API.G_RET_STS_SUCCESS) THEN
402: x_result := FND_API.G_RET_STS_ERROR;
403: x_error_code := '20002';
404: x_error_message := 'ENABLE_NOTIF_FAILED';
405:
406: IF (g_fnd_debug = 'Y') THEN
421: IF (p_old_bid_number <>-1 AND l_new_bid_status = 'ACTIVE') THEN
422:
423: OKC_MANAGE_DELIVERABLES_GRP.cancelDeliverables (
424: p_api_version => 1.0,
425: p_init_msg_list => FND_API.G_FALSE,
426: p_commit => FND_API.G_FALSE,
427: p_bus_doc_id => p_old_bid_number,
428: p_bus_doc_type => l_bus_doc_type,
429: p_bus_doc_version => -99,
422:
423: OKC_MANAGE_DELIVERABLES_GRP.cancelDeliverables (
424: p_api_version => 1.0,
425: p_init_msg_list => FND_API.G_FALSE,
426: p_commit => FND_API.G_FALSE,
427: p_bus_doc_id => p_old_bid_number,
428: p_bus_doc_type => l_bus_doc_type,
429: p_bus_doc_version => -99,
430: x_msg_data => l_msg_data,
430: x_msg_data => l_msg_data,
431: x_msg_count => l_msg_count,
432: x_return_status => l_return_status);
433:
434: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
435:
436: x_result := FND_API.G_RET_STS_ERROR;
437: x_error_code := '20003';
438: x_error_message := 'CANCEL_DELIV_FAILED';
432: x_return_status => l_return_status);
433:
434: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
435:
436: x_result := FND_API.G_RET_STS_ERROR;
437: x_error_code := '20003';
438: x_error_message := 'CANCEL_DELIV_FAILED';
439:
440: IF (g_fnd_debug = 'Y') THEN
447: END IF;
448:
449: END IF;
450:
451: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
452:
453: END IF; -- IF (l_return_status <> FND_API.G_RET_STS_SUCCESS)
454:
455: END IF; -- if (p_old_bid_number <>-1 AND l_new_bid_status = 'ACTIVE')
449: END IF;
450:
451: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
452:
453: END IF; -- IF (l_return_status <> FND_API.G_RET_STS_SUCCESS)
454:
455: END IF; -- if (p_old_bid_number <>-1 AND l_new_bid_status = 'ACTIVE')
456: --}
457: exception
533:
534:
535: BEGIN
536:
537: if (is_contracts_installed() = FND_API.G_TRUE) then
538:
539: BEGIN
540:
541: -- get the contract doc type depending on p_doc_type_id
571: -- Call Contracts API for updating negotiation first
572:
573: OKC_MANAGE_DELIVERABLES_GRP.updateDeliverables(
574: p_api_version => 1.0,
575: p_init_msg_list => FND_API.G_FALSE,
576: p_commit => FND_API.G_FALSE,
577: p_bus_doc_id => p_auction_header_id,
578: p_bus_doc_type => l_negotiation_doc_type,
579: p_bus_doc_version => -99,
572:
573: OKC_MANAGE_DELIVERABLES_GRP.updateDeliverables(
574: p_api_version => 1.0,
575: p_init_msg_list => FND_API.G_FALSE,
576: p_commit => FND_API.G_FALSE,
577: p_bus_doc_id => p_auction_header_id,
578: p_bus_doc_type => l_negotiation_doc_type,
579: p_bus_doc_version => -99,
580: p_bus_doc_date_events_tbl => l_bus_doc_dates_tbl,
582: x_msg_count => x_msg_count,
583: x_return_status => l_return_status
584: );
585:
586: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
587: IF (g_fnd_debug = 'Y') THEN
588: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.g_current_runtime_level) THEN
589: FND_LOG.string(log_level => FND_LOG.LEVEL_PROCEDURE ,
590: module => g_module_prefix || l_api_name,
602: IF (current_amendment.auction_header_id <> p_auction_header_id) THEN
603:
604: OKC_MANAGE_DELIVERABLES_GRP.updateDeliverables(
605: p_api_version => 1.0,
606: p_init_msg_list => FND_API.G_FALSE,
607: p_commit => FND_API.G_FALSE,
608: p_bus_doc_id => current_amendment.auction_header_id,
609: p_bus_doc_type => l_negotiation_doc_type,
610: p_bus_doc_version => -99,
603:
604: OKC_MANAGE_DELIVERABLES_GRP.updateDeliverables(
605: p_api_version => 1.0,
606: p_init_msg_list => FND_API.G_FALSE,
607: p_commit => FND_API.G_FALSE,
608: p_bus_doc_id => current_amendment.auction_header_id,
609: p_bus_doc_type => l_negotiation_doc_type,
610: p_bus_doc_version => -99,
611: p_bus_doc_date_events_tbl => l_bus_doc_dates_tbl,
613: x_msg_count => x_msg_count,
614: x_return_status => l_return_status
615: );
616:
617: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
618: IF (g_fnd_debug = 'Y') THEN
619: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.g_current_runtime_level) THEN
620: FND_LOG.string(log_level => FND_LOG.LEVEL_PROCEDURE ,
621: module => g_module_prefix || l_api_name,
636: FOR active_bid IN active_bids LOOP
637:
638: OKC_MANAGE_DELIVERABLES_GRP.updateDeliverables(
639: p_api_version => 1.0,
640: p_init_msg_list => FND_API.G_FALSE,
641: p_commit => FND_API.G_FALSE,
642: p_bus_doc_id => active_bid.bid_number,
643: p_bus_doc_type => l_response_doc_type,
644: p_bus_doc_version => -99,
637:
638: OKC_MANAGE_DELIVERABLES_GRP.updateDeliverables(
639: p_api_version => 1.0,
640: p_init_msg_list => FND_API.G_FALSE,
641: p_commit => FND_API.G_FALSE,
642: p_bus_doc_id => active_bid.bid_number,
643: p_bus_doc_type => l_response_doc_type,
644: p_bus_doc_version => -99,
645: p_bus_doc_date_events_tbl => l_bus_doc_dates_tbl,
646: x_msg_data => l_msg_data,
647: x_msg_count => x_msg_count,
648: x_return_status => l_return_status
649: );
650: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
651: IF (g_fnd_debug = 'Y') THEN
652: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.g_current_runtime_level) THEN
653: FND_LOG.string(log_level => FND_LOG.LEVEL_PROCEDURE ,
654: module => g_module_prefix || l_api_name,
724: from pon_auction_headers_all
725: where auction_header_id=p_auction_header_id;
726: end if;
727:
728: if (is_contracts_installed() = FND_API.G_TRUE) then
729:
730: BEGIN
731:
732: select org_id
751:
752: -- Call Contracts API for cancelling negotiation 's delvierablesfirst
753: OKC_MANAGE_DELIVERABLES_GRP.cancelDeliverables(
754: p_api_version => 1.0,
755: p_init_msg_list => FND_API.G_FALSE,
756: p_commit => FND_API.G_FALSE,
757: p_bus_doc_id => p_auction_header_id,
758: p_bus_doc_type => l_negotiation_doc_type,
759: p_bus_doc_version => -99,
752: -- Call Contracts API for cancelling negotiation 's delvierablesfirst
753: OKC_MANAGE_DELIVERABLES_GRP.cancelDeliverables(
754: p_api_version => 1.0,
755: p_init_msg_list => FND_API.G_FALSE,
756: p_commit => FND_API.G_FALSE,
757: p_bus_doc_id => p_auction_header_id,
758: p_bus_doc_type => l_negotiation_doc_type,
759: p_bus_doc_version => -99,
760: x_msg_data => l_msg_data,
762: x_return_status => l_return_status
763: );
764:
765:
766: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
767: IF (g_fnd_debug = 'Y') THEN
768: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.g_current_runtime_level) THEN
769: FND_LOG.string(log_level => FND_LOG.LEVEL_PROCEDURE ,
770: module => g_module_prefix || l_api_name,
775: -- Call Contracts API for cancel Active Bids' deliverables
776: FOR active_bid IN active_bids LOOP
777: OKC_MANAGE_DELIVERABLES_GRP.cancelDeliverables(
778: p_api_version => 1.0,
779: p_init_msg_list => FND_API.G_FALSE,
780: p_commit => FND_API.G_FALSE,
781: p_bus_doc_id => active_bid.bid_number,
782: p_bus_doc_type => l_response_doc_type,
783: p_bus_doc_version => -99,
776: FOR active_bid IN active_bids LOOP
777: OKC_MANAGE_DELIVERABLES_GRP.cancelDeliverables(
778: p_api_version => 1.0,
779: p_init_msg_list => FND_API.G_FALSE,
780: p_commit => FND_API.G_FALSE,
781: p_bus_doc_id => active_bid.bid_number,
782: p_bus_doc_type => l_response_doc_type,
783: p_bus_doc_version => -99,
784: x_msg_data => l_msg_data,
785: x_msg_count => x_msg_count,
786: x_return_status => l_return_status
787: );
788:
789: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
790: IF (g_fnd_debug = 'Y') THEN
791: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.g_current_runtime_level) THEN
792: FND_LOG.string(log_level => FND_LOG.LEVEL_PROCEDURE ,
793: module => g_module_prefix || l_api_name,
850: l_org_id NUMBER;
851:
852: BEGIN
853:
854: if (is_contracts_installed() = FND_API.G_TRUE) then
855:
856: BEGIN
857:
858: -- get the contract doc type depending on p_doc_type_id
881: x_msg_data => l_msg_data,
882: x_msg_count => x_msg_count,
883: x_return_status => l_return_status
884: );
885: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
886: IF (g_fnd_debug = 'Y') THEN
887: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.g_current_runtime_level) THEN
888: FND_LOG.string(log_level => FND_LOG.LEVEL_PROCEDURE ,
889: module => g_module_prefix || l_api_name,
952: indx PLS_INTEGER := 0;
953:
954: BEGIN
955:
956: if (is_contracts_installed() = FND_API.G_TRUE) then
957:
958: BEGIN
959:
960: SELECT doctype_id, view_by_Date, open_bidding_date, close_bidding_date, org_id
986: mo_global.set_policy_context('S', l_org_id);
987:
988: OKC_MANAGE_DELIVERABLES_GRP.resolveDeliverables(
989: p_api_version => 1.0,
990: p_init_msg_list => FND_API.G_FALSE,
991: p_commit => FND_API.G_FALSE,
992: p_bus_doc_id => p_auction_header_id,
993: p_bus_doc_type => l_negotiation_doc_type,
994: p_bus_doc_version => -99,
987:
988: OKC_MANAGE_DELIVERABLES_GRP.resolveDeliverables(
989: p_api_version => 1.0,
990: p_init_msg_list => FND_API.G_FALSE,
991: p_commit => FND_API.G_FALSE,
992: p_bus_doc_id => p_auction_header_id,
993: p_bus_doc_type => l_negotiation_doc_type,
994: p_bus_doc_version => -99,
995: p_event_code => l_event_name,
999: x_msg_count => x_msg_count,
1000: x_return_status => x_return_status
1001: );
1002:
1003: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1004: IF (g_fnd_debug = 'Y') THEN
1005: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.g_current_runtime_level) THEN
1006: FND_LOG.string(log_level => FND_LOG.LEVEL_PROCEDURE ,
1007: module => g_module_prefix || l_api_name,
1007: module => g_module_prefix || l_api_name,
1008: message => l_msg_data);
1009: END IF;
1010: END IF;
1011: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1012: END IF;
1013:
1014: --
1015: -- Set the org context back
1043:
1044: IS
1045:
1046: l_api_version Number := 1.0;
1047: l_init_msg_list Varchar2(1) := FND_API.G_FALSE ;
1048: l_commit Varchar2(1) := FND_API.G_FALSE;
1049:
1050: l_source_doc_type Varchar2(30) := 'AUCTION_RESPONSE'; -- need to get the correct doc type
1051: l_source_doc_id Number := p_source_bid_number;
1044: IS
1045:
1046: l_api_version Number := 1.0;
1047: l_init_msg_list Varchar2(1) := FND_API.G_FALSE ;
1048: l_commit Varchar2(1) := FND_API.G_FALSE;
1049:
1050: l_source_doc_type Varchar2(30) := 'AUCTION_RESPONSE'; -- need to get the correct doc type
1051: l_source_doc_id Number := p_source_bid_number;
1052:
1112: mo_global.set_policy_context('S', l_org_id);
1113:
1114: OKC_TERMS_COPY_GRP.COPY_RESPONSE_DOC(
1115: p_api_version => 1.0 , --l_api_version ,
1116: p_init_msg_list => FND_API.G_FALSE , --l_init_msg_list ,
1117: p_commit => FND_API.G_FALSE , --l_commit ,
1118: p_source_doc_type => l_source_doc_type ,
1119: p_source_doc_id => l_source_doc_id ,
1120: p_target_doc_type => l_target_doc_type ,
1113:
1114: OKC_TERMS_COPY_GRP.COPY_RESPONSE_DOC(
1115: p_api_version => 1.0 , --l_api_version ,
1116: p_init_msg_list => FND_API.G_FALSE , --l_init_msg_list ,
1117: p_commit => FND_API.G_FALSE , --l_commit ,
1118: p_source_doc_type => l_source_doc_type ,
1119: p_source_doc_id => l_source_doc_id ,
1120: p_target_doc_type => l_target_doc_type ,
1121: p_target_doc_id => l_target_doc_id ,
1177: l_api_version NUMBER := 1.0;
1178: l_api_name CONSTANT VARCHAR2(30) := 'disqualifyDeliverables';
1179: l_bus_doc_id NUMBER;
1180: l_doc_type_id NUMBER;
1181: l_init_msg_list VARCHAR2(1) := FND_API.G_FALSE;
1182: l_bus_doc_type VARCHAR2(30);
1183:
1184: l_event_name VARCHAR2(30) := PON_CONTERMS_UTL_PVT.RESPONSE_RECEIVED;
1185: l_event_date DATE := sysdate;
1193:
1194: l_msg_data VARCHAR2(250);
1195: l_msg_count NUMBER;
1196: l_return_status VARCHAR2(1);
1197: l_commit VARCHAR2(1) := FND_API.G_FALSE;
1198:
1199: BEGIN
1200:
1201: select b.doctype_id ,
1208: and a.auction_header_id = b.auction_header_id;
1209:
1210: l_bus_doc_type := get_response_doc_type(l_doc_type_id);
1211:
1212: if (is_contracts_installed() = FND_API.G_TRUE) then
1213:
1214: begin
1215: -- note that we do not need to cancel all the deliverabls
1216: -- for all the archived bids that will get 'disqualified'
1231: mo_global.set_policy_context('S', l_org_id);
1232:
1233: OKC_MANAGE_DELIVERABLES_GRP.disableDeliverables (
1234: p_api_version => 1.0,
1235: p_init_msg_list => FND_API.G_FALSE,
1236: p_commit => FND_API.G_FALSE,
1237: p_bus_doc_id => p_bid_number,
1238: p_bus_doc_type => l_bus_doc_type,
1239: p_bus_doc_version => -99,
1232:
1233: OKC_MANAGE_DELIVERABLES_GRP.disableDeliverables (
1234: p_api_version => 1.0,
1235: p_init_msg_list => FND_API.G_FALSE,
1236: p_commit => FND_API.G_FALSE,
1237: p_bus_doc_id => p_bid_number,
1238: p_bus_doc_type => l_bus_doc_type,
1239: p_bus_doc_version => -99,
1240: x_msg_data => l_msg_data,
1240: x_msg_data => l_msg_data,
1241: x_msg_count => l_msg_count,
1242: x_return_status => l_return_status);
1243:
1244: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1245: IF (g_fnd_debug = 'Y') THEN
1246: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.g_current_runtime_level) THEN
1247: FND_LOG.string(log_level => FND_LOG.LEVEL_PROCEDURE ,
1248: module => g_module_prefix || l_api_name,
1284: IS
1285: l_api_version NUMBER := 1.0;
1286: l_bus_doc_id NUMBER;
1287:
1288: l_init_msg_list VARCHAR2(1) := FND_API.G_FALSE;
1289:
1290: -- multi-org related changes
1291: l_old_org_id NUMBER;
1292: l_old_policy VARCHAR2(2);
1295: -- out parameters for the contracts apis
1296: l_msg_data VARCHAR2(250);
1297: l_msg_count NUMBER;
1298: l_return_status VARCHAR2(1);
1299: l_commit VARCHAR2(1) := FND_API.G_FALSE;
1300: l_response_doc_type VARCHAR2(30);
1301: l_api_name CONSTANT VARCHAR2(30) :='disableDeliverables';
1302:
1303: CURSOR active_bids IS
1308:
1309: BEGIN
1310:
1311: l_response_doc_type := get_response_doc_type(p_doc_type_id);
1312: if (is_contracts_installed() = FND_API.G_TRUE) then
1313:
1314: begin
1315:
1316: select org_id
1332: FOR active_bid IN active_bids LOOP
1333:
1334: OKC_MANAGE_DELIVERABLES_GRP.disableDeliverables(
1335: p_api_version => 1.0,
1336: p_init_msg_list => FND_API.G_FALSE,
1337: p_commit => FND_API.G_FALSE,
1338: p_bus_doc_id => active_bid.bid_number,
1339: p_bus_doc_type => l_response_doc_type,
1340: p_bus_doc_version => -99,
1333:
1334: OKC_MANAGE_DELIVERABLES_GRP.disableDeliverables(
1335: p_api_version => 1.0,
1336: p_init_msg_list => FND_API.G_FALSE,
1337: p_commit => FND_API.G_FALSE,
1338: p_bus_doc_id => active_bid.bid_number,
1339: p_bus_doc_type => l_response_doc_type,
1340: p_bus_doc_version => -99,
1341: x_msg_data => l_msg_data,
1341: x_msg_data => l_msg_data,
1342: x_msg_count => l_msg_count,
1343: x_return_status => l_return_status)
1344: ;
1345: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1346: IF (g_fnd_debug = 'Y') THEN
1347: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.g_current_runtime_level) THEN
1348: FND_LOG.string(log_level => FND_LOG.LEVEL_PROCEDURE ,
1349: module => g_module_prefix || l_api_name,
1396: BEGIN
1397:
1398: get_auction_header_id(p_doc_type, p_doc_id, l_auction_header_id, l_return_status, l_msg_data, l_msg_count);
1399:
1400: if(l_return_status <> fnd_api.g_ret_sts_success) then
1401: if (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
1402: fnd_log.string( fnd_log.level_statement,
1403: 'pon_conterms_utl_pvt',
1404: 'contract_terms_exist() failed for doc_id=' || p_doc_id || ', msg_data=' || l_msg_data
1486: mo_global.set_policy_context('S', l_org_id);
1487:
1488: resultout := okc_terms_util_grp.is_article_exist(
1489: p_api_version => 1.0,
1490: p_init_msg_list => fnd_api.g_false,
1491: x_return_status => v_return_status,
1492: x_msg_data => v_msg_data,
1493: x_msg_count => v_msg_count,
1494: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1493: x_msg_count => v_msg_count,
1494: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1495: p_doc_id => v_doc_id);
1496:
1497: if (v_return_status <> fnd_api.g_ret_sts_success) then
1498: resultout := null;
1499:
1500: if (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
1501: fnd_log.string(fnd_log.level_statement,
1560: mo_global.set_policy_context('S', l_org_id);
1561:
1562: resultout := okc_terms_util_grp.is_article_amended(
1563: p_api_version => 1.0,
1564: p_init_msg_list => fnd_api.g_false,
1565: x_return_status => v_return_status,
1566: x_msg_data => v_msg_data,
1567: x_msg_count => v_msg_count,
1568: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1567: x_msg_count => v_msg_count,
1568: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1569: p_doc_id => v_doc_id);
1570:
1571: if (v_return_status <> fnd_api.g_ret_sts_success) then
1572: resultout := null;
1573:
1574: if (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
1575: fnd_log.string(fnd_log.level_statement,
1639: mo_global.set_policy_context('S', l_org_id);
1640:
1641: resultout := okc_terms_util_grp.is_deliverable_amended(
1642: p_api_version => 1.0,
1643: p_init_msg_list => fnd_api.g_false,
1644: x_return_status => v_return_status,
1645: x_msg_data => v_msg_data,
1646: x_msg_count => v_msg_count,
1647: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1646: x_msg_count => v_msg_count,
1647: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1648: p_doc_id => v_doc_id);
1649:
1650: if (v_return_status <> fnd_api.g_ret_sts_success) then
1651: resultout := null;
1652:
1653: if (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
1654: fnd_log.string(fnd_log.level_statement,
1714:
1715:
1716: resultout := okc_terms_util_grp.is_template_expired(
1717: p_api_version => 1.0,
1718: p_init_msg_list => fnd_api.g_false,
1719: x_return_status => v_return_status,
1720: x_msg_data => v_msg_data,
1721: x_msg_count => v_msg_count,
1722: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1721: x_msg_count => v_msg_count,
1722: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1723: p_doc_id => v_doc_id);
1724:
1725: if (v_return_status <> fnd_api.g_ret_sts_success) then
1726: resultout := null;
1727:
1728: if (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
1729: fnd_log.string(fnd_log.level_statement,
1789: mo_global.set_policy_context('S', l_org_id);
1790:
1791: resultout := okc_terms_util_grp.deviation_from_standard(
1792: p_api_version => 1.0,
1793: p_init_msg_list => fnd_api.g_false,
1794: x_return_status => v_return_status,
1795: x_msg_data => v_msg_data,
1796: x_msg_count => v_msg_count,
1797: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1796: x_msg_count => v_msg_count,
1797: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1798: p_doc_id => v_doc_id);
1799:
1800: if (v_return_status <> fnd_api.g_ret_sts_success) then
1801: resultout := null;
1802:
1803: if (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
1804: fnd_log.string(fnd_log.level_statement,
1864: mo_global.set_policy_context('S', l_org_id);
1865:
1866: resultout := okc_terms_util_grp.is_deliverable_exist(
1867: p_api_version => 1.0,
1868: p_init_msg_list => fnd_api.g_false,
1869: x_return_status => v_return_status,
1870: x_msg_data => v_msg_data,
1871: x_msg_count => v_msg_count,
1872: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1871: x_msg_count => v_msg_count,
1872: p_doc_type => pon_conterms_utl_grp.get_contracts_document_type(v_doc_id, 'N'),
1873: p_doc_id => v_doc_id);
1874:
1875: if (v_return_status <> fnd_api.g_ret_sts_success) then
1876: resultout := null;
1877:
1878: if (fnd_log.level_statement >= fnd_log.g_current_runtime_level) then
1879: fnd_log.string(fnd_log.level_statement,
1908: l_old_policy VARCHAR2(2);
1909:
1910: BEGIN
1911:
1912: IF (is_contracts_installed() = FND_API.G_TRUE) THEN --{
1913:
1914: BEGIN
1915: --{
1916:
1926: mo_global.set_policy_context('M', null);
1927:
1928: OKC_MANAGE_DELIVERABLES_GRP.updateExtPartyOnDeliverables
1929: ( p_api_version => 1.0,
1930: p_init_msg_list => FND_API.G_TRUE,
1931: p_commit => FND_API.G_FALSE,
1932: p_document_class => 'SOURCING',
1933: p_from_external_party_id => p_from_vendor_id,
1934: p_from_external_party_site_id => p_from_site_id,
1927:
1928: OKC_MANAGE_DELIVERABLES_GRP.updateExtPartyOnDeliverables
1929: ( p_api_version => 1.0,
1930: p_init_msg_list => FND_API.G_TRUE,
1931: p_commit => FND_API.G_FALSE,
1932: p_document_class => 'SOURCING',
1933: p_from_external_party_id => p_from_vendor_id,
1934: p_from_external_party_site_id => p_from_site_id,
1935: p_to_external_party_id => p_to_vendor_id,
1945: mo_global.set_policy_context(l_old_policy, l_old_org_id);
1946:
1947: -- keep logging
1948:
1949: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN --{
1950:
1951: IF (g_fnd_debug = 'Y') THEN --{
1952:
1953: IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.g_current_runtime_level) THEN
1961: || ' p_to_external_party_site_id=' || p_to_site_id);
1962: END IF;
1963:
1964: END IF; --}
1965: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1966: END IF; --}
1967: END;--}
1968: END IF;--}
1969: EXCEPTION
2033: x_msg_count => l_msg_count,
2034: x_return_status => l_return_status);
2035:
2036:
2037: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2038:
2039: x_result := FND_API.G_RET_STS_ERROR;
2040: x_error_code := 'UPDATE_DELIV_AMEND_FAILED';
2041: x_error_message := 'Unable to update deliverables for auction ' || p_auction_header_id_orig;
2035:
2036:
2037: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2038:
2039: x_result := FND_API.G_RET_STS_ERROR;
2040: x_error_code := 'UPDATE_DELIV_AMEND_FAILED';
2041: x_error_message := 'Unable to update deliverables for auction ' || p_auction_header_id_orig;
2042:
2043: IF (g_fnd_debug = 'Y') THEN
2046: module => g_module_prefix || l_api_name,
2047: message => l_msg_data || ' ' || x_error_code || ' ' || x_error_message);
2048: END IF;
2049: END IF;
2050: --RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2051: END IF;
2052: END IF;
2053:
2054: -- finally call disabledeliverables on the previous amendment
2058: x_msg_data => l_msg_data,
2059: x_msg_count => l_msg_count,
2060: x_return_status => l_return_status);
2061:
2062: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2063:
2064: x_result := FND_API.G_RET_STS_ERROR;
2065: x_error_code := 'DISABLE_DELIV_AMEND_FAILED';
2066: x_error_message := 'Unable to disable deliverables for auction ' || p_auction_header_id_prev;
2060: x_return_status => l_return_status);
2061:
2062: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2063:
2064: x_result := FND_API.G_RET_STS_ERROR;
2065: x_error_code := 'DISABLE_DELIV_AMEND_FAILED';
2066: x_error_message := 'Unable to disable deliverables for auction ' || p_auction_header_id_prev;
2067:
2068: IF (g_fnd_debug = 'Y') THEN
2071: module => g_module_prefix || l_api_name,
2072: message => l_msg_data || ' ' || x_error_code || ' ' || x_error_message);
2073: END IF;
2074: END IF;
2075: --RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2076: END IF;
2077:
2078:
2079: EXCEPTION
2079: EXCEPTION
2080:
2081: WHEN OTHERS THEN
2082:
2083: x_result := FND_API.G_RET_STS_ERROR;
2084: x_error_code := 'UPDATE_DELIV_AMEND_FAILED_COMPLETELY - ' || SQLCODE;
2085: x_error_message := 'Unable to do anything with deliverables for auction ' || p_auction_header_id_prev || ' ' || SUBSTR(SQLERRM, 1, 100);
2086:
2087: IF (g_fnd_debug = 'Y') THEN