1: PACKAGE BODY RCV_QUANTITIES_S AS
2: /* $Header: RCVTXQUB.pls 120.16.12020000.2 2012/07/10 09:29:37 ptkumar ship $*/
3:
4: g_asn_debug VARCHAR2(1) := asn_debug.is_debug_on; -- Bug 9152790
5:
6: /*
7: ** Forward declarations of all the local procedures and functions called
8: ** by get_available_quantity().
367: BEGIN
368:
369: x_progress := '005';
370:
371: IF (g_asn_debug = 'Y') THEN
372: asn_debug.put_line('p_transaction_type '||p_transaction_type);
373: asn_debug.put_line('p_parent_id '||p_parent_id);
374: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type);
375: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id);
368:
369: x_progress := '005';
370:
371: IF (g_asn_debug = 'Y') THEN
372: asn_debug.put_line('p_transaction_type '||p_transaction_type);
373: asn_debug.put_line('p_parent_id '||p_parent_id);
374: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type);
375: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id);
376: asn_debug.put_line('p_correction_type '||p_correction_type);
369: x_progress := '005';
370:
371: IF (g_asn_debug = 'Y') THEN
372: asn_debug.put_line('p_transaction_type '||p_transaction_type);
373: asn_debug.put_line('p_parent_id '||p_parent_id);
374: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type);
375: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id);
376: asn_debug.put_line('p_correction_type '||p_correction_type);
377: END IF;
370:
371: IF (g_asn_debug = 'Y') THEN
372: asn_debug.put_line('p_transaction_type '||p_transaction_type);
373: asn_debug.put_line('p_parent_id '||p_parent_id);
374: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type);
375: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id);
376: asn_debug.put_line('p_correction_type '||p_correction_type);
377: END IF;
378: IF p_transaction_type = 'RECEIVE' THEN
371: IF (g_asn_debug = 'Y') THEN
372: asn_debug.put_line('p_transaction_type '||p_transaction_type);
373: asn_debug.put_line('p_parent_id '||p_parent_id);
374: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type);
375: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id);
376: asn_debug.put_line('p_correction_type '||p_correction_type);
377: END IF;
378: IF p_transaction_type = 'RECEIVE' THEN
379:
372: asn_debug.put_line('p_transaction_type '||p_transaction_type);
373: asn_debug.put_line('p_parent_id '||p_parent_id);
374: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type);
375: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id);
376: asn_debug.put_line('p_correction_type '||p_correction_type);
377: END IF;
378: IF p_transaction_type = 'RECEIVE' THEN
379:
380: get_receive_amount(p_parent_id, p_receipt_source_code,
406: RAISE invalid_transaction_type;
407:
408: END IF;
409:
410: IF (g_asn_debug = 'Y') THEN
411: asn_debug.put_line('Exit get_available_amt '||p_transaction_type);
412: asn_debug.put_line('p_available_amt '||p_available_amount);
413: asn_debug.put_line('p_tolerable_amount '||p_tolerable_amount);
414: end if;
407:
408: END IF;
409:
410: IF (g_asn_debug = 'Y') THEN
411: asn_debug.put_line('Exit get_available_amt '||p_transaction_type);
412: asn_debug.put_line('p_available_amt '||p_available_amount);
413: asn_debug.put_line('p_tolerable_amount '||p_tolerable_amount);
414: end if;
415: EXCEPTION
408: END IF;
409:
410: IF (g_asn_debug = 'Y') THEN
411: asn_debug.put_line('Exit get_available_amt '||p_transaction_type);
412: asn_debug.put_line('p_available_amt '||p_available_amount);
413: asn_debug.put_line('p_tolerable_amount '||p_tolerable_amount);
414: end if;
415: EXCEPTION
416:
409:
410: IF (g_asn_debug = 'Y') THEN
411: asn_debug.put_line('Exit get_available_amt '||p_transaction_type);
412: asn_debug.put_line('p_available_amt '||p_available_amount);
413: asn_debug.put_line('p_tolerable_amount '||p_tolerable_amount);
414: end if;
415: EXCEPTION
416:
417: WHEN invalid_transaction_type THEN
425: RAISE;
426:
427: WHEN OTHERS THEN
428:
429: IF (g_asn_debug = 'Y') THEN
430: asn_debug.put_line('When others exception in get_available_amt' );
431: end if;
432: po_message_s.sql_error('get_available_amount', x_progress, sqlcode);
433:
426:
427: WHEN OTHERS THEN
428:
429: IF (g_asn_debug = 'Y') THEN
430: asn_debug.put_line('When others exception in get_available_amt' );
431: end if;
432: po_message_s.sql_error('get_available_amount', x_progress, sqlcode);
433:
434: RAISE;
522:
523: invalid_receipt_source_code EXCEPTION;
524:
525: BEGIN
526: IF (g_asn_debug = 'Y') THEN
527: asn_debug.put_line('in get_receive_amount ' );
528: asn_debug.put_line('p_parent_id '||p_parent_id);
529: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code);
530: END IF;
523: invalid_receipt_source_code EXCEPTION;
524:
525: BEGIN
526: IF (g_asn_debug = 'Y') THEN
527: asn_debug.put_line('in get_receive_amount ' );
528: asn_debug.put_line('p_parent_id '||p_parent_id);
529: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code);
530: END IF;
531:
524:
525: BEGIN
526: IF (g_asn_debug = 'Y') THEN
527: asn_debug.put_line('in get_receive_amount ' );
528: asn_debug.put_line('p_parent_id '||p_parent_id);
529: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code);
530: END IF;
531:
532: IF (p_receipt_source_code = 'VENDOR') THEN
525: BEGIN
526: IF (g_asn_debug = 'Y') THEN
527: asn_debug.put_line('in get_receive_amount ' );
528: asn_debug.put_line('p_parent_id '||p_parent_id);
529: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code);
530: END IF;
531:
532: IF (p_receipt_source_code = 'VENDOR') THEN
533: IF (g_asn_debug = 'Y') THEN
529: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code);
530: END IF;
531:
532: IF (p_receipt_source_code = 'VENDOR') THEN
533: IF (g_asn_debug = 'Y') THEN
534: asn_debug.put_line('before get_po_amount ' );
535: end if;
536:
537: get_po_amount(p_parent_id, p_available_amount,
530: END IF;
531:
532: IF (p_receipt_source_code = 'VENDOR') THEN
533: IF (g_asn_debug = 'Y') THEN
534: asn_debug.put_line('before get_po_amount ' );
535: end if;
536:
537: get_po_amount(p_parent_id, p_available_amount,
538: p_tolerable_amount);
547: RAISE invalid_receipt_source_code;
548:
549: END IF;
550:
551: IF (g_asn_debug = 'Y') THEN
552: asn_debug.put_line('p_available_amount '||p_available_amount);
553: asn_debug.put_line('p_tolerable_amount '||p_tolerable_amount);
554: END IF;
555: EXCEPTION
548:
549: END IF;
550:
551: IF (g_asn_debug = 'Y') THEN
552: asn_debug.put_line('p_available_amount '||p_available_amount);
553: asn_debug.put_line('p_tolerable_amount '||p_tolerable_amount);
554: END IF;
555: EXCEPTION
556:
549: END IF;
550:
551: IF (g_asn_debug = 'Y') THEN
552: asn_debug.put_line('p_available_amount '||p_available_amount);
553: asn_debug.put_line('p_tolerable_amount '||p_tolerable_amount);
554: END IF;
555: EXCEPTION
556:
557: WHEN invalid_receipt_source_code THEN
565: RAISE;
566:
567: WHEN OTHERS THEN
568:
569: IF (g_asn_debug = 'Y') THEN
570: asn_debug.put_line('Exception get_receive_amount ' );
571: end if;
572: po_message_s.sql_error('get_receive_amount', x_progress, sqlcode);
573:
566:
567: WHEN OTHERS THEN
568:
569: IF (g_asn_debug = 'Y') THEN
570: asn_debug.put_line('Exception get_receive_amount ' );
571: end if;
572: po_message_s.sql_error('get_receive_amount', x_progress, sqlcode);
573:
574: RAISE;
849: ** Calculate the quantity available to be received.
850: */
851:
852: --
853: IF (g_asn_debug = 'Y') THEN
854: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
855: END IF;
856:
857: l_is_clm_po := po_clm_intg_grp.is_clm_po( p_po_header_id => NULL,
850: */
851:
852: --
853: IF (g_asn_debug = 'Y') THEN
854: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
855: END IF;
856:
857: l_is_clm_po := po_clm_intg_grp.is_clm_po( p_po_header_id => NULL,
858: p_po_line_id => NULL,
860: p_po_distribution_id => NULL);
861:
862: l_partial_funded_flag := 'N';
863:
864: IF (g_asn_debug = 'Y') THEN
865: asn_debug.put_line('line_location_id : ' || p_line_location_id);
866: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
867: END IF;
868:
861:
862: l_partial_funded_flag := 'N';
863:
864: IF (g_asn_debug = 'Y') THEN
865: asn_debug.put_line('line_location_id : ' || p_line_location_id);
866: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
867: END IF;
868:
869: IF l_is_clm_po = 'Y' THEN
862: l_partial_funded_flag := 'N';
863:
864: IF (g_asn_debug = 'Y') THEN
865: asn_debug.put_line('line_location_id : ' || p_line_location_id);
866: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
867: END IF;
868:
869: IF l_is_clm_po = 'Y' THEN
870: IF (g_asn_debug = 'Y') THEN
866: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
867: END IF;
868:
869: IF l_is_clm_po = 'Y' THEN
870: IF (g_asn_debug = 'Y') THEN
871: asn_debug.put_line('before calling po_clm_intg_grp.get_funding_info()');
872: END IF;
873:
874: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
867: END IF;
868:
869: IF l_is_clm_po = 'Y' THEN
870: IF (g_asn_debug = 'Y') THEN
871: asn_debug.put_line('before calling po_clm_intg_grp.get_funding_info()');
872: END IF;
873:
874: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
875: p_po_line_id => NULL,
896: x_return_status => l_return_status
897:
898: );
899:
900: IF (g_asn_debug = 'Y') THEN
901: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
902: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
903: asn_debug.put_line('l_quantity_received : ' || l_quantity_received);
904: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
897:
898: );
899:
900: IF (g_asn_debug = 'Y') THEN
901: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
902: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
903: asn_debug.put_line('l_quantity_received : ' || l_quantity_received);
904: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
905: END IF;
898: );
899:
900: IF (g_asn_debug = 'Y') THEN
901: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
902: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
903: asn_debug.put_line('l_quantity_received : ' || l_quantity_received);
904: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
905: END IF;
906:
899:
900: IF (g_asn_debug = 'Y') THEN
901: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
902: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
903: asn_debug.put_line('l_quantity_received : ' || l_quantity_received);
904: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
905: END IF;
906:
907: IF l_partial_funded_flag = 'Y' THEN
900: IF (g_asn_debug = 'Y') THEN
901: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
902: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
903: asn_debug.put_line('l_quantity_received : ' || l_quantity_received);
904: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
905: END IF;
906:
907: IF l_partial_funded_flag = 'Y' THEN
908:
947: ** tolerance.
948: */
949: --
950: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
951: IF (g_asn_debug = 'Y') THEN
952: asn_debug.put_line('set p_tolerable_quantity for clm po');
953: END IF;
954:
955: p_tolerable_quantity := p_available_quantity;
948: */
949: --
950: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
951: IF (g_asn_debug = 'Y') THEN
952: asn_debug.put_line('set p_tolerable_quantity for clm po');
953: END IF;
954:
955: p_tolerable_quantity := p_available_quantity;
956:
954:
955: p_tolerable_quantity := p_available_quantity;
956:
957: ELSE
958: IF (g_asn_debug = 'Y') THEN
959: asn_debug.put_line('set p_tolerable_quantity for non-clm po');
960: END IF;
961: --
962: p_tolerable_quantity := (x_quantity_ordered * x_qty_rcv_tolerance) -
955: p_tolerable_quantity := p_available_quantity;
956:
957: ELSE
958: IF (g_asn_debug = 'Y') THEN
959: asn_debug.put_line('set p_tolerable_quantity for non-clm po');
960: END IF;
961: --
962: p_tolerable_quantity := (x_quantity_ordered * x_qty_rcv_tolerance) -
963: x_quantity_received - x_quantity_cancelled -
1067: AND transaction_type IN ('RECEIVE', 'MATCH','CORRECT')
1068: AND po_line_location_id = p_line_location_id;
1069:
1070: --
1071: IF (g_asn_debug = 'Y') THEN
1072: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
1073: END IF;
1074:
1075: l_is_clm_po := po_clm_intg_grp.is_clm_po( p_po_header_id => NULL,
1068: AND po_line_location_id = p_line_location_id;
1069:
1070: --
1071: IF (g_asn_debug = 'Y') THEN
1072: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
1073: END IF;
1074:
1075: l_is_clm_po := po_clm_intg_grp.is_clm_po( p_po_header_id => NULL,
1076: p_po_line_id => NULL,
1078: p_po_distribution_id => NULL);
1079:
1080: l_partial_funded_flag := 'N';
1081:
1082: IF (g_asn_debug = 'Y') THEN
1083: asn_debug.put_line('line_location_id : ' || p_line_location_id);
1084: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
1085: END IF;
1086:
1079:
1080: l_partial_funded_flag := 'N';
1081:
1082: IF (g_asn_debug = 'Y') THEN
1083: asn_debug.put_line('line_location_id : ' || p_line_location_id);
1084: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
1085: END IF;
1086:
1087: IF l_is_clm_po = 'Y' THEN
1080: l_partial_funded_flag := 'N';
1081:
1082: IF (g_asn_debug = 'Y') THEN
1083: asn_debug.put_line('line_location_id : ' || p_line_location_id);
1084: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
1085: END IF;
1086:
1087: IF l_is_clm_po = 'Y' THEN
1088: IF (g_asn_debug = 'Y') THEN
1084: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
1085: END IF;
1086:
1087: IF l_is_clm_po = 'Y' THEN
1088: IF (g_asn_debug = 'Y') THEN
1089: asn_debug.put_line('before calling po_clm_intg_grp.get_funding_info()');
1090: END IF;
1091:
1092: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
1085: END IF;
1086:
1087: IF l_is_clm_po = 'Y' THEN
1088: IF (g_asn_debug = 'Y') THEN
1089: asn_debug.put_line('before calling po_clm_intg_grp.get_funding_info()');
1090: END IF;
1091:
1092: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
1093: p_po_line_id => NULL,
1114: x_return_status => l_return_status
1115:
1116: );
1117:
1118: IF (g_asn_debug = 'Y') THEN
1119: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
1120: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
1121: asn_debug.put_line('l_amount_received : ' || l_amount_received);
1122: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
1115:
1116: );
1117:
1118: IF (g_asn_debug = 'Y') THEN
1119: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
1120: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
1121: asn_debug.put_line('l_amount_received : ' || l_amount_received);
1122: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
1123: END IF;
1116: );
1117:
1118: IF (g_asn_debug = 'Y') THEN
1119: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
1120: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
1121: asn_debug.put_line('l_amount_received : ' || l_amount_received);
1122: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
1123: END IF;
1124:
1117:
1118: IF (g_asn_debug = 'Y') THEN
1119: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
1120: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
1121: asn_debug.put_line('l_amount_received : ' || l_amount_received);
1122: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
1123: END IF;
1124:
1125: IF l_partial_funded_flag = 'Y' THEN
1118: IF (g_asn_debug = 'Y') THEN
1119: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
1120: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
1121: asn_debug.put_line('l_amount_received : ' || l_amount_received);
1122: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
1123: END IF;
1124:
1125: IF l_partial_funded_flag = 'Y' THEN
1126:
1154: */
1155:
1156: --
1157: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
1158: IF (g_asn_debug = 'Y') THEN
1159: asn_debug.put_line('set p_tolerable_amount for clm po');
1160: END IF;
1161:
1162: p_tolerable_amount := p_available_amount;
1155:
1156: --
1157: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
1158: IF (g_asn_debug = 'Y') THEN
1159: asn_debug.put_line('set p_tolerable_amount for clm po');
1160: END IF;
1161:
1162: p_tolerable_amount := p_available_amount;
1163:
1161:
1162: p_tolerable_amount := p_available_amount;
1163:
1164: ELSE
1165: IF (g_asn_debug = 'Y') THEN
1166: asn_debug.put_line('set p_tolerable_amount for non-clm po');
1167: END IF;
1168: --
1169:
1162: p_tolerable_amount := p_available_amount;
1163:
1164: ELSE
1165: IF (g_asn_debug = 'Y') THEN
1166: asn_debug.put_line('set p_tolerable_amount for non-clm po');
1167: END IF;
1168: --
1169:
1170: p_tolerable_amount := (x_amount_ordered * x_qty_rcv_tolerance) -
1231: AND processing_status_code <> 'ERROR')
1232: AND transaction_type IN('RECEIVE', 'MATCH', 'CORRECT', 'SHIP')
1233: AND oe_order_line_id = p_oe_order_line_id;
1234: BEGIN
1235: asn_debug.put_line('***BEGIN*** get_po_quantity');
1236: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1237: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1238: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1239: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1232: AND transaction_type IN('RECEIVE', 'MATCH', 'CORRECT', 'SHIP')
1233: AND oe_order_line_id = p_oe_order_line_id;
1234: BEGIN
1235: asn_debug.put_line('***BEGIN*** get_po_quantity');
1236: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1237: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1238: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1239: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1240: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1233: AND oe_order_line_id = p_oe_order_line_id;
1234: BEGIN
1235: asn_debug.put_line('***BEGIN*** get_po_quantity');
1236: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1237: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1238: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1239: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1240: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1241: x_progress := '010';
1234: BEGIN
1235: asn_debug.put_line('***BEGIN*** get_po_quantity');
1236: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1237: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1238: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1239: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1240: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1241: x_progress := '010';
1242:
1235: asn_debug.put_line('***BEGIN*** get_po_quantity');
1236: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1237: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1238: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1239: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1240: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1241: x_progress := '010';
1242:
1243: SELECT NVL(oel.ordered_quantity2, 0),
1236: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1237: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1238: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1239: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1240: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1241: x_progress := '010';
1242:
1243: SELECT NVL(oel.ordered_quantity2, 0),
1244: NVL(oel.shipped_quantity2, 0),
1313: /*
1314: ** Return the PO unit of measure
1315: */
1316: p_unit_of_measure := x_oe_uom;
1317: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1318: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1319: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1320: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1321: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1314: ** Return the PO unit of measure
1315: */
1316: p_unit_of_measure := x_oe_uom;
1317: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1318: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1319: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1320: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1321: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1322: asn_debug.put_line('***END*** get_po_quantity');
1315: */
1316: p_unit_of_measure := x_oe_uom;
1317: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1318: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1319: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1320: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1321: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1322: asn_debug.put_line('***END*** get_po_quantity');
1323: EXCEPTION
1316: p_unit_of_measure := x_oe_uom;
1317: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1318: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1319: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1320: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1321: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1322: asn_debug.put_line('***END*** get_po_quantity');
1323: EXCEPTION
1324: WHEN OTHERS THEN
1317: asn_debug.put_line('p_oe_order_line_id = ' || p_oe_order_line_id);
1318: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1319: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1320: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1321: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1322: asn_debug.put_line('***END*** get_po_quantity');
1323: EXCEPTION
1324: WHEN OTHERS THEN
1325: po_message_s.sql_error('get_rma_quantity',
1318: asn_debug.put_line('p_available_quantity = ' || p_available_quantity);
1319: asn_debug.put_line('p_tolerable_quantity = ' || p_tolerable_quantity);
1320: asn_debug.put_line('p_unit_of_measure = ' || p_unit_of_measure);
1321: asn_debug.put_line('p_secondary_available_qty = ' || p_secondary_available_qty);
1322: asn_debug.put_line('***END*** get_po_quantity');
1323: EXCEPTION
1324: WHEN OTHERS THEN
1325: po_message_s.sql_error('get_rma_quantity',
1326: x_progress,
1534: ** needs to be trapped here
1535: */
1536:
1537: -- bug 4873207
1538: IF (g_asn_debug = 'Y') THEN
1539: asn_debug.put_line('get_transaction_quantity >> ' || x_progress );
1540: asn_debug.put_line('p_transaction_id ' || p_transaction_id);
1541: END IF;
1542: -- bug 4873207
1535: */
1536:
1537: -- bug 4873207
1538: IF (g_asn_debug = 'Y') THEN
1539: asn_debug.put_line('get_transaction_quantity >> ' || x_progress );
1540: asn_debug.put_line('p_transaction_id ' || p_transaction_id);
1541: END IF;
1542: -- bug 4873207
1543:
1536:
1537: -- bug 4873207
1538: IF (g_asn_debug = 'Y') THEN
1539: asn_debug.put_line('get_transaction_quantity >> ' || x_progress );
1540: asn_debug.put_line('p_transaction_id ' || p_transaction_id);
1541: END IF;
1542: -- bug 4873207
1543:
1544: BEGIN
1607:
1608: END;
1609:
1610: -- bug 4873207
1611: IF (g_asn_debug = 'Y') THEN
1612: asn_debug.put_line('get_transaction_quantity >> ');
1613: asn_debug.put_line('x_transaction_quantity '||x_transaction_quantity);
1614: asn_debug.put_line('x_transaction_uom '||x_transaction_uom);
1615: asn_debug.put_line('item_id '||x_item_id);
1608: END;
1609:
1610: -- bug 4873207
1611: IF (g_asn_debug = 'Y') THEN
1612: asn_debug.put_line('get_transaction_quantity >> ');
1613: asn_debug.put_line('x_transaction_quantity '||x_transaction_quantity);
1614: asn_debug.put_line('x_transaction_uom '||x_transaction_uom);
1615: asn_debug.put_line('item_id '||x_item_id);
1616: asn_debug.put_line('x_secondary_transaction_qty '||x_secondary_transaction_qty);
1609:
1610: -- bug 4873207
1611: IF (g_asn_debug = 'Y') THEN
1612: asn_debug.put_line('get_transaction_quantity >> ');
1613: asn_debug.put_line('x_transaction_quantity '||x_transaction_quantity);
1614: asn_debug.put_line('x_transaction_uom '||x_transaction_uom);
1615: asn_debug.put_line('item_id '||x_item_id);
1616: asn_debug.put_line('x_secondary_transaction_qty '||x_secondary_transaction_qty);
1617: END IF;
1610: -- bug 4873207
1611: IF (g_asn_debug = 'Y') THEN
1612: asn_debug.put_line('get_transaction_quantity >> ');
1613: asn_debug.put_line('x_transaction_quantity '||x_transaction_quantity);
1614: asn_debug.put_line('x_transaction_uom '||x_transaction_uom);
1615: asn_debug.put_line('item_id '||x_item_id);
1616: asn_debug.put_line('x_secondary_transaction_qty '||x_secondary_transaction_qty);
1617: END IF;
1618: -- bug 4873207
1611: IF (g_asn_debug = 'Y') THEN
1612: asn_debug.put_line('get_transaction_quantity >> ');
1613: asn_debug.put_line('x_transaction_quantity '||x_transaction_quantity);
1614: asn_debug.put_line('x_transaction_uom '||x_transaction_uom);
1615: asn_debug.put_line('item_id '||x_item_id);
1616: asn_debug.put_line('x_secondary_transaction_qty '||x_secondary_transaction_qty);
1617: END IF;
1618: -- bug 4873207
1619:
1612: asn_debug.put_line('get_transaction_quantity >> ');
1613: asn_debug.put_line('x_transaction_quantity '||x_transaction_quantity);
1614: asn_debug.put_line('x_transaction_uom '||x_transaction_uom);
1615: asn_debug.put_line('item_id '||x_item_id);
1616: asn_debug.put_line('x_secondary_transaction_qty '||x_secondary_transaction_qty);
1617: END IF;
1618: -- bug 4873207
1619:
1620:
1663: /*
1664: ** There is unprocessed quantity. Convert it to the transaction uom
1665: ** so that the available quantity can be calculated in the trx uom
1666: */
1667: IF (g_asn_debug = 'Y') THEN
1668: asn_debug.put_line('Before uom_convert:');
1669: asn_debug.put_line('x_interface_quantity:' || x_interface_quantity);
1670: asn_debug.put_line('x_primary_uom:' || x_primary_uom);
1671: asn_debug.put_line('x_transaction_uom:' || x_transaction_uom);
1664: ** There is unprocessed quantity. Convert it to the transaction uom
1665: ** so that the available quantity can be calculated in the trx uom
1666: */
1667: IF (g_asn_debug = 'Y') THEN
1668: asn_debug.put_line('Before uom_convert:');
1669: asn_debug.put_line('x_interface_quantity:' || x_interface_quantity);
1670: asn_debug.put_line('x_primary_uom:' || x_primary_uom);
1671: asn_debug.put_line('x_transaction_uom:' || x_transaction_uom);
1672: asn_debug.put_line('x_item_id:' || x_item_id);
1665: ** so that the available quantity can be calculated in the trx uom
1666: */
1667: IF (g_asn_debug = 'Y') THEN
1668: asn_debug.put_line('Before uom_convert:');
1669: asn_debug.put_line('x_interface_quantity:' || x_interface_quantity);
1670: asn_debug.put_line('x_primary_uom:' || x_primary_uom);
1671: asn_debug.put_line('x_transaction_uom:' || x_transaction_uom);
1672: asn_debug.put_line('x_item_id:' || x_item_id);
1673: END IF;
1666: */
1667: IF (g_asn_debug = 'Y') THEN
1668: asn_debug.put_line('Before uom_convert:');
1669: asn_debug.put_line('x_interface_quantity:' || x_interface_quantity);
1670: asn_debug.put_line('x_primary_uom:' || x_primary_uom);
1671: asn_debug.put_line('x_transaction_uom:' || x_transaction_uom);
1672: asn_debug.put_line('x_item_id:' || x_item_id);
1673: END IF;
1674:
1667: IF (g_asn_debug = 'Y') THEN
1668: asn_debug.put_line('Before uom_convert:');
1669: asn_debug.put_line('x_interface_quantity:' || x_interface_quantity);
1670: asn_debug.put_line('x_primary_uom:' || x_primary_uom);
1671: asn_debug.put_line('x_transaction_uom:' || x_transaction_uom);
1672: asn_debug.put_line('x_item_id:' || x_item_id);
1673: END IF;
1674:
1675: x_progress := '015';
1668: asn_debug.put_line('Before uom_convert:');
1669: asn_debug.put_line('x_interface_quantity:' || x_interface_quantity);
1670: asn_debug.put_line('x_primary_uom:' || x_primary_uom);
1671: asn_debug.put_line('x_transaction_uom:' || x_transaction_uom);
1672: asn_debug.put_line('x_item_id:' || x_item_id);
1673: END IF;
1674:
1675: x_progress := '015';
1676: po_uom_s.uom_convert(x_interface_quantity, x_primary_uom, x_item_id,
1755: /*
1756: ** Get available amount information from processed transactions.
1757: */
1758:
1759: IF (g_asn_debug = 'Y') THEN
1760: asn_debug.put_line('get_transaction_amount ' );
1761: asn_debug.put_line('p_transaction_id '||p_transaction_id );
1762: end if;
1763: BEGIN
1756: ** Get available amount information from processed transactions.
1757: */
1758:
1759: IF (g_asn_debug = 'Y') THEN
1760: asn_debug.put_line('get_transaction_amount ' );
1761: asn_debug.put_line('p_transaction_id '||p_transaction_id );
1762: end if;
1763: BEGIN
1764:
1757: */
1758:
1759: IF (g_asn_debug = 'Y') THEN
1760: asn_debug.put_line('get_transaction_amount ' );
1761: asn_debug.put_line('p_transaction_id '||p_transaction_id );
1762: end if;
1763: BEGIN
1764:
1765: SELECT nvl(sum(amount),0)
1767: from rcv_transactions
1768: where parent_transaction_id = p_transaction_id
1769: and transaction_type = 'CORRECT';
1770:
1771: IF (g_asn_debug = 'Y') THEN
1772: asn_debug.put_line('l_receive_correct '||l_receive_correct);
1773: end if;
1774: select transaction_id
1775: into l_deliver_id
1768: where parent_transaction_id = p_transaction_id
1769: and transaction_type = 'CORRECT';
1770:
1771: IF (g_asn_debug = 'Y') THEN
1772: asn_debug.put_line('l_receive_correct '||l_receive_correct);
1773: end if;
1774: select transaction_id
1775: into l_deliver_id
1776: from rcv_transactions
1776: from rcv_transactions
1777: where parent_transaction_id= p_transaction_id
1778: and transaction_type='DELIVER';
1779:
1780: IF (g_asn_debug = 'Y') THEN
1781: asn_debug.put_line('l_deliver_id '||l_deliver_id);
1782: end if;
1783: SELECT nvl(sum(amount),0)
1784: into l_deliver_correct
1777: where parent_transaction_id= p_transaction_id
1778: and transaction_type='DELIVER';
1779:
1780: IF (g_asn_debug = 'Y') THEN
1781: asn_debug.put_line('l_deliver_id '||l_deliver_id);
1782: end if;
1783: SELECT nvl(sum(amount),0)
1784: into l_deliver_correct
1785: from rcv_transactions
1785: from rcv_transactions
1786: where parent_transaction_id = l_deliver_id
1787: and transaction_type = 'CORRECT';
1788:
1789: IF (g_asn_debug = 'Y') THEN
1790: asn_debug.put_line('l_deliver_correct '||l_deliver_correct);
1791: end if;
1792:
1793: EXCEPTION
1786: where parent_transaction_id = l_deliver_id
1787: and transaction_type = 'CORRECT';
1788:
1789: IF (g_asn_debug = 'Y') THEN
1790: asn_debug.put_line('l_deliver_correct '||l_deliver_correct);
1791: end if;
1792:
1793: EXCEPTION
1794: WHEN NO_DATA_FOUND THEN
1817: WHERE (transaction_status_code = 'PENDING'
1818: and processing_status_code <> 'ERROR')
1819: AND parent_transaction_id = p_transaction_id;
1820:
1821: IF (g_asn_debug = 'Y') THEN
1822: asn_debug.put_line('x_interface_amount '||x_interface_amount);
1823: end if;
1824:
1825: -- do the same for the children of the receive transaction
1818: and processing_status_code <> 'ERROR')
1819: AND parent_transaction_id = p_transaction_id;
1820:
1821: IF (g_asn_debug = 'Y') THEN
1822: asn_debug.put_line('x_interface_amount '||x_interface_amount);
1823: end if;
1824:
1825: -- do the same for the children of the receive transaction
1826: SELECT nvl(sum(decode(transaction_type,
1832: WHERE (transaction_status_code = 'PENDING'
1833: and processing_status_code <> 'ERROR')
1834: AND parent_transaction_id = l_deliver_id;
1835:
1836: IF (g_asn_debug = 'Y') THEN
1837: asn_debug.put_line('x_interface_deliver_amount '||x_interface_deliver_amount);
1838: END IF;
1839:
1840: /*
1833: and processing_status_code <> 'ERROR')
1834: AND parent_transaction_id = l_deliver_id;
1835:
1836: IF (g_asn_debug = 'Y') THEN
1837: asn_debug.put_line('x_interface_deliver_amount '||x_interface_deliver_amount);
1838: END IF;
1839:
1840: /*
1841: ** Calculate the quantity available to be transacted
1842: */
1843:
1844: p_available_amount := l_receive_correct - l_deliver_correct - (x_interface_amount - x_interface_deliver_amount);
1845:
1846: IF (g_asn_debug = 'Y') THEN
1847: asn_debug.put_line('p_available_amount '||p_available_amount);
1848: end if;
1849:
1850: EXCEPTION
1843:
1844: p_available_amount := l_receive_correct - l_deliver_correct - (x_interface_amount - x_interface_deliver_amount);
1845:
1846: IF (g_asn_debug = 'Y') THEN
1847: asn_debug.put_line('p_available_amount '||p_available_amount);
1848: end if;
1849:
1850: EXCEPTION
1851:
1850: EXCEPTION
1851:
1852: WHEN OTHERS THEN
1853:
1854: IF (g_asn_debug = 'Y') THEN
1855: asn_debug.put_line('Exception in get_transaction_amount');
1856: end if;
1857: po_message_s.sql_error('get_transaction_amount', x_progress, sqlcode);
1858:
1851:
1852: WHEN OTHERS THEN
1853:
1854: IF (g_asn_debug = 'Y') THEN
1855: asn_debug.put_line('Exception in get_transaction_amount');
1856: end if;
1857: po_message_s.sql_error('get_transaction_amount', x_progress, sqlcode);
1858:
1859: RAISE;
1912: --
1913:
1914: BEGIN
1915:
1916: IF (g_asn_debug = 'Y') THEN
1917: asn_debug.put_line(' in get_correction_quantity');
1918: end if;
1919: IF p_correction_type = 'NEGATIVE' THEN
1920:
1913:
1914: BEGIN
1915:
1916: IF (g_asn_debug = 'Y') THEN
1917: asn_debug.put_line(' in get_correction_quantity');
1918: end if;
1919: IF p_correction_type = 'NEGATIVE' THEN
1920:
1921: /*
1931: ** Use get_transaction_quantity logic to get the available quantity
1932: ** and uom.
1933: */
1934:
1935: IF (g_asn_debug = 'Y') THEN
1936: asn_debug.put_line(' Before get_transaction_quantity');
1937: end if;
1938: get_transaction_quantity(p_parent_id, p_available_quantity,
1939: p_unit_of_measure,p_secondary_available_qty);
1932: ** and uom.
1933: */
1934:
1935: IF (g_asn_debug = 'Y') THEN
1936: asn_debug.put_line(' Before get_transaction_quantity');
1937: end if;
1938: get_transaction_quantity(p_parent_id, p_available_quantity,
1939: p_unit_of_measure,p_secondary_available_qty);
1940:
1951: ** to Return To Receiving transactions. However, it is a good
1952: ** candidate for an ER. If we do, we need to add to this function
1953: ** to handle this case.
1954: */
1955: IF (g_asn_debug = 'Y') THEN
1956: asn_debug.put_line(' Before get_deliver_quantity');
1957: end if;
1958:
1959: get_deliver_quantity(p_parent_id, p_available_quantity,
1952: ** candidate for an ER. If we do, we need to add to this function
1953: ** to handle this case.
1954: */
1955: IF (g_asn_debug = 'Y') THEN
1956: asn_debug.put_line(' Before get_deliver_quantity');
1957: end if;
1958:
1959: get_deliver_quantity(p_parent_id, p_available_quantity,
1960: p_unit_of_measure,p_secondary_available_qty);
2103: FROM rcv_transactions rt
2104: WHERE rt.transaction_id = p_parent_id ;
2105:
2106:
2107: IF (g_asn_debug = 'Y') THEN
2108: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
2109: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
2110: END IF;
2111:
2104: WHERE rt.transaction_id = p_parent_id ;
2105:
2106:
2107: IF (g_asn_debug = 'Y') THEN
2108: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
2109: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
2110: END IF;
2111:
2112: IF l_po_line_location_id IS NOT NULL THEN
2105:
2106:
2107: IF (g_asn_debug = 'Y') THEN
2108: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
2109: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
2110: END IF;
2111:
2112: IF l_po_line_location_id IS NOT NULL THEN
2113: l_is_clm_po := po_clm_intg_grp.is_clm_po( p_po_header_id => NULL,
2115: p_po_line_location_id => l_po_line_location_id,
2116: p_po_distribution_id => NULL);
2117: END IF;
2118:
2119: IF (g_asn_debug = 'Y') THEN
2120: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
2121: END IF;
2122:
2123: IF l_is_clm_po = 'Y' THEN
2116: p_po_distribution_id => NULL);
2117: END IF;
2118:
2119: IF (g_asn_debug = 'Y') THEN
2120: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
2121: END IF;
2122:
2123: IF l_is_clm_po = 'Y' THEN
2124:
2121: END IF;
2122:
2123: IF l_is_clm_po = 'Y' THEN
2124:
2125: IF (g_asn_debug = 'Y') THEN
2126: asn_debug.put_line(' before po_clm_intg_grp.get_funding_info()');
2127: end if;
2128:
2129: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
2122:
2123: IF l_is_clm_po = 'Y' THEN
2124:
2125: IF (g_asn_debug = 'Y') THEN
2126: asn_debug.put_line(' before po_clm_intg_grp.get_funding_info()');
2127: end if;
2128:
2129: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
2130: p_po_line_id => NULL,
2150: x_amount_cancelled => l_amount_cancelled,
2151: x_return_status => l_return_status
2152: );
2153:
2154: IF (g_asn_debug = 'Y') THEN
2155: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
2156: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
2157: asn_debug.put_line('l_quantity_received : ' || l_quantity_received);
2158: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
2151: x_return_status => l_return_status
2152: );
2153:
2154: IF (g_asn_debug = 'Y') THEN
2155: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
2156: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
2157: asn_debug.put_line('l_quantity_received : ' || l_quantity_received);
2158: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
2159: END IF;
2152: );
2153:
2154: IF (g_asn_debug = 'Y') THEN
2155: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
2156: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
2157: asn_debug.put_line('l_quantity_received : ' || l_quantity_received);
2158: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
2159: END IF;
2160:
2153:
2154: IF (g_asn_debug = 'Y') THEN
2155: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
2156: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
2157: asn_debug.put_line('l_quantity_received : ' || l_quantity_received);
2158: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
2159: END IF;
2160:
2161: END IF;
2154: IF (g_asn_debug = 'Y') THEN
2155: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
2156: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
2157: asn_debug.put_line('l_quantity_received : ' || l_quantity_received);
2158: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
2159: END IF;
2160:
2161: END IF;
2162:
2160:
2161: END IF;
2162:
2163: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
2164: IF (g_asn_debug = 'Y') THEN
2165: asn_debug.put_line('set p_tolerable_quantity for clm po');
2166: END IF;
2167:
2168: p_tolerable_quantity := p_available_quantity;
2161: END IF;
2162:
2163: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
2164: IF (g_asn_debug = 'Y') THEN
2165: asn_debug.put_line('set p_tolerable_quantity for clm po');
2166: END IF;
2167:
2168: p_tolerable_quantity := p_available_quantity;
2169:
2167:
2168: p_tolerable_quantity := p_available_quantity;
2169:
2170: ELSE
2171: IF (g_asn_debug = 'Y') THEN
2172: asn_debug.put_line('set p_tolerable_quantity for non-clm po');
2173: END IF;
2174: --
2175:
2168: p_tolerable_quantity := p_available_quantity;
2169:
2170: ELSE
2171: IF (g_asn_debug = 'Y') THEN
2172: asn_debug.put_line('set p_tolerable_quantity for non-clm po');
2173: END IF;
2174: --
2175:
2176:
2258: --
2259:
2260: BEGIN
2261:
2262: IF (g_asn_debug = 'Y') THEN
2263: asn_debug.put_line('p_correction_type '||p_correction_type );
2264: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type );
2265: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code );
2266: asn_debug.put_line('p_parent_id '||p_parent_id );
2259:
2260: BEGIN
2261:
2262: IF (g_asn_debug = 'Y') THEN
2263: asn_debug.put_line('p_correction_type '||p_correction_type );
2264: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type );
2265: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code );
2266: asn_debug.put_line('p_parent_id '||p_parent_id );
2267: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id );
2260: BEGIN
2261:
2262: IF (g_asn_debug = 'Y') THEN
2263: asn_debug.put_line('p_correction_type '||p_correction_type );
2264: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type );
2265: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code );
2266: asn_debug.put_line('p_parent_id '||p_parent_id );
2267: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id );
2268: end if;
2261:
2262: IF (g_asn_debug = 'Y') THEN
2263: asn_debug.put_line('p_correction_type '||p_correction_type );
2264: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type );
2265: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code );
2266: asn_debug.put_line('p_parent_id '||p_parent_id );
2267: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id );
2268: end if;
2269: IF p_correction_type = 'NEGATIVE' THEN
2262: IF (g_asn_debug = 'Y') THEN
2263: asn_debug.put_line('p_correction_type '||p_correction_type );
2264: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type );
2265: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code );
2266: asn_debug.put_line('p_parent_id '||p_parent_id );
2267: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id );
2268: end if;
2269: IF p_correction_type = 'NEGATIVE' THEN
2270:
2263: asn_debug.put_line('p_correction_type '||p_correction_type );
2264: asn_debug.put_line('p_parent_transaction_type '||p_parent_transaction_type );
2265: asn_debug.put_line('p_receipt_source_code '||p_receipt_source_code );
2266: asn_debug.put_line('p_parent_id '||p_parent_id );
2267: asn_debug.put_line('p_grand_parent_id '||p_grand_parent_id );
2268: end if;
2269: IF p_correction_type = 'NEGATIVE' THEN
2270:
2271: /*
2280: ** Use get_transaction_quantity logic to get the available quantity
2281: ** and uom.
2282: */
2283:
2284: IF (g_asn_debug = 'Y') THEN
2285: asn_debug.put_line(' before get_transaction_amount');
2286: end if;
2287: get_transaction_amount(p_parent_id, p_available_amount);
2288:
2281: ** and uom.
2282: */
2283:
2284: IF (g_asn_debug = 'Y') THEN
2285: asn_debug.put_line(' before get_transaction_amount');
2286: end if;
2287: get_transaction_amount(p_parent_id, p_available_amount);
2288:
2289:
2299: ** candidate for an ER. If we do, we need to add to this function
2300: ** to handle this case.
2301: */
2302:
2303: IF (g_asn_debug = 'Y') THEN
2304: asn_debug.put_line(' before get_deliver_amount');
2305: end if;
2306: get_deliver_amount(p_parent_id, p_available_amount);
2307:
2300: ** to handle this case.
2301: */
2302:
2303: IF (g_asn_debug = 'Y') THEN
2304: asn_debug.put_line(' before get_deliver_amount');
2305: end if;
2306: get_deliver_amount(p_parent_id, p_available_amount);
2307:
2308: ELSE
2340: ** p_grand_parent_id is either the po_line_location_id or the
2341: ** rcv_shipment_line_id as the case may be.
2342: */
2343:
2344: IF (g_asn_debug = 'Y') THEN
2345: asn_debug.put_line(' before get_receive_amount');
2346: end if;
2347: get_receive_amount(p_grand_parent_id, p_receipt_source_code,
2348: p_available_amount, p_tolerable_amount);
2341: ** rcv_shipment_line_id as the case may be.
2342: */
2343:
2344: IF (g_asn_debug = 'Y') THEN
2345: asn_debug.put_line(' before get_receive_amount');
2346: end if;
2347: get_receive_amount(p_grand_parent_id, p_receipt_source_code,
2348: p_available_amount, p_tolerable_amount);
2349:
2356: ** p_grand_parent_id is the grand parent transaction for which
2357: ** we need to get the outstanding quantity.
2358: */
2359:
2360: IF (g_asn_debug = 'Y') THEN
2361: asn_debug.put_line(' before get_transaction_amount');
2362: end if;
2363: get_transaction_amount(p_grand_parent_id, p_available_amount);
2364:
2357: ** we need to get the outstanding quantity.
2358: */
2359:
2360: IF (g_asn_debug = 'Y') THEN
2361: asn_debug.put_line(' before get_transaction_amount');
2362: end if;
2363: get_transaction_amount(p_grand_parent_id, p_available_amount);
2364:
2365: ELSE
2382: FROM rcv_transactions rt
2383: WHERE rt.transaction_id = p_parent_id ;
2384:
2385:
2386: IF (g_asn_debug = 'Y') THEN
2387: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
2388: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
2389: END IF;
2390:
2383: WHERE rt.transaction_id = p_parent_id ;
2384:
2385:
2386: IF (g_asn_debug = 'Y') THEN
2387: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
2388: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
2389: END IF;
2390:
2391: IF l_po_line_location_id IS NOT NULL THEN
2384:
2385:
2386: IF (g_asn_debug = 'Y') THEN
2387: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
2388: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
2389: END IF;
2390:
2391: IF l_po_line_location_id IS NOT NULL THEN
2392: l_is_clm_po := po_clm_intg_grp.is_clm_po( p_po_header_id => NULL,
2394: p_po_line_location_id => l_po_line_location_id,
2395: p_po_distribution_id => NULL);
2396: END IF;
2397:
2398: IF (g_asn_debug = 'Y') THEN
2399: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
2400: END IF;
2401:
2402: IF l_is_clm_po = 'Y' THEN
2395: p_po_distribution_id => NULL);
2396: END IF;
2397:
2398: IF (g_asn_debug = 'Y') THEN
2399: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
2400: END IF;
2401:
2402: IF l_is_clm_po = 'Y' THEN
2403:
2400: END IF;
2401:
2402: IF l_is_clm_po = 'Y' THEN
2403:
2404: IF (g_asn_debug = 'Y') THEN
2405: asn_debug.put_line(' before po_clm_intg_grp.get_funding_info()');
2406: end if;
2407:
2408: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
2401:
2402: IF l_is_clm_po = 'Y' THEN
2403:
2404: IF (g_asn_debug = 'Y') THEN
2405: asn_debug.put_line(' before po_clm_intg_grp.get_funding_info()');
2406: end if;
2407:
2408: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
2409: p_po_line_id => NULL,
2429: x_amount_cancelled => l_amount_cancelled,
2430: x_return_status => l_return_status
2431: );
2432:
2433: IF (g_asn_debug = 'Y') THEN
2434: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
2435: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
2436: asn_debug.put_line('l_amount_received : ' || l_amount_received);
2437: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
2430: x_return_status => l_return_status
2431: );
2432:
2433: IF (g_asn_debug = 'Y') THEN
2434: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
2435: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
2436: asn_debug.put_line('l_amount_received : ' || l_amount_received);
2437: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
2438: END IF;
2431: );
2432:
2433: IF (g_asn_debug = 'Y') THEN
2434: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
2435: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
2436: asn_debug.put_line('l_amount_received : ' || l_amount_received);
2437: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
2438: END IF;
2439:
2432:
2433: IF (g_asn_debug = 'Y') THEN
2434: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
2435: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
2436: asn_debug.put_line('l_amount_received : ' || l_amount_received);
2437: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
2438: END IF;
2439:
2440: END IF;
2433: IF (g_asn_debug = 'Y') THEN
2434: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
2435: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
2436: asn_debug.put_line('l_amount_received : ' || l_amount_received);
2437: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
2438: END IF;
2439:
2440: END IF;
2441:
2439:
2440: END IF;
2441:
2442: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
2443: IF (g_asn_debug = 'Y') THEN
2444: asn_debug.put_line('set p_tolerable_amount for CLM PO');
2445: END IF;
2446:
2447: p_tolerable_amount := p_available_amount;
2440: END IF;
2441:
2442: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
2443: IF (g_asn_debug = 'Y') THEN
2444: asn_debug.put_line('set p_tolerable_amount for CLM PO');
2445: END IF;
2446:
2447: p_tolerable_amount := p_available_amount;
2448:
2626: WHERE (transaction_status_code = 'PENDING'
2627: and processing_status_code <> 'ERROR')
2628: AND parent_transaction_id = p_transaction_id;
2629:
2630: IF (g_asn_debug = 'Y') THEN
2631: asn_debug.put_line('p_transaction_id = ' || p_transaction_id);
2632: asn_debug.put_line('x_interface_quantity = ' || x_interface_quantity);
2633: END IF;
2634:
2627: and processing_status_code <> 'ERROR')
2628: AND parent_transaction_id = p_transaction_id;
2629:
2630: IF (g_asn_debug = 'Y') THEN
2631: asn_debug.put_line('p_transaction_id = ' || p_transaction_id);
2632: asn_debug.put_line('x_interface_quantity = ' || x_interface_quantity);
2633: END IF;
2634:
2635: -- rtv project : start
2628: AND parent_transaction_id = p_transaction_id;
2629:
2630: IF (g_asn_debug = 'Y') THEN
2631: asn_debug.put_line('p_transaction_id = ' || p_transaction_id);
2632: asn_debug.put_line('x_interface_quantity = ' || x_interface_quantity);
2633: END IF;
2634:
2635: -- rtv project : start
2636: SELECT nvl( sum(primary_quantity),0)
2644: and wdd.source_code = 'RTV');
2645:
2646: x_interface_quantity := x_interface_quantity - x_rtv_running_qty;
2647:
2648: IF (g_asn_debug = 'Y') THEN
2649: asn_debug.put_line('x_rtv_running_qty = ' || x_rtv_running_qty);
2650: asn_debug.put_line('x_interface_quantity = ' || x_interface_quantity);
2651: END IF;
2652:
2645:
2646: x_interface_quantity := x_interface_quantity - x_rtv_running_qty;
2647:
2648: IF (g_asn_debug = 'Y') THEN
2649: asn_debug.put_line('x_rtv_running_qty = ' || x_rtv_running_qty);
2650: asn_debug.put_line('x_interface_quantity = ' || x_interface_quantity);
2651: END IF;
2652:
2653: -- rtv project : end
2646: x_interface_quantity := x_interface_quantity - x_rtv_running_qty;
2647:
2648: IF (g_asn_debug = 'Y') THEN
2649: asn_debug.put_line('x_rtv_running_qty = ' || x_rtv_running_qty);
2650: asn_debug.put_line('x_interface_quantity = ' || x_interface_quantity);
2651: END IF;
2652:
2653: -- rtv project : end
2654:
2683: WHERE (transaction_status_code = 'PENDING'
2684: and processing_status_code <> 'ERROR')
2685: AND parent_transaction_id = p_transaction_id;
2686:
2687: IF (g_asn_debug = 'Y') THEN
2688: asn_debug.put_line('x_secondary_interface_qty = ' || x_secondary_interface_qty);
2689: END IF;
2690:
2691: -- rtv project : start
2684: and processing_status_code <> 'ERROR')
2685: AND parent_transaction_id = p_transaction_id;
2686:
2687: IF (g_asn_debug = 'Y') THEN
2688: asn_debug.put_line('x_secondary_interface_qty = ' || x_secondary_interface_qty);
2689: END IF;
2690:
2691: -- rtv project : start
2692: SELECT nvl(sum(secondary_quantity),0)
2700: and wdd.source_code = 'RTV');
2701:
2702: x_secondary_interface_qty := x_secondary_interface_qty - (2 * x_rtv_running_sec_qty);
2703:
2704: IF (g_asn_debug = 'Y') THEN
2705: asn_debug.put_line('x_rtv_running_sec_qty = ' || x_rtv_running_sec_qty);
2706: asn_debug.put_line('x_secondary_interface_qty = ' || x_secondary_interface_qty);
2707: END IF;
2708:
2701:
2702: x_secondary_interface_qty := x_secondary_interface_qty - (2 * x_rtv_running_sec_qty);
2703:
2704: IF (g_asn_debug = 'Y') THEN
2705: asn_debug.put_line('x_rtv_running_sec_qty = ' || x_rtv_running_sec_qty);
2706: asn_debug.put_line('x_secondary_interface_qty = ' || x_secondary_interface_qty);
2707: END IF;
2708:
2709: -- rtv project : end
2702: x_secondary_interface_qty := x_secondary_interface_qty - (2 * x_rtv_running_sec_qty);
2703:
2704: IF (g_asn_debug = 'Y') THEN
2705: asn_debug.put_line('x_rtv_running_sec_qty = ' || x_rtv_running_sec_qty);
2706: asn_debug.put_line('x_secondary_interface_qty = ' || x_secondary_interface_qty);
2707: END IF;
2708:
2709: -- rtv project : end
2710:
2946: IF ( l_consigned_deliver_uom_qty < p_available_quantity ) THEN
2947: p_available_quantity := l_consigned_deliver_uom_qty;
2948: END IF;
2949: ELSE
2950: IF (g_asn_debug = 'Y') THEN
2951: asn_debug.put_line('Error in get_deliver_quantity() during call to INV consigned API');
2952: asn_debug.put_line('Return status : '||l_return_status);
2953: asn_debug.put_line('Error Message : '||SUBSTRB(l_msg_data,1,50));
2954: END IF;
2947: p_available_quantity := l_consigned_deliver_uom_qty;
2948: END IF;
2949: ELSE
2950: IF (g_asn_debug = 'Y') THEN
2951: asn_debug.put_line('Error in get_deliver_quantity() during call to INV consigned API');
2952: asn_debug.put_line('Return status : '||l_return_status);
2953: asn_debug.put_line('Error Message : '||SUBSTRB(l_msg_data,1,50));
2954: END IF;
2955: APP_EXCEPTION.RAISE_EXCEPTION;
2948: END IF;
2949: ELSE
2950: IF (g_asn_debug = 'Y') THEN
2951: asn_debug.put_line('Error in get_deliver_quantity() during call to INV consigned API');
2952: asn_debug.put_line('Return status : '||l_return_status);
2953: asn_debug.put_line('Error Message : '||SUBSTRB(l_msg_data,1,50));
2954: END IF;
2955: APP_EXCEPTION.RAISE_EXCEPTION;
2956: --END IF;
2949: ELSE
2950: IF (g_asn_debug = 'Y') THEN
2951: asn_debug.put_line('Error in get_deliver_quantity() during call to INV consigned API');
2952: asn_debug.put_line('Return status : '||l_return_status);
2953: asn_debug.put_line('Error Message : '||SUBSTRB(l_msg_data,1,50));
2954: END IF;
2955: APP_EXCEPTION.RAISE_EXCEPTION;
2956: --END IF;
2957: END IF;
2985: BEGIN
2986:
2987: x_progress := '005';
2988:
2989: IF (g_asn_debug = 'Y') THEN
2990: asn_debug.put_line('in get_receive_amount ' );
2991: asn_debug.put_line('p_transaction_id '||p_transaction_id);
2992: END IF;
2993: /*
2986:
2987: x_progress := '005';
2988:
2989: IF (g_asn_debug = 'Y') THEN
2990: asn_debug.put_line('in get_receive_amount ' );
2991: asn_debug.put_line('p_transaction_id '||p_transaction_id);
2992: END IF;
2993: /*
2994: ** Get available transaction amount information.
2987: x_progress := '005';
2988:
2989: IF (g_asn_debug = 'Y') THEN
2990: asn_debug.put_line('in get_receive_amount ' );
2991: asn_debug.put_line('p_transaction_id '||p_transaction_id);
2992: END IF;
2993: /*
2994: ** Get available transaction amount information.
2995: */
2998: into x_deliver_amount
2999: from rcv_transactions rt
3000: where rt.transaction_id = p_transaction_id;
3001:
3002: IF (g_asn_debug = 'Y') THEN
3003: asn_debug.put_line('x_deliver_amount '||x_deliver_amount );
3004: end if;
3005: x_progress := '010';
3006:
2999: from rcv_transactions rt
3000: where rt.transaction_id = p_transaction_id;
3001:
3002: IF (g_asn_debug = 'Y') THEN
3003: asn_debug.put_line('x_deliver_amount '||x_deliver_amount );
3004: end if;
3005: x_progress := '010';
3006:
3007: /*
3018: WHERE (transaction_status_code = 'PENDING'
3019: and processing_status_code <> 'ERROR')
3020: AND parent_transaction_id = p_transaction_id;
3021:
3022: IF (g_asn_debug = 'Y') THEN
3023: asn_debug.put_line('x_interface_amount '||x_interface_amount );
3024: end if;
3025: /*
3026: ** Calculate the quantity available to be transacted
3019: and processing_status_code <> 'ERROR')
3020: AND parent_transaction_id = p_transaction_id;
3021:
3022: IF (g_asn_debug = 'Y') THEN
3023: asn_debug.put_line('x_interface_amount '||x_interface_amount );
3024: end if;
3025: /*
3026: ** Calculate the quantity available to be transacted
3027: */
3027: */
3028:
3029: p_available_amount := x_deliver_amount - x_interface_amount;
3030:
3031: IF (g_asn_debug = 'Y') THEN
3032: asn_debug.put_line('p_available_amount '||p_available_amount );
3033: end if;
3034: /*
3035: ** Get any rows already precessed against this transaction
3028:
3029: p_available_amount := x_deliver_amount - x_interface_amount;
3030:
3031: IF (g_asn_debug = 'Y') THEN
3032: asn_debug.put_line('p_available_amount '||p_available_amount );
3033: end if;
3034: /*
3035: ** Get any rows already precessed against this transaction
3036: ** parent transaction. x_interface_quantity is in primary uom.
3047: FROM rcv_transactions
3048: WHERE parent_transaction_id = p_transaction_id
3049: AND transaction_type = 'CORRECT';
3050:
3051: IF (g_asn_debug = 'Y') THEN
3052: asn_debug.put_line('x_transaction_amount '||x_transaction_amount );
3053: end if;
3054: x_progress := '015';
3055:
3048: WHERE parent_transaction_id = p_transaction_id
3049: AND transaction_type = 'CORRECT';
3050:
3051: IF (g_asn_debug = 'Y') THEN
3052: asn_debug.put_line('x_transaction_amount '||x_transaction_amount );
3053: end if;
3054: x_progress := '015';
3055:
3056: /*
3057: ** Calculate the quantity available to be transacted
3058: */
3059:
3060: p_available_amount := p_available_amount + x_transaction_amount;
3061: IF (g_asn_debug = 'Y') THEN
3062: asn_debug.put_line('p_available_amount 1 '||p_available_amount );
3063: end if;
3064:
3065: EXCEPTION
3058: */
3059:
3060: p_available_amount := p_available_amount + x_transaction_amount;
3061: IF (g_asn_debug = 'Y') THEN
3062: asn_debug.put_line('p_available_amount 1 '||p_available_amount );
3063: end if;
3064:
3065: EXCEPTION
3066:
3177: and pod.po_line_id = pol.po_line_id;
3178:
3179: --
3180:
3181: IF (g_asn_debug = 'Y') THEN
3182: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
3183: END IF;
3184:
3185: l_is_clm_po := po_clm_intg_grp.is_clm_po( p_po_header_id => NULL,
3178:
3179: --
3180:
3181: IF (g_asn_debug = 'Y') THEN
3182: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
3183: END IF;
3184:
3185: l_is_clm_po := po_clm_intg_grp.is_clm_po( p_po_header_id => NULL,
3186: p_po_line_id => NULL,
3186: p_po_line_id => NULL,
3187: p_po_line_location_id => l_po_line_location_id,
3188: p_po_distribution_id => p_po_distribution_id);
3189:
3190: IF (g_asn_debug = 'Y') THEN
3191: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
3192: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3193: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3194: END IF;
3187: p_po_line_location_id => l_po_line_location_id,
3188: p_po_distribution_id => p_po_distribution_id);
3189:
3190: IF (g_asn_debug = 'Y') THEN
3191: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
3192: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3193: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3194: END IF;
3195:
3188: p_po_distribution_id => p_po_distribution_id);
3189:
3190: IF (g_asn_debug = 'Y') THEN
3191: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
3192: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3193: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3194: END IF;
3195:
3196:
3189:
3190: IF (g_asn_debug = 'Y') THEN
3191: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
3192: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3193: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3194: END IF;
3195:
3196:
3197: IF l_is_clm_po = 'Y' THEN
3194: END IF;
3195:
3196:
3197: IF l_is_clm_po = 'Y' THEN
3198: IF (g_asn_debug = 'Y') THEN
3199: asn_debug.put_line(' before po_clm_intg_grp.get_funding_info()');
3200: end if;
3201:
3202: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
3195:
3196:
3197: IF l_is_clm_po = 'Y' THEN
3198: IF (g_asn_debug = 'Y') THEN
3199: asn_debug.put_line(' before po_clm_intg_grp.get_funding_info()');
3200: end if;
3201:
3202: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
3203: p_po_line_id => NULL,
3223: x_amount_cancelled => l_amount_cancelled,
3224: x_return_status => l_return_status
3225: );
3226:
3227: IF (g_asn_debug = 'Y') THEN
3228: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3229: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
3230: asn_debug.put_line('l_quantity_delivered : ' || l_quantity_delivered);
3231: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
3224: x_return_status => l_return_status
3225: );
3226:
3227: IF (g_asn_debug = 'Y') THEN
3228: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3229: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
3230: asn_debug.put_line('l_quantity_delivered : ' || l_quantity_delivered);
3231: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
3232: END IF;
3225: );
3226:
3227: IF (g_asn_debug = 'Y') THEN
3228: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3229: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
3230: asn_debug.put_line('l_quantity_delivered : ' || l_quantity_delivered);
3231: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
3232: END IF;
3233:
3226:
3227: IF (g_asn_debug = 'Y') THEN
3228: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3229: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
3230: asn_debug.put_line('l_quantity_delivered : ' || l_quantity_delivered);
3231: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
3232: END IF;
3233:
3234: IF l_partial_funded_flag = 'Y' THEN
3227: IF (g_asn_debug = 'Y') THEN
3228: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3229: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
3230: asn_debug.put_line('l_quantity_delivered : ' || l_quantity_delivered);
3231: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
3232: END IF;
3233:
3234: IF l_partial_funded_flag = 'Y' THEN
3235:
3351: END IF;
3352:
3353: --
3354: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
3355: IF (g_asn_debug = 'Y') THEN
3356: asn_debug.put_line('set p_tolerable_quantity for clm po');
3357: END IF;
3358:
3359: p_tolerable_quantity := p_available_quantity;
3352:
3353: --
3354: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
3355: IF (g_asn_debug = 'Y') THEN
3356: asn_debug.put_line('set p_tolerable_quantity for clm po');
3357: END IF;
3358:
3359: p_tolerable_quantity := p_available_quantity;
3360:
3358:
3359: p_tolerable_quantity := p_available_quantity;
3360:
3361: ELSE
3362: IF (g_asn_debug = 'Y') THEN
3363: asn_debug.put_line('set p_tolerable_quantity for non-clm po');
3364: END IF;
3365: --
3366:
3359: p_tolerable_quantity := p_available_quantity;
3360:
3361: ELSE
3362: IF (g_asn_debug = 'Y') THEN
3363: asn_debug.put_line('set p_tolerable_quantity for non-clm po');
3364: END IF;
3365: --
3366:
3367: -- 1337787
3465: and pod.po_line_id = pol.po_line_id;
3466:
3467: --
3468:
3469: IF (g_asn_debug = 'Y') THEN
3470: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
3471: END IF;
3472:
3473: l_is_clm_po := po_clm_intg_grp.is_clm_po( p_po_header_id => NULL,
3466:
3467: --
3468:
3469: IF (g_asn_debug = 'Y') THEN
3470: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
3471: END IF;
3472:
3473: l_is_clm_po := po_clm_intg_grp.is_clm_po( p_po_header_id => NULL,
3474: p_po_line_id => NULL,
3474: p_po_line_id => NULL,
3475: p_po_line_location_id => l_po_line_location_id,
3476: p_po_distribution_id => p_po_distribution_id);
3477:
3478: IF (g_asn_debug = 'Y') THEN
3479: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
3480: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3481: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3482: END IF;
3475: p_po_line_location_id => l_po_line_location_id,
3476: p_po_distribution_id => p_po_distribution_id);
3477:
3478: IF (g_asn_debug = 'Y') THEN
3479: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
3480: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3481: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3482: END IF;
3483:
3476: p_po_distribution_id => p_po_distribution_id);
3477:
3478: IF (g_asn_debug = 'Y') THEN
3479: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
3480: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3481: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3482: END IF;
3483:
3484:
3477:
3478: IF (g_asn_debug = 'Y') THEN
3479: asn_debug.put_line('line_location_id : ' || l_po_line_location_id);
3480: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3481: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3482: END IF;
3483:
3484:
3485: IF l_is_clm_po = 'Y' THEN
3482: END IF;
3483:
3484:
3485: IF l_is_clm_po = 'Y' THEN
3486: IF (g_asn_debug = 'Y') THEN
3487: asn_debug.put_line(' Before po_clm_intg_grp.get_funding_info()');
3488: end if;
3489:
3490: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
3483:
3484:
3485: IF l_is_clm_po = 'Y' THEN
3486: IF (g_asn_debug = 'Y') THEN
3487: asn_debug.put_line(' Before po_clm_intg_grp.get_funding_info()');
3488: end if;
3489:
3490: po_clm_intg_grp.get_funding_info( p_po_header_id => NULL,
3491: p_po_line_id => NULL,
3511: x_amount_cancelled => l_amount_cancelled,
3512: x_return_status => l_return_status
3513: );
3514:
3515: IF (g_asn_debug = 'Y') THEN
3516: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3517: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
3518: asn_debug.put_line('l_amount_delivered : ' || l_amount_delivered);
3519: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
3512: x_return_status => l_return_status
3513: );
3514:
3515: IF (g_asn_debug = 'Y') THEN
3516: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3517: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
3518: asn_debug.put_line('l_amount_delivered : ' || l_amount_delivered);
3519: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
3520: END IF;
3513: );
3514:
3515: IF (g_asn_debug = 'Y') THEN
3516: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3517: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
3518: asn_debug.put_line('l_amount_delivered : ' || l_amount_delivered);
3519: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
3520: END IF;
3521:
3514:
3515: IF (g_asn_debug = 'Y') THEN
3516: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3517: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
3518: asn_debug.put_line('l_amount_delivered : ' || l_amount_delivered);
3519: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
3520: END IF;
3521:
3522: IF l_partial_funded_flag = 'Y' THEN
3515: IF (g_asn_debug = 'Y') THEN
3516: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3517: asn_debug.put_line('l_amount_funded: ' || l_amount_funded);
3518: asn_debug.put_line('l_amount_delivered : ' || l_amount_delivered);
3519: asn_debug.put_line('l_amount_cancelled: ' || l_amount_cancelled);
3520: END IF;
3521:
3522: IF l_partial_funded_flag = 'Y' THEN
3523:
3567: END IF;
3568:
3569: --
3570: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
3571: IF (g_asn_debug = 'Y') THEN
3572: asn_debug.put_line('set p_tolerable_amount for clm po');
3573: END IF;
3574:
3575: p_tolerable_amount := p_available_amount;
3568:
3569: --
3570: IF l_is_clm_po = 'Y' AND l_partial_funded_flag = 'Y' THEN
3571: IF (g_asn_debug = 'Y') THEN
3572: asn_debug.put_line('set p_tolerable_amount for clm po');
3573: END IF;
3574:
3575: p_tolerable_amount := p_available_amount;
3576:
3574:
3575: p_tolerable_amount := p_available_amount;
3576:
3577: ELSE
3578: IF (g_asn_debug = 'Y') THEN
3579: asn_debug.put_line('set p_tolerable_amount for non-clm po');
3580: END IF;
3581: --
3582:
3575: p_tolerable_amount := p_available_amount;
3576:
3577: ELSE
3578: IF (g_asn_debug = 'Y') THEN
3579: asn_debug.put_line('set p_tolerable_amount for non-clm po');
3580: END IF;
3581: --
3582:
3583: -- 1337787
3686:
3687:
3688: --
3689:
3690: IF (g_asn_debug = 'Y') THEN
3691: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
3692: END IF;
3693:
3694: l_is_clm_po := po_clm_intg_grp.is_clm_po(p_po_header_id => NULL,
3687:
3688: --
3689:
3690: IF (g_asn_debug = 'Y') THEN
3691: asn_debug.put_line('before calling po_clm_intg_grp.is_clm_po()');
3692: END IF;
3693:
3694: l_is_clm_po := po_clm_intg_grp.is_clm_po(p_po_header_id => NULL,
3695: p_po_line_id => NULL,
3696: p_po_line_location_id => NULL,
3697: p_po_distribution_id => p_po_distribution_id);
3698:
3699:
3700: IF (g_asn_debug = 'Y') THEN
3701: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3702: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3703: END IF;
3704:
3697: p_po_distribution_id => p_po_distribution_id);
3698:
3699:
3700: IF (g_asn_debug = 'Y') THEN
3701: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3702: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3703: END IF;
3704:
3705: IF l_is_clm_po = 'Y' THEN
3698:
3699:
3700: IF (g_asn_debug = 'Y') THEN
3701: asn_debug.put_line('p_po_distribution_id : ' || p_po_distribution_id);
3702: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3703: END IF;
3704:
3705: IF l_is_clm_po = 'Y' THEN
3706: IF (g_asn_debug = 'Y') THEN
3702: asn_debug.put_line('l_is_clm_po: ' || l_is_clm_po);
3703: END IF;
3704:
3705: IF l_is_clm_po = 'Y' THEN
3706: IF (g_asn_debug = 'Y') THEN
3707: asn_debug.put_line('before calling po_clm_intg_grp.get_funding_info()');
3708: END IF;
3709:
3710: po_clm_intg_grp.get_funding_info(p_po_header_id => NULL,
3703: END IF;
3704:
3705: IF l_is_clm_po = 'Y' THEN
3706: IF (g_asn_debug = 'Y') THEN
3707: asn_debug.put_line('before calling po_clm_intg_grp.get_funding_info()');
3708: END IF;
3709:
3710: po_clm_intg_grp.get_funding_info(p_po_header_id => NULL,
3711: p_po_line_id => NULL,
3730: x_quantity_cancelled => l_quantity_cancelled,
3731: x_amount_cancelled => l_amount_cancelled,
3732: x_return_status => l_return_status);
3733:
3734: IF (g_asn_debug = 'Y') THEN
3735: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3736: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
3737: asn_debug.put_line('l_quantity_delivered : ' || l_quantity_delivered);
3738: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
3731: x_amount_cancelled => l_amount_cancelled,
3732: x_return_status => l_return_status);
3733:
3734: IF (g_asn_debug = 'Y') THEN
3735: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3736: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
3737: asn_debug.put_line('l_quantity_delivered : ' || l_quantity_delivered);
3738: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
3739: END IF;
3732: x_return_status => l_return_status);
3733:
3734: IF (g_asn_debug = 'Y') THEN
3735: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3736: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
3737: asn_debug.put_line('l_quantity_delivered : ' || l_quantity_delivered);
3738: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
3739: END IF;
3740:
3733:
3734: IF (g_asn_debug = 'Y') THEN
3735: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3736: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
3737: asn_debug.put_line('l_quantity_delivered : ' || l_quantity_delivered);
3738: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
3739: END IF;
3740:
3741: IF (l_partial_funded_flag = 'Y') THEN
3734: IF (g_asn_debug = 'Y') THEN
3735: asn_debug.put_line('l_partial_funded_flag : ' || l_partial_funded_flag);
3736: asn_debug.put_line('l_quantity_funded: ' || l_quantity_funded);
3737: asn_debug.put_line('l_quantity_delivered : ' || l_quantity_delivered);
3738: asn_debug.put_line('l_quantity_cancelled: ' || l_quantity_cancelled);
3739: END IF;
3740:
3741: IF (l_partial_funded_flag = 'Y') THEN
3742:
4098: l_progress VARCHAR2(3) := NULL;
4099: begin
4100:
4101: l_progress := '000';
4102: IF (g_asn_debug = 'Y') THEN
4103: asn_debug.put_line('Enter get_available_asn_quantity ');
4104: asn_debug.put_line('p_transaction_type '||p_transaction_type);
4105: asn_debug.put_line('p_shipment_line_id '||p_shipment_line_id);
4106: asn_debug.put_line('p_line_location_id '||p_line_location_id );
4099: begin
4100:
4101: l_progress := '000';
4102: IF (g_asn_debug = 'Y') THEN
4103: asn_debug.put_line('Enter get_available_asn_quantity ');
4104: asn_debug.put_line('p_transaction_type '||p_transaction_type);
4105: asn_debug.put_line('p_shipment_line_id '||p_shipment_line_id);
4106: asn_debug.put_line('p_line_location_id '||p_line_location_id );
4107: asn_debug.put_line('p_distribution_id '||p_distribution_id );
4100:
4101: l_progress := '000';
4102: IF (g_asn_debug = 'Y') THEN
4103: asn_debug.put_line('Enter get_available_asn_quantity ');
4104: asn_debug.put_line('p_transaction_type '||p_transaction_type);
4105: asn_debug.put_line('p_shipment_line_id '||p_shipment_line_id);
4106: asn_debug.put_line('p_line_location_id '||p_line_location_id );
4107: asn_debug.put_line('p_distribution_id '||p_distribution_id );
4108: asn_debug.put_line('x_unit_of_measure '||x_unit_of_measure );
4101: l_progress := '000';
4102: IF (g_asn_debug = 'Y') THEN
4103: asn_debug.put_line('Enter get_available_asn_quantity ');
4104: asn_debug.put_line('p_transaction_type '||p_transaction_type);
4105: asn_debug.put_line('p_shipment_line_id '||p_shipment_line_id);
4106: asn_debug.put_line('p_line_location_id '||p_line_location_id );
4107: asn_debug.put_line('p_distribution_id '||p_distribution_id );
4108: asn_debug.put_line('x_unit_of_measure '||x_unit_of_measure );
4109: END IF;
4102: IF (g_asn_debug = 'Y') THEN
4103: asn_debug.put_line('Enter get_available_asn_quantity ');
4104: asn_debug.put_line('p_transaction_type '||p_transaction_type);
4105: asn_debug.put_line('p_shipment_line_id '||p_shipment_line_id);
4106: asn_debug.put_line('p_line_location_id '||p_line_location_id );
4107: asn_debug.put_line('p_distribution_id '||p_distribution_id );
4108: asn_debug.put_line('x_unit_of_measure '||x_unit_of_measure );
4109: END IF;
4110:
4103: asn_debug.put_line('Enter get_available_asn_quantity ');
4104: asn_debug.put_line('p_transaction_type '||p_transaction_type);
4105: asn_debug.put_line('p_shipment_line_id '||p_shipment_line_id);
4106: asn_debug.put_line('p_line_location_id '||p_line_location_id );
4107: asn_debug.put_line('p_distribution_id '||p_distribution_id );
4108: asn_debug.put_line('x_unit_of_measure '||x_unit_of_measure );
4109: END IF;
4110:
4111: IF (p_transaction_type = 'RECEIVE') then --{
4104: asn_debug.put_line('p_transaction_type '||p_transaction_type);
4105: asn_debug.put_line('p_shipment_line_id '||p_shipment_line_id);
4106: asn_debug.put_line('p_line_location_id '||p_line_location_id );
4107: asn_debug.put_line('p_distribution_id '||p_distribution_id );
4108: asn_debug.put_line('x_unit_of_measure '||x_unit_of_measure );
4109: END IF;
4110:
4111: IF (p_transaction_type = 'RECEIVE') then --{
4112:
4123: x_tolerable_quantity,
4124: x_unit_of_measure,
4125: X_secondary_available_qty);
4126:
4127: IF (g_asn_debug = 'Y') THEN
4128: asn_debug.put_line('x_available_quantity '||x_available_quantity);
4129: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4130: asn_debug.put_line('x_unit_of_measure '||x_unit_of_measure);
4131: asn_debug.put_line('X_secondary_available_qty '||X_secondary_available_qty);
4124: x_unit_of_measure,
4125: X_secondary_available_qty);
4126:
4127: IF (g_asn_debug = 'Y') THEN
4128: asn_debug.put_line('x_available_quantity '||x_available_quantity);
4129: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4130: asn_debug.put_line('x_unit_of_measure '||x_unit_of_measure);
4131: asn_debug.put_line('X_secondary_available_qty '||X_secondary_available_qty);
4132: END IF;
4125: X_secondary_available_qty);
4126:
4127: IF (g_asn_debug = 'Y') THEN
4128: asn_debug.put_line('x_available_quantity '||x_available_quantity);
4129: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4130: asn_debug.put_line('x_unit_of_measure '||x_unit_of_measure);
4131: asn_debug.put_line('X_secondary_available_qty '||X_secondary_available_qty);
4132: END IF;
4133:
4126:
4127: IF (g_asn_debug = 'Y') THEN
4128: asn_debug.put_line('x_available_quantity '||x_available_quantity);
4129: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4130: asn_debug.put_line('x_unit_of_measure '||x_unit_of_measure);
4131: asn_debug.put_line('X_secondary_available_qty '||X_secondary_available_qty);
4132: END IF;
4133:
4134: l_progress := '010';
4127: IF (g_asn_debug = 'Y') THEN
4128: asn_debug.put_line('x_available_quantity '||x_available_quantity);
4129: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4130: asn_debug.put_line('x_unit_of_measure '||x_unit_of_measure);
4131: asn_debug.put_line('X_secondary_available_qty '||X_secondary_available_qty);
4132: END IF;
4133:
4134: l_progress := '010';
4135:
4144: l_uom_hold,
4145: x_secondary_available_qty);
4146:
4147:
4148: IF (g_asn_debug = 'Y') THEN
4149: asn_debug.put_line('l_available_qty_hold '||l_available_qty_hold);
4150: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4151: asn_debug.put_line('l_uom_hold '||l_uom_hold);
4152: asn_debug.put_line('X_secondary_available_qty '||X_secondary_available_qty);
4145: x_secondary_available_qty);
4146:
4147:
4148: IF (g_asn_debug = 'Y') THEN
4149: asn_debug.put_line('l_available_qty_hold '||l_available_qty_hold);
4150: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4151: asn_debug.put_line('l_uom_hold '||l_uom_hold);
4152: asn_debug.put_line('X_secondary_available_qty '||X_secondary_available_qty);
4153: END IF;
4146:
4147:
4148: IF (g_asn_debug = 'Y') THEN
4149: asn_debug.put_line('l_available_qty_hold '||l_available_qty_hold);
4150: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4151: asn_debug.put_line('l_uom_hold '||l_uom_hold);
4152: asn_debug.put_line('X_secondary_available_qty '||X_secondary_available_qty);
4153: END IF;
4154:
4147:
4148: IF (g_asn_debug = 'Y') THEN
4149: asn_debug.put_line('l_available_qty_hold '||l_available_qty_hold);
4150: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4151: asn_debug.put_line('l_uom_hold '||l_uom_hold);
4152: asn_debug.put_line('X_secondary_available_qty '||X_secondary_available_qty);
4153: END IF;
4154:
4155: /* Bug 9593466
4148: IF (g_asn_debug = 'Y') THEN
4149: asn_debug.put_line('l_available_qty_hold '||l_available_qty_hold);
4150: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4151: asn_debug.put_line('l_uom_hold '||l_uom_hold);
4152: asn_debug.put_line('X_secondary_available_qty '||X_secondary_available_qty);
4153: END IF;
4154:
4155: /* Bug 9593466
4156: We do not need to do any more calculation to get the available qty
4168: where shipment_line_id = p_shipment_line_id and
4169: transaction_type = 'RETURN TO VENDOR';
4170:
4171:
4172: IF (g_asn_debug = 'Y') THEN
4173: asn_debug.put_line('l_quantity_returned '||l_quantity_returned );
4174: END IF;
4175:
4176: IF l_quantity_returned > 0 then --}
4169: transaction_type = 'RETURN TO VENDOR';
4170:
4171:
4172: IF (g_asn_debug = 'Y') THEN
4173: asn_debug.put_line('l_quantity_returned '||l_quantity_returned );
4174: END IF;
4175:
4176: IF l_quantity_returned > 0 then --}
4177:
4186: x_tolerable_quantity := 0;
4187: end if;
4188:
4189:
4190: IF (g_asn_debug = 'Y') THEN
4191: asn_debug.put_line('x_available_quantity '||x_available_quantity );
4192: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity );
4193: END IF;
4194:
4187: end if;
4188:
4189:
4190: IF (g_asn_debug = 'Y') THEN
4191: asn_debug.put_line('x_available_quantity '||x_available_quantity );
4192: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity );
4193: END IF;
4194:
4195: END IF; --}
4188:
4189:
4190: IF (g_asn_debug = 'Y') THEN
4191: asn_debug.put_line('x_available_quantity '||x_available_quantity );
4192: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity );
4193: END IF;
4194:
4195: END IF; --}
4196:
4196:
4197: elsif(p_transaction_type = 'DIRECT RECEIPT') then
4198:
4199:
4200: IF (g_asn_debug = 'Y') THEN
4201: asn_debug.put_line('In direct receipt of ASN ');
4202: END IF;
4203:
4204: BEGIN
4197: elsif(p_transaction_type = 'DIRECT RECEIPT') then
4198:
4199:
4200: IF (g_asn_debug = 'Y') THEN
4201: asn_debug.put_line('In direct receipt of ASN ');
4202: END IF;
4203:
4204: BEGIN
4205:
4223: WHEN OTHERS THEN RAISE;
4224:
4225: END;
4226:
4227: IF (g_asn_debug = 'Y') THEN
4228: asn_debug.put_line('x_available_quantity '||x_available_quantity);
4229: END IF;
4230:
4231:
4224:
4225: END;
4226:
4227: IF (g_asn_debug = 'Y') THEN
4228: asn_debug.put_line('x_available_quantity '||x_available_quantity);
4229: END IF;
4230:
4231:
4232: l_progress := '050';
4245: AND po_line_location_id = p_line_location_id
4246: AND po_distribution_id = p_distribution_id;
4247:
4248:
4249: IF (g_asn_debug = 'Y') THEN
4250: asn_debug.put_line('l_interface_quantity '||l_interface_quantity);
4251: asn_debug.put_line('l_primary_uom '||l_primary_uom);
4252: END IF;
4253:
4246: AND po_distribution_id = p_distribution_id;
4247:
4248:
4249: IF (g_asn_debug = 'Y') THEN
4250: asn_debug.put_line('l_interface_quantity '||l_interface_quantity);
4251: asn_debug.put_line('l_primary_uom '||l_primary_uom);
4252: END IF;
4253:
4254: IF (l_interface_quantity = 0) THEN
4247:
4248:
4249: IF (g_asn_debug = 'Y') THEN
4250: asn_debug.put_line('l_interface_quantity '||l_interface_quantity);
4251: asn_debug.put_line('l_primary_uom '||l_primary_uom);
4252: END IF;
4253:
4254: IF (l_interface_quantity = 0) THEN
4255:
4271:
4272: END IF;
4273:
4274:
4275: IF (g_asn_debug = 'Y') THEN
4276: asn_debug.put_line('l_interface_qty_in_trx_uom '||l_interface_qty_in_trx_uom);
4277: END IF;
4278:
4279: x_available_quantity := x_available_quantity -
4272: END IF;
4273:
4274:
4275: IF (g_asn_debug = 'Y') THEN
4276: asn_debug.put_line('l_interface_qty_in_trx_uom '||l_interface_qty_in_trx_uom);
4277: END IF;
4278:
4279: x_available_quantity := x_available_quantity -
4280: l_interface_qty_in_trx_uom;
4284: x_available_quantity := 0;
4285:
4286: END IF;
4287:
4288: IF (g_asn_debug = 'Y') THEN
4289: asn_debug.put_line('x_available_quantity '||x_available_quantity);
4290: END IF;
4291:
4292:
4285:
4286: END IF;
4287:
4288: IF (g_asn_debug = 'Y') THEN
4289: asn_debug.put_line('x_available_quantity '||x_available_quantity);
4290: END IF;
4291:
4292:
4293:
4308: and pod.po_distribution_id = p_distribution_id
4309: and pod.po_line_id = pol.po_line_id;
4310:
4311:
4312: IF (g_asn_debug = 'Y') THEN
4313: asn_debug.put_line('l_qty_rcv_tolerance '||l_qty_rcv_tolerance);
4314: asn_debug.put_line('l_qty_ordered '||l_qty_ordered);
4315: asn_debug.put_line('l_qty_received '||l_qty_received);
4316: asn_debug.put_line('l_qty_cancelled '||l_qty_cancelled);
4309: and pod.po_line_id = pol.po_line_id;
4310:
4311:
4312: IF (g_asn_debug = 'Y') THEN
4313: asn_debug.put_line('l_qty_rcv_tolerance '||l_qty_rcv_tolerance);
4314: asn_debug.put_line('l_qty_ordered '||l_qty_ordered);
4315: asn_debug.put_line('l_qty_received '||l_qty_received);
4316: asn_debug.put_line('l_qty_cancelled '||l_qty_cancelled);
4317: END IF;
4310:
4311:
4312: IF (g_asn_debug = 'Y') THEN
4313: asn_debug.put_line('l_qty_rcv_tolerance '||l_qty_rcv_tolerance);
4314: asn_debug.put_line('l_qty_ordered '||l_qty_ordered);
4315: asn_debug.put_line('l_qty_received '||l_qty_received);
4316: asn_debug.put_line('l_qty_cancelled '||l_qty_cancelled);
4317: END IF;
4318:
4311:
4312: IF (g_asn_debug = 'Y') THEN
4313: asn_debug.put_line('l_qty_rcv_tolerance '||l_qty_rcv_tolerance);
4314: asn_debug.put_line('l_qty_ordered '||l_qty_ordered);
4315: asn_debug.put_line('l_qty_received '||l_qty_received);
4316: asn_debug.put_line('l_qty_cancelled '||l_qty_cancelled);
4317: END IF;
4318:
4319: x_tolerable_quantity := (l_qty_ordered * l_qty_rcv_tolerance)-
4312: IF (g_asn_debug = 'Y') THEN
4313: asn_debug.put_line('l_qty_rcv_tolerance '||l_qty_rcv_tolerance);
4314: asn_debug.put_line('l_qty_ordered '||l_qty_ordered);
4315: asn_debug.put_line('l_qty_received '||l_qty_received);
4316: asn_debug.put_line('l_qty_cancelled '||l_qty_cancelled);
4317: END IF;
4318:
4319: x_tolerable_quantity := (l_qty_ordered * l_qty_rcv_tolerance)-
4320: l_qty_received - l_qty_cancelled -
4326:
4327: END IF;
4328:
4329:
4330: IF (g_asn_debug = 'Y') THEN
4331: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4332: END IF;
4333:
4334:
4327: END IF;
4328:
4329:
4330: IF (g_asn_debug = 'Y') THEN
4331: asn_debug.put_line('x_tolerable_quantity '||x_tolerable_quantity);
4332: END IF;
4333:
4334:
4335:
4334:
4335:
4336: end if; --}
4337:
4338: IF (g_asn_debug = 'Y') THEN
4339: asn_debug.put_line('Leave get_available_asn_qty ');
4340: END IF;
4341:
4342: EXCEPTION
4335:
4336: end if; --}
4337:
4338: IF (g_asn_debug = 'Y') THEN
4339: asn_debug.put_line('Leave get_available_asn_qty ');
4340: END IF;
4341:
4342: EXCEPTION
4343: WHEN OTHERS THEN