DBA Data[Home] [Help]

APPS.WSH_NEW_DELIVERY_ACTIONS dependencies on WSH_DELIVERY_LEGS

Line 1746: wsh_delivery_legs dg,

1742: t.ship_method_code,
1743: dl.organization_id,
1744: t.name
1745: FROM wsh_new_deliveries dl,
1746: wsh_delivery_legs dg,
1747: wsh_trip_stops st,
1748: wsh_trips t
1749: WHERE dl.delivery_id = p_delivery_id AND
1750: dl.delivery_id = dg.delivery_id AND

Line 1882: 'WSH_DELIVERY_LEGS',

1878: NULL,
1879: x_return_status,
1880: x_msg_count,
1881: x_msg_data,
1882: 'WSH_DELIVERY_LEGS',
1883: l_delivery_leg_id,
1884: 665,
1885: l_pickup_location_id,
1886: 'BOL',

Line 2195: from wsh_delivery_legs wdl, wsh_trip_stops wts

2191: WHERE rs.report_set_id = p_report_set_id;
2192:
2193: CURSOR Check_Trip (l_delivery_id NUMBER) IS
2194: select wts.trip_id
2195: from wsh_delivery_legs wdl, wsh_trip_stops wts
2196: where wdl.pick_up_stop_id=wts.stop_id
2197: and wdl.delivery_id=l_delivery_id
2198: and rownum=1;
2199:

Line 2255: wsh_delivery_legs dlg,

2251: -- frontport bug 4310141 / Bug 4103142 - to get first trip for delivery
2252: CURSOR c_first_ship_method (p_delivery_id IN number)IS
2253: SELECT wt.ship_method_code
2254: FROM wsh_new_deliveries del,
2255: wsh_delivery_legs dlg,
2256: wsh_trip_stops st,
2257: wsh_trips wt
2258: WHERE del.delivery_id = dlg.delivery_id
2259: AND dlg.pick_up_stop_id = st.stop_id

Line 2580: FROM wsh_delivery_legs l1, wsh_delivery_legs l2

2576: rs.report_set_id = sp.delivery_report_set_id;
2577:
2578: CURSOR del_legs (l_delivery_id NUMBER) IS
2579: SELECT l1.pick_up_stop_id, l1.drop_off_stop_id, l1.delivery_leg_id, l2.delivery_id parent_delivery_id
2580: FROM wsh_delivery_legs l1, wsh_delivery_legs l2
2581: WHERE l1.delivery_id = l_delivery_id
2582: AND l1.parent_delivery_leg_id = l2.delivery_leg_id(+);
2583:
2584:

Line 2587: FROM wsh_delivery_legs l1, wsh_delivery_legs l2

2583:
2584:
2585: CURSOR get_consol_del (l_delivery_id NUMBER) IS
2586: SELECT l2.delivery_id parent_delivery_id
2587: FROM wsh_delivery_legs l1, wsh_delivery_legs l2
2588: WHERE l1.delivery_id = l_delivery_id
2589: AND l1.parent_delivery_leg_id = l2.delivery_leg_id;
2590:
2591:

Line 2650: FROM wsh_delivery_legs wdl, wsh_trip_stops wts, wsh_trips wt

2646: SELECT wt.trip_id , wt.carrier_id, wt.ship_method_code, wt.mode_of_transport,
2647: --OTM R12
2648: wt.tp_plan_name
2649: --
2650: FROM wsh_delivery_legs wdl, wsh_trip_stops wts, wsh_trips wt
2651: WHERE wdl.pick_up_stop_id=wts.stop_id
2652: AND wdl.delivery_id=v_del_id
2653: AND wts.trip_id=wt.trip_id;
2654:

Line 2694: FROM wsh_delivery_legs wdl, wsh_trip_stops wts, wsh_new_deliveries wnd

