930: and wdd2.delivery_detail_id = wda.parent_delivery_detail_id
931: and wdd2.lpn_id is not null -- for performance, bug 2418639
932: and wdd2.lpn_id = lpn.lpn_id
933: and lpn.outermost_lpn_id = wlpn.lpn_id
934: and ( wlpn.lpn_context = wms_container_pvt.lpn_context_picked
935: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
936: and wnd.status_code in ('OP', 'PA')
937: and wdd.released_status = 'Y'
938: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
931: and wdd2.lpn_id is not null -- for performance, bug 2418639
932: and wdd2.lpn_id = lpn.lpn_id
933: and lpn.outermost_lpn_id = wlpn.lpn_id
934: and ( wlpn.lpn_context = wms_container_pvt.lpn_context_picked
935: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
936: and wnd.status_code in ('OP', 'PA')
937: and wdd.released_status = 'Y'
938: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
939: and wlpn.license_plate_number like (p_lpn)
955: and wdd.lpn_id is not null
956: and wdd.lpn_id = lpn.outermost_lpn_id
957: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
958: and lpn.outermost_lpn_id = wlpn.lpn_id
959: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
960: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
961: and lpn.organization_id = p_organization_id
962: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
963: and wlpn.license_plate_number like (p_lpn)
956: and wdd.lpn_id = lpn.outermost_lpn_id
957: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
958: and lpn.outermost_lpn_id = wlpn.lpn_id
959: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
960: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
961: and lpn.organization_id = p_organization_id
962: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
963: and wlpn.license_plate_number like (p_lpn)
964: and wda.delivery_id IS NOT NULL
979: and wdd.lpn_id is not null
980: and wdd.lpn_id = lpn.outermost_lpn_id
981: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
982: and lpn.outermost_lpn_id = wlpn.lpn_id
983: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
984: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
985: and lpn.organization_id = p_organization_id
986: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
987: and wlpn.license_plate_number like (p_lpn)
980: and wdd.lpn_id = lpn.outermost_lpn_id
981: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
982: and lpn.outermost_lpn_id = wlpn.lpn_id
983: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
984: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
985: and lpn.organization_id = p_organization_id
986: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
987: and wlpn.license_plate_number like (p_lpn)
988: and wda.delivery_id IS NULL
1002: and wdd.lpn_id is not null
1003: and wdd.lpn_id = lpn.lpn_id
1004: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
1005: and lpn.outermost_lpn_id = wlpn.lpn_id
1006: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
1007: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
1008: and lpn.organization_id = p_organization_id
1009: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
1010: and wlpn.license_plate_number like (p_lpn)
1003: and wdd.lpn_id = lpn.lpn_id
1004: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
1005: and lpn.outermost_lpn_id = wlpn.lpn_id
1006: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
1007: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
1008: and lpn.organization_id = p_organization_id
1009: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
1010: and wlpn.license_plate_number like (p_lpn)
1011: and wda.delivery_id IS NOT NULL
1026: and wdd.lpn_id is not null
1027: and wdd.lpn_id = lpn.lpn_id
1028: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
1029: and lpn.outermost_lpn_id = wlpn.lpn_id
1030: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
1031: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
1032: and lpn.organization_id = p_organization_id
1033: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
1034: and wlpn.license_plate_number like (p_lpn)
1027: and wdd.lpn_id = lpn.lpn_id
1028: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
1029: and lpn.outermost_lpn_id = wlpn.lpn_id
1030: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
1031: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
1032: and lpn.organization_id = p_organization_id
1033: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
1034: and wlpn.license_plate_number like (p_lpn)
1035: and wda.delivery_id IS NULL
1061: and wdd2.lpn_id is not null -- for performance, bug 2418639
1062: and wdd2.lpn_id = lpn.lpn_id
1063: and lpn.outermost_lpn_id = wlpn.lpn_id
1064: --MR-MDC wlpn.lpn_context <> wms_globals.lpn_loaded_for_shipment
1065: and ( wlpn.lpn_context = wms_container_pvt.lpn_context_picked
1066: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
1067: -- 5582189 dherring additional criteria added to ensure ship confirmed deliveries
1068: -- do not appear in the lov
1069: and wnd.status_code in ('OP', 'PA')
1062: and wdd2.lpn_id = lpn.lpn_id
1063: and lpn.outermost_lpn_id = wlpn.lpn_id
1064: --MR-MDC wlpn.lpn_context <> wms_globals.lpn_loaded_for_shipment
1065: and ( wlpn.lpn_context = wms_container_pvt.lpn_context_picked
1066: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
1067: -- 5582189 dherring additional criteria added to ensure ship confirmed deliveries
1068: -- do not appear in the lov
1069: and wnd.status_code in ('OP', 'PA')
1070: and wdd.released_status = 'Y'
1087: and wdd.lpn_id is not null -- for performance, bug 2418639
1088: and wdd.lpn_id = lpn.outermost_lpn_id
1089: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
1090: and lpn.outermost_lpn_id = wlpn.lpn_id
1091: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
1092: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
1093: and lpn.organization_id = p_organization_id
1094: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
1095: and wlpn.license_plate_number like (p_lpn)
1088: and wdd.lpn_id = lpn.outermost_lpn_id
1089: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
1090: and lpn.outermost_lpn_id = wlpn.lpn_id
1091: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
1092: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
1093: and lpn.organization_id = p_organization_id
1094: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
1095: and wlpn.license_plate_number like (p_lpn)
1096: -- 5582189 dherring UNION introduced to avoid cartesian join
1111: and wdd.lpn_id is not null -- for performance, bug 2418639
1112: and wdd.lpn_id = lpn.outermost_lpn_id
1113: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
1114: and lpn.outermost_lpn_id = wlpn.lpn_id
1115: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
1116: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
1117: and lpn.organization_id = p_organization_id
1118: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
1119: and wlpn.license_plate_number like (p_lpn)
1112: and wdd.lpn_id = lpn.outermost_lpn_id
1113: and wdd.released_status = 'X' -- For LPN reuse ER : 6845650
1114: and lpn.outermost_lpn_id = wlpn.lpn_id
1115: and (wlpn.lpn_context = wms_container_pvt.lpn_context_picked
1116: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
1117: and lpn.organization_id = p_organization_id
1118: and (wdd.inv_interfaced_flag <> 'Y' or wdd.inv_interfaced_flag is null )
1119: and wlpn.license_plate_number like (p_lpn)
1120: -- 5582189 dherring UNION introduced to avoid cartesian join
3061: and wdd2.delivery_detail_id = wda.parent_delivery_detail_id
3062: and wdd2.lpn_id = lpn.lpn_id
3063: and lpn.outermost_lpn_id = wlpn.lpn_id
3064: AND wdd.organization_id = p_organization_id
3065: and ( wlpn.lpn_context = wms_container_pvt.lpn_context_picked
3066: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
3067: -- 5582189 dherring changed code to select picked lpns
3068: and wnd.status_code in ('OP', 'PA');
3069: --and wlpn.lpn_context <> 9;
3062: and wdd2.lpn_id = lpn.lpn_id
3063: and lpn.outermost_lpn_id = wlpn.lpn_id
3064: AND wdd.organization_id = p_organization_id
3065: and ( wlpn.lpn_context = wms_container_pvt.lpn_context_picked
3066: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
3067: -- 5582189 dherring changed code to select picked lpns
3068: and wnd.status_code in ('OP', 'PA');
3069: --and wlpn.lpn_context <> 9;
3070: if l_count > 0 then
3100: and wdl.pick_up_stop_id = pickup_stop.stop_id
3101: and pickup_stop.trip_id = p_trip_id
3102: and lpn.lpn_id = wdd2.lpn_id
3103: and lpn.outermost_lpn_id = wlpn.lpn_id
3104: and ( wlpn.lpn_context = wms_container_pvt.lpn_context_picked
3105: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
3106: --and wlpn.lpn_context <> 9
3107: -- 5582189 dherring changed code to select picked lpns
3108: and wnd.status_code in ('OP', 'PA')
3101: and pickup_stop.trip_id = p_trip_id
3102: and lpn.lpn_id = wdd2.lpn_id
3103: and lpn.outermost_lpn_id = wlpn.lpn_id
3104: and ( wlpn.lpn_context = wms_container_pvt.lpn_context_picked
3105: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
3106: --and wlpn.lpn_context <> 9
3107: -- 5582189 dherring changed code to select picked lpns
3108: and wnd.status_code in ('OP', 'PA')
3109: and lpn.locator_id = milk.inventory_location_id
3142: and wdd2.lpn_id = lpn.lpn_id
3143: and wlpn.lpn_id = lpn.outermost_lpn_id
3144: AND wdd.organization_id = p_organization_id
3145: and ( wlpn.lpn_context =
3146: wms_container_pvt.lpn_context_picked
3147: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
3148: -- 5582189 dherring changed code to select picked lpns
3149: and wda.delivery_id = wnd.delivery_id
3150: and wnd.status_code in ('OP', 'PA');
3143: and wlpn.lpn_id = lpn.outermost_lpn_id
3144: AND wdd.organization_id = p_organization_id
3145: and ( wlpn.lpn_context =
3146: wms_container_pvt.lpn_context_picked
3147: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
3148: -- 5582189 dherring changed code to select picked lpns
3149: and wda.delivery_id = wnd.delivery_id
3150: and wnd.status_code in ('OP', 'PA');
3151: --and wlpn.lpn_context <> 9;
3197: and nvl(direct_ship_flag,'N') = 'N')
3198: and wda.delivery_id = wnd.delivery_id
3199: and lpn.lpn_id = wdd2.lpn_id
3200: and lpn.outermost_lpn_id = wlpn.lpn_id
3201: and ( wlpn.lpn_context = wms_container_pvt.lpn_context_picked
3202: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
3203: --and wlpn.lpn_context <> 9
3204: -- 5582189 dherring changed code to select picked lpns
3205: and wnd.status_code in ('OP', 'PA')
3198: and wda.delivery_id = wnd.delivery_id
3199: and lpn.lpn_id = wdd2.lpn_id
3200: and lpn.outermost_lpn_id = wlpn.lpn_id
3201: and ( wlpn.lpn_context = wms_container_pvt.lpn_context_picked
3202: OR wlpn.lpn_context = wms_container_pvt.lpn_loaded_in_stage)
3203: --and wlpn.lpn_context <> 9
3204: -- 5582189 dherring changed code to select picked lpns
3205: and wnd.status_code in ('OP', 'PA')
3206: and lpn.locator_id = milk.inventory_location_id