182: WHERE offer_discount_line_id = p_offer_discount_line_id;
183: l_volume_type OZF_OFFER_DISCOUNT_LINES.volume_type%type;
184: BEGIN
185: --initialize
186: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
187:
188: x_return_status := FND_API.g_ret_sts_success;
189: -- volume type required
190: IF p_vo_disc_rec.volume_type = FND_API.G_MISS_CHAR OR p_vo_disc_rec.volume_type IS NULL THEN
219: ELSE
220: l_volume_type := p_vo_disc_rec.volume_type;
221: END IF;
222: ELSE
223: OZF_Offer_Adj_Line_PVT.debug_message('INVALID VALIDATION MODE');
224: x_return_status := FND_API.g_ret_sts_error;
225: END IF;
226:
227: -- if volume_type = quantity (PRICING_ATTRIBUTE10) UOM CODE is required
231: x_return_status := FND_API.g_ret_sts_error;
232: END IF;
233: END IF;
234:
235: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
236:
237: END check_pbh_req_items;
238:
239:
271: l_api_name CONSTANT VARCHAR2(30) := 'check_dis_req_items';
272: l_discStr VARCHAR2(240);
273: BEGIN
274: --initialize
275: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
276: x_return_status := FND_API.g_ret_sts_success;
277: l_discStr := OZF_UTILITY_PVT.getAttributeName(p_attributeCode => 'OZF_DISCOUNT' );
278: l_discStr := l_discStr || ' ' || OZF_UTILITY_PVT.getAttributeName(p_attributeCode =>'IEC_ALG_OR' , p_applicationId => 545) ;
279: l_discStr := l_discStr || ' '|| OZF_UTILITY_PVT.getAttributeName(p_attributeCode => 'OZF_FORMULA');
368: x_return_status := FND_API.g_ret_sts_error;
369: return;
370: END IF;
371:
372: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
373:
374: END check_dis_req_items;
375:
376:
419: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_req_items';
420:
421: BEGIN
422: --initialize
423: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
424:
425: x_return_status := FND_API.g_ret_sts_success;
426:
427: -- get offer type
427: -- get offer type
428: OPEN c_offer_type(p_vo_disc_rec.offer_id);
429: FETCH c_offer_type INTO l_offer_type ;
430: CLOSE c_offer_type;
431: OZF_Offer_Adj_Line_PVT.debug_message('Offer Type is ' || l_offer_type || 'Offer Id is :'|| p_vo_disc_rec.offer_id);
432: -- if offer_type is not volume_offer return error message
433: IF l_offer_type = 'VOLUME_OFFER' THEN
434: -- get tier_type for the line either from db or from record itself
435: IF p_validation_mode = JTF_PLSQL_API.g_create THEN
442: ELSE
443: l_tier_type := p_vo_disc_rec.tier_type;
444: END IF;
445: ELSE
446: OZF_Offer_Adj_Line_PVT.debug_message('INVALID VALIDATION MODE');
447: x_return_status := FND_API.g_ret_sts_error;
448: END IF;
449: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
450: RAISE FND_API.G_EXC_ERROR;
467: -- populate error message for invalid tier type
468: END IF;
469:
470: ELSE
471: OZF_Offer_Adj_Line_PVT.debug_message('Offer Type is ' || l_offer_type || 'Offer Id is :'|| p_vo_disc_rec.offer_id);
472: x_return_status := FND_API.g_ret_sts_error;
473: -- populate error message for invalid offer type
474: END IF;
475:
476: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
477: RAISE FND_API.G_EXC_ERROR;
478: END IF;
479:
480: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
481:
482:
483: END check_vo_req_items;
484:
514: IS
515: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_discounts_req_items';
516: BEGIN
517: --initialize
518: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
519:
520: x_return_status := FND_API.g_ret_sts_success;
521: -- check required items
522: IF p_validation_mode = JTF_PLSQL_API.g_create THEN
564: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
565: RAISE FND_API.G_EXC_ERROR;
566: END IF;
567:
568: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
569:
570:
571: END check_vo_discounts_req_items;
572:
614: END IF;
615:
616: IF p_vo_disc_rec.parent_discount_line_id IS NOT NULL AND p_vo_disc_rec.PARENT_DISCOUNT_LINE_ID <> FND_API.G_MISS_NUM
617: THEN
618: OZF_Offer_Adj_Line_PVT.debug_message('Parent Id is :'||p_vo_disc_rec.parent_discount_line_id);
619: IF ozf_utility_pvt.check_fk_exists('OZF_OFFER_DISCOUNT_LINES','OFFER_DISCOUNT_LINE_ID',to_char(p_vo_disc_rec.parent_discount_line_id)) = FND_API.g_false THEN
620: OZF_Utility_PVT.Error_Message('OZF_INVALID_PARENT_ID' );
621: x_return_status := FND_API.g_ret_sts_error;
622: return;
859: l_getOverlapTiers NUMBER;
860: l_return VARCHAR2(10) := null;
861: BEGIN
862: l_return := null;
863: OZF_Offer_Adj_Line_PVT.debug_message('Volume From :'||p_volumeFrom || ' : volume to : '||p_volumeTo || ' OfferDiscountLineId :'||p_parentDiscountLineId || ' : OfferDiscountLIneId is : '||p_offerDiscountLineId|| 'OfferId :'||p_offerId);
864: OPEN c_getOverlapTiers(cp_volumeFrom => p_volumeFrom
865: , cp_volumeTo => p_volumeTo
866: , cp_offerId => p_offerId
867: , cp_parentDiscountLineId => p_parentDiscountLineId
1009: IS
1010: l_discount_type OZF_OFFER_DISCOUNT_LINES.DISCOUNT_TYPE%TYPE;
1011: BEGIN
1012: x_return_status := FND_API.G_RET_STS_SUCCESS;
1013: OZF_Offer_Adj_Line_PVT.debug_message('uom is ' || p_vo_disc_rec.uom_code);
1014: IF p_vo_disc_rec.uom_code IS NOT NULL AND p_vo_disc_rec.uom_code <> fnd_api.g_miss_char AND p_vo_disc_rec.volume_type <> 'PRICING_ATTRIBUTE10' THEN
1015: OZF_Utility_PVT.Error_Message('OZF_VO_UOM_INV' );
1016: x_return_status := FND_API.g_ret_sts_error;
1017: RETURN;
1019:
1020: IF p_vo_disc_rec.tier_type = 'DIS' AND (p_vo_disc_rec.parent_discount_line_id IS NOT NULL AND p_vo_disc_rec.parent_discount_line_id <> FND_API.G_MISS_NUM) THEN
1021: SELECT discount_type INTO l_discount_type FROM OZF_OFFER_DISCOUNT_LINES
1022: WHERE OFFER_DISCOUNT_LINE_ID = p_vo_disc_rec.parent_discount_line_id;
1023: OZF_Offer_Adj_Line_PVT.debug_message('Discount is :'||p_vo_disc_rec.discount);
1024: IF p_vo_disc_rec.discount IS NOT NULL AND p_vo_disc_rec.discount <> FND_API.G_MISS_NUM THEN
1025: IF l_discount_type ='%' AND p_vo_disc_rec.discount > 100 THEN
1026: OZF_Utility_PVT.Error_Message('OZF_PER_DISC_INV' );
1027: x_return_status := FND_API.g_ret_sts_error;
1132: IS
1133: l_api_name CONSTANT VARCHAR2(30) := 'Check_vo_discount_Items';
1134: BEGIN
1135: x_return_status := FND_API.G_RET_STS_SUCCESS;
1136: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
1137:
1138: check_vo_discounts_req_items(
1139: p_vo_disc_rec => p_vo_disc_rec,
1140: p_validation_mode => p_validation_mode,
1215: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1216: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1217: END IF;
1218:
1219: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
1220:
1221: END Check_vo_discount_Items;
1222:
1223:
1226: p_vo_disc_rec IN vo_disc_rec_type,
1227: x_complete_rec OUT NOCOPY vo_disc_rec_type)
1228: IS
1229: BEGIN
1230: OZF_Offer_Adj_Line_PVT.debug_message('Complete_pbh_Rec');
1231: x_complete_rec := p_vo_disc_rec;
1232: x_complete_rec.parent_discount_line_id := FND_API.G_MISS_NUM;
1233: x_complete_rec.volume_from := FND_API.G_MISS_NUM;
1234: x_complete_rec.volume_to := FND_API.G_MISS_NUM;
1253: p_vo_disc_rec IN vo_disc_rec_type,
1254: x_complete_rec OUT NOCOPY vo_disc_rec_type)
1255: IS
1256: BEGIN
1257: OZF_Offer_Adj_Line_PVT.debug_message('Complete_dis_Rec');
1258: x_complete_rec := p_vo_disc_rec;
1259: x_complete_rec.incompatibility_group := FND_API.G_MISS_CHAR;
1260: x_complete_rec.precedence := FND_API.G_MISS_NUM;
1261: x_complete_rec.bucket := FND_API.G_MISS_CHAR;
1345: -- THEN
1346: -- x_return_status := FND_API.G_RET_STS_ERROR;
1347:
1348: -- Debug Message
1349: OZF_Offer_Adj_Line_PVT.debug_message('Private API: Validate_dm_model_rec');
1350: -- Standard call to get message count and if count is 1, get message info.
1351: FND_MSG_PUB.Count_And_Get
1352: (p_count => x_msg_count,
1353: p_data => x_msg_data
1419: FND_MSG_PUB.initialize;
1420: END IF;
1421:
1422: -- Debug Message
1423: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
1424:
1425: -- Initialize API return status to SUCCESS
1426: x_return_status := FND_API.G_RET_STS_SUCCESS;
1427:
1424:
1425: -- Initialize API return status to SUCCESS
1426: x_return_status := FND_API.G_RET_STS_SUCCESS;
1427:
1428: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'Return status is : '|| x_return_status);
1429:
1430: /*IF p_validation_mode <> JTF_PLSQL_API.g_create THEN
1431: Complete_vo_discount_Rec(
1432: p_vo_disc_rec => px_vo_disc_rec,
1465: END IF;
1466: END IF;
1467: */
1468:
1469: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'Return status is : '|| x_return_status);
1470:
1471: -- Debug Message
1472: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
1473:
1468:
1469: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'Return status is : '|| x_return_status);
1470:
1471: -- Debug Message
1472: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
1473:
1474:
1475: -- Standard call to get message count and if count is 1, get message info.
1476: FND_MSG_PUB.Count_And_Get
1609: EXCEPTION
1610: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1611: null;
1612: END;
1613: OZF_Offer_Adj_Line_PVT.debug_message('Done calling Delete product');
1614:
1615: BEGIN
1616: SELECT object_version_number, offr_disc_struct_name_id INTO l_object_version_number, l_offr_disc_struct_name_id
1617: FROM ozf_offr_disc_struct_name_b
1624: EXCEPTION
1625: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1626: null;
1627: END;
1628: OZF_Offer_Adj_Line_PVT.debug_message('Done calling Delete name');
1629:
1630:
1631: BEGIN
1632: OZF_DISC_LINE_PKG.delete_tiers(p_offer_discount_line_id => p_offer_discount_line_id);
1634: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1635: null;
1636: END;
1637:
1638: OZF_Offer_Adj_Line_PVT.debug_message('Done deleting children');
1639:
1640: BEGIN
1641: OZF_DISC_LINE_PKG.Delete_Row(
1642: p_offer_discount_line_id => p_offer_discount_line_id,
1642: p_offer_discount_line_id => p_offer_discount_line_id,
1643: p_object_version_number => p_object_version_number
1644: );
1645: END;
1646: OZF_Offer_Adj_Line_PVT.debug_message('Done deleting');
1647:
1648:
1649: --
1650: -- End of API body
1688: );
1689:
1690: WHEN OTHERS THEN
1691: ROLLBACK TO Delete_vo_discount_PVT;
1692: OZF_Offer_Adj_Line_PVT.debug_message(SUBSTR(SQLERRM, 1, 100));
1693: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1694: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1695: THEN
1696: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1795: FND_MSG_PUB.initialize;
1796: END IF;
1797:
1798: -- Debug Message
1799: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
1800:
1801: -- Initialize API return status to SUCCESS
1802: x_return_status := FND_API.G_RET_STS_SUCCESS;
1803:
1809: THEN
1810: OZF_Utility_PVT.Error_Message(p_message_name => 'USER_PROFILE_MISSING');
1811: RAISE FND_API.G_EXC_ERROR;
1812: END IF;
1813: OZF_Offer_Adj_Line_PVT.debug_message('OfferDiscountLineId is : '||p_discount_line_id);
1814:
1815:
1816: OPEN c_get_vo_disc_line( p_vo_disc_rec.offer_discount_line_id,p_vo_disc_rec.object_version_number);
1817: FETCH c_get_vo_disc_line INTO l_get_vo_disc_line ;
1841:
1842: OPEN c_pbh_discount(p_discount_line_id) ;
1843: FETCH c_pbh_discount INTO l_pbh_discount ;
1844: IF c_pbh_discount%FOUND THEN
1845: OZF_Offer_Adj_Line_PVT.debug_message('offerId 2 is : '||l_pbh_discount.offer_id);
1846: CLOSE c_pbh_discount ;
1847:
1848: l_vo_pbh_rec.offer_id := l_pbh_discount.offer_id;
1849: l_vo_pbh_rec.volume_type := l_pbh_discount.volume_type;
1857: l_vo_pbh_rec.end_date_active := l_pbh_discount.end_date_active;
1858: l_vo_pbh_rec.name := p_vo_disc_rec.name;
1859: --l_vo_pbh_rec.description := l_pbh_discount.description;
1860:
1861: OZF_Offer_Adj_Line_PVT.debug_message('Offer id1 is :'|| l_vo_pbh_rec.offer_id);
1862:
1863: Create_vo_discount(
1864: p_api_version_number => p_api_version_number
1865: , p_init_msg_list => p_init_msg_list
1875: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
1876: RAISE FND_API.G_EXC_ERROR;
1877: END IF;
1878:
1879: OZF_Offer_Adj_Line_PVT.debug_message('discount line id1 is :'||p_discount_line_id);
1880: FOR l_dis_discount IN c_dis_discount(p_discount_line_id) LOOP
1881: l_vo_dis_rec.offer_id := l_dis_discount.offer_id;
1882: l_vo_dis_rec.parent_discount_line_id := x_vo_discount_line_id;
1883: l_vo_dis_rec.volume_from := l_dis_discount.volume_from;
1899: , x_vo_discount_line_id => l_vo_id
1900: );
1901: END LOOP;
1902: ELSE
1903: OZF_Offer_Adj_Line_PVT.debug_message('PBH not found');
1904: CLOSE c_pbh_discount;
1905: END IF;
1906: OZF_Offer_Adj_Line_PVT.debug_message('New Discount line id is :'|| x_vo_discount_line_id);
1907:
1902: ELSE
1903: OZF_Offer_Adj_Line_PVT.debug_message('PBH not found');
1904: CLOSE c_pbh_discount;
1905: END IF;
1906: OZF_Offer_Adj_Line_PVT.debug_message('New Discount line id is :'|| x_vo_discount_line_id);
1907:
1908:
1909: IF x_return_status<>FND_API.G_RET_STS_SUCCESS THEN
1910: RAISE FND_API.G_EXC_ERROR;
2039: FND_MSG_PUB.initialize;
2040: END IF;
2041:
2042: -- Debug Message
2043: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
2044:
2045: -- Initialize API return status to SUCCESS
2046: x_return_status := FND_API.G_RET_STS_SUCCESS;
2047:
2080: l_dummy := NULL;
2081: OPEN c_struct_id;
2082: FETCH c_struct_id INTO l_offr_disc_struct_name_id;
2083: CLOSE c_struct_id;
2084: OZF_Offer_Adj_Line_PVT.debug_message('disc struct id is :'|| l_offr_disc_struct_name_id);
2085: OPEN c_struct_id_exists(l_offr_disc_struct_name_id);
2086: FETCH c_struct_id_exists INTO l_struct_dummy;
2087: CLOSE c_struct_id_exists;
2088: EXIT WHEN l_struct_dummy IS NULL;
2098:
2099: l_vo_discount_rec.offr_disc_struct_name_id := l_offr_disc_struct_name_id ;
2100:
2101:
2102: OZF_Offer_Adj_Line_PVT.debug_message('Calling Validate Discounts: Return Status is :' || x_return_status );
2103:
2104:
2105: -- validate discounts
2106: Validate_vo_discounts(
2117: RAISE FND_API.G_EXC_ERROR;
2118: END IF;
2119: -- create discounts
2120: -- Debug Message
2121: OZF_Offer_Adj_Line_PVT.debug_message( 'Private API: Calling create table handler');
2122: -- Invoke table handler(OZF_DISC_LINE_PKG.Insert_Row)
2123: OZF_DISC_LINE_PKG.Insert_Row(
2124: px_offer_discount_line_id => l_vo_discount_line_id,
2125: p_parent_discount_line_id => l_vo_discount_rec.parent_discount_line_id,
2200: THEN
2201: COMMIT WORK;
2202: END IF;
2203: -- Debug Message
2204: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
2205: -- Standard call to get message count and if count is 1, get message info.
2206: FND_MSG_PUB.Count_And_Get
2207: (p_count => x_msg_count,
2208: p_data => x_msg_data
2322: THEN
2323: FND_MSG_PUB.initialize;
2324: END IF;
2325: -- Debug Message
2326: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
2327:
2328: -- Initialize API return status to SUCCESS
2329: x_return_status := FND_API.G_RET_STS_SUCCESS;
2330:
2328: -- Initialize API return status to SUCCESS
2329: x_return_status := FND_API.G_RET_STS_SUCCESS;
2330:
2331: -- Debug Message
2332: OZF_Offer_Adj_Line_PVT.debug_message('Private API: - Open Cursor to Select');
2333: OZF_Offer_Adj_Line_PVT.debug_message('INputs : '|| l_tar_vo_disc_line_rec.offer_discount_line_id || ' : ' || l_tar_vo_disc_line_rec.object_version_number);
2334: OPEN c_get_vo_disc_line( l_tar_vo_disc_line_rec.offer_discount_line_id,l_tar_vo_disc_line_rec.object_version_number);
2335: FETCH c_get_vo_disc_line INTO l_ref_vo_disc_line_rec ;
2336: If ( c_get_vo_disc_line%NOTFOUND) THEN
2329: x_return_status := FND_API.G_RET_STS_SUCCESS;
2330:
2331: -- Debug Message
2332: OZF_Offer_Adj_Line_PVT.debug_message('Private API: - Open Cursor to Select');
2333: OZF_Offer_Adj_Line_PVT.debug_message('INputs : '|| l_tar_vo_disc_line_rec.offer_discount_line_id || ' : ' || l_tar_vo_disc_line_rec.object_version_number);
2334: OPEN c_get_vo_disc_line( l_tar_vo_disc_line_rec.offer_discount_line_id,l_tar_vo_disc_line_rec.object_version_number);
2335: FETCH c_get_vo_disc_line INTO l_ref_vo_disc_line_rec ;
2336: If ( c_get_vo_disc_line%NOTFOUND) THEN
2337: OZF_Utility_PVT.Error_Message(p_message_name => 'API_MISSING_UPDATE_TARGET'
2358:
2359: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
2360: THEN
2361: -- Debug message
2362: OZF_Offer_Adj_Line_PVT.debug_message('Private API: Validate_vo_discounts');
2363: -- validate data
2364: Validate_vo_discounts(
2365: p_api_version_number => p_api_version_number
2366: , p_init_msg_list => p_init_msg_list
2451: THEN
2452: COMMIT WORK;
2453: END IF;
2454: -- Debug Message
2455: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
2456: -- Standard call to get message count and if count is 1, get message info.
2457: FND_MSG_PUB.Count_And_Get
2458: (p_count => x_msg_count,
2459: p_data => x_msg_data
2535: IS
2536: l_valid_flag VARCHAR2(1);
2537: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_product_Uk_Items';
2538: BEGIN
2539: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
2540: x_return_status := FND_API.g_ret_sts_success;
2541: IF p_validation_mode = JTF_PLSQL_API.g_create
2542: AND (p_vo_prod_rec.off_discount_product_id IS NOT NULL AND p_vo_prod_rec.off_discount_product_id <> FND_API.g_miss_num)
2543: THEN
2544: l_valid_flag := OZF_Utility_PVT.check_uniqueness(
2545: 'ozf_offer_discount_products',
2546: 'OFF_DISCOUNT_PRODUCT_ID = ''' || p_vo_prod_rec.off_discount_product_id ||''''
2547: );
2548: OZF_Offer_Adj_Line_PVT.debug_message('Off Discount Product Id is '||p_vo_prod_rec.off_discount_product_id);
2549: IF l_valid_flag = FND_API.g_false THEN
2550: OZF_Utility_PVT.Error_Message(p_message_name => 'OZF_PROD_LINE_ID_DUP');
2551: x_return_status := FND_API.g_ret_sts_error;
2552: return;
2562: l_valid_flag := OZF_Utility_PVT.check_uniqueness(
2563: 'ozf_offer_discount_products',
2564: l_attr || l_attr2
2565: );
2566: OZF_Offer_Adj_Line_PVT.debug_message('Valid Flag for duplicate products is:'||l_valid_flag);
2567: IF l_valid_flag = FND_API.g_false THEN
2568: OZF_Utility_PVT.Error_Message(p_message_name => 'OZF_VO_PROD_DUP');
2569: x_return_status := FND_API.g_ret_sts_error;
2570: return;
2609: )
2610: IS
2611: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_product_req_items';
2612: BEGIN
2613: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
2614: OZF_Offer_Adj_Line_PVT.debug_message('Validation Mode is : ' || p_validation_mode || ' '|| JTF_PLSQL_API.g_create);
2615: x_return_status := FND_API.g_ret_sts_success;
2616: IF p_validation_mode = JTF_PLSQL_API.g_create THEN
2617: IF p_vo_prod_rec.off_discount_product_id = FND_API.G_MISS_NUM OR p_vo_prod_rec.off_discount_product_id IS NULL THEN
2610: IS
2611: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_product_req_items';
2612: BEGIN
2613: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
2614: OZF_Offer_Adj_Line_PVT.debug_message('Validation Mode is : ' || p_validation_mode || ' '|| JTF_PLSQL_API.g_create);
2615: x_return_status := FND_API.g_ret_sts_success;
2616: IF p_validation_mode = JTF_PLSQL_API.g_create THEN
2617: IF p_vo_prod_rec.off_discount_product_id = FND_API.G_MISS_NUM OR p_vo_prod_rec.off_discount_product_id IS NULL THEN
2618: OZF_Utility_PVT.Error_Message('OZF_API_MISSING_FIELD', 'MISS_FIELD', 'off_discount_product_id' );
2662: return;
2663: END IF;
2664:
2665: ELSE
2666: OZF_Offer_Adj_Line_PVT.debug_message('In Update Mode');
2667: IF p_vo_prod_rec.off_discount_product_id = FND_API.G_MISS_NUM THEN
2668: OZF_Utility_PVT.Error_Message('OZF_API_MISSING_FIELD', 'MISS_FIELD', 'off_discount_product_id' );
2669: x_return_status := FND_API.g_ret_sts_error;
2670: return;
2674: OZF_Utility_PVT.Error_Message('OZF_API_MISSING_FIELD', 'MISS_FIELD', 'OFFER_DISCOUNT_LINE_ID' );
2675: x_return_status := FND_API.g_ret_sts_error;
2676: return;
2677: END IF;
2678: OZF_Offer_Adj_Line_PVT.debug_message('OFFER_ID IS '||p_vo_prod_rec.offer_id);
2679: IF p_vo_prod_rec.offer_id = FND_API.G_MISS_NUM THEN
2680: OZF_Utility_PVT.Error_Message('OZF_API_MISSING_FIELD', 'MISS_FIELD', 'OFFER_ID' );
2681: x_return_status := FND_API.g_ret_sts_error;
2682: return;
2724: )
2725: IS
2726: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_product_FK_items';
2727: BEGIN
2728: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
2729: x_return_status := FND_API.G_RET_STS_SUCCESS;
2730: IF p_vo_prod_rec.offer_id IS NOT NULL AND p_vo_prod_rec.offer_id <> FND_API.G_MISS_NUM
2731: THEN
2732: IF ozf_utility_pvt.check_fk_exists('OZF_OFFERS','OFFER_ID',to_char(p_vo_prod_rec.offer_id)) = FND_API.g_false THEN
2734: x_return_status := FND_API.g_ret_sts_error;
2735: return;
2736: END IF;
2737: END IF;
2738: OZF_Offer_Adj_Line_PVT.debug_message('Offer Discount LIne Id is: ' || p_vo_prod_rec.offer_discount_line_id || 'end');
2739: IF p_vo_prod_rec.offer_discount_line_id IS NOT NULL AND p_vo_prod_rec.offer_discount_line_id <> FND_API.G_MISS_NUM
2740: THEN
2741: IF ozf_utility_pvt.check_fk_exists('OZF_OFFER_DISCOUNT_LINES','OFFER_DISCOUNT_LINE_ID',to_char(p_vo_prod_rec.offer_discount_line_id)) = FND_API.g_false THEN
2742: OZF_Utility_PVT.Error_Message('OZF_INVALID_DISCOUNT_ID' );
2743: x_return_status := FND_API.g_ret_sts_error;
2744: return;
2745: END IF;
2746: END IF;
2747: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
2748: END check_vo_product_FK_items;
2749:
2750: -- ==============================================================================
2751: -- Start of Comments
2802: l_general_uom c_general_uom%rowtype;
2803: l_list_header_id NUMBER;
2804: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_product_Lkup_Items';
2805: BEGIN
2806: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
2807: x_return_status := FND_API.G_RET_STS_SUCCESS;
2808: --=====================================================================
2809: -- uom validation begin
2810: --=====================================================================
2874: --===========================================================================
2875:
2876: END IF;
2877:
2878: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
2879:
2880: END check_vo_product_Lkup_Items;
2881:
2882:
2917: l_datatype VARCHAR2(1);
2918: l_precedence NUMBER;
2919: l_error_code NUMBER := 0;
2920: BEGIN
2921: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
2922: x_return_status := FND_API.G_RET_STS_SUCCESS;
2923:
2924:
2925:
2963: End If;
2964:
2965:
2966:
2967: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
2968: END check_vo_product_attr;
2969:
2970: -- ==============================================================================
2971: -- Start of Comments
2998: )
2999: IS
3000: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_product_inter_attr';
3001: BEGIN
3002: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
3003: x_return_status := FND_API.G_RET_STS_SUCCESS;
3004: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
3005: END check_vo_product_inter_attr;
3006:
3000: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_product_inter_attr';
3001: BEGIN
3002: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
3003: x_return_status := FND_API.G_RET_STS_SUCCESS;
3004: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
3005: END check_vo_product_inter_attr;
3006:
3007: PROCEDURE check_vo_product_entity_attr(
3008: p_vo_prod_rec IN vo_prod_rec_type
3016: l_discount_volume_type c_discount_volume_type%rowtype;
3017:
3018: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_product_entity_attr';
3019: BEGIN
3020: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
3021: x_return_status := FND_API.G_RET_STS_SUCCESS;
3022: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
3023: END check_vo_product_entity_attr;
3024:
3018: l_api_name CONSTANT VARCHAR2(30) := 'check_vo_product_entity_attr';
3019: BEGIN
3020: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
3021: x_return_status := FND_API.G_RET_STS_SUCCESS;
3022: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
3023: END check_vo_product_entity_attr;
3024:
3025: -- ==============================================================================
3026: -- Start of Comments
3053: )
3054: IS
3055: l_api_name CONSTANT VARCHAR2(30) := 'Check_vo_Product_Items';
3056: BEGIN
3057: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
3058: x_return_status := FND_API.G_RET_STS_SUCCESS;
3059:
3060: check_vo_product_req_items(
3061: p_vo_prod_rec => p_vo_prod_rec,
3139: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3140: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3141: END IF;
3142:
3143: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
3144: END Check_vo_product_Items;
3145:
3146:
3147: -- ==============================================================================
3208: FND_MSG_PUB.initialize;
3209: END IF;
3210:
3211: -- Debug Message
3212: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
3213:
3214: -- Initialize API return status to SUCCESS
3215: x_return_status := FND_API.G_RET_STS_SUCCESS;
3216:
3213:
3214: -- Initialize API return status to SUCCESS
3215: x_return_status := FND_API.G_RET_STS_SUCCESS;
3216:
3217: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'Return status is : '|| x_return_status);
3218:
3219: IF p_validation_level >= JTF_PLSQL_API.g_valid_level_item THEN
3220: Check_vo_product_Items(
3221: p_vo_prod_rec => p_vo_prod_rec,
3251: END IF;
3252: END IF;
3253: */
3254:
3255: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'Return status is : '|| x_return_status);
3256:
3257: -- Debug Message
3258: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
3259:
3254:
3255: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'Return status is : '|| x_return_status);
3256:
3257: -- Debug Message
3258: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
3259:
3260:
3261: -- Standard call to get message count and if count is 1, get message info.
3262: FND_MSG_PUB.Count_And_Get
3386: FND_MSG_PUB.initialize;
3387: END IF;
3388:
3389: -- Debug Message
3390: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
3391:
3392: -- Initialize API return status to SUCCESS
3393: x_return_status := FND_API.G_RET_STS_SUCCESS;
3394:
3424:
3425:
3426: l_vo_prod_rec.off_discount_product_id := l_vo_prod_id ;
3427:
3428: OZF_Offer_Adj_Line_PVT.debug_message('Calling Validate Discounts: Return Status is :' || x_return_status );
3429:
3430: -- validate
3431:
3432: Validate_vo_products(
3585: THEN
3586: FND_MSG_PUB.initialize;
3587: END IF;
3588: -- Debug Message
3589: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'start');
3590:
3591: -- Initialize API return status to SUCCESS
3592: x_return_status := FND_API.G_RET_STS_SUCCESS;
3593:
3591: -- Initialize API return status to SUCCESS
3592: x_return_status := FND_API.G_RET_STS_SUCCESS;
3593:
3594: -- validate
3595: OZF_Offer_Adj_Line_PVT.debug_message('Private API: - Open Cursor to Select');
3596: OPEN c_get_vo_prod_line( l_tar_vo_prod_rec.OFF_DISCOUNT_PRODUCT_ID,l_tar_vo_prod_rec.object_version_number);
3597: FETCH c_get_vo_prod_line INTO l_ref_vo_prod_rec ;
3598: If ( c_get_vo_prod_line%NOTFOUND) THEN
3599: OZF_Utility_PVT.Error_Message(p_message_name => 'API_MISSING_UPDATE_TARGET'
3620:
3621: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
3622: THEN
3623: -- Debug message
3624: OZF_Offer_Adj_Line_PVT.debug_message('Private API: Validate_vo_discounts');
3625: -- validate data
3626: Validate_vo_products(
3627: p_api_version_number => p_api_version_number
3628: , p_init_msg_list => p_init_msg_list
3669: THEN
3670: COMMIT WORK;
3671: END IF;
3672: -- Debug Message
3673: OZF_Offer_Adj_Line_PVT.debug_message('Private API: ' || l_api_name || 'end');
3674: -- Standard call to get message count and if count is 1, get message info.
3675: FND_MSG_PUB.Count_And_Get
3676: (p_count => x_msg_count,
3677: p_data => x_msg_data