DBA Data[Home] [Help]

APPS.CSD_DEPOT_UPDATE_PVT SQL Statements

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

Line: 28

    select uom_code
    into p_from_uom_code
    from mtl_units_of_measure
    where unit_of_measure = p_from_uom;
Line: 46

    select primary_uom_code
    into v_primary_uom_code
    from mtl_system_items
    where organization_id   = p_organization_id
    and   inventory_item_id = p_item_id;
Line: 84

PROCEDURE group_wip_update
( p_api_version           IN   NUMBER,
  p_commit                IN   VARCHAR2  := fnd_api.g_false,
  p_init_msg_list         IN   VARCHAR2  := fnd_api.g_false,
  p_validation_level      IN   NUMBER    := fnd_api.g_valid_level_full,
  p_incident_id           IN   NUMBER,
  x_return_status         OUT NOCOPY  VARCHAR2,
  x_msg_count             OUT NOCOPY  NUMBER,
  x_msg_data              OUT NOCOPY  VARCHAR2
  )
 IS
  l_api_name                 CONSTANT VARCHAR2(30)   := 'group_wip_update';
Line: 113

  p_last_updated_by          NUMBER;
Line: 124

SELECT repair_group_id
  FROM csd_repair_order_groups
 WHERE incident_id = p_inc_id;
Line: 129

SELECT x.repair_job_xref_id, x.group_id, x.object_version_number
  FROM csd_repair_job_xref x
 WHERE x.repair_line_id in ( select r.repair_line_id
                              from csd_repairs r
                             where r.repair_group_id = p_rep_grp_id)
   AND x.wip_entity_id = x.group_id;
Line: 139

SELECT distinct crog.wip_entity_id
FROM   csd_repair_order_groups crog,
       wip_discrete_jobs wdj
WHERE  crog.wip_entity_id = wdj.wip_entity_id
 AND   wdj.status_type    in ( 4,12,5)
 AND   crog.incident_id    = p_inc_id;
Line: 155

SELECT crog.repair_group_id
FROM   csd_repair_order_groups crog
WHERE  crog.wip_entity_id = p_wip_ent_id;
Line: 162

SELECT
      crj.repair_job_xref_id,
      crj.wip_entity_id,
      crj.repair_line_id,
      csr.repair_number,
      crj.quantity_completed,
      crj.quantity,
      csr.promise_date
FROM  csd_repair_job_xref crj,
     csd_repairs csr
WHERE repair_group_id = p_rep_group_id
AND   csr.repair_line_id            = crj.repair_line_id
AND   nvl(crj.quantity_completed,0) < crj.quantity
AND   crj.wip_entity_id  = p_wip_ent_id;
Line: 180

   SAVEPOINT  group_wip_update;
Line: 236

      SELECT wip_entity_id
        INTO v_weid
        FROM wip_entities
       WHERE wip_entity_name = 'CSD'||C6.group_id;
Line: 265

      UPDATE csd_repair_job_xref
         SET wip_entity_id   = v_weid
       WHERE repair_job_xref_id = C6.repair_job_xref_id
         AND group_id = C6.group_id
         AND object_version_number = C6.object_version_number;
Line: 288

      UPDATE csd_repair_order_groups
         SET wip_entity_id   = v_weid
       WHERE repair_group_id = C5.repair_group_id;
Line: 314

       SELECT  wip_entity_id,
              quantity_completed,
                completion_subinventory,
                date_completed,
              organization_id,
              routing_reference_id,
              last_updated_by
        INTO    v_wip_entity_id,
                v_quantity_completed,
                p_completion_subinventory,
                p_date_completed,
              p_organization_id,
              p_routing_reference_id,
              p_last_updated_by
        FROM    wip_discrete_jobs
        WHERE   wip_entity_id = C1.wip_entity_id
          AND   status_type    in ( 4,12,5);
Line: 348

    SELECT nvl(sum(quantity_completed),0)
    INTO p_old_complete
    FROM csd_repair_job_xref
    WHERE wip_entity_id = C1.wip_entity_id;
Line: 367

            update csd_repair_job_xref
            set quantity_completed = quantity
            where repair_line_id = C3.repair_line_id;
Line: 372

       csd_gen_utility_pvt.add('Updated qty completed in csd_repair_job_xref for :'||C1.wip_entity_id);
Line: 377

            update csd_repairs
            set ro_txn_status  = 'WIP_COMPLETED'
            where repair_line_id = C3.repair_line_id;
Line: 382

       csd_gen_utility_pvt.add('Updated txn status in csd_repairs :'||C3.repair_line_id);
