DBA Data[Home] [Help]

APPS.WSH_SHIP_CONFIRM_ACTIONS SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 51

  select dd.delivery_detail_id, dd.transaction_temp_id,
         to_number(msnt.serial_prefix) "quantity",
         msnt.fm_serial_number, msnt.to_serial_number,
         msnt.attribute_category, -- Bug 3628620
         msnt.attribute1,
         msnt.attribute2,
         msnt.attribute3,
         msnt.attribute4,
         msnt.attribute5,
         msnt.attribute6,
         msnt.attribute7,
         msnt.attribute8,
         msnt.attribute9,
         msnt.attribute10,
         msnt.attribute11,
         msnt.attribute12,
         msnt.attribute13,
         msnt.attribute14,
         msnt.attribute15,   -- End of Bug 3628620
         dd.inventory_item_id, -- 3704188
         --Bug 8467875
         msnt.cycles_since_mark,
         msnt.cycles_since_new,
         msnt.cycles_since_overhaul,
         msnt.cycles_since_repair,
         msnt.cycles_since_visit,
         msnt.c_attribute1,
         msnt.c_attribute10,
         msnt.c_attribute11,
         msnt.c_attribute12,
         msnt.c_attribute13,
         msnt.c_attribute14,
         msnt.c_attribute15,
         msnt.c_attribute16,
         msnt.c_attribute17,
         msnt.c_attribute18,
         msnt.c_attribute19,
         msnt.c_attribute2,
         msnt.c_attribute20,
         msnt.c_attribute3,
         msnt.c_attribute4,
         msnt.c_attribute5,
         msnt.c_attribute6,
         msnt.c_attribute7,
         msnt.c_attribute8,
         msnt.c_attribute9,
         msnt.d_attribute1,
         msnt.d_attribute10,
         msnt.d_attribute2,
         msnt.d_attribute3,
         msnt.d_attribute4,
         msnt.d_attribute5,
         msnt.d_attribute6,
         msnt.d_attribute7,
         msnt.d_attribute8,
         msnt.d_attribute9,
         msnt.number_of_repairs,
         msnt.n_attribute1,
         msnt.n_attribute10,
         msnt.n_attribute2,
         msnt.n_attribute3,
         msnt.n_attribute4,
         msnt.n_attribute5,
         msnt.n_attribute6,
         msnt.n_attribute7,
         msnt.n_attribute8,
         msnt.n_attribute9,
         msnt.territory_code,
         msnt.time_since_mark,
         msnt.time_since_new,
         msnt.time_since_overhaul,
         msnt.time_since_repair,
         msnt.time_since_visit,
         msnt.serial_attribute_category
         --Bug 8467875
  from   wsh_delivery_details dd,
         wsh_delivery_assignments_v da,
         wsh_delivery_legs dg,
         wsh_new_deliveries dl,
         wsh_trip_stops st,
         mtl_serial_numbers_temp msnt
  where  st.batch_id = p_batch_id
  and    st.stop_location_id = dl.initial_pickup_location_id
  and    dg.delivery_id = dl.delivery_id
  and    da.delivery_id = dl.delivery_id
  and    dd.delivery_detail_id = da.delivery_detail_id
  -- bug 2787888 : removed oe_interfaced_flag and source_code comparison for OKE lines
  and    st.stop_id = dg.pick_up_stop_id
  and    dd.released_status = 'C'
  and    dd.container_flag='N'
  and    dd.transaction_temp_id = msnt.transaction_temp_id
--  and    msnt.fm_serial_number <> nvl(msnt.to_serial_number, msnt.fm_serial_number)
  and    nvl(dl.shipment_direction , 'O') IN ('O', 'IO');   -- J Inbound Logistics jckwok
Line: 146

  select dd.delivery_detail_id, dd.transaction_temp_id,
         to_number(msnt.serial_prefix) "quantity",
         msnt.fm_serial_number, msnt.to_serial_number,
         msnt.attribute_category, -- Bug 3628620
         msnt.attribute1,
         msnt.attribute2,
         msnt.attribute3,
         msnt.attribute4,
         msnt.attribute5,
         msnt.attribute6,
         msnt.attribute7,
         msnt.attribute8,
         msnt.attribute9,
         msnt.attribute10,
         msnt.attribute11,
         msnt.attribute12,
         msnt.attribute13,
         msnt.attribute14,
         msnt.attribute15,   -- End of Bug 3628620
         dd.inventory_item_id,-- 3704188
         --Bug 8467875
         msnt.cycles_since_mark,
         msnt.cycles_since_new,
         msnt.cycles_since_overhaul,
         msnt.cycles_since_repair,
         msnt.cycles_since_visit,
         msnt.c_attribute1,
         msnt.c_attribute10,
         msnt.c_attribute11,
         msnt.c_attribute12,
         msnt.c_attribute13,
         msnt.c_attribute14,
         msnt.c_attribute15,
         msnt.c_attribute16,
         msnt.c_attribute17,
         msnt.c_attribute18,
         msnt.c_attribute19,
         msnt.c_attribute2,
         msnt.c_attribute20,
         msnt.c_attribute3,
         msnt.c_attribute4,
         msnt.c_attribute5,
         msnt.c_attribute6,
         msnt.c_attribute7,
         msnt.c_attribute8,
         msnt.c_attribute9,
         msnt.d_attribute1,
         msnt.d_attribute10,
         msnt.d_attribute2,
         msnt.d_attribute3,
         msnt.d_attribute4,
         msnt.d_attribute5,
         msnt.d_attribute6,
         msnt.d_attribute7,
         msnt.d_attribute8,
         msnt.d_attribute9,
         msnt.number_of_repairs,
         msnt.n_attribute1,
         msnt.n_attribute10,
         msnt.n_attribute2,
         msnt.n_attribute3,
         msnt.n_attribute4,
         msnt.n_attribute5,
         msnt.n_attribute6,
         msnt.n_attribute7,
         msnt.n_attribute8,
         msnt.n_attribute9,
         msnt.territory_code,
         msnt.time_since_mark,
         msnt.time_since_new,
         msnt.time_since_overhaul,
         msnt.time_since_repair,
         msnt.time_since_visit,
         msnt.serial_attribute_category
         --Bug 8467875
  from   wsh_delivery_details dd,
         wsh_delivery_assignments_v da,
         wsh_delivery_legs dg,
         wsh_new_deliveries dl,
         wsh_trip_stops st,
         mtl_serial_numbers_temp msnt
  where  st.batch_id = p_batch_id
  and    st.stop_location_id = dl.initial_pickup_location_id
  and    dg.delivery_id = dl.delivery_id
  and    da.delivery_id = dl.delivery_id
  and    dd.delivery_detail_id = da.delivery_detail_id
  and    st.stop_id = dg.pick_up_stop_id
  and    dd.released_status = 'C'
  and    dd.container_flag='N'
  and    NVL(dd.oe_interfaced_flag , 'N') = 'Y'
  and    dd.transaction_temp_id = msnt.transaction_temp_id
--  and    msnt.fm_serial_number <> nvl(msnt.to_serial_number, msnt.fm_serial_number)
  and    nvl(dl.shipment_direction , 'O') IN ('O', 'IO');
Line: 241

  select dd.delivery_detail_id, msn.group_mark_id,
         dd.shipped_quantity "quantity",
         dd.serial_number, dd.serial_number "to_serial_number",
         msn.attribute_category, -- Bug 3628620
         msn.attribute1,
         msn.attribute2,
         msn.attribute3,
         msn.attribute4,
         msn.attribute5,
         msn.attribute6,
         msn.attribute7,
         msn.attribute8,
         msn.attribute9,
         msn.attribute10,
         msn.attribute11,
         msn.attribute12,
         msn.attribute13,
         msn.attribute14,
         msn.attribute15,   -- End of Bug 3628620
         dd.inventory_item_id, -- 3704188
         --Bug 8467875
         msn.cycles_since_mark,
         msn.cycles_since_new,
         msn.cycles_since_overhaul,
         msn.cycles_since_repair,
         msn.cycles_since_visit,
         msn.c_attribute1,
         msn.c_attribute10,
         msn.c_attribute11,
         msn.c_attribute12,
         msn.c_attribute13,
         msn.c_attribute14,
         msn.c_attribute15,
         msn.c_attribute16,
         msn.c_attribute17,
         msn.c_attribute18,
         msn.c_attribute19,
         msn.c_attribute2,
         msn.c_attribute20,
         msn.c_attribute3,
         msn.c_attribute4,
         msn.c_attribute5,
         msn.c_attribute6,
         msn.c_attribute7,
         msn.c_attribute8,
         msn.c_attribute9,
         msn.d_attribute1,
         msn.d_attribute10,
         msn.d_attribute2,
         msn.d_attribute3,
         msn.d_attribute4,
         msn.d_attribute5,
         msn.d_attribute6,
         msn.d_attribute7,
         msn.d_attribute8,
         msn.d_attribute9,
         msn.number_of_repairs,
         msn.n_attribute1,
         msn.n_attribute10,
         msn.n_attribute2,
         msn.n_attribute3,
         msn.n_attribute4,
         msn.n_attribute5,
         msn.n_attribute6,
         msn.n_attribute7,
         msn.n_attribute8,
         msn.n_attribute9,
         msn.territory_code,
         msn.time_since_mark,
         msn.time_since_new,
         msn.time_since_overhaul,
         msn.time_since_repair,
         msn.time_since_visit,
         msn.serial_attribute_category
         --Bug 8467875
  from   wsh_delivery_details dd,
         wsh_delivery_assignments_v da,
         wsh_delivery_legs dg,
         wsh_new_deliveries dl,
         wsh_trip_stops st,
         mtl_serial_numbers msn
  where  st.batch_id = p_batch_id
  and    st.stop_location_id = dl.initial_pickup_location_id
  and    dg.delivery_id = dl.delivery_id
  and    da.delivery_id = dl.delivery_id
  and    dd.delivery_detail_id = da.delivery_detail_id
  -- bug 2787888 : removed oe_interfaced_flag and source_code comparison for OKE lines
  and    st.stop_id = dg.pick_up_stop_id
  and    dd.released_status = 'C'
  and    dd.container_flag='N'
  and    dd.serial_number = msn.serial_number
  and    dd.inventory_item_id = msn.inventory_item_id -- bug 3704188: part of mtl_serial_numbers_u1
  and    nvl(dl.shipment_direction , 'O') IN ('O', 'IO');   -- J Inbound Logistics jckwok
Line: 336

  select dd.delivery_detail_id, msn.group_mark_id,
         dd.shipped_quantity "quantity",
         dd.serial_number, dd.serial_number "to_serial_number",
         msn.attribute_category, -- Bug 3628620
         msn.attribute1,
         msn.attribute2,
         msn.attribute3,
         msn.attribute4,
         msn.attribute5,
         msn.attribute6,
         msn.attribute7,
         msn.attribute8,
         msn.attribute9,
         msn.attribute10,
         msn.attribute11,
         msn.attribute12,
         msn.attribute13,
         msn.attribute14,
         msn.attribute15,   -- End of Bug 3628620
         dd.inventory_item_id, -- 3704188
         --Bug 8467875
         msn.cycles_since_mark,
         msn.cycles_since_new,
         msn.cycles_since_overhaul,
         msn.cycles_since_repair,
         msn.cycles_since_visit,
         msn.c_attribute1,
         msn.c_attribute10,
         msn.c_attribute11,
         msn.c_attribute12,
         msn.c_attribute13,
         msn.c_attribute14,
         msn.c_attribute15,
         msn.c_attribute16,
         msn.c_attribute17,
         msn.c_attribute18,
         msn.c_attribute19,
         msn.c_attribute2,
         msn.c_attribute20,
         msn.c_attribute3,
         msn.c_attribute4,
         msn.c_attribute5,
         msn.c_attribute6,
         msn.c_attribute7,
         msn.c_attribute8,
         msn.c_attribute9,
         msn.d_attribute1,
         msn.d_attribute10,
         msn.d_attribute2,
         msn.d_attribute3,
         msn.d_attribute4,
         msn.d_attribute5,
         msn.d_attribute6,
         msn.d_attribute7,
         msn.d_attribute8,
         msn.d_attribute9,
         msn.number_of_repairs,
         msn.n_attribute1,
         msn.n_attribute10,
         msn.n_attribute2,
         msn.n_attribute3,
         msn.n_attribute4,
         msn.n_attribute5,
         msn.n_attribute6,
         msn.n_attribute7,
         msn.n_attribute8,
         msn.n_attribute9,
         msn.territory_code,
         msn.time_since_mark,
         msn.time_since_new,
         msn.time_since_overhaul,
         msn.time_since_repair,
         msn.time_since_visit,
         msn.serial_attribute_category
         --Bug 8467875
  from   wsh_delivery_details dd,
         wsh_delivery_assignments_v da,
         wsh_delivery_legs dg,
         wsh_new_deliveries dl,
         wsh_trip_stops st,
         mtl_serial_numbers msn
  where  st.batch_id = p_batch_id
  and    st.stop_location_id = dl.initial_pickup_location_id
  and    dg.delivery_id = dl.delivery_id
  and    da.delivery_id = dl.delivery_id
  and    dd.delivery_detail_id = da.delivery_detail_id
  and    st.stop_id = dg.pick_up_stop_id
  and    dd.released_status = 'C'
  and    dd.container_flag='N'
  and    NVL(dd.oe_interfaced_flag , 'N') = 'Y'
  and    dd.serial_number = msn.serial_number
  and    dd.inventory_item_id = msn.inventory_item_id -- bug 3704188: part of mtl_serial_numbers_u1
  and    nvl(dl.shipment_direction , 'O') IN ('O', 'IO');
