DBA Data[Home] [Help]

APPS.MST_WB_UTIL dependencies on MST_TRIP_STOPS

Line 227: FROM mst_trip_stops TS

223: RETURN NUMBER IS
224:
225: CURSOR Cur_Trip_Stops IS
226: SELECT COUNT(TS.Stop_Id)
227: FROM mst_trip_stops TS
228: WHERE TS.plan_id = p_plan_id
229: AND TS.trip_id = p_trip_id;
230:
231: V_Trip_Stops NUMBER;

Line 307: mst_trip_stops ts

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
311: AND ts.stop_id = pp_stop_id

Line 324: mst_trip_stops ts

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
328: AND ts.stop_id = pp_stop_id

Line 432: FROM mst_trip_stops

428: OR mdl.drop_off_stop_id = p_stop_id));*/
429:
430: CURSOR get_stop_det IS
431: SELECT stop_sequence_number
432: FROM mst_trip_stops
433: WHERE plan_Id = p_plan_Id
434: AND trip_id = p_trip_id
435: AND stop_id = p_stop_id;
436:

Line 466: FROM mst_trip_stops mts1

462: AND mda.parent_delivery_detail_id is null
463: AND mdl.trip_id = p_trip_id
464: AND mdl.pick_up_stop_id IN
465: (SELECT mts1.stop_id
466: FROM mst_trip_stops mts1
467: WHERE mts1.plan_id = mdl.plan_Id
468: AND mts1.trip_id = mdl.trip_id
469: AND mts1.stop_sequence_number <= p_stop_sequence));
470:

Line 486: FROM mst_trip_stops mts1

482: AND mda.parent_delivery_detail_id is null
483: AND mdl.trip_id = p_trip_id
484: AND mdl.drop_off_stop_id IN
485: (SELECT mts1.stop_id
486: FROM mst_trip_stops mts1
487: WHERE mts1.plan_id = mdl.plan_Id
488: AND mts1.trip_id = mdl.trip_id
489: AND mts1.stop_sequence_number <= p_stop_sequence));
490:

Line 755: FROM MST_TRIP_STOPS TS

