94: CURSOR c_delv_trip_id_cursor( t_delivery_id NUMBER ) IS
95: select distinct trip_id from wsh_trip_stops
96: where stop_id in
97: ( select distinct pick_up_stop_id
98: from wsh_delivery_legs
99: where delivery_id = t_delivery_id );
100:
101:
102: CURSOR c_dlvy_leg_cur(p_delivery_id NUMBER) IS
107: b.carrier_id,
108: b.trip_id,
109: b.trip_name,
110: l.parent_delivery_leg_id
111: FROM wsh_bols_db_v b, wsh_delivery_legs l
112: WHERE b.delivery_id = p_delivery_id
113: AND l.delivery_leg_id = b.delivery_leg_id;
114:
115: CURSOR c_child_deliveries(p_delivery_id IN NUMBER) IS
113: AND l.delivery_leg_id = b.delivery_leg_id;
114:
115: CURSOR c_child_deliveries(p_delivery_id IN NUMBER) IS
116: select child.delivery_id
117: from wsh_delivery_legs parent,
118: wsh_delivery_legs child
119: where parent.delivery_id = p_delivery_id
120: and parent.delivery_leg_id = child.parent_delivery_leg_id;
121:
114:
115: CURSOR c_child_deliveries(p_delivery_id IN NUMBER) IS
116: select child.delivery_id
117: from wsh_delivery_legs parent,
118: wsh_delivery_legs child
119: where parent.delivery_id = p_delivery_id
120: and parent.delivery_leg_id = child.parent_delivery_leg_id;
121:
122:
127:
128: Cursor c_del_assign_to_trip(c_delivery_id number) is
129: SELECT distinct t.trip_id, t.ship_method_code, t.lane_id
130: FROM wsh_new_deliveries dl,
131: wsh_delivery_legs dg,
132: wsh_trip_stops st,
133: wsh_trips t
134: WHERE dl.delivery_id = c_delivery_id AND
135: dl.delivery_id = dg.delivery_id AND
142: --selecting deliveries that has 'AR' status on a trip
143: CURSOR c_get_delivery_id(p_trip_id IN NUMBER) IS
144: SELECT wdl.delivery_id,
145: WSH_NEW_DELIVERIES_PVT.C_TMS_AWAITING_ANSWER interface_flag
146: FROM wsh_delivery_legs wdl,
147: wsh_trip_stops wts,
148: wsh_new_deliveries wnd,
149: wsh_trips wt
150: WHERE wt.trip_id = p_trip_id
249: l_doc_set_id NUMBER;
250: l_doc_delivery_id_tab wsh_util_core.id_tab_type;
251: l_doc_valid_ids_tab wsh_util_core.id_tab_type;
252:
253: l_dleg_prms WSH_DELIVERY_LEGS_GRP.action_parameters_rectype;
254: l_dleg_action_out_rec WSH_DELIVERY_LEGS_GRP.action_out_rec_type;
255: l_dleg_tab WSH_DELIVERY_LEGS_GRP.dlvy_leg_tab_type;
256:
257: l_action_prms action_parameters_rectype;
250: l_doc_delivery_id_tab wsh_util_core.id_tab_type;
251: l_doc_valid_ids_tab wsh_util_core.id_tab_type;
252:
253: l_dleg_prms WSH_DELIVERY_LEGS_GRP.action_parameters_rectype;
254: l_dleg_action_out_rec WSH_DELIVERY_LEGS_GRP.action_out_rec_type;
255: l_dleg_tab WSH_DELIVERY_LEGS_GRP.dlvy_leg_tab_type;
256:
257: l_action_prms action_parameters_rectype;
258: l_delivery_out_rec Delivery_Action_Out_Rec_Type;
251: l_doc_valid_ids_tab wsh_util_core.id_tab_type;
252:
253: l_dleg_prms WSH_DELIVERY_LEGS_GRP.action_parameters_rectype;
254: l_dleg_action_out_rec WSH_DELIVERY_LEGS_GRP.action_out_rec_type;
255: l_dleg_tab WSH_DELIVERY_LEGS_GRP.dlvy_leg_tab_type;
256:
257: l_action_prms action_parameters_rectype;
258: l_delivery_out_rec Delivery_Action_Out_Rec_Type;
259: l_defaults_rec default_parameters_rectype;
2794: wsh_debug_sv.log(l_module_name, 'Processing delivery leg', dlvy_leg_rec.delivery_leg_id);
2795: END IF;
2796:
2797: l_dleg_tab.delete;
2798: wsh_delivery_legs_pvt.populate_record(
2799: p_delivery_leg_id => NVL(dlvy_leg_rec.parent_delivery_leg_id, dlvy_leg_rec.delivery_leg_id),
2800: x_delivery_leg_info => l_dleg_tab(1),
2801: x_return_status => l_return_status);
2802:
2828: l_dleg_action_out_rec.x_trip_name := dlvy_leg_rec.trip_name;
2829: l_dleg_action_out_rec.x_delivery_id := l_child_deliveries_tab(child);
2830: l_dleg_action_out_rec.result_id_tab.delete;
2831:
2832: wsh_delivery_legs_grp.Delivery_Leg_Action(
2833: p_api_version_number => 1.0,
2834: p_init_msg_list => FND_API.G_FALSE,
2835: p_commit => FND_API.G_FALSE,
2836: p_rec_attr_tab => l_dleg_tab,
6582: SELECT dg.pick_up_stop_id,
6583: pu_stop.status_code pu_status,
6584: dg.drop_off_stop_id,
6585: do_stop.status_code do_status
6586: FROM wsh_delivery_legs dg,
6587: wsh_trip_stops pu_stop,
6588: wsh_trip_stops do_stop
6589: WHERE dg.delivery_id = p_delivery_id
6590: AND pu_stop.stop_id = dg.pick_up_stop_id