Line: 432

  select msn.attribute1,
         msn.attribute2,
         msn.attribute3,
         msn.attribute4,
         msn.attribute5,
         msn.attribute6,
         msn.attribute7,
         msn.attribute8,
         msn.attribute9,
         msn.attribute10,
         msn.attribute11,
         msn.attribute12,
         msn.attribute13,
         msn.attribute14,
         msn.attribute15
  from   mtl_serial_numbers msn
  where  msn.serial_number = x_serial_number
  and    msn.inventory_item_id = x_inventory_item_id -- bug 3704188: part of mtl_serial_numbers_u1
  ;
Line: 784

      INSERT INTO wsh_serial_numbers
                         ( delivery_detail_id,
                           quantity,
                           fm_serial_number,
                           to_serial_number,
                           creation_date,
                           created_by,
                           last_update_date,
                           last_updated_by,
                           attribute_category, -- Bug 3628620
                           attribute1, attribute2, attribute3,
                           attribute4,  attribute5, attribute6,
                           attribute7,  attribute8, attribute9,
                           attribute10, attribute11,attribute12,
                           attribute13, attribute14,attribute15, -- End of Bug 3628620
                           -- Bug 8467875
                           serial_attribute_category,c_attribute1,c_attribute2,
                           c_attribute3,c_attribute4,c_attribute5,
                           c_attribute6,c_attribute7,c_attribute8,
                           c_attribute9,c_attribute10,c_attribute11,
                           c_attribute12,c_attribute13,c_attribute14,
                           c_attribute15,c_attribute16,c_attribute17,
                           c_attribute18,c_attribute19,c_attribute20,
                           cycles_since_mark,cycles_since_new,cycles_since_overhaul,
                           cycles_since_repair,cycles_since_visit,number_of_repairs,
                           n_attribute1,n_attribute10,n_attribute2,
                           n_attribute3,n_attribute4,n_attribute5,
                           n_attribute6,n_attribute7,n_attribute8,
                           n_attribute9,time_since_mark,time_since_new,
                           time_since_overhaul,time_since_repair,time_since_visit,
                           d_attribute1,d_attribute10,d_attribute2,
                           d_attribute3,d_attribute4,d_attribute5,
                           d_attribute6,d_attribute7,d_attribute8,
                           d_attribute9,territory_code
                           -- Bug 8467875
                          )
                      VALUES
                         ( l_delivery_detail_id(i),
                           l_quantity(i),
                           l_fm_serial_number(i),
                           l_to_serial_number(i),
                           sysdate,
                           FND_GLOBAL.USER_ID,
                           sysdate,
                           FND_GLOBAL.USER_ID,
                           l_attribute_category(i), -- Bug 3628620
                           l_attribute1(i), l_attribute2(i), l_attribute3(i),
                           l_attribute4(i),  l_attribute5(i),  l_attribute6(i),
                           l_attribute7(i),  l_attribute8(i),  l_attribute9(i),
                           l_attribute10(i), l_attribute11(i), l_attribute12(i),
                           l_attribute13(i), l_attribute14(i), l_attribute15(i),
                           -- End of Bug 3628620
                           -- Bug 8467875
                           l_serial_attribute_category(i),l_c_attribute1(i),l_c_attribute2(i),
                           l_c_attribute3(i),l_c_attribute4(i),l_c_attribute5(i),
                           l_c_attribute6(i),l_c_attribute7(i),l_c_attribute8(i),
                           l_c_attribute9(i),l_c_attribute10(i),l_c_attribute11(i),
                           l_c_attribute12(i),l_c_attribute13(i),l_c_attribute14(i),
                           l_c_attribute15(i),l_c_attribute16(i),l_c_attribute17(i),
                           l_c_attribute18(i),l_c_attribute19(i),l_c_attribute20(i),
                           l_cycles_since_mark(i),l_cycles_since_new(i),l_cycles_since_overhaul(i),
                           l_cycles_since_repair(i),l_cycles_since_visit(i),l_number_of_repairs(i),
                           l_n_attribute1(i),l_n_attribute10(i),l_n_attribute2(i),
                           l_n_attribute3(i),l_n_attribute4(i),l_n_attribute5(i),
                           l_n_attribute6(i),l_n_attribute7(i),l_n_attribute8(i),
                           l_n_attribute9(i),l_time_since_mark(i),l_time_since_new(i),
                           l_time_since_overhaul(i),l_time_since_repair(i),l_time_since_visit(i),
                           l_d_attribute1(i),l_d_attribute10(i),l_d_attribute2(i),
                           l_d_attribute3(i),l_d_attribute4(i),l_d_attribute5(i),
                           l_d_attribute6(i),l_d_attribute7(i),l_d_attribute8(i),
                           l_d_attribute9(i),l_territory_code(i)
                           -- Bug 8467875
                          );
Line: 864

         DELETE FROM mtl_serial_numbers_temp
         WHERE  transaction_temp_id = l_transaction_temp_id(i)
         AND    fm_serial_number = l_fm_serial_number(i);
Line: 871

         UPDATE wsh_delivery_details
         SET    serial_number = NULL,
	        --Added as part of bug 7645262
                last_update_date    = sysdate,
                request_id          = fnd_global.conc_request_id,
                last_updated_by     = fnd_global.user_id,
                transaction_temp_id = l_transaction_temp_id(i)
         WHERE  delivery_detail_id = l_delivery_detail_id(i);
