DBA Data[Home] [Help]

APPS.MST_AGG_PKG dependencies on MST_TRIPS

Line 10: from mst_trips

6: l_count number;
7: begin
8: select count(1)
9: into l_count
10: from mst_trips
11: where plan_id = p_plan_id
12: and nvl(move_type, 2) <> 1;
13: return l_count;
14:

Line 26: from mst_trips

22: l_count number;
23: begin
24: select count(1)
25: into l_count
26: from mst_trips
27: where plan_id = p_plan_id
28: and mode_of_transport = p_mode_of_transport
29: and nvl(move_type, 2) <> 1 ;
30: return l_count;

Line 195: from mst_trips

191: l_fixed_charge number;
192: begin
193: select sum(total_basic_transport_cost)
194: into l_fixed_charge
195: from mst_trips
196: where plan_id = p_plan_id
197: and mode_of_transport = p_mode;
198: return l_fixed_charge;
199: EXCEPTION

Line 211: from mst_trips

207: l_stop_charge number;
208: begin
209: select sum(total_stop_cost)
210: into l_stop_charge
211: from mst_trips
212: where plan_id = p_plan_id
213: and mode_of_transport = 'TRUCK';
214: return l_stop_charge;
215: EXCEPTION

Line 227: from mst_trips

223: l_ld_unld_charge number;
224: begin
225: select sum(total_load_unload_cost)
226: into l_ld_unld_charge
227: from mst_trips
228: where plan_id = p_plan_id
229: and mode_of_transport = 'TRUCK';
230: return l_ld_unld_charge;
231: EXCEPTION

Line 243: from mst_trips

239: l_layover_charge number;
240: begin
241: select sum(total_layover_cost)
242: into l_layover_charge
243: from mst_trips
244: where plan_id = p_plan_id
245: and mode_of_transport = 'TRUCK';
246: return l_layover_charge;
247: EXCEPTION

Line 259: from mst_trips

255: l_assessorial_charge number;
256: begin
257: select sum(total_accessorial_cost)
258: into l_assessorial_charge
259: from mst_trips
260: where plan_id = p_plan_id
261: and mode_of_transport = p_mode;
262: return l_assessorial_charge;
263: EXCEPTION

Line 549: from mst_trips

545: sum(total_basic_transport_cost + total_stop_cost
546: + total_load_unload_cost + total_layover_cost
547: + total_accessorial_cost + total_handling_cost)
548: into l_total_cost_for_TLs_with_CMs
549: from mst_trips
550: where plan_id = p_plan_id
551: and continuous_move_id is not null
552: and mode_of_transport = 'TRUCK';
553:

Line 569: from mst_trips

565: l_percent number;
566: begin
567: select count(1)
568: into l_total_number_of_tl
569: from mst_trips
570: where plan_id = p_plan_id
571: and mode_of_transport = 'TRUCK';
572:
573: select count(1)

Line 575: from mst_trips

571: and mode_of_transport = 'TRUCK';
572:
573: select count(1)
574: into l_total_number_of_tl_in_cm
575: from mst_trips
576: where plan_id = p_plan_id
577: and continuous_move_id is not null
578: and mode_of_transport = 'TRUCK';
579:

Line 681: from mst_trips

677:
678: begin
679: select sum(total_basic_transport_cost + total_stop_cost + total_load_unload_cost + total_layover_cost + total_accessorial_cost + total_handling_cost)
680: into l_carrier_tl_cost
681: from mst_trips
682: where plan_id = p_plan_id
683: and carrier_id = p_carrier_id
684: and mode_of_transport = 'TRUCK'
685: and continuous_move_id is null;

Line 689: from mst_trips

685: and continuous_move_id is null;
686:
687: select sum(total_basic_transport_cost + total_accessorial_cost)
688: into l_carrier_ltl_parcel_cost
689: from mst_trips
690: where plan_id = p_plan_id
691: and carrier_id = p_carrier_id
692: and mode_of_transport in ('LTL', 'PARCEL');
693:

Line 722: MST_TRIPS mt,

