DBA Data[Home] [Help]

APPS.MST_WB_UTIL dependencies on MST_TRIPS

Line 200: FROM mst_trips T

196: RETURN NUMBER IS
197:
198: CURSOR Cur_Circuity IS
199: SELECT (T.Total_trip_distance/T.Total_direct_distance -1)*100
200: FROM mst_trips T
201: WHERE T.plan_id = p_plan_id
202: AND T.trip_id = p_trip_id;
203:
204: v_circuity NUMBER;

Line 704: FROM Mst_Trips

700:
701: CURSOR Cm_Dist_Cur(Cp_Plan_Id IN NUMBER,
702: Cp_Cont_Move_Id IN NUMBER) IS
703: SELECT NVL(sum(Total_Trip_Distance),0)
704: FROM Mst_Trips
705: WHERE Plan_Id = Cp_Plan_Id
706: AND Continuous_Move_Id = Cp_Cont_Move_Id;
707:
708: l_Distance NUMBER;

Line 730: FROM Mst_Trips

726: Return NUMBER IS
727: CURSOR Cm_count_Cur(Cp_Plan_Id IN NUMBER,
728: Cp_Cont_Move_Id IN NUMBER) IS
729: SELECT COUNT(Trip_id)
730: FROM Mst_Trips
731: WHERE Plan_Id = Cp_Plan_Id
732: AND Continuous_Move_Id = Cp_Cont_Move_Id;
733:
734: l_trips NUMBER;

Line 822: from mst_trips

818: and trip_id = p_trip_id;
819:
820: cursor trips is
821: select nvl(peak_volume_utilization, 1)
822: from mst_trips
823: where plan_id = p_plan_id
824: and trip_id = p_trip_id;
825:
826: l_peak_volume number := 0;

Line 1268: from mst_trips mt

1264: l_trip_utilization number;
1265: BEGIN
1266: select nvl(peak_weight_utilization,0)
1267: into l_weight_utilization
1268: from mst_trips mt
1269: where mt.trip_id = p_trip_id
1270: and mt.plan_id = p_plan_id;
1271:
1272: select nvl(peak_volume_utilization,0)

Line 1274: from mst_trips mt

1270: and mt.plan_id = p_plan_id;
1271:
1272: select nvl(peak_volume_utilization,0)
1273: into l_volume_utilization
1274: from mst_trips mt
1275: where mt.trip_id = p_trip_id
1276: and mt.plan_id = p_plan_id;
1277:
1278: select nvl(peak_pallet_utilization,0)

Line 1280: from mst_trips mt

1276: and mt.plan_id = p_plan_id;
1277:
1278: select nvl(peak_pallet_utilization,0)
1279: into l_pallet_utilization
1280: from mst_trips mt
1281: where mt.trip_id = p_trip_id
1282: and mt.plan_id = p_plan_id;
1283:
1284: l_trip_utilization := l_weight_utilization;

Line 1305: from mst_trips

1301: l_time_remaining number;
1302: BEGIN
1303: select (trip_start_date - sysdate)
1304: into l_time_remaining
1305: from mst_trips
1306: where plan_id = p_plan_id
1307: and trip_id = p_trip_id;
1308: if l_time_remaining < 0 then
1309: return 0;

Line 1375: FROM mst_trips mt, wsh_lookups wlk

1371: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_220_1');
1372: --Trip_number, mode_of_transport
1373: SELECT mt.trip_number, wlk.meaning
1374: INTO l_id1, l_temp
1375: FROM mst_trips mt, wsh_lookups wlk
1376: WHERE plan_id = P_PLAN_ID
1377: AND trip_id = P_TRIP_ID
1378: and wlk.lookup_type = 'WSH_MODE_OF_TRANSPORT'
1379: and mt.mode_of_transport = wlk.lookup_code;

Line 1404: FROM mst_trips

1400: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_221_1');
1401: --Trip_number
1402: SELECT trip_number, carrier_id
1403: INTO l_id1, l_id2
1404: FROM mst_trips
1405: WHERE plan_id = P_PLAN_ID
1406: AND trip_id = P_TRIP_ID;
1407: -- item_description
1408: select description, med.delivery_detail_id

Line 1526: FROM mst_trips

