DBA Data[Home] [Help]

APPS.MST_WB_UTIL dependencies on MST_DELIVERY_LEGS

Line 258: FROM mst_delivery_legs dl

254: AND dd.delivery_detail_id = da.delivery_detail_id
255: AND dd.plan_id = da.plan_id
256: AND da.delivery_id IN
257: (SELECT dl.delivery_id
258: FROM mst_delivery_legs dl
259: WHERE dl.plan_id = da.plan_id
260: AND dl.trip_id = p_trip_id);*/
261:
262: CURSOR cur_get_trip_orders is

Line 271: FROM mst_delivery_legs dl

267: AND dd.delivery_detail_id = da.delivery_detail_id
268: AND dd.plan_id = da.plan_id
269: AND da.delivery_id IN
270: (SELECT dl.delivery_id
271: FROM mst_delivery_legs dl
272: WHERE dl.plan_id = da.plan_id
273: AND dl.trip_id = p_trip_id)
274: AND da.parent_delivery_detail_id is null;
275:

Line 306: FROM mst_delivery_legs dl,

302: FROM mst_deliveries d
303: WHERE d.plan_id = pp_plan_id
304: AND d.delivery_id IN
305: (SELECT delivery_id
306: FROM mst_delivery_legs dl,
307: mst_trip_stops ts
308: WHERE dl.plan_id = d.plan_id
309: AND dl.pick_up_stop_id = ts.stop_id
310: AND ts.plan_id = dl.plan_id

Line 323: FROM mst_delivery_legs dl,

319: FROM mst_deliveries d
320: WHERE d.plan_id = pp_plan_id
321: AND d.delivery_id IN
322: (SELECT delivery_id
323: FROM mst_delivery_legs dl,
324: mst_trip_stops ts
325: WHERE dl.plan_id = d.plan_id
326: AND dl.drop_off_stop_id = ts.stop_id
327: AND ts.plan_id = dl.plan_id

Line 376: FROM MST_DELIVERY_LEGS DL

372: FROM MST_DELIVERIES D
373: WHERE D.PLAN_ID = pp_plan_id
374: AND D.DELIVERY_ID IN
375: (SELECT DL.DELIVERY_ID
376: FROM MST_DELIVERY_LEGS DL
377: WHERE DL.plan_id = d.plan_id
378: AND dl.Trip_id = PP_Trip_Id);
379:
380: V_Weight NUMBER;

Line 420: mst_delivery_legs mdl

416: AND mdd.delivery_detail_id IN
417: ( SELECT mda.delivery_detail_id
418: FROM mst_deliveries md,
419: mst_delivery_assignments mda,
420: mst_delivery_legs mdl
421: WHERE mda.plan_id = mdd.plan_id
422: AND mda.plan_id = md.plan_id
423: AND mda.delivery_id = md.delivery_id
424: AND md.plan_id = mdl.plan_id

Line 444: mst_delivery_legs mdl

440: WHERE mdd.plan_id = p_plan_Id
441: AND mdd.delivery_detail_id IN
442: ( SELECT mda.delivery_detail_id
443: FROM mst_delivery_assignments mda,
444: mst_delivery_legs mdl
445: WHERE mda.plan_id = mdd.plan_id
446: AND mda.plan_id = mdl.plan_id
447: AND mda.delivery_id = mdl.delivery_id
448: AND mdl.trip_id = p_trip_id

Line 458: mst_delivery_legs mdl

454: WHERE mdd.plan_id = p_plan_Id
455: AND mdd.delivery_detail_id IN
456: ( SELECT mda.delivery_detail_id
457: FROM mst_delivery_assignments mda,
458: mst_delivery_legs mdl
459: WHERE mda.plan_id = mdd.plan_id
460: AND mda.plan_id = mdl.plan_id
461: AND mda.delivery_id = mdl.delivery_id
462: AND mda.parent_delivery_detail_id is null

Line 478: mst_delivery_legs mdl

474: WHERE mdd.plan_id = p_plan_Id
475: AND mdd.delivery_detail_id IN
476: ( SELECT mda.delivery_detail_id
477: FROM mst_delivery_assignments mda,
478: mst_delivery_legs mdl
479: WHERE mda.plan_id = mdd.plan_id
480: AND mda.plan_id = mdl.plan_id
481: AND mda.delivery_id = mdl.delivery_id
482: AND mda.parent_delivery_detail_id is null

Line 2532: from mst_delivery_legs mdl

2528: + (nvl(allocated_fac_shp_hand_cost, 0) + nvl(allocated_fac_rec_hand_cost, 0))
2529: + nvl(mdl.allocated_fac_loading_cost,0)
2530: + nvl(mdl.allocated_fac_unloading_cost,0)) allocated_cost
2531: into l_plan_alloc_cost
2532: from mst_delivery_legs mdl
2533: where mdl.plan_id = p_plan_id;
2534:
2535: return l_plan_alloc_cost;
2536: exception

Line 2553: mst_delivery_legs mdl,

2549: select count(mdd.delivery_detail_id)
2550: into l_total_orders
2551: from mst_trips mt,
2552: mst_trip_stops mts,
2553: mst_delivery_legs mdl,
2554: mst_deliveries md,
2555: mst_delivery_details mdd,
2556: mst_delivery_assignments mda
2557: where mt.plan_id = p_plan_id

Line 2574: mst_delivery_legs mdl,

2570: select count(mdd.delivery_detail_id)
2571: into l_total_orders
2572: from mst_trips mt,
2573: mst_trip_stops mts,
2574: mst_delivery_legs mdl,
2575: mst_deliveries md,
2576: mst_delivery_details mdd,
2577: mst_delivery_assignments mda
2578: where mt.plan_id = p_plan_id

Line 2594: mst_delivery_legs mdl,

2590: select count(mdd.delivery_detail_id)
2591: into l_total_orders
2592: from mst_trips mt,
2593: mst_trip_stops mts,
2594: mst_delivery_legs mdl,
2595: mst_deliveries md,
2596: mst_delivery_details mdd,
2597: mst_delivery_assignments mda
2598: where mt.plan_id = p_plan_id

Line 2623: mst_delivery_legs mdl

2619: and md.delivery_id in
2620: (select mdl.delivery_id
2621: from mst_trips t,
2622: mst_trip_stops ts,
2623: mst_delivery_legs mdl
2624: where mdl.plan_id = md.plan_id
2625: and ts.plan_id = mdl.plan_id
2626: and ts.stop_id = mdl.pick_up_stop_id
2627: and ts.stop_location_id = p_my_fac_location_id

Line 2658: mst_delivery_legs mdl

2654: + nvl(mdl.allocated_fac_shp_hand_cost,0)
2655: + nvl(mdl.allocated_transport_cost,0)) total_departing_cost
2656: from mst_trips mt,
2657: mst_trip_stops mts,
2658: mst_delivery_legs mdl
2659: where mt.plan_id = l_plan_id
2660: and mt.mode_of_transport = l_mode
2661: and mt.plan_id = mts.plan_id
2662: and mt.trip_id = mts.trip_id

Line 2673: mst_delivery_legs mdl

2669: + nvl(mdl.allocated_fac_rec_hand_cost,0)
2670: + nvl(mdl.allocated_transport_cost,0)) total_arriving_cost
2671: from mst_trips mt,
2672: mst_trip_stops mts,
2673: mst_delivery_legs mdl
2674: where mt.plan_id = l_plan_id
2675: and mt.mode_of_transport = l_mode
2676: and mt.plan_id = mts.plan_id
2677: and mt.trip_id = mts.trip_id

Line 2705: mst_delivery_legs mdl,

2701: select sum(md.gross_weight)
2702: into l_loading_weight
2703: from mst_trips mt,
2704: mst_trip_stops mts,
2705: mst_delivery_legs mdl,
2706: mst_deliveries md
2707: where mt.plan_id = p_plan_id
2708: and mt.mode_of_transport = p_mode
2709: and mts.trip_id = mt.trip_id

Line 2736: mst_delivery_legs mdl,

2732: select sum(md.volume)
2733: into l_loading_cube
2734: from mst_trips mt,
2735: mst_trip_stops mts,
2736: mst_delivery_legs mdl,
2737: mst_deliveries md
2738: where mt.plan_id = p_plan_id
2739: and mt.mode_of_transport = p_mode
2740: and mts.trip_id = mt.trip_id

Line 2768: mst_delivery_legs mdl,

2764: select sum(md.number_of_pieces)
2765: into l_loading_pieces
2766: from mst_trips mt,
2767: mst_trip_stops mts,
2768: mst_delivery_legs mdl,
2769: mst_deliveries md
2770: where mt.plan_id = p_plan_id
2771: and mt.mode_of_transport = p_mode
2772: and mts.trip_id = mt.trip_id

Line 2843: mst_delivery_legs mdl

2839: and md.delivery_id in
2840: (select mdl.delivery_id
2841: from mst_trips t,
2842: mst_trip_stops ts,
2843: mst_delivery_legs mdl
2844: where mdl.plan_id = md.plan_id
2845: and ts.plan_id = mdl.plan_id
2846: and (ts.stop_id = mdl.pick_up_stop_id
2847: or ts.stop_id = mdl.drop_off_stop_id)

Line 2958: from mst_delivery_legs mdl

2954: + (nvl(allocated_fac_shp_hand_cost, 0) + nvl(allocated_fac_rec_hand_cost, 0))
2955: + nvl(mdl.allocated_fac_loading_cost,0)
2956: + nvl(mdl.allocated_fac_unloading_cost,0)) allocated_cost
2957: into l_alloc_cost
2958: from mst_delivery_legs mdl
2959: , mst_trips mt
2960: where mdl.plan_id = mt.plan_id
2961: and mdl.trip_id = mt.trip_id
2962: and mt.plan_id = p_plan_id

Line 3129: , mst_delivery_legs mdl

3125: + nvl(mdl.allocated_transport_cost,0)),0)
3126: into l_cost
3127: from mst_trips mt
3128: , mst_trip_stops mts
3129: , mst_delivery_legs mdl
3130: where mt.plan_id = p_plan_id
3131: and mt.mode_of_transport = p_mode_of_transport
3132: and mt.origin_location_id = p_origin_id
3133: and mts.plan_id = mt.plan_id

Line 3206: from mst_delivery_legs mdl

3202: + (nvl(allocated_fac_shp_hand_cost, 0) + nvl(allocated_fac_rec_hand_cost, 0))
3203: + nvl(mdl.allocated_fac_loading_cost,0)
3204: + nvl(mdl.allocated_fac_unloading_cost,0)) allocated_cost
3205: into l_alloc_cost
3206: from mst_delivery_legs mdl
3207: , mst_trips mt
3208: where mdl.plan_id = mt.plan_id
3209: and mdl.trip_id = mt.trip_id
3210: and mt.plan_id = p_plan_id

Line 3372: , mst_delivery_legs mdl

3368: + nvl(mdl.allocated_transport_cost,0)),0)
3369: into l_cost
3370: from mst_trips mt
3371: , mst_trip_stops mts
3372: , mst_delivery_legs mdl
3373: where mt.plan_id = p_plan_id
3374: and mt.mode_of_transport = p_mode_of_transport
3375: and mt.destination_location_id = p_dest_id
3376: and mts.plan_id = mt.plan_id

