Professional Documents
Culture Documents
from (
SELECT del.delivery_id,
del.delivery_name,
iodv.organization_code,
iodv.organization_name,
iodv.business_unit_id,
iodv.legal_entity,
iodv.business_unit_name,
del.organization_id,
TO_CHAR(dha.request_ship_date,'YYY-MM-DD') request_ship_date, --fecha solicitud
dha.ordered_date ,
dha.request_arrival_date,
TO_CHAR(dha.submitted_date,'YYY-MM-DD') submitted_date, --fecha envio
dhe.attribute_char9 puerto_embarque,
dhe.attribute_char13 puerto_destino,
ship_from_loc.country country_from,
ship_loc.country country_to,
del.net_weight,
del.gross_weight,
del.weight_uom_code,
del.VOLUME,
del.VOLUME_UOM_CODE,
deldet.VOLUME Volume_line,
to_number(deldet.attribute5) peso_neto,
to_number(deldet.attribute6) peso_bruto,
deldet.attribute7 total_cajas,
(del.gross_weight - NVL(del.net_weight, 0)) tara,
deldet.gross_weight + ((deldet.gross_weight - NVL(deldet.net_weight, 0)))
net_weight_line,
deldet.gross_weight gross_weight_line,
deldet.SRC_REQUESTED_QUANTITY_UOM,
deldet.requested_quantity_uom,
deldet.converted_quantity,
deldet.shipped_quantity,
deldet.requested_quantity,
deldet.original_item_uom,
deldet.original_item_converted_qty,
deldet.sp_picked_quantity,
deldet.spq_uom,
itm.primary_uom_code,
case
when deldet.requested_quantity_uom <>'cja' then
(select conv.conversion_rate
from CONVERSION conv
where conv.inventory_item_id=itm.inventory_item_id
and conv.from_uom_code=deldet.requested_quantity_uom
and to_base_uom='cja'
and rownum=1
)
else
1
end factor_cajas,
case
when requested_quantity_uom <>'und' then
(select conv.conversion_rate
from CONVERSION conv
where conv.inventory_item_id=itm.inventory_item_id
and conv.from_uom_code=deldet.requested_quantity_uom
and to_base_uom='und'
and rownum=1
)
else
1
end factor_unidad,
del.confirm_date,
del.delivered_date,
del.tp_shipment_number,
bill_of_lading_number,
packing_slip_number,
ship_party.party_name ship_to_party_name,
sold_party.party_name sold_to_party_name,
bill_party.party_name bill_party_name,
deldet.source_shipment_id,
dfla.header_id,
deldet.source_header_id,
deldet.source_line_type,
deldet.sales_order_number,
deldet.sales_order_line_number,
deldet.sales_order_shipment_number,
deldet.source_shipment_number,
itm.inventory_item_id,
itm.item_number,
esit.description Desc_item,
deldet.lot_number,
deldet.shipping_instructions ,
ship_party.party_id ship_party_id,
bill_party.party_id bill_party_id,
sold_party.party_id sold_party_id