1522: fnd_message.set_token('FACILITY_DESCRIPTION', l_temp);
1523: --trip_number,carrier_name
1524: SELECT trip_number, carrier_id
1525: INTO l_id1, l_id2
1526: FROM mst_trips
1527: WHERE plan_id = P_PLAN_ID
1528: AND trip_id = P_TRIP_ID;
1529: --carrier name
1530: SELECT freight_code INTO l_temp

Line 1545: FROM mst_trips mt

1541: --Trip_number, item_description,vehicle_type
1542: --Trip_number
1543: SELECT mt.trip_number,vehicle_type_id
1544: INTO l_id1,l_id2
1545: FROM mst_trips mt
1546: WHERE plan_id = P_PLAN_ID
1547: AND trip_id = P_TRIP_ID;
1548: fnd_message.set_token('TRIP_NUMBER', l_id1);
1549: -- item_description

Line 1578: FROM mst_trips mt

1574: --Trip_Number, Item_description, facility_description
1575: --Trip_number
1576: SELECT mt.trip_number
1577: INTO l_id1
1578: FROM mst_trips mt
1579: WHERE plan_id = P_PLAN_ID
1580: AND trip_id = P_TRIP_ID;
1581: fnd_message.set_token('TRIP_NUMBER', l_id1);
1582: -- item_description

Line 1612: FROM mst_trips mt, wsh_lookups wlk

1608: --Trip_number, mode_of_transport, facility_description
1609: --Trip_number, mode_of_transport
1610: SELECT mt.trip_number, wlk.meaning
1611: INTO l_id1, l_temp
1612: FROM mst_trips mt, wsh_lookups wlk
1613: WHERE plan_id = P_PLAN_ID
1614: AND trip_id = P_TRIP_ID
1615: and wlk.lookup_type = 'WSH_MODE_OF_TRANSPORT'
1616: and mt.mode_of_transport = wlk.lookup_code;

Line 1661: FROM mst_trips

1657: IF P_LINE_NUM = 1 THEN
1658: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_200_1');
1659: SELECT carrier_id, origin_location_id, destination_location_id, trip_number
1660: INTO l_id1, l_id2, l_id3, l_id4
1661: FROM mst_trips
1662: WHERE plan_id = P_PLAN_ID
1663: AND trip_id = P_TRIP_ID;
1664: fnd_message.set_token('TRIP_NUMBER', l_id4);
1665:

Line 1710: FROM mst_trips

1706: IF P_LINE_NUM = 1 THEN
1707: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_207_1');
1708: SELECT carrier_id, origin_location_id, destination_location_id, trip_number
1709: INTO l_id1, l_id2, l_id3, l_id4
1710: FROM mst_trips
1711: WHERE plan_id = P_PLAN_ID
1712: AND trip_id = P_TRIP_ID;
1713: fnd_message.set_token('TRIP_NUMBER', l_id4);
1714:

Line 1789: FROM mst_trips

1785: fnd_message.set_token('LAYOVER_TIME', l_id1);
1786:
1787: SELECT nvl(round(((trip_end_date - trip_start_date) * 24)),0)
1788: INTO l_id1
1789: FROM mst_trips
1790: WHERE plan_id = P_PLAN_ID
1791: AND trip_id = P_TRIP_ID;
1792: fnd_message.set_token('TIME', l_id1);
1793:

Line 1801: FROM mst_trips

1797: IF P_LINE_NUM = 1 THEN
1798: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_206_1');
1799: SELECT carrier_id, origin_location_id, destination_location_id, trip_number
1800: INTO l_id1, l_id2, l_id3, l_id4
1801: FROM mst_trips
1802: WHERE plan_id = P_PLAN_ID
1803: AND trip_id = P_TRIP_ID;
1804: fnd_message.set_token('TRIP_NUMBER', l_id4);
1805:

Line 1838: FROM mst_trips

1834: IF P_LINE_NUM = 1 THEN
1835: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_208_1');
1836: SELECT carrier_id, origin_location_id, destination_location_id, trip_number
1837: INTO l_id1, l_id2, l_id3, l_id4
1838: FROM mst_trips
1839: WHERE plan_id = P_PLAN_ID
1840: AND trip_id = P_TRIP_ID;
1841: fnd_message.set_token('TRIP_NUMBER', l_id4);
1842:

Line 1904: FROM mst_trips

