DBA Data[Home] [Help]

VIEW: APPS.MST_CARR_UNDERUTIL_TRIP_V

Source

View Text - Preformatted

SELECT medd.plan_id , medd.exception_detail_id , medd.trip_id , mt.mode_of_transport , mt.trip_number , wl1.address1 , wl1.city , wl1.state , wl1.postal_code , wl1.country , wl2.address1 , wl2.city , wl2.state , wl2.postal_code , wl2.country , nvl ( sum ( md.gross_weight ), 0 ) , mp.weight_uom , nvl ( sum ( md.volume ), 0 ) , mp.volume_uom , nvl ( sum ( md.number_of_pallets ), 0 ) , nvl ( sum ( md.number_of_pieces ), 0 ) , nvl ( mst_wb_util.get_trip_orders ( medd.plan_id, medd.trip_id ), 0 ) , nvl ( mt.total_basic_transport_cost, 0 ) + nvl ( mt.total_accessorial_cost, 0 ) + nvl ( mt.total_handling_cost, 0 ) + nvl ( mt.total_layover_cost, 0 ) + nvl ( mt.total_load_unload_cost,0 ) + nvl ( mt.total_stop_cost, 0 ) , mp.currency_uom from mst_except_details_details medd , mst_trips mt , wsh_locations wl1 , wsh_locations wl2 , mst_deliveries md , mst_delivery_legs mdl , mst_plans mp WHERE medd.plan_id = mt.plan_id and medd.trip_id = mt.trip_id and mt.origin_location_id = wl1.wsh_location_id and mt.destination_location_id = wl2.wsh_location_id and medd.plan_id = mdl.plan_id and medd.trip_id = mdl.trip_id and medd.plan_id = md.plan_id and mdl.delivery_id = md.delivery_id and medd.plan_id = mp.plan_id group by medd.plan_id , medd.exception_detail_id , medd.trip_id , mt.mode_of_transport , mt.trip_number , wl1.address1 , wl1.city , wl1.state , wl1.postal_code , wl1.country , wl2.address1 , wl2.city , wl2.state , wl2.postal_code , wl2.country , mp.weight_uom , mp.volume_uom , nvl ( mst_wb_util.get_trip_orders ( medd.plan_id, medd.trip_id ), 0 ) , nvl ( mt.total_basic_transport_cost, 0 ) + nvl ( mt.total_accessorial_cost, 0 ) + nvl ( mt.total_handling_cost, 0 ) + nvl ( mt.total_layover_cost, 0 ) + nvl ( mt.total_load_unload_cost,0 ) + nvl ( mt.total_stop_cost, 0 ) , mp.currency_uom
View Text - HTML Formatted

SELECT MEDD.PLAN_ID
, MEDD.EXCEPTION_DETAIL_ID
, MEDD.TRIP_ID
, MT.MODE_OF_TRANSPORT
, MT.TRIP_NUMBER
, WL1.ADDRESS1
, WL1.CITY
, WL1.STATE
, WL1.POSTAL_CODE
, WL1.COUNTRY
, WL2.ADDRESS1
, WL2.CITY
, WL2.STATE
, WL2.POSTAL_CODE
, WL2.COUNTRY
, NVL ( SUM ( MD.GROSS_WEIGHT )
, 0 )
, MP.WEIGHT_UOM
, NVL ( SUM ( MD.VOLUME )
, 0 )
, MP.VOLUME_UOM
, NVL ( SUM ( MD.NUMBER_OF_PALLETS )
, 0 )
, NVL ( SUM ( MD.NUMBER_OF_PIECES )
, 0 )
, NVL ( MST_WB_UTIL.GET_TRIP_ORDERS ( MEDD.PLAN_ID
, MEDD.TRIP_ID )
, 0 )
, NVL ( MT.TOTAL_BASIC_TRANSPORT_COST
, 0 ) + NVL ( MT.TOTAL_ACCESSORIAL_COST
, 0 ) + NVL ( MT.TOTAL_HANDLING_COST
, 0 ) + NVL ( MT.TOTAL_LAYOVER_COST
, 0 ) + NVL ( MT.TOTAL_LOAD_UNLOAD_COST
, 0 ) + NVL ( MT.TOTAL_STOP_COST
, 0 )
, MP.CURRENCY_UOM
FROM MST_EXCEPT_DETAILS_DETAILS MEDD
, MST_TRIPS MT
, WSH_LOCATIONS WL1
, WSH_LOCATIONS WL2
, MST_DELIVERIES MD
, MST_DELIVERY_LEGS MDL
, MST_PLANS MP
WHERE MEDD.PLAN_ID = MT.PLAN_ID
AND MEDD.TRIP_ID = MT.TRIP_ID
AND MT.ORIGIN_LOCATION_ID = WL1.WSH_LOCATION_ID
AND MT.DESTINATION_LOCATION_ID = WL2.WSH_LOCATION_ID
AND MEDD.PLAN_ID = MDL.PLAN_ID
AND MEDD.TRIP_ID = MDL.TRIP_ID
AND MEDD.PLAN_ID = MD.PLAN_ID
AND MDL.DELIVERY_ID = MD.DELIVERY_ID
AND MEDD.PLAN_ID = MP.PLAN_ID GROUP BY MEDD.PLAN_ID
, MEDD.EXCEPTION_DETAIL_ID
, MEDD.TRIP_ID
, MT.MODE_OF_TRANSPORT
, MT.TRIP_NUMBER
, WL1.ADDRESS1
, WL1.CITY
, WL1.STATE
, WL1.POSTAL_CODE
, WL1.COUNTRY
, WL2.ADDRESS1
, WL2.CITY
, WL2.STATE
, WL2.POSTAL_CODE
, WL2.COUNTRY
, MP.WEIGHT_UOM
, MP.VOLUME_UOM
, NVL ( MST_WB_UTIL.GET_TRIP_ORDERS ( MEDD.PLAN_ID
, MEDD.TRIP_ID )
, 0 )
, NVL ( MT.TOTAL_BASIC_TRANSPORT_COST
, 0 ) + NVL ( MT.TOTAL_ACCESSORIAL_COST
, 0 ) + NVL ( MT.TOTAL_HANDLING_COST
, 0 ) + NVL ( MT.TOTAL_LAYOVER_COST
, 0 ) + NVL ( MT.TOTAL_LOAD_UNLOAD_COST
, 0 ) + NVL ( MT.TOTAL_STOP_COST
, 0 )
, MP.CURRENCY_UOM