Line: 404

                p_PROGRAM_UPDATE_DATE     => null,
                p_CREATED_BY              => FND_GLOBAL.USER_ID,
                p_CREATION_DATE           => sysdate,
                p_LAST_UPDATED_BY         =>  FND_GLOBAL.USER_ID,
                p_LAST_UPDATE_DATE        => sysdate,
                p_REPAIR_LINE_ID          => C3.repair_line_id,
                p_EVENT_CODE  => 'JC',
                p_EVENT_DATE  => nvl(p_date_completed,sysdate),
                p_QUANTITY    => v_transaction_quantity,
                p_PARAMN1     => p_organization_id,
                p_PARAMN2     => p_routing_reference_id,
                p_PARAMN3     => null,
                p_PARAMN4     => C3.wip_entity_id,
                p_PARAMN5     => null,
                p_PARAMN6     => null,
                p_PARAMN7     => null,
                p_PARAMN8     => null,
                p_PARAMN9     => null,
                p_PARAMN10    => null,
                p_PARAMC1     => p_completion_subinventory,
                p_PARAMC2     => v_wip_entity_name,
                p_PARAMC3     => null,
                p_PARAMC4     => null,
                p_PARAMC5     => null,
                p_PARAMC6     => null,
                p_PARAMC7     => null,
                p_PARAMC8     => null,
                p_PARAMC9     => null,
                p_PARAMC10    => null,
                p_PARAMD1     => p_date_completed,
                p_PARAMD2     => null,
                p_PARAMD3     => null,
                p_PARAMD4     => null,
                p_PARAMD5     => null,
                p_PARAMD6     => null,
                p_PARAMD7     => null,
                p_PARAMD8     => null,
                p_PARAMD9     => null,
                p_PARAMD10    => null,
                p_ATTRIBUTE_CATEGORY  => null,
                p_ATTRIBUTE1    => null,
                p_ATTRIBUTE2    => null,
                p_ATTRIBUTE3    => null,
                p_ATTRIBUTE4    => null,
                p_ATTRIBUTE5    => null,
                p_ATTRIBUTE6    => null,
                p_ATTRIBUTE7    => null,
                p_ATTRIBUTE8    => null,
                p_ATTRIBUTE9    => null,
                p_ATTRIBUTE10   => null,
                p_ATTRIBUTE11   => null,
                p_ATTRIBUTE12   => null,
                p_ATTRIBUTE13   => null,
                p_ATTRIBUTE14   => null,
                p_ATTRIBUTE15   => null,
                p_LAST_UPDATE_LOGIN  => FND_GLOBAL.LOGIN_ID,
                X_Return_Status      => l_return_status  ,
                X_Msg_Count          => l_msg_count,
                X_Msg_Data           => l_msg_data  );
Line: 475

          UPDATE csd_repair_order_groups
          SET    group_txn_status   = 'WIP_COMPLETED',
                 completed_quantity = submitted_quantity
          WHERE  repair_group_id    = C2.repair_group_id;
Line: 482

        csd_gen_utility_pvt.add('Successfully completed Depot Repair WIP Job Update');
Line: 502

          ROLLBACK TO Group_Wip_update;
Line: 509

          ROLLBACK TO Group_Wip_update;
Line: 515

          ROLLBACK TO Group_Wip_update ;
Line: 527

END Group_Wip_update;
Line: 530

/* procedure name: Pre_process_update                    */
/* description   : procedure that updates the depot table*/
/*                 once the pre-process is completed     */
/*-------------------------------------------------------*/

procedure Pre_process_update
( p_api_version           IN     NUMBER,
  p_commit                IN     VARCHAR2  := fnd_api.g_false,
  p_init_msg_list         IN     VARCHAR2  := fnd_api.g_false,
  p_validation_level      IN     NUMBER    := fnd_api.g_valid_level_full,
  p_incident_id           IN     number,
  x_return_status         OUT NOCOPY    VARCHAR2,
  x_msg_count             OUT NOCOPY    NUMBER,
  x_msg_data              OUT NOCOPY    VARCHAR2
  ) IS

  l_api_name               CONSTANT VARCHAR2(30)   := 'Pre_process_update';
Line: 552

  x_update_count           Number;
Line: 555

Select crog.repair_group_id,
       crt.repair_type_ref,
       crog.group_txn_status,
      crog.repair_order_quantity,
      crog.received_quantity,
      crog.shipped_quantity
from csd_repair_order_groups crog,
     csd_repair_types_vl crt