751: P_TRIP_ID IN NUMBER)
752: RETURN DATE IS
753: CURSOR TRIP_STOP_CUR IS
754: SELECT TS.PLANNED_DEPARTURE_DATE
755: FROM MST_TRIP_STOPS TS
756: WHERE TS.PLAN_ID = P_PLAN_ID
757: AND TS.TRIP_ID = P_TRIP_ID
758: AND TS.STOP_SEQUENCE_NUMBER =
759: (SELECT MIN(STOP_SEQUENCE_NUMBER)

Line 760: FROM MST_TRIP_STOPS TS1

756: WHERE TS.PLAN_ID = P_PLAN_ID
757: AND TS.TRIP_ID = P_TRIP_ID
758: AND TS.STOP_SEQUENCE_NUMBER =
759: (SELECT MIN(STOP_SEQUENCE_NUMBER)
760: FROM MST_TRIP_STOPS TS1
761: WHERE TS1.PLAN_ID = TS.PLAN_ID
762: AND TS1.TRIP_ID = TS.TRIP_ID
763: GROUP BY TS1.PLAN_ID, TS1.TRIP_ID);
764: l_Date DATE;

Line 786: FROM MST_TRIP_STOPS TS

782: RETURN DATE IS
783:
784: CURSOR TRIP_STOP_CUR IS
785: SELECT TS.PLANNED_ARRIVAL_DATE
786: FROM MST_TRIP_STOPS TS
787: WHERE TS.PLAN_ID = P_PLAN_ID
788: AND TS.TRIP_ID = P_TRIP_ID
789: AND TS.STOP_SEQUENCE_NUMBER =
790: (SELECT MAX(STOP_SEQUENCE_NUMBER)

Line 791: FROM MST_TRIP_STOPS TS1

787: WHERE TS.PLAN_ID = P_PLAN_ID
788: AND TS.TRIP_ID = P_TRIP_ID
789: AND TS.STOP_SEQUENCE_NUMBER =
790: (SELECT MAX(STOP_SEQUENCE_NUMBER)
791: FROM MST_TRIP_STOPS TS1
792: WHERE TS1.PLAN_ID = TS.PLAN_ID
793: AND TS1.TRIP_ID = TS.TRIP_ID
794: GROUP BY TS1.PLAN_ID, TS1.TRIP_ID);
795: l_Date DATE;

Line 816: from mst_trip_stops

812: p_trip_id IN NUMBER)
813: RETURN NUMBER IS
814: cursor stops is
815: select departure_volume
816: from mst_trip_stops
817: where plan_id = p_plan_id
818: and trip_id = p_trip_id;
819:
820: cursor trips is

Line 1238: FROM mst_trip_stops ts

1234: RETURN NUMBER IS
1235:
1236: CURSOR Cur_Leg_num IS
1237: SELECT ts.stop_id
1238: FROM mst_trip_stops ts
1239: WHERE plan_id = p_plan_Id
1240: AND ts.trip_id = p_trip_id
1241: ORDER BY ts.stop_sequence_number;
1242: l_stop_id NUMBER;

Line 1516: from fte_location_parameters flp, mst_trip_stops mts, mst_exception_details med

1512: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_406_1');
1513: --facility_description
1514: select flp.facility_code
1515: into l_temp
1516: from fte_location_parameters flp, mst_trip_stops mts, mst_exception_details med
1517: where mts.stop_id = med.stop_id1
1518: and mts.stop_location_id = flp.location_id
1519: and med.exception_detail_id = p_exception_detail_id
1520: and med.plan_id = mts.plan_id

Line 1932: FROM mst_trip_stops mts,

1928: fnd_message.set_token('TRIP_NUMBER', l_id1);
1929:
1930: SELECT mts.stop_sequence_number, mts.stop_location_id
1931: INTO l_id2, l_id3
1932: FROM mst_trip_stops mts,
1933: mst_exception_details med
1934: WHERE mts.plan_id = med.plan_id
1935: AND med.plan_id = P_PLAN_ID
1936: AND mts.trip_id = med.trip_id1

Line 1960: FROM mst_trip_stops mts,

1956: fnd_message.set_token('TRIP_NUMBER', l_id1);
1957:
1958: SELECT mts.stop_location_id, mts.planned_departure_date, round(med.number1)
1959: INTO l_id1, l_date1, l_id3
1960: FROM mst_trip_stops mts,
1961: mst_exception_details med
1962: WHERE mts.plan_id = med.plan_id
1963: AND mts.stop_id = med.stop_id1
1964: AND med.plan_id = P_PLAN_ID

Line 1975: FROM mst_trip_stops mts,

1971: fnd_message.set_token('REQUIRED_TRANSIT_TIME', l_id3);
1972:
1973: SELECT mts.stop_location_id, mts.planned_arrival_date
1974: INTO l_id3, l_date2
1975: FROM mst_trip_stops mts,
1976: mst_exception_details med
1977: WHERE mts.plan_id = med.plan_id
1978: AND mts.stop_id = med.stop_id2
1979: AND med.plan_id = P_PLAN_ID

Line 2036: FROM mst_trip_stops mts,

2032:
2033: SELECT description into l_temp
2034: FROM fte_location_parameters
2035: WHERE location_id in (SELECT mts.stop_location_id
2036: FROM mst_trip_stops mts,
2037: mst_exception_details med
2038: WHERE mts.plan_id = med.plan_id
2039: AND mts.stop_id = med.stop_id1
2040: AND med.plan_id = P_PLAN_ID

Line 2059: mst_trip_stops mts,

2055:
2056: SELECT flp.description, round(nvl(med.number1, 0), 1), round((mts.planned_departure_date - mts.planned_arrival_date) * 24, 1)
2057: INTO l_temp, l_id1, l_id2
2058: FROM fte_location_parameters flp,
2059: mst_trip_stops mts,
2060: mst_exception_details med
2061: WHERE flp.location_id = mts.stop_location_id
2062: AND mts.plan_id = med.plan_id
2063: AND mts.stop_id = med.stop_id1

Line 2281: mst_trip_stops mts

2277: SELECT flp.description
2278: INTO l_temp
2279: FROM fte_location_parameters flp,
2280: mst_exception_details med,
2281: mst_trip_stops mts
2282: WHERE med.stop_id1 = mts.stop_id
2283: AND mts.plan_id = P_PLAN_ID
2284: AND med.exception_detail_id = P_EXCEPTION_DETAIL_ID
2285: AND mts.stop_location_id = flp.location_id;

Line 2552: mst_trip_stops mts,

2548: if p_activity_type is null then
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

Line 2573: mst_trip_stops mts,

2569: elsif p_activity_type = 'L' then
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

Line 2593: mst_trip_stops mts,

2589: elsif p_activity_type = 'U' then
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

Line 2622: mst_trip_stops ts,

2618: and md.delivery_id = mda.delivery_id
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

Line 2657: mst_trip_stops mts,

2653: select sum( nvl(mdl.allocated_fac_loading_cost,0)
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

Line 2672: mst_trip_stops mts,

2668: select sum( nvl(mdl.allocated_fac_unloading_cost,0)
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

Line 2704: mst_trip_stops mts,

2700: begin
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

Line 2735: mst_trip_stops mts,

2731: begin
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

Line 2767: mst_trip_stops mts,

2763: begin
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

Line 2842: mst_trip_stops ts,

2838: and md.delivery_id = mda.delivery_id
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

Line 3009: , mst_trip_stops mts

3005: select count(*)
3006: into l_count_stops_origin
3007: from (select distinct mt.trip_id, count(*) num_stops
3008: from mst_trips mt
3009: , mst_trip_stops mts
3010: where mt.plan_id = p_plan_id
3011: and mt.origin_location_id = p_origin_id
3012: and mts.plan_id = mt.plan_id
3013: and mts.trip_id = mt.trip_id

Line 3128: , mst_trip_stops mts

3124: + nvl(mdl.ALLOCATED_FAC_REC_HAND_COST,0)
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

Line 3155: , mst_trip_stops mts

3151: select count(*)
3152: into total_dtl
3153: from (select distinct mt.trip_id, count(*) num_stops
3154: from mst_trips mt
3155: , mst_trip_stops mts
3156: where mt.plan_id = p_plan_id
3157: and mt.origin_location_id = p_origin_id
3158: and mt.mode_of_transport = 'TRUCK'
3159: and mts.plan_id = mt.plan_id

Line 3254: , mst_trip_stops mts

3250: select count(*)
3251: into l_count_stops_dest
3252: from (select distinct mt.trip_id, count(*) num_stops
3253: from mst_trips mt
3254: , mst_trip_stops mts
3255: where mt.plan_id = p_plan_id
3256: and mt.destination_location_id = p_dest_id
3257: and mts.plan_id = mt.plan_id
3258: and mts.trip_id = mt.trip_id

Line 3371: , mst_trip_stops mts

3367: + nvl(mdl.ALLOCATED_FAC_REC_HAND_COST,0)
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

Line 3398: , mst_trip_stops mts

3394: select count(*)
3395: into total_dtl
3396: from (select distinct mt.trip_id, count(*) num_stops
3397: from mst_trips mt
3398: , mst_trip_stops mts
3399: where mt.plan_id = p_plan_id
3400: and mt.destination_location_id = p_dest_id
3401: and mt.mode_of_transport = 'TRUCK'
3402: and mts.plan_id = mt.plan_id

Line 3432: from mst_trip_stops mts

3428: from mst_trips mt
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

Line 3468: from mst_trip_stops mts

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
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

Line 3500: from mst_trip_stops mts

3496: from mst_trips mt
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

Line 3514: from mst_trip_stops ts

3510: and mdl.drop_off_stop_id = mts.stop_id)
3511: and mt.mode_of_transport = 'TRUCK'
3512: and EXISTS
3513: (select ts.trip_id
3514: from mst_trip_stops ts
3515: where ts.plan_id = mt.plan_id
3516: and ts.trip_id = mt.trip_id
3517: having count(ts.stop_id) >2
3518: group by ts.trip_id);

Line 3539: from mst_trip_stops mts

3535: where mt.plan_id = p_plan_id
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

Line 3576: FROM MST_TRIP_STOPS MTS

3572: WHERE MT.PLAN_ID = p_plan_id
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

Line 3624: from mst_trip_stops mts

3620: from mst_trips mt
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

Line 3638: from mst_trip_stops ts

3634: and mdl.drop_off_stop_id = mts.stop_id)
3635: and mt.mode_of_transport = 'TRUCK'
3636: and EXISTS
3637: (select ts.trip_id
3638: from mst_trip_stops ts
3639: where ts.plan_id = mt.plan_id
3640: and ts.trip_id = mt.trip_id
3641: having count(ts.stop_id) =2
3642: group by ts.trip_id);

Line 3668: from mst_trip_stops mts

3664: from mst_trips mt
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

Line 3703: from mst_trip_stops mts

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
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

Line 3735: from mst_trip_stops mts

3731: from mst_trips mt
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

Line 3749: from mst_trip_stops ts

3745: and mdl.pick_up_stop_id = mts.stop_id)
3746: and mt.mode_of_transport = 'TRUCK'
3747: and EXISTS
3748: (select ts.trip_id
3749: from mst_trip_stops ts
3750: where ts.plan_id = mt.plan_id
3751: and ts.trip_id = mt.trip_id
3752: having count(ts.stop_id) >2
3753: group by ts.trip_id);

Line 3775: from mst_trip_stops mts

3771: where mt.plan_id = p_plan_id
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

Line 3813: FROM MST_TRIP_STOPS MTS

3809: WHERE MT.PLAN_ID = p_plan_id
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

Line 3862: from mst_trip_stops mts

3858: from mst_trips mt
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

Line 3876: from mst_trip_stops ts

3872: and mdl.pick_up_stop_id = mts.stop_id)
3873: and mt.mode_of_transport = 'TRUCK'
3874: and EXISTS
3875: (select ts.trip_id
3876: from mst_trip_stops ts
3877: where ts.plan_id = mt.plan_id
3878: and ts.trip_id = mt.trip_id
3879: having count(ts.stop_id) =2
3880: group by ts.trip_id);

Line 3903: from mst_trip_stops mts

3899: begin
3900:
3901: select mts.planned_arrival_date, mts.planned_departure_date
3902: into l_arr_time, l_dep_time
3903: from mst_trip_stops mts
3904: where mts.plan_id = p_plan_id
3905: and mts.trip_id = p_trip_id
3906: and mts.stop_id = p_stop_id;
3907:

Line 3912: from mst_trip_stops mts

3908: if l_dep_time > l_arr_time then
3909: select (mts.planned_departure_date - mts.planned_arrival_date) * 24
3910: , TRUNC((mts.planned_departure_date - mts.planned_arrival_date) * 24)
3911: into l_wait_hrs_min, l_wait_hrs
3912: from mst_trip_stops mts
3913: where mts.plan_id = p_plan_id
3914: and mts.trip_id = p_trip_id
3915: and mts.stop_id = p_stop_id;
3916:

Line 3951: and (mdl.pick_up_stop_id IN (select mts.stop_id from mst_trip_stops mts

3947: and mdl.delivery_id = p_delivery_id
3948: and mdl.trip_id <> p_trip_id
3949: and mt.plan_id = mdl.plan_id
3950: and mt.trip_id = mdl.trip_id
3951: and (mdl.pick_up_stop_id IN (select mts.stop_id from mst_trip_stops mts
3952: where mts.plan_id = p_plan_id
3953: and mts.stop_location_id = p_stop_location_id)
3954: or mdl.drop_off_stop_id IN (select mts.stop_id from mst_trip_stops mts
3955: where mts.plan_id = p_plan_id

Line 3954: or mdl.drop_off_stop_id IN (select mts.stop_id from mst_trip_stops mts

3950: and mt.trip_id = mdl.trip_id
3951: and (mdl.pick_up_stop_id IN (select mts.stop_id from mst_trip_stops mts
3952: where mts.plan_id = p_plan_id
3953: and mts.stop_location_id = p_stop_location_id)
3954: or mdl.drop_off_stop_id IN (select mts.stop_id from mst_trip_stops mts
3955: where mts.plan_id = p_plan_id
3956: and mts.stop_location_id = p_stop_location_id)
3957: );
3958:

Line 3986: from mst_trip_stops mts

3982: exit_loop_flag number := 0;
3983:
3984: cursor seq_num_cur is
3985: select mts.stop_sequence_number
3986: from mst_trip_stops mts
3987: where mts.plan_id = p_plan_id
3988: and mts.trip_id = p_trip_id
3989: order by mts.stop_sequence_number desc;
3990:

Line 4031: from mst_trip_stops mts

4027: begin
4028:
4029: select min(mts.stop_sequence_number)
4030: into p_min_seq_num
4031: from mst_trip_stops mts
4032: where mts.plan_id = p_plan_id
4033: and mts.trip_id = p_trip_id;
4034:
4035: if p_curr_seq_num = p_min_seq_num then

Line 4041: from mst_trip_stops mts

4037: else
4038: if p_identifier = 'D' then
4039: select mts.distance_to_next_stop
4040: into p_ret_val
4041: from mst_trip_stops mts
4042: where mts.plan_id = p_plan_id
4043: and mts.trip_id = p_trip_id
4044: and mts.stop_sequence_number = r_get_prev_stop_seqnum (p_plan_id, p_trip_id, p_curr_seq_num);
4045: elsif p_identifier = 'T' then

Line 4048: from mst_trip_stops mts

4044: and mts.stop_sequence_number = r_get_prev_stop_seqnum (p_plan_id, p_trip_id, p_curr_seq_num);
4045: elsif p_identifier = 'T' then
4046: select mts.drv_time_to_next_stop
4047: into p_ret_val
4048: from mst_trip_stops mts
4049: where mts.plan_id = p_plan_id
4050: and mts.trip_id = p_trip_id
4051: and mts.stop_sequence_number = r_get_prev_stop_seqnum (p_plan_id, p_trip_id, p_curr_seq_num);
4052: elsif p_identifier = 'C' then

Line 4055: from mst_trip_stops mts

4051: and mts.stop_sequence_number = r_get_prev_stop_seqnum (p_plan_id, p_trip_id, p_curr_seq_num);
4052: elsif p_identifier = 'C' then
4053: select mts.distance_cost
4054: into p_ret_val
4055: from mst_trip_stops mts
4056: where mts.plan_id = p_plan_id
4057: and mts.trip_id = p_trip_id
4058: and mts.stop_sequence_number = r_get_prev_stop_seqnum (p_plan_id, p_trip_id, p_curr_seq_num);
4059: else

Line 4126: , mst_trip_stops mts

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
4130: and mdl1.trip_id = p_trip_id)

Line 4135: and mdl.pick_up_stop_id in (select distinct mts1.stop_id from mst_trip_stops mts1

4131: and mdl.trip_id <> p_trip_id
4132: and mts.plan_id = mdl.plan_id
4133: and mts.trip_id = mdl.trip_id
4134: and mts.stop_location_id = p_stop_location_id -- will be destination_location_id of the previous trip
4135: and mdl.pick_up_stop_id in (select distinct mts1.stop_id from mst_trip_stops mts1
4136: where mts1.plan_id = mts.plan_id
4137: and mts1.trip_id = mts.trip_id);
4138:
4139: return latest_depart_date_frm_dest;

Line 4193: from mst_trip_stops mts

4189: begin
4190:
4191: select mts.stop_location_id
4192: into leg_pickup_loc_id
4193: from mst_trip_stops mts
4194: where mts.plan_id = p_plan_id
4195: and mts.stop_id = p_pick_up_stop_id;
4196:
4197: open pickup_loc_cur;

Line 4240: from mst_trip_stops mts

4236: begin
4237:
4238: select mts.stop_location_id
4239: into leg_dropoff_loc_id
4240: from mst_trip_stops mts
4241: where mts.plan_id = p_plan_id
4242: and mts.stop_id = p_drop_off_stop_id;
4243:
4244: open dropoff_loc_cur;

Line 4645: FROM mst_trip_stops

4641: END IF;
4642:
4643: SELECT stop_location_id, stop_sequence_number
4644: INTO l_id4, l_id5
4645: FROM mst_trip_stops
4646: WHERE plan_id = P_PLAN_ID
4647: AND stop_id = l_id2;
4648: fnd_message.set_token('STOP_SEQUENCE_NUMBER', l_id5);
4649:

Line 5724: delete from MST_TRIP_STOPS

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;
5726:
5727: delete from MST_TRIPS
5728: where plan_id = p_plan_id;