select a.shipment_id,
       a.PLANNED_SHIP_DATE,
       a.PLANNED_DELIVERY_DATE,
       Shipment_API.Get_Receiver_Addr_Id(a.SHIPMENT_ID) as "Address",
       b.shipment_line_no,
       b.SOURCE_PART_NO as "IPL Code",
       Shipment_Source_Utility_API.Get_Receiver_Part_No__(a.shipment_id,
                                                          b.shipment_line_no,
                                                          b.SOURCE_REF1,
                                                          b.SOURCE_REF2,
                                                          b.SOURCE_REF3,
                                                          b.SOURCE_REF4,
                                                          b.SOURCE_REF_TYPE_DB) as "AN Code",
       b.CONNECTED_SOURCE_QTY as "Qty",
       round(b.CF$_NO_OF_PALLETS, 2) as "Pallets",
       b.SOURCE_PART_DESCRIPTION,
       b.CF$_CUSTOMER_PO_NO as "PO",
       b.source_ref1 as "SO"
  from shipment a
  join shipment_line_CFV b
    on a.shipment_id = b.shipment_id
 where a.CONTRACT LIKE '%&Site%'
   and a.receiver_id LIKE '%&Customer_No%'
   and a.PLANNED_SHIP_DATE between to_date('&From_Date', 'DD/MM/YYYY') and
       to_date('&To_Date', 'DD/MM/YYYY')
 order by a.PLANNED_SHIP_DATE, a.shipment_id, b.shipment_line_no