500: CURSOR c_first_trip_ship_method (x_delivery_id IN NUMBER,
501: x_initial_loc_id IN NUMBER)IS
502: SELECT wt.ship_method_code
503: FROM wsh_delivery_legs dlg,
504: wsh_trip_stops st,
505: wsh_trips wt
506: WHERE dlg.delivery_id = x_delivery_id
507: AND st.stop_id = dlg.pick_up_stop_id
508: AND st.stop_location_id = x_initial_loc_id
726: x_return_status OUT NOCOPY VARCHAR2) IS
727:
728: Cursor lock_stop_trip (c_stop_id NUMBER) IS
729: SELECT a.stop_id self_stop_id, b.trip_id, c.stop_id other_stop_id
730: FROM wsh_trip_stops a, wsh_trips b, wsh_trip_stops c
731: WHERE a.trip_id = b.trip_id AND
732: a.stop_id = c_stop_id AND
733: c.trip_id = b.trip_id AND
734: a.stop_id <> C.stop_id
738: l_self_stop_id NUMBER;
739: l_other_stop_id NUMBER;
740: l_trip_id NUMBER;
741: l_return_status VARCHAR2(1);
742: l_action_prms WSH_TRIP_STOPS_GRP.action_parameters_rectype;
743: l_rec_attr_tab WSH_TRIP_STOPS_PVT.Stop_Attr_Tbl_Type;
744: l_stop_out_rec WSH_TRIP_STOPS_GRP.stopActionOutRecType;
745: l_def_rec WSH_TRIP_STOPS_GRP.default_parameters_rectype;
746: l_msg_count NUMBER;
739: l_other_stop_id NUMBER;
740: l_trip_id NUMBER;
741: l_return_status VARCHAR2(1);
742: l_action_prms WSH_TRIP_STOPS_GRP.action_parameters_rectype;
743: l_rec_attr_tab WSH_TRIP_STOPS_PVT.Stop_Attr_Tbl_Type;
744: l_stop_out_rec WSH_TRIP_STOPS_GRP.stopActionOutRecType;
745: l_def_rec WSH_TRIP_STOPS_GRP.default_parameters_rectype;
746: l_msg_count NUMBER;
747: l_msg_data VARCHAR2(2000);
740: l_trip_id NUMBER;
741: l_return_status VARCHAR2(1);
742: l_action_prms WSH_TRIP_STOPS_GRP.action_parameters_rectype;
743: l_rec_attr_tab WSH_TRIP_STOPS_PVT.Stop_Attr_Tbl_Type;
744: l_stop_out_rec WSH_TRIP_STOPS_GRP.stopActionOutRecType;
745: l_def_rec WSH_TRIP_STOPS_GRP.default_parameters_rectype;
746: l_msg_count NUMBER;
747: l_msg_data VARCHAR2(2000);
748: l_debug_on BOOLEAN;
741: l_return_status VARCHAR2(1);
742: l_action_prms WSH_TRIP_STOPS_GRP.action_parameters_rectype;
743: l_rec_attr_tab WSH_TRIP_STOPS_PVT.Stop_Attr_Tbl_Type;
744: l_stop_out_rec WSH_TRIP_STOPS_GRP.stopActionOutRecType;
745: l_def_rec WSH_TRIP_STOPS_GRP.default_parameters_rectype;
746: l_msg_count NUMBER;
747: l_msg_data VARCHAR2(2000);
748: l_debug_on BOOLEAN;
749: l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'Close_A_Stop';
773:
774: SAVEPOINT beginning_of_the_procedure;
775:
776: IF l_debug_on THEN
777: WSH_DEBUG_SV.log(l_module_name, 'Stop locked, calling WSH_TRIP_STOPS_GRP.Stop_Action for stop '|| to_char(p_stop_id));
778: END IF;
779:
780: l_action_prms.action_code := 'UPDATE-STATUS';
781: l_action_prms.stop_action := 'CLOSE';
787:
788: l_rec_attr_tab(1).stop_id := p_stop_id;
789:
790:
791: WSH_TRIP_STOPS_GRP.Stop_Action
792: ( p_api_version_number => 1.0,
793: p_init_msg_list => FND_API.G_FALSE,
794: p_commit => FND_API.G_FALSE,
795: p_action_prms => l_action_prms,
886: CURSOR get_pick_up_stops IS
887: SELECT DISTINCT wtp.trip_id, wst.stop_sequence_number, wst.stop_id, wst.stop_location_id
888: FROM wsh_new_deliveries wnd,
889: wsh_delivery_legs wlg,
890: wsh_trip_stops wst,
891: wsh_trips wtp
892: WHERE wnd.delivery_id = wlg.delivery_id AND
893: wlg.pick_up_stop_id = wst.stop_id AND
894: wnd.status_code = 'CO' AND
907:
908: --Modified the following SQL as part of bug 4280371 ( 30-Jun-2005 ).
909: CURSOR get_all_stops IS
910: select wsto.trip_id, wsto.stop_sequence_number, wsto.stop_id , wsto.stop_location_id
911: from wsh_trip_stops wsto
912: , wsh_new_deliveries wnd
913: , wsh_delivery_legs wlg
914: , wsh_trip_stops wst
915: where wnd.batch_id = p_sc_batch_id
910: select wsto.trip_id, wsto.stop_sequence_number, wsto.stop_id , wsto.stop_location_id
911: from wsh_trip_stops wsto
912: , wsh_new_deliveries wnd
913: , wsh_delivery_legs wlg
914: , wsh_trip_stops wst
915: where wnd.batch_id = p_sc_batch_id
916: and wnd.status_code = 'CO'
917: and wnd.delivery_id = wlg.delivery_id
918: and wlg.pick_up_stop_id = wst.stop_id
931: -- added cursor to check if interface is necessary
932: -- 3667595
933: CURSOR c_batch_stop(p_batch_id NUMBER)IS
934: SELECT wts.stop_id
935: FROM wsh_trip_stops wts,
936: wsh_delivery_legs wdl,
937: wsh_new_deliveries wnd,
938: wsh_picking_batches wpb
939: WHERE p_batch_id IS NOT NULL