Line: 889

	-- bug 6625172: Deleting the msnt records for all the selected transaction_temp_id's for OM records
	IF (ins_rows > 0) THEN
        --{
           DELETE mtl_serial_numbers_temp
           WHERE  transaction_temp_id IN
              (   SELECT DISTINCT dd.transaction_temp_id
                  from  wsh_delivery_details dd,
                  wsh_delivery_assignments da,
                  wsh_delivery_legs dg,
                  wsh_new_deliveries dl,
                  wsh_trip_stops st,
                  mtl_serial_numbers_temp msnt
                  where  st.batch_id = p_batch_id
                  and    st.stop_location_id = dl.initial_pickup_location_id
                  and    dg.delivery_id = dl.delivery_id
                  and    da.delivery_id = dl.delivery_id
                  and    dd.delivery_detail_id = da.delivery_detail_id
                  and    st.stop_id = dg.pick_up_stop_id
                  and    dd.released_status = 'C'
                  and    dd.container_flag='N'
                  and    NVL(dd.oe_interfaced_flag , 'N') = 'Y'
                  and    dd.transaction_temp_id = msnt.transaction_temp_id
                  and    nvl(dl.shipment_direction , 'O') IN ('O', 'IO'));
Line: 922

	-- bug 6625172: Deleting the msnt records for all the selected transaction_temp_id's for non-OM records
        IF (ins_rows > 0) THEN
        --{
            DELETE mtl_serial_numbers_temp
            WHERE  transaction_temp_id IN
            ( SELECT DISTINCT dd.transaction_temp_id
                  from   wsh_delivery_details dd,
                  wsh_delivery_assignments da,
                 wsh_delivery_legs dg,
                 wsh_new_deliveries dl,
                 wsh_trip_stops st,
                 mtl_serial_numbers_temp msnt
                 where  st.batch_id = p_batch_id
                 and    st.stop_location_id = dl.initial_pickup_location_id
                 and    dg.delivery_id = dl.delivery_id
                 and    da.delivery_id = dl.delivery_id
                 and    dd.delivery_detail_id = da.delivery_detail_id
                 and    st.stop_id = dg.pick_up_stop_id
                 and    dd.released_status = 'C'
                 and    dd.container_flag='N'
                 and    dd.transaction_temp_id = msnt.transaction_temp_id
                 and    nvl(dl.shipment_direction , 'O') IN ('O', 'IO'));
Line: 953

      WSH_DEBUG_SV.log(l_module_name,'Numbers of rows inserted into wsh_serial_numbers: '|| to_char(ins_rows) ||
                                     ', Number of rows deleted from mtl_serial_numbers_temp: '|| to_char(del_rows) ||
                                     ', Number of rows updated in wsh_delivery_details: '|| to_char(upd_rows) );
Line: 1173

procedure Update_Completion_Status(p_num_stops IN NUMBER,
                           p_batch_id  IN NUMBER,
                           x_master_status IN OUT NOCOPY  VARCHAR2,
                           p_api_status      IN OUT NOCOPY  VARCHAR2,
                           x_normal_count  IN OUT NOCOPY  NUMBER,
                           x_warning_count   IN OUT NOCOPY  NUMBER,
                           x_interfaced_count IN OUT NOCOPY  NUMBER
               ) IS
               --
l_debug_on BOOLEAN;
Line: 1184

               l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'UPDATE_COMPLETION_STATUS';
Line: 1189

               SELECT count(*)
               FROM wsh_trip_stops
               WHERE batch_id = p_batch_id;
Line: 1254

END Update_Completion_Status;
Line: 1314

   SELECT DISTINCT wts.stop_id
   FROM wsh_trip_stops wts,
   wsh_trip_stops wts2,
   wsh_delivery_legs wdl,
   wsh_delivery_legs wdl2,
   wsh_delivery_assignments_v wda,
   wsh_delivery_assignments_v wda2,
   wsh_delivery_details wdd,
   wsh_delivery_details wdd2
   WHERE wts.batch_id = p_batch_id
   AND wts.stop_id = wdl.pick_up_stop_id
   AND wda.delivery_id = wdl.delivery_id
   AND wda.delivery_detail_id = wdd.delivery_detail_id
   AND wdd.source_code = 'OE'
   AND nvl(wdd.oe_interfaced_flag,'N') <> 'Y'
   AND wdd.released_status <> 'D'
   AND wts2.batch_id = p_batch_id
   AND wts2.stop_id = wdl2.pick_up_stop_id
   AND wda2.delivery_id = wdl2.delivery_id
   AND wda2.delivery_detail_id = wdd2.delivery_detail_id
   AND wdd2.source_line_id = wdd.source_line_id
   AND wdd2.source_code = 'OE'
   AND nvl(wdd2.oe_interfaced_flag,'N') <> 'Y'
   AND wdd2.released_status <> 'D'
   AND wts2.stop_id <> wts.stop_id;
Line: 1362

   x_stop_tab.DELETE;
Line: 1371

      UPDATE wsh_trip_stops
      SET batch_id  = p_batch_id
      WHERE stop_id = x_split_stops(x);
Line: 1384

   x_split_stops.DELETE;
Line: 1413

               UPDATE wsh_trip_stops
               SET batch_id = NULL
               WHERE stop_id =  l_stop_tab(x)
               AND batch_id = p_batch_id;
Line: 1430

      x_split_stops.DELETE(x_split_stops.LAST);
Line: 1571

  SELECT stop_id
  FROM wsh_trip_stops
  WHERE stop_id = p_stop_id
  AND   pending_interface_flag = p_flag
  FOR UPDATE NOWAIT;
Line: 1578

  SELECT stop_id
  FROM wsh_trip_stops
  WHERE batch_id = p_batch_id
  AND   pending_interface_flag = p_flag
  FOR UPDATE NOWAIT;
Line: 1593

   SELECT wts.stop_id
   FROM   wsh_trip_stops    wts,
         wsh_delivery_legs  wdl,
         wsh_new_deliveries wnd
   WHERE  wnd.delivery_id    = p_delivery_id
   AND   wdl.delivery_id     = wnd.delivery_id
   AND   wts.stop_id      = wdl.pick_up_stop_id
   AND   wts.stop_location_id = wnd.initial_pickup_location_id;
Line: 1605

   SELECT wts.stop_id
   FROM   wsh_trip_stops wts
   WHERE  wts.stop_id = p_trip_stop_id
   AND   wts.pending_interface_flag = 'Y'
   AND   nvl(wts.SHIPMENTS_TYPE_FLAG, 'O') IN  ('O', 'M');
Line: 1613

   SELECT wts.stop_id
   FROM   wsh_trip_stops wts
   WHERE  wts.pending_interface_flag = 'Y'
   AND    nvl(wts.SHIPMENTS_TYPE_FLAG, 'O') IN  ('O', 'M')  -- J Inbound Logistics jckwok
   ORDER BY DECODE(wts.lock_stop_id, wts.stop_id, 1, NULL, 2, 3);
Line: 1623

   SELECT DISTINCT wts.stop_id
   FROM   wsh_trip_stops wts,
          wsh_new_deliveries wnd,
          wsh_delivery_legs wdl
   WHERE   wts.pending_interface_flag = 'Y'
   AND   wdl.pick_up_stop_id = wts.stop_id
   AND   wnd.initial_pickup_location_id = wts.stop_location_id
   AND   wdl.delivery_id     = wnd.delivery_id
   AND   nvl(wts.SHIPMENTS_TYPE_FLAG, 'O') IN  ('O', 'M')
   AND   wnd.organization_id = p_organization_id
   ORDER BY  wts.stop_id;
Line: 1637

    SELECT wts.stop_id
    FROM   wsh_trip_stops    wts,
          wsh_delivery_legs  wdl,
          wsh_new_deliveries wnd,
          wsh_picking_batches wpb
    WHERE p_batch_id IS NOT NULL
    AND   wnd.batch_id    = p_batch_id
    AND   wdl.delivery_id     = wnd.delivery_id
    AND   wts.stop_id      = wdl.pick_up_stop_id
    AND   wts.stop_location_id = wnd.initial_pickup_location_id
    AND   wpb.batch_id = wnd.batch_id
    AND   (p_trip_type IS NULL OR
          (p_trip_type = 'AC' AND wpb.creation_date <= wts.creation_date) OR
          (p_trip_type = 'MC' AND wpb.creation_date > wts.creation_date))
    AND   nvl(wnd.SHIPMENT_DIRECTION , 'O') IN ('O', 'IO')   -- J Inbound Logistics jckwok
    ORDER BY DECODE(wts.lock_stop_id, wts.stop_id,1,
                NULL,2,3);
Line: 1656

SELECT 1
FROM   wsh_delivery_legs dg,
      wsh_new_deliveries dl,
      wsh_trip_stops st
WHERE  st.stop_id = dg.pick_up_stop_id AND
       nvl(dl.SHIPMENT_DIRECTION , 'O') IN ('O', 'IO') AND  -- J Inbound Logistics jckwok
      st.stop_id = p_stop_id AND
      st.stop_location_id = dl.initial_pickup_location_id AND
      dg.delivery_id = dl.delivery_id  AND
	   dl.asn_seq_number is not null
	   and rownum=1;
Line: 1670

SELECT WSH_STOP_BATCH_S.NEXTVAL
FROM sys.dual;
Line: 1675

SELECT  wnd.delivery_id,
	wnd.organization_id,
	wnd.initial_pickup_location_id,
	wnd.delivery_scpod_wf_process,
	wnd.del_wf_interface_attr
FROM    wsh_new_deliveries wnd,
	wsh_delivery_legs wdl,
	wsh_trip_stops wts
WHERE   wnd.delivery_id = wdl.delivery_id
AND     wdl.pick_up_stop_id = p_stop_id
AND     wts.stop_id      = wdl.pick_up_stop_id
AND     wts.stop_location_id = wnd.initial_pickup_location_id;
Line: 1979

       l_dsno_stop_tab.DELETE;
Line: 1980

       l_stop_tab.DELETE;
Line: 2030

         UPDATE wsh_trip_stops
         SET    pending_interface_flag = 'P',
             request_id             = fnd_global.conc_request_id,
             last_updated_by        = fnd_global.user_id,
             last_update_date       = sysdate,
             batch_id               = l_stop_batch_id
         WHERE  stop_id = l_stop_id;
Line: 2168

        Update_Completion_Status(l_err_stops_count,
                           NULL,
                           l_completion_status,
                           l_api_completion_status_bkp,
                           l_stops_normal(1),
                           l_stops_warning(1),
                           l_stops_interfaced(1));
Line: 2186

     Update_Completion_Status(l_stop_count ,
                        NULL,
                        l_completion_status,
                        l_api_completion_status,
                        l_stops_normal(1),
                        l_stops_warning(1),
                        l_stops_interfaced(1));
Line: 2228

   l_inv_stops.DELETE;
Line: 2229

   l_stop_tab.DELETE;
Line: 2244

   l_err_stops.DELETE;
Line: 2312

           Update_Completion_Status(1,
                              NULL,
                              l_completion_status,
                              l_api_completion_status,
                              l_stops_normal(2),
                              l_stops_warning(2),
                              l_stops_interfaced(2));
Line: 2361

         UPDATE wsh_trip_stops
         SET pending_interface_flag = 'Y',
           batch_id = NULL
         WHERE stop_id = l_err_stops(x);
Line: 2375

   l_err_stops.DELETE;
Line: 2376

   l_dsno_stop_tab.DELETE;
Line: 2406

     Update_Completion_Status(NULL,
                           l_stop_batch_id,
                           l_completion_status,
                           l_api_completion_status,
                           l_stops_normal(3),
                           l_stops_warning(3),
                           l_stops_interfaced(3));
Line: 2417

   l_dsno_stop_tab.DELETE;
Line: 2418

   l_inv_batch_table.DELETE;
Line: 2456

        UPDATE wsh_trip_stops
        SET    pending_interface_flag = l_new_flag,
                  last_updated_by          = fnd_global.user_id,
                  last_update_date         = sysdate
        WHERE  batch_id = l_stop_batch_id;
Line: 2489

       WSH_UTIL_CORE.PrintMsg('Locking issue:  batch '|| l_stop_batch_id  || ' needs pending_interface_flag updated to ' || l_new_flag);
Line: 2643

    UPDATE wsh_trip_stops wts
    SET    wts.pending_interface_flag = 'Y',
           wts.last_updated_by       = fnd_global.user_id,
           wts.last_update_date      = sysdate
    WHERE  wts.pending_interface_flag = 'P'
    AND    EXISTS (SELECT 'request completed'
                   FROM fnd_concurrent_requests fcr
                   WHERE  fcr.request_id = wts.request_id
                   AND    fcr.phase_code = 'C');
Line: 2791

PROCEDURE Insert_inv_records(
	p_start_index		IN number,
	p_end_index		IN number,
	p_mtl_txn_if_rec      	IN WSH_SHIP_CONFIRM_ACTIONS.Mtl_txn_if_rec_type,
       	p_mtl_ser_txn_if_rec  	IN OUT NOCOPY Mtl_ser_txn_if_rec_type,
       	p_mtl_lot_txn_if_rec  	IN OUT NOCOPY Mtl_lot_txn_if_rec_type,
        p_def_inv_online        IN VARCHAR2,
	x_return_status		OUT NOCOPY 	VARCHAR2) IS

l_debug_on BOOLEAN;
Line: 2801

l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'Insert_inv_records';
Line: 2823

 SAVEPOINT sp_insert_inv_records;
Line: 2827

    WSH_TRX_HANDLER.INSERT_ROW_BULK (
	p_start_index		=>p_start_index,
	p_end_index		=>p_end_index,
	p_mtl_txn_if_rec 	=>p_mtl_txn_if_rec,
        x_return_status  	=> l_return_status);
Line: 2834

        WSH_DEBUG_SV.log(l_module_name,'WSH_TRX_HANDLER.INSERT_ROW_BULK l_return_status',l_return_status);
Line: 2845

    WSH_TRXSN_HANDLER.INSERT_ROW_BULK
		(p_mtl_ser_txn_if_rec => p_mtl_ser_txn_if_rec,
                 x_return_status  => l_return_status);
Line: 2850

       WSH_DEBUG_SV.log(l_module_name,'WSH_TRXSN_HANDLER.INSERT_ROW_BULK l_return_status',l_return_status);
Line: 2857

    p_mtl_ser_txn_if_rec.source_code.delete;
Line: 2858

    p_mtl_ser_txn_if_rec.source_line_id.delete;
Line: 2859

    p_mtl_ser_txn_if_rec.fm_serial_number.delete;
Line: 2860

    p_mtl_ser_txn_if_rec.to_serial_number.delete;
Line: 2861

    p_mtl_ser_txn_if_rec.transaction_interface_id.delete;
Line: 2869

    WSH_TRXLOTS_HANDLER.insert_ROW_bulk
		(p_mtl_lot_txn_if_rec => p_mtl_lot_txn_if_rec,
                 x_return_status  => l_return_status);
Line: 2874

        WSH_DEBUG_SV.log(l_module_name,'WSH_TRXLOT_HANDLER.INSERT_ROW_BULK l_return_status',l_return_status);
Line: 2881

    p_mtl_lot_txn_if_rec.source_code.delete;
Line: 2882

    p_mtl_lot_txn_if_rec.source_line_id.delete;
Line: 2883

    p_mtl_lot_txn_if_rec.lot_number.delete;
Line: 2884

    p_mtl_lot_txn_if_rec.trx_quantity.delete;
Line: 2885

    p_mtl_lot_txn_if_rec.serial_transaction_temp_id.delete;
Line: 2886

    p_mtl_lot_txn_if_rec.transaction_interface_id.delete;
Line: 2888

    p_mtl_lot_txn_if_rec.grade_code.delete;
Line: 2889

    p_mtl_lot_txn_if_rec.secondary_trx_quantity.delete;
Line: 2910

     ROLLBACK TO SAVEPOINT sp_insert_inv_records;
Line: 2921

     ROLLBACK TO SAVEPOINT sp_insert_inv_records;
Line: 2922

END  Insert_inv_records;
Line: 2971

SELECT source_document_type_id, source_document_id, source_document_line_id
FROM   oe_order_lines_all
WHERE  line_id = c_order_line_id;
Line: 2979

SELECT   destination_type_code,
     destination_subinventory,
     source_organization_id,
     destination_organization_id,
     deliver_to_location_id,
     pl.requisition_line_id,
     pd.distribution_id,
     pl.unit_price,
     nvl(pd.budget_account_id,-1)  budget_account_id,
     decode(nvl(pd.prevent_encumbrance_flag,'N'),'N',nvl(pd.encumbered_flag,'N'),'N') encumbered_flag
FROM    po_requisition_lines_all pl,
     po_req_distributions_all pd
WHERE pl.requisition_line_id = c_po_line_id
AND     pl.requisition_header_id = c_source_document_id
AND     pl.requisition_line_id = pd.requisition_line_id;
Line: 2999

   SELECT intransit_type
   FROM   mtl_interorg_parameters
   WHERE  from_organization_id = c_from_organization_id AND
          to_organization_id = c_to_organization_id;
Line: 3010

SELECT fm_serial_number,
       to_serial_number,
       rownum, --haperf
       mtl_material_transactions_s.nextval seq_num,
       attribute_category,
       attribute1,
       attribute2,
       attribute3,
       attribute4,
       attribute5,
       attribute6,
       attribute7,
       attribute8,
       attribute9,
       attribute10,
       attribute11,
       attribute12,
       attribute13,
       attribute14,
       attribute15,
       --Bug 8467875
       cycles_since_mark,
       cycles_since_new,
       cycles_since_overhaul,
       cycles_since_repair,
       cycles_since_visit,
       c_attribute1,
       c_attribute10,
       c_attribute11,
       c_attribute12,
       c_attribute13,
       c_attribute14,
       c_attribute15,
       c_attribute16,
       c_attribute17,
       c_attribute18,
       c_attribute19,
       c_attribute2,
       c_attribute20,
       c_attribute3,
       c_attribute4,
       c_attribute5,
       c_attribute6,
       c_attribute7,
       c_attribute8,
       c_attribute9,
       d_attribute1,
       d_attribute10,
       d_attribute2,
       d_attribute3,
       d_attribute4,
       d_attribute5,
       d_attribute6,
       d_attribute7,
       d_attribute8,
       d_attribute9,
       number_of_repairs,
       n_attribute1,
       n_attribute10,
       n_attribute2,
       n_attribute3,
       n_attribute4,
       n_attribute5,
       n_attribute6,
       n_attribute7,
       n_attribute8,
       n_attribute9,
       territory_code,
       time_since_mark,
       time_since_new,
       time_since_overhaul,
       time_since_repair,
       time_since_visit,
       serial_attribute_category
       --Bug 8467875
from   wsh_serial_numbers
where  delivery_detail_id = c_delivery_detail_id;
Line: 3091

SELECT attribute_category,
       attribute1,
       attribute2,
       attribute3,
       attribute4,
       attribute5,
       attribute6,
       attribute7,
       attribute8,
       attribute9,
       attribute10,
       attribute11,
       attribute12,
       attribute13,
       attribute14,
       attribute15,
       c_attribute1,
       c_attribute10,
       c_attribute11,
       c_attribute12,
       c_attribute13,
       c_attribute14,
       c_attribute15,
       c_attribute16,
       c_attribute17,
       c_attribute18,
       c_attribute19,
       c_attribute2,
       c_attribute20,
       c_attribute3,
       c_attribute4,
       c_attribute5,
       c_attribute6,
       c_attribute7,
       c_attribute8,
       c_attribute9,
       d_attribute1,
       d_attribute10,
       d_attribute2,
       d_attribute3,
       d_attribute4,
       d_attribute5,
       d_attribute6,
       d_attribute7,
       d_attribute8,
       d_attribute9,
       n_attribute1,
       n_attribute10,
       n_attribute2,
       n_attribute3,
       n_attribute4,
       n_attribute5,
       n_attribute6,
       n_attribute7,
       n_attribute8,
       n_attribute9,
       lot_attribute_category
FROM   mtl_lot_numbers
WHERE  inventory_item_id = c_inv_item_id
AND    organization_id   = c_organization_id
AND    lot_number        = c_lot_name;
Line: 3215

SELECT source_location_id
FROM   wsh_locations
WHERE  wsh_location_id = v_location_id;
Line: 3227

SELECT source_code,
       source_header_id,
       source_line_id,
       inventory_item_id,
       subinventory,
       trx_quantity,
       trx_date,
       organization_id,
       trx_source_id,
       trx_source_type_id,
       trx_action_id,
       trx_type_id,
       distribution_account_id,
       trx_reference,
       trx_header_id,
       trx_source_line_id,
       trx_source_delivery_id,
       revision,
       locator_id,
       picking_line_id,
       transfer_subinventory,
       transfer_organization,
       ship_to_location_id,
       requisition_line_id,
       requisition_distribution_id,
       trx_uom,
       mtl_material_transactions_s.nextval trx_interface_id,
       shipment_number,
       expected_arrival_date,
       encumbrance_account,
       encumbrance_amount,
       movement_id,
       freight_code,
       waybill_airbill,
       content_lpn_id,
       requested_quantity,
       inv_interfaced_flag,
       ship_method_code,
       cycle_count_quantity,
       src_requested_quantity_uom,
       transaction_temp_id,
       lot_number,
       serial_number,
       to_serial_number,
       trip_id,
-- HW OPMCONV. No need for sublot anymore
--     sublot_number,
       ship_tolerance_above,
       ship_tolerance_below,
       src_requested_quantity,
       org_id,
       trx_quantity2,
       error_flag,
-- HW OPMCONV. Retrieve grade and uom2
       preferred_grade,
       requested_quantity_uom2,
--added for BUG 4538005
       ship_from_location_id,
       ship_to_site_use_id
--
FROM (SELECT dd.source_code,
       dd.source_header_id,
       dd.source_line_id,
       dd.inventory_item_id,
       dd.subinventory,
       dd.shipped_quantity 	trx_quantity,
       st.actual_departure_date trx_date,
       dd.organization_id,
       NULL			trx_source_id,
       NULL			trx_source_type_id,
       NULL			trx_action_id,
       NULL			trx_type_id,
       NULL			distribution_account_id,
       dd.source_header_id	trx_reference,
       NULL			trx_header_id,
       dd.source_line_id	trx_source_line_id,
       dl.delivery_id 		trx_source_delivery_id,
       dd.revision,
       dd.locator_id,
       dd.delivery_detail_id	picking_line_id,
       NULL			transfer_subinventory,
       NULL			transfer_organization,
       dd.ship_to_location_id	ship_to_location_id,
       NULL			requisition_line_id,
       NULL			requisition_distribution_id,
       dd.requested_quantity_uom trx_uom,
       --haperf NULL			trx_interface_id,
       dl.name			shipment_number,
       dl.ultimate_dropoff_date expected_arrival_date,
       NULL			encumbrance_account,
       NULL			encumbrance_amount,
       dd.movement_id,
       wcv.freight_code		freight_code,
       dl.waybill		waybill_airbill,
       dd1.lpn_id		content_lpn_id,
       ---
       dd.requested_quantity,
       dd.inv_interfaced_flag,
       tr.ship_method_code,
       dd.cycle_count_quantity,
       dd.src_requested_quantity_uom,
       dd.transaction_temp_id,
       dd.lot_number,
       dd.serial_number,
       dd.to_serial_number,
       st.trip_id,
-- HW OPMCONV. No need for sublot anymore
--     dd.sublot_number,
       dd.ship_tolerance_above,
       dd.ship_tolerance_below,
       dd.src_requested_quantity,
       dd.org_id,
-- HW OPM 3064890 added trx_quantity2
       dd.shipped_quantity2     trx_quantity2,
       'N' error_flag,
-- HW OPMCONV. Retrieve grade and uom2
       dd.preferred_grade,
       dd.requested_quantity_uom2,
--added for BUG 4538005
       dd.ship_from_location_id  ship_from_location_id,
       dd.ship_to_site_use_id   ship_to_site_use_id
--
FROM    wsh_delivery_details dd,
        wsh_delivery_assignments_v da,
	wsh_delivery_legs dg,
        wsh_new_deliveries dl,
        wsh_trip_stops st,
	wsh_trips tr,
        wsh_carriers wcv,
        wsh_delivery_details dd1,
        wsh_delivery_assignments_v da1
WHERE   st.stop_id = dg.pick_up_stop_id
AND     st.batch_id = p_batch_id
AND     st.stop_location_id = dl.initial_pickup_location_id
AND     dg.delivery_id = dl.delivery_id
AND     da.delivery_id = dl.delivery_id
AND     dd.delivery_detail_id = da.delivery_detail_id
AND     st.trip_id = tr.trip_id
AND     dd.container_flag = 'N'
AND     dd.source_code <> 'RTV'    -- RTV changes
AND     dd.inv_interfaced_flag = 'N'
AND     dd.released_status <> 'D'
AND     nvl(dd.line_direction,'O') in ('O','IO')
AND     tr.carrier_id = wcv.carrier_id (+)
AND     dd.delivery_detail_id=da1.delivery_detail_id
AND     da1.parent_delivery_detail_id = dd1.delivery_detail_id(+)
ORDER BY dd.organization_id,
	 dd.source_header_id,
	 dd.ship_to_location_id);
Line: 3380

  SELECT mrp_atp_schedule_temp_s.nextVal
  FROM dual;
Line: 3386

 SELECT mtl_material_transactions_s.nextval
 FROM sys.dual;
Line: 3394

SELECT wcv.freight_code freight_code
FROM wsh_carrier_services wcs,
     wsh_org_carrier_services wocs,
     wsh_carriers_v wcv
WHERE wcs.carrier_service_id = wocs.carrier_service_id AND
      wcs.carrier_id = wcv.carrier_id AND
      wcs.ship_method_code = p_ship_method_code AND
      wocs.organization_id = p_organization_id;
Line: 3405

SELECT wc.freight_code
 FROM  wsh_new_deliveries wnd,
       wsh_carriers wc
 WHERE wnd.delivery_id = p_delivery_id AND
       wc.carrier_id = wnd.carrier_id;
Line: 3441

l_insert_inv_calls		number:=0;
Line: 3442

l_insert_inv_not_success		number:=0;
Line: 4451

                  WSH_DEBUG_SV.logmsg(l_module_name, 'INSERTED '||l_serial_count||' SERIAL RECORDS ');
Line: 4461

                           'INSERTING SRL NUMBER ' || l_mtl_txn_if_rec.SERIAL_NUMBER(l_index) || 'INTO MSNI.');
Line: 4684

    l_insert_inv_calls := l_insert_inv_calls + 1;
Line: 4686

    Insert_inv_records(
	p_start_index	=> l_start_index,
	p_end_index	=> l_index,
	p_mtl_txn_if_rec => l_mtl_txn_if_rec,
	p_mtl_ser_txn_if_rec => l_mtl_ser_txn_if_rec,
	p_mtl_lot_txn_if_rec => l_mtl_lot_txn_if_rec,
        p_def_inv_online   => l_def_inv_online,
	x_return_status	 => l_return_status);
Line: 4696

      WSH_DEBUG_SV.log(l_module_name,'Insert_inv_records l_return_status',l_return_status);
Line: 4699

       l_insert_inv_not_success := l_insert_inv_not_success + 1;
Line: 4703

      WSH_DEBUG_SV.log(l_module_name,'l_insert_inv_calls',l_insert_inv_calls);
Line: 4704

      WSH_DEBUG_SV.log(l_module_name,'l_insert_inv_not_success',l_insert_inv_not_success);
Line: 4726

             l_insert_inv_calls := l_insert_inv_calls + 1;
Line: 4727

             Insert_inv_records(
                p_start_index   => l_start_index,
                p_end_index     => l_index,
                p_mtl_txn_if_rec => l_mtl_txn_if_rec,
                p_mtl_ser_txn_if_rec => l_mtl_ser_txn_if_rec,
                p_mtl_lot_txn_if_rec => l_mtl_lot_txn_if_rec,
                p_def_inv_online   => l_def_inv_online,
                x_return_status  => l_return_status);
Line: 4737

                 WSH_DEBUG_SV.log(l_module_name,'Insert_inv_records l_return_status',l_return_status);
Line: 4740

                      l_insert_inv_not_success := l_insert_inv_not_success + 1;
Line: 4743

                  WSH_DEBUG_SV.log(l_module_name,'l_insert_inv_calls',l_insert_inv_calls);
Line: 4744

                  WSH_DEBUG_SV.log(l_module_name,'l_insert_inv_not_success',l_insert_inv_not_success);
Line: 4763

             l_insert_inv_calls := l_insert_inv_calls + 1;
Line: 4764

             Insert_inv_records(
                p_start_index   => l_start_index,
                p_end_index     => l_index,
                p_mtl_txn_if_rec => l_mtl_txn_if_rec,
                p_mtl_ser_txn_if_rec => l_mtl_ser_txn_if_rec,
                p_mtl_lot_txn_if_rec => l_mtl_lot_txn_if_rec,
                p_def_inv_online   => l_def_inv_online,
                x_return_status  => l_return_status);
Line: 4774

                 WSH_DEBUG_SV.log(l_module_name,'Insert_inv_records l_return_status',l_return_status);
Line: 4777

                      l_insert_inv_not_success := l_insert_inv_not_success + 1;
Line: 4780

                  WSH_DEBUG_SV.log(l_module_name,'l_insert_inv_calls',l_insert_inv_calls);
Line: 4781

                  WSH_DEBUG_SV.log(l_module_name,'l_insert_inv_not_success',l_insert_inv_not_success);
Line: 4800

    UPDATE wsh_delivery_details
    SET inv_interfaced_flag = c_inv_int_full ,
        --Added as part of bug 7645262
        last_update_date    = sysdate,
        request_id          = fnd_global.conc_request_id,
        last_updated_by     = fnd_global.user_id

    WHERE delivery_detail_id = l_delivery_detail_tbl(i)
    AND container_flag = 'N';
Line: 4814

 IF (l_insert_inv_not_success >= l_insert_inv_calls) THEN
    raise fnd_api.g_exc_error;
Line: 4816

 ELSIF (l_insert_inv_not_success > 0 and l_insert_inv_not_success < l_insert_inv_calls) THEN
     RAISE wsh_util_core.g_exc_warning;
Line: 4927

SELECT stop_id
FROM wsh_trip_stops
WHERE batch_id = p_batch_id
FOR UPDATE NOWAIT;
Line: 4938

SELECT  da.delivery_detail_id
FROM    wsh_delivery_assignments da , wsh_delivery_legs dg, wsh_new_deliveries dl, wsh_trip_stops st
where   dl.delivery_id = da.delivery_id
AND     da.delivery_id IS NOT NULL
AND     st.stop_id = dg.pick_up_stop_id
AND     st.batch_id = p_batch_id
AND     st.stop_location_id = dl.initial_pickup_location_id
AND     dg.delivery_id = dl.delivery_id;
Line: 4957

SELECT mti.picking_line_id
FROM   mtl_transactions_interface mti,
       wsh_delivery_assignments_v da ,
       wsh_delivery_legs dg,
       wsh_new_deliveries dl,
       wsh_delivery_details wdd,
       wsh_trip_stops st
WHERE  mti.picking_line_id  = da.delivery_detail_id
AND    wdd.delivery_detail_id = da.delivery_detail_id
AND    wdd.source_code  <>  'RTV'                           -- RTV changes
AND    dl.delivery_id = da.delivery_id
AND    st.stop_id = dg.pick_up_stop_id
AND    st.batch_id = p_batch_id
AND    st.stop_location_id = dl.initial_pickup_location_id
AND    dg.delivery_id = dl.delivery_id
AND    nvl(mti.lock_flag,2) = 2;
Line: 4976

SELECT DISTINCT wnd.delivery_id
from   wsh_delivery_details wdd,
       wsh_delivery_assignments_v wda,
       wsh_new_deliveries wnd,
       wsh_delivery_legs wdl,
       wsh_trip_stops wts
where  wdd.source_code        = 'RTV'
and    nvl(wdd.inv_interfaced_flag, 'N') = 'N'
AND    wdd.container_flag = 'N'
AND    wdd.released_status <> 'D'
AND    nvl(wdd.line_direction,'O') in ('O','IO')
and    wdd.delivery_detail_id = wda.delivery_detail_id
and    wda.delivery_id        = wnd.delivery_id
and    wda.delivery_id is not null
and    wnd.delivery_id        = wdl.delivery_id
and    wdl.pick_up_stop_id    = wts.stop_id
and    wdd.ship_from_location_id = wts.stop_location_id
and    wts.batch_id               = p_batch_id;
Line: 5088

   Update_Interfaced_Details ( p_batch_id ,  l_return_status ) ;
Line: 5179

       update wsh_delivery_details dd
       set    inv_interfaced_flag = 'N' ,
              --Added as part of bug 7645262
              last_update_date    = sysdate,
              request_id          = fnd_global.conc_request_id,
              last_updated_by     = fnd_global.user_id
       where  inv_interfaced_flag = 'P'
       and    not exists (
                          select picking_line_id
                          from   mtl_transactions_interface mti
                          where  source_line_id = mti.trx_source_line_id
                          and    mti.picking_line_id   =  dd.delivery_detail_id)
       and delivery_detail_id  = l_detail_ids_tbl(i)
       and container_flag = 'N'
       and released_status <> 'D'; /* H integration: wrudge */
Line: 5198

      SELECT mtl_material_transactions_s.nextval
      INTO l_transaction_header_id
      FROM sys.dual;
Line: 5230

          update mtl_transactions_interface
          set    transaction_header_id = l_transaction_header_id
          where  picking_line_id    = l_picking_line_id_tbl(i)
          and    nvl(process_flag,1) <> 3
          and    nvl(lock_flag,2) = 2;
Line: 5240

            WSH_DEBUG_SV.log(l_module_name,'No. existing record updated in MTI', l_count);
Line: 5421

   SELECT count(*)  total
   from wsh_delivery_details dd,
         wsh_delivery_assignments_v da,
         wsh_new_deliveries ds
     where dd.delivery_detail_id = da.delivery_detail_id
     and  da.delivery_id = ds.delivery_id
     and  ds.status_code NOT IN ('CL','IT','CO', 'SR', 'SC') /* Closed, In  Transit, Confirmed */
     and  da.delivery_id <> p_delivery_id
     and  da.delivery_id IS NOT NULL
     and  dd.source_line_id = p_source_line_id
     and  dd.source_code = p_source_code
     and  dd.container_flag = 'N'
          and    dd.released_status <> 'D' ;  /* H integration: wrudge */
Line: 5436

   SELECT count(*) total
   from wsh_delivery_details dd,
         wsh_delivery_assignments_v da
     where   dd.delivery_detail_id = da.delivery_detail_id
     and da.delivery_id is NULL
     and dd.source_line_id = p_source_line_id
     and  dd.source_code = p_source_code
     and dd.container_flag = 'N'
          and   dd.released_status <> 'D' ;  /* H integration: wrudge */
Line: 5528

select sum(decode(p_fulfill_base,'S',nvl(wdd.picked_quantity2, wdd.requested_quantity2),nvl(wdd.picked_quantity, wdd.requested_quantity)))
from wsh_delivery_details wdd,
wsh_delivery_assignments_v da,
wsh_new_deliveries wnd
where wdd.source_line_id=p_source_line_id and
wdd.source_code = 'OE' and
wdd.delivery_detail_id=da.delivery_detail_id and
not exists (select 1 from wsh_delivery_legs lg, wsh_trip_stops st
where st.batch_id= p_batch_id and
st.stop_id = lg.pick_up_stop_id and
nvl(da.delivery_id,0)= lg.delivery_id)
and wnd.delivery_id(+) = da.delivery_id
and (   (wdd.released_status = 'Y')
     OR (wdd.released_status = 'C' AND wdd.oe_interfaced_flag <> 'Y')
     OR (wnd.status_code IN ('SR', 'SC'))
    );
Line: 5635

Select order_quantity_uom,
ordered_quantity_uom2
from oe_order_Lines_all
where line_id = c_source_line_id ;
Line: 5783

  l_delete_detail_id NUMBER;
Line: 5800

  SELECT delivery_detail_id
  FROM   wsh_delivery_details dd
  WHERE  source_line_id   = c_source_line_id
    AND source_code      = 'OE'
    AND released_status IN ('R', 'B','N','S','X')
    AND NVL(container_flag, 'N') = 'N';
Line: 5808

  SELECT DISTINCT wdd.source_line_id
  FROM   wsh_delivery_details wdd
  WHERE  wdd.source_header_id   = c_source_header_id
     AND wdd.source_code        = 'OE'
     AND wdd.source_line_set_id = c_source_line_set_id
     AND NOT EXISTS
         ( SELECT 'x'
           FROM    wsh_delivery_assignments_v wda,
                   wsh_new_deliveries wnd        ,
                   wsh_delivery_legs wdl         ,
                   wsh_trip_stops wts
           WHERE   wdd.delivery_detail_id = wda.delivery_detail_id
               AND wda.delivery_id        = wnd.delivery_id
               AND wda.delivery_id IS NOT NULL
               AND wnd.delivery_id           = wdl.delivery_id
               AND wdl.pick_up_stop_id       = wts.stop_id
               AND wdd.ship_from_location_id = wts.stop_location_id
               AND wts.batch_id              = p_batch_id);
Line: 5828

  SELECT 'x'
  FROM   wsh_delivery_details wdd      ,
         wsh_delivery_assignments_v wda,
         wsh_new_deliveries wnd
  WHERE  wdd.source_line_id     = c_source_line_id
     AND wdd.source_code        = 'OE'
     AND wdd.source_header_id   = c_source_header_id
     AND wdd.delivery_detail_id = wda.delivery_detail_id
     AND wnd.delivery_id(+)     = wda.delivery_id
     AND ( ( wdd.released_status = 'Y' ) OR
           ( wdd.released_status = 'C' AND wdd.oe_interfaced_flag <> 'Y' ) OR
           ( wnd.status_code IN ('SR','SC')));
Line: 5895

            SELECT SUM(dd.requested_quantity),
                  SUM( NVL(dd.shipped_quantity, 0 )),
                  -- muom
                  SUM(dd.requested_quantity2),
                  SUM( NVL(dd.shipped_quantity2, 0 )),
                  max(nvl(dd.client_id,0)) -- LSP PROJECT : needs to check clientId on WDD records.
            INTO  l_tot_dd_req_qty,
                  l_tot_dd_shp_qty,
                  -- muom
                  l_tot_dd_req_qty2,
                  l_tot_dd_shp_qty2,
                  l_client_id             -- LSP PROJECT
            FROM  wsh_delivery_Details dd       ,
                  wsh_delivery_assignments_v da ,
                  wsh_delivery_legs dg          ,
                  wsh_new_deliveries dl         ,
                  wsh_trip_stops st
            WHERE st.stop_id          = dg.pick_up_stop_id
              AND st.batch_id         = P_batch_id
              AND st.stop_location_id = dl.initial_pickup_location_id
              AND dg.delivery_id      = dl.delivery_id
              AND dl.delivery_id      = da.delivery_id
              AND da.delivery_id IS NOT NULL
              AND da.delivery_detail_id = dd.delivery_detail_id
              AND NVL ( dd.oe_interfaced_flag , 'N' ) <> 'Y'
              AND dd.source_code = 'OE'
              AND dd.source_header_id = p_oe_interface_rec.source_header_id
              AND dd.source_line_set_id = p_oe_interface_rec.source_line_set_id
              AND dd.released_status <> 'D';
Line: 5925

            SELECT SUM(WSH_WV_UTILS.CONVERT_UOM(ol.order_quantity_uom, p_oe_interface_rec.requested_quantity_uom, ol.ordered_quantity, ol.inventory_item_id)) order_line_quantity,
            -- muom
            SUM(ol.ordered_quantity2) order_line_quantity2
            INTO  l_tot_ord_qty, l_tot_ord_qty2
            FROM  oe_order_lines_all ol
            WHERE ol.header_id   = p_oe_interface_rec.source_header_id
              AND ol.line_set_id = p_oe_interface_rec.source_line_set_id;
Line: 5938

            SELECT DISTINCT client_id
            INTO   l_client_id
            FROM   wsh_delivery_details
            WHERE  source_code = 'OE'
            AND    source_line_id = p_oe_interface_rec.source_line_id;
Line: 6012

                               INTO  l_delete_detail_id;
Line: 6015

                               l_remain_details_id(l_remain_detail_index) := l_delete_detail_id;
Line: 6017

                                   WSH_DEBUG_SV.logmsg(l_module_name, 'l_remain_detail_index =  '||l_remain_detail_index||' detail_id = '||l_delete_detail_id);
Line: 6051

                                         INTO  l_delete_detail_id;
Line: 6054

                                         l_remain_details_id(l_remain_detail_index) := l_delete_detail_id;
Line: 6056

                                             WSH_DEBUG_SV.logmsg(l_module_name, 'l_remain_detail_index =  '||l_remain_detail_index||' detail_id = '||l_delete_detail_id);
Line: 6270

   SELECT count(*) into l_count
   from wsh_delivery_details
   where top_model_line_id is not null
   and source_line_id = p_source_line_id
   and source_code = p_source_code
   and   container_flag = 'N'
   and released_status <> 'D' ;  /* H integration: wrudge */
Line: 6322

     SELECT distinct top_model_line_id  into l_top_id
     from wsh_delivery_details
     where source_line_id = p_source_line_id
     and source_code = p_source_code
     and container_flag = 'N'
          and released_status <> 'D' ;  /* H integration: wrudge */
Line: 6359

procedure update_interfaced_details ( p_batch_id number  ,  x_return_status out NOCOPY  varchar2 ) is
--
l_debug_on BOOLEAN;
Line: 6363

l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'UPDATE_INTERFACED_DETAILS';
Line: 6384

    update wsh_delivery_details  dd
    set inv_interfaced_flag   =   c_inv_int_full ,
        --Added as part of bug 7645262
        last_update_date    = sysdate,
        request_id          = fnd_global.conc_request_id,
        last_updated_by     = fnd_global.user_id

    where (exists (
                SELECT mmt.picking_line_id
                   FROM  mtl_material_transactions mmt
                   WHERE mmt.picking_line_id  =  dd.delivery_detail_id
               and transaction_source_type_id in ( 2,8,13,16 )
               and trx_source_line_id = dd.source_line_id
                   )
               )
    and container_flag = 'N'
    and nvl(inv_interfaced_flag , 'N')  <> c_inv_int_full
   and nvl(inv_interfaced_flag , 'N')  <> 'X'
    and dd.delivery_Detail_id in  (
               SELECT  da.delivery_detail_id
               FROM   wsh_delivery_assignments_v da ,
                       wsh_delivery_legs dg,
                       wsh_new_deliveries dl,
                       wsh_trip_stops st
               where   dl.delivery_id = da.delivery_id  AND
                     da.delivery_id  IS NOT NULL AND
                     st.stop_id = dg.pick_up_stop_id AND
                     st.batch_id = p_batch_id AND
                     st.stop_location_id = dl.initial_pickup_location_id AND
                     dg.delivery_id = dl.delivery_id AND
                     nvl(dl.SHIPMENT_DIRECTION , 'O') IN ('O', 'IO')   -- J Inbound Logistics jckwok
                )
         and dd.source_code <> 'RTV'     -- RTV changes
         and dd.released_status <> 'D';   /* H integration: wrudge */
Line: 6420

        WSH_DEBUG_SV.logmsg(l_module_name,  'NUMBER OF ROWS UPDATED AS INTERFACED TO INVENTORY = ' || SQL%ROWCOUNT  );
Line: 6427

         WSH_UTIL_CORE.PrintMsg('UPDATE_INTERFACED_DETAILS : unexpected error ');
Line: 6435

end update_interfaced_details ;
Line: 6547

   SELECT batch_id
   FROM wsh_trip_stops
   WHERE batch_id = p_batch_id
   FOR UPDATE NOWAIT;
Line: 6557

   SELECT DISTINCT stop_id
   FROM   wsh_delivery_Details dd,
      wsh_delivery_assignments_v da ,
      wsh_delivery_legs dg,
      wsh_new_deliveries dl,
      wsh_trip_stops st
   WHERE st.stop_id = dg.pick_up_stop_id
      AND st.batch_id = p_batch_id
      AND st.stop_location_id = dl.initial_pickup_location_id
      AND dg.delivery_id = dl.delivery_id
      AND dl.delivery_id = da.delivery_id
      AND da.delivery_id IS NOT NULL
      AND da.delivery_detail_id = dd.delivery_detail_id
      AND dd.oe_interfaced_flag =  'N'
      AND dd.source_code = 'OE'
      AND dd.released_status <> 'D'
      AND    nvl(dd.line_direction,'O') IN ('O','IO');
Line: 6639

      UPDATE wsh_trip_stops
      SET batch_id = NULL,
      pending_interface_flag = 'Y'
      WHERE stop_id = l_err_stops(i);
Line: 6751

SELECT stop_id
FROM wsh_trip_stops
WHERE batch_id = p_batch_id
FOR UPDATE NOWAIT;
Line: 6971

SELECT  delivery_detail_id
FROM 	wsh_delivery_details wdd
WHERE   wdd.top_model_line_id = p_top_model_line_id
AND     wdd.source_header_id = p_source_header_id -- bug 3642085
AND     wdd.source_code = 'OE'                    -- bug 3642085
MINUS
SELECT  wdd.delivery_detail_id
  from wsh_delivery_details wdd,
       wsh_delivery_assignments_v wda,
       wsh_delivery_legs wdl,
       wsh_trip_stops wts
  where wts.batch_id = p_batch_id
  and   wdl.pick_up_stop_id = wts.stop_id
  and   wda.delivery_id = wdl.delivery_id
  and   wdd.delivery_detail_id = wda.delivery_detail_id
  and   wdd.container_flag = 'N'
  and   wdd.source_code = 'OE'
  AND     wdd.source_line_set_id IS NULL
  AND   wdd.source_header_id = p_source_header_id -- frontport of bug 4324971
  and   wdd.top_model_line_id = p_top_model_line_id;
Line: 6993

Select  delivery_detail_id
from 	wsh_delivery_details wdd
WHERE   wdd.ship_set_id = p_ship_set_id
AND     wdd.source_header_id = p_source_header_id -- bug 3642085
AND     wdd.source_code = 'OE'                    -- bug 3642085
MINUS
select wdd.delivery_detail_id
from wsh_delivery_details wdd,
       wsh_delivery_assignments_v wda,
       wsh_delivery_legs wdl,
       wsh_trip_stops wts
  where wts.batch_id = p_batch_id
  and   wdl.pick_up_stop_id = wts.stop_id
  and   wda.delivery_id = wdl.delivery_id
  and   wdd.delivery_detail_id = wda.delivery_detail_id
  and   wdd.container_flag = 'N'
  and   wdd.source_code = 'OE'
  AND     wdd.source_line_set_id IS NULL
  and   wdd.ship_set_id = p_ship_set_id;
Line: 7014

SELECT   delivery_detail_id
from wsh_delivery_details wdd
WHERE   wdd.source_line_id = p_source_line_id
AND     wdd.source_code = 'OE'                    -- bug 3642085
MINUS
SELECT  wdd.delivery_detail_id
  from wsh_delivery_details wdd,
       wsh_delivery_assignments_v wda,
       wsh_delivery_legs wdl,
       wsh_trip_stops wts
  where wts.batch_id = p_batch_id
  and   wdl.pick_up_stop_id = wts.stop_id
  and   wda.delivery_id = wdl.delivery_id
  and   wdd.delivery_detail_id = wda.delivery_detail_id
  and   wdd.container_flag = 'N'
  and   wdd.source_code = 'OE'
  AND     wdd.source_line_set_id IS NULL
  and   wdd.source_line_id = p_source_line_id;
Line: 7491

SELECT stop_id
FROM wsh_trip_stops
WHERE batch_id = p_batch_id
ORDER BY stop_id ;
Line: 7497

SELECT  wdd.source_line_id
FROM wsh_delivery_details wdd,
     wsh_trip_stops wts,
     wsh_delivery_legs wdl,
     wsh_delivery_assignments_v wda
WHERE wts.stop_id = p_stop_id
AND   wdl.pick_up_stop_id = wts.stop_id
AND   wdl.delivery_id = wda.delivery_id
AND   wdd.delivery_detail_id = wda.delivery_detail_id
AND   nvl(wdd.LINE_DIRECTION , 'O') IN ('O', 'IO')
AND   wdd.released_status = 'C'
AND   wdd.container_flag='N'
AND   wdd.oe_interfaced_flag <> 'Y'
AND   wdd.source_code = 'OE'
ORDER BY wdd.source_line_id;
Line: 7587

         l_lines_tab.DELETE;
Line: 7624

         l_freight_costs_all.DELETE;
Line: 7771

          UPDATE wsh_delivery_details dd
          SET    oe_interfaced_flag = l_oe_interfaced_flag ,
                 --Added as part of bug 7645262
                 last_update_date    = sysdate,
                 request_id          = fnd_global.conc_request_id,
                 last_updated_by     = fnd_global.user_id
          WHERE  source_line_id = p_bulk_ship_line.line_id(i)
          and container_flag = l_container_flag
          and source_code = l_source_code
          and released_status <> l_released_status
          and dd.delivery_detail_id in  (
            SELECT  /*+ no_unnest */ da.delivery_detail_id
            FROM wsh_delivery_assignments_v da ,
                  wsh_delivery_legs dg,
                  wsh_new_deliveries dl,
                  wsh_trip_stops st
            where   da.delivery_detail_id = dd.delivery_detail_id  AND
                  dl.delivery_id = da.delivery_id  AND
                  da.delivery_id  IS NOT NULL AND
                  st.stop_id = dg.pick_up_stop_id AND
                  st.batch_id = p_batch_id AND
                  st.stop_location_id = dl.initial_pickup_location_id AND
                  dg.delivery_id = dl.delivery_id
             );
Line: 7798

            WSH_DEBUG_SV.logmsg(l_module_name,'After Forall Update');
Line: 7861

            UPDATE wsh_delivery_details dd
            set   oe_interfaced_flag = l_oe_interfaced_flag ,
                  --Added as part of bug 7645262
                  last_update_date    = sysdate,
                  request_id          = fnd_global.conc_request_id,
                  last_updated_by     = fnd_global.user_id
            where  delivery_detail_id in  (
                   SELECT da.delivery_detail_id
                   FROM wsh_delivery_assignments_v da ,
                         wsh_delivery_legs dg,
                         wsh_new_deliveries dl,
                         wsh_trip_stops st,
                         oe_order_lines_all ol
                   where   da.delivery_detail_id = dd.delivery_detail_id  AND
                         dl.delivery_id = da.delivery_id  AND
                         da.delivery_id  IS NOT NULL AND
                         st.stop_id = dg.pick_up_stop_id AND
                         st.batch_id = p_batch_id AND
                         st.stop_location_id = dl.initial_pickup_location_id AND
                         dg.delivery_id = dl.delivery_id  AND
                         ol.line_id = dd.source_line_id AND
                         ol.shipped_quantity > 0
                    )
            and dd.source_header_id = l_header_id
            and container_flag = l_container_flag
            and source_code = l_source_code
            and released_status <> l_released_status;
Line: 7896

            UPDATE wsh_delivery_details dd
            SET    oe_interfaced_flag = l_oe_interfaced_flag ,
                   --Added as part of bug 7645262
                   last_update_date    = sysdate,
                   request_id          = fnd_global.conc_request_id,
                   last_updated_by     = fnd_global.user_id

            WHERE  source_line_id = p_bulk_ship_line.line_id(i)
            and container_flag = l_container_flag
            and source_code = l_source_code
            and released_status <> l_released_status
            and dd.delivery_detail_id in  (
              SELECT  /*+ no_unnest */ da.delivery_detail_id
              FROM wsh_delivery_assignments_v da ,
                    wsh_delivery_legs dg,
                    wsh_new_deliveries dl,
                    wsh_trip_stops st
              where   da.delivery_detail_id = dd.delivery_detail_id  AND
                    dl.delivery_id = da.delivery_id  AND
                    da.delivery_id  IS NOT NULL AND
                    st.stop_id = dg.pick_up_stop_id AND
                    st.batch_id = p_batch_id AND
                    st.stop_location_id = dl.initial_pickup_location_id AND
                    dg.delivery_id = dl.delivery_id
               );
Line: 7926

             WSH_DEBUG_SV.log(l_module_name,'No. Success Rec. Update to Y', l_count);
Line: 7960

             UPDATE wsh_delivery_details dd
             SET oe_interfaced_flag = Decode(p_bulk_ship_line.error_flag(i),'Y','N','Y') ,
                 --Added as part of bug 7645262
                 last_update_date    = sysdate,
                 request_id          = fnd_global.conc_request_id,
                 last_updated_by     = fnd_global.user_id
             WHERE  source_line_id = p_bulk_ship_line.line_id(i)
             and container_flag = l_container_flag
             and source_code = l_source_code
             and released_status <> l_released_status
             and dd.delivery_detail_id in  (
               SELECT /*+ no_unnest */ da.delivery_detail_id
               FROM wsh_delivery_assignments_v da ,
                     wsh_delivery_legs dg,
                     wsh_new_deliveries dl,
                     wsh_trip_stops st
               where   da.delivery_detail_id = dd.delivery_detail_id  AND
                     dl.delivery_id = da.delivery_id  AND
                     da.delivery_id  IS NOT NULL AND
                     st.stop_id = dg.pick_up_stop_id AND
                     st.batch_id = p_batch_id AND
                     st.stop_location_id = dl.initial_pickup_location_id AND
                     dg.delivery_id = dl.delivery_id
                );
Line: 7988

              WSH_DEBUG_SV.log(l_module_name,'No. Warning Rec. Update',l_count);
Line: 8060

         l_ship_adj_line.cost_id.DELETE;
Line: 8061

         l_ship_adj_line.automatic_flag.DELETE;
Line: 8062

         l_ship_adj_line.list_line_type_code.DELETE;
Line: 8063

         l_ship_adj_line.charge_type_code.DELETE;
Line: 8064

         l_ship_adj_line.header_id.DELETE;
Line: 8065

         l_ship_adj_line.line_id.DELETE;
Line: 8066

         l_ship_adj_line.adjusted_amount.DELETE;
Line: 8067

         l_ship_adj_line.arithmetic_operator.DELETE;
Line: 8068

         l_ship_adj_line.operation.DELETE;
Line: 8129

         l_ship_adj_line.cost_id.DELETE;
Line: 8130

         l_ship_adj_line.automatic_flag.DELETE;
Line: 8131

         l_ship_adj_line.list_line_type_code.DELETE;
Line: 8132

         l_ship_adj_line.charge_type_code.DELETE;
Line: 8133

         l_ship_adj_line.header_id.DELETE;
Line: 8134

         l_ship_adj_line.line_id.DELETE;
Line: 8135

         l_ship_adj_line.adjusted_amount.DELETE;
Line: 8136

         l_ship_adj_line.arithmetic_operator.DELETE;
Line: 8137

         l_ship_adj_line.operation.DELETE;
Line: 8348

SELECT dd.source_line_id
FROM   wsh_delivery_Details dd,
   wsh_delivery_assignments_v da ,
   wsh_delivery_legs dg,
   wsh_new_deliveries dl,
   wsh_trip_stops st
WHERE st.stop_id = dg.pick_up_stop_id AND
   st.batch_id = p_batch_id AND
   st.stop_location_id = dl.initial_pickup_location_id AND
   dg.delivery_id = dl.delivery_id  AND
   dl.delivery_id = da.delivery_id  AND
   da.delivery_id IS NOT NULL AND
   da.delivery_detail_id = dd.delivery_detail_id
   and nvl ( dd.oe_interfaced_flag , 'N' )  <> 'Y'
   and dd.source_code = 'OE'
   and dd.source_header_id = c_source_header_id
   and dd.source_line_id = c_source_line_id
   and dd.released_status <> 'D'  /* H integration: wrudge */
for update nowait;
Line: 8371

SELECT wdd.delivery_detail_id
FROM   wsh_delivery_details wdd
WHERE  wdd.source_code = 'OE'
AND    wdd.source_header_id = c_source_header_id
AND    wdd.source_line_set_id = c_source_line_set_id
AND    wdd.released_status <> 'D'
AND EXISTS (
            SELECT 'X'
            FROM wsh_trip_stops wts,
            wsh_delivery_legs wdl,
            wsh_delivery_assignments_v wda
            WHERE wdd.delivery_detail_id = wda.delivery_detail_id
            AND wts.batch_id = c_batch_id
            AND wts.stop_id = wdl.pick_up_stop_id
            AND wdl.delivery_id = wda.delivery_id
           )
FOR UPDATE NOWAIT;
Line: 8392

SELECT wdd.delivery_detail_id
FROM   wsh_delivery_details wdd
WHERE  wdd.source_code = 'OE'
AND    wdd.source_header_id = c_source_header_id
AND    wdd.source_line_id = c_source_line_id
AND    wdd.released_status <> 'D'
AND EXISTS (
            SELECT 'X'
            FROM wsh_trip_stops wts,
            wsh_delivery_legs wdl,
            wsh_delivery_assignments_v wda
            WHERE wdd.delivery_detail_id = wda.delivery_detail_id
            AND wts.batch_id = c_batch_id
            AND wts.stop_id = wdl.pick_up_stop_id
            AND wdl.delivery_id = wda.delivery_id
           )
FOR UPDATE NOWAIT;
Line: 8413

SELECT delivery_detail_id
FROM wsh_delivery_details dd
WHERE source_line_id = c_source_line_id AND
     source_code = 'OE' AND
     released_status IN ('R', 'B', 'N', 'S', 'X') AND
     NVL(container_flag, 'N') = 'N';
Line: 8423

SELECT DISTINCT wdd.source_line_id
from   wsh_delivery_details wdd
where  wdd.source_header_id   = c_source_header_id
and    wdd.source_code        = 'OE'
and    wdd.source_line_set_id = c_source_line_set_id
and    not exists (
         select 'x'
         from   wsh_delivery_assignments_v wda,
                wsh_new_deliveries wnd,
                wsh_delivery_legs wdl,
                wsh_trip_stops wts
         where  wdd.delivery_detail_id = wda.delivery_detail_id
         and    wda.delivery_id        = wnd.delivery_id
         and    wda.delivery_id is not null
         and    wnd.delivery_id        = wdl.delivery_id
         and    wdl.pick_up_stop_id    = wts.stop_id
         and    wdd.ship_from_location_id = wts.stop_location_id
         and    wts.batch_id               = p_batch_id);
Line: 8444

select 'x'
from   wsh_delivery_details wdd,
       wsh_delivery_assignments_v wda,
       wsh_new_deliveries wnd
where  wdd.source_line_id     = c_source_line_id
and    wdd.source_code        = 'OE'
and    wdd.source_header_id   = c_source_header_id
and    wdd.delivery_detail_id = wda.delivery_detail_id
and    wnd.delivery_id(+)     = wda.delivery_id
and    ( (wdd.released_status = 'Y') OR
         (wdd.released_status = 'C' AND wdd.oe_interfaced_flag <> 'Y') OR
         (wnd.status_code IN ('SR', 'SC'))
       );
Line: 8494

l_delete_detail_id NUMBER;
Line: 8516

select 'X'
from wsh_delivery_details
where source_line_id in (select source_line_id
                         from wsh_delivery_details wdd,
                              wsh_delivery_assignments_v wda,
                              wsh_delivery_legs wdl,
                              wsh_trip_stops wts
                         where wts.batch_id = cp_batch_id
                         and   wdl.pick_up_stop_id = wts.stop_id
                         and   wda.delivery_id = wdl.delivery_id
                         and   wdd.delivery_detail_id = wda.delivery_detail_id
                         and   wdd.container_flag = 'N'
                         and   wdd.source_code = 'OE'
                        )
  and   (delivery_detail_id not in
            (select wdd.delivery_detail_id
             from wsh_delivery_details wdd,
                  wsh_delivery_assignments_v wda,
                  wsh_delivery_legs wdl,
                  wsh_trip_stops wts
             where wts.batch_id = cp_batch_id
             and   wdl.pick_up_stop_id = wts.stop_id
             and   wda.delivery_id = wdl.delivery_id
             and   wdd.delivery_detail_id = wda.delivery_detail_id
             and   wdd.container_flag = 'N'
             and   wdd.source_code = 'OE'
            )
         or    top_model_line_id is not null
         or    ship_set_id is not null
         or    nvl(ship_model_complete_flag,'N')  = 'Y'
         or    requested_quantity <> nvl(shipped_quantity,-99)
         or    source_line_set_id IS NOT NULL
        )
  and   source_code = 'OE'
and   container_flag = 'N';
Line: 8554

select 'X'
  from wsh_trip_stops wts,
       wsh_delivery_legs wdl,
       wsh_delivery_assignments wda ,
       wsh_delivery_details wdd
 where wts.batch_id = cp_batch_id
   and wdl.pick_up_stop_id = wts.stop_id
   and wda.delivery_id = wdl.delivery_id
   and wdd.delivery_detail_id = wda.delivery_detail_id
   and wdd.container_flag = 'N'
   and wdd.source_code = 'OE'
   and (EXISTS (select 'any non-cancelled line outside batch'
                  from wsh_delivery_details wdd2
                 where wdd2.source_line_id = wdd.source_line_id
                   and wdd2.source_code = 'OE'
                   and wdd2.container_flag = 'N'
                   and wdd2.released_status <> 'D'
                   and wdd2.delivery_detail_id NOT IN
                       (select wda3.delivery_detail_id
                          from wsh_delivery_assignments wda3 ,
                               wsh_delivery_legs wdl3,
                               wsh_trip_stops wts3,
                               wsh_delivery_details wdd3
                         where wts3.batch_id = cp_batch_id
                           and wdl3.pick_up_stop_id = wts3.stop_id
                           and wda3.delivery_id = wdl3.delivery_id
                           and wdd3.delivery_detail_id = wda3.delivery_detail_id
                           and wdd3.source_line_id = wdd.source_line_id
                           and wdd3.source_code = 'OE'
                           and wdd3.container_flag = 'N'))
        or    wdd.top_model_line_id is not null
        or    wdd.ship_set_id is not null
        or    nvl(wdd.ship_model_complete_flag,'N')  = 'Y'
        or    wdd.requested_quantity <> nvl(wdd.shipped_quantity,-99)
              -- bug 5688051
        or    nvl(requested_quantity2, -99) <> nvl(shipped_quantity2, -99)
        or    wdd.source_line_set_id IS NOT NULL )
   and rownum = 1;
Line: 8595

 SELECT	dd.source_header_id		        header_id,
	dd.source_line_id			line_id,
        dd.top_model_line_id 			top_model_line_id,
        dd.ship_set_id				ship_set_id,
        dd.arrival_set_id			arrival_set_id,
	NVL(dl.initial_pickup_date,sysdate) 	actual_shipment_date,
	dd.requested_quantity_uom		shipping_quantity_uom,
	dd.requested_quantity_uom2 		shipping_quantity_uom2,
        ol.flow_status_code			flow_status_code,
        ol.ordered_quantity			ordered_quantity,
        ol.ordered_quantity2			ordered_quantity2,
        ol.org_id                               org_id,
	sum( nvl(dd.shipped_quantity,0) )	shipping_quantity,
	sum( nvl(dd.shipped_quantity2, 0 )) 	shipping_quantity2,
        -- muom
        -- Derive shipped_quantity (to pass to OM) only when Fufillment Base is Secondary
        sum( decode(dd.requested_quantity_uom2, null, null,
                      decode(WSH_UTIL_CORE.Get_Line_Fulfillment_Base(dd.source_code, dd.source_line_id),
                                        'S', WSH_WV_UTILS.CONVERT_UOM(from_uom => dd.requested_quantity_uom2,
                                                                      to_uom   => ol.order_quantity_uom,
                                                                      quantity => nvl(dd.shipped_quantity2,0),
                                                                      item_id  => dd.inventory_item_id)))) shipped_quantity
FROM   wsh_delivery_Details dd,
   wsh_delivery_assignments_v da ,
   wsh_delivery_legs dg,
   wsh_new_deliveries dl,
   wsh_trip_stops st,
   oe_order_lines_all ol
WHERE st.stop_id = dg.pick_up_stop_id AND
   st.batch_id = cp_batch_id AND
   st.stop_location_id = dl.initial_pickup_location_id AND
   dg.delivery_id = dl.delivery_id  AND
   dl.delivery_id = da.delivery_id  AND
   da.delivery_detail_id = dd.delivery_detail_id
   and nvl ( dd.oe_interfaced_flag , 'N' )  <> 'Y'
   and dd.source_code = 'OE'
   and dd.released_status <> 'D'
   and ol.line_id = dd.source_line_id
   and dd.client_id IS NULL -- LSP PROJECT : Should not perform OM interface for LSP orders
GROUP BY
   dd.source_header_id ,
   dd.source_line_id,
   dd.top_model_line_id,
   dd.ship_set_id,
   dd.arrival_set_id,
   dl.initial_pickup_date,
   dd.requested_quantity_uom,
   dd.requested_quantity_uom2,
   ol.flow_status_code,
   ol.ordered_quantity,
   ol.ordered_quantity2,
   ol.order_quantity_uom, -- muom
   ol.org_id
ORDER BY --Bugfix 14127623
   dd.source_header_id,
   dd.source_line_id;
Line: 8653

   SELECT dd.source_header_id ,
   dd.source_header_number ,
   dd.source_line_set_id,
   dd.source_line_id ,
   WSH_WV_UTILS.CONVERT_UOM(ol.order_quantity_uom,
                     dd.requested_quantity_uom,
                     ol.ordered_quantity,
                     dd.inventory_item_id) order_line_quantity,
   -- muom
   ol.ordered_quantity2 order_line_quantity2,
   dd.requested_quantity_uom  ,
   dd.requested_quantity_uom2 ,
   ol.ordered_quantity,
   ol.order_quantity_uom,
   ol.ordered_quantity2,
   ol.ordered_quantity_uom2,
   ol.model_remnant_flag,
   ol.item_type_code,
   ol.calculate_price_flag,
   dd.ship_tolerance_below  ,
   dd.ship_tolerance_above,
   ol.org_id org_id ,
   dd.organization_id organization_id ,
   NVL(dd.oe_interfaced_flag, 'N') oe_interfaced_flag,
   dl.initial_pickup_date,
   dd.top_model_line_id ,
   dd.ato_line_id,
   dd.ship_set_id,
   dd.ship_model_complete_flag,
   dd.arrival_set_id,
   dd.inventory_item_id,
   ol.flow_status_code,
   sum( dd.requested_quantity )     total_requested_quantity,
   sum( dd.requested_quantity2 )   total_requested_quantity2,
   sum( nvl(dd.shipped_quantity, 0 )) total_shipped_quantity ,
   sum( nvl(dd.shipped_quantity2, 0 )) total_shipped_quantity2,
   -- muom
   -- Derive shipped_quantity (to pass to OM) only when Fufillment Base is Secondary
   sum( decode(dd.requested_quantity_uom2, null, null,
         decode(WSH_UTIL_CORE.Get_Line_Fulfillment_Base(dd.source_code, dd.source_line_id),
          'S',WSH_WV_UTILS.CONVERT_UOM(
                             from_uom   => ol.ordered_quantity_uom2,
                             to_uom     => ol.order_quantity_uom,
                             quantity   => nvl(dd.shipped_quantity2, 0 ),
                             item_id    => dd.inventory_item_id)))) total_om_shipped_quantity
FROM   wsh_delivery_Details dd,
   wsh_delivery_assignments_v da ,
   wsh_delivery_legs dg,
   wsh_new_deliveries dl,
   wsh_trip_stops st,
   oe_order_lines_all ol
WHERE st.stop_id = dg.pick_up_stop_id AND
   st.batch_id = cp_batch_id AND
   st.stop_location_id = dl.initial_pickup_location_id AND
   dg.delivery_id = dl.delivery_id  AND
   dl.delivery_id = da.delivery_id  AND
   da.delivery_id IS NOT NULL AND
   da.delivery_detail_id = dd.delivery_detail_id
   and nvl ( dd.oe_interfaced_flag , 'N' )  <> 'Y'
   and dd.source_code = 'OE'
   and ol.line_id = dd.source_line_id
   and dd.released_status <> 'D'
   and dd.client_id IS NULL  -- LSP PROJECT : Should not perform OM interface for LSP orders
group by ol.org_id ,
   dd.source_header_id ,
   dd.source_header_number ,
   dd.source_line_set_id,
   dd.source_line_id,
   dd.top_model_line_id,
   dd.ship_set_id,
   dd.ato_line_id,
   dd.ship_set_id,
   dd.arrival_set_id,
   dd.inventory_item_id,
   dd.ship_model_complete_flag,
   WSH_WV_UTILS.CONVERT_UOM(ol.order_quantity_uom,
                     dd.requested_quantity_uom,
                     ol.ordered_quantity,
                     dd.inventory_item_id) ,
   dd.requested_quantity_uom,
   dd.requested_quantity_uom2,
   ol.ordered_quantity,
   ol.order_quantity_uom,
   ol.ordered_quantity2,
   ol.ordered_quantity_uom2,
   ol.model_remnant_flag,
   ol.item_type_code,
   ol.calculate_price_flag,
   dd.ship_tolerance_below ,
   dd.ship_tolerance_above ,
   dd.organization_id ,
   NVL(dd.oe_interfaced_flag, 'N') ,
   dl.initial_pickup_date,
   ol.flow_status_code
ORDER BY  ol.org_id,
        dd.source_header_id,
        dd.source_header_number,
        --bug fix 3286811 : replaced total_shipped_quantity -total_requested_quantity in order by for 8.1.7.4 compatibility
        (sum( nvl(dd.shipped_quantity, 0 )) - sum( dd.requested_quantity )),
        dd.source_line_set_id,
        dd.source_line_id,
        dd.top_model_line_id,
        dd.ato_line_id,
        dd.ship_set_id,
        dd.arrival_set_id,
        dd.inventory_item_id,
        dd.ship_model_complete_flag,
        WSH_WV_UTILS.CONVERT_UOM(ol.order_quantity_uom,
                                 dd.requested_quantity_uom,
                                 ol.ordered_quantity,
                                 dd.inventory_item_id) ,
        dd.requested_quantity_uom,
        dd.requested_quantity_uom2,
        ol.ordered_quantity,
        ol.order_quantity_uom,
        ol.ordered_quantity2,
        ol.ordered_quantity_uom2,
        ol.model_remnant_flag,
        ol.item_type_code,
        ol.calculate_price_flag,
        dd.ship_tolerance_below,
        dd.ship_tolerance_above ,
        dd.organization_id,
        NVL(dd.oe_interfaced_flag, 'N') ,
        dl.initial_pickup_date ;
Line: 8873

       WSH_DEBUG_SV.log(l_module_name,'Rows insert into l_bulk_ship_line',l_bulk_count);
Line: 9039

            l_non_bulk_ship_line.line_id.delete;
Line: 9040

            l_non_bulk_ship_line.requested_quantity.delete;
Line: 9041

            l_non_bulk_ship_line.requested_quantity2.delete;
Line: 9042

            l_non_bulk_ship_line.shipping_quantity2.delete;
Line: 9043

            l_non_bulk_ship_line.shipping_quantity.delete;
Line: 9044

            l_non_bulk_ship_line.shipped_quantity.delete; -- muom
Line: 9045

            l_non_bulk_ship_line.shipping_quantity_uom2.delete;
Line: 9046

            l_non_bulk_ship_line.shipping_quantity_uom.delete;
Line: 9048

            l_non_bulk_ship_line.order_quantity_uom.delete;
Line: 9049

            l_non_bulk_ship_line.order_quantity_uom2.delete;
Line: 9050

            l_non_bulk_ship_line.ordered_quantity.delete;
Line: 9051

            l_non_bulk_ship_line.ordered_quantity2.delete;
Line: 9052

            l_non_bulk_ship_line.fulfilled_flag.delete;
Line: 9053

            l_non_bulk_ship_line.actual_shipment_date.delete;
Line: 9054

	    l_non_bulk_ship_line.header_id.delete;
Line: 9055

	    l_non_bulk_ship_line.top_model_line_id.delete;
Line: 9056

	    l_non_bulk_ship_line.ato_line_id.delete;
Line: 9057

	    l_non_bulk_ship_line.ship_set_id.delete;
Line: 9058

	    l_non_bulk_ship_line.arrival_set_id.delete;
Line: 9059

	    l_non_bulk_ship_line.inventory_item_id.delete;
Line: 9060

	    l_non_bulk_ship_line.ship_from_org_id.delete;
Line: 9061

	    l_non_bulk_ship_line.line_set_id.delete;
Line: 9062

            l_non_bulk_ship_line.smc_flag.delete;
Line: 9063

            l_non_bulk_ship_line.over_ship_reason_code.delete;
Line: 9064

            l_non_bulk_ship_line.pending_quantity.delete;
Line: 9065

            l_non_bulk_ship_line.pending_quantity2.delete;
Line: 9066

            l_non_bulk_ship_line.pending_requested_flag.delete;
Line: 9067

            l_non_bulk_ship_line.item_type_code.delete;
Line: 9068

            l_non_bulk_ship_line.calculate_price_flag.delete;
Line: 9072

            l_non_bulk_req_line.line_id.delete;
Line: 9073

            l_non_bulk_req_line.requested_quantity.delete;
Line: 9074

            l_non_bulk_req_line.requested_quantity2.delete;
Line: 9075

            l_non_bulk_req_line.shipping_quantity2.delete;
Line: 9076

            l_non_bulk_req_line.shipping_quantity.delete;
Line: 9077

            l_non_bulk_req_line.shipped_quantity.delete; -- muom
Line: 9078

            l_non_bulk_req_line.shipping_quantity_uom2.delete;
Line: 9079

            l_non_bulk_req_line.shipping_quantity_uom.delete;
Line: 9080

            l_non_bulk_req_line.order_quantity_uom.delete;
Line: 9081

            l_non_bulk_req_line.order_quantity_uom2.delete;
Line: 9082

            l_non_bulk_req_line.ordered_quantity.delete;
Line: 9083

            l_non_bulk_req_line.ordered_quantity2.delete;
Line: 9084

	    l_non_bulk_req_line.line_set_id.delete;
Line: 9085

            l_non_bulk_req_line.item_type_code.delete;
Line: 9087

	    l_non_bulk_req_line.ato_line_id.delete;
Line: 9088

	    l_non_bulk_req_line.top_model_line_id.delete;
Line: 9089

	    l_non_bulk_req_line.inventory_item_id.delete;
Line: 9090

	    l_non_bulk_req_line.ship_from_org_id.delete;
Line: 9756

   update wsh_delivery_details
   set inv_interfaced_flag = 'P' ,
       --Added as part of bug 7645262
       last_update_date    = sysdate,
       request_id          = fnd_global.conc_request_id,
       last_updated_by     = fnd_global.user_id

   where delivery_detail_id in  (
               SELECT  da.delivery_detail_id
               FROM   wsh_delivery_assignments_v da ,
                  wsh_delivery_legs dg,
                  wsh_new_deliveries dl,
                  wsh_trip_stops st
               where dl.delivery_id = da.delivery_id  AND
                   da.delivery_id  IS NOT NULL AND
                   st.stop_id = dg.pick_up_stop_id AND
                   st.batch_id   = p_batch_id   AND
                   st.stop_location_id = dl.initial_pickup_location_id AND
                   dg.delivery_id = dl.delivery_id AND
                   nvl(dl.SHIPMENT_DIRECTION , 'O') IN ('O', 'IO')   -- J Inbound Logistics jckwok
               )
   --RTV changes
   and source_code <> 'RTV'
   and inv_interfaced_flag = 'N'
   and container_flag = 'N'
   and released_status <> 'D' ; /* H integration: wrudge */
Line: 9787

       WSH_DEBUG_SV.log(l_module_name,'Number of rows updated',SQL%ROWCOUNT);
Line: 9857

   Update_Interfaced_Details ( p_batch_id , l_return_status ) ;
Line: 9913

SELECT source_line_id, organization_id, org_id from wsh_delivery_details
where delivery_detail_id = p_del_detail_id
and container_flag = 'N'
and released_status <> 'D' ; /* H integration: wrudge */
Line: 9921

SELECT goods_dispatched_account
FROM   wsh_shipping_parameters
WHERE  organization_id = p_organization_id;
Line: 9973

     SELECT ORG_ID
     INTO l_detail_rec.org_id
     FROM OE_ORDER_LINES_ALL
     WHERE LINE_ID = l_detail_rec.SOURCE_LINE_ID;
Line: 10165

   SELECT wdd.delivery_detail_id
   FROM   wsh_trip_stops wts,
         wsh_delivery_legs wdl,
         wsh_delivery_assignments_v wda,
         wsh_delivery_details wdd
   WHERE  wdd.inv_interfaced_flag IN ('N', 'P')
   AND   wts.batch_id = p_batch_id
   AND   wts.stop_location_id = wdd.ship_from_location_id
   AND   wts.stop_id = wdl.pick_up_stop_id
   AND   wdl.delivery_id = wda.delivery_id
   AND   wda.delivery_id IS NOT NULL
   AND   wda.delivery_detail_id = wdd.delivery_detail_id
   AND   wdd.source_code in ('OE','OKE', 'WSH','RTV')   -- RTV changes
        AND     wdd.released_status <> 'D'  /* H integration: wrudge */
   AND   nvl(wdd.LINE_DIRECTION , 'O') IN ('O', 'IO')   -- J Inbound Logistics jckwok
   AND   rownum = 1;
Line: 10233

   SELECT wdd.delivery_detail_id
   FROM   wsh_trip_stops wts,
         wsh_delivery_legs wdl,
         wsh_delivery_assignments_v wda,
         wsh_delivery_details wdd
   WHERE -- wdd.oe_interfaced_flag <> 'Y'
         wdd.oe_interfaced_flag NOT IN ( 'Y' ,'X')  --Standalone WMS project changes
   AND   wts.batch_id = p_batch_id
   AND   wts.stop_location_id = wdd.ship_from_location_id
   AND   wts.stop_id = wdl.pick_up_stop_id
   AND   wdl.delivery_id = wda.delivery_id
   AND   wda.delivery_id IS NOT NULL
   AND   wda.delivery_detail_id = wdd.delivery_detail_id
   AND   wdd.source_code = 'OE'
        AND     wdd.released_status <> 'D'  /* H integration: wrudge */
   AND   rownum = 1;
Line: 10364

   SELECT request_id
   FROM FND_CONCURRENT_REQUESTS
   WHERE parent_request_id = p_parent_request_id;
Line: 10581

   SELECT dd.source_header_id ,
         dd.source_header_number,
         NULL source_line_set_id,
         dd.source_line_id,
         WSH_WV_UTILS.CONVERT_UOM(ol.order_quantity_uom,
                     dd.requested_quantity_uom,
                     ol.ordered_quantity,
                     dd.inventory_item_id) order_line_quantity,
         -- muom
         ol.ordered_quantity2 order_line_quantity2,
         dd.requested_quantity_uom,
         NULL requested_quantity_uom2,
         ol.ordered_quantity,
         ol.order_quantity_uom,
         NULL ordered_quantity2,
         NULL ordered_quantity_uom2,
         NULL model_remnant_flag,
         ol.item_type_code,
         ol.calculate_price_flag,
         dd.ship_tolerance_below,
         dd.ship_tolerance_above,
         NULL org_id,
         dd.organization_id,
         NVL(dd.oe_interfaced_flag,'X') oe_interfaced_flag,
         NULL initial_pickup_date ,
         NULL top_model_line_id,
         NULL ato_line_id ,
         NULL ship_set_id ,
         NULL ship_model_complete_flag  ,
         NULL arrival_set_id,
         dd.inventory_item_id,
         ol.flow_status_code,
         SUM( dd.requested_quantity ) total_requested_quantity ,
         NULL total_requested_quantity2,
         SUM( NVL(dd.shipped_quantity, 0 )) total_shipped_quantity,
         NULL total_shipped_quantity2,
         -- muom
         NULL total_om_shipped_quantity
  FROM   wsh_delivery_Details dd ,
         oe_order_lines_all ol
  WHERE  dd.source_line_id = ol.line_id
    AND  dd.released_status = 'C'
    AND  dd.source_code = 'OE'
    AND  ol.shipped_quantity IS NULL
    AND  dd.source_line_id IN
         ( SELECT DISTINCT dd1.source_line_id
           FROM   wsh_delivery_details dd1      ,
                  wsh_delivery_assignments_v da
           WHERE  da.delivery_id = c_delivery_id
             AND  da.delivery_detail_id  = dd1.delivery_detail_id
             AND  NVL(dd1.oe_interfaced_flag,'X') = 'X'
             AND  dd1.source_code = 'OE'
             AND  dd1.released_status = 'C')
  GROUP BY  dd.source_header_id,
            dd.source_header_number,
            dd.source_line_id,
            ol.ordered_quantity,
            dd.requested_quantity_uom,
            ol.ordered_quantity,
            ol.order_quantity_uom,
            dd.inventory_item_id,
            ol.item_type_code,
            ol.calculate_price_flag,
            dd.ship_tolerance_below,
            dd.ship_tolerance_above,
            dd.organization_id,
            NVL(dd.oe_interfaced_flag, 'X') ,
            ol.flow_status_code
  ORDER BY  dd.organization_id ,
            dd.source_line_id ;
Line: 10654

  l_delete_detail_id NUMBER;
Line: 10822

  SELECT dd.source_header_id,
         dd.source_header_number  ,
         dd.source_line_id ,
         ol.ordered_quantity ,
         dd.requested_quantity_uom,
         ol.order_quantity_uom ,
         dd.inventory_item_id,
         ol.item_type_code  ,
         ol.org_id  ,
         ol.calculate_price_flag ,
         dd.ship_tolerance_below,
         dd.ship_tolerance_above   ,
         dd.organization_id  ,
         NVL(dd.oe_interfaced_flag, 'X') oe_interfaced_flag  ,
         ol.flow_status_code  ,
         SUM( dd.requested_quantity ) total_requested_quantity ,
         SUM( NVL(dd.shipped_quantity, 0 )) total_shipped_quantity
  FROM   wsh_delivery_Details dd ,
         oe_order_lines_all ol
  WHERE  dd.source_line_id  = ol.line_id
     AND dd.released_status = 'C'
     AND dd.source_line_id  = c_line_id
     AND dd.source_code = 'OE'
     and ol.shipped_quantity is NULL
     AND NOT EXISTS
         ( SELECT 'X'
           FROM   wsh_delivery_details wdd2
           WHERE  wdd2.source_line_id   = dd.source_line_id
             AND  wdd2.source_code = 'OE'
             AND  wdd2.released_status IN ( 'R','B','S','Y','X'))
  GROUP BY dd.source_header_id ,
         dd.source_header_number ,
         dd.source_line_id ,
         ol.ordered_quantity ,
         dd.requested_quantity_uom ,
         ol.ordered_quantity ,
         ol.order_quantity_uom ,
         dd.inventory_item_id ,
         ol.item_type_code ,
         ol.org_id ,
         ol.calculate_price_flag ,
         dd.ship_tolerance_below ,
         dd.ship_tolerance_above ,
         dd.organization_id ,
         NVL(dd.oe_interfaced_flag, 'X') ,
         ol.flow_status_code
   ORDER BY dd.organization_id ,
            dd.source_line_id ;
Line: 10890

    l_bulk_ship_line.line_id.DELETE;
Line: 10891

    l_non_bulk_ship_line.line_id.DELETE;
Line: 10924

            SELECT initial_pickup_date
            INTO  l_pick_up_date
            FROM  wsh_delivery_details wdd    ,
                  wsh_delivery_assignments wda,
                  wsh_new_deliveries wnd
            WHERE wdd.source_line_id     = line_rec.source_line_id
              AND wda.delivery_detail_id = wdd.delivery_detail_id
              AND wnd.delivery_id        = wda.delivery_id
              AND ROWNUM =1;