1900: IF P_LINE_NUM = 1 THEN
1901: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_202_1');
1902: SELECT origin_location_id, destination_location_id, trip_number
1903: INTO l_id2, l_id3, l_id4
1904: FROM mst_trips
1905: WHERE plan_id = P_PLAN_ID
1906: AND trip_id = P_TRIP_ID;
1907: fnd_message.set_token('TRIP_NUMBER', l_id4);
1908:

Line 1925: FROM mst_trips

1921: IF P_LINE_NUM = 1 THEN
1922: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_203_1');
1923: SELECT trip_number
1924: INTO l_id1
1925: FROM mst_trips
1926: WHERE plan_id = P_PLAN_ID
1927: AND trip_id = P_TRIP_ID;
1928: fnd_message.set_token('TRIP_NUMBER', l_id1);
1929:

Line 1953: FROM mst_trips

1949: IF P_LINE_NUM = 1 THEN
1950: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_204_1');
1951: SELECT trip_number
1952: INTO l_id1
1953: FROM mst_trips
1954: WHERE plan_id = P_PLAN_ID
1955: AND trip_id = P_TRIP_ID;
1956: fnd_message.set_token('TRIP_NUMBER', l_id1);
1957:

Line 1996: FROM mst_trips

1992: IF P_LINE_NUM = 1 THEN
1993: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_205_1');
1994: SELECT trip_number
1995: INTO l_id1
1996: FROM mst_trips
1997: WHERE plan_id = P_PLAN_ID
1998: AND trip_id = P_TRIP_ID;
1999: fnd_message.set_token('TRIP_NUMBER', l_id1);
2000:

Line 2028: FROM mst_trips

2024: IF P_LINE_NUM = 1 THEN
2025: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_400_1');
2026: SELECT trip_number
2027: INTO l_id1
2028: FROM mst_trips
2029: WHERE plan_id = P_PLAN_ID
2030: AND trip_id = P_TRIP_ID;
2031: fnd_message.set_token('TRIP_NUMBER', l_id1);
2032:

Line 2051: FROM mst_trips

2047: IF P_LINE_NUM = 1 THEN
2048: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_401_1');
2049: SELECT trip_number
2050: INTO l_id1
2051: FROM mst_trips
2052: WHERE plan_id = P_PLAN_ID
2053: AND trip_id = P_TRIP_ID;
2054: fnd_message.set_token('TRIP_NUMBER', l_id1);
2055:

Line 2078: FROM mst_trips

2074: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_500_1');
2075: SELECT trip_number, origin_location_id, destination_location_id, carrier_id,
2076: round((nvl(total_basic_transport_cost,0) + nvl(total_accessorial_cost,0) + nvl(total_layover_cost,0) + nvl(total_load_unload_cost,0) + nvl(total_stop_cost,0)))
2077: INTO l_id1, l_id2, l_id3, l_id4, l_id5
2078: FROM mst_trips
2079: WHERE plan_id = P_PLAN_ID
2080: AND trip_id = P_TRIP_ID;
2081: fnd_message.set_token('TRIP_NUMBER', l_id1);
2082:

Line 2120: FROM mst_trips

2116: IF P_LINE_NUM = 1 THEN
2117: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_501_1');
2118: SELECT trip_number
2119: INTO l_id1
2120: FROM mst_trips
2121: WHERE plan_id = P_PLAN_ID
2122: AND trip_id = P_TRIP_ID;
2123: fnd_message.set_token('TRIP_NUMBER', l_id1);
2124:

Line 2138: FROM mst_trips mt,

2134: med.number1,
2135: med.number3,
2136: med.vehicle_type_id
2137: INTO l_id1, l_id2, l_id3, l_id4, l_id5, l_id6, l_id7, l_id8
2138: FROM mst_trips mt,
2139: mst_exception_details med
2140: WHERE mt.plan_id = med.plan_id
2141: AND med.plan_id = P_PLAN_ID
2142: AND mt.trip_id = P_TRIP_ID

Line 2200: FROM mst_trips mt,

2196: med.number2,
2197: med.number1,
2198: med.number3
2199: INTO l_id1, l_id2, l_id3, l_id4, l_id5, l_id6, l_id7
2200: FROM mst_trips mt,
2201: mst_exception_details med
2202: WHERE mt.plan_id = med.plan_id
2203: AND med.plan_id = P_PLAN_ID
2204: AND mt.trip_id = P_TRIP_ID

