85: IS
86: l_amount NUMBER;
87: No_Conversion_Rate EXCEPTION;
88: --
89: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
90: --
91: BEGIN
92:
93: BEGIN
91: BEGIN
92:
93: BEGIN
94: if l_debug_level > 0 then
95: OE_DEBUG_PUB.ADD('Convert from '||p_from_currency||
96: ' to '||p_to_currency||' Amount :'||p_amount);
97: end if;
98: l_amount := gl_currency_api.convert_closest_amount_sql
99: (x_from_currency => p_from_currency
104: ,x_amount => p_amount
105: ,x_max_roll_days => -1
106: );
107: if l_debug_level > 0 then
108: OE_DEBUG_PUB.ADD('Converted amount 1 :'||l_amount);
109: end if;
110:
111: IF l_amount < 0 THEN
112: RAISE No_Conversion_Rate;
120:
121: l_sob_rec := OE_Order_Cache.Load_Set_Of_Books;
122:
123: if l_debug_level > 0 then
124: OE_DEBUG_PUB.ADD('SOB Currency :'||l_sob_rec.currency_code);
125: end if;
126:
127: IF l_sob_rec.currency_code <> p_to_currency THEN
128:
135: ,x_amount => p_amount
136: ,x_max_roll_days => -1
137: );
138: if l_debug_level > 0 then
139: OE_DEBUG_PUB.ADD('Converted amount 2 :'||l_amount);
140: end if;
141:
142: IF l_amount < 0 THEN
143: RAISE No_Conversion_Rate;
152: ,x_amount => l_amount
153: ,x_max_roll_days => -1
154: );
155: if l_debug_level > 0 then
156: OE_DEBUG_PUB.ADD('Converted amount 3 :'||l_amount);
157: end if;
158:
159: IF l_amount < 0 THEN
160: RAISE No_Conversion_Rate;
173:
174: EXCEPTION
175: WHEN No_Conversion_Rate THEN
176: if l_debug_level > 0 then
177: oe_debug_pub.add('no rate found in either blanket or sob currency');
178: end if;
179: FND_MESSAGE.SET_NAME('ONT','OE_BL_MISSING_CONV_RATE');
180: FND_MESSAGE.SET_TOKEN('BLANKET_CURRENCY',p_to_currency);
181: OE_MSG_PUB.ADD;
245: l_blanket_header_id NUMBER;
246: l_blanket_line_id NUMBER;
247:
248: --
249: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
250: --
251: BEGIN
252:
253: if l_debug_level > 0 then
250: --
251: BEGIN
252:
253: if l_debug_level > 0 then
254: oe_debug_pub.add('Enter cache blanket');
255: oe_debug_pub.add('lock :'||p_lock);
256: oe_debug_pub.add('blanket number :'||p_blanket_number);
257: oe_debug_pub.add('blanket number :'||p_blanket_line_number);
258: end if;
251: BEGIN
252:
253: if l_debug_level > 0 then
254: oe_debug_pub.add('Enter cache blanket');
255: oe_debug_pub.add('lock :'||p_lock);
256: oe_debug_pub.add('blanket number :'||p_blanket_number);
257: oe_debug_pub.add('blanket number :'||p_blanket_line_number);
258: end if;
259:
252:
253: if l_debug_level > 0 then
254: oe_debug_pub.add('Enter cache blanket');
255: oe_debug_pub.add('lock :'||p_lock);
256: oe_debug_pub.add('blanket number :'||p_blanket_number);
257: oe_debug_pub.add('blanket number :'||p_blanket_line_number);
258: end if;
259:
260: SELECT line_id
253: if l_debug_level > 0 then
254: oe_debug_pub.add('Enter cache blanket');
255: oe_debug_pub.add('lock :'||p_lock);
256: oe_debug_pub.add('blanket number :'||p_blanket_number);
257: oe_debug_pub.add('blanket number :'||p_blanket_line_number);
258: end if;
259:
260: SELECT line_id
261: INTO x_blanket_line_id
267: x_blanket_line_id := MOD(x_blanket_line_id , G_BINARY_LIMIT); --bug8465849
268:
269:
270: if l_debug_level > 0 then
271: oe_debug_pub.add('blanket line id :'||x_blanket_line_id);
272: if g_blkt_line_tbl.exists(x_blanket_line_id) then
273: oe_debug_pub.add('locked flag :'|| g_blkt_line_tbl(x_blanket_line_id).locked_flag);
274: end if;
275: end if;
269:
270: if l_debug_level > 0 then
271: oe_debug_pub.add('blanket line id :'||x_blanket_line_id);
272: if g_blkt_line_tbl.exists(x_blanket_line_id) then
273: oe_debug_pub.add('locked flag :'|| g_blkt_line_tbl(x_blanket_line_id).locked_flag);
274: end if;
275: end if;
276:
277: --------------------------------------------------------------------
285: )
286: THEN
287:
288: if l_debug_level > 0 then
289: oe_debug_pub.add('query blanket line');
290: end if;
291:
292: OPEN c_blanket_line(l_blanket_line_id);--bug8465849
293: FETCH c_blanket_line INTO
317: IF p_lock = 'Y'
318: AND g_blkt_line_tbl(x_blanket_line_id).locked_flag = 'N'
319: THEN
320: if l_debug_level > 0 then
321: oe_debug_pub.add('lock blanket line');
322: end if;
323: SELECT 'Y'
324: INTO g_blkt_line_tbl(x_blanket_line_id).locked_flag
325: FROM oe_blanket_lines_all
341: )
342: THEN
343:
344: if l_debug_level > 0 then
345: oe_debug_pub.add('query blanket header');
346: end if;
347:
348: OPEN c_blanket_header(l_blanket_header_id);
349: FETCH c_blanket_header INTO
364: IF p_lock = 'Y'
365: AND g_blkt_hdr_tbl(x_blanket_header_id).locked_flag = 'N'
366: THEN
367: if l_debug_level > 0 then
368: oe_debug_pub.add('lock blanket header');
369: end if;
370: SELECT 'Y'
371: INTO g_blkt_hdr_tbl(x_blanket_header_id).locked_flag
372: FROM oe_blanket_headers_all
374: FOR UPDATE NOWAIT;
375: END IF;
376:
377: if l_debug_level > 0 then
378: oe_debug_pub.add('Exit cache blanket');
379: end if;
380:
381: EXCEPTION
382: WHEN APP_EXCEPTIONS.RECORD_LOCK_EXCEPTION THEN
429: l_hdr_released_amount NUMBER := 0;
430: l_released_quantity NUMBER := 0;
431:
432: --
433: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
434: --
435: BEGIN
436:
437: x_return_status := FND_API.G_RET_STS_SUCCESS;
447: -- COMPUTE RELEASE QUANTITY IF Blanket UOM Exists
448: --------------------------------------------------------------------
449:
450: if l_debug_level > 0 then
451: oe_debug_pub.add('Blanket UOM:'||g_blkt_line_tbl(l_blanket_line_id).uom);
452: oe_debug_pub.add('INITIAL blkt line released qty: '||
453: g_blkt_line_tbl(l_blanket_line_id).released_quantity);
454: oe_debug_pub.add('INITIAL blkt line released amt: '||
455: g_blkt_line_tbl(l_blanket_line_id).released_amount);
448: --------------------------------------------------------------------
449:
450: if l_debug_level > 0 then
451: oe_debug_pub.add('Blanket UOM:'||g_blkt_line_tbl(l_blanket_line_id).uom);
452: oe_debug_pub.add('INITIAL blkt line released qty: '||
453: g_blkt_line_tbl(l_blanket_line_id).released_quantity);
454: oe_debug_pub.add('INITIAL blkt line released amt: '||
455: g_blkt_line_tbl(l_blanket_line_id).released_amount);
456: oe_debug_pub.add('INITIAL blkt hdr released amt: '||
450: if l_debug_level > 0 then
451: oe_debug_pub.add('Blanket UOM:'||g_blkt_line_tbl(l_blanket_line_id).uom);
452: oe_debug_pub.add('INITIAL blkt line released qty: '||
453: g_blkt_line_tbl(l_blanket_line_id).released_quantity);
454: oe_debug_pub.add('INITIAL blkt line released amt: '||
455: g_blkt_line_tbl(l_blanket_line_id).released_amount);
456: oe_debug_pub.add('INITIAL blkt hdr released amt: '||
457: g_blkt_hdr_tbl(l_blanket_header_id).released_amount);
458: oe_debug_pub.add('new qty :'||p_quantity);
452: oe_debug_pub.add('INITIAL blkt line released qty: '||
453: g_blkt_line_tbl(l_blanket_line_id).released_quantity);
454: oe_debug_pub.add('INITIAL blkt line released amt: '||
455: g_blkt_line_tbl(l_blanket_line_id).released_amount);
456: oe_debug_pub.add('INITIAL blkt hdr released amt: '||
457: g_blkt_hdr_tbl(l_blanket_header_id).released_amount);
458: oe_debug_pub.add('new qty :'||p_quantity);
459: oe_debug_pub.add('old qty :'||p_old_quantity);
460: oe_debug_pub.add('new SP :'||p_unit_selling_price);
454: oe_debug_pub.add('INITIAL blkt line released amt: '||
455: g_blkt_line_tbl(l_blanket_line_id).released_amount);
456: oe_debug_pub.add('INITIAL blkt hdr released amt: '||
457: g_blkt_hdr_tbl(l_blanket_header_id).released_amount);
458: oe_debug_pub.add('new qty :'||p_quantity);
459: oe_debug_pub.add('old qty :'||p_old_quantity);
460: oe_debug_pub.add('new SP :'||p_unit_selling_price);
461: oe_debug_pub.add('old SP :'||p_old_unit_selling_price);
462: oe_debug_pub.add('from uom :'||p_order_qty_uom);
455: g_blkt_line_tbl(l_blanket_line_id).released_amount);
456: oe_debug_pub.add('INITIAL blkt hdr released amt: '||
457: g_blkt_hdr_tbl(l_blanket_header_id).released_amount);
458: oe_debug_pub.add('new qty :'||p_quantity);
459: oe_debug_pub.add('old qty :'||p_old_quantity);
460: oe_debug_pub.add('new SP :'||p_unit_selling_price);
461: oe_debug_pub.add('old SP :'||p_old_unit_selling_price);
462: oe_debug_pub.add('from uom :'||p_order_qty_uom);
463: oe_debug_pub.add('inv item :'||p_inv_item_id);
456: oe_debug_pub.add('INITIAL blkt hdr released amt: '||
457: g_blkt_hdr_tbl(l_blanket_header_id).released_amount);
458: oe_debug_pub.add('new qty :'||p_quantity);
459: oe_debug_pub.add('old qty :'||p_old_quantity);
460: oe_debug_pub.add('new SP :'||p_unit_selling_price);
461: oe_debug_pub.add('old SP :'||p_old_unit_selling_price);
462: oe_debug_pub.add('from uom :'||p_order_qty_uom);
463: oe_debug_pub.add('inv item :'||p_inv_item_id);
464: end if;
457: g_blkt_hdr_tbl(l_blanket_header_id).released_amount);
458: oe_debug_pub.add('new qty :'||p_quantity);
459: oe_debug_pub.add('old qty :'||p_old_quantity);
460: oe_debug_pub.add('new SP :'||p_unit_selling_price);
461: oe_debug_pub.add('old SP :'||p_old_unit_selling_price);
462: oe_debug_pub.add('from uom :'||p_order_qty_uom);
463: oe_debug_pub.add('inv item :'||p_inv_item_id);
464: end if;
465:
458: oe_debug_pub.add('new qty :'||p_quantity);
459: oe_debug_pub.add('old qty :'||p_old_quantity);
460: oe_debug_pub.add('new SP :'||p_unit_selling_price);
461: oe_debug_pub.add('old SP :'||p_old_unit_selling_price);
462: oe_debug_pub.add('from uom :'||p_order_qty_uom);
463: oe_debug_pub.add('inv item :'||p_inv_item_id);
464: end if;
465:
466: IF p_order_qty_uom IS NULL THEN
459: oe_debug_pub.add('old qty :'||p_old_quantity);
460: oe_debug_pub.add('new SP :'||p_unit_selling_price);
461: oe_debug_pub.add('old SP :'||p_old_unit_selling_price);
462: oe_debug_pub.add('from uom :'||p_order_qty_uom);
463: oe_debug_pub.add('inv item :'||p_inv_item_id);
464: end if;
465:
466: IF p_order_qty_uom IS NULL THEN
467: l_quantity := 0;
489: ,p_to_uom_code => g_blkt_line_tbl(l_blanket_line_id).uom
490: ,p_from_qty => l_quantity
491: );
492: if l_debug_level > 0 then
493: oe_debug_pub.add('conv new qty :'||l_quantity);
494: end if;
495: IF l_quantity < 0 THEN
496: FND_MESSAGE.SET_NAME('ONT','OE_BL_UOM_CONV_FAILED');
497: FND_MESSAGE.SET_TOKEN('LINE_NUMBER',Get_Line_Number(p_line_id));
511: ,p_to_uom_code => g_blkt_line_tbl(l_blanket_line_id).uom
512: ,p_from_qty => l_old_quantity
513: );
514: if l_debug_level > 0 then
515: oe_debug_pub.add('conv old qty :'||l_quantity);
516: end if;
517: IF l_old_quantity < 0 THEN
518: FND_MESSAGE.SET_NAME('ONT','OE_BL_UOM_CONV_FAILED');
519: FND_MESSAGE.SET_TOKEN('LINE_NUMBER',Get_Line_Number(p_line_id));
583: l_hdr_released_amount := g_blkt_hdr_tbl(l_blanket_header_id).released_amount
584: + (l_amount - l_old_amount);
585:
586: if l_debug_level > 0 then
587: oe_debug_pub.add('curr line amt :'||l_amount);
588: oe_debug_pub.add('bl line released qty :'||l_released_quantity);
589: oe_debug_pub.add('bl line released amt :'||l_released_amount);
590: oe_debug_pub.add('hdr released amt :'||l_hdr_released_amount);
591: end if;
584: + (l_amount - l_old_amount);
585:
586: if l_debug_level > 0 then
587: oe_debug_pub.add('curr line amt :'||l_amount);
588: oe_debug_pub.add('bl line released qty :'||l_released_quantity);
589: oe_debug_pub.add('bl line released amt :'||l_released_amount);
590: oe_debug_pub.add('hdr released amt :'||l_hdr_released_amount);
591: end if;
592:
585:
586: if l_debug_level > 0 then
587: oe_debug_pub.add('curr line amt :'||l_amount);
588: oe_debug_pub.add('bl line released qty :'||l_released_quantity);
589: oe_debug_pub.add('bl line released amt :'||l_released_amount);
590: oe_debug_pub.add('hdr released amt :'||l_hdr_released_amount);
591: end if;
592:
593: --------------------------------------------------------------------
586: if l_debug_level > 0 then
587: oe_debug_pub.add('curr line amt :'||l_amount);
588: oe_debug_pub.add('bl line released qty :'||l_released_quantity);
589: oe_debug_pub.add('bl line released amt :'||l_released_amount);
590: oe_debug_pub.add('hdr released amt :'||l_hdr_released_amount);
591: end if;
592:
593: --------------------------------------------------------------------
594: -- VALIDATE MIN/MAX IF OVERRIDE NOT ALLOWED
899:
900: END IF;
901:
902: if l_debug_level > 0 then
903: oe_debug_pub.add('Final blkt line released qty: '||
904: g_blkt_line_tbl(l_blanket_line_id).released_quantity);
905: oe_debug_pub.add('Final blkt line released amt: '||
906: g_blkt_line_tbl(l_blanket_line_id).released_amount);
907: oe_debug_pub.add('Final blkt hdr released amt: '||
901:
902: if l_debug_level > 0 then
903: oe_debug_pub.add('Final blkt line released qty: '||
904: g_blkt_line_tbl(l_blanket_line_id).released_quantity);
905: oe_debug_pub.add('Final blkt line released amt: '||
906: g_blkt_line_tbl(l_blanket_line_id).released_amount);
907: oe_debug_pub.add('Final blkt hdr released amt: '||
908: g_blkt_hdr_tbl(l_blanket_header_id).released_amount);
909: end if;
903: oe_debug_pub.add('Final blkt line released qty: '||
904: g_blkt_line_tbl(l_blanket_line_id).released_quantity);
905: oe_debug_pub.add('Final blkt line released amt: '||
906: g_blkt_line_tbl(l_blanket_line_id).released_amount);
907: oe_debug_pub.add('Final blkt hdr released amt: '||
908: g_blkt_hdr_tbl(l_blanket_header_id).released_amount);
909: end if;
910:
911: -- End of min-max checks
936: IS
937: l_index NUMBER;
938: BEGIN
939:
940: oe_debug_pub.add('Inside update blanket');
941:
942: l_index := g_blkt_hdr_tbl.FIRST;
943: WHILE l_index IS NOT NULL LOOP
944:
979:
980:
981: END LOOP;
982:
983: oe_debug_pub.add('Leaving update blanket');
984:
985: EXCEPTION
986: WHEN OTHERS THEN
987: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1018: l_uom VARCHAR2(3);
1019: l_inv_item_id NUMBER;
1020: l_set_line_number NUMBER;
1021: --
1022: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1023: --
1024:
1025: FUNCTION Get_Set_Line_Number RETURN NUMBER IS
1026: BEGIN
1071: AND blanket_number = p_blanket_number
1072: AND blanket_line_number = p_blanket_line_number;
1073:
1074: if l_debug_level > 0 then
1075: oe_debug_pub.add('Set Qty :'||l_set_quantity);
1076: oe_debug_pub.add('Set Amt :'||l_set_amount);
1077: end if;
1078:
1079: -- Min/Max Qty Validations only if UOM exists on blanket line
1072: AND blanket_line_number = p_blanket_line_number;
1073:
1074: if l_debug_level > 0 then
1075: oe_debug_pub.add('Set Qty :'||l_set_quantity);
1076: oe_debug_pub.add('Set Amt :'||l_set_amount);
1077: end if;
1078:
1079: -- Min/Max Qty Validations only if UOM exists on blanket line
1080: IF g_blkt_line_tbl(l_blanket_line_id).uom IS NOT NULL
1084: IF NOT OE_GLOBALS.EQUAL(l_uom,
1085: g_blkt_line_tbl(l_blanket_line_id).uom)
1086: THEN
1087:
1088: oe_debug_pub.add('convert uom');
1089: l_set_quantity := OE_Order_Misc_Util.Convert_UOM
1090: (p_item_id => l_inv_item_id
1091: ,p_from_uom_code => l_uom
1092: ,p_to_uom_code => g_blkt_line_tbl(l_blanket_line_id).uom
1138: END IF;
1139:
1140: END IF;
1141:
1142: oe_debug_pub.add('Amt Checks');
1143: -- Min/Max Amount Validations
1144: IF l_set_amount <> 0 THEN
1145:
1146: IF p_currency_code
1256: l_currency_code VARCHAR2(15);
1257: l_hdr_id NUMBER;
1258: p_request_tbl_temp OE_ORDER_PUB.Request_Tbl_Type;
1259: --
1260: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1261: --
1262: BEGIN
1263:
1264: if l_debug_level > 0 then
1261: --
1262: BEGIN
1263:
1264: if l_debug_level > 0 then
1265: oe_debug_pub.add('ENTER OE_Blanket_Util.Process_Releases, Num Requests :'
1266: || p_request_tbl.COUNT);
1267: end if;
1268:
1269: g_blkt_line_tbl.delete;
1280: GOTO end_of_loop;
1281: END IF;
1282:
1283: if l_debug_level > 0 then
1284: oe_debug_pub.add('VALIDATE_RELEASE_SHIPMENTS, line set id: '
1285: ||p_request_tbl(I).entity_id);
1286: end if;
1287:
1288: Validate_Release_Shipments
1293: ,x_return_status => l_return_status
1294: );
1295:
1296: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1297: oe_debug_pub.add('ret sts of error');
1298: x_return_status := FND_API.G_RET_STS_ERROR;
1299: RETURN;
1300: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1301: oe_debug_pub.add('ret sts of unexp error');
1297: oe_debug_pub.add('ret sts of error');
1298: x_return_status := FND_API.G_RET_STS_ERROR;
1299: RETURN;
1300: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1301: oe_debug_pub.add('ret sts of unexp error');
1302: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1303: RETURN;
1304: END IF;
1305:
1344: THEN
1345: GOTO end_of_loop;
1346: END IF;
1347:
1348: oe_debug_pub.add('PROCESS_RELEASE, line id: '||p_request_tbl_temp(I).entity_id);
1349:
1350: begin
1351: select header_id
1352: into l_hdr_id
1378:
1379: l_currency_code := p_request_tbl_temp(I).request_unique_key1;
1380:
1381: if l_debug_level > 0 then
1382: oe_debug_pub.add('header currency :'||l_currency_code);
1383: oe_debug_pub.add('old blanket num :'||p_request_tbl_temp(I).param1);
1384: oe_debug_pub.add('new blanket num:'||p_request_tbl_temp(I).param11);
1385: oe_debug_pub.add('old blanket line num:'||p_request_tbl_temp(I).param2);
1386: oe_debug_pub.add('new blanket line num:'||p_request_tbl_temp(I).param12);
1379: l_currency_code := p_request_tbl_temp(I).request_unique_key1;
1380:
1381: if l_debug_level > 0 then
1382: oe_debug_pub.add('header currency :'||l_currency_code);
1383: oe_debug_pub.add('old blanket num :'||p_request_tbl_temp(I).param1);
1384: oe_debug_pub.add('new blanket num:'||p_request_tbl_temp(I).param11);
1385: oe_debug_pub.add('old blanket line num:'||p_request_tbl_temp(I).param2);
1386: oe_debug_pub.add('new blanket line num:'||p_request_tbl_temp(I).param12);
1387: end if;
1380:
1381: if l_debug_level > 0 then
1382: oe_debug_pub.add('header currency :'||l_currency_code);
1383: oe_debug_pub.add('old blanket num :'||p_request_tbl_temp(I).param1);
1384: oe_debug_pub.add('new blanket num:'||p_request_tbl_temp(I).param11);
1385: oe_debug_pub.add('old blanket line num:'||p_request_tbl_temp(I).param2);
1386: oe_debug_pub.add('new blanket line num:'||p_request_tbl_temp(I).param12);
1387: end if;
1388:
1381: if l_debug_level > 0 then
1382: oe_debug_pub.add('header currency :'||l_currency_code);
1383: oe_debug_pub.add('old blanket num :'||p_request_tbl_temp(I).param1);
1384: oe_debug_pub.add('new blanket num:'||p_request_tbl_temp(I).param11);
1385: oe_debug_pub.add('old blanket line num:'||p_request_tbl_temp(I).param2);
1386: oe_debug_pub.add('new blanket line num:'||p_request_tbl_temp(I).param12);
1387: end if;
1388:
1389: -- Blanket line remained same but some other field affecting
1382: oe_debug_pub.add('header currency :'||l_currency_code);
1383: oe_debug_pub.add('old blanket num :'||p_request_tbl_temp(I).param1);
1384: oe_debug_pub.add('new blanket num:'||p_request_tbl_temp(I).param11);
1385: oe_debug_pub.add('old blanket line num:'||p_request_tbl_temp(I).param2);
1386: oe_debug_pub.add('new blanket line num:'||p_request_tbl_temp(I).param12);
1387: end if;
1388:
1389: -- Blanket line remained same but some other field affecting
1390: -- qty or price was updated
1392: AND p_request_tbl_temp(I).param2 = p_request_tbl_temp(I).param12
1393: THEN
1394:
1395: if l_debug_level > 0 then
1396: oe_debug_pub.add('Update qty/amt for existing blanket num :'
1397: ||p_request_tbl_temp(I).param11);
1398: end if;
1399:
1400: Update_Released_Qty_Amount
1415: ,x_return_status => l_return_status
1416: );
1417:
1418: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1419: oe_debug_pub.add('1. ret sts of error');
1420: x_return_status := FND_API.G_RET_STS_ERROR;
1421: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1422: oe_debug_pub.add('1. ret sts of unexp error');
1423: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1418: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1419: oe_debug_pub.add('1. ret sts of error');
1420: x_return_status := FND_API.G_RET_STS_ERROR;
1421: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1422: oe_debug_pub.add('1. ret sts of unexp error');
1423: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1424: END IF;
1425:
1426: ELSE
1428: -- Increment qty/amount for new blanket line
1429: IF p_request_tbl_temp(I).param11 IS NOT NULL THEN
1430:
1431: if l_debug_level > 0 then
1432: oe_debug_pub.add('Increment qty/amt for new blanket num :'
1433: ||p_request_tbl_temp(I).param11);
1434: end if;
1435:
1436: Update_Released_Qty_Amount
1453:
1454: END IF;
1455:
1456: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1457: oe_debug_pub.add('2. ret sts of error');
1458: x_return_status := FND_API.G_RET_STS_ERROR;
1459: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1460: oe_debug_pub.add('2. ret sts of unexp error');
1461: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1456: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1457: oe_debug_pub.add('2. ret sts of error');
1458: x_return_status := FND_API.G_RET_STS_ERROR;
1459: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1460: oe_debug_pub.add('2. ret sts of unexp error');
1461: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1462: END IF;
1463:
1464: -- Decrement qty/amount for old blanket line
1464: -- Decrement qty/amount for old blanket line
1465: IF p_request_tbl_temp(I).param1 IS NOT NULL THEN
1466:
1467: if l_debug_level > 0 then
1468: oe_debug_pub.add('Decrement qty/amt for old blanket num :'
1469: ||p_request_tbl_temp(I).param1);
1470: end if;
1471:
1472: Update_Released_Qty_Amount
1489:
1490: END IF;
1491:
1492: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1493: oe_debug_pub.add('3. ret sts of error');
1494: x_return_status := FND_API.G_RET_STS_ERROR;
1495: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1496: oe_debug_pub.add('3. ret sts of unexp error');
1497: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1492: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
1493: oe_debug_pub.add('3. ret sts of error');
1494: x_return_status := FND_API.G_RET_STS_ERROR;
1495: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1496: oe_debug_pub.add('3. ret sts of unexp error');
1497: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1498: END IF;
1499:
1500: END IF;
1532: -- Error during updates, mark the requests as NOT processed
1533: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1534:
1535: if l_debug_level > 0 then
1536: oe_debug_pub.add('Overall Ret Sts :'||x_return_status);
1537: end if;
1538:
1539: I := p_request_tbl.FIRST;
1540: WHILE I IS NOT NULL LOOP
1539: I := p_request_tbl.FIRST;
1540: WHILE I IS NOT NULL LOOP
1541: IF p_request_tbl(I).request_type = 'PROCESS_RELEASE' THEN
1542: if l_debug_level > 0 then
1543: oe_debug_pub.add('Set req to NOT processed at index :'||I);
1544: end if;
1545: p_request_tbl(I).processed := 'N';
1546: END IF;
1547: I := p_request_tbl.NEXT(I);
1556: -- Only if blankets update is successful,
1557: -- delete the old order released qty/amount also.
1558: IF OE_CODE_CONTROL.CODE_RELEASE_LEVEL >= '110510' THEN
1559:
1560: oe_debug_pub.add('delete cache');
1561: g_bl_order_val_tbl.delete;
1562: g_bh_order_val_tbl.delete;
1563:
1564: END IF;
1565:
1566: END IF;
1567:
1568: if l_debug_level > 0 then
1569: oe_debug_pub.add('EXIT OE_Blanket_Util.Process_Releases');
1570: end if;
1571:
1572: EXCEPTION
1573: WHEN FND_API.G_EXC_ERROR THEN
1607: l_rem_bl_line_amt NUMBER;
1608: l_rem_bl_hdr_amt NUMBER;
1609: l_currency_code VARCHAR2(15);
1610: --
1611: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1612: --
1613: BEGIN
1614:
1615: if l_debug_level > 0 then
1612: --
1613: BEGIN
1614:
1615: if l_debug_level > 0 then
1616: oe_debug_pub.add('Enter Populate_Old_Values');
1617: oe_debug_pub.add('Blanket Num :'||p_blanket_number);
1618: oe_debug_pub.add('Blanket Line Num :'||p_blanket_line_number);
1619: oe_debug_pub.add('Line ID :'||p_line_id);
1620: oe_debug_pub.add('Header ID :'||p_header_id);
1613: BEGIN
1614:
1615: if l_debug_level > 0 then
1616: oe_debug_pub.add('Enter Populate_Old_Values');
1617: oe_debug_pub.add('Blanket Num :'||p_blanket_number);
1618: oe_debug_pub.add('Blanket Line Num :'||p_blanket_line_number);
1619: oe_debug_pub.add('Line ID :'||p_line_id);
1620: oe_debug_pub.add('Header ID :'||p_header_id);
1621: oe_debug_pub.add('Old Qty :'||p_old_quantity);
1614:
1615: if l_debug_level > 0 then
1616: oe_debug_pub.add('Enter Populate_Old_Values');
1617: oe_debug_pub.add('Blanket Num :'||p_blanket_number);
1618: oe_debug_pub.add('Blanket Line Num :'||p_blanket_line_number);
1619: oe_debug_pub.add('Line ID :'||p_line_id);
1620: oe_debug_pub.add('Header ID :'||p_header_id);
1621: oe_debug_pub.add('Old Qty :'||p_old_quantity);
1622: oe_debug_pub.add('Old Selling Price :'||p_old_unit_sp);
1615: if l_debug_level > 0 then
1616: oe_debug_pub.add('Enter Populate_Old_Values');
1617: oe_debug_pub.add('Blanket Num :'||p_blanket_number);
1618: oe_debug_pub.add('Blanket Line Num :'||p_blanket_line_number);
1619: oe_debug_pub.add('Line ID :'||p_line_id);
1620: oe_debug_pub.add('Header ID :'||p_header_id);
1621: oe_debug_pub.add('Old Qty :'||p_old_quantity);
1622: oe_debug_pub.add('Old Selling Price :'||p_old_unit_sp);
1623: end if;
1616: oe_debug_pub.add('Enter Populate_Old_Values');
1617: oe_debug_pub.add('Blanket Num :'||p_blanket_number);
1618: oe_debug_pub.add('Blanket Line Num :'||p_blanket_line_number);
1619: oe_debug_pub.add('Line ID :'||p_line_id);
1620: oe_debug_pub.add('Header ID :'||p_header_id);
1621: oe_debug_pub.add('Old Qty :'||p_old_quantity);
1622: oe_debug_pub.add('Old Selling Price :'||p_old_unit_sp);
1623: end if;
1624:
1617: oe_debug_pub.add('Blanket Num :'||p_blanket_number);
1618: oe_debug_pub.add('Blanket Line Num :'||p_blanket_line_number);
1619: oe_debug_pub.add('Line ID :'||p_line_id);
1620: oe_debug_pub.add('Header ID :'||p_header_id);
1621: oe_debug_pub.add('Old Qty :'||p_old_quantity);
1622: oe_debug_pub.add('Old Selling Price :'||p_old_unit_sp);
1623: end if;
1624:
1625: -- Do not lock when caching old values
1618: oe_debug_pub.add('Blanket Line Num :'||p_blanket_line_number);
1619: oe_debug_pub.add('Line ID :'||p_line_id);
1620: oe_debug_pub.add('Header ID :'||p_header_id);
1621: oe_debug_pub.add('Old Qty :'||p_old_quantity);
1622: oe_debug_pub.add('Old Selling Price :'||p_old_unit_sp);
1623: end if;
1624:
1625: -- Do not lock when caching old values
1626: Cache_Blanket
1712:
1713: END IF;
1714:
1715: if l_debug_level > 0 then
1716: oe_debug_pub.add('order header id :'||l_header_id);
1717: oe_debug_pub.add('rem bl line qty :'||nvl(l_rem_bl_line_qty,0));
1718: oe_debug_pub.add('rem bl line amt :'||nvl(l_rem_bl_line_amt,0));
1719: oe_debug_pub.add('rem bl hdr amt :'||nvl(l_rem_bl_hdr_amt,0));
1720: oe_debug_pub.add('old qty :'||l_old_quantity);
1713: END IF;
1714:
1715: if l_debug_level > 0 then
1716: oe_debug_pub.add('order header id :'||l_header_id);
1717: oe_debug_pub.add('rem bl line qty :'||nvl(l_rem_bl_line_qty,0));
1718: oe_debug_pub.add('rem bl line amt :'||nvl(l_rem_bl_line_amt,0));
1719: oe_debug_pub.add('rem bl hdr amt :'||nvl(l_rem_bl_hdr_amt,0));
1720: oe_debug_pub.add('old qty :'||l_old_quantity);
1721: oe_debug_pub.add('old amt :'||l_old_amount);
1714:
1715: if l_debug_level > 0 then
1716: oe_debug_pub.add('order header id :'||l_header_id);
1717: oe_debug_pub.add('rem bl line qty :'||nvl(l_rem_bl_line_qty,0));
1718: oe_debug_pub.add('rem bl line amt :'||nvl(l_rem_bl_line_amt,0));
1719: oe_debug_pub.add('rem bl hdr amt :'||nvl(l_rem_bl_hdr_amt,0));
1720: oe_debug_pub.add('old qty :'||l_old_quantity);
1721: oe_debug_pub.add('old amt :'||l_old_amount);
1722: end if;
1715: if l_debug_level > 0 then
1716: oe_debug_pub.add('order header id :'||l_header_id);
1717: oe_debug_pub.add('rem bl line qty :'||nvl(l_rem_bl_line_qty,0));
1718: oe_debug_pub.add('rem bl line amt :'||nvl(l_rem_bl_line_amt,0));
1719: oe_debug_pub.add('rem bl hdr amt :'||nvl(l_rem_bl_hdr_amt,0));
1720: oe_debug_pub.add('old qty :'||l_old_quantity);
1721: oe_debug_pub.add('old amt :'||l_old_amount);
1722: end if;
1723:
1716: oe_debug_pub.add('order header id :'||l_header_id);
1717: oe_debug_pub.add('rem bl line qty :'||nvl(l_rem_bl_line_qty,0));
1718: oe_debug_pub.add('rem bl line amt :'||nvl(l_rem_bl_line_amt,0));
1719: oe_debug_pub.add('rem bl hdr amt :'||nvl(l_rem_bl_hdr_amt,0));
1720: oe_debug_pub.add('old qty :'||l_old_quantity);
1721: oe_debug_pub.add('old amt :'||l_old_amount);
1722: end if;
1723:
1724: END IF; -- if not cached
1717: oe_debug_pub.add('rem bl line qty :'||nvl(l_rem_bl_line_qty,0));
1718: oe_debug_pub.add('rem bl line amt :'||nvl(l_rem_bl_line_amt,0));
1719: oe_debug_pub.add('rem bl hdr amt :'||nvl(l_rem_bl_hdr_amt,0));
1720: oe_debug_pub.add('old qty :'||l_old_quantity);
1721: oe_debug_pub.add('old amt :'||l_old_amount);
1722: end if;
1723:
1724: END IF; -- if not cached
1725:
1753: l_old_line_quantity NUMBER;
1754: l_rem_lines_quantity NUMBER;
1755: l_currency_code VARCHAR2(15);
1756: --
1757: l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1758: --
1759:
1760: BEGIN
1761:
1759:
1760: BEGIN
1761:
1762: if l_debug_level > 0 then
1763: oe_debug_pub.add('ENTER OE_Blkt_Release_Util.Cache_Order_Qty_Amt');
1764: end if;
1765:
1766: x_return_status := fnd_api.g_ret_sts_success;
1767:
1809:
1810: END IF;
1811:
1812: if l_debug_level > 0 then
1813: oe_debug_pub.add('EXIT OE_Blkt_Release_Util.Cache_Order_Qty_Amt');
1814: end if;
1815:
1816: EXCEPTION
1817: WHEN FND_API.G_EXC_ERROR THEN