where crog.repair_type_id   = crt.repair_type_id
 and  crog.incident_id      = p_inc_id;
Line: 569

   SAVEPOINT  Pre_process_update;
Line: 632

         Group_Rma_Update
          ( p_api_version         => p_api_version,
            p_commit              => fnd_api.g_false,
            p_init_msg_list       => fnd_api.g_true,
            p_validation_level    => fnd_api.g_valid_level_full,
            p_repair_group_id     => grp.repair_group_id,
            x_update_count        => x_update_count,
            x_return_status       => x_return_status,
            x_msg_count           => x_msg_count,
            x_msg_data            => x_msg_data );
Line: 644

          csd_gen_utility_pvt.add('x_update_count  ='||x_update_count );
Line: 650

            csd_gen_utility_pvt.ADD('Group_ship_update failed ');
Line: 656

        IF (nvl(grp.received_quantity,0) + nvl(x_update_count,0) = nvl(grp.repair_order_quantity,0)) then

IF (g_debug > 0 ) THEN
          csd_gen_utility_pvt.add('Updating group txn status and qty ');
Line: 663

            Update csd_repair_order_groups
            set received_quantity = nvl(repair_order_quantity,0) ,
                group_txn_status  = 'OM_RECEIVED'
            where repair_group_id = grp.repair_group_id ;
Line: 667

         ELSIF nvl(x_update_count,0) > 0 then
IF (g_debug > 0 ) THEN
          csd_gen_utility_pvt.add('Updating recd qty');
Line: 673

            Update csd_repair_order_groups
            set received_quantity = nvl(received_quantity,0)+ x_update_count
            where repair_group_id = grp.repair_group_id ;
Line: 686

         Group_Rma_Update
          ( p_api_version         => p_api_version,
            p_commit              => fnd_api.g_false,
            p_init_msg_list       => fnd_api.g_true,
            p_validation_level    => fnd_api.g_valid_level_full,
            p_repair_group_id     => grp.repair_group_id,
            x_update_count        => x_update_count,
            x_return_status       => x_return_status,
            x_msg_count           => x_msg_count,
            x_msg_data            => x_msg_data );
Line: 702

          csd_gen_utility_pvt.add('x_update_count  ='||x_update_count );
Line: 708

            csd_gen_utility_pvt.ADD('Group_rma_update failed ');
Line: 714

        IF (nvl(grp.received_quantity,0) + nvl(x_update_count,0) = nvl(grp.repair_order_quantity,0)) then

IF (g_debug > 0 ) THEN
          csd_gen_utility_pvt.add('Updating group txn status and qty ');
Line: 721

            Update csd_repair_order_groups
            set received_quantity = nvl(repair_order_quantity,0) ,
                group_txn_status  = 'OM_RECEIVED'
            where repair_group_id = grp.repair_group_id ;
Line: 725

         ELSIF nvl(x_update_count,0) > 0 then
IF (g_debug > 0 ) THEN
          csd_gen_utility_pvt.add('Updating recd qty');
Line: 731

            Update csd_repair_order_groups
            set received_quantity = nvl(received_quantity,0)+ x_update_count
            where repair_group_id = grp.repair_group_id ;
Line: 739

         Group_ship_update
          ( p_api_version         => p_api_version,
            p_commit              => fnd_api.g_false,
            p_init_msg_list       => fnd_api.g_true,
            p_validation_level    => fnd_api.g_valid_level_full,
            p_repair_group_id     => grp.repair_group_id,
            x_update_count        => x_update_count,
            x_return_status       => x_return_status,
            x_msg_count           => x_msg_count,
            x_msg_data            => x_msg_data );
Line: 752

            csd_gen_utility_pvt.ADD('Group_ship_update failed ');
Line: 766

         Group_ship_update
          ( p_api_version         => p_api_version,
            p_commit              => fnd_api.g_false,
            p_init_msg_list       => fnd_api.g_true,
            p_validation_level    => fnd_api.g_valid_level_full,
            p_repair_group_id     => grp.repair_group_id,
            x_update_count        => x_update_count,
            x_return_status       => x_return_status,
            x_msg_count           => x_msg_count,
            x_msg_data            => x_msg_data );
Line: 782

          csd_gen_utility_pvt.add('x_update_count  ='||x_update_count );
Line: 788

            csd_gen_utility_pvt.ADD('Group_ship_update failed ');
Line: 794

      IF (nvl(grp.shipped_quantity,0) + nvl(x_update_count,0)) = nvl(grp.repair_order_quantity,0) then
IF (g_debug > 0 ) THEN
        csd_gen_utility_pvt.add('Updating group status and qty ');