Line 2235: FROM mst_trips

2231: IF P_LINE_NUM = 1 THEN
2232: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_800_1');
2233: SELECT trip_number
2234: INTO l_id1
2235: FROM mst_trips
2236: WHERE plan_id = P_PLAN_ID
2237: AND trip_id = P_TRIP_ID;
2238: fnd_message.set_token('TRIP_NUMBER', l_id1);
2239:

Line 2266: FROM mst_trips

2262: IF P_LINE_NUM = 1 THEN
2263: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_801_1');
2264: SELECT trip_number, carrier_id
2265: INTO l_id1, l_id2
2266: FROM mst_trips
2267: WHERE plan_id = P_PLAN_ID
2268: AND trip_id = P_TRIP_ID;
2269: fnd_message.set_token('TRIP_NUMBER', l_id1);
2270:

Line 2302: FROM mst_trips

2298: IF P_LINE_NUM = 1 THEN
2299: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_803_1');
2300: SELECT trip_number
2301: INTO l_id1
2302: FROM mst_trips
2303: WHERE plan_id = P_PLAN_ID
2304: AND trip_id = P_TRIP_ID;
2305: fnd_message.set_token('TRIP_NUMBER', l_id1);
2306:

Line 2499: from mst_trips mt

2495: + nvl(mt.total_layover_cost,0)
2496: + nvl(mt.total_load_unload_cost,0)
2497: + nvl(mt.total_stop_cost,0))
2498: into l_plan_value
2499: from mst_trips mt
2500: where mt.plan_id = p_plan_id;
2501: */
2502: -- Changed as per bug # 3509257
2503: -- The Plan value should be calculated from the selling price at the delivery lines.

Line 2551: from mst_trips mt,

2547: /*
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,

Line 2572: from mst_trips mt,

2568: and mdd.split_from_delivery_detail_id is null;
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,

Line 2592: from mst_trips mt,

2588: and mdd.split_from_delivery_detail_id is null;
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,

Line 2621: from mst_trips t,

2617: where md.plan_id = mda.plan_id
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

Line 2656: from mst_trips mt,

2652: cursor departing_delivery_leg(l_plan_id in number,l_my_fac_location_id in number, l_mode in varchar2) is
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

Line 2671: from mst_trips mt,

2667: cursor arriving_delivery_leg(l_plan_id in number,l_my_fac_location_id in number, l_mode in varchar2) is
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

Line 2703: from mst_trips mt,

2699: l_loading_weight number;
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

Line 2734: from mst_trips mt,

2730: l_loading_cube number;
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

Line 2766: from mst_trips mt,

2762: l_loading_pieces number;
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

Line 2804: from mst_trips mt

2800: + nvl(mt.total_layover_cost,0)
2801: + nvl(mt.total_load_unload_cost,0)
2802: + nvl(mt.total_stop_cost,0))
2803: into l_total_value
2804: from mst_trips mt
2805: where mt.plan_id = p_plan_id
2806: and (mt.origin_location_id IN (select distinct fte.location_id
2807: from fte_location_parameters fte
2808: where fte.facility_id = p_facility_id)

Line 2841: from mst_trips t,

2837: where md.plan_id = mda.plan_id
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

Line 2935: from mst_trips mt

2931: + nvl(mt.total_layover_cost,0)
2932: + nvl(mt.total_load_unload_cost,0)
2933: + nvl(mt.total_stop_cost,0))
2934: into l_total_value
2935: from mst_trips mt
2936: where mt.plan_id = p_plan_id
2937: and mt.origin_location_id = p_origin_id;
2938:
2939: return l_total_value;

Line 2959: , mst_trips mt

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
2963: and mt.origin_location_id = p_origin_id;

Line 3008: from mst_trips mt

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

Line 3089: from mst_trips mt

3085: l_trip_count number;
3086: begin
3087: select count (1)
3088: into l_trip_count
3089: from mst_trips mt
3090: where mt.plan_id = p_plan_id
3091: and mt.mode_of_transport = p_mode_of_transport
3092: and mt.origin_location_id = p_origin_id;
3093:

Line 3115: from mst_trips mt

3111: + nvl(mt.total_handling_cost,0)
3112: + nvl(mt.total_load_unload_cost,0)
3113: + nvl(mt.total_stop_cost,0)),0)
3114: into l_cost
3115: from mst_trips mt
3116: where mt.plan_id = p_plan_id
3117: and mt.mode_of_transport = p_mode_of_transport
3118: and mt.origin_location_id = p_origin_id;
3119: */

