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 2194: from wsh_delivery_legs wdl, wsh_trip_stops wts

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

Line 2246: wsh_delivery_legs dlg,

2242: -- frontport bug 4310141 / Bug 4103142 - to get first trip for delivery
2243: CURSOR c_first_ship_method (p_delivery_id IN number)IS
2244: SELECT wt.ship_method_code
2245: FROM wsh_new_deliveries del,
2246: wsh_delivery_legs dlg,
2247: wsh_trip_stops st,
2248: wsh_trips wt
2249: WHERE del.delivery_id = dlg.delivery_id
2250: AND dlg.pick_up_stop_id = st.stop_id

Line 2549: FROM wsh_delivery_legs l1, wsh_delivery_legs l2

2545: rs.report_set_id = sp.delivery_report_set_id;
2546:
2547: CURSOR del_legs (l_delivery_id NUMBER) IS
2548: SELECT l1.pick_up_stop_id, l1.drop_off_stop_id, l1.delivery_leg_id, l2.delivery_id parent_delivery_id
2549: FROM wsh_delivery_legs l1, wsh_delivery_legs l2
2550: WHERE l1.delivery_id = l_delivery_id
2551: AND l1.parent_delivery_leg_id = l2.delivery_leg_id(+);
2552:
2553:

Line 2556: FROM wsh_delivery_legs l1, wsh_delivery_legs l2

2552:
2553:
2554: CURSOR get_consol_del (l_delivery_id NUMBER) IS
2555: SELECT l2.delivery_id parent_delivery_id
2556: FROM wsh_delivery_legs l1, wsh_delivery_legs l2
2557: WHERE l1.delivery_id = l_delivery_id
2558: AND l1.parent_delivery_leg_id = l2.delivery_leg_id;
2559:
2560:

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

2613: SELECT wt.trip_id , wt.carrier_id, wt.ship_method_code, wt.mode_of_transport,
2614: --OTM R12
2615: wt.tp_plan_name
2616: --
2617: FROM wsh_delivery_legs wdl, wsh_trip_stops wts, wsh_trips wt
2618: WHERE wdl.pick_up_stop_id=wts.stop_id
2619: AND wdl.delivery_id=v_del_id
2620: AND wts.trip_id=wt.trip_id;
2621:

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

2657:
2658:
2659: CURSOR Get_Del_First_Trip(v_del_id NUMBER) IS
2660: SELECT wts.trip_id
2661: FROM wsh_delivery_legs wdl, wsh_trip_stops wts, wsh_new_deliveries wnd
2662: WHERE wdl.pick_up_stop_id=wts.stop_id
2663: AND wnd.initial_pickup_location_id = wts.stop_location_id
2664: AND wnd.delivery_id = wdl.delivery_id
2665: AND wnd.delivery_id=v_del_id;

Line 2703: from wsh_delivery_legs

2699: CURSOR c_delv_trip_id_cursor( t_delivery_id NUMBER ) IS
2700: select distinct trip_id from wsh_trip_stops
2701: where stop_id in
2702: ( select distinct pick_up_stop_id
2703: from wsh_delivery_legs
2704: where delivery_id = t_delivery_id );
2705:
2706:
2707: l_batch_id WSH_NEW_DELIVERIES.batch_id%TYPE;

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

6322: END IF;
6323: END IF;
6324: END IF;
6325: IF l_debug_on THEN
6326: WSH_DEBUG_SV.logmsg(l_module_name,'Calling program unit WSH_DELIVERY_LEGS_PVT.DELETE_DELIVERY_LEG',WSH_DEBUG_SV.C_PROC_LEVEL);
6327: END IF;
6328: wsh_delivery_legs_pvt.delete_delivery_leg
6329: (NULL, dg.delivery_leg_id, l_return_status);
6330: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN

Line 6328: wsh_delivery_legs_pvt.delete_delivery_leg