Line: 800

         Update csd_repair_order_groups
         set shipped_quantity = nvl(repair_order_quantity,0) ,
             group_txn_status  = 'OM_SHIPPED'
         where repair_group_id = grp.repair_group_id ;
Line: 804

       ELSIF nvl(x_update_count,0) > 0 then
IF (g_debug > 0 ) THEN
         csd_gen_utility_pvt.add('updating shipped qty  ='||x_update_count );
Line: 810

         Update csd_repair_order_groups
         set shipped_quantity = nvl(shipped_quantity,0)+x_update_count
         where repair_group_id = grp.repair_group_id ;
Line: 823

          ROLLBACK TO Pre_process_update;
Line: 830

          ROLLBACK TO Pre_process_update ;
Line: 836

          ROLLBACK TO Pre_process_update ;
Line: 847

END Pre_process_update;
Line: 850

/* procedure name: Post_process_update              */
/* description   : procedure that updates depot     */
/*                after post-process is complete    */
/*--------------------------------------------------*/

procedure Post_process_update
( p_api_version           IN     NUMBER,
  p_commit                IN     VARCHAR2  := fnd_api.g_false,
  p_init_msg_list         IN     VARCHAR2  := fnd_api.g_false,
  p_validation_level      IN     NUMBER    := fnd_api.g_valid_level_full,
  p_incident_id           IN     number,
  x_return_status         OUT NOCOPY    VARCHAR2,
  x_msg_count             OUT NOCOPY    NUMBER,
  x_msg_data              OUT NOCOPY    VARCHAR2
 ) IS

  l_api_name               CONSTANT VARCHAR2(30)   := 'Post_process_update';
Line: 872

  x_update_count           number;
Line: 875

Select crog.repair_group_id,
       crt.repair_type_ref,
       crog.group_txn_status,
      crog.repair_order_quantity,
      crog.received_quantity,
      crog.shipped_quantity
from csd_repair_order_groups crog,
     csd_repair_types_vl crt
where crog.repair_type_id   = crt.repair_type_id
 and  crog.incident_id      = p_inc_id;
Line: 889

   SAVEPOINT  Post_process_update;
Line: 947

         Group_Rma_Update
          ( p_api_version         => p_api_version,
            p_commit              => fnd_api.g_false,
            p_init_msg_list       => fnd_api.g_true,
            p_validation_level    => fnd_api.g_valid_level_full,
            p_repair_group_id     => grp.repair_group_id,
            x_update_count        => x_update_count,
            x_return_status       => x_return_status,
            x_msg_count           => x_msg_count,
            x_msg_data            => x_msg_data );
Line: 963

          csd_gen_utility_pvt.add('x_update_count ='||x_update_count );
Line: 969

            csd_gen_utility_pvt.ADD('Group_ship_update failed ');
Line: 975

     IF nvl(grp.received_quantity,0)+nvl(x_update_count,0) = nvl(grp.repair_order_quantity,0) then
IF (g_debug > 0 ) THEN
         csd_gen_utility_pvt.add('Updating the group txn status ');
Line: 981

         Update csd_repair_order_groups
         set received_quantity = nvl(received_quantity ,0) + nvl(x_update_count,0),
             group_txn_status  = 'OM_RECEIVED'
         where repair_group_id = grp.repair_group_id ;
Line: 985

      ELSIF  nvl(x_update_count,0) > 0 then
IF (g_debug > 0 ) THEN
         csd_gen_utility_pvt.add('Updating the recd qty ');
Line: 991

         Update csd_repair_order_groups
         set received_quantity = nvl(received_quantity ,0) + nvl(x_update_count,0)
         where repair_group_id = grp.repair_group_id ;
Line: 1005

         Group_ship_update
          ( p_api_version         => p_api_version,
            p_commit              => fnd_api.g_false,
            p_init_msg_list       => fnd_api.g_true,
            p_validation_level    => fnd_api.g_valid_level_full,
            p_repair_group_id     => grp.repair_group_id,
            x_update_count        => x_update_count,
            x_return_status       => x_return_status,
            x_msg_count           => x_msg_count,
            x_msg_data            => x_msg_data );
Line: 1021

        csd_gen_utility_pvt.add('x_update_count   ='||x_update_count );
Line: 1027

            csd_gen_utility_pvt.ADD('Group_ship_update failed ');
Line: 1033

      IF nvl(grp.shipped_quantity,0) + nvl(x_update_count,0) = grp.repair_order_quantity then