Line 3127: from mst_trips mt

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

Line 3154: from mst_trips mt

3150: begin
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'

Line 3184: from mst_trips mt

3180: + nvl(mt.total_layover_cost,0)
3181: + nvl(mt.total_load_unload_cost,0)
3182: + nvl(mt.total_stop_cost,0))
3183: into l_total_value
3184: from mst_trips mt
3185: where mt.plan_id = p_plan_id
3186: and mt.destination_location_id = p_dest_id;
3187:
3188: return l_total_value;

Line 3207: , mst_trips mt

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
3211: and mt.destination_location_id = p_dest_id;

Line 3253: from mst_trips mt

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

Line 3332: from mst_trips mt

3328: l_trip_count number;
3329: begin
3330: select count (1)
3331: into l_trip_count
3332: from mst_trips mt
3333: where mt.plan_id = p_plan_id
3334: and mt.mode_of_transport = p_mode_of_transport
3335: and mt.destination_location_id = p_dest_id;
3336:

Line 3358: from mst_trips mt

3354: + nvl(mt.total_handling_cost,0)
3355: + nvl(mt.total_load_unload_cost,0)
3356: + nvl(mt.total_stop_cost,0)),0)
3357: into l_cost
3358: from mst_trips mt
3359: where mt.plan_id = p_plan_id
3360: and mt.mode_of_transport = p_mode_of_transport
3361: and mt.destination_location_id = p_dest_id;
3362: */

Line 3370: from mst_trips mt

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

Line 3397: from mst_trips mt

3393: begin
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'

Line 3428: from mst_trips mt

3424: + nvl(mt.total_layover_cost,0)
3425: + nvl(mt.total_load_unload_cost,0)
3426: + nvl(mt.total_stop_cost,0))
3427: into l_total_value
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

Line 3496: from mst_trips mt

3492: l_count_stops number;
3493: BEGIN
3494: select count(mt.trip_id)
3495: into l_count_stops
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

Line 3534: from mst_trips mt

3530: l_trip_count number;
3531: BEGIN
3532: select count(mt.trip_id)
3533: into l_trip_count
3534: from mst_trips mt
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

Line 3571: FROM MST_TRIPS MT

3567: + nvl(MT.TOTAL_HANDLING_COST,0)
3568: + nvl(MT.TOTAL_LOAD_UNLOAD_COST,0)
3569: + nvl(MT.TOTAL_STOP_COST,0))
3570: INTO l_cost
3571: FROM MST_TRIPS MT
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

Line 3597: , mst_trips mt

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
3601: and md.delivery_id = mdl.delivery_id

Line 3620: from mst_trips mt

3616: total_dtl number := 0;
3617: BEGIN
3618: select count(mt.trip_id)
3619: into total_dtl
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

Line 3664: from mst_trips mt

3660: + nvl(mt.total_layover_cost,0)
3661: + nvl(mt.total_load_unload_cost,0)
3662: + nvl(mt.total_stop_cost,0))
3663: into l_total_value
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

Line 3731: from mst_trips mt

3727: l_count_stops number;
3728: BEGIN
3729: select count(mt.trip_id)
3730: into l_count_stops
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

Line 3770: from mst_trips mt

3766: l_trip_count number;
3767: BEGIN
3768: select count(mt.trip_id)
3769: into l_trip_count
3770: from mst_trips mt
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

Line 3808: FROM MST_TRIPS MT

3804: + nvl(MT.TOTAL_HANDLING_COST,0)
3805: + nvl(MT.TOTAL_LOAD_UNLOAD_COST,0)
3806: + nvl(MT.TOTAL_STOP_COST,0))
3807: INTO l_cost
3808: FROM MST_TRIPS MT
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

Line 3834: , mst_trips mt

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
3838: and md.delivery_id = mdl.delivery_id

Line 3858: from mst_trips mt

3854: total_dtl number := 0;
3855: BEGIN
3856: select count(mt.trip_id)
3857: into total_dtl
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