2690:
2691:
2692: CURSOR Get_Del_First_Trip(v_del_id NUMBER) IS
2693: SELECT wts.trip_id
2694: FROM wsh_delivery_legs wdl, wsh_trip_stops wts, wsh_new_deliveries wnd
2695: WHERE wdl.pick_up_stop_id=wts.stop_id
2696: AND wnd.initial_pickup_location_id = wts.stop_location_id
2697: AND wnd.delivery_id = wdl.delivery_id
2698: AND wnd.delivery_id=v_del_id;

Line 2736: from wsh_delivery_legs

2732: CURSOR c_delv_trip_id_cursor( t_delivery_id NUMBER ) IS
2733: select distinct trip_id from wsh_trip_stops
2734: where stop_id in
2735: ( select distinct pick_up_stop_id
2736: from wsh_delivery_legs
2737: where delivery_id = t_delivery_id );
2738:
2739:
2740: l_batch_id WSH_NEW_DELIVERIES.batch_id%TYPE;

Line 6466: WSH_DEBUG_SV.logmsg(l_module_name,'Calling program unit WSH_DELIVERY_LEGS_PVT.DELETE_DELIVERY_LEG',WSH_DEBUG_SV.C_PROC_LEVEL);

6462: END IF;
6463: END IF;
6464: END IF;
6465: IF l_debug_on THEN
6466: WSH_DEBUG_SV.logmsg(l_module_name,'Calling program unit WSH_DELIVERY_LEGS_PVT.DELETE_DELIVERY_LEG',WSH_DEBUG_SV.C_PROC_LEVEL);
6467: END IF;
6468: wsh_delivery_legs_pvt.delete_delivery_leg
6469: (NULL, dg.delivery_leg_id, l_return_status);
6470: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN

Line 6468: wsh_delivery_legs_pvt.delete_delivery_leg

6464: END IF;
6465: IF l_debug_on THEN
6466: WSH_DEBUG_SV.logmsg(l_module_name,'Calling program unit WSH_DELIVERY_LEGS_PVT.DELETE_DELIVERY_LEG',WSH_DEBUG_SV.C_PROC_LEVEL);
6467: END IF;
6468: wsh_delivery_legs_pvt.delete_delivery_leg
6469: (NULL, dg.delivery_leg_id, l_return_status);
6470: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
6471: --Bug 2108310
6472: IF (l_return_status = WSH_UTIL_CORE.G_RET_STS_WARNING) THEN

Line 7932: FROM wsh_delivery_legs wdl,