Line 3433: , mst_delivery_legs mdl

3429: where mt.plan_id = p_plan_id
3430: and mt.trip_id IN
3431: (select distinct mts.trip_id
3432: from mst_trip_stops mts
3433: , mst_delivery_legs mdl
3434: , mst_deliveries md
3435: where md.plan_id = mdl.plan_id
3436: and md.customer_id = p_customer_id
3437: and mts.plan_id = md.plan_id

Line 3464: from mst_delivery_legs mdl

3460: + (nvl(allocated_fac_shp_hand_cost, 0) + nvl(allocated_fac_rec_hand_cost, 0))
3461: + nvl(mdl.allocated_fac_loading_cost,0)
3462: + nvl(mdl.allocated_fac_unloading_cost,0)) allocated_cost
3463: into l_alloc_cost
3464: from mst_delivery_legs mdl
3465: where mdl.plan_id = p_plan_id
3466: and mdl.trip_id IN
3467: (select distinct mts.trip_id
3468: from mst_trip_stops mts

Line 3469: , mst_delivery_legs mdl

3465: where mdl.plan_id = p_plan_id
3466: and mdl.trip_id IN
3467: (select distinct mts.trip_id
3468: from mst_trip_stops mts
3469: , mst_delivery_legs mdl
3470: , mst_deliveries md
3471: where md.plan_id = mdl.plan_id
3472: and md.customer_id = p_customer_id
3473: and mts.plan_id = md.plan_id

Line 3501: , mst_delivery_legs mdl

3497: where mt.plan_id = p_plan_id
3498: and mt.trip_id in
3499: (select distinct mts.trip_id
3500: from mst_trip_stops mts
3501: , mst_delivery_legs mdl
3502: , mst_deliveries md
3503: where md.plan_id = mt.plan_id
3504: and md.customer_id = p_customer_id
3505: and mts.plan_id = md.plan_id

Line 3540: , mst_delivery_legs mdl

3536: and mt.mode_of_transport = p_mode_of_transport
3537: and mt.trip_id in
3538: (select distinct mts.trip_id
3539: from mst_trip_stops mts
3540: , mst_delivery_legs mdl
3541: , mst_deliveries md
3542: where md.plan_id = mt.plan_id
3543: and md.customer_id = p_customer_id
3544: and mts.plan_id = md.plan_id

Line 3577: , MST_DELIVERY_LEGS MDL

3573: AND MT.MODE_OF_TRANSPORT = p_mode_of_transport
3574: AND MT.TRIP_ID IN
3575: (SELECT DISTINCT MTS.TRIP_ID
3576: FROM MST_TRIP_STOPS MTS
3577: , MST_DELIVERY_LEGS MDL
3578: , MST_DELIVERIES MD
3579: WHERE MD.PLAN_ID = MT.PLAN_ID
3580: AND MD.CUSTOMER_ID = p_customer_id
3581: AND MTS.PLAN_ID = MD.PLAN_ID

Line 3596: , mst_delivery_legs mdl

3592: + nvl(mdl.ALLOCATED_FAC_REC_HAND_COST,0)
3593: + nvl(mdl.allocated_transport_cost,0)),0)
3594: into l_cost
3595: from mst_deliveries md
3596: , mst_delivery_legs mdl
3597: , mst_trips mt
3598: where md.plan_id = p_plan_id
3599: and md.customer_id = p_customer_id
3600: and md.plan_id = mdl.plan_id

Line 3625: , mst_delivery_legs mdl

3621: where mt.plan_id = p_plan_id
3622: and mt.trip_id in
3623: (select distinct mts.trip_id
3624: from mst_trip_stops mts
3625: , mst_delivery_legs mdl
3626: , mst_deliveries md
3627: where md.plan_id = mt.plan_id
3628: and md.customer_id = p_customer_id
3629: and mts.plan_id = md.plan_id

Line 3669: , mst_delivery_legs mdl

3665: where mt.plan_id = p_plan_id
3666: and mt.trip_id IN
3667: (select distinct mts.trip_id
3668: from mst_trip_stops mts
3669: , mst_delivery_legs mdl
3670: , mst_deliveries md
3671: where md.plan_id = mdl.plan_id
3672: and md.supplier_id = p_supplier_id
3673: and mts.plan_id = md.plan_id

Line 3699: from mst_delivery_legs mdl

3695: + (nvl(allocated_fac_shp_hand_cost, 0) + nvl(allocated_fac_rec_hand_cost, 0))
3696: + nvl(mdl.allocated_fac_loading_cost,0)
3697: + nvl(mdl.allocated_fac_unloading_cost,0)) allocated_cost
3698: into l_alloc_cost
3699: from mst_delivery_legs mdl
3700: where mdl.plan_id = p_plan_id
3701: and mdl.trip_id IN
3702: (select distinct mts.trip_id
3703: from mst_trip_stops mts

Line 3704: , mst_delivery_legs mdl

3700: where mdl.plan_id = p_plan_id
3701: and mdl.trip_id IN
3702: (select distinct mts.trip_id
3703: from mst_trip_stops mts
3704: , mst_delivery_legs mdl
3705: , mst_deliveries md
3706: where md.plan_id = mdl.plan_id
3707: and md.supplier_id = p_supplier_id
3708: and mts.plan_id = md.plan_id

Line 3736: , mst_delivery_legs mdl

3732: where mt.plan_id = p_plan_id
3733: and mt.trip_id in
3734: (select distinct mts.trip_id
3735: from mst_trip_stops mts
3736: , mst_delivery_legs mdl
3737: , mst_deliveries md
3738: where md.plan_id = mt.plan_id
3739: and md.supplier_id = p_supplier_id
3740: and mts.plan_id = md.plan_id

Line 3776: , mst_delivery_legs mdl

3772: and mt.mode_of_transport = p_mode_of_transport
3773: and mt.trip_id in
3774: (select distinct mts.trip_id
3775: from mst_trip_stops mts
3776: , mst_delivery_legs mdl
3777: , mst_deliveries md
3778: where md.plan_id = mt.plan_id
3779: and md.supplier_id = p_supplier_id
3780: and mts.plan_id = md.plan_id

Line 3814: , MST_DELIVERY_LEGS MDL

3810: AND MT.MODE_OF_TRANSPORT = p_mode_of_transport
3811: AND MT.TRIP_ID IN
3812: (SELECT DISTINCT MTS.TRIP_ID
3813: FROM MST_TRIP_STOPS MTS
3814: , MST_DELIVERY_LEGS MDL
3815: , MST_DELIVERIES MD
3816: WHERE MD.PLAN_ID = MT.PLAN_ID
3817: AND MD.SUPPLIER_ID = p_supplier_id
3818: AND MTS.PLAN_ID = MD.PLAN_ID

Line 3833: , mst_delivery_legs mdl

3829: + nvl(mdl.ALLOCATED_FAC_REC_HAND_COST,0)
3830: + nvl(mdl.allocated_transport_cost,0)),0)
3831: into l_cost
3832: from mst_deliveries md
3833: , mst_delivery_legs mdl
3834: , mst_trips mt
3835: where md.plan_id = p_plan_id
3836: and md.supplier_id = p_supplier_id
3837: and md.plan_id = mdl.plan_id

Line 3863: , mst_delivery_legs mdl

3859: where mt.plan_id = p_plan_id
3860: and mt.trip_id in
3861: (select distinct mts.trip_id
3862: from mst_trip_stops mts
3863: , mst_delivery_legs mdl
3864: , mst_deliveries md
3865: where md.plan_id = mt.plan_id
3866: and md.supplier_id = p_supplier_id
3867: and mts.plan_id = md.plan_id

Line 3944: from mst_delivery_legs mdl

3940: begin
3941:
3942: select mt.carrier_id, mt.trip_id
3943: into l_prev_carr, l_trip_id
3944: from mst_delivery_legs mdl
3945: , mst_trips mt
3946: where mdl.plan_id = p_plan_id
3947: and mdl.delivery_id = p_delivery_id
3948: and mdl.trip_id <> p_trip_id

Line 4125: from mst_delivery_legs mdl

4121: return varchar2 is latest_depart_date_frm_dest varchar2(20) := null;
4122: begin
4123: select substr(mst_wb_util.get_local_chardt(p_stop_location_id, min(mts.planned_departure_date)),1,20)
4124: into latest_depart_date_frm_dest
4125: from mst_delivery_legs mdl
4126: , mst_trip_stops mts
4127: where mdl.plan_id = p_plan_id
4128: and mdl.delivery_id in (select distinct mdl1.delivery_id from mst_delivery_legs mdl1
4129: where mdl1.plan_id = mdl.plan_id

Line 4128: and mdl.delivery_id in (select distinct mdl1.delivery_id from mst_delivery_legs mdl1

4124: into latest_depart_date_frm_dest
4125: from mst_delivery_legs mdl
4126: , mst_trip_stops mts
4127: where mdl.plan_id = p_plan_id
4128: and mdl.delivery_id in (select distinct mdl1.delivery_id from mst_delivery_legs mdl1
4129: where mdl1.plan_id = mdl.plan_id
4130: and mdl1.trip_id = p_trip_id)
4131: and mdl.trip_id <> p_trip_id
4132: and mts.plan_id = mdl.plan_id

Line 4179: , mst_delivery_legs mdl

4175:
4176: cursor pickup_loc_cur is
4177: select mt.destination_location_id
4178: from mst_deliveries md
4179: , mst_delivery_legs mdl
4180: , mst_trips mt
4181: where md.plan_id = p_plan_id
4182: and md.delivery_id = p_delivery_id
4183: and mdl.plan_id = md.plan_id

Line 4226: , mst_delivery_legs mdl

4222:
4223: cursor dropoff_loc_cur is
4224: select mt.origin_location_id
4225: from mst_deliveries md
4226: , mst_delivery_legs mdl
4227: , mst_trips mt
4228: where md.plan_id = p_plan_id
4229: and md.delivery_id = p_delivery_id
4230: and mdl.plan_id = md.plan_id

Line 4388: FROM mst_delivery_legs

4384: l_lookup_code NUMBER;
4385: BEGIN
4386: SELECT COUNT('x')
4387: INTO l_count
4388: FROM mst_delivery_legs
4389: WHERE plan_id = p_plan_id
4390: AND trip_id = p_trip_id;
4391:
4392: If l_count > 0 Then

Line 5721: delete from MST_DELIVERY_LEGS

5717: begin
5718: l_message := 'Purge of plan '||p_compile_designator||':'||p_description||' started by '||fnd_global.user_name;
5719: print_info(1,l_message);
5720:
5721: delete from MST_DELIVERY_LEGS
5722: where plan_id = p_plan_id;
5723:
5724: delete from MST_TRIP_STOPS
5725: where plan_id = p_plan_id;

Line 5983: FROM MST_DELIVERY_LEGS mdl

5979: SELECT DELIVERY_ID, PLANNED_FLAG, KNOWN_TE_FIRM_STATUS, PRESERVE_GROUPING_FLAG
5980: FROM MST_DELIVERIES md
5981: WHERE md.plan_id = p_plan_id
5982: AND md.DELIVERY_ID IN (SELECT mdl.DELIVERY_ID
5983: FROM MST_DELIVERY_LEGS mdl
5984: WHERE mdl.PLAN_ID = md.Plan_Id
5985: AND mdl.TRIP_ID = p_Trip_Id)
5986: FOR UPDATE OF PLANNED_FLAG NOWAIT;
5987:

Line 5994: FROM MST_DELIVERY_LEGS mdl1

5990: SELECT TRIP_ID, PLANNED_FLAG
5991: FROM mst_trips mt
5992: WHERE mt.PLAN_ID = p_Plan_Id
5993: AND mt.TRIP_ID IN (SELECT mdl2.TRIP_ID
5994: FROM MST_DELIVERY_LEGS mdl1
5995: , MST_DELIVERY_LEGS mdl2
5996: WHERE mdl1.PLAN_ID = mdl2.PLAN_ID
5997: AND mdl1.DELIVERY_ID = mdl2.DELIVERY_ID
5998: AND mdl1.TRIP_ID <> mdl2.TRIP_ID

Line 5995: , MST_DELIVERY_LEGS mdl2

5991: FROM mst_trips mt
5992: WHERE mt.PLAN_ID = p_Plan_Id
5993: AND mt.TRIP_ID IN (SELECT mdl2.TRIP_ID
5994: FROM MST_DELIVERY_LEGS mdl1
5995: , MST_DELIVERY_LEGS mdl2
5996: WHERE mdl1.PLAN_ID = mdl2.PLAN_ID
5997: AND mdl1.DELIVERY_ID = mdl2.DELIVERY_ID
5998: AND mdl1.TRIP_ID <> mdl2.TRIP_ID
5999: AND mdl1.PLAN_ID = mt.Plan_Id