DBA Data[Home] [Help]

VIEW: APPS.MST_REL_TL_V

Source

View Text - Preformatted

SELECT mt.plan_id , decode(MST_AGG_PKG.GET_TOTAL_EXCP_IN_TRIP(mt.plan_id, mt.trip_id), 0, 'jtfgnull.gif', 'jtfuwnac.gif') , mt.trip_id , mt.mode_of_transport , mt.trip_number , mt.continuous_move_id , mt.carrier_id , mt.carrier_service_id , mt.origin_location_id , mt.destination_location_id , wc.freight_code , mt.service_level , wlk.meaning , msikfv.concatenated_segments , substr(MST_WB_UTIL.GET_NAME(flp1.location_id), 1, 80) , flp1.facility_id , flp1.facility_code , flp1.description , wl1.city , wl1.state , wl1.postal_code , wl1.country , substr(MST_WB_UTIL.GET_NAME(flp2.location_id), 1, 80) , flp2.facility_id , flp2.facility_code , flp2.description , wl2.city , wl2.state , wl2.postal_code , wl2.country , MST_AGG_PKG.GET_TOTAL_TRIP_WEIGHT(mt.plan_id, mt.trip_id) , MST_AGG_PKG.GET_TOTAL_TRIP_VOLUME(mt.plan_id, mt.trip_id) , MST_AGG_PKG.GET_TOTAL_TRIP_PALLETS(mt.plan_id, mt.trip_id) , MST_AGG_PKG.GET_TOTAL_TRIP_PIECES(mt.plan_id, mt.trip_id) , MST_WB_UTIL.GET_TRIP_ORDERS(mt.plan_id, mt.trip_id) , nvl(mt.total_basic_transport_cost,0) , mp.currency_uom , greatest(peak_weight_utilization, peak_volume_utilization, peak_pallet_utilization) , MST_WB_UTIL.GET_TRIP_CIRCUITY(mt.plan_id, mt.trip_id) , nvl(mt.total_trip_distance,0) , MST_WB_UTIL.GET_TRIP_STOPS(mt.plan_id, mt.trip_id) , substr(MST_WB_UTIL.GET_HR_MIN (decode(greatest(mt.trip_start_date, sysdate), mt.trip_start_date, (mt.trip_start_date - sysdate) * 24, 0)), 1, 80) , decode(greatest(mt.trip_start_date, sysdate), mt.trip_start_date, (mt.trip_start_date - sysdate) * 24, 0) , ml1.meaning , ml2.meaning , ml3.meaning , mt.release_date , fnd_date.date_to_chardt(mt.release_date) , nvl(mt.selected_for_release, 2) from mst_trips mt , mst_plans mp , wsh_carriers wc , wsh_locations wl1 , wsh_locations wl2 , fte_location_parameters flp1 , fte_location_parameters flp2 , mtl_system_items_kfv msikfv , fte_vehicle_types fvt , mfg_lookups ml1 , mfg_lookups ml2 , mfg_lookups ml3 , wsh_lookups wlk WHERE mt.mode_of_transport = 'TRUCK' and mt.plan_id = mp.plan_id and mt.carrier_id = wc.carrier_id and mt.service_level = wlk.lookup_code and wlk.lookup_type = 'WSH_SERVICE_LEVELS' and mt.vehicle_type_id = fvt.vehicle_type_id and fvt.inventory_item_id = msikfv.inventory_item_id and fvt.organization_id = msikfv.organization_id and mt.origin_location_id = wl1.wsh_location_id and mt.destination_location_id = wl2.wsh_location_id and mt.origin_location_id = flp1.location_id and mt.destination_location_id = flp2.location_id and nvl(mt.planned_flag,4) = ml1.lookup_code and ml1.lookup_type = 'MST_TRIP_PLANNED_FLAG' and nvl(mt.selected_for_release,2) = ml2.lookup_code and ml2.lookup_type = 'MST_SELECTED_FOR_RELEASE' and nvl(mt.release_status, 5) = ml3.lookup_code and ml3.lookup_type = 'MST_RELEASE_STATUS'
View Text - HTML Formatted