7928: --{
7929: CURSOR delivery_stops_csr (p_delivery_id NUMBER)
7930: IS
7931: SELECT stop_id
7932: FROM wsh_delivery_legs wdl,
7933: wsh_Trip_stops wts
7934: WHERE wdl.delivery_id = p_delivery_id
7935: AND (
7936: wdl.pick_up_stop_id = wts.stop_id

Line 8240: FROM wsh_delivery_legs dg,

8236: SELECT dg.pick_up_stop_id,
8237: pu_stop.status_code pu_status,
8238: dg.drop_off_stop_id,
8239: do_stop.status_code do_status
8240: FROM wsh_delivery_legs dg,
8241: wsh_trip_stops pu_stop,
8242: wsh_trip_stops do_stop
8243: WHERE dg.delivery_id = l_delivery_id
8244: AND pu_stop.stop_id = dg.pick_up_stop_id

Line 8629: from wsh_delivery_legs l1, wsh_delivery_legs l2

8625: d1.last_update_login = l_login_id
8626: where d1.status_code = 'CO'
8627: and exists (
8628: select 'X'
8629: from wsh_delivery_legs l1, wsh_delivery_legs l2
8630: where l2.delivery_id = p_del_rows(i)
8631: and l2.parent_delivery_leg_id = l1.delivery_leg_id
8632: and l1.delivery_id = d1.delivery_id);
8633: END IF;

Line 8785: FROM wsh_delivery_legs

8781: WHERE delivery_id = p_delivery_id;
8782:
8783: CURSOR count_legs IS
8784: SELECT count(*)
8785: FROM wsh_delivery_legs
8786: WHERE delivery_id = p_delivery_id;
8787:
8788: CURSOR pickup_delivery_legs(l_pickup_location_id IN NUMBER) IS
8789: SELECT dg.delivery_leg_id leg_id,

Line 8792: FROM wsh_delivery_legs dg,

8788: CURSOR pickup_delivery_legs(l_pickup_location_id IN NUMBER) IS
8789: SELECT dg.delivery_leg_id leg_id,
8790: st1.stop_location_id pickup,
8791: st2.stop_location_id dropoff
8792: FROM wsh_delivery_legs dg,
8793: wsh_trip_stops st1,
8794: wsh_trip_stops st2
8795: WHERE dg.delivery_id = p_delivery_id AND
8796: st1.stop_id = dg.pick_up_stop_id AND

Line 8802: FROM wsh_delivery_legs dg,

8798: st1.stop_location_id = l_pickup_location_id;
8799:
8800: CURSOR dropoff_delivery_legs(l_pickup_location_id IN NUMBER) IS
8801: SELECT count(*)
8802: FROM wsh_delivery_legs dg,
8803: wsh_trip_stops st1,
8804: wsh_trip_stops st2
8805: WHERE dg.delivery_id = p_delivery_id AND
8806: st1.stop_id = dg.pick_up_stop_id AND

Line 8899: UPDATE wsh_delivery_legs

8895: IF (l_leg_id IS NOT NULL) THEN
8896: l_seq_num := l_seq_num + 1;
8897:
8898: IF p_update_flag = 'Y' THEN
8899: UPDATE wsh_delivery_legs
8900: SET sequence_number = l_seq_num * 10
8901: WHERE delivery_leg_id = l_leg_id;
8902:
8903: IF (SQL%NOTFOUND) THEN

Line 10001: FROM wsh_delivery_legs wdl,

9997: --
9998: CURSOR stop_csr(p_delivery_id IN NUMBER, p_location_id IN NUMBER)
9999: IS
10000: SELECT stop_id
10001: FROM wsh_delivery_legs wdl,
10002: wsh_trip_stops wts
10003: WHERE wdl.delivery_id = p_delivery_id
10004: AND wdl.pick_up_stop_id = wts.stop_id
10005: AND wts.stop_location_id = p_location_id;

Line 10016: FROM wsh_delivery_legs wdl,

10012: --
10013: CURSOR pickup_dlvy_csr (p_delivery_id IN NUMBER,p_stop_id IN NUMBER)
10014: IS
10015: SELECT wnd.delivery_id, wnd.name
10016: FROM wsh_delivery_legs wdl,
10017: wsh_new_deliveries wnd
10018: WHERE pick_up_stop_id = p_stop_id
10019: AND wdl.delivery_id <> p_delivery_id
10020: AND wdl.delivery_id = wnd.delivery_id;

Line 10370: -- wsh_delivery_legs and wsh_trip_stops

10366: -- First row found is enough
10367:
10368: -- bug 4891897, sql 15038247
10369: -- 1) wsh_delivery_trips_v is replaced with the join of
10370: -- wsh_delivery_legs and wsh_trip_stops
10371: -- 2) query is flattened instead of using the subquery for lower sharable memory
10372:
10373: CURSOR Check_Last_Trip (l_delivery_id NUMBER) IS
10374: SELECT s1.trip_id

Line 10376: wsh_delivery_legs dl1,

10372:
10373: CURSOR Check_Last_Trip (l_delivery_id NUMBER) IS
10374: SELECT s1.trip_id
10375: FROM wsh_trip_stops s1,
10376: wsh_delivery_legs dl1,
10377: wsh_new_deliveries d1,
10378: wsh_trip_stops s2,
10379: wsh_delivery_legs dl2
10380: WHERE d1.delivery_id <> l_delivery_id

Line 10379: wsh_delivery_legs dl2

