20: END IF;
21: OE_STANDARD_WF.Set_Msg_Context(actid);
22: IF (funcmode = 'RUN') then
23:
24: OE_MSG_PUB.set_msg_context(
25: p_entity_code => 'HEADER'
26: ,p_entity_id => to_number(itemkey)
27: ,p_header_id => to_number(itemkey));
28:
77: END IF;
78: OE_STANDARD_WF.Set_Msg_Context(actid);
79: IF (funcmode = 'RUN') then
80:
81: OE_MSG_PUB.set_msg_context(
82: p_entity_code => 'HEADER'
83: ,p_entity_id => to_number(itemkey)
84: ,p_header_id => to_number(itemkey));
85:
151: OE_STANDARD_WF.Set_Msg_Context(actid);
152:
153: IF (funcmode = 'RUN') then
154:
155: OE_MSG_PUB.set_msg_context(
156: p_entity_code => 'HEADER'
157: ,p_entity_id => to_number(itemkey)
158: ,p_header_id => to_number(itemkey));
159:
207: l_sales_document_type := fnd_message.get;
208:
209: FND_MESSAGE.SET_NAME('ONT', 'OE_ZERO_QUANTITY');
210: FND_MESSAGE.SET_TOKEN('SALES_DOCUMENT_TYPE', l_sales_document_type);
211: oe_msg_pub.add;
212: resultout := 'COMPLETE:INCOMPLETE';
213: OE_STANDARD_WF.Save_Messages;
214: OE_STANDARD_WF.Clear_Msg_Context;
215: return;
298: oe_debug_pub.add( 'ENTERING OE_Negotiate_WF.Customer_Acceptance:'||ITEMTYPE||'/'||ITEMKEY ,1 ) ;
299: END IF;
300: OE_STANDARD_WF.Set_Msg_Context(actid);
301: IF (funcmode = 'RUN') then
302: OE_MSG_PUB.set_msg_context(
303: p_entity_code => 'HEADER'
304: ,p_entity_id => to_number(itemkey)
305: ,p_header_id => to_number(itemkey));
306:
350: oe_debug_pub.add( 'ENTERING OE_Negotiate_WF.Update_Customer_Accepted:'||ITEMTYPE||'/'||ITEMKEY ,1 ) ;
351: END IF;
352: OE_STANDARD_WF.Set_Msg_Context(actid);
353: IF (funcmode = 'RUN') then
354: OE_MSG_PUB.set_msg_context(
355: p_entity_code => 'HEADER'
356: ,p_entity_id => to_number(itemkey)
357: ,p_header_id => to_number(itemkey));
358:
404: oe_debug_pub.add( 'ENTERING OE_Negotiate_WF.Update_Customer_Rejected:'||ITEMTYPE||'/'||ITEMKEY ,1 ) ;
405: END IF;
406: OE_STANDARD_WF.Set_Msg_Context(actid);
407: IF (funcmode = 'RUN') then
408: OE_MSG_PUB.set_msg_context(
409: p_entity_code => 'HEADER'
410: ,p_entity_id => to_number(itemkey)
411: ,p_header_id => to_number(itemkey));
412:
462: oe_debug_pub.add( 'ENTERING OE_Negotiate_WF.Check_Expiration_Date:'||ITEMTYPE||'/'||ITEMKEY ,1 ) ;
463: END IF;
464: OE_STANDARD_WF.Set_Msg_Context(actid);
465: IF (funcmode = 'RUN') then
466: OE_MSG_PUB.set_msg_context(
467: p_entity_code => 'HEADER'
468: ,p_entity_id => to_number(itemkey)
469: ,p_header_id => to_number(itemkey));
470:
602: oe_debug_pub.add( 'ENTERING OE_Negotiate_WF.Offer_Expired:'||ITEMTYPE||'/'||ITEMKEY ,1 ) ;
603: END IF;
604: OE_STANDARD_WF.Set_Msg_Context(actid);
605: IF (funcmode = 'RUN') then
606: OE_MSG_PUB.set_msg_context(
607: p_entity_code => 'HEADER'
608: ,p_entity_id => to_number(itemkey)
609: ,p_header_id => to_number(itemkey));
610:
794: END IF;
795: EXCEPTION
796: WHEN OTHERS
797: THEN
798: IF oe_msg_pub.check_msg_level (oe_msg_pub.g_msg_lvl_unexp_error)
799: THEN
800: oe_msg_pub.add_exc_msg (g_pkg_name,
801: 'Set_Negotiate_Hdr_Descriptor'
802: );
796: WHEN OTHERS
797: THEN
798: IF oe_msg_pub.check_msg_level (oe_msg_pub.g_msg_lvl_unexp_error)
799: THEN
800: oe_msg_pub.add_exc_msg (g_pkg_name,
801: 'Set_Negotiate_Hdr_Descriptor'
802: );
803: RAISE fnd_api.g_exc_unexpected_error;
804: END IF;
822: l_return_status VARCHAR2(240);
823:
824: --
825: BEGIN
826: OE_MSG_PUB.initialize;
827: x_return_status := FND_API.G_RET_STS_SUCCESS;
828: IF l_debug_level > 0 THEN
829: oe_debug_pub.add('ENTERING OE_Negotiate_WF.Lost: '|| TO_CHAR (p_header_id) ,1) ;
830: END IF;
827: x_return_status := FND_API.G_RET_STS_SUCCESS;
828: IF l_debug_level > 0 THEN
829: oe_debug_pub.add('ENTERING OE_Negotiate_WF.Lost: '|| TO_CHAR (p_header_id) ,1) ;
830: END IF;
831: OE_MSG_PUB.set_msg_context(
832: p_entity_code => 'HEADER'
833: ,p_entity_id => p_header_id
834: ,p_header_id => p_header_id);
835:
854: l_sales_document_type := fnd_message.get;
855:
856: fnd_message.set_name('ONT', 'OE_WF_NO_LOST'); --flow not at notified state
857: fnd_message.set_token('SALES_DOCUMENT_TYPE', l_sales_document_type);
858: oe_msg_pub.add;
859: x_return_status := FND_API.G_RET_STS_ERROR;
860: IF l_debug_level > 0 THEN
861: oe_debug_pub.add('EXITING OE_Negotiate_WF.Lost WITH STATUS: '||X_RETURN_STATUS ,1);
862: END IF;
884: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
885: IF l_debug_level > 0 THEN
886: oe_debug_pub.add('EXITING OE_Negotiate_WF.Lost WITH STATUS: '||X_RETURN_STATUS ,1);
887: END IF;
888: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
889: THEN
890: OE_MSG_PUB.Add_Exc_Msg
891: ( G_PKG_NAME,
892: 'Lost'
886: oe_debug_pub.add('EXITING OE_Negotiate_WF.Lost WITH STATUS: '||X_RETURN_STATUS ,1);
887: END IF;
888: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
889: THEN
890: OE_MSG_PUB.Add_Exc_Msg
891: ( G_PKG_NAME,
892: 'Lost'
893: );
894: END IF;
912: l_bsa_count NUMBER;
913: --
914: l_customer_acceptance VARCHAR2(30) := 'CUSTOMER_ACCEPTANCE';
915: BEGIN
916: OE_MSG_PUB.initialize;
917: x_return_status := FND_API.G_RET_STS_SUCCESS;
918: IF l_debug_level > 0 THEN
919: oe_debug_pub.add('ENTERING OE_Negotiate_WF.Customer_Accepted: '|| TO_CHAR (p_header_id) ,1) ;
920: END IF;
918: IF l_debug_level > 0 THEN
919: oe_debug_pub.add('ENTERING OE_Negotiate_WF.Customer_Accepted: '|| TO_CHAR (p_header_id) ,1) ;
920: END IF;
921:
922: OE_MSG_PUB.set_msg_context(
923: p_entity_code => 'HEADER'
924: ,p_entity_id => p_header_id
925: ,p_header_id => p_header_id);
926:
976: l_sales_document_type := fnd_message.get;
977:
978: fnd_message.set_name('ONT', 'OE_WF_NO_CUST_ACCEPTED'); --flow not at right state
979: fnd_message.set_token('SALES_DOCUMENT_TYPE', l_sales_document_type);
980: oe_msg_pub.add;
981: x_return_status := FND_API.G_RET_STS_ERROR;
982: IF l_debug_level > 0 THEN
983: oe_debug_pub.add('EXITING OE_Negotiate_WF.Customer_Accepted WITH STATUS: '||X_RETURN_STATUS ,1);
984: END IF;
990: ELSE
991: l_entity_code := 'BLANKET_HEADER';
992: END IF;
993:
994: OE_MSG_PUB.set_msg_context(
995: p_entity_code => l_entity_code
996: ,p_entity_id => p_header_id
997: ,p_header_id => p_header_id
998: ,p_line_id => null
1018: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1019: IF l_debug_level > 0 THEN
1020: oe_debug_pub.add('EXITING OE_Negotiate_WF.Customer_Accepted WITH STATUS: '||X_RETURN_STATUS ,1);
1021: END IF;
1022: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1023: THEN
1024: OE_MSG_PUB.Add_Exc_Msg
1025: ( G_PKG_NAME,
1026: 'Customer_Accepted'
1020: oe_debug_pub.add('EXITING OE_Negotiate_WF.Customer_Accepted WITH STATUS: '||X_RETURN_STATUS ,1);
1021: END IF;
1022: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1023: THEN
1024: OE_MSG_PUB.Add_Exc_Msg
1025: ( G_PKG_NAME,
1026: 'Customer_Accepted'
1027: );
1028: END IF;
1050: --
1051: l_customer_acceptance VARCHAR2(30) := 'CUSTOMER_ACCEPTANCE';
1052: --
1053: BEGIN
1054: OE_MSG_PUB.initialize;
1055: x_return_status := FND_API.G_RET_STS_SUCCESS;
1056: IF l_debug_level > 0 THEN
1057: oe_debug_pub.add('ENTERING OE_Negotiate_WF.Customer_Rejected: '|| TO_CHAR (p_header_id) ,1) ;
1058: END IF;
1055: x_return_status := FND_API.G_RET_STS_SUCCESS;
1056: IF l_debug_level > 0 THEN
1057: oe_debug_pub.add('ENTERING OE_Negotiate_WF.Customer_Rejected: '|| TO_CHAR (p_header_id) ,1) ;
1058: END IF;
1059: OE_MSG_PUB.set_msg_context(
1060: p_entity_code => 'HEADER'
1061: ,p_entity_id => p_header_id
1062: ,p_header_id => p_header_id);
1063:
1082: l_sales_document_type := fnd_message.get;
1083:
1084: fnd_message.set_name('ONT', 'OE_WF_NO_CUST_REJECTED'); --flow not at right state
1085: fnd_message.set_token('SALES_DOCUMENT_TYPE', l_sales_document_type);
1086: oe_msg_pub.add;
1087: x_return_status := FND_API.G_RET_STS_ERROR;
1088: IF l_debug_level > 0 THEN
1089: oe_debug_pub.add('EXITING OE_Negotiate_WF.Customer_Rejected WITH STATUS: '||X_RETURN_STATUS ,1);
1090: END IF;
1111: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1112: IF l_debug_level > 0 THEN
1113: oe_debug_pub.add('EXITING OE_Negotiate_WF.Customer_Rejected WITH STATUS: '||X_RETURN_STATUS ,1);
1114: END IF;
1115: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1116: THEN
1117: OE_MSG_PUB.Add_Exc_Msg
1118: ( G_PKG_NAME,
1119: 'Customer_Rejected'
1113: oe_debug_pub.add('EXITING OE_Negotiate_WF.Customer_Rejected WITH STATUS: '||X_RETURN_STATUS ,1);
1114: END IF;
1115: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1116: THEN
1117: OE_MSG_PUB.Add_Exc_Msg
1118: ( G_PKG_NAME,
1119: 'Customer_Rejected'
1120: );
1121: END IF;
1133: l_sales_document_type_code VARCHAR2(1);
1134: l_sales_document_type VARCHAR2(30);
1135: --
1136: BEGIN
1137: OE_MSG_PUB.initialize;
1138: x_return_status := FND_API.G_RET_STS_SUCCESS;
1139: IF l_debug_level > 0 THEN
1140: oe_debug_pub.add('ENTERING OE_Negotiate_WF.Offer_Date_Changed: '|| TO_CHAR (p_header_id) ,1) ;
1141: END IF;
1138: x_return_status := FND_API.G_RET_STS_SUCCESS;
1139: IF l_debug_level > 0 THEN
1140: oe_debug_pub.add('ENTERING OE_Negotiate_WF.Offer_Date_Changed: '|| TO_CHAR (p_header_id) ,1) ;
1141: END IF;
1142: OE_MSG_PUB.set_msg_context(
1143: p_entity_code => 'HEADER'
1144: ,p_entity_id => p_header_id
1145: ,p_header_id => p_header_id);
1146:
1164: END IF;
1165: l_sales_document_type := fnd_message.get;
1166: fnd_message.set_name('ONT', 'OE_WF_NO_OFFER_DATE_CHANGE'); --flow not at right state
1167: fnd_message.set_token('SALES_DOCUMENT_TYPE', l_sales_document_type);
1168: oe_msg_pub.add;
1169: x_return_status := FND_API.G_RET_STS_ERROR;
1170: IF l_debug_level > 0 THEN
1171: oe_debug_pub.add('EXITING OE_Negotiate_WF.Offer_Date_Changed WITH STATUS: '||X_RETURN_STATUS ,1);
1172: END IF;
1185: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1186: IF l_debug_level > 0 THEN
1187: oe_debug_pub.add('EXITING OE_Negotiate_WF.Offer_Date_Changed WITH STATUS: '||X_RETURN_STATUS ,1);
1188: END IF;
1189: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1190: THEN
1191: OE_MSG_PUB.Add_Exc_Msg
1192: ( G_PKG_NAME,
1193: 'Offer_Date_Changed'
1187: oe_debug_pub.add('EXITING OE_Negotiate_WF.Offer_Date_Changed WITH STATUS: '||X_RETURN_STATUS ,1);
1188: END IF;
1189: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1190: THEN
1191: OE_MSG_PUB.Add_Exc_Msg
1192: ( G_PKG_NAME,
1193: 'Offer_Date_Changed'
1194: );
1195: END IF;
1213: l_submit_draft_eligible VARCHAR2(30) := 'SUBMIT_DRAFT_ELIGIBLE';
1214:
1215: --
1216: BEGIN
1217: -- OE_MSG_PUB.initialize; commented out for 4671489
1218: x_return_status := FND_API.G_RET_STS_SUCCESS;
1219: IF l_debug_level > 0 THEN
1220: oe_debug_pub.add('ENTERING OE_Negotiate_WF.Submit_Draft: '|| TO_CHAR (p_header_id) ,1) ;
1221: END IF;
1259: ELSE
1260: l_entity_code := 'BLANKET_HEADER';
1261: END IF;
1262:
1263: OE_MSG_PUB.set_msg_context(
1264: p_entity_code => l_entity_code
1265: ,p_entity_id => p_header_id
1266: ,p_header_id => p_header_id
1267: ,p_line_id => null
1292: l_sales_document_type := fnd_message.get;
1293:
1294: fnd_message.set_name('ONT', 'OE_WF_NO_SUBMIT_DRAFT'); --flow not at right state
1295: fnd_message.set_token('SALES_DOCUMENT_TYPE', l_sales_document_type);
1296: oe_msg_pub.add;
1297: x_return_status := FND_API.G_RET_STS_ERROR;
1298: IF l_debug_level > 0 THEN
1299: oe_debug_pub.add('EXITING OE_Negotiate_WF.Submit_Draft WITH STATUS: '||X_RETURN_STATUS ,1);
1300: END IF;
1313: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1314: IF l_debug_level > 0 THEN
1315: oe_debug_pub.add('EXITING OE_Negotiate_WF.Submit_Draft WITH STATUS: '||X_RETURN_STATUS ,1);
1316: END IF;
1317: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1318: THEN
1319: OE_MSG_PUB.Add_Exc_Msg
1320: ( G_PKG_NAME,
1321: 'Submit_Draft'
1315: oe_debug_pub.add('EXITING OE_Negotiate_WF.Submit_Draft WITH STATUS: '||X_RETURN_STATUS ,1);
1316: END IF;
1317: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1318: THEN
1319: OE_MSG_PUB.Add_Exc_Msg
1320: ( G_PKG_NAME,
1321: 'Submit_Draft'
1322: );
1323: END IF;
1376:
1377: -- end setting item attribute for WF header attributes
1378: EXCEPTION
1379: WHEN OTHERS THEN
1380: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1381: THEN
1382: OE_MSG_PUB.Add_Exc_Msg
1383: (G_PKG_NAME
1384: , 'Set_Header_Attributes_Internal'
1378: EXCEPTION
1379: WHEN OTHERS THEN
1380: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1381: THEN
1382: OE_MSG_PUB.Add_Exc_Msg
1383: (G_PKG_NAME
1384: , 'Set_Header_Attributes_Internal'
1385: );
1386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1440: oe_debug_pub.add( 'ENTERING OE_Negotiate_WF.Set_Final_Expiration_Date:'||ITEMTYPE||'/'||ITEMKEY ,1 ) ;
1441: END IF;
1442: OE_STANDARD_WF.Set_Msg_Context(actid);
1443: IF (funcmode = 'RUN') then
1444: OE_MSG_PUB.set_msg_context(
1445: p_entity_code => 'HEADER'
1446: ,p_entity_id => to_number(itemkey)
1447: ,p_header_id => to_number(itemkey));
1448: