[Home] [Help]
793: l_progress := '102';
794:
795: /* Convert transaction qty in p_transaction_unit_of_measure to l_pmy_unit_of_meas */
796: /*I
797: l_lot_qty := INV_CONVERT.inv_um_convert(
798: item_id => p_item_id ,
799: lot_number => p_lot_number ,
800: organization_id => p_to_organization_id ,
801: precision => 5 ,
806: to_name => l_pmy_unit_of_meas
807: );
808:
809: IF g_debug = 1 THEN
810: print_debug('Program INV_CONVERT.inv_um_convert return: ' || l_progress, 9);
811: print_debug('l_lot_qty: ' || l_lot_qty, 9);
812: END IF;
813:
814: l_progress := '103';
815:
816: IF l_lot_qty = -99999 THEN
817:
818: IF g_debug = 1 THEN
819: print_debug('INV_CONVERT.inv_um_convert has failed '|| l_progress, 1);
820: END IF;
821:
822: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
823: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
819: print_debug('INV_CONVERT.inv_um_convert has failed '|| l_progress, 1);
820: END IF;
821:
822: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
823: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
824: fnd_msg_pub.ADD;
825:
826: RAISE g_exc_unexpected_error;
827: END IF;
894:
895: l_progress := '013' ;
896:
897: IF g_debug = 1 THEN
898: print_debug('Before calling INV_CONVERT.Within_deviation ' || l_progress, 1);
899: print_debug('p_quantity ' || p_lot_quantity, 1);
900: print_debug('p_quantity2 ' || l_lot_secondary_quantity, 1);
901: print_debug('p_unit_of_measure1 ' || p_transaction_unit_of_measure, 1);
902: print_debug('p_unit_of_measure2 ' || p_secondary_unit_of_measure, 1);
907: END IF;
908:
909: /* Bug 5365360 for a fixed type of item just recompute the lot secondary quantity)*/
910: IF (INV_CACHE.item_rec.secondary_default_ind = 'F') THEN
911: l_lot_secondary_quantity:= INV_CONVERT.inv_um_convert (
912: item_id => p_item_id
913: ,
914: lot_number => p_lot_number
915: ,
951:
952:
953: ELSE
954:
955: l_deviation_check := INV_CONVERT.Within_deviation(
956: p_organization_id => p_to_organization_id ,
957: p_inventory_item_id => p_item_id ,
958: p_lot_number => p_lot_number ,
959: p_precision => 5 ,
968:
969: /*RETURN Number , 1 for True and 0 for False */
970:
971: IF g_debug = 1 THEN
972: print_debug('Program INV_CONVERT.Within_deviation return ' || l_progress, 1);
973: END IF;
974: END IF;
975:
976:
977: l_progress := '014';
978:
979: IF l_deviation_check = 0 THEN
980: IF g_debug = 1 THEN
981: print_debug('Program INV_CONVERT.Within_deviation has failed ' || l_progress, 1);
982: END IF;
983: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
984: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.Within_deviation return');
985: fnd_msg_pub.ADD;
980: IF g_debug = 1 THEN
981: print_debug('Program INV_CONVERT.Within_deviation has failed ' || l_progress, 1);
982: END IF;
983: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
984: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.Within_deviation return');
985: fnd_msg_pub.ADD;
986: RAISE g_exc_unexpected_error;
987: END IF;
988:
990:
991: l_progress := '015';
992:
993: IF g_debug = 1 THEN
994: print_debug('Before calling INV_CONVERT.inv_um_convert ' || l_progress, 1);
995: print_debug('from_quantity ' || p_lot_quantity, 1);
996: print_debug('from_unit ' || l_from_unit, 1);
997: print_debug('to_unit ' || l_to_unit, 1);
998: print_debug('from_name ' || p_transaction_unit_of_measure, 1);
999: print_debug('to_name ' || p_secondary_unit_of_measure, 1);
1000: END IF;
1001:
1002:
1003: l_lot_secondary_quantity:= INV_CONVERT.inv_um_convert (
1004: item_id => p_item_id ,
1005: lot_number => p_lot_number ,
1006: organization_id => p_to_organization_id ,
1007: precision => 5 ,
1012: to_name => p_secondary_unit_of_measure
1013: );
1014:
1015: IF g_debug = 1 THEN
1016: print_debug('Program INV_CONVERT.inv_um_convert return: ' || l_progress, 9);
1017: print_debug('l_lot_secondary_quantity: ' || l_lot_secondary_quantity, 9);
1018: END IF;
1019:
1020: l_progress := '016';
1020: l_progress := '016';
1021:
1022: IF l_lot_secondary_quantity = -99999 THEN
1023: IF g_debug = 1 THEN
1024: print_debug('INV_CONVERT.inv_um_convert has failed '|| l_progress, 1);
1025: END IF;
1026: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
1027: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
1028: fnd_msg_pub.ADD;
1023: IF g_debug = 1 THEN
1024: print_debug('INV_CONVERT.inv_um_convert has failed '|| l_progress, 1);
1025: END IF;
1026: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
1027: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
1028: fnd_msg_pub.ADD;
1029:
1030: RAISE g_exc_unexpected_error;
1031: END IF;
1102: IF l_lot_secondary_quantity IS NOT NULL THEN
1103: ---Validate the secondary quantity
1104:
1105: IF g_debug = 1 THEN
1106: print_debug('Before calling INV_CONVERT.Within_deviation ' || l_progress, 1);
1107: print_debug('p_quantity ' || p_lot_quantity, 1);
1108: print_debug('p_quantity2 ' || l_lot_secondary_quantity, 1);
1109: print_debug('p_unit_of_measure1 ' || p_transaction_unit_of_measure, 1);
1110: print_debug('p_unit_of_measure2 ' || p_secondary_unit_of_measure, 1);
1115: END IF;
1116:
1117: /* Bug 5365360 for a fixed type of item just recompute the lot secondary quantity)*/
1118: IF (INV_CACHE.item_rec.secondary_default_ind = 'F') THEN
1119: l_lot_secondary_quantity:= INV_CONVERT.inv_um_convert (
1120: item_id => p_item_id ,
1121: lot_number => p_lot_number ,
1122: organization_id => p_to_organization_id ,
1123: precision => 5 ,
1157: ELSE
1158:
1159:
1160: ---Do item level deviation check
1161: l_deviation_check := INV_CONVERT.Within_deviation(
1162: p_organization_id => p_to_organization_id ,
1163: p_inventory_item_id => p_item_id ,
1164: p_lot_number => p_lot_number ,---new lot number
1165: p_precision => 5 ,
1175:
1176: /*RETURN Number , 1 for True and 0 for False */
1177:
1178: IF g_debug = 1 THEN
1179: print_debug('Program INV_CONVERT.Within_deviation return ' || l_progress, 1);
1180: END IF;
1181:
1182: IF l_deviation_check = 0 THEN
1183: IF g_debug = 1 THEN
1180: END IF;
1181:
1182: IF l_deviation_check = 0 THEN
1183: IF g_debug = 1 THEN
1184: print_debug('Program INV_CONVERT.Within_deviation has failed ' || l_progress, 9);
1185: END IF;
1186: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1187: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.Within_deviation return');
1188: fnd_msg_pub.ADD;
1183: IF g_debug = 1 THEN
1184: print_debug('Program INV_CONVERT.Within_deviation has failed ' || l_progress, 9);
1185: END IF;
1186: FND_MESSAGE.SET_NAME('INV','INV_PROGRAM_ERROR');
1187: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.Within_deviation return');
1188: fnd_msg_pub.ADD;
1189: RAISE g_exc_error;
1190: END IF;
1191:
1193:
1194: ELSE -----if l_lot_secondary_quantity is NULL
1195:
1196: IF g_debug = 1 THEN
1197: print_debug('Before calling INV_CONVERT.inv_um_convert ' || l_progress, 1);
1198: print_debug('from_quantity ' || p_lot_quantity, 1);
1199: print_debug('from_unit ' || l_from_unit, 1);
1200: print_debug('to_unit ' || l_to_unit, 1);
1201: print_debug('from_name ' || p_transaction_unit_of_measure, 1);
1202: print_debug('to_name ' || p_secondary_unit_of_measure, 1);
1203: END IF;
1204:
1205: ---Default the secondary quantity.
1206: l_lot_secondary_quantity:= INV_CONVERT.Inv_um_convert(
1207: item_id => p_item_id ,
1208: lot_number => p_lot_number,----new lot number
1209: organization_id => p_to_organization_id ,
1210: precision => 5 ,
1216: );
1217: l_progress :='021';
1218:
1219: IF g_debug = 1 THEN
1220: print_debug('Program INV_CONVERT.inv_um_convert return: '||l_progress , 1);
1221: END IF;
1222:
1223: IF l_lot_secondary_quantity = -99999 THEN
1224: IF g_debug = 1 THEN
1221: END IF;
1222:
1223: IF l_lot_secondary_quantity = -99999 THEN
1224: IF g_debug = 1 THEN
1225: print_debug('INV_CONVERT.inv_um_convert has failed'|| l_progress, 9);
1226: END IF;
1227: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
1228: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
1229: fnd_msg_pub.ADD;
1224: IF g_debug = 1 THEN
1225: print_debug('INV_CONVERT.inv_um_convert has failed'|| l_progress, 9);
1226: END IF;
1227: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
1228: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
1229: fnd_msg_pub.ADD;
1230: RAISE g_exc_unexpected_error;
1231: END IF;
1232:
2000: all of these situations and will do the appropriate business rule validations.*/
2001:
2002: /* Fetching the conversion rate */
2003: /*
2004: INV_CONVERT.inv_um_conversion(
2005: from_unit =>p_lot_uom_conv_rec.FROM_UOM_CODE,
2006: to_unit =>p_lot_uom_conv_rec.TO_UOM_CODE,
2007: item_id =>p_lot_uom_conv_rec.INVENTORY_ITEM_ID,
2008: lot_number =>p_lot_uom_conv_rec.LOT_NUMBER,
2352: in p_rti_unit_of_measure (RTI.UNIT_OF_MEASURE )for each lot of that item into
2353: RTI.SOURCE_DOC_UNIT_OF_MEASURE taking lot specific conversion into consideration */
2354:
2355:
2356: l_rti_sourcedoc_quantity := INV_CONVERT.inv_um_convert(
2357: item_id => p_inventory_item_id ,
2358: lot_number => p_lot_number ,
2359: organization_id => p_to_organization_id ,
2360: precision => 5 ,
2367:
2368: l_progress :='040';
2369:
2370: IF g_debug = 1 THEN
2371: print_debug('Program INV_CONVERT.inv_um_convert return :' ||l_progress , 1);
2372: print_debug('l_rti_sourcedoc_quantity :' ||l_rti_sourcedoc_quantity , 1);
2373: END IF;
2374:
2375: IF l_rti_sourcedoc_quantity = -99999 THEN
2373: END IF;
2374:
2375: IF l_rti_sourcedoc_quantity = -99999 THEN
2376: IF g_debug = 1 THEN
2377: print_debug('INV_CONVERT.inv_um_convert has failed in inv_synch_quantities:'|| l_progress, 1);
2378: END IF;
2379: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
2380: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
2381: fnd_msg_pub.ADD;
2376: IF g_debug = 1 THEN
2377: print_debug('INV_CONVERT.inv_um_convert has failed in inv_synch_quantities:'|| l_progress, 1);
2378: END IF;
2379: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
2380: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
2381: fnd_msg_pub.ADD;
2382: RAISE g_exc_unexpected_error;
2383: END IF;
2384:
2883: print_debug('l_trx_unit_of_measure <> l_lot_recv_unit_of_measure :' ||l_progress, 1);
2884: END IF;
2885:
2886:
2887: l_trx_quantity := INV_CONVERT.inv_um_convert(
2888: item_id => p_item_id ,
2889: lot_number => p_lot_number ,
2890: organization_id => p_to_organization_id ,
2891: precision => l_precision ,
2897: );
2898:
2899: IF g_debug = 1 THEN
2900: print_debug('quantity when l_trx_unit_of_measure <> l_lot_recv_unit_of_measure is :'|| l_trx_quantity ,1);
2901: print_debug('Program INV_CONVERT.inv_um_convert return: ' || l_return_status||':'||l_progress, 1);
2902: END IF;
2903:
2904:
2905: IF l_trx_quantity = -99999 THEN
2906:
2907: l_progress := '070';
2908:
2909: IF g_debug = 1 THEN
2910: print_debug('Inv_Validate_rma_quantity::INV_CONVERT.inv_um_convert has failed:'||l_progress, 1);
2911: END IF;
2912: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
2913: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
2914: fnd_msg_pub.ADD;
2909: IF g_debug = 1 THEN
2910: print_debug('Inv_Validate_rma_quantity::INV_CONVERT.inv_um_convert has failed:'||l_progress, 1);
2911: END IF;
2912: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
2913: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
2914: fnd_msg_pub.ADD;
2915: RAISE g_exc_unexpected_error;
2916: END IF;
2917:
2929: IF g_debug = 1 THEN
2930: print_debug('l_rma_lot_unit_of_measure <> l_lot_recv_unit_of_measure :' ||l_progress, 1);
2931: END IF;
2932:
2933: l_rma_quantity := INV_CONVERT.inv_um_convert(
2934: item_id => p_item_id ,
2935: lot_number => p_lot_number ,
2936: organization_id => p_to_organization_id ,
2937: precision => 5 ,
2943: );
2944:
2945: IF g_debug = 1 THEN
2946: print_debug('quantity when l_rma_lot_unit_of_measure <> l_lot_recv_unit_of_measure is :'|| l_rma_quantity ,1);
2947: print_debug('Program INV_CONVERT.inv_um_convert return: ' ||l_progress, 1);
2948: END IF;
2949:
2950:
2951: IF l_rma_quantity = -99999 THEN
2952:
2953: l_progress :='072';
2954:
2955: IF g_debug = 1 THEN
2956: print_debug('Inv_Validate_rma_quantity::INV_CONVERT.inv_um_convert has failed:'||l_progress, 9);
2957: END IF;
2958: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
2959: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
2960: fnd_msg_pub.ADD;
2955: IF g_debug = 1 THEN
2956: print_debug('Inv_Validate_rma_quantity::INV_CONVERT.inv_um_convert has failed:'||l_progress, 9);
2957: END IF;
2958: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
2959: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_CONVERT.inv_um_convert');
2960: fnd_msg_pub.ADD;
2961: RAISE g_exc_unexpected_error;
2962: END IF;
2963:
2983: IF l_trx_unit_of_measure <> l_lot_recv_unit_of_measure THEN
2984:
2985: l_progress := '074';
2986:
2987: X_allowed_quantity:= INV_CONVERT.inv_um_convert(
2988: item_id => p_item_id ,
2989: lot_number => p_lot_number ,
2990: organization_id => p_to_organization_id ,
2991: precision => 5 ,
2996: to_name => l_trx_unit_of_measure
2997: );
2998: IF g_debug = 1 THEN
2999: print_debug('x_allowed_quantity when l_trx_unit_of_measure <> l_lot_recv_unit_of_measure is :'|| X_allowed_quantity ,1);
3000: print_debug('Program INV_CONVERT.inv_um_convert return ' || l_progress, 1);
3001: END IF;
3002:
3003: IF X_allowed_quantity = -99999 THEN
3004: l_progress := '075';
3003: IF X_allowed_quantity = -99999 THEN
3004: l_progress := '075';
3005:
3006: IF g_debug = 1 THEN
3007: print_debug('Inv_Validate_rma_quantity::INV_CONVERT.inv_um_convert has failed:'|| l_progress, 1);
3008: END IF;
3009: FND_MESSAGE.SET_NAME('INV','INV_NO_CONVERSION_ERR');
3010: FND_MESSAGE.SET_TOKEN('PGM_NAME','INV_ROI_INTEGRATION_GRP.INV_VALIDATE_RMA_QUANTITY');
3011: fnd_msg_pub.ADD;