Line 3945: , mst_trips mt

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
3949: and mt.plan_id = mdl.plan_id

Line 3964: from mst_trips mt

3960: return nvl(l_prev_carr,0);
3961: elsif p_identifier = 'C' then
3962: select nvl(mt.total_handling_cost,0) -- + mt.total_load_unload_cost)
3963: into l_carr_cost
3964: from mst_trips mt
3965: where mt.plan_id = p_plan_id
3966: and mt.trip_id = l_trip_id;
3967: end if;
3968:

Line 4180: , mst_trips mt

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
4184: and mdl.delivery_id = md.delivery_id

Line 4227: , mst_trips mt

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
4231: and mdl.delivery_id = md.delivery_id

Line 4370: FROM mst_trips

4366: SELECT SUM(total_basic_transport_cost + total_accessorial_cost +
4367: total_handling_cost + total_layover_cost +
4368: total_load_unload_cost + total_stop_cost)
4369: INTO l_cost
4370: FROM mst_trips
4371: WHERE plan_id = p_plan_id
4372: AND trip_id IN (p_trip_id1, p_trip_id2);
4373: RETURN l_cost;
4374: EXCEPTION

Line 4596: FROM mst_trips

4592: AND exception_type = P_EXCEPTION_TYPE;
4593:
4594: SELECT trip_number, origin_location_id, destination_location_id
4595: INTO l_id2, l_id3, l_id4
4596: FROM mst_trips
4597: WHERE plan_id = P_PLAN_ID
4598: AND trip_id = l_id1;
4599:
4600: fnd_message.set_name('MST', 'MST_EXCEP_TOKEN_202_1');

Line 4633: FROM mst_trips

4629: AND exception_type = P_EXCEPTION_TYPE;
4630:
4631: SELECT trip_number
4632: INTO l_id3
4633: FROM mst_trips
4634: WHERE trip_id = l_id1
4635: AND plan_id = P_PLAN_ID;
4636:
4637: IF l_id3 < 0 THEN

Line 5727: delete from MST_TRIPS

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;
5729:
5730: delete from MST_CM_TRIPS
5731: where plan_id = p_plan_id;

Line 5991: FROM mst_trips mt

5987:
5988: CURSOR cur_affected_trips(p_plan_id IN NUMBER,
5989: p_trip_id IN NUMBER) IS
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

Line 6044: l_update_stmt := ' UPDATE MST_TRIPS '||

6040: LOOP
6041: l_planned_flag := NULL;
6042: FETCH cur_affected_trips INTO l_rec_affected_trips;
6043: EXIT WHEN cur_affected_trips%NOTFOUND;
6044: l_update_stmt := ' UPDATE MST_TRIPS '||
6045: ' SET PLANNED_FLAG = DECODE(:p_Planned_Flag, '||
6046: ' 1, DECODE(SIGN(PLANNED_FLAG-2), '||
6047: ' -1, PLANNED_FLAG, 2), '||
6048: ' 3,DECODE(SIGN(PLANNED_FLAG-2), '||

Line 6086: FROM mst_trips mt

6082:
6083: CURSOR cur_affected_trips(p_plan_id IN NUMBER,
6084: p_Continuous_Move_Id IN NUMBER) IS
6085: SELECT TRIP_ID, PLANNED_FLAG
6086: FROM mst_trips mt
6087: WHERE plan_id = p_plan_id
6088: AND Continuous_Move_Id = p_Continuous_Move_Id
6089: FOR UPDATE OF PLANNED_FLAG NOWAIT;
6090:

Line 6100: l_update_stmt := ' UPDATE MST_TRIPS '||

6096: LOOP
6097: l_planned_flag := NULL;
6098: FETCH cur_affected_trips INTO l_rec_affected_trips;
6099: EXIT WHEN cur_affected_trips%NOTFOUND;
6100: l_update_stmt := ' UPDATE MST_TRIPS '||
6101: ' SET PLANNED_FLAG = DECODE(SIGN(PLANNED_FLAG-2),-1,PLANNED_FLAG,2) '||
6102: ' WHERE PLAN_ID = :p_Plan_Id '||
6103: ' AND TRIP_ID = :p_trip_id '||
6104: ' RETURNING planned_flag into :l_planned_flag';