718: WHERE md.plan_id = p_plan_id
719: AND md.delivery_id IN
720: ( SELECT mdl.delivery_id
721: FROM MST_DELIVERY_LEGS mdl,
722: MST_TRIPS mt,
723: MST_TRIP_STOPS mts
724: WHERE mt.plan_id = md.plan_id
725: AND mt.carrier_id = p_carrier_id
726: AND mt.plan_id = mdl.plan_id

Line 803: MST_TRIPS mt,

799: WHERE md.plan_id = p_plan_id
800: AND md.delivery_id IN
801: ( SELECT mdl.delivery_id
802: FROM MST_DELIVERY_LEGS mdl,
803: MST_TRIPS mt,
804: MST_TRIP_STOPS mts
805: WHERE mt.plan_id = md.plan_id
806: AND mt.carrier_id = p_carrier_id
807: AND mt.plan_id = mdl.plan_id

Line 885: MST_TRIPS mt,

881: WHERE md.plan_id = p_plan_id
882: AND md.delivery_id IN
883: ( SELECT mdl.delivery_id
884: FROM MST_DELIVERY_LEGS mdl,
885: MST_TRIPS mt,
886: MST_TRIP_STOPS mts
887: WHERE mt.plan_id = md.plan_id
888: AND mt.carrier_id = p_carrier_id
889: AND mt.plan_id = mdl.plan_id

Line 966: MST_TRIPS mt,

962: WHERE md.plan_id = p_plan_id
963: AND md.delivery_id IN
964: ( SELECT mdl.delivery_id
965: FROM MST_DELIVERY_LEGS mdl,
966: MST_TRIPS mt,
967: MST_TRIP_STOPS mts
968: WHERE mt.plan_id = md.plan_id
969: AND mt.carrier_id = p_carrier_id
970: AND mt.plan_id = mdl.plan_id

Line 1055: FROM MST_TRIPS T,

1051: WHERE MD.PLAN_ID = MDA.PLAN_ID
1052: AND MD.DELIVERY_ID = MDA.DELIVERY_ID
1053: AND MD.DELIVERY_ID IN
1054: (SELECT MDL.DELIVERY_ID
1055: FROM MST_TRIPS T,
1056: MST_TRIP_STOPS TS,
1057: MST_DELIVERY_LEGS MDL
1058: WHERE MDL.PLAN_ID = MD.PLAN_ID
1059: AND TS.PLAN_ID = MDL.PLAN_ID

Line 1151: from mst_trips

1147: begin
1148: if p_mode = 'TRUCK' then
1149: select sum(total_basic_transport_cost + total_stop_cost + total_load_unload_cost+ total_layover_cost+ total_accessorial_cost + total_handling_cost)
1150: into l_carrier_tl_cost
1151: from mst_trips
1152: where plan_id = p_plan_id
1153: and carrier_id = p_carrier_id
1154: and mode_of_transport = 'TRUCK'
1155: and service_level = p_service

Line 1161: from mst_trips

1157: l_carrier_service_cost := l_carrier_tl_cost;
1158: elsif p_mode = 'LTL' then
1159: select sum(total_basic_transport_cost + total_accessorial_cost)
1160: into l_carrier_ltl_cost
1161: from mst_trips
1162: where plan_id = p_plan_id
1163: and carrier_id = p_carrier_id
1164: and mode_of_transport = 'LTL'
1165: and service_level = p_service;

Line 1170: from mst_trips

1166: l_carrier_service_cost := l_carrier_ltl_cost;
1167: elsif p_mode = 'PARCEL' then
1168: select sum(total_basic_transport_cost + total_accessorial_cost)
1169: into l_carrier_parcel_cost
1170: from mst_trips
1171: where plan_id = p_plan_id
1172: and carrier_id = p_carrier_id
1173: and mode_of_transport = 'LTL'
1174: and service_level = p_service;

Line 1193: mst_trips mt,

1189: from(
1190: select distinct md.delivery_id, md.gross_weight gross_weight
1191: from mst_delivery_legs mdl,
1192: mst_deliveries md,
1193: mst_trips mt,
1194: mst_trip_stops mts
1195: where mt.plan_id = p_plan_id
1196: and mt.mode_of_transport = p_mode
1197: and mt.service_level = p_service

Line 1220: mst_trips mt,

1216: from(
1217: select distinct md.delivery_id, md.volume volume
1218: from mst_delivery_legs mdl,
1219: mst_deliveries md,
1220: mst_trips mt,
1221: mst_trip_stops mts
1222: where mt.plan_id = p_plan_id
1223: and mt.mode_of_transport = p_mode
1224: and mt.service_level = p_service

Line 1246: mst_trips mt,

1242: from(
1243: select distinct md.delivery_id, md.number_of_pallets number_of_pallets
1244: from mst_delivery_legs mdl,
1245: mst_deliveries md,
1246: mst_trips mt,
1247: mst_trip_stops mts
1248: where mt.plan_id = p_plan_id
1249: and mt.mode_of_transport = p_mode
1250: and mt.service_level = p_service

Line 1272: mst_trips mt,

1268: from(
1269: select distinct md.delivery_id, md.number_of_pieces number_of_pieces
1270: from mst_delivery_legs mdl,
1271: mst_deliveries md,
1272: mst_trips mt,
1273: mst_trip_stops mts
1274: where mt.plan_id = p_plan_id
1275: and mt.mode_of_transport = p_mode
1276: and mt.service_level = p_service

Line 1619: from mst_delivery_legs mdl, mst_trip_stops mts, mst_trips mt

1615: and mdl.plan_id = p_plan_id;
1616:
1617: cursor mst_mode_of_transport (p_delivery_leg_id NUMBER) is
1618: select mt.mode_of_transport mode_of_transport, mt.trip_id trip_id
1619: from mst_delivery_legs mdl, mst_trip_stops mts, mst_trips mt
1620: where mdl.delivery_leg_id = p_delivery_leg_id
1621: and mdl.plan_id = mts.plan_id
1622: and mdl.pick_up_stop_id = mts.stop_id
1623: and mdl.plan_id = mt.plan_id

Line 1770: from mst_delivery_legs mdl, mst_trip_stops mts, mst_trips mt

1766: and mdl.plan_id = p_plan_id;
1767:
1768: cursor mst_mode_of_transport (p_delivery_leg_id NUMBER) is
1769: select mt.mode_of_transport mode_of_transport, mt.trip_id trip_id
1770: from mst_delivery_legs mdl, mst_trip_stops mts, mst_trips mt
1771: where mdl.delivery_leg_id = p_delivery_leg_id
1772: and mdl.plan_id = mts.plan_id
1773: and mdl.pick_up_stop_id = mts.stop_id
1774: and mdl.plan_id = mt.plan_id

Line 1923: from mst_trips mt

1919: if p_partner_type = 0 then -- partner_type = 0 means for customer
1920: --for DTLs
1921: select count(mt.trip_id)
1922: into l_num_of_direct_tls
1923: from mst_trips mt
1924: where mt.plan_id = p_plan_id
1925: and mt.trip_id in
1926: (select distinct mts.trip_id
1927: from mst_trip_stops mts

Line 1950: from mst_trips mt

1946:
1947: -- for MultiStop TLs
1948: select count(mt.trip_id)
1949: into l_num_of_multi_stop_tls
1950: from mst_trips mt
1951: where mt.plan_id = p_plan_id
1952: and mt.trip_id in
1953: (select distinct mts.trip_id
1954: from mst_trip_stops mts

Line 1977: from mst_trips mt

1973:
1974: --for LTLs
1975: select count(mt.trip_id)
1976: into l_num_of_ltls
1977: from mst_trips mt
1978: where mt.plan_id = p_plan_id
1979: and mt.trip_id in
1980: (select distinct mts.trip_id
1981: from mst_trip_stops mts

Line 1997: from mst_trips mt

1993:
1994: --for Parcels
1995: select count(mt.trip_id)
1996: into l_num_of_parcels
1997: from mst_trips mt
1998: where mt.plan_id = p_plan_id
1999: and mt.trip_id in
2000: (select distinct mts.trip_id
2001: from mst_trip_stops mts

Line 2018: from mst_trips mt

2014: elsif p_partner_type = 1 then -- partner_type = 1 means for supplier
2015: --for DTLs
2016: select count(mt.trip_id)
2017: into l_num_of_direct_tls
2018: from mst_trips mt
2019: where mt.plan_id = p_plan_id
2020: and mt.trip_id in
2021: (select distinct mts.trip_id
2022: from mst_trip_stops mts

Line 2045: from mst_trips mt

2041:
2042: -- for MultiStop TLs
2043: select count(mt.trip_id)
2044: into l_num_of_multi_stop_tls
2045: from mst_trips mt
2046: where mt.plan_id = p_plan_id
2047: and mt.trip_id in
2048: (select distinct mts.trip_id
2049: from mst_trip_stops mts

Line 2072: from mst_trips mt

2068:
2069: --for LTLs
2070: select count(mt.trip_id)
2071: into l_num_of_ltls
2072: from mst_trips mt
2073: where mt.plan_id = p_plan_id
2074: and mt.trip_id in
2075: (select distinct mts.trip_id
2076: from mst_trip_stops mts

Line 2092: from mst_trips mt

2088:
2089: --for Parcels
2090: select count(mt.trip_id)
2091: into l_num_of_parcels
2092: from mst_trips mt
2093: where mt.plan_id = p_plan_id
2094: and mt.trip_id in
2095: (select distinct mts.trip_id
2096: from mst_trip_stops mts

Line 2954: FROM mst_trips mt

2950: -- each trip to be 2 (Direct)Get count of such trips. --
2951: -- ---------------------------------------------------- --
2952: SELECT COUNT(mt.trip_id)
2953: INTO l_total_trips
2954: FROM mst_trips mt
2955: WHERE mt.plan_id = p_plan_id
2956: AND mt.trip_id IN
2957: (select distinct mts.trip_id
2958: from mst_trip_stops mts

Line 2991: FROM mst_trips mt

2987: -- each trip to be 2 (Direct)Get count of such trips. --
2988: -- ---------------------------------------------------- --
2989: SELECT COUNT(mt.trip_id)
2990: INTO l_total_trips
2991: FROM mst_trips mt
2992: WHERE mt.plan_id = p_plan_id
2993: AND mt.trip_id IN
2994: (select distinct mts.trip_id
2995: from mst_trip_stops mts

Line 3030: FROM mst_trips mt

3026: -- trip to be > 2 (Multi stop)Get count of such trips. --
3027: -- ---------------------------------------------------- --
3028: SELECT COUNT(mt.trip_id)
3029: INTO l_total_trips
3030: FROM mst_trips mt
3031: WHERE mt.plan_id = p_plan_id
3032: AND mt.trip_id IN
3033: (select distinct mts.trip_id
3034: from mst_trip_stops mts

Line 3067: FROM mst_trips mt

3063: -- trip to be > 2 (Multi stop)Get count of such trips. --
3064: -- ---------------------------------------------------- --
3065: SELECT COUNT(mt.trip_id)
3066: INTO l_total_trips
3067: FROM mst_trips mt
3068: WHERE mt.plan_id = p_plan_id
3069: AND mt.trip_id IN
3070: (select distinct mts.trip_id
3071: from mst_trip_stops mts

Line 3124: FROM mst_trips mt

3120: -- more delivery legs. --
3121: -- ---------------------------------------------------- --
3122: /*SELECT COUNT(mt.trip_id)
3123: INTO l_total_trips
3124: FROM mst_trips mt
3125: WHERE mt.plan_id = p_plan_id
3126: AND mt.trip_id IN
3127: (SELECT mdl.trip_id
3128: FROM mst_delivery_legs mdl,

Line 3140: FROM mst_trips mt

3136: AND mt.mode_of_transport = p_mode_of_transport;*/
3137: -- Rewritten for bug#3598252.
3138: SELECT COUNT(mt.trip_id)
3139: INTO l_total_trips
3140: FROM mst_trips mt
3141: WHERE mt.plan_id = p_plan_id
3142: AND mt.trip_id IN
3143: (SELECT mdl.trip_id
3144: FROM mst_delivery_legs mdl,

Line 3168: FROM mst_trips mt

3164: -- more delivery legs. --
3165: -- ---------------------------------------------------- --
3166: /*SELECT COUNT(mt.trip_id)
3167: INTO l_total_trips
3168: FROM mst_trips mt
3169: WHERE mt.plan_id = p_plan_id
3170: AND mt.trip_id IN
3171: (SELECT mdl.trip_id
3172: FROM mst_delivery_legs mdl,

Line 3184: FROM mst_trips mt

3180: AND mt.mode_of_transport = p_mode_of_transport;*/
3181: -- Rewritten for bug#3598252.
3182: SELECT COUNT(mt.trip_id)
3183: INTO l_total_trips
3184: FROM mst_trips mt
3185: WHERE mt.plan_id = p_plan_id
3186: AND mt.trip_id IN
3187: (SELECT mdl.trip_id
3188: FROM mst_delivery_legs mdl,

Line 3221: FROM mst_trips mt

3217: RETURN NUMBER IS
3218:
3219: CURSOR get_trips IS
3220: SELECT COUNT(mt.trip_id)
3221: FROM mst_trips mt
3222: WHERE mt.plan_id = p_plan_id
3223: AND mt.mode_of_transport = p_mode_of_transport
3224: AND mt.trip_id IN (
3225: SELECT ts.trip_id

Line 3236: FROM mst_trips mt

3232: OR ts.stop_id = mdl.drop_off_stop_id));
3233:
3234: CURSOR get_empty_trips IS
3235: SELECT COUNT(mt.trip_id)
3236: FROM mst_trips mt
3237: WHERE mt.plan_id = p_plan_id
3238: AND mt.mode_of_transport = p_mode_of_transport
3239: AND mt.continuous_move_id IS NULL
3240: AND EXISTS (SELECT 1

Line 3252: FROM mst_trips mt

3248: AND mdl.trip_id = mt.trip_id);
3249:
3250: CURSOR get_trips_load IS
3251: SELECT COUNT(mt.trip_id)
3252: FROM mst_trips mt
3253: WHERE mt.plan_id = p_plan_id
3254: AND mt.mode_of_transport = p_mode_of_transport
3255: AND mt.trip_id IN (
3256: SELECT ts.trip_id

Line 3266: FROM mst_trips mt

3262: AND ts.plan_id = mdl.plan_id);
3263:
3264: CURSOR get_trips_unload IS
3265: SELECT count(mt.trip_id)
3266: FROM mst_trips mt
3267: WHERE mt.plan_id = p_plan_id
3268: AND mt.mode_of_transport = p_mode_of_transport
3269: AND mt.trip_id IN (
3270: SELECT ts.trip_id

Line 3338: mst_trips mt,

3334: WHERE mdd.plan_id = p_plan_id
3335: AND mdd.delivery_detail_id IN
3336: (SELECT mda.delivery_detail_id
3337: FROM mst_delivery_assignments mda,
3338: mst_trips mt,
3339: mst_trip_stops mts,
3340: mst_delivery_legs mdl,
3341: mst_deliveries md
3342: WHERE mda.plan_id = mdd.plan_id

Line 3371: mst_trips mt,

3367: AND mdd.delivery_detail_id IN
3368: ( SELECT mda.delivery_detail_id
3369: FROM mst_delivery_assignments mda,
3370: mst_deliveries md,
3371: mst_trips mt,
3372: mst_delivery_legs mdl
3373: WHERE mda.plan_id = mdd.plan_id
3374: AND mda.plan_id = md.plan_id
3375: AND mda.delivery_id = md.delivery_id

Line 3399: mst_trips mt,

3395: AND mdd.delivery_detail_id IN
3396: ( SELECT mda.delivery_detail_id
3397: FROM mst_delivery_assignments mda,
3398: mst_deliveries md,
3399: mst_trips mt,
3400: mst_delivery_legs mdl
3401: WHERE mda.plan_id = mdd.plan_id
3402: AND mda.plan_id = md.plan_id
3403: AND mda.delivery_id = md.delivery_id

Line 3426: mst_trips mt,

3422: AND mdd.delivery_detail_id IN
3423: ( SELECT mda.delivery_detail_id
3424: FROM mst_delivery_assignments mda,
3425: mst_deliveries md,
3426: mst_trips mt,
3427: mst_delivery_legs mdl
3428: WHERE mda.plan_id = mdd.plan_id
3429: AND mda.plan_id = md.plan_id
3430: AND mda.delivery_id = md.delivery_id

Line 3455: from mst_trips t,

3451: where md.plan_id = mda.plan_id
3452: and md.delivery_id = mda.delivery_id
3453: and md.delivery_id in
3454: (select mdl.delivery_id
3455: from mst_trips t,
3456: mst_trip_stops ts,
3457: mst_delivery_legs mdl
3458: where mdl.plan_id = md.plan_id
3459: and ts.plan_id = mdl.plan_id

Line 3476: from mst_trips mt,

3472: -- total orders for a given mode_of_transport
3473: if p_activity_type is null and p_mode is not null then
3474: select count(mdd.delivery_detail_id)
3475: into l_total_orders
3476: from mst_trips mt,
3477: mst_trip_stops mts,
3478: mst_delivery_legs mdl,
3479: mst_deliveries md,
3480: mst_delivery_details mdd,

Line 3504: from mst_trips mt,

3500: - ------------------------------------------ -
3501: */
3502: /*select count(mdd.delivery_detail_id)
3503: into l_total_orders
3504: from mst_trips mt,
3505: mst_trip_stops mts,
3506: mst_delivery_legs mdl,
3507: mst_deliveries md,
3508: mst_delivery_details mdd,

Line 3531: FROM MST_TRIPS T,

3527: WHERE MD.PLAN_ID = MDA.PLAN_ID
3528: AND MD.DELIVERY_ID = MDA.DELIVERY_ID
3529: AND MD.DELIVERY_ID IN
3530: (SELECT MDL.DELIVERY_ID
3531: FROM MST_TRIPS T,
3532: MST_TRIP_STOPS TS,
3533: MST_DELIVERY_LEGS MDL
3534: WHERE MDL.PLAN_ID = MD.PLAN_ID
3535: AND TS.PLAN_ID = MDL.PLAN_ID

Line 3556: from mst_trips mt,

3552: - ------------------------------------------ -
3553: */
3554: /*select count(mdd.delivery_detail_id)
3555: into l_total_orders
3556: from mst_trips mt,
3557: mst_trip_stops mts,
3558: mst_delivery_legs mdl,
3559: mst_deliveries md,
3560: mst_delivery_details mdd,

Line 3582: FROM MST_TRIPS T,

3578: WHERE MD.PLAN_ID = MDA.PLAN_ID
3579: AND MD.DELIVERY_ID = MDA.DELIVERY_ID
3580: AND MD.DELIVERY_ID IN
3581: (SELECT MDL.DELIVERY_ID
3582: FROM MST_TRIPS T,
3583: MST_TRIP_STOPS TS,
3584: MST_DELIVERY_LEGS MDL
3585: WHERE MDL.PLAN_ID = MD.PLAN_ID
3586: AND TS.PLAN_ID = MDL.PLAN_ID

Line 3633: FROM mst_trips mt,

3629: /*SELECT SUM(NVL(mdl.allocated_fac_loading_cost,0) +
3630: NVL(mdl.allocated_transport_cost,0) +
3631: NVL(mdl.allocated_fac_shp_hand_cost,0) )
3632: INTO l_loading_cost
3633: FROM mst_trips mt,
3634: mst_trip_stops mts,
3635: mst_delivery_legs mdl
3636: WHERE mt.plan_id = p_plan_id
3637: AND mt.mode_of_transport = p_mode

Line 3654: mst_trips mt,

3650: AND mdl.delivery_id IN
3651: ( SELECT md.delivery_id
3652: FROM mst_delivery_legs mdl1,
3653: mst_deliveries md,
3654: mst_trips mt,
3655: mst_trip_stops mts
3656: WHERE mt.plan_id = mdl1.plan_id
3657: AND mt.trip_id = mdl1.trip_id
3658: AND mt.mode_of_transport = p_mode

Line 3680: mst_trips mt,

3676: AND mdl.delivery_id IN
3677: ( SELECT md.delivery_id
3678: FROM mst_delivery_legs mdl1,
3679: mst_deliveries md,
3680: mst_trips mt,
3681: mst_trip_stops mts
3682: WHERE mt.plan_id = mdl1.plan_id
3683: AND mt.trip_id = mdl1.trip_id
3684: AND mt.mode_of_transport = p_mode

Line 3736: from mst_trips mt,

3732: /*select sum(NVL(mdl.allocated_fac_unloading_cost,0)+
3733: NVL(mdl.allocated_transport_cost,0) +
3734: NVL(mdl.allocated_fac_rec_hand_cost,0) )
3735: into l_unloading_cost
3736: from mst_trips mt,
3737: mst_trip_stops mts,
3738: mst_delivery_legs mdl
3739: where mt.plan_id = p_plan_id
3740: and mt.mode_of_transport = p_mode

Line 3757: mst_trips mt,

3753: AND mdl.delivery_id IN
3754: ( SELECT md.delivery_id
3755: FROM mst_delivery_legs mdl1,
3756: mst_deliveries md,
3757: mst_trips mt,
3758: mst_trip_stops mts
3759: WHERE mt.plan_id = mdl1.plan_id
3760: AND mt.trip_id = mdl1.trip_id
3761: AND mt.mode_of_transport = p_mode

Line 3785: mst_trips mt,

3781: AND mdl.delivery_id IN
3782: ( SELECT md.delivery_id
3783: FROM mst_delivery_legs mdl1,
3784: mst_deliveries md,
3785: mst_trips mt,
3786: mst_trip_stops mts
3787: WHERE mt.plan_id = mdl1.plan_id
3788: AND mt.trip_id = mdl1.trip_id
3789: AND mt.mode_of_transport = p_mode

Line 3822: from mst_trips mt,

3818: l_total_arriving_cost number;
3819:
3820: cursor departing_delivery_leg is
3821: select sum(mdl.allocated_fac_loading_cost + mdl.ALLOCATED_FAC_SHP_HAND_COST + mdl.allocated_transport_cost) total_departing_cost
3822: from mst_trips mt,
3823: mst_trip_stops mts,
3824: mst_delivery_legs mdl
3825: where mt.plan_id = p_plan_id
3826: and mt.mode_of_transport = p_mode

Line 3833: from mst_trips mt,

3829: and mts.stop_location_id = p_my_fac_location_id;
3830:
3831: cursor arriving_delivery_leg is
3832: select sum(mdl.allocated_fac_unloading_cost + mdl.ALLOCATED_FAC_REC_HAND_COST+ mdl.allocated_transport_cost) total_arriving_cost
3833: from mst_trips mt,
3834: mst_trip_stops mts,
3835: mst_delivery_legs mdl
3836: where mt.plan_id = p_plan_id
3837: and mt.mode_of_transport = p_mode

Line 3866: from mst_trips mt,

3862: -- Modified for performance ( bug#3379415).
3863: -- -----------------------------------------
3864: select sum(md.gross_weight)
3865: into l_loading_weight
3866: from mst_trips mt,
3867: mst_trip_stops mts,
3868: mst_delivery_legs mdl,
3869: mst_deliveries md
3870: where mt.plan_id = p_plan_id

Line 3900: from mst_trips mt,

3896: -- Modified for performance ( bug#3379415).
3897: -- -----------------------------------------
3898: select sum(md.gross_weight)
3899: into l_unloading_weight
3900: from mst_trips mt,
3901: mst_trip_stops mts,
3902: mst_delivery_legs mdl,
3903: mst_deliveries md
3904: where mt.plan_id = p_plan_id

Line 3934: from mst_trips mt,

3930: -- Modified for performance ( bug#3379415).
3931: -- -----------------------------------------
3932: select sum(md.volume)
3933: into l_loading_cube
3934: from mst_trips mt,
3935: mst_trip_stops mts,
3936: mst_delivery_legs mdl,
3937: mst_deliveries md
3938: where mt.plan_id = p_plan_id

Line 3968: from mst_trips mt,

3964: -- Modified for performance ( bug#3379415).
3965: -- -----------------------------------------
3966: select sum(md.volume)
3967: into l_unloading_cube
3968: from mst_trips mt,
3969: mst_trip_stops mts,
3970: mst_delivery_legs mdl,
3971: mst_deliveries md
3972: where mt.plan_id = p_plan_id

Line 4002: from mst_trips mt,

3998: -- Modified for performance ( bug#3379415).
3999: -- -----------------------------------------
4000: select sum(md.number_of_pallets)
4001: into l_loading_pallets
4002: from mst_trips mt,
4003: mst_trip_stops mts,
4004: mst_delivery_legs mdl,
4005: mst_deliveries md
4006: where mt.plan_id = p_plan_id

Line 4036: from mst_trips mt,

4032: -- Modified for performance ( bug#3379415).
4033: -- -----------------------------------------
4034: select sum(md.number_of_pallets)
4035: into l_unloading_pallets
4036: from mst_trips mt,
4037: mst_trip_stops mts,
4038: mst_delivery_legs mdl,
4039: mst_deliveries md
4040: where mt.plan_id = p_plan_id

Line 4070: from mst_trips mt,

4066: -- Modified for performance ( bug#3379415).
4067: -- -----------------------------------------
4068: select sum(md.number_of_pieces)
4069: into l_loading_pieces
4070: from mst_trips mt,
4071: mst_trip_stops mts,
4072: mst_delivery_legs mdl,
4073: mst_deliveries md
4074: where mt.plan_id = p_plan_id

Line 4104: from mst_trips mt,

4100: -- Modified for performance ( bug#3379415).
4101: -- -----------------------------------------
4102: SELECT sum(md.number_of_pieces)
4103: into l_unloading_pieces
4104: from mst_trips mt,
4105: mst_trip_stops mts,
4106: mst_delivery_legs mdl,
4107: mst_deliveries md
4108: where mt.plan_id = p_plan_id

Line 4150: FROM mst_trips t

4146: --AND owner_type = 3; -- 'carrier'
4147:
4148: CURSOR carrier_trips IS
4149: SELECT t.trip_id, t.mode_of_transport
4150: FROM mst_trips t
4151: WHERE t.plan_id = p_plan_id
4152: AND t.carrier_id = p_carrier_id
4153: ORDER BY t.mode_of_transport;
4154:

Line 4243: FROM mst_trips t,

4239: AND owner_type = CARRIER;
4240:
4241: CURSOR trips_to_location(p_location_id IN NUMBER) IS
4242: SELECT t.trip_id, t.mode_of_transport
4243: FROM mst_trips t,
4244: mst_trip_stops ts
4245: WHERE t.plan_id = p_plan_id
4246: AND t.plan_id = ts.plan_id
4247: AND t.trip_id = ts.trip_id

Line 4315: mst_trips mt

4311: mdl.drop_off_stop_id,
4312: mdl.allocated_fac_unloading_cost,0))
4313: FROM mst_delivery_legs mdl,
4314: mst_trip_stops mts,
4315: mst_trips mt
4316: WHERE mdl.plan_id = p_plan_id
4317: AND mts.plan_id = mdl.plan_id
4318: AND ( mts.stop_id = mdl.pick_up_stop_id
4319: OR mts.stop_id = mdl.drop_off_stop_id)

Line 4343: mst_trips mt

4339: mdl.drop_off_stop_id,
4340: mdl.allocated_fac_Rec_hand_cost,0) )
4341: FROM mst_delivery_legs mdl,
4342: mst_trip_stops mts,
4343: mst_trips mt
4344: WHERE mdl.plan_id = p_plan_id
4345: AND mt.plan_id = mdl.plan_id
4346: AND mt.trip_id = mdl.trip_id
4347: AND mt.plan_id = mts.plan_Id

Line 4397: mst_trips mt,

4393: WHERE md.plan_id = p_plan_id
4394: AND md.delivery_id IN
4395: (SELECT mdl.delivery_id
4396: FROM mst_delivery_legs mdl,
4397: mst_trips mt,
4398: mst_trip_stops mts
4399: WHERE mdl.plan_id = md.plan_id
4400: AND mts.plan_Id = mdl.plan_id
4401: AND mts.stop_id = mdl.drop_off_stop_id

Line 4420: mst_trips mt,

4416: WHERE md.plan_id = p_plan_id
4417: AND md.delivery_id IN
4418: (SELECT mdl.delivery_id
4419: FROM mst_delivery_legs mdl,
4420: mst_trips mt,
4421: mst_trip_stops mts
4422: WHERE mdl.plan_id = md.plan_id
4423: AND mts.plan_id = mdl.plan_id
4424: AND mts.stop_id = mdl.pick_up_stop_id

Line 4449: mst_trips mt,

4445: WHERE md.plan_id = p_plan_id
4446: AND md.delivery_id IN
4447: (SELECT mdl.delivery_id
4448: FROM mst_delivery_legs mdl,
4449: mst_trips mt,
4450: mst_trip_stops mts
4451: WHERE mdl.plan_id = md.plan_id
4452: AND mts.plan_Id = mdl.plan_id
4453: AND ( mts.stop_id = mdl.pick_up_stop_id

Line 4468: mst_trips mt,

4464: WHERE md.plan_id = p_plan_id
4465: AND md.delivery_id IN
4466: (SELECT mdl.delivery_id
4467: FROM mst_delivery_legs mdl,
4468: mst_trips mt,
4469: mst_trip_stops mts
4470: WHERE mdl.plan_id = md.plan_id
4471: AND mts.plan_Id = mdl.plan_id
4472: AND mts.stop_id = mdl.pick_up_stop_id

Line 4488: mst_trips mt,

4484: WHERE md.plan_id = p_plan_id
4485: AND md.delivery_id IN
4486: (SELECT mdl.delivery_id
4487: FROM mst_delivery_legs mdl,
4488: mst_trips mt,
4489: mst_trip_stops mts
4490: WHERE mdl.plan_id = md.plan_id
4491: AND mts.plan_Id = mdl.plan_id
4492: AND mts.stop_id = mdl.drop_off_stop_id

Line 4517: mst_trips mt,

4513: WHERE md.plan_id = p_plan_id
4514: AND md.delivery_id IN
4515: (SELECT mdl.delivery_id
4516: FROM mst_delivery_legs mdl,
4517: mst_trips mt,
4518: mst_trip_stops mts
4519: WHERE mdl.plan_id = md.plan_id
4520: AND mts.plan_Id = mdl.plan_id
4521: AND ( mts.stop_id = mdl.pick_up_stop_id

Line 4535: mst_trips mt,

4531: WHERE md.plan_id = p_plan_id
4532: AND md.delivery_id IN
4533: (SELECT mdl.delivery_id
4534: FROM mst_delivery_legs mdl,
4535: mst_trips mt,
4536: mst_trip_stops mts
4537: WHERE mdl.plan_id = md.plan_id
4538: AND mts.plan_Id = mdl.plan_id
4539: AND mts.stop_id = mdl.pick_up_stop_id

Line 4554: mst_trips mt,

4550: WHERE md.plan_id = p_plan_id
4551: AND md.delivery_id IN
4552: (SELECT mdl.delivery_id
4553: FROM mst_delivery_legs mdl,
4554: mst_trips mt,
4555: mst_trip_stops mts
4556: WHERE mdl.plan_id = md.plan_id
4557: AND mts.plan_Id = mdl.plan_id
4558: AND mts.stop_id = mdl.drop_off_stop_id

Line 4602: mst_trips mt,

4598: WHERE md.plan_id = p_plan_id
4599: AND md.delivery_id IN
4600: (SELECT mdl.delivery_id
4601: FROM mst_delivery_legs mdl,
4602: mst_trips mt,
4603: mst_trip_stops mts
4604: WHERE mdl.plan_id = md.plan_id
4605: AND mts.plan_Id = mdl.plan_id
4606: AND mts.stop_id = mdl.drop_off_stop_id

Line 4625: mst_trips mt,

4621: WHERE md.plan_id = p_plan_id
4622: AND md.delivery_id IN
4623: (SELECT mdl.delivery_id
4624: FROM mst_delivery_legs mdl,
4625: mst_trips mt,
4626: mst_trip_stops mts
4627: WHERE mdl.plan_id = md.plan_id
4628: AND mts.plan_id = mdl.plan_id
4629: AND mts.stop_id = mdl.pick_up_stop_id

Line 4654: mst_trips mt,

4650: WHERE md.plan_id = p_plan_id
4651: AND md.delivery_id IN
4652: (SELECT mdl.delivery_id
4653: FROM mst_delivery_legs mdl,
4654: mst_trips mt,
4655: mst_trip_stops mts
4656: WHERE mdl.plan_id = md.plan_id
4657: AND mts.plan_Id = mdl.plan_id
4658: AND (mts.stop_id = mdl.pick_up_stop_id

Line 4673: mst_trips mt,

4669: WHERE md.plan_id = p_plan_id
4670: AND md.delivery_id IN
4671: (SELECT mdl.delivery_id
4672: FROM mst_delivery_legs mdl,
4673: mst_trips mt,
4674: mst_trip_stops mts
4675: WHERE mdl.plan_id = md.plan_id
4676: AND mts.plan_Id = mdl.plan_id
4677: AND mts.stop_id = mdl.pick_up_stop_id

Line 4693: mst_trips mt,

4689: WHERE md.plan_id = p_plan_id
4690: AND md.delivery_id IN
4691: (SELECT mdl.delivery_id
4692: FROM mst_delivery_legs mdl,
4693: mst_trips mt,
4694: mst_trip_stops mts
4695: WHERE mdl.plan_id = md.plan_id
4696: AND mts.plan_Id = mdl.plan_id
4697: AND mts.stop_id = mdl.drop_off_stop_id

Line 4722: mst_trips mt,

4718: WHERE md.plan_id = p_plan_id
4719: AND md.delivery_id IN
4720: (SELECT mdl.delivery_id
4721: FROM mst_delivery_legs mdl,
4722: mst_trips mt,
4723: mst_trip_stops mts
4724: WHERE mdl.plan_id = md.plan_id
4725: AND mts.plan_Id = mdl.plan_id
4726: AND (mts.stop_id = mdl.pick_up_stop_id

Line 4740: mst_trips mt,

4736: WHERE md.plan_id = p_plan_id
4737: AND md.delivery_id IN
4738: (SELECT mdl.delivery_id
4739: FROM mst_delivery_legs mdl,
4740: mst_trips mt,
4741: mst_trip_stops mts
4742: WHERE mdl.plan_id = md.plan_id
4743: AND mts.plan_Id = mdl.plan_id
4744: AND mts.stop_id = mdl.pick_up_stop_id

Line 4759: mst_trips mt,

4755: WHERE md.plan_id = p_plan_id
4756: AND md.delivery_id IN
4757: (SELECT mdl.delivery_id
4758: FROM mst_delivery_legs mdl,
4759: mst_trips mt,
4760: mst_trip_stops mts
4761: WHERE mdl.plan_id = md.plan_id
4762: AND mts.plan_Id = mdl.plan_id
4763: AND mts.stop_id = mdl.drop_off_stop_id

Line 4805: mst_trips mt,

4801: WHERE md.plan_id = p_plan_id
4802: AND md.delivery_id IN
4803: (SELECT mdl.delivery_id
4804: FROM mst_delivery_legs mdl,
4805: mst_trips mt,
4806: mst_trip_stops mts
4807: WHERE mdl.plan_id = md.plan_id
4808: AND mts.plan_Id = mdl.plan_id
4809: AND mts.stop_id = mdl.drop_off_stop_id

Line 4828: mst_trips mt,

4824: WHERE md.plan_id = p_plan_id
4825: AND md.delivery_id IN
4826: (SELECT mdl.delivery_id
4827: FROM mst_delivery_legs mdl,
4828: mst_trips mt,
4829: mst_trip_stops mts
4830: WHERE mdl.plan_id = md.plan_id
4831: AND mts.plan_id = mdl.plan_id
4832: AND mts.stop_id = mdl.pick_up_stop_id

Line 4857: mst_trips mt,

4853: WHERE md.plan_id = p_plan_id
4854: AND md.delivery_id IN
4855: (SELECT mdl.delivery_id
4856: FROM mst_delivery_legs mdl,
4857: mst_trips mt,
4858: mst_trip_stops mts
4859: WHERE mdl.plan_id = md.plan_id
4860: AND mts.plan_Id = mdl.plan_id
4861: AND ( mts.stop_id = mdl.pick_up_stop_id

Line 4876: mst_trips mt,

4872: WHERE md.plan_id = p_plan_id
4873: AND md.delivery_id IN
4874: (SELECT mdl.delivery_id
4875: FROM mst_delivery_legs mdl,
4876: mst_trips mt,
4877: mst_trip_stops mts
4878: WHERE mdl.plan_id = md.plan_id
4879: AND mts.plan_Id = mdl.plan_id
4880: AND mts.stop_id = mdl.pick_up_stop_id

Line 4896: mst_trips mt,

4892: WHERE md.plan_id = p_plan_id
4893: AND md.delivery_id IN
4894: (SELECT mdl.delivery_id
4895: FROM mst_delivery_legs mdl,
4896: mst_trips mt,
4897: mst_trip_stops mts
4898: WHERE mdl.plan_id = md.plan_id
4899: AND mts.plan_Id = mdl.plan_id
4900: AND mts.stop_id = mdl.drop_off_stop_id

Line 4925: mst_trips mt,

4921: WHERE md.plan_id = p_plan_id
4922: AND md.delivery_id IN
4923: (SELECT mdl.delivery_id
4924: FROM mst_delivery_legs mdl,
4925: mst_trips mt,
4926: mst_trip_stops mts
4927: WHERE mdl.plan_id = md.plan_id
4928: AND mts.plan_Id = mdl.plan_id
4929: AND ( mts.stop_id = mdl.pick_up_stop_id

Line 4943: mst_trips mt,

4939: WHERE md.plan_id = p_plan_id
4940: AND md.delivery_id IN
4941: (SELECT mdl.delivery_id
4942: FROM mst_delivery_legs mdl,
4943: mst_trips mt,
4944: mst_trip_stops mts
4945: WHERE mdl.plan_id = md.plan_id
4946: AND mts.plan_Id = mdl.plan_id
4947: AND mts.stop_id = mdl.pick_up_stop_id

Line 4962: mst_trips mt,

4958: WHERE md.plan_id = p_plan_id
4959: AND md.delivery_id IN
4960: (SELECT mdl.delivery_id
4961: FROM mst_delivery_legs mdl,
4962: mst_trips mt,
4963: mst_trip_stops mts
4964: WHERE mdl.plan_id = md.plan_id
4965: AND mts.plan_Id = mdl.plan_id
4966: AND mts.stop_id = mdl.drop_off_stop_id

Line 5008: mst_trips mt,

5004: WHERE md.plan_id = p_plan_id
5005: AND md.delivery_id IN
5006: (SELECT mdl.delivery_id
5007: FROM mst_delivery_legs mdl,
5008: mst_trips mt,
5009: mst_trip_stops mts
5010: WHERE mdl.plan_id = md.plan_id
5011: AND mts.plan_Id = mdl.plan_id
5012: AND mts.stop_id = mdl.drop_off_stop_id

Line 5031: mst_trips mt,

5027: WHERE md.plan_id = p_plan_id
5028: AND md.delivery_id IN
5029: (SELECT mdl.delivery_id
5030: FROM mst_delivery_legs mdl,
5031: mst_trips mt,
5032: mst_trip_stops mts
5033: WHERE mdl.plan_id = md.plan_id
5034: AND mts.plan_id = mdl.plan_id
5035: AND mts.stop_id = mdl.pick_up_stop_id

Line 5060: mst_trips mt,

5056: WHERE md.plan_id = p_plan_id
5057: AND md.delivery_id IN
5058: (SELECT mdl.delivery_id
5059: FROM mst_delivery_legs mdl,
5060: mst_trips mt,
5061: mst_trip_stops mts
5062: WHERE mdl.plan_id = md.plan_id
5063: AND mts.plan_Id = mdl.plan_id
5064: AND ( mts.stop_id = mdl.pick_up_stop_id

Line 5079: mst_trips mt,

5075: WHERE md.plan_id = p_plan_id
5076: AND md.delivery_id IN
5077: (SELECT mdl.delivery_id
5078: FROM mst_delivery_legs mdl,
5079: mst_trips mt,
5080: mst_trip_stops mts
5081: WHERE mdl.plan_id = md.plan_id
5082: AND mts.plan_Id = mdl.plan_id
5083: AND mts.stop_id = mdl.pick_up_stop_id

Line 5099: mst_trips mt,

5095: WHERE md.plan_id = p_plan_id
5096: AND md.delivery_id IN
5097: (SELECT mdl.delivery_id
5098: FROM mst_delivery_legs mdl,
5099: mst_trips mt,
5100: mst_trip_stops mts
5101: WHERE mdl.plan_id = md.plan_id
5102: AND mts.plan_Id = mdl.plan_id
5103: AND mts.stop_id = mdl.drop_off_stop_id

Line 5128: mst_trips mt,

5124: WHERE md.plan_id = p_plan_id
5125: AND md.delivery_id IN
5126: (SELECT mdl.delivery_id
5127: FROM mst_delivery_legs mdl,
5128: mst_trips mt,
5129: mst_trip_stops mts
5130: WHERE mdl.plan_id = md.plan_id
5131: AND mts.plan_Id = mdl.plan_id
5132: AND ( mts.stop_id = mdl.pick_up_stop_id

Line 5146: mst_trips mt,

5142: WHERE md.plan_id = p_plan_id
5143: AND md.delivery_id IN
5144: (SELECT mdl.delivery_id
5145: FROM mst_delivery_legs mdl,
5146: mst_trips mt,
5147: mst_trip_stops mts
5148: WHERE mdl.plan_id = md.plan_id
5149: AND mts.plan_Id = mdl.plan_id
5150: AND mts.stop_id = mdl.pick_up_stop_id

Line 5165: mst_trips mt,

5161: WHERE md.plan_id = p_plan_id
5162: AND md.delivery_id IN
5163: (SELECT mdl.delivery_id
5164: FROM mst_delivery_legs mdl,
5165: mst_trips mt,
5166: mst_trip_stops mts
5167: WHERE mdl.plan_id = md.plan_id
5168: AND mts.plan_Id = mdl.plan_id
5169: AND mts.stop_id = mdl.drop_off_stop_id

Line 5220: FROM MST_TRIPS T,

5216: WHERE MD.PLAN_ID = MDA.PLAN_ID
5217: AND MD.DELIVERY_ID = MDA.DELIVERY_ID
5218: AND MD.DELIVERY_ID IN
5219: (SELECT MDL.DELIVERY_ID
5220: FROM MST_TRIPS T,
5221: MST_TRIP_STOPS TS,
5222: MST_DELIVERY_LEGS MDL
5223: WHERE MDL.PLAN_ID = MD.PLAN_ID
5224: AND TS.PLAN_ID = MDL.PLAN_ID

Line 5245: FROM MST_TRIPS T,

5241: WHERE MD.PLAN_ID = MDA.PLAN_ID
5242: AND MD.DELIVERY_ID = MDA.DELIVERY_ID
5243: AND MD.DELIVERY_ID IN
5244: (SELECT MDL.DELIVERY_ID
5245: FROM MST_TRIPS T,
5246: MST_TRIP_STOPS TS,
5247: MST_DELIVERY_LEGS MDL
5248: WHERE MDL.PLAN_ID = MD.PLAN_ID
5249: AND TS.PLAN_ID = MDL.PLAN_ID

Line 5271: FROM MST_TRIPS T,

5267: WHERE MD.PLAN_ID = MDA.PLAN_ID
5268: AND MD.DELIVERY_ID = MDA.DELIVERY_ID
5269: AND MD.DELIVERY_ID IN
5270: (SELECT MDL.DELIVERY_ID
5271: FROM MST_TRIPS T,
5272: MST_TRIP_STOPS TS,
5273: MST_DELIVERY_LEGS MDL
5274: WHERE MDL.PLAN_ID = MD.PLAN_ID
5275: AND TS.PLAN_ID = MDL.PLAN_ID

Line 5305: FROM MST_TRIPS T,

5301: WHERE MD.PLAN_ID = MDA.PLAN_ID
5302: AND MD.DELIVERY_ID = MDA.DELIVERY_ID
5303: AND MD.DELIVERY_ID IN
5304: (SELECT MDL.DELIVERY_ID
5305: FROM MST_TRIPS T,
5306: MST_TRIP_STOPS TS,
5307: MST_DELIVERY_LEGS MDL
5308: WHERE MDL.PLAN_ID = MD.PLAN_ID
5309: AND TS.PLAN_ID = MDL.PLAN_ID

Line 5376: --FROM MST_TRIPS T,

5372: WHERE MD.PLAN_ID = MDA.PLAN_ID
5373: AND MD.DELIVERY_ID = MDA.DELIVERY_ID
5374: AND MD.DELIVERY_ID IN
5375: (SELECT MDL.DELIVERY_ID
5376: --FROM MST_TRIPS T,
5377: FROM MST_TRIP_STOPS TS,
5378: MST_DELIVERY_LEGS MDL
5379: WHERE MDL.PLAN_ID = MD.PLAN_ID
5380: AND TS.PLAN_ID = MDL.PLAN_ID

Line 5403: --FROM MST_TRIPS T,

5399: WHERE MD.PLAN_ID = MDA.PLAN_ID
5400: AND MD.DELIVERY_ID = MDA.DELIVERY_ID
5401: AND MD.DELIVERY_ID IN
5402: (SELECT MDL.DELIVERY_ID
5403: --FROM MST_TRIPS T,
5404: FROM MST_TRIP_STOPS TS,
5405: MST_DELIVERY_LEGS MDL
5406: WHERE MDL.PLAN_ID = MD.PLAN_ID
5407: AND TS.PLAN_ID = MDL.PLAN_ID

Line 5446: FROM mst_trips mt

5442: -- carrier facility.
5443: -- ---------------------------------------------
5444: SELECT COUNT(mt.trip_id)
5445: INTO l_total_trips
5446: FROM mst_trips mt
5447: WHERE mt.plan_id = p_plan_id
5448: AND mt.trip_id IN
5449: (SELECT mdl.trip_id
5450: FROM mst_delivery_legs mdl,

Line 5466: FROM mst_trips mt

5462: -- carrier facility.
5463: -- ---------------------------------------------
5464: SELECT COUNT(mt.trip_id)
5465: INTO l_total_trips
5466: FROM mst_trips mt
5467: WHERE mt.plan_id = p_plan_id
5468: AND mt.trip_id IN
5469: (SELECT mdl.trip_id
5470: FROM mst_deliveries md,

Line 5487: FROM mst_trips mt

5483: -- carrier facility.
5484: -- ------------------------------------------
5485: SELECT COUNT(mt.trip_id)
5486: INTO l_total_trips
5487: FROM mst_trips mt
5488: WHERE mt.plan_id = p_plan_id
5489: AND mt.trip_id IN
5490: (SELECT mdl.trip_id
5491: FROM mst_delivery_legs mdl,

Line 5513: FROM mst_trips mt

5509: -- ------------------------------------------------------------------
5510: /***********************
5511: SELECT COUNT(mt.trip_id)
5512: INTO l_total_trips
5513: FROM mst_trips mt
5514: WHERE mt.plan_id = p_plan_id
5515: AND mt.trip_id IN
5516: (SELECT mdl.trip_id
5517: FROM mst_delivery_legs mdl,

Line 5528: FROM mst_trips mt

5524: AND mt.carrier_id = p_carrier_id;
5525: *************************/
5526: SELECT COUNT(mt.trip_id)
5527: INTO l_total_trips
5528: FROM mst_trips mt
5529: WHERE mt.plan_id = p_plan_id
5530: AND mt.trip_id IN
5531: (SELECT mdl.trip_id
5532: FROM mst_delivery_legs mdl,

Line 5544: FROM mst_trips mt

5540: l_total_trips := 0;
5541:
5542: SELECT COUNT(mt.trip_id)
5543: INTO l_total_trips
5544: FROM mst_trips mt
5545: WHERE mt.plan_id = p_plan_id
5546: AND mt.trip_id IN
5547: (SELECT mdl.trip_id
5548: FROM mst_delivery_legs mdl,

Line 5593: FROM mst_trips mt

5589: IF p_Location_type = 'L' THEN
5590:
5591: SELECT COUNT(mt.trip_id)
5592: INTO l_total_trips
5593: FROM mst_trips mt
5594: WHERE mt.plan_id = p_plan_id
5595: AND mt.trip_id IN
5596: (SELECT mdl.trip_id
5597: FROM mst_delivery_legs mdl,

Line 5615: FROM mst_trips mt

5611: ELSIF p_Location_type = 'U' THEN
5612:
5613: SELECT COUNT(mt.trip_id)
5614: INTO l_total_trips
5615: FROM mst_trips mt
5616: WHERE mt.plan_id = p_plan_id
5617: AND mt.trip_id IN
5618: (SELECT mdl.trip_id
5619: FROM mst_delivery_legs mdl,

Line 5648: FROM mst_trips mt

5644: -- ---------------------------------------------------- --
5645: IF p_Location_type = 'L' THEN
5646: SELECT COUNT(mt.trip_id)
5647: INTO l_total_trips
5648: FROM mst_trips mt
5649: WHERE mt.plan_id = p_plan_id
5650: AND mt.trip_id IN
5651: (SELECT mdl.trip_id
5652: FROM mst_delivery_legs mdl,

Line 5670: FROM mst_trips mt

5666: ELSIF p_Location_type = 'U' THEN
5667:
5668: SELECT COUNT(mt.trip_id)
5669: INTO l_total_trips
5670: FROM mst_trips mt
5671: WHERE mt.plan_id = p_plan_id
5672: AND mt.trip_id IN
5673: (SELECT mdl.trip_id
5674: FROM mst_delivery_legs mdl,

Line 5721: mst_trips mt

5717: mdl.drop_off_stop_id,
5718: NVL(mdl.allocated_fac_Rec_hand_cost,0),0) ), 0)
5719: FROM mst_delivery_legs mdl,
5720: mst_trip_stops mts,
5721: mst_trips mt
5722: WHERE mdl.plan_id = p_plan_id
5723: AND mt.plan_id = mdl.plan_id
5724: AND mt.trip_id = mdl.trip_id
5725: AND mt.plan_id = mts.plan_Id

Line 5749: mst_trips mt

5745: mdl.drop_off_stop_id,
5746: NVL(mdl.allocated_fac_Rec_hand_cost,0),0) ), 0)
5747: FROM mst_delivery_legs mdl,
5748: mst_trip_stops mts,
5749: mst_trips mt
5750: WHERE mdl.plan_id = p_plan_id
5751: AND mt.plan_id = mdl.plan_id
5752: AND mt.trip_id = mdl.trip_id
5753: AND mt.plan_id = mts.plan_Id

Line 5954: from mst_trips mt

5950: l_count number;
5951: begin
5952: select count(mt.trip_id)
5953: into l_count
5954: from mst_trips mt
5955: where plan_id = p_plan_id
5956: and mt.continuous_move_id in (select cm.continuous_move_id
5957: from mst_cm_trips cm
5958: where cm.plan_id = p_plan_id);

Line 5999: mst_trips mt

5995: where md.plan_id = p_plan_id
5996: and exists (select 1
5997: from mst_delivery_legs mdl,
5998: mst_trip_stops mts,
5999: mst_trips mt
6000: where mdl.delivery_id = md.delivery_id
6001: and mdl.pick_up_stop_id = mts.stop_id
6002: and mt.trip_id = p_trip_id
6003: and mts.trip_id = mt.trip_id

Line 6022: mst_trips mt

6018: where md.plan_id = p_plan_id
6019: and exists (select 1
6020: from mst_delivery_legs mdl,
6021: mst_trip_stops mts,
6022: mst_trips mt
6023: where mdl.delivery_id = md.delivery_id
6024: and mdl.pick_up_stop_id = mts.stop_id
6025: and mt.trip_id = p_trip_id
6026: and mts.trip_id = mt.trip_id

Line 6045: mst_trips mt

6041: where md.plan_id = p_plan_id
6042: and exists (select 1
6043: from mst_delivery_legs mdl,
6044: mst_trip_stops mts,
6045: mst_trips mt
6046: where mdl.delivery_id = md.delivery_id
6047: and mdl.pick_up_stop_id = mts.stop_id
6048: and mt.trip_id = p_trip_id
6049: and mts.trip_id = mt.trip_id

Line 6068: mst_trips mt

6064: where md.plan_id = p_plan_id
6065: and exists (select 1
6066: from mst_delivery_legs mdl,
6067: mst_trip_stops mts,
6068: mst_trips mt
6069: where mdl.delivery_id = md.delivery_id
6070: and mdl.pick_up_stop_id = mts.stop_id
6071: and mt.trip_id = p_trip_id
6072: and mts.trip_id = mt.trip_id

Line 6085: from mst_trips mt

6081: l_count number;
6082: begin
6083: select count(mt.trip_id)
6084: into l_count
6085: from mst_trips mt
6086: where mt.mode_of_transport = 'TRUCK'
6087: and mt.plan_id = p_plan_id
6088: and mt.trip_id in (select mts.trip_id
6089: from mst_trip_stops mts

Line 6103: from mst_trips mt

6099: l_count number;
6100: begin
6101: select count(mt.trip_id)
6102: into l_count
6103: from mst_trips mt
6104: where mt.mode_of_transport = 'TRUCK'
6105: and mt.plan_id = p_plan_id
6106: and mt.trip_id in (select mts.trip_id
6107: from mst_trip_stops mts

Line 6122: from mst_trips

6118: l_count number;
6119: begin
6120: select count('x')
6121: into l_count
6122: from mst_trips
6123: where plan_id = p_plan_id
6124: and auto_release_flag = 1
6125: and mode_of_transport = p_mode;
6126: return l_count;

Line 6135: from mst_trips

6131: l_count number;
6132: begin
6133: select count('x')
6134: into l_count
6135: from mst_trips
6136: where plan_id = p_plan_id
6137: and release_status <> 4
6138: and release_date is not null
6139: and auto_release_flag <> 1

Line 6151: from mst_trips

6147: l_count number;
6148: begin
6149: select count('x')
6150: into l_count
6151: from mst_trips
6152: where plan_id = p_plan_id
6153: and release_status = 4
6154: and release_date is not null
6155: and mode_of_transport = p_mode;

Line 6165: from mst_trips

6161: l_count number;
6162: begin
6163: select count('x')
6164: into l_count
6165: from mst_trips
6166: where plan_id = p_plan_id
6167: and selected_for_release = 1
6168: and mode_of_transport = p_mode;
6169: return l_count;

Line 6178: from mst_trips

6174: l_count number;
6175: begin
6176: select count('x')
6177: into l_count
6178: from mst_trips
6179: where plan_id = p_plan_id
6180: and release_date is null
6181: and mode_of_transport = p_mode;
6182: return l_count;