6324: END IF;
6325: IF l_debug_on THEN
6326: WSH_DEBUG_SV.logmsg(l_module_name,'Calling program unit WSH_DELIVERY_LEGS_PVT.DELETE_DELIVERY_LEG',WSH_DEBUG_SV.C_PROC_LEVEL);
6327: END IF;
6328: wsh_delivery_legs_pvt.delete_delivery_leg
6329: (NULL, dg.delivery_leg_id, l_return_status);
6330: IF (l_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
6331: --Bug 2108310
6332: IF (l_return_status = WSH_UTIL_CORE.G_RET_STS_WARNING) THEN

Line 7736: FROM wsh_delivery_legs wdl,

7732: --{
7733: CURSOR delivery_stops_csr (p_delivery_id NUMBER)
7734: IS
7735: SELECT stop_id
7736: FROM wsh_delivery_legs wdl,
7737: wsh_Trip_stops wts
7738: WHERE wdl.delivery_id = p_delivery_id
7739: AND (
7740: wdl.pick_up_stop_id = wts.stop_id

Line 8044: FROM wsh_delivery_legs dg,

8040: SELECT dg.pick_up_stop_id,
8041: pu_stop.status_code pu_status,
8042: dg.drop_off_stop_id,
8043: do_stop.status_code do_status
8044: FROM wsh_delivery_legs dg,
8045: wsh_trip_stops pu_stop,
8046: wsh_trip_stops do_stop
8047: WHERE dg.delivery_id = l_delivery_id
8048: AND pu_stop.stop_id = dg.pick_up_stop_id

Line 8433: from wsh_delivery_legs l1, wsh_delivery_legs l2

8429: d1.last_update_login = l_login_id
8430: where d1.status_code = 'CO'
8431: and exists (
8432: select 'X'
8433: from wsh_delivery_legs l1, wsh_delivery_legs l2
8434: where l2.delivery_id = p_del_rows(i)
8435: and l2.parent_delivery_leg_id = l1.delivery_leg_id
8436: and l1.delivery_id = d1.delivery_id);
8437: END IF;

Line 8589: FROM wsh_delivery_legs

8585: WHERE delivery_id = p_delivery_id;
8586:
8587: CURSOR count_legs IS
8588: SELECT count(*)
8589: FROM wsh_delivery_legs
8590: WHERE delivery_id = p_delivery_id;
8591:
8592: CURSOR pickup_delivery_legs(l_pickup_location_id IN NUMBER) IS
8593: SELECT dg.delivery_leg_id leg_id,

Line 8596: FROM wsh_delivery_legs dg,

8592: CURSOR pickup_delivery_legs(l_pickup_location_id IN NUMBER) IS
8593: SELECT dg.delivery_leg_id leg_id,
8594: st1.stop_location_id pickup,
8595: st2.stop_location_id dropoff
8596: FROM wsh_delivery_legs dg,
8597: wsh_trip_stops st1,
8598: wsh_trip_stops st2
8599: WHERE dg.delivery_id = p_delivery_id AND
8600: st1.stop_id = dg.pick_up_stop_id AND

Line 8606: FROM wsh_delivery_legs dg,

8602: st1.stop_location_id = l_pickup_location_id;
8603:
8604: CURSOR dropoff_delivery_legs(l_pickup_location_id IN NUMBER) IS
8605: SELECT count(*)
8606: FROM wsh_delivery_legs dg,
8607: wsh_trip_stops st1,
8608: wsh_trip_stops st2
8609: WHERE dg.delivery_id = p_delivery_id AND
8610: st1.stop_id = dg.pick_up_stop_id AND

Line 8703: UPDATE wsh_delivery_legs

8699: IF (l_leg_id IS NOT NULL) THEN
8700: l_seq_num := l_seq_num + 1;
8701:
8702: IF p_update_flag = 'Y' THEN
8703: UPDATE wsh_delivery_legs
8704: SET sequence_number = l_seq_num * 10
8705: WHERE delivery_leg_id = l_leg_id;
8706:
8707: IF (SQL%NOTFOUND) THEN

Line 9805: FROM wsh_delivery_legs wdl,

9801: --
9802: CURSOR stop_csr(p_delivery_id IN NUMBER, p_location_id IN NUMBER)
9803: IS
9804: SELECT stop_id
9805: FROM wsh_delivery_legs wdl,
9806: wsh_trip_stops wts
9807: WHERE wdl.delivery_id = p_delivery_id
9808: AND wdl.pick_up_stop_id = wts.stop_id
9809: AND wts.stop_location_id = p_location_id;

Line 9820: FROM wsh_delivery_legs wdl,

9816: --
9817: CURSOR pickup_dlvy_csr (p_delivery_id IN NUMBER,p_stop_id IN NUMBER)
9818: IS
9819: SELECT wnd.delivery_id, wnd.name
9820: FROM wsh_delivery_legs wdl,
9821: wsh_new_deliveries wnd
9822: WHERE pick_up_stop_id = p_stop_id
9823: AND wdl.delivery_id <> p_delivery_id
9824: AND wdl.delivery_id = wnd.delivery_id;

Line 10174: -- wsh_delivery_legs and wsh_trip_stops

10170: -- First row found is enough
10171:
10172: -- bug 4891897, sql 15038247
10173: -- 1) wsh_delivery_trips_v is replaced with the join of
10174: -- wsh_delivery_legs and wsh_trip_stops
10175: -- 2) query is flattened instead of using the subquery for lower sharable memory
10176:
10177: CURSOR Check_Last_Trip (l_delivery_id NUMBER) IS
10178: SELECT s1.trip_id

Line 10180: wsh_delivery_legs dl1,

10176:
10177: CURSOR Check_Last_Trip (l_delivery_id NUMBER) IS
10178: SELECT s1.trip_id
10179: FROM wsh_trip_stops s1,
10180: wsh_delivery_legs dl1,
10181: wsh_new_deliveries d1,
10182: wsh_trip_stops s2,
10183: wsh_delivery_legs dl2
10184: WHERE d1.delivery_id <> l_delivery_id

Line 10183: wsh_delivery_legs dl2

10179: FROM wsh_trip_stops s1,
10180: wsh_delivery_legs dl1,
10181: wsh_new_deliveries d1,
10182: wsh_trip_stops s2,
10183: wsh_delivery_legs dl2
10184: WHERE d1.delivery_id <> l_delivery_id
10185: AND s1.stop_id = dl1.pick_up_stop_id
10186: AND d1.delivery_id = dl1.delivery_id
10187: AND d1.status_code = 'OP'

Line 10280: FROM wsh_delivery_legs

10276: l_lane_id NUMBER;
10277:
10278: CURSOR check_many_trips(x_delivery_id NUMBER) IS
10279: SELECT count(delivery_leg_id), min(delivery_leg_id)
10280: FROM wsh_delivery_legs
10281: WHERE delivery_id = x_delivery_id;
10282:
10283: CURSOR check_shared_trip(x_delivery_leg_id NUMBER) IS
10284: SELECT count(s.trip_id ), min(s.trip_id)

Line 10285: FROM wsh_delivery_legs d, wsh_trip_stops s

10281: WHERE delivery_id = x_delivery_id;
10282:
10283: CURSOR check_shared_trip(x_delivery_leg_id NUMBER) IS
10284: SELECT count(s.trip_id ), min(s.trip_id)
10285: FROM wsh_delivery_legs d, wsh_trip_stops s
10286: WHERE d.pick_up_stop_id = s.stop_id
10287: AND s.trip_id = (SELECT s1.trip_id
10288: FROM wsh_trip_stops s1, wsh_delivery_legs d1
10289: WHERE d1.delivery_leg_id = x_delivery_leg_id

Line 10288: FROM wsh_trip_stops s1, wsh_delivery_legs d1

10284: SELECT count(s.trip_id ), min(s.trip_id)
10285: FROM wsh_delivery_legs d, wsh_trip_stops s
10286: WHERE d.pick_up_stop_id = s.stop_id
10287: AND s.trip_id = (SELECT s1.trip_id
10288: FROM wsh_trip_stops s1, wsh_delivery_legs d1
10289: WHERE d1.delivery_leg_id = x_delivery_leg_id
10290: AND s1.stop_id = d1.pick_up_stop_id);
10291:
10292: -- Hiding project

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

10293: -- count('CONSOLIDATION') should be 1
10294:
10295: CURSOR check_shared_trip_consol(x_delivery_leg_id NUMBER) IS
10296: SELECT count(*), min(s.trip_id)
10297: FROM wsh_new_deliveries n, wsh_delivery_legs d, wsh_trip_stops s
10298: WHERE n.delivery_id = d.delivery_id
10299: AND d.pick_up_stop_id = s.stop_id
10300: AND s.trip_id = (SELECT s1.trip_id
10301: FROM wsh_trip_stops s1, wsh_delivery_legs d1

Line 10301: FROM wsh_trip_stops s1, wsh_delivery_legs d1

10297: FROM wsh_new_deliveries n, wsh_delivery_legs d, wsh_trip_stops s
10298: WHERE n.delivery_id = d.delivery_id
10299: AND d.pick_up_stop_id = s.stop_id
10300: AND s.trip_id = (SELECT s1.trip_id
10301: FROM wsh_trip_stops s1, wsh_delivery_legs d1
10302: WHERE d1.delivery_leg_id = x_delivery_leg_id
10303: AND s1.stop_id = d1.pick_up_stop_id)
10304: AND d.parent_delivery_leg_id IS NULL;
10305:

Line 10433: should always use wsh_delivery_legs instead of wsh_delivery_assignments.

10429: IS
10430:
10431: /*
10432: When we query for a parent delivery of a delivery we
10433: should always use wsh_delivery_legs instead of wsh_delivery_assignments.
10434: If the child delivery does not have any lines attached to it,
10435: it will not have record in wda, whereas a console delivery and
10436: its children will always have a trip, and a record in wdl.
10437: */

Line 10441: from wsh_delivery_legs pleg,

10437: */
10438:
10439: CURSOR c_get_console_delivery (c_delivery_id IN NUMBER) IS
10440: select pleg.delivery_id
10441: from wsh_delivery_legs pleg,
10442: wsh_delivery_legs cleg
10443: where pleg.delivery_leg_id = cleg.parent_delivery_leg_id
10444: and cleg.delivery_id = c_delivery_id;
10445:

Line 10442: wsh_delivery_legs cleg

10438:
10439: CURSOR c_get_console_delivery (c_delivery_id IN NUMBER) IS
10440: select pleg.delivery_id
10441: from wsh_delivery_legs pleg,
10442: wsh_delivery_legs cleg
10443: where pleg.delivery_leg_id = cleg.parent_delivery_leg_id
10444: and cleg.delivery_id = c_delivery_id;
10445:
10446: l_delivery_id NUMBER;

Line 11619: wsh_delivery_legs wdl,

11615: CURSOR check_del_assigned(p_del_id IN NUMBER) IS
11616: select wts.trip_id,
11617: wt.rank_id
11618: from wsh_trip_stops wts,
11619: wsh_delivery_legs wdl,
11620: wsh_trips wt
11621: where wdl.delivery_id = p_del_id
11622: and wts.stop_id = wdl.pick_up_stop_id
11623: and wts.trip_id = wt.trip_id;

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

12787: s1.planned_arrival_date pu_ar_date,
12788: s1.planned_departure_date pu_dep_date,
12789: s2.planned_arrival_date do_ar_date,
12790: s2.planned_departure_date do_dep_date
12791: from wsh_trip_stops s1, wsh_trip_stops s2, wsh_delivery_legs l, wsh_new_deliveries d, wsh_trips t
12792: where s1.stop_id = l.pick_up_stop_id
12793: and s2.stop_id = l.drop_off_stop_id
12794: and l.delivery_id = d.delivery_id
12795: and d.delivery_id = p_parent_del_id

Line 12809: and not exists (select 1 from wsh_delivery_legs

12805: from wsh_new_deliveries d
12806: where d.delivery_id = p_delivery_id
12807: and d.status_code = 'OP'
12808: and d.delivery_type = 'STANDARD'
12809: and not exists (select 1 from wsh_delivery_legs
12810: where parent_delivery_leg_id is not null
12811: and delivery_id = d.delivery_id);
12812: -- check if the delivery is assigned to a trip
12813: /*cursor c_check_trips(p_delivery_id in number) is

Line 12815: from wsh_delivery_legs

12811: and delivery_id = d.delivery_id);
12812: -- check if the delivery is assigned to a trip
12813: /*cursor c_check_trips(p_delivery_id in number) is
12814: select delivery_leg_id
12815: from wsh_delivery_legs
12816: where delivery_id = p_delivery_id
12817: and rownum = 1;
12818: */
12819: -- check if the trip the delivery is assigned to is valid

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

12818: */
12819: -- check if the trip the delivery is assigned to is valid
12820: cursor c_check_trips(p_delivery_id in number) is
12821: select l.delivery_leg_id, s1.trip_id
12822: from wsh_delivery_legs l, wsh_trip_stops s1, wsh_new_deliveries d
12823: where l.delivery_id = p_delivery_id
12824: and d.delivery_id = l.delivery_id
12825: and d.initial_pickup_location_id = s1.stop_location_id
12826: and s1.stop_id = l.pick_up_stop_id;

Line 12855: wsh_delivery_legs l1, wsh_delivery_legs l2

12851:
12852: cursor c_get_trip_siblings(p_trip_id in number) is
12853: select distinct s2.trip_id
12854: from wsh_trip_stops s1, wsh_trip_stops s2,
12855: wsh_delivery_legs l1, wsh_delivery_legs l2
12856: where s1.trip_id = p_trip_id
12857: and s1.stop_id = l1.pick_up_stop_id
12858: and l1.delivery_id = l2.delivery_id
12859: and l2.pick_up_stop_id = s2.stop_id;

Line 12864: from wsh_trip_stops s, wsh_delivery_legs l

12860:
12861:
12862: cursor c_chil_del_trips(p_delivery_id in number) is
12863: select s.trip_id
12864: from wsh_trip_stops s, wsh_delivery_legs l
12865: where l.delivery_id = p_delivery_id
12866: and l.pick_up_stop_id = s.stop_id;
12867:
12868: l_parent_trip_id NUMBER;

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

13291:
13292: BEGIN
13293:
13294: FOR i in 1..l_valid_children_tab.count LOOP
13295: WSH_DELIVERY_LEGS_PVT.lock_dlvy_leg_no_compare(p_delivery_id => l_valid_children_tab(i));
13296: END LOOP;
13297:
13298: EXCEPTION
13299: WHEN OTHERS THEN

Line 13316: update wsh_delivery_legs

13312: --
13313: END;
13314: -- Assign child delivery legs to parent
13315: FORALL i in 1..l_valid_children_tab.count
13316: update wsh_delivery_legs
13317: set parent_delivery_leg_id = l_parent_trip_rec.delivery_leg_id
13318: where delivery_id = l_valid_children_tab(i)
13319: and pick_up_stop_id = l_parent_trip_rec.pick_up_stop_id;
13320:

Line 13348: WSH_DELIVERY_LEGS_ACTIONS.Mark_Reprice_Required(

13344: );
13345: END IF;
13346:
13347: l_parent_del_tab(1) := p_parent_del_id;
13348: WSH_DELIVERY_LEGS_ACTIONS.Mark_Reprice_Required(
13349: p_entity_type => 'DELIVERY',
13350: p_entity_ids => l_parent_del_tab,
13351: x_return_status => l_return_status);
13352:

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

13604: x_return_status OUT NOCOPY VARCHAR2) IS
13605:
13606: CURSOR c_check_parent_exists(p_child_delivery_id in number, p_parent_delivery_id in number) IS
13607: select l1.delivery_id, l2.delivery_id, l1.delivery_leg_id, s.trip_id
13608: from wsh_delivery_legs l1, wsh_delivery_legs l2, wsh_new_deliveries d, wsh_trip_stops s
13609: where l1.parent_delivery_leg_id = l2.delivery_leg_id
13610: and l1.delivery_id = p_child_delivery_id
13611: and l2.delivery_id = NVL(p_parent_delivery_id, l2.delivery_id)
13612: and d.delivery_id = l1.delivery_id

Line 13619: from wsh_delivery_legs l1, wsh_delivery_legs l2

13615: order by s.trip_id, l2.delivery_id;
13616:
13617: cursor c_check_children_exists(p_parent_delivery_id in number) is
13618: select l1.delivery_id
13619: from wsh_delivery_legs l1, wsh_delivery_legs l2
13620: where l1.parent_delivery_leg_id = l2.delivery_leg_id
13621: and l2.delivery_id = p_parent_delivery_id
13622: and rownum = 1;
13623:

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

13622: and rownum = 1;
13623:
13624: CURSOR c_get_children(p_parent_delivery_id IN NUMBER) is
13625: select l1.delivery_id, l1.delivery_leg_id, s.trip_id
13626: from wsh_delivery_legs l1, wsh_delivery_legs l2, wsh_new_deliveries d, wsh_trip_stops s
13627: where l1.parent_delivery_leg_id = l2.delivery_leg_id
13628: and l2.delivery_id = p_parent_delivery_id
13629: and d.delivery_id = l1.delivery_id
13630: and d.status_code = 'OP'

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

13853: BEGIN
13854:
13855: FOR i in 1..l_child_legs_tab.count LOOP
13856:
13857: WSH_DELIVERY_LEGS_PVT.lock_dlvy_leg_no_compare(p_dlvy_leg_id => l_child_legs_tab(i));
13858:
13859: END LOOP;
13860:
13861: EXCEPTION

Line 13879: update wsh_delivery_legs

13875: --
13876: END;
13877:
13878: FORALL i in 1..l_child_legs_tab.count
13879: update wsh_delivery_legs
13880: set parent_delivery_leg_id = NULL
13881: where delivery_leg_id = l_child_legs_tab(i);
13882:
13883:

Line 13965: WSH_DELIVERY_LEGS_ACTIONS.Mark_Reprice_Required(

13961: );
13962:
13963: END LOOP;
13964:
13965: WSH_DELIVERY_LEGS_ACTIONS.Mark_Reprice_Required(
13966: p_entity_type => 'DELIVERY',
13967: p_entity_ids => l_remaining_parent_dels,
13968: x_return_status => l_return_status);
13969:

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

14071: x_return_status OUT NOCOPY VARCHAR2) IS
14072:
14073: cursor c_check_close_consol(p_del_id IN NUMBER) IS
14074: select d.delivery_id
14075: from wsh_delivery_legs l1, wsh_delivery_legs l2, wsh_new_deliveries d
14076: where l1.parent_delivery_leg_id = l2.delivery_leg_id
14077: and l2.delivery_id = p_del_id
14078: and l1.delivery_id = d.delivery_id
14079: and d.status_code = 'OP'

Line 14358: wsh_delivery_legs child_leg,

14354: child.mode_of_transport,
14355: child.ignore_for_planning
14356: FROM wsh_new_deliveries child,
14357: wsh_new_deliveries parent,
14358: wsh_delivery_legs child_leg,
14359: wsh_delivery_legs parent_leg,
14360: wsh_trip_stops stop
14361: WHERE child_leg.delivery_id = p_delivery_id
14362: AND child_leg.parent_delivery_leg_id = parent_leg.delivery_leg_id

Line 14359: wsh_delivery_legs parent_leg,

14355: child.ignore_for_planning
14356: FROM wsh_new_deliveries child,
14357: wsh_new_deliveries parent,
14358: wsh_delivery_legs child_leg,
14359: wsh_delivery_legs parent_leg,
14360: wsh_trip_stops stop
14361: WHERE child_leg.delivery_id = p_delivery_id
14362: AND child_leg.parent_delivery_leg_id = parent_leg.delivery_leg_id
14363: AND child_leg.delivery_id = child.delivery_id

Line 14370: FROM wsh_delivery_legs leg,

14366: AND child.ultimate_dropoff_location_id <> parent.ultimate_dropoff_location_id;
14367:
14368: CURSOR c_second_leg(p_delivery_id IN NUMBER) IS
14369: SELECT stop.trip_id
14370: FROM wsh_delivery_legs leg,
14371: wsh_trip_stops stop
14372: WHERE leg.parent_delivery_leg_id IS NULL
14373: AND leg.delivery_id = p_delivery_id
14374: AND leg.pick_up_stop_id = stop.stop_id;