IF (g_debug > 0 ) THEN
         csd_gen_utility_pvt.add('updating group txn status');
Line: 1040

         Update csd_repair_order_groups
         set shipped_quantity = nvl(shipped_quantity ,0) + nvl(x_update_count,0),
             group_txn_status  = 'OM_SHIPPED'
         where repair_group_id = grp.repair_group_id ;
Line: 1045

     ELSIF nvl(x_update_count,0) > 0 THEN
IF (g_debug > 0 ) THEN
         csd_gen_utility_pvt.add('updating only shipped qty');
Line: 1051

         Update csd_repair_order_groups
         set shipped_quantity = nvl(shipped_quantity ,0) + nvl(x_update_count,0)
         where repair_group_id = grp.repair_group_id ;
Line: 1064

         Group_ship_update
          ( p_api_version         => p_api_version,
            p_commit              => fnd_api.g_false,
            p_init_msg_list       => fnd_api.g_true,
            p_validation_level    => fnd_api.g_valid_level_full,
            p_repair_group_id     => grp.repair_group_id,
            x_update_count        => x_update_count,
            x_return_status       => x_return_status,
            x_msg_count           => x_msg_count,
            x_msg_data            => x_msg_data );
Line: 1080

           csd_gen_utility_pvt.add('x_update_count   ='||x_update_count );
Line: 1086

            csd_gen_utility_pvt.ADD('Group_ship_update failed ');
Line: 1092

        IF nvl(grp.shipped_quantity,0) + nvl(x_update_count,0) = grp.repair_order_quantity then

IF (g_debug > 0 ) THEN
        csd_gen_utility_pvt.add('updating group txn status');
Line: 1099

         Update csd_repair_order_groups
         set shipped_quantity = nvl(shipped_quantity ,0) + nvl(x_update_count,0),
             group_txn_status  = 'OM_SHIPPED'
         where repair_group_id = grp.repair_group_id ;
Line: 1104

       ELSIF nvl(x_update_count,0) > 0 THEN
IF (g_debug > 0 ) THEN
         csd_gen_utility_pvt.add('updating only shipped qty');
Line: 1110

         Update csd_repair_order_groups
         set shipped_quantity = nvl(shipped_quantity ,0) + nvl(x_update_count,0)
         where repair_group_id = grp.repair_group_id ;
Line: 1118

         Group_Rma_Update
          ( p_api_version         => p_api_version,
            p_commit              => fnd_api.g_false,
            p_init_msg_list       => fnd_api.g_true,
            p_validation_level    => fnd_api.g_valid_level_full,
            p_repair_group_id     => grp.repair_group_id,
            x_update_count        => x_update_count,
            x_return_status       => x_return_status,
            x_msg_count           => x_msg_count,
            x_msg_data            => x_msg_data );
Line: 1131

            csd_gen_utility_pvt.ADD('Group_rma_update failed ');
Line: 1145

          ROLLBACK TO Post_process_update;
Line: 1152

          ROLLBACK TO Post_process_update ;
Line: 1158

          ROLLBACK TO Post_process_update ;
Line: 1169

END Post_process_update;
Line: 1172

/* procedure name: Group_Rma_Update                 */
/* description   : procedure used to apply contract */
/*                                                  */
/*--------------------------------------------------*/

procedure Group_Rma_Update
( p_api_version           IN     NUMBER,
  p_commit                IN     VARCHAR2  := fnd_api.g_false,
  p_init_msg_list         IN     VARCHAR2  := fnd_api.g_false,
  p_validation_level      IN     NUMBER    := fnd_api.g_valid_level_full,
  p_repair_group_id       IN     NUMBER,
  x_update_count          OUT NOCOPY    NUMBER,
  x_return_status         OUT NOCOPY    VARCHAR2,
  x_msg_count             OUT NOCOPY    NUMBER,
  x_msg_data              OUT NOCOPY    VARCHAR2
  ) IS

  l_api_name          CONSTANT VARCHAR2(30)   := 'Group_Rma_Update';
Line: 1212

Select
     cr.incident_id,         -- travi
     cr.repair_group_id,
     ced.order_header_id,
     ced.order_line_id,
     ced.txn_billing_type_id,
     cpt.product_transaction_id,
     cpt.action_code,
    ooh.order_number rma_number,
     ool.line_number rma_line_number,
     ool.line_type_id,
     cr.repair_line_id,
     cr.repair_number,
     rcv.organization_id,
     cr.inventory_item_id,
     rcv.unit_of_measure,
     rcv.transaction_date received_date,
     rcv.transaction_id transaction_id,
     rcv.quantity received_quantity,
     rcv.subinventory,
     rcv.last_updated_by who_col,
     rcv.oe_order_header_id rma_header_id,
    rst.serial_num serial_number