SELECT MT.PLAN_ID
, DECODE(MST_AGG_PKG.GET_TOTAL_EXCP_IN_TRIP(MT.PLAN_ID
, MT.TRIP_ID)
, 0
, 'JTFGNULL.GIF'
, 'JTFUWNAC.GIF')
, MT.TRIP_ID
, MT.MODE_OF_TRANSPORT
, MT.TRIP_NUMBER
, MT.CONTINUOUS_MOVE_ID
, MT.CARRIER_ID
, MT.CARRIER_SERVICE_ID
, MT.ORIGIN_LOCATION_ID
, MT.DESTINATION_LOCATION_ID
, WC.FREIGHT_CODE
, MT.SERVICE_LEVEL
, WLK.MEANING
, MSIKFV.CONCATENATED_SEGMENTS
, SUBSTR(MST_WB_UTIL.GET_NAME(FLP1.LOCATION_ID)
, 1
, 80)
, FLP1.FACILITY_ID
, FLP1.FACILITY_CODE
, FLP1.DESCRIPTION
, WL1.CITY
, WL1.STATE
, WL1.POSTAL_CODE
, WL1.COUNTRY
, SUBSTR(MST_WB_UTIL.GET_NAME(FLP2.LOCATION_ID)
, 1
, 80)
, FLP2.FACILITY_ID
, FLP2.FACILITY_CODE
, FLP2.DESCRIPTION
, WL2.CITY
, WL2.STATE
, WL2.POSTAL_CODE
, WL2.COUNTRY
, MST_AGG_PKG.GET_TOTAL_TRIP_WEIGHT(MT.PLAN_ID
, MT.TRIP_ID)
, MST_AGG_PKG.GET_TOTAL_TRIP_VOLUME(MT.PLAN_ID
, MT.TRIP_ID)
, MST_AGG_PKG.GET_TOTAL_TRIP_PALLETS(MT.PLAN_ID
, MT.TRIP_ID)
, MST_AGG_PKG.GET_TOTAL_TRIP_PIECES(MT.PLAN_ID
, MT.TRIP_ID)
, MST_WB_UTIL.GET_TRIP_ORDERS(MT.PLAN_ID
, MT.TRIP_ID)
, NVL(MT.TOTAL_BASIC_TRANSPORT_COST
, 0)
, MP.CURRENCY_UOM
, GREATEST(PEAK_WEIGHT_UTILIZATION
, PEAK_VOLUME_UTILIZATION
, PEAK_PALLET_UTILIZATION)
, MST_WB_UTIL.GET_TRIP_CIRCUITY(MT.PLAN_ID
, MT.TRIP_ID)
, NVL(MT.TOTAL_TRIP_DISTANCE
, 0)
, MST_WB_UTIL.GET_TRIP_STOPS(MT.PLAN_ID
, MT.TRIP_ID)
, SUBSTR(MST_WB_UTIL.GET_HR_MIN (DECODE(GREATEST(MT.TRIP_START_DATE
, SYSDATE)
, MT.TRIP_START_DATE
, (MT.TRIP_START_DATE - SYSDATE) * 24
, 0))
, 1
, 80)
, DECODE(GREATEST(MT.TRIP_START_DATE
, SYSDATE)
, MT.TRIP_START_DATE
, (MT.TRIP_START_DATE - SYSDATE) * 24
, 0)
, ML1.MEANING
, ML2.MEANING
, ML3.MEANING
, MT.RELEASE_DATE
, FND_DATE.DATE_TO_CHARDT(MT.RELEASE_DATE)
, NVL(MT.SELECTED_FOR_RELEASE
, 2)
FROM MST_TRIPS MT
, MST_PLANS MP
, WSH_CARRIERS WC
, WSH_LOCATIONS WL1
, WSH_LOCATIONS WL2
, FTE_LOCATION_PARAMETERS FLP1
, FTE_LOCATION_PARAMETERS FLP2
, MTL_SYSTEM_ITEMS_KFV MSIKFV
, FTE_VEHICLE_TYPES FVT
, MFG_LOOKUPS ML1
, MFG_LOOKUPS ML2
, MFG_LOOKUPS ML3
, WSH_LOOKUPS WLK
WHERE MT.MODE_OF_TRANSPORT = 'TRUCK'
AND MT.PLAN_ID = MP.PLAN_ID
AND MT.CARRIER_ID = WC.CARRIER_ID
AND MT.SERVICE_LEVEL = WLK.LOOKUP_CODE
AND WLK.LOOKUP_TYPE = 'WSH_SERVICE_LEVELS'
AND MT.VEHICLE_TYPE_ID = FVT.VEHICLE_TYPE_ID
AND FVT.INVENTORY_ITEM_ID = MSIKFV.INVENTORY_ITEM_ID
AND FVT.ORGANIZATION_ID = MSIKFV.ORGANIZATION_ID
AND MT.ORIGIN_LOCATION_ID = WL1.WSH_LOCATION_ID
AND MT.DESTINATION_LOCATION_ID = WL2.WSH_LOCATION_ID
AND MT.ORIGIN_LOCATION_ID = FLP1.LOCATION_ID
AND MT.DESTINATION_LOCATION_ID = FLP2.LOCATION_ID
AND NVL(MT.PLANNED_FLAG
, 4) = ML1.LOOKUP_CODE
AND ML1.LOOKUP_TYPE = 'MST_TRIP_PLANNED_FLAG'
AND NVL(MT.SELECTED_FOR_RELEASE
, 2) = ML2.LOOKUP_CODE
AND ML2.LOOKUP_TYPE = 'MST_SELECTED_FOR_RELEASE'
AND NVL(MT.RELEASE_STATUS
, 5) = ML3.LOOKUP_CODE
AND ML3.LOOKUP_TYPE = 'MST_RELEASE_STATUS'