10375: FROM wsh_trip_stops s1,
10376: wsh_delivery_legs dl1,
10377: wsh_new_deliveries d1,
10378: wsh_trip_stops s2,
10379: wsh_delivery_legs dl2
10380: WHERE d1.delivery_id <> l_delivery_id
10381: AND s1.stop_id = dl1.pick_up_stop_id
10382: AND d1.delivery_id = dl1.delivery_id
10383: AND d1.status_code = 'OP'

Line 10476: FROM wsh_delivery_legs

10472: l_lane_id NUMBER;
10473:
10474: CURSOR check_many_trips(x_delivery_id NUMBER) IS
10475: SELECT count(delivery_leg_id), min(delivery_leg_id)
10476: FROM wsh_delivery_legs
10477: WHERE delivery_id = x_delivery_id;
10478:
10479: CURSOR check_shared_trip(x_delivery_leg_id NUMBER) IS
10480: SELECT count(s.trip_id ), min(s.trip_id)

Line 10481: FROM wsh_delivery_legs d, wsh_trip_stops s

10477: WHERE delivery_id = x_delivery_id;
10478:
10479: CURSOR check_shared_trip(x_delivery_leg_id NUMBER) IS
10480: SELECT count(s.trip_id ), min(s.trip_id)
10481: FROM wsh_delivery_legs d, wsh_trip_stops s
10482: WHERE d.pick_up_stop_id = s.stop_id
10483: AND s.trip_id = (SELECT s1.trip_id
10484: FROM wsh_trip_stops s1, wsh_delivery_legs d1
10485: WHERE d1.delivery_leg_id = x_delivery_leg_id

Line 10484: FROM wsh_trip_stops s1, wsh_delivery_legs d1

10480: SELECT count(s.trip_id ), min(s.trip_id)
10481: FROM wsh_delivery_legs d, wsh_trip_stops s
10482: WHERE d.pick_up_stop_id = s.stop_id
10483: AND s.trip_id = (SELECT s1.trip_id
10484: FROM wsh_trip_stops s1, wsh_delivery_legs d1
10485: WHERE d1.delivery_leg_id = x_delivery_leg_id
10486: AND s1.stop_id = d1.pick_up_stop_id);
10487:
10488: -- Hiding project

Line 10493: FROM wsh_new_deliveries n, wsh_delivery_legs d, wsh_trip_stops s

10489: -- count('CONSOLIDATION') should be 1
10490:
10491: CURSOR check_shared_trip_consol(x_delivery_leg_id NUMBER) IS
10492: SELECT count(*), min(s.trip_id)
10493: FROM wsh_new_deliveries n, wsh_delivery_legs d, wsh_trip_stops s
10494: WHERE n.delivery_id = d.delivery_id
10495: AND d.pick_up_stop_id = s.stop_id
10496: AND s.trip_id = (SELECT s1.trip_id
10497: FROM wsh_trip_stops s1, wsh_delivery_legs d1

Line 10497: FROM wsh_trip_stops s1, wsh_delivery_legs d1

10493: FROM wsh_new_deliveries n, wsh_delivery_legs d, wsh_trip_stops s
10494: WHERE n.delivery_id = d.delivery_id
10495: AND d.pick_up_stop_id = s.stop_id
10496: AND s.trip_id = (SELECT s1.trip_id
10497: FROM wsh_trip_stops s1, wsh_delivery_legs d1
10498: WHERE d1.delivery_leg_id = x_delivery_leg_id
10499: AND s1.stop_id = d1.pick_up_stop_id)
10500: AND d.parent_delivery_leg_id IS NULL;
10501:

Line 10629: should always use wsh_delivery_legs instead of wsh_delivery_assignments.

10625: IS
10626:
10627: /*
10628: When we query for a parent delivery of a delivery we
10629: should always use wsh_delivery_legs instead of wsh_delivery_assignments.
10630: If the child delivery does not have any lines attached to it,
10631: it will not have record in wda, whereas a console delivery and
10632: its children will always have a trip, and a record in wdl.
10633: */

Line 10637: from wsh_delivery_legs pleg,

10633: */
10634:
10635: CURSOR c_get_console_delivery (c_delivery_id IN NUMBER) IS
10636: select pleg.delivery_id
10637: from wsh_delivery_legs pleg,
10638: wsh_delivery_legs cleg
10639: where pleg.delivery_leg_id = cleg.parent_delivery_leg_id
10640: and cleg.delivery_id = c_delivery_id;
10641:

Line 10638: wsh_delivery_legs cleg

10634:
10635: CURSOR c_get_console_delivery (c_delivery_id IN NUMBER) IS
10636: select pleg.delivery_id
10637: from wsh_delivery_legs pleg,
10638: wsh_delivery_legs cleg
10639: where pleg.delivery_leg_id = cleg.parent_delivery_leg_id
10640: and cleg.delivery_id = c_delivery_id;
10641:
10642: l_delivery_id NUMBER;

Line 11815: wsh_delivery_legs wdl,

11811: CURSOR check_del_assigned(p_del_id IN NUMBER) IS
11812: select wts.trip_id,
11813: wt.rank_id
11814: from wsh_trip_stops wts,
11815: wsh_delivery_legs wdl,
11816: wsh_trips wt
11817: where wdl.delivery_id = p_del_id
11818: and wts.stop_id = wdl.pick_up_stop_id
11819: and wts.trip_id = wt.trip_id;

Line 12988: from wsh_trip_stops s1, wsh_trip_stops s2, wsh_delivery_legs l, wsh_new_deliveries d, wsh_trips t

12984: s1.planned_arrival_date pu_ar_date,
12985: s1.planned_departure_date pu_dep_date,
12986: s2.planned_arrival_date do_ar_date,
12987: s2.planned_departure_date do_dep_date
12988: from wsh_trip_stops s1, wsh_trip_stops s2, wsh_delivery_legs l, wsh_new_deliveries d, wsh_trips t
12989: where s1.stop_id = l.pick_up_stop_id
12990: and s2.stop_id = l.drop_off_stop_id
12991: and l.delivery_id = d.delivery_id
12992: and d.delivery_id = p_parent_del_id

Line 13006: and not exists (select 1 from wsh_delivery_legs

13002: from wsh_new_deliveries d
13003: where d.delivery_id = p_delivery_id
13004: and d.status_code = 'OP'
13005: and d.delivery_type = 'STANDARD'
13006: and not exists (select 1 from wsh_delivery_legs
13007: where parent_delivery_leg_id is not null
13008: and delivery_id = d.delivery_id);
13009: -- check if the delivery is assigned to a trip
13010: /*cursor c_check_trips(p_delivery_id in number) is

Line 13012: from wsh_delivery_legs

13008: and delivery_id = d.delivery_id);
13009: -- check if the delivery is assigned to a trip
13010: /*cursor c_check_trips(p_delivery_id in number) is
13011: select delivery_leg_id
13012: from wsh_delivery_legs
13013: where delivery_id = p_delivery_id
13014: and rownum = 1;
13015: */
13016: -- check if the trip the delivery is assigned to is valid

Line 13019: from wsh_delivery_legs l, wsh_trip_stops s1, wsh_new_deliveries d

13015: */
13016: -- check if the trip the delivery is assigned to is valid
13017: cursor c_check_trips(p_delivery_id in number) is
13018: select l.delivery_leg_id, s1.trip_id
13019: from wsh_delivery_legs l, wsh_trip_stops s1, wsh_new_deliveries d
13020: where l.delivery_id = p_delivery_id
13021: and d.delivery_id = l.delivery_id
13022: and d.initial_pickup_location_id = s1.stop_location_id
13023: and s1.stop_id = l.pick_up_stop_id;

Line 13052: wsh_delivery_legs l1, wsh_delivery_legs l2

13048:
13049: cursor c_get_trip_siblings(p_trip_id in number) is
13050: select distinct s2.trip_id
13051: from wsh_trip_stops s1, wsh_trip_stops s2,
13052: wsh_delivery_legs l1, wsh_delivery_legs l2
13053: where s1.trip_id = p_trip_id
13054: and s1.stop_id = l1.pick_up_stop_id
13055: and l1.delivery_id = l2.delivery_id
13056: and l2.pick_up_stop_id = s2.stop_id;

Line 13061: from wsh_trip_stops s, wsh_delivery_legs l

13057:
13058:
13059: cursor c_chil_del_trips(p_delivery_id in number) is
13060: select s.trip_id
13061: from wsh_trip_stops s, wsh_delivery_legs l
13062: where l.delivery_id = p_delivery_id
13063: and l.pick_up_stop_id = s.stop_id;
13064:
13065: l_parent_trip_id NUMBER;

Line 13492: WSH_DELIVERY_LEGS_PVT.lock_dlvy_leg_no_compare(p_delivery_id => l_valid_children_tab(i));

13488:
13489: BEGIN
13490:
13491: FOR i in 1..l_valid_children_tab.count LOOP
13492: WSH_DELIVERY_LEGS_PVT.lock_dlvy_leg_no_compare(p_delivery_id => l_valid_children_tab(i));
13493: END LOOP;
13494:
13495: EXCEPTION
13496: WHEN OTHERS THEN

Line 13513: update wsh_delivery_legs

13509: --
13510: END;
13511: -- Assign child delivery legs to parent
13512: FORALL i in 1..l_valid_children_tab.count
13513: update wsh_delivery_legs
13514: set parent_delivery_leg_id = l_parent_trip_rec.delivery_leg_id
13515: where delivery_id = l_valid_children_tab(i)
13516: and pick_up_stop_id = l_parent_trip_rec.pick_up_stop_id;
13517:

Line 13545: WSH_DELIVERY_LEGS_ACTIONS.Mark_Reprice_Required(

13541: );
13542: END IF;
13543:
13544: l_parent_del_tab(1) := p_parent_del_id;
13545: WSH_DELIVERY_LEGS_ACTIONS.Mark_Reprice_Required(
13546: p_entity_type => 'DELIVERY',
13547: p_entity_ids => l_parent_del_tab,
13548: x_return_status => l_return_status);
13549:

Line 13805: from wsh_delivery_legs l1, wsh_delivery_legs l2, wsh_new_deliveries d, wsh_trip_stops s

13801: x_return_status OUT NOCOPY VARCHAR2) IS
13802:
13803: CURSOR c_check_parent_exists(p_child_delivery_id in number, p_parent_delivery_id in number) IS
13804: select l1.delivery_id, l2.delivery_id, l1.delivery_leg_id, s.trip_id
13805: from wsh_delivery_legs l1, wsh_delivery_legs l2, wsh_new_deliveries d, wsh_trip_stops s
13806: where l1.parent_delivery_leg_id = l2.delivery_leg_id
13807: and l1.delivery_id = p_child_delivery_id
13808: and l2.delivery_id = NVL(p_parent_delivery_id, l2.delivery_id)
13809: and d.delivery_id = l1.delivery_id

Line 13816: from wsh_delivery_legs l1, wsh_delivery_legs l2

13812: order by s.trip_id, l2.delivery_id;
13813:
13814: cursor c_check_children_exists(p_parent_delivery_id in number) is
13815: select l1.delivery_id
13816: from wsh_delivery_legs l1, wsh_delivery_legs l2
13817: where l1.parent_delivery_leg_id = l2.delivery_leg_id
13818: and l2.delivery_id = p_parent_delivery_id
13819: and rownum = 1;
13820:

Line 13823: from wsh_delivery_legs l1, wsh_delivery_legs l2, wsh_new_deliveries d, wsh_trip_stops s

13819: and rownum = 1;
13820:
13821: CURSOR c_get_children(p_parent_delivery_id IN NUMBER) is
13822: select l1.delivery_id, l1.delivery_leg_id, s.trip_id
13823: from wsh_delivery_legs l1, wsh_delivery_legs l2, wsh_new_deliveries d, wsh_trip_stops s
13824: where l1.parent_delivery_leg_id = l2.delivery_leg_id
13825: and l2.delivery_id = p_parent_delivery_id
13826: and d.delivery_id = l1.delivery_id
13827: and d.status_code = 'OP'

Line 14054: WSH_DELIVERY_LEGS_PVT.lock_dlvy_leg_no_compare(p_dlvy_leg_id => l_child_legs_tab(i));

14050: BEGIN
14051:
14052: FOR i in 1..l_child_legs_tab.count LOOP
14053:
14054: WSH_DELIVERY_LEGS_PVT.lock_dlvy_leg_no_compare(p_dlvy_leg_id => l_child_legs_tab(i));
14055:
14056: END LOOP;
14057:
14058: EXCEPTION

Line 14076: update wsh_delivery_legs

14072: --
14073: END;
14074:
14075: FORALL i in 1..l_child_legs_tab.count
14076: update wsh_delivery_legs
14077: set parent_delivery_leg_id = NULL
14078: where delivery_leg_id = l_child_legs_tab(i);
14079:
14080:

Line 14162: WSH_DELIVERY_LEGS_ACTIONS.Mark_Reprice_Required(

14158: );
14159:
14160: END LOOP;
14161:
14162: WSH_DELIVERY_LEGS_ACTIONS.Mark_Reprice_Required(
14163: p_entity_type => 'DELIVERY',
14164: p_entity_ids => l_remaining_parent_dels,
14165: x_return_status => l_return_status);
14166:

Line 14272: from wsh_delivery_legs l1, wsh_delivery_legs l2, wsh_new_deliveries d

14268: x_return_status OUT NOCOPY VARCHAR2) IS
14269:
14270: cursor c_check_close_consol(p_del_id IN NUMBER) IS
14271: select d.delivery_id
14272: from wsh_delivery_legs l1, wsh_delivery_legs l2, wsh_new_deliveries d
14273: where l1.parent_delivery_leg_id = l2.delivery_leg_id
14274: and l2.delivery_id = p_del_id
14275: and l1.delivery_id = d.delivery_id
14276: and d.status_code = 'OP'

Line 14555: wsh_delivery_legs child_leg,

14551: child.mode_of_transport,
14552: child.ignore_for_planning
14553: FROM wsh_new_deliveries child,
14554: wsh_new_deliveries parent,
14555: wsh_delivery_legs child_leg,
14556: wsh_delivery_legs parent_leg,
14557: wsh_trip_stops stop
14558: WHERE child_leg.delivery_id = p_delivery_id
14559: AND child_leg.parent_delivery_leg_id = parent_leg.delivery_leg_id

Line 14556: wsh_delivery_legs parent_leg,

14552: child.ignore_for_planning
14553: FROM wsh_new_deliveries child,
14554: wsh_new_deliveries parent,
14555: wsh_delivery_legs child_leg,
14556: wsh_delivery_legs parent_leg,
14557: wsh_trip_stops stop
14558: WHERE child_leg.delivery_id = p_delivery_id
14559: AND child_leg.parent_delivery_leg_id = parent_leg.delivery_leg_id
14560: AND child_leg.delivery_id = child.delivery_id

Line 14567: FROM wsh_delivery_legs leg,

14563: AND child.ultimate_dropoff_location_id <> parent.ultimate_dropoff_location_id;
14564:
14565: CURSOR c_second_leg(p_delivery_id IN NUMBER) IS
14566: SELECT stop.trip_id
14567: FROM wsh_delivery_legs leg,
14568: wsh_trip_stops stop
14569: WHERE leg.parent_delivery_leg_id IS NULL
14570: AND leg.delivery_id = p_delivery_id
14571: AND leg.pick_up_stop_id = stop.stop_id;