from csd_repairs cr,
     csd_product_transactions cpt,
     cs_estimate_details ced,
     rcv_transactions rcv,
    rcv_serial_transactions rst,
     oe_order_headers_all ooh,
     oe_order_lines_all ool,
     cs_txn_billing_types ctbt,
     cs_transaction_types_b ctt
where cr.repair_line_id    = cpt.repair_line_id
 and  cpt.estimate_detail_id = ced.estimate_detail_id
 and  ced.txn_billing_type_id = ctbt.txn_billing_type_id
 and  ctbt.transaction_type_id = ctt.transaction_type_id
 and  ctt.depot_Repair_flag = 'Y'
 and  cpt.action_type in ('RMA','WALK_IN_RECEIPT')
 and  ced.original_source_code = 'DR'
 and  cr.repair_group_id = p_rep_group_id
 and  rcv.oe_order_line_id = ced.order_line_id
 and  rcv.transaction_id = rst.transaction_id(+)
 and  rcv.oe_order_line_id = ool.line_id
 and  ool.header_id = ooh.header_id
 and  rcv.transaction_type = 'DELIVER'
 and  rcv.source_document_code = 'RMA'
 and  rcv.transaction_id NOT IN
       (SELECT paramn1
         FROM csd_Repair_history crh,
              csd_repairs cra
         WHERE crh.repair_line_id = cra.repair_line_id
          AND  crh.event_code = 'RR'
          AND  cra.repair_group_id = p_rep_group_id );
Line: 1269

   SAVEPOINT  Group_Rma_Update;
Line: 1317

        csd_gen_utility_pvt.add('Before update csd_repairs');
Line: 1321

         update csd_repairs
         set quantity_rcvd = nvl(quantity_rcvd,0)+ nvl(p_result_quantity,0),
             ro_txn_status = 'OM_RECEIVED'
         where repair_line_id = C1.repair_line_id;
Line: 1327

        csd_gen_utility_pvt.add('After update csd_repairs');
Line: 1337

          csd_gen_utility_pvt.add('Before select ib_flag');
Line: 1341

          select
          comms_nl_trackable_flag
          into l_ib_flag
          from mtl_system_items
        where inventory_item_id = C1.inventory_item_id
         and  organization_id = C1.organization_id
           and rownum < 2;  -- travi
Line: 1350

          csd_gen_utility_pvt.add('After select ib_flag');
Line: 1381

               csd_gen_utility_pvt.add('Before select account_id,  customer_id');
Line: 1384

              select account_id,  customer_id
                into l_account_id, l_customer_id
                from csd_incidents_v
                where incident_id = C1.incident_id;
Line: 1390

               csd_gen_utility_pvt.add('After select account_id,  customer_id');
Line: 1405

               csd_gen_utility_pvt.add('Before select instance_id');
Line: 1409

            Select instance_id
             into  l_instance_id
             from csi_item_instances
             where serial_number = C1.serial_number
             and  inventory_item_id = C1.inventory_item_id
             and  trunc(sysdate) between trunc(nvl(active_start_date,sysdate))
             and  trunc(nvl(active_end_date,sysdate))
                and owner_party_account_id = nvl(l_account_id, owner_party_account_id)  -- sr.account_id
                and owner_party_id = l_customer_id;  -- sr.customer_id
Line: 1420

               csd_gen_utility_pvt.add('After select instance_id');
Line: 1438

          update csd_repairs
          set serial_number = C1.serial_number ,
            customer_product_id = l_instance_id
          where repair_line_id = C1.repair_line_id;
Line: 1447

          update csd_repairs
          set serial_number = C1.serial_number
          where repair_line_id = C1.repair_line_id;
Line: 1456

        Update csd_product_transactions
       set prod_txn_status = 'RECEIVED'
       where product_transaction_id = C1.product_transaction_id;
Line: 1485

            p_PROGRAM_UPDATE_DATE      => null,
            p_CREATED_BY       =>  FND_GLOBAL.USER_ID,
            p_CREATION_DATE    => sysdate,
            p_LAST_UPDATED_BY  =>  FND_GLOBAL.USER_ID,
            p_LAST_UPDATE_DATE => sysdate,
            p_REPAIR_LINE_ID   => C1.repair_line_id,
            p_EVENT_CODE       => 'RR',
            p_EVENT_DATE       => C1.received_date,
            p_QUANTITY         => C1.received_quantity,
            p_PARAMN1          => C1.transaction_id,
            p_PARAMN2          => C1.rma_line_number,
            p_PARAMN3          => C1.line_type_id,
            p_PARAMN4          => C1.txn_billing_type_id,
            p_PARAMN5          => C1.who_col,
            p_PARAMN6          => C1.rma_header_id,
            p_PARAMN7          => null,
            p_PARAMN8          => null,
            p_PARAMN9          => null,
            p_PARAMN10         => null,
            p_PARAMC1          => C1.subinventory,
            p_PARAMC2          => C1.rma_number,
            p_PARAMC3          => null,
            p_PARAMC4          => null,
            p_PARAMC5          => null,
            p_PARAMC6          => null,
            p_PARAMC7          => null,
            p_PARAMC8          => null,
            p_PARAMC9          => null,
            p_PARAMC10         => null,
            p_PARAMD1          => null,
            p_PARAMD2          => null,
            p_PARAMD3          => null,
            p_PARAMD4          => null,
            p_PARAMD5          => null,
            p_PARAMD6          => null,
            p_PARAMD7          => null,
            p_PARAMD8          => null,
            p_PARAMD9          => null,
            p_PARAMD10         => null,
            p_ATTRIBUTE_CATEGORY => null,
            p_ATTRIBUTE1         => null,
            p_ATTRIBUTE2         => null,
            p_ATTRIBUTE3         => null,
            p_ATTRIBUTE4         => null,
            p_ATTRIBUTE5         => null,
            p_ATTRIBUTE6         => null,
            p_ATTRIBUTE7         => null,
            p_ATTRIBUTE8         => null,
            p_ATTRIBUTE9         => null,
            p_ATTRIBUTE10        => null,
            p_ATTRIBUTE11        => null,
            p_ATTRIBUTE12        => null,
            p_ATTRIBUTE13        => null,
            p_ATTRIBUTE14        => null,
            p_ATTRIBUTE15        => null,
            p_LAST_UPDATE_LOGIN  => FND_GLOBAL.LOGIN_ID,
            X_Return_Status      => l_return_status  ,
            X_Msg_Count          => l_msg_count,
            X_Msg_Data           => l_msg_data        );
Line: 1550

          csd_gen_utility_pvt.add('Successfully completed Depot RMA receipt update ');
Line: 1574

 x_update_count := v_total_records ;
Line: 1578

          ROLLBACK TO Group_Rma_Update;
Line: 1585

          ROLLBACK TO Group_Rma_Update ;
Line: 1591

          ROLLBACK TO Group_Rma_Update ;
Line: 1602

END Group_Rma_Update;
Line: 1605

/* procedure name: Group_ship_update                */
/* description   : procedure used to apply contract */
/*                                                  */
/*--------------------------------------------------*/

procedure Group_ship_update
( p_api_version           IN     NUMBER,
  p_commit                IN     VARCHAR2  := fnd_api.g_false,
  p_init_msg_list         IN     VARCHAR2  := fnd_api.g_false,
  p_validation_level      IN     NUMBER    := fnd_api.g_valid_level_full,
  p_repair_group_id       IN     number,
  x_update_count          OUT NOCOPY    NUMBER,
  x_return_status         OUT NOCOPY    VARCHAR2,
  x_msg_count             OUT NOCOPY    NUMBER,
  x_msg_data              OUT NOCOPY    VARCHAR2

 ) IS

  l_api_name               CONSTANT VARCHAR2(30)   := 'Group_ship_update';
Line: 1638

  Select
    dd.serial_number sl_number,
    cra.quantity qty,
    cpt.product_transaction_id,
    cpt.action_code,
    oeh.order_number order_number,
    oeh.header_id sales_order_header,
    oel.line_number order_line_number,
    oel.line_type_id,
    cra.repair_number,
    cra.repair_line_id,
    ced.txn_billing_type_id,
    dd.requested_quantity,
    dd.shipped_quantity,
    dl.initial_pickup_date date_shipped,
    dd.delivery_detail_id,
    dd.requested_quantity_uom shipped_uom_code,
    mtlu.unit_of_measure shipped_uom,
    dd.inventory_item_id ,
    dd.organization_id
  from
    csd_Repairs cra,
    csd_product_transactions cpt,
    cs_estimate_details ced,
    wsh_new_deliveries  dl,
    wsh_delivery_assignments da,
    wsh_delivery_details dd ,
    oe_order_headers_all oeh,
    oe_order_lines_all oel,
    mtl_units_of_measure mtlu
  Where cra.repair_group_id = p_rep_group_id
    and cra.repair_line_id   = cpt.repair_line_id
    and cpt.estimate_detail_id = ced.estimate_detail_id
    and ced.original_source_code = 'DR'
    and dd.delivery_detail_id   = da.delivery_detail_id
    and da.delivery_id      = dl.delivery_id(+)
    and ced.order_line_id   = oel.line_id
    and oel.header_id       = oeh.header_id
    and dd.source_header_id = ced.order_header_id
    and dd.source_line_id   = ced.order_line_id
    and dd.released_status  = 'C'
    and dd.delivery_detail_id not in
     (select paramn1
      from csd_Repair_history
      where repair_line_id = cra.repair_line_id
        and event_code='PS')
    and mtlu.uom_code = dd.requested_quantity_uom;
Line: 1689

   SAVEPOINT  Group_ship_update;
Line: 1709

   csd_gen_utility_pvt.add('at the begin Group_ship_update');
Line: 1744

     update csd_repairs
     set quantity_shipped = nvl(quantity_shipped,0)+nvl(p_result_ship_quantity,0),
         ro_txn_status    = 'RO_SHIPPED'
     where repair_line_id = I.repair_line_id;
Line: 1751

    update csd_product_transactions
    set prod_txn_status= 'SHIPPED'
    where product_transaction_id = I.product_transaction_id;
Line: 1756

    csd_gen_utility_pvt.add('Updated csd_repairs table');
Line: 1785

      p_PROGRAM_UPDATE_DATE  => null,
      p_CREATED_BY         => FND_GLOBAL.USER_ID,
      p_CREATION_DATE      => sysdate,
      p_LAST_UPDATED_BY    => FND_GLOBAL.USER_ID,
      p_LAST_UPDATE_DATE   => sysdate,
      p_REPAIR_LINE_ID     => I.repair_line_id,
      p_EVENT_CODE         => 'PS',
      p_EVENT_DATE         => I.date_shipped,
      p_QUANTITY           => p_result_ship_quantity,
      p_PARAMN1    => i.delivery_detail_id,
      p_PARAMN2    => i.order_line_number,
      p_PARAMN3    => i.line_type_id,
      p_PARAMN4    => i.txn_billing_type_id,
      p_PARAMN5    => null,
      p_PARAMN6    => null,
      p_PARAMN7    => null,
      p_PARAMN8    => null,
      p_PARAMN9    => null,
      p_PARAMN10   => null,
      p_PARAMC1    => null,
      p_PARAMC2    => i.order_number,
      p_PARAMC3    => null,
      p_PARAMC4    => null,
      p_PARAMC5    => null,
      p_PARAMC6    => null,
      p_PARAMC7    => null,
      p_PARAMC8    => null,
      p_PARAMC9    => null,
      p_PARAMC10   => null,
      p_PARAMD1    => null,
      p_PARAMD2    => null,
      p_PARAMD3    => null,
      p_PARAMD4    => null,
      p_PARAMD5    => null,
      p_PARAMD6    => null,
      p_PARAMD7    => null,
      p_PARAMD8    => null,
      p_PARAMD9    => null,
      p_PARAMD10   => null,
      p_ATTRIBUTE_CATEGORY  => null,
      p_ATTRIBUTE1    => null,
      p_ATTRIBUTE2    => null,
      p_ATTRIBUTE3    => null,
      p_ATTRIBUTE4    => null,
      p_ATTRIBUTE5    => null,
      p_ATTRIBUTE6    => null,
      p_ATTRIBUTE7    => null,
      p_ATTRIBUTE8    => null,
      p_ATTRIBUTE9    => null,
      p_ATTRIBUTE10   => null,
      p_ATTRIBUTE11   => null,
      p_ATTRIBUTE12   =>null,
      p_ATTRIBUTE13   => null,
      p_ATTRIBUTE14   => null,
      p_ATTRIBUTE15   => null,
      p_LAST_UPDATE_LOGIN  => FND_GLOBAL.LOGIN_ID,
      X_Return_Status => l_return_status  ,
      X_Msg_Count     => l_msg_count,
      X_Msg_Data      => l_msg_data   );
Line: 1850

      csd_gen_utility_pvt.add('Successfully completed Depot repair Shipping Update');
Line: 1872

  x_update_count := v_total_records;
Line: 1876

          ROLLBACK TO Group_ship_update;
Line: 1883

          ROLLBACK TO Group_ship_update ;
Line: 1889

          ROLLBACK TO Group_ship_update ;
Line: 1901

 End Group_ship_update;