DBA Data[Home] [Help]

APPS.WMS_WAVEPLAN_TASKS_PVT SQL Statements

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

Line: 6

   g_task_updated                   wms_waveplan_tasks_temp.error%TYPE;
Line: 8

   g_cannot_update_putaway          wms_waveplan_tasks_temp.error%TYPE;
Line: 9

   g_cannot_update_staging_move     wms_waveplan_tasks_temp.error%TYPE;
Line: 83

   /*INSERT INTO my_temp_table VALUES (p_message,i);
Line: 95

         SELECT transaction_temp_id, task_id, is_modified, status_id,
                status_id_original, person_id, person_id_original, priority,
                priority_original
           FROM wms_waveplan_tasks_temp
          WHERE is_modified = 'Y';
Line: 127

         UPDATE wms_waveplan_tasks_temp
            SET RESULT = DECODE (RESULT, NULL, 'X', 'S', 'Y', 'E', 'Z')
          WHERE transaction_temp_id = p_transaction_temp_id (i)
            AND task_type_id = p_task_type_id (i);
Line: 144

         UPDATE wms_waveplan_tasks_temp
            SET RESULT =
                        DECODE (RESULT,
                                'Y', 'S',
                                'Z', 'E',
                                'X', NULL,
                                RESULT
                               )
          WHERE RESULT IN ('X', 'Y', 'Z');
Line: 171

      SELECT   NVL (jcgc.visible_flag, jgc.visible_flag)
      BULK COLLECT INTO visible_columns
          FROM jtf_grid_cols_b jgc, jtf_custom_grid_cols jcgc
         WHERE jgc.grid_datasource_name = jcgc.grid_datasource_name(+)
           AND jgc.grid_col_alias = jcgc.grid_col_alias(+)
           AND jgc.grid_datasource_name = 'WMS_WAVEPLAN_TASKS'
           AND jcgc.created_by(+) = l_user_id
           AND jgc.grid_col_alias IN
                  ('ALLOCATED_LPN',
                   'ASSEMBLY',
                   'CARRIER',
                   'CARTONIZATION_LPN',
                   'CONTAINER_ITEM',
                   'CONTENT_LPN',
                   'CUSTOMER',
                   'DELIVERY',
                   'DEPARTMENT',
		   'DROP_LPN', --bug 4510849
                   'FROM_LPN',
                   'LINE',
                   'LINE_NUMBER',
		   'LOADED_LPN', --bug 4510849
                   'MACHINE_RESOURCE_CODE',
                   'NUM_OF_CHILD_TASKS',
                   'OPERATION_PLAN',
                   'OPERATION_SEQUENCE',
                   'OP_PLAN_INSTANCE_ID',
                   'PERSON',
                   'PERSON_RESOURCE_CODE',
		   'PICKED_LPN', --bug 4510849
                   'SHIP_METHOD',
                   'SHIP_TO_COUNTRY',
                   'SHIP_TO_POSTAL_CODE',
                   'SHIP_TO_STATE',
                   'SOURCE_HEADER',
                   'STATUS',
                   'TASK_TYPE',
                   'TO_LOCATOR',
                   'TO_LPN',
                   'TO_ORGANIZATION_CODE',
                   'TRANSACTION_SOURCE_TYPE',
                   'USER_TASK_TYPE'
                  )
      ORDER BY NVL (jcgc.grid_col_alias, jgc.grid_col_alias);
Line: 296

      SELECT   REPLACE (meaning, '''', ''''''), meaning
      BULK COLLECT INTO g_status_codes, g_status_codes_orig
          FROM mfg_lookups
         WHERE lookup_type = 'WMS_TASK_STATUS'
      ORDER BY lookup_code;
Line: 306

      SELECT   REPLACE (meaning, '''', ''''''), meaning
      BULK COLLECT INTO g_task_types, g_task_types_orig
          FROM mfg_lookups
         WHERE lookup_type = 'WMS_TASK_TYPES'
      ORDER BY lookup_code;
Line: 317

      SELECT   REPLACE (meaning, '''', '''''')
      BULK COLLECT INTO g_plan_task_types
          FROM mfg_lookups
         WHERE lookup_type = 'WMS_PLAN_TASK_TYPES'
      ORDER BY lookup_code;
Line: 327

      SELECT   REPLACE (meaning, '''', '''''')
      BULK COLLECT INTO g_plan_status_codes
          FROM mfg_lookups
         WHERE lookup_type = 'WMS_OP_PLAN_INSTANCE_STATUS'
      ORDER BY lookup_code;
Line: 340

         SELECT DECODE (project_reference_enabled, 1, 'Y', 'N')
           INTO g_project_enabled_organization
           FROM mtl_parameters
          WHERE organization_id = p_organization_id;
Line: 348

         UPDATE wms_waveplan_tasks_temp wwtt
            SET LOCATOR =
                   inv_project.get_locator (wwtt.locator_id,
                                            wwtt.organization_id
                                           )
          WHERE LOCATOR IS NULL;
Line: 357

            UPDATE wms_waveplan_tasks_temp wwtt
               SET to_locator =
                      inv_project.get_locator (wwtt.to_locator_id,
                                               wwtt.organization_id
                                              )
             WHERE to_locator IS NULL;
Line: 382

      SELECT ph.segment1, pl.line_num, wwtt.transaction_temp_id,
             wwtt.task_type_id
      BULK COLLECT INTO l_source_header, l_line_number, l_temp_id,
             l_task_type_id
        FROM po_line_locations_trx_v pll,--CLM Changes, using CLM views instead of base tables
             po_headers_trx_v ph,
             po_lines_trx_v pl,
             wms_waveplan_tasks_temp wwtt
       WHERE pll.line_location_id = wwtt.reference_id
         AND pll.po_line_id = pl.po_line_id
         AND ph.po_header_id = pl.po_header_id
         AND wwtt.REFERENCE = 'PO_LINE_LOCATION_ID'
         AND wwtt.source_header IS NULL
         AND wwtt.reference_id IS NOT NULL;
Line: 400

            UPDATE wms_waveplan_tasks_temp wwtt
               SET source_header = l_source_header (i),
                   line_number = l_line_number (i)
             WHERE wwtt.transaction_temp_id = l_temp_id (i)
               AND wwtt.task_type_id = l_task_type_id (i);
Line: 407

      SELECT ooh.order_number, ool.line_number, wwtt.transaction_temp_id,
             wwtt.task_type_id
      BULK COLLECT INTO l_source_header, l_line_number, l_temp_id,
             l_task_type_id
        FROM oe_order_lines_all ool,
             oe_order_headers_all ooh,
             wms_waveplan_tasks_temp wwtt
       WHERE ool.line_id = wwtt.reference_id
         AND ooh.header_id = ool.header_id
         AND wwtt.REFERENCE = 'ORDER_LINE_ID'
         AND wwtt.source_header IS NULL
         AND wwtt.reference_id IS NOT NULL;
Line: 423

            UPDATE wms_waveplan_tasks_temp wwtt
               SET source_header = l_source_header (i),
                   line_number = l_line_number (i)
             WHERE wwtt.transaction_temp_id = l_temp_id (i)
               AND wwtt.task_type_id = l_task_type_id (i);
Line: 430

      SELECT DECODE (rsl.requisition_line_id,
                     NULL, rsh.shipment_num,
                     prh.segment1
                    ),
             DECODE (rsl.requisition_line_id,
                     NULL, rsl.line_num,
                     prl.line_num
                    ),
             wwtt.transaction_temp_id, wwtt.task_type_id
      BULK COLLECT INTO l_source_header,
             l_line_number,
             l_temp_id, l_task_type_id
             -- MOAC po_requisition_headers and
             -- po_requisition_lines switched to use _ALL tables
        FROM po_requisition_headers_all prh,
             po_requisition_lines_all prl,
             rcv_shipment_lines rsl,
             rcv_shipment_headers rsh,
             wms_waveplan_tasks_temp wwtt
       WHERE rsl.shipment_line_id = wwtt.reference_id
         AND prh.requisition_header_id(+) = prl.requisition_header_id
         AND rsl.requisition_line_id = prl.requisition_line_id(+)
         AND rsl.shipment_header_id = rsh.shipment_header_id
         AND wwtt.REFERENCE = 'SHIPMENT_LINE_ID'
         AND wwtt.source_header IS NULL
         AND wwtt.reference_id IS NOT NULL;
Line: 460

            UPDATE wms_waveplan_tasks_temp wwtt
               SET source_header = l_source_header (i),
                   line_number = l_line_number (i)
             WHERE wwtt.transaction_temp_id = l_temp_id (i)
               AND wwtt.task_type_id = l_task_type_id (i);
Line: 494

      SELECT   COUNT (1), wwtt.transaction_temp_id
      BULK COLLECT INTO l_num_of_child_tasks_tbl, l_parent_temp_ids_tbl
          FROM wms_waveplan_tasks_temp wwtt,mtl_cycle_count_entries mcce, mtl_cycle_count_headers mcch
         WHERE mcce.cycle_count_header_id = mcch.cycle_count_header_id
              AND mcce.inventory_item_id = wwtt.inventory_item_id
              AND mcce.subinventory = wwtt.subinventory
              AND mcce.locator_id = wwtt.locator_id
              AND NVL(mcce.revision,'-1') = NVL(wwtt.revision, '-1')
              AND mcch.cycle_count_header_name = wwtt.source_header
	      AND mcch.organization_id = wwtt.organization_id
              AND mcce.entry_status_code not in (2,4,5)
              AND wwtt.status_id in (1,2) --bug 12614348 - Show child task count for Queued tasks too
              AND wwtt.task_type_id = 3
              --bug 12614348 - Show child task count for Queued tasks too
              /*AND not exists (select 1 from wms_dispatched_tasks wdt
                              where wdt.transaction_temp_id = mcce.cycle_count_entry_id
                              and wdt.status in (2,3))*/
      GROUP BY wwtt.transaction_temp_id;
Line: 519

            UPDATE wms_waveplan_tasks_temp wwtt
               SET wwtt.num_of_child_tasks = l_num_of_child_tasks_tbl (i)
             WHERE wwtt.transaction_temp_id = l_parent_temp_ids_tbl (i)
             AND l_num_of_child_tasks_tbl (i) <> 1;
Line: 581

      SELECT   COUNT (1), wwtt.transaction_temp_id
      BULK COLLECT INTO l_num_of_child_tasks_tbl, l_parent_temp_ids_tbl
          FROM wms_waveplan_tasks_temp wwtt,
               mtl_material_transactions_temp mmtt
         WHERE wwtt.transaction_temp_id = mmtt.parent_line_id
           AND wwtt.transaction_temp_id <> mmtt.transaction_temp_id
      GROUP BY wwtt.transaction_temp_id;
Line: 595

            UPDATE wms_waveplan_tasks_temp wwtt
               SET wwtt.num_of_child_tasks = l_num_of_child_tasks_tbl (i)
             WHERE wwtt.transaction_temp_id = l_parent_temp_ids_tbl (i);
Line: 655

            UPDATE wms_waveplan_tasks_temp
              -- transfer_lpn_id would be null if it is loaded into the same lpn as that of picked.
              SET picked_lpn_id = NVL(content_lpn_id,from_lpn_id), /*12984304 Changed the order in NVL * /
                  loaded_lpn_id = Nvl(to_lpn_id,  Nvl(content_lpn_id,from_lpn_id))/*12984304 Changed the order in NVL * /
              WHERE task_type_id IN (1, 4, 5, 6)
              AND status_id = 6;
Line: 663

            UPDATE wms_waveplan_tasks_temp wwtt
            -- transfer_lpn_id would be null if it is loaded into the same lpn as that of picked.
            SET wwtt.picked_lpn_id = NVL(wwtt.content_lpn_id,wwtt.from_lpn_id), /*12984304 Changed the order in NVL */
                    wwtt.loaded_lpn_id = NVL((select transfer_lpn_id from wms_dispatched_tasks_history wdth where wdth.task_id = wwtt.task_id),
                                                            NVL(wwtt.to_lpn_id,  NVL(wwtt.content_lpn_id, wwtt.from_lpn_id)))
            WHERE wwtt.task_type_id IN (1, 4, 5, 6)
            AND wwtt.status_id = 6;
Line: 674

           UPDATE wms_waveplan_tasks_temp
             SET picked_lpn = (SELECT license_plate_number FROM wms_license_plate_numbers WHERE lpn_id = picked_lpn_id)
             WHERE picked_lpn_id IS NOT NULL
             AND task_type_id IN (1, 4, 5, 6)
             AND status_id = 6;
Line: 682

            UPDATE wms_waveplan_tasks_temp
              SET loaded_lpn = (SELECT license_plate_number FROM wms_license_plate_numbers WHERE lpn_id = loaded_lpn_id)
              WHERE loaded_lpn_id IS NOT NULL
              AND task_type_id IN (1, 4, 5, 6)
              AND status_id = 6;
Line: 690

            UPDATE wms_waveplan_tasks_temp wstt
              SET drop_lpn = Nvl((select license_plate_number
                                  FROM wms_license_plate_numbers wlpn, mtl_material_transactions mmt
                                  WHERE wlpn.lpn_id = mmt.transfer_lpn_id
                                  AND mmt.transaction_action_id = 50
                                  AND mmt.transaction_set_id = wstt.transaction_set_id
                                  AND mmt.transaction_quantity > 0),
                                 loaded_lpn)
              WHERE task_type_id IN (1, 4, 5, 6)
              AND status_id = 6;
Line: 706

            UPDATE wms_waveplan_tasks_temp
              -- transfer_lpn_id would be null if it is loaded into the same lpn as that of picked.
              SET picked_lpn_id = NVL(content_lpn_id,from_lpn_id), /*12984304 Changed the order in NVL*/
                  loaded_lpn_id = to_lpn_id
              WHERE task_type_id IN (1, 4, 5, 6)
              AND status_id = 4;
Line: 715

            UPDATE wms_waveplan_tasks_temp
              SET picked_lpn = (SELECT license_plate_number FROM wms_license_plate_numbers WHERE lpn_id = picked_lpn_id)
              WHERE picked_lpn_id IS NOT NULL
              AND task_type_id IN (1, 4, 5, 6)
              AND status_id = 4;
Line: 723

            UPDATE wms_waveplan_tasks_temp
              SET loaded_lpn = (SELECT license_plate_number FROM wms_license_plate_numbers WHERE lpn_id = loaded_lpn_id)
              WHERE loaded_lpn_id IS NOT NULL
              AND task_type_id IN (1, 4, 5, 6)
              AND status_id = 4;
Line: 732

   FUNCTION get_generic_insert (
      p_is_unreleased   BOOLEAN DEFAULT FALSE,
      p_is_pending      BOOLEAN DEFAULT FALSE,
      p_is_queued       BOOLEAN DEFAULT FALSE,
      p_is_dispatched   BOOLEAN DEFAULT FALSE,
      p_is_active       BOOLEAN DEFAULT FALSE,
      p_is_loaded       BOOLEAN DEFAULT FALSE,
      p_is_completed    BOOLEAN DEFAULT FALSE
	 ,p_is_picknone    BOOLEAN DEFAULT FALSE --ER13869750
   )
      RETURN VARCHAR2
   IS
      l_insert_generic   VARCHAR2 (2000);
Line: 772

      l_insert_generic := 'INSERT INTO wms_waveplan_tasks_temp( ';
Line: 773

      /* Patchset J - ATF - we have to insert expansion_code, plans_tasks also
        * into the temp table
        */
      l_insert_generic := l_insert_generic || 'expansion_code';
Line: 777

      l_insert_generic := l_insert_generic || ', plans_tasks';
Line: 778

      l_insert_generic := l_insert_generic || ', transaction_temp_id ';
Line: 783

      l_insert_generic := l_insert_generic || ', parent_line_id ';
Line: 784

      l_insert_generic := l_insert_generic || ', inventory_item_id ';
Line: 785

      l_insert_generic := l_insert_generic || ', item ';
Line: 786

      l_insert_generic := l_insert_generic || ', item_description ';
Line: 787

      l_insert_generic := l_insert_generic || ', unit_weight ';
Line: 788

      l_insert_generic := l_insert_generic || ', weight_uom_code ';
Line: 789

      l_insert_generic := l_insert_generic || ', unit_volume ';
Line: 790

      l_insert_generic := l_insert_generic || ', volume_uom_code ';
Line: 791

      l_insert_generic := l_insert_generic || ', organization_id ';
Line: 792

      l_insert_generic := l_insert_generic || ', revision ';
Line: 793

      l_insert_generic := l_insert_generic || ', subinventory ';
Line: 794

      l_insert_generic := l_insert_generic || ', locator_id ';
Line: 795

      l_insert_generic := l_insert_generic || ', locator ';
Line: 796

      l_insert_generic := l_insert_generic || ', status_id ';
Line: 797

      l_insert_generic := l_insert_generic || ', status_id_original ';
Line: 798

      l_insert_generic := l_insert_generic || ', status ';
Line: 799

      l_insert_generic := l_insert_generic || ', transaction_type_id ';
Line: 800

      l_insert_generic := l_insert_generic || ', transaction_action_id ';
Line: 801

      l_insert_generic := l_insert_generic || ', transaction_source_type_id ';
Line: 805

         l_insert_generic := l_insert_generic || ', transaction_source_type ';
Line: 808

      l_insert_generic := l_insert_generic || ', transaction_source_id ';
Line: 809

      l_insert_generic := l_insert_generic || ', transaction_source_line_id ';
Line: 810

      l_insert_generic := l_insert_generic || ', to_organization_id ';
Line: 814

         l_insert_generic := l_insert_generic || ', to_organization_code ';
Line: 817

      l_insert_generic := l_insert_generic || ', to_subinventory ';
Line: 818

      l_insert_generic := l_insert_generic || ', to_locator_id ';
Line: 822

         l_insert_generic := l_insert_generic || ', to_locator ';
Line: 825

      l_insert_generic := l_insert_generic || ', transaction_uom ';
Line: 826

      l_insert_generic := l_insert_generic || ', transaction_quantity ';
Line: 827

      l_insert_generic := l_insert_generic || ', user_task_type_id ';
Line: 831

         l_insert_generic := l_insert_generic || ', user_task_type ';
Line: 834

      l_insert_generic := l_insert_generic || ', move_order_line_id ';
Line: 835

      l_insert_generic := l_insert_generic || ', pick_slip_number ';
Line: 836

      l_insert_generic := l_insert_generic || ', cartonization_id ';
Line: 840

         l_insert_generic := l_insert_generic || ', cartonization_lpn ';
Line: 843

      l_insert_generic := l_insert_generic || ', allocated_lpn_id ';
Line: 847

         l_insert_generic := l_insert_generic || ', allocated_lpn ';
Line: 850

      l_insert_generic := l_insert_generic || ', container_item_id ';
Line: 854

         l_insert_generic := l_insert_generic || ', container_item ';
Line: 857

      l_insert_generic := l_insert_generic || ', from_lpn_id ';
Line: 861

         l_insert_generic := l_insert_generic || ', from_lpn ';
Line: 864

      l_insert_generic := l_insert_generic || ', content_lpn_id ';
Line: 868

         l_insert_generic := l_insert_generic || ', content_lpn ';
Line: 871

      l_insert_generic := l_insert_generic || ', to_lpn_id ';
Line: 875

         l_insert_generic := l_insert_generic || ', to_lpn ';
Line: 878

      l_insert_generic := l_insert_generic || ', mmtt_last_update_date ';
Line: 879

      l_insert_generic := l_insert_generic || ', mmtt_last_updated_by ';
Line: 880

      l_insert_generic := l_insert_generic || ', priority ';
Line: 881

      l_insert_generic := l_insert_generic || ', priority_original ';
Line: 882

      l_insert_generic := l_insert_generic || ', task_type_id ';
Line: 883

      l_insert_generic := l_insert_generic || ', task_type ';
Line: 884

      l_insert_generic := l_insert_generic || ', creation_time ';
Line: 885

      l_insert_generic := l_insert_generic || ', operation_plan_id ';
Line: 889

         l_insert_generic := l_insert_generic || ', operation_plan ';
Line: 893

        l_insert_generic := l_insert_generic || ', operation_sequence ';
Line: 896

      l_insert_generic := l_insert_generic || ', op_plan_instance_id ';
Line: 900

         l_insert_generic := l_insert_generic || ', task_id ';
Line: 901

         l_insert_generic := l_insert_generic || ', person_id ';
Line: 902

         l_insert_generic := l_insert_generic || ', person_id_original ';
Line: 906

            l_insert_generic := l_insert_generic || ', person ';
Line: 909

         l_insert_generic := l_insert_generic || ', effective_start_date ';
Line: 910

         l_insert_generic := l_insert_generic || ', effective_end_date ';
Line: 911

         l_insert_generic := l_insert_generic || ', person_resource_id ';
Line: 915

            l_insert_generic := l_insert_generic || ', person_resource_code ';
Line: 918

         l_insert_generic := l_insert_generic || ', machine_resource_id ';
Line: 922

            l_insert_generic :=
                               l_insert_generic || ', machine_resource_code ';
Line: 926

         l_insert_generic := l_insert_generic || ', equipment_instance ';
Line: 927

         l_insert_generic := l_insert_generic || ', dispatched_time ';
Line: 928

         l_insert_generic := l_insert_generic || ', loaded_time ';
Line: 929

         l_insert_generic := l_insert_generic || ', drop_off_time ';
Line: 930

         l_insert_generic := l_insert_generic || ', wdt_last_update_date ';
Line: 931

         l_insert_generic := l_insert_generic || ', wdt_last_updated_by ';
Line: 934

      l_insert_generic := l_insert_generic || ', is_modified ';
Line: 936

      l_insert_generic := l_insert_generic || ', secondary_transaction_uom ';
Line: 937

      l_insert_generic := l_insert_generic || ', secondary_transaction_quantity ';
Line: 941

          l_insert_generic := l_insert_generic || ', transaction_set_id ';
Line: 945

      RETURN l_insert_generic;
Line: 948

   FUNCTION get_generic_select (
      p_is_unreleased           BOOLEAN DEFAULT FALSE,
      p_is_pending              BOOLEAN DEFAULT FALSE,
      p_is_queued               BOOLEAN DEFAULT FALSE,
      p_is_dispatched           BOOLEAN DEFAULT FALSE,
      p_is_active               BOOLEAN DEFAULT FALSE,
      p_is_loaded               BOOLEAN DEFAULT FALSE,
      p_is_completed            BOOLEAN DEFAULT FALSE,
      p_populate_merged_tasks   BOOLEAN DEFAULT FALSE
	 ,p_is_picknone            BOOLEAN DEFAULT FALSE  --ER13869750
   )
      RETURN VARCHAR2
   IS
      l_select_generic   VARCHAR2 (4000);
Line: 966

	  Debug(' Entered into get_generic_select ' || i );
Line: 969

          Debug('Entered into generic select');
Line: 995

         l_select_generic := 'SELECT ';
Line: 996

         l_select_generic := l_select_generic || 'null, ';   -- expansion_code
Line: 997

         l_select_generic :=
               l_select_generic
            || 'decode(mmtt.parent_line_id,'
            || ' null,decode(mmtt.operation_plan_id,null,'''
            || g_plan_task_types (1)
       || ''','
       || ' decode(mmtt.transaction_action_id,28,'''
       || g_plan_task_types(1)
       || ''','
       || ' decode(mmtt.transaction_source_type_id, 5, '''
       || g_plan_task_types(1)
       || ''','
       || ' 13, decode(mmtt.transaction_type_id,51,'''
       || g_plan_task_types(1)
       || ''','''
       || g_plan_task_types(3)
            || ''' )))), '
            || ' mmtt.transaction_temp_id, '''
            || g_plan_task_types (4)
            || ''','''
            || g_plan_task_types (2)
            || '''),';
Line: 1021

         l_select_generic := l_select_generic || 'mmtt.transaction_temp_id, ';
Line: 1023

         l_select_generic := l_select_generic || 'mmtt.parent_line_id, ';
Line: 1025

         l_select_generic := l_select_generic || 'mmtt.inventory_item_id, ';
Line: 1027

         l_select_generic :=
                            l_select_generic || 'msiv.concatenated_segments, ';
Line: 1030

         l_select_generic := l_select_generic || 'msiv.description, ';
Line: 1032

         l_select_generic := l_select_generic || 'msiv.unit_weight, ';
Line: 1034

         l_select_generic := l_select_generic || 'msiv.weight_uom_code, ';
Line: 1036

         l_select_generic := l_select_generic || 'msiv.unit_volume, ';
Line: 1038

         l_select_generic := l_select_generic || 'msiv.volume_uom_code, ';
Line: 1040

         l_select_generic := l_select_generic || 'mmtt.organization_id, ';
Line: 1042

         l_select_generic := l_select_generic || 'mmtt.revision, '; --revision
Line: 1043

         l_select_generic := l_select_generic || 'mmtt.subinventory_code, ';
Line: 1045

         l_select_generic := l_select_generic || 'mmtt.locator_id, ';
Line: 1048

         l_select_generic :=
               l_select_generic
            || 'decode(milv.segment19, null, milv.concatenated_segments, null), ';
Line: 1055

            l_select_generic :=
                  l_select_generic
               || 'decode(wdt.status, null, nvl(mmtt.wms_task_status, 1), wdt.status), ';
Line: 1059

            l_select_generic :=
                  l_select_generic
               || 'decode(wdt.status, null, nvl(mmtt.wms_task_status, 1), wdt.status), ';
Line: 1063

            l_select_generic :=
                  l_select_generic
               || 'decode(decode(wdt.status, null, nvl(mmtt.wms_task_status, 1), wdt.status),'
               || '1, '''
               || g_status_codes (1)
               || ''', 2, '''
               || g_status_codes (2)
               || ''', 3, '''
               || g_status_codes (3)
               || ''', 4, '''
               || g_status_codes (4)
               || ''', 5, '''
               || g_status_codes (5)
               || ''', 6, '''
               || g_status_codes (6)
               || ''', 7, '''
               || g_status_codes (7)
               || ''', 8, '''
               || g_status_codes (8)
               || ''', '
               || '9, '''
               || g_status_codes (9)
               || '''), ';
Line: 1088

            l_select_generic :=
                         l_select_generic || 'nvl(mmtt.wms_task_status, 1), ';
Line: 1091

            l_select_generic :=
                         l_select_generic || 'nvl(mmtt.wms_task_status, 1), ';
Line: 1094

            l_select_generic :=
                  l_select_generic
               || 'decode(nvl(mmtt.wms_task_status, 1),'
               || '1, '''
               || g_status_codes (1)
               || ''', 8, '''
               || g_status_codes (8)
               || '''), ';
Line: 1104

         l_select_generic := l_select_generic || 'mmtt.transaction_type_id, ';
Line: 1106

         l_select_generic :=
                            l_select_generic || 'mmtt.transaction_action_id, ';
Line: 1109

         l_select_generic :=
                       l_select_generic || 'mmtt.transaction_source_type_id, ';
Line: 1115

            l_select_generic :=
                    l_select_generic || 'mtst.transaction_source_type_name, ';
Line: 1120

         l_select_generic :=
                            l_select_generic || 'mmtt.transaction_source_id, ';
Line: 1123

         l_select_generic := l_select_generic || 'mmtt.trx_source_line_id, ';
Line: 1125

         l_select_generic :=
                            l_select_generic || 'mmtt.transfer_organization, ';
Line: 1131

            l_select_generic := l_select_generic || 'mp1.organization_code, ';
Line: 1135

         l_select_generic :=
                            l_select_generic || 'mmtt.transfer_subinventory, ';
Line: 1138

         l_select_generic := l_select_generic || 'mmtt.transfer_to_location, ';
Line: 1144

            l_select_generic :=
                  l_select_generic
               || 'decode(milv1.segment19, null, milv1.concatenated_segments, null), ';
Line: 1149

         l_select_generic := l_select_generic || 'mmtt.transaction_uom, ';
Line: 1151

         l_select_generic := l_select_generic || 'mmtt.transaction_quantity, ';
Line: 1153

         l_select_generic :=
                            l_select_generic || 'mmtt.standard_operation_id, ';
Line: 1159

            l_select_generic := l_select_generic || 'bso.operation_code, ';
Line: 1165

            l_select_generic :=
                              l_select_generic || 'mmtt.move_order_line_id, ';
Line: 1169

            l_select_generic := l_select_generic || 'mmtt.pick_slip_number, ';
Line: 1173

            l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1176

            l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1183

         l_select_generic := l_select_generic || 'mmtt.pick_slip_number, ';          --pick_slip_number
Line: 1185

         l_select_generic := l_select_generic || 'to_number(null), ';                --pick_slip_number
Line: 1188

         l_select_generic := l_select_generic || 'mmtt.cartonization_id, ';
Line: 1193

            l_select_generic :=
                           l_select_generic || 'wlpn2.license_plate_number, ';
Line: 1198

         l_select_generic := l_select_generic || 'mmtt.allocated_lpn_id, ';
Line: 1203

            l_select_generic :=
                           l_select_generic || 'wlpn1.license_plate_number, ';
Line: 1208

         l_select_generic := l_select_generic || 'mmtt.container_item_id, ';
Line: 1213

            l_select_generic :=
                          l_select_generic || 'msiv1.concatenated_segments, ';
Line: 1218

         l_select_generic := l_select_generic || 'mmtt.lpn_id, ';
Line: 1223

            l_select_generic :=
                           l_select_generic || 'wlpn5.license_plate_number, ';
Line: 1228

         l_select_generic := l_select_generic || 'mmtt.content_lpn_id, ';
Line: 1233

            l_select_generic :=
                           l_select_generic || 'wlpn3.license_plate_number, ';
Line: 1238

         l_select_generic := l_select_generic || 'mmtt.transfer_lpn_id, ';
Line: 1243

            l_select_generic :=
                           l_select_generic || 'wlpn4.license_plate_number, ';
Line: 1248

         l_select_generic := l_select_generic || 'mmtt.last_update_date, ';
Line: 1250

         l_select_generic := l_select_generic || 'mmtt.last_updated_by, ';
Line: 1252

         l_select_generic := l_select_generic || 'mmtt.task_priority, ';
Line: 1254

         l_select_generic := l_select_generic || 'mmtt.task_priority, ';
Line: 1256

         l_select_generic := l_select_generic || 'mmtt.wms_task_type, ';
Line: 1259

         l_select_generic :=
               l_select_generic
            || 'decode(mmtt.wms_task_type,'
            || '1, '''
            || g_task_types (1)
            || ''', 2, '''
            || g_task_types (2)
            || ''', 3, '''
            || g_task_types (3)
            || ''', 4, '''
            || g_task_types (4)
            || ''', 5, '''
            || g_task_types (5)
            || ''', 6, '''
            || g_task_types (6)
            || ''', 7, '''
            || g_task_types (7)
            || ''', 8, '''
            || g_task_types (8)
            || '''), ';
Line: 1279

         l_select_generic := l_select_generic || 'mmtt.creation_date, ';
Line: 1281

         l_select_generic := l_select_generic || 'mmtt.operation_plan_id, ';
Line: 1286

            l_select_generic :=
                              l_select_generic || 'wop.operation_plan_name, ';
Line: 1295

              l_select_generic := l_select_generic || 'wooi.operation_sequence,  '; --operation_sequence
Line: 1298

            l_select_generic :=
                            l_select_generic || 'wooi.op_plan_instance_id,  ';
Line: 1303

            l_select_generic := l_select_generic || 'to_number(null), '; --operation_sequence
Line: 1306

            l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1313

            l_select_generic := l_select_generic || 'wdt.task_id, ';
Line: 1315

            l_select_generic := l_select_generic || 'wdt.person_id, ';
Line: 1317

            l_select_generic := l_select_generic || 'wdt.person_id, ';
Line: 1322

               l_select_generic := l_select_generic || 'pap.full_name, ';
Line: 1326

            l_select_generic :=
                              l_select_generic || 'wdt.effective_start_date, ';
Line: 1329

            l_select_generic := l_select_generic || 'wdt.effective_end_date, ';
Line: 1331

            l_select_generic := l_select_generic || 'wdt.person_resource_id, ';
Line: 1336

               l_select_generic := l_select_generic || 'br1.resource_code, ';
Line: 1340

            l_select_generic :=
                               l_select_generic || 'wdt.machine_resource_id, ';
Line: 1346

               l_select_generic := l_select_generic || 'br2.resource_code, ';
Line: 1350

            l_select_generic := l_select_generic || 'wdt.equipment_instance, ';
Line: 1352

            l_select_generic := l_select_generic || 'wdt.dispatched_time, ';
Line: 1354

            l_select_generic := l_select_generic || 'wdt.loaded_time, ';
Line: 1356

            l_select_generic := l_select_generic || 'wdt.drop_off_time, ';
Line: 1358

            l_select_generic := l_select_generic || 'wdt.last_update_date, ';
Line: 1360

            l_select_generic := l_select_generic || 'wdt.last_updated_by, ';
Line: 1366

            l_select_generic :=
                  l_select_generic
               || 'to_number(null), '                              /*task_id*/
               || 'to_number(null), '                            /*person_id*/
               || 'to_number(null), ';                    --person_id_original
Line: 1374

               l_select_generic := l_select_generic || 'NULL, ';
Line: 1378

            l_select_generic :=
                  l_select_generic
               || 'TO_DATE(NULL), '                   /*effective_start_date*/
               || 'TO_DATE(NULL), '                     /*effective_end_date*/
               || 'TO_NUMBER(NULL), ';                    --person_resource_id
Line: 1386

               l_select_generic := l_select_generic || 'NULL, ';
Line: 1390

            l_select_generic := l_select_generic || 'TO_NUMBER(NULL), ';
Line: 1395

               l_select_generic := l_select_generic || 'NULL, ';
Line: 1399

            l_select_generic := l_select_generic || 'NULL, ';
Line: 1401

            l_select_generic := l_select_generic || 'TO_DATE(NULL), ';
Line: 1403

            l_select_generic := l_select_generic || 'TO_DATE(NULL), ';
Line: 1405

            l_select_generic := l_select_generic || 'TO_DATE(NULL), ';
Line: 1407

            l_select_generic := l_select_generic || 'TO_DATE(NULL), ';
Line: 1409

            l_select_generic := l_select_generic || 'TO_NUMBER(NULL), ';
Line: 1413

         l_select_generic := l_select_generic || '''N'', ';       --is_modified
Line: 1415

         l_select_generic := l_select_generic || 'mmtt.secondary_uom_code, ';
Line: 1417

         l_select_generic :=
                         l_select_generic || 'mmtt.secondary_transaction_quantity ';
Line: 1421

         RETURN l_select_generic;
Line: 1425

         l_select_generic := 'SELECT ';
Line: 1427

         l_select_generic := l_select_generic || ' /*+ leading ( wdd ) and index ( wdd WSH_DELIVERY_DETAILS_N1 ) push_pred(wdd) push_pred(wt) push_pred(wts) push_pred(wdl) push_pred(wnd)  */  null, ';  -- expansion_code
Line: 1428

    l_select_generic :=
      l_select_generic
      || 'decode(wdth.is_parent,'
      || '''Y'', decode(wdth.transaction_action_id,28,'''
      || g_plan_task_types (4)
      || ''','
      || 'decode(wdth.transaction_source_type_id,'
      || '5,decode(wdth.transaction_type_id,35,'''
      || g_plan_task_types (4)
      || ''','''
      || g_plan_task_types (3)
      || '''),'
      || '13, decode(wdth.transaction_type_id,51,'''
      || g_plan_task_types (4)
      || ''','''
      || g_plan_task_types (3)
      || '''),'''
      || g_plan_task_types (3)
      || ''')),'
      || 'decode(wdth.parent_transaction_id,null,''' --'N' or null
      || g_plan_task_types(1)
      || ''','
      || 'decode(wdth.transaction_action_id,28,'''
      || g_plan_task_types(5)
      || ''','
      || 'decode(wdth.transaction_source_type_id,'
      || '5,decode(wdth.transaction_type_id,35,'''
      || g_plan_task_types (5)
      || ''','''
      || g_plan_task_types (2)
      || '''),'
      || '13, decode(wdth.transaction_type_id,51,'''
      || g_plan_task_types (5)
      || ''','''
      || g_plan_task_types (2)
      || '''),'''
      || g_plan_task_types (2)
      || ''')))),';   --plan task
Line: 1466

         l_select_generic := l_select_generic || 'mmt.transaction_id, ';
Line: 1468

         l_select_generic := l_select_generic || 'wdth.parent_transaction_id,';
Line: 1470

         l_select_generic := l_select_generic || 'mmt.inventory_item_id, ';
Line: 1472

         l_select_generic :=
                            l_select_generic || 'msiv.concatenated_segments, ';
Line: 1475

         l_select_generic := l_select_generic || 'msiv.description, ';
Line: 1477

         l_select_generic := l_select_generic || 'msiv.unit_weight, ';
Line: 1479

         l_select_generic := l_select_generic || 'msiv.weight_uom_code, ';
Line: 1481

         l_select_generic := l_select_generic || 'msiv.unit_volume, ';
Line: 1483

         l_select_generic := l_select_generic || 'msiv.volume_uom_code, ';
Line: 1485

         l_select_generic := l_select_generic || 'mmt.organization_id, ';
Line: 1487

         l_select_generic := l_select_generic || 'mmt.revision, ';  --revision
Line: 1488

         l_select_generic := l_select_generic || 'mmt.subinventory_code, ';
Line: 1490

         l_select_generic := l_select_generic || 'mmt.locator_id, ';
Line: 1493

         l_select_generic :=
               l_select_generic
            || 'decode(milv.segment19, null, milv.concatenated_segments, null), ';
Line: 1496

         l_select_generic := l_select_generic || '6, ';            --status_id
Line: 1497

         l_select_generic := l_select_generic || '6, ';   --status_id_original
Line: 1498

         l_select_generic :=
                       l_select_generic || '''' || g_status_codes (6)
                       || ''', ';                                     --status
Line: 1501

         l_select_generic := l_select_generic || 'mmt.transaction_type_id, ';
Line: 1503

         l_select_generic := l_select_generic || 'mmt.transaction_action_id, ';
Line: 1505

         l_select_generic :=
                        l_select_generic || 'mmt.transaction_source_type_id, ';
Line: 1511

            l_select_generic :=
                    l_select_generic || 'mtst.transaction_source_type_name, ';
Line: 1516

         l_select_generic := l_select_generic || 'mmt.transaction_source_id, ';
Line: 1518

         l_select_generic := l_select_generic || 'mmt.trx_source_line_id, ';
Line: 1520

         l_select_generic :=
                          l_select_generic || 'mmt.transfer_organization_id, ';
Line: 1526

            l_select_generic := l_select_generic || 'mp1.organization_code, ';
Line: 1530

         l_select_generic := l_select_generic || 'mmt.transfer_subinventory, ';
Line: 1532

         l_select_generic := l_select_generic || 'mmt.transfer_locator_id,  ';
Line: 1538

            l_select_generic :=
                  l_select_generic
               || 'decode(milv1.segment19, null, milv1.concatenated_segments, null), ';
Line: 1543

         l_select_generic := l_select_generic || 'mmt.transaction_uom, ';
Line: 1545

         l_select_generic :=
                         l_select_generic || 'abs(mmt.transaction_quantity), ';
Line: 1548

         l_select_generic := l_select_generic || 'wdth.user_task_type, ';
Line: 1553

            l_select_generic := l_select_generic || 'bso.operation_code, ';
Line: 1557

         l_select_generic := l_select_generic || 'mmt.move_order_line_id, ';
Line: 1559

         l_select_generic := l_select_generic || 'mmt.pick_slip_number, ';
Line: 1561

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1564

         l_select_generic := l_select_generic || 'null, '; --cartonization_lpn
Line: 1566

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1569

            l_select_generic := l_select_generic || 'null, ';
Line: 1572

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1575

            l_select_generic := l_select_generic || 'null, '; /*container item */
Line: 1578

         l_select_generic := l_select_generic || 'mmt.lpn_id, ';
Line: 1583

            l_select_generic :=
                           l_select_generic || 'wlpn5.license_plate_number, ';
Line: 1588

         l_select_generic := l_select_generic || 'mmt.content_lpn_id, ';
Line: 1593

            l_select_generic :=
                           l_select_generic || 'wlpn3.license_plate_number, ';
Line: 1598

         l_select_generic := l_select_generic || 'mmt.transfer_lpn_id, ';
Line: 1603

            l_select_generic :=
                           l_select_generic || 'wlpn4.license_plate_number, ';
Line: 1608

         l_select_generic := l_select_generic || 'to_date(null), ';
Line: 1610

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1612

         l_select_generic := l_select_generic || 'wdth.priority, '; --priority
Line: 1613

         l_select_generic := l_select_generic || 'wdth.priority, ';
Line: 1615

         l_select_generic := l_select_generic || 'wdth.task_type, ';
Line: 1618

         l_select_generic :=
               l_select_generic
            || 'decode(wdth.task_type,'
            || '1, '''
            || g_task_types (1)
            || ''', 2, '''
            || g_task_types (2)
            || ''', 3, '''
            || g_task_types (3)
            || ''', 4, '''
            || g_task_types (4)
            || ''', 5, '''
            || g_task_types (5)
            || ''', 6, '''
            || g_task_types (6)
            || ''', 7, '''
            || g_task_types (7)
            || '''), ';
Line: 1636

         l_select_generic := l_select_generic || 'to_date(null), ';
Line: 1638

         l_select_generic := l_select_generic || 'wdth.operation_plan_id, ';
Line: 1643

            l_select_generic :=
                              l_select_generic || 'wop.operation_plan_name, ';
Line: 1650

            l_select_generic := l_select_generic || 'to_number(null), ';--operation_sequence
Line: 1652

               l_select_generic := l_select_generic || 'to_number(null), ';--operation_sequence
Line: 1657

         l_select_generic := l_select_generic || 'wdth.op_plan_instance_id,  ';
Line: 1661

         l_select_generic := l_select_generic || 'wdth.task_id, ';   --task_id
Line: 1662

         l_select_generic := l_select_generic || 'wdth.person_id, ';
Line: 1664

         l_select_generic := l_select_generic || 'wdth.person_id, ';
Line: 1669

            l_select_generic := l_select_generic || 'pap.full_name, ';
Line: 1673

         l_select_generic := l_select_generic || 'wdth.effective_start_date, ';
Line: 1675

         l_select_generic := l_select_generic || 'wdth.effective_end_date, ';
Line: 1677

         l_select_generic := l_select_generic || 'wdth.person_resource_id, ';
Line: 1682

            l_select_generic := l_select_generic || 'br1.resource_code, ';
Line: 1686

         l_select_generic := l_select_generic || 'wdth.machine_resource_id, ';
Line: 1691

            l_select_generic := l_select_generic || 'br2.resource_code, ';
Line: 1695

         l_select_generic := l_select_generic || 'wdth.equipment_instance, ';
Line: 1697

         l_select_generic := l_select_generic || 'wdth.dispatched_time, ';
Line: 1699

         l_select_generic := l_select_generic || 'wdth.loaded_time, ';
Line: 1701

         l_select_generic := l_select_generic || 'wdth.drop_off_time, ';
Line: 1703

         l_select_generic := l_select_generic || 'to_date(null), ';
Line: 1705

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1707

         l_select_generic := l_select_generic || '''N'', ';       --is_modified
Line: 1712

             l_select_generic := l_select_generic || 'mmt.secondary_uom_code, ';
Line: 1714

             l_select_generic :=
                             l_select_generic || 'abs(mmt.secondary_transaction_quantity), ';
Line: 1718

              l_select_generic := l_select_generic || 'mmt.transaction_set_id ';
Line: 1722

            l_select_generic := l_select_generic || 'mmt.secondary_uom_code, ';
Line: 1724

            l_select_generic :=
                            l_select_generic || 'abs(mmt.secondary_transaction_quantity) ';
Line: 1729

         RETURN l_select_generic;
Line: 1738

         l_select_generic := 'SELECT ';
Line: 1739

         l_select_generic := l_select_generic || 'null, ';  -- expansion_code
Line: 1740

         l_select_generic :=
               l_select_generic
            || 'decode(wdth.is_parent,'
            || '''N'', decode(wdth.operation_plan_id,null, decode(wdth.parent_transaction_id,null,'''
            || g_plan_task_types (1)
            || ''','''
            || g_plan_task_types (5)
            || '''),'''
            || g_plan_task_types (2)
            || '''), '
            || 'decode(wdth.transaction_action_id,28,'''
            || g_plan_task_types (4)
            || ''','
            || 'decode(wdth.transaction_source_type_id,'
            || '5,decode(wdth.transaction_type_id,35,'''
            || g_plan_task_types (4)
            || ''','''
            || g_plan_task_types (3)
            || '''),'
            || '13, decode(wdth.transaction_type_id,51,'''
           || g_plan_task_types (4)
            || ''','''
            || g_plan_task_types (3)
            || '''),'''
            || g_plan_task_types (3)
            || '''))),';                                  --plan_task
Line: 1766

         l_select_generic := l_select_generic || 'wdth.transaction_id, ';
Line: 1768

         l_select_generic := l_select_generic || 'wdth.parent_transaction_id,';
Line: 1770

         l_select_generic := l_select_generic || 'wdth.inventory_item_id, ';
Line: 1772

         l_select_generic :=
                            l_select_generic || 'msiv.concatenated_segments, ';
Line: 1775

         l_select_generic := l_select_generic || 'msiv.description, ';
Line: 1777

         l_select_generic := l_select_generic || 'msiv.unit_weight, ';
Line: 1779

         l_select_generic := l_select_generic || 'msiv.weight_uom_code, ';
Line: 1781

         l_select_generic := l_select_generic || 'msiv.unit_volume, ';
Line: 1783

         l_select_generic := l_select_generic || 'msiv.volume_uom_code, ';
Line: 1785

         l_select_generic := l_select_generic || 'wdth.organization_id, ';
Line: 1787

         l_select_generic := l_select_generic || 'wdth.revision, '; --revision
Line: 1788

         l_select_generic :=
                         l_select_generic || 'wdth.source_subinventory_code, ';
Line: 1791

         l_select_generic := l_select_generic || 'wdth.source_locator_id, ';
Line: 1794

         l_select_generic :=
               l_select_generic
            || 'decode(milv.segment19, null, milv.concatenated_segments, null), ';
Line: 1797

         l_select_generic := l_select_generic || '6, ';            --status_id
Line: 1798

         l_select_generic := l_select_generic || '6, ';   --status_id_original
Line: 1799

         l_select_generic :=
                       l_select_generic || '''' || g_status_codes (6)
                       || ''', ';                                     --status
Line: 1802

         l_select_generic := l_select_generic || 'wdth.transaction_type_id, ';
Line: 1804

         l_select_generic :=
                            l_select_generic || 'wdth.transaction_action_id, ';
Line: 1807

         l_select_generic :=
                       l_select_generic || 'wdth.transaction_source_type_id, ';
Line: 1813

            l_select_generic :=
                    l_select_generic || 'mtst.transaction_source_type_name, ';
Line: 1818

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1820

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1822

         l_select_generic :=
                         l_select_generic || 'wdth.transfer_organization_id, ';
Line: 1828

            l_select_generic := l_select_generic || 'mp1.organization_code, ';
Line: 1832

         l_select_generic := l_select_generic || 'null, ';   --to_subinventory
Line: 1833

         l_select_generic := l_select_generic || 'to_number(null),  ';
Line: 1839

            l_select_generic := l_select_generic || 'null, ';
Line: 1842

         l_select_generic := l_select_generic || 'wdth.transaction_uom_code, ';
Line: 1844

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1846

         l_select_generic := l_select_generic || 'wdth.user_task_type, ';
Line: 1851

            l_select_generic := l_select_generic || 'bso.operation_code, ';
Line: 1855

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1857

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1859

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1862

         l_select_generic := l_select_generic || 'null, '; --cartonization_lpn
Line: 1864

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1867

            l_select_generic := l_select_generic || 'null, ';
Line: 1870

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1873

            l_select_generic := l_select_generic || 'null, ';
Line: 1877

         l_select_generic := l_select_generic || 'wdth.lpn_id, ';
Line: 1882

            l_select_generic :=
                           l_select_generic || 'wlpn5.license_plate_number, ';
Line: 1887

         l_select_generic := l_select_generic || 'wdth.content_lpn_id, ';
Line: 1892

            l_select_generic :=
                           l_select_generic || 'wlpn3.license_plate_number, ';
Line: 1897

         l_select_generic := l_select_generic || 'wdth.transfer_lpn_id, ';
Line: 1902

            l_select_generic :=
                           l_select_generic || 'wlpn4.license_plate_number, ';
Line: 1907

         l_select_generic := l_select_generic || 'to_date(null), ';
Line: 1909

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 1911

         l_select_generic := l_select_generic || 'wdth.priority, '; --priority
Line: 1912

         l_select_generic := l_select_generic || 'wdth.priority, ';
Line: 1914

         l_select_generic := l_select_generic || 'wdth.task_type, ';
Line: 1917

         l_select_generic :=
               l_select_generic
            || 'decode(wdth.task_type,'
            || '1, '''
            || g_task_types (1)
            || ''', 2, '''
            || g_task_types (2)
            || ''', 3, '''
            || g_task_types (3)
            || ''', 4, '''
            || g_task_types (4)
            || ''', 5, '''
            || g_task_types (5)
            || ''', 6, '''
            || g_task_types (6)
            || ''', 7, '''
            || g_task_types (7)
            || ''', 8, '''
            || g_task_types (8)
            || '''), ';
Line: 1937

         l_select_generic := l_select_generic || 'to_date(null), ';
Line: 1939

         l_select_generic := l_select_generic || 'wdth.operation_plan_id, ';
Line: 1944

            l_select_generic :=
                              l_select_generic || 'wop.operation_plan_name, ';
Line: 1950

             l_select_generic := l_select_generic || 'to_number(null),  '; --operation_sequence
Line: 1954

         l_select_generic := l_select_generic || 'wdth.op_plan_instance_id,  ';
Line: 1958

         l_select_generic := l_select_generic || 'wdth.task_id, ';   --task_id
Line: 1959

         l_select_generic := l_select_generic || 'wdth.person_id, ';
Line: 1961

         l_select_generic := l_select_generic || 'wdth.person_id, ';
Line: 1966

            l_select_generic := l_select_generic || 'pap.full_name, ';
Line: 1970

         l_select_generic := l_select_generic || 'wdth.effective_start_date, ';
Line: 1972

         l_select_generic := l_select_generic || 'wdth.effective_end_date, ';
Line: 1974

         l_select_generic := l_select_generic || 'wdth.person_resource_id, ';
Line: 1979

            l_select_generic := l_select_generic || 'br1.resource_code, ';
Line: 1983

         l_select_generic := l_select_generic || 'wdth.machine_resource_id, ';
Line: 1988

            l_select_generic := l_select_generic || 'br2.resource_code, ';
Line: 1992

         l_select_generic := l_select_generic || 'wdth.equipment_instance, ';
Line: 1994

         l_select_generic := l_select_generic || 'wdth.dispatched_time, ';
Line: 1996

         l_select_generic := l_select_generic || 'wdth.loaded_time, ';
Line: 1998

         l_select_generic := l_select_generic || 'wdth.drop_off_time, ';
Line: 2000

         l_select_generic := l_select_generic || 'to_date(null), ';
Line: 2002

         l_select_generic := l_select_generic || 'to_number(null), ';
Line: 2004

         l_select_generic := l_select_generic || '''N'', ';       --is_modified
Line: 2009

            l_select_generic := l_select_generic || 'wdth.secondary_transaction_uom_code, ';
Line: 2011

            l_select_generic := l_select_generic || 'to_number(null), ';
Line: 2013

            l_select_generic := l_select_generic || 'mmt.transaction_set_id ';
Line: 2017

            l_select_generic := l_select_generic || 'wdth.secondary_transaction_uom_code, ';
Line: 2019

            l_select_generic := l_select_generic || 'to_number(null) ';
Line: 2022

       RETURN l_select_generic;
Line: 2026

    debug('Entered into picknone select');
Line: 2028

    l_select_generic            := NULL;
Line: 2029

    l_select_generic            := 'SELECT ';
Line: 2030

    l_select_generic            := l_select_generic || 'null, ';
Line: 2031

    l_select_generic :=
	l_select_generic
	|| 'decode(wdth.is_parent,'
	|| '''Y'', decode(wdth.transaction_action_id,28,'''
	|| g_plan_task_types (4)
	|| ''','
	|| 'decode(wdth.transaction_source_type_id,'
	|| '5,decode(wdth.transaction_type_id,35,'''
	|| g_plan_task_types (4)
	|| ''','''
	|| g_plan_task_types (3)
	|| '''),'
	|| '13, decode(wdth.transaction_type_id,51,'''
	|| g_plan_task_types (4)
	|| ''','''
	|| g_plan_task_types (3)
	|| '''),'''
	|| g_plan_task_types (3)
	|| ''')),'
	|| 'decode(wdth.parent_transaction_id,null,''' --'N' or null
    || g_plan_task_types(1)
	|| ''','
	|| 'decode(wdth.transaction_action_id,28,'''
	|| g_plan_task_types(5)
	|| ''','
	|| 'decode(wdth.transaction_source_type_id,'
	|| '5,decode(wdth.transaction_type_id,35,'''
	|| g_plan_task_types (5)
	|| ''','''
	|| g_plan_task_types (2)
	|| '''),'
	|| '13, decode(wdth.transaction_type_id,51,'''
	|| g_plan_task_types (5)
	|| ''','''
	|| g_plan_task_types (2)
	|| '''),'''
	|| g_plan_task_types (2)
	|| ''')))),';
Line: 2069

    l_select_generic            := l_select_generic || 'wdth.transaction_temp_id, ';    --transaction_temp_id
Line: 2070

    l_select_generic            := l_select_generic || 'wdth.parent_transaction_id,';   --parent_line_id
Line: 2071

    l_select_generic            := l_select_generic || 'wdth.inventory_item_id, ';      --inventory_item_id
Line: 2072

    l_select_generic            := l_select_generic || 'msiv.concatenated_segments, ';  --item
Line: 2073

    l_select_generic            := l_select_generic || 'msiv.description, ';            --item description
Line: 2074

    l_select_generic            := l_select_generic || 'msiv.unit_weight, ';            --unit_weight
Line: 2075

    l_select_generic            := l_select_generic || 'msiv.weight_uom_code, ';        --weight_uom_code
Line: 2076

    l_select_generic            := l_select_generic || 'msiv.unit_volume, ';            --unit_volume
Line: 2077

    l_select_generic            := l_select_generic || 'msiv.volume_uom_code, ';        --volume_uom_code
Line: 2078

    l_select_generic            := l_select_generic || 'wdth.organization_id, ';        --organization_id
Line: 2079

    l_select_generic            := l_select_generic || 'wdth.revision, ';               --revision
Line: 2080

    l_select_generic            := l_select_generic || 'wdth.source_subinventory_code, ';      --subinventory
Line: 2081

    l_select_generic            := l_select_generic || 'wdth.source_locator_id, ';      --locator_id
Line: 2082

    l_select_generic            := l_select_generic || 'decode(milv.segment19, null, milv.concatenated_segments, null), ';  --locator
Line: 2083

    l_select_generic            := l_select_generic || '13, ';                          --status_id
Line: 2084

    l_select_generic            := l_select_generic || '13, ';                          --status_id_original
Line: 2085

    l_select_generic            := l_select_generic || '''' || g_status_codes (13) || ''', ';  --status
Line: 2086

    l_select_generic            := l_select_generic || 'wdth.transaction_type_id, ';    --transaction_type_id
Line: 2087

    l_select_generic            := l_select_generic || 'wdth.transaction_action_id, ';  --transaction_action_id
Line: 2088

    l_select_generic            := l_select_generic || 'wdth.transaction_source_type_id, ';    --transaction_source_type_id
Line: 2090

      l_select_generic          := l_select_generic || 'mtst.transaction_source_type_name, '; --transaction_source_type
Line: 2092

    l_select_generic                 := l_select_generic || 'to_number(null), ';               --transaction_source_id
Line: 2093

    l_select_generic                 := l_select_generic || 'to_number(null), ';               --transaction_source_line_id
Line: 2094

    l_select_generic                 := l_select_generic || 'wdth.transfer_organization_id, '; --to_organization_id
Line: 2096

      l_select_generic               := l_select_generic || 'mp1.organization_code, '; --to_organization_id
Line: 2098

    l_select_generic       := l_select_generic || ' NVL(wdth.SUGGESTED_DEST_SUBINVENTORY,wdth.DEST_SUBINVENTORY_CODE) , '; --to_subinventory
Line: 2099

    l_select_generic       := l_select_generic || ' NVL(wdth.SUGGESTED_DEST_LOCATOR_ID,wdth.DEST_LOCATOR_ID) ,  ';         --'to_number(null),  ';    --to_locator_id
Line: 2101

      l_select_generic     := l_select_generic || 'decode(milv1.segment19, null, milv1.concatenated_segments, null), ';
Line: 2103

    l_select_generic           := l_select_generic || 'wdth.transaction_UOM_CODE, ';       --jan28 'wdd.REQUESTED_QUANTITY_UOM, '   --transaction_uom
Line: 2104

    l_select_generic           := l_select_generic || 'wdth.transaction_QUANTITY, ';       --jan28  'wdd.REQUESTED_QUANTITY, '   --transaction_quantity
Line: 2105

    l_select_generic           := l_select_generic || 'wdth.user_task_type, '; --user_task_type_id
Line: 2107

      l_select_generic         := l_select_generic || 'bso.operation_code, '; --user_task_type
Line: 2109

    l_select_generic              := l_select_generic || 'mtrl.line_id, ';          --move_order_line_id
Line: 2110

    l_select_generic              := l_select_generic || 'mtrl.pick_slip_number, '; --pick_slip_number
Line: 2111

    l_select_generic              := l_select_generic || 'to_number(null), ';       --cartonization_id
Line: 2113

      l_select_generic            := l_select_generic || 'null, '; --cartonization_lpn
Line: 2115

    l_select_generic          := l_select_generic || 'to_number(null), '; --allocated_lpn_id
Line: 2117

      l_select_generic        := l_select_generic || 'null, ';
Line: 2119

    l_select_generic           := l_select_generic || 'to_number(null), '; --container_item_id
Line: 2121

      l_select_generic         := l_select_generic || 'null, ';
Line: 2123

    l_select_generic     := l_select_generic || 'wdth.lpn_id, '; --from_lpn_id
Line: 2125

      l_select_generic   := l_select_generic || 'wlpn5.license_plate_number, '; --from_lpn
Line: 2127

    l_select_generic        := l_select_generic || 'wdth.content_lpn_id, '; --content_lpn_id
Line: 2129

      l_select_generic      := l_select_generic || 'wlpn3.license_plate_number, '; --content_lpn
Line: 2131

    l_select_generic   := l_select_generic || 'wdth.transfer_lpn_id, '; --to_lpn_id
Line: 2133

      l_select_generic := l_select_generic || 'wlpn4.license_plate_number, '; --to_lpn
Line: 2135

    l_select_generic           := l_select_generic || 'wdth.LAST_UPDATE_DATE, '; --mmt_last_update_date
Line: 2136

    l_select_generic           := l_select_generic || 'wdth.LAST_UPDATED_BY, ';  --mmt_last_updated_by
Line: 2137

    l_select_generic           := l_select_generic || 'wdth.priority, ';         --priority
Line: 2138

    l_select_generic           := l_select_generic || 'wdth.priority, ';         --priority_original
Line: 2139

    l_select_generic           := l_select_generic || 'wdth.task_type, ';        --task_type_id
Line: 2140

    l_select_generic :=
	l_select_generic
	|| 'decode(wdth.task_type,'
	|| '1, '''
	|| g_task_types (1)
	|| ''', 2, '''
	|| g_task_types (2)
	|| ''', 3, '''
	|| g_task_types (3)
	|| ''', 4, '''
	|| g_task_types (4)
	|| ''', 5, '''
	|| g_task_types (5)
	|| ''', 6, '''
	|| g_task_types (6)
	|| ''', 7, '''
	|| g_task_types (7)
	|| ''', 8, '''
	|| g_task_types (8)
	|| '''), ';
Line: 2160

    l_select_generic           := l_select_generic || 'wdth.CREATION_DATE, ';     --creation_time
Line: 2161

    l_select_generic           := l_select_generic || 'wdth.operation_plan_id, '; --operation_plan_id
Line: 2163

      l_select_generic         := l_select_generic || 'wop.operation_plan_name, '; --operation_plan
Line: 2166

      l_select_generic             := l_select_generic || 'to_number(null),  '; --operation_sequence
Line: 2169

    l_select_generic := l_select_generic || 'wdth.op_plan_instance_id,  '; --op_plan_instance_id
Line: 2172

    l_select_generic   := l_select_generic || 'wdth.task_id, ';   --task_id
Line: 2173

    l_select_generic   := l_select_generic || 'wdth.person_id, '; --person_id
Line: 2174

    l_select_generic   := l_select_generic || 'wdth.person_id, '; --person_id_original
Line: 2176

      l_select_generic := l_select_generic || 'pap.full_name, '; --person_id
Line: 2178

    l_select_generic            := l_select_generic || 'wdth.effective_start_date, '; --effective_start_date
Line: 2179

    l_select_generic            := l_select_generic || 'wdth.effective_end_date, ';   --effective_end_date
Line: 2180

    l_select_generic            := l_select_generic || 'wdth.person_resource_id, ';   --person_resource_id
Line: 2182

      l_select_generic          := l_select_generic || 'br1.resource_code, '; --person_resource_code
Line: 2184

    l_select_generic             := l_select_generic || 'wdth.machine_resource_id, '; --machine_resource_id
Line: 2186

      l_select_generic           := l_select_generic || 'br2.resource_code, '; --machine_resource_code
Line: 2188

    l_select_generic := l_select_generic || 'wdth.equipment_instance, '; --equipment_instance
Line: 2189

    l_select_generic := l_select_generic || 'wdth.dispatched_time, ';    --dispatched_time
Line: 2190

    l_select_generic := l_select_generic || 'wdth.loaded_time, ';        --loaded_time
Line: 2191

    l_select_generic := l_select_generic || 'wdth.drop_off_time, ';      --drop_off_time
Line: 2192

    l_select_generic := l_select_generic || 'to_date(null), ';           --wdt_last_update_date
Line: 2193

    l_select_generic := l_select_generic || 'to_number(null), ';         --wdt_last_updated_by
Line: 2195

    l_select_generic := l_select_generic || '''N'', '; --is_modified    -- bug #5163661
Line: 2198

      l_select_generic := l_select_generic || 'wdth.secondary_transaction_uom_code, '; --sec_transaction_uom
Line: 2199

      l_select_generic := l_select_generic || 'wdth.SECONDARY_TRANSACTION_QUANTITY ';  --sec_transaction_quantity
Line: 2204

      l_select_generic := l_select_generic || 'wdth.secondary_transaction_uom_code, '; --sec_transaction_uom
Line: 2205

      l_select_generic := l_select_generic || 'wdth.SECONDARY_TRANSACTION_QUANTITY ';  --sec_transaction_quantity
Line: 2207

    debug('select for picknone'||l_select_generic);
Line: 2208

    RETURN l_select_generic;
Line: 2211

   END get_generic_select;
Line: 2275

            || ', (select distinct parent_line_id from wms_waveplan_tasks_temp where task_type_id <> 3) wwtt';
Line: 2441

                   'WHERE NOT exists (SELECT 1 FROM wms_waveplan_tasks_temp ';
Line: 2490

                  || 'AND NOT EXISTS (SELECT 1 FROM wms_dispatched_tasks ';
Line: 3032

                   'WHERE NOT exists (SELECT 1 FROM wms_waveplan_tasks_temp ';
Line: 3439

                   'WHERE NOT exists (SELECT 1 FROM wms_waveplan_tasks_temp ';
Line: 3781

      l_insert_query     VARCHAR2 (2000);
Line: 3782

      l_select_generic   VARCHAR2 (3000);
Line: 3796

      DELETE FROM wms_waveplan_tasks_temp
            WHERE task_type_id <> 3
              AND transaction_temp_id IN (
                     SELECT parent_line_id
                       FROM wms_waveplan_tasks_temp
                      WHERE parent_line_id IS NOT NULL
                        AND task_type_id <> 3
                        --Change
                        --Check for outbound and wip tasks below
                        AND (   transaction_action_id = 28
                             OR (    transaction_source_type_id = 5
                                 AND transaction_type_id = 35
                                )
                             OR (    transaction_source_type_id = 13
                                 AND transaction_type_id = 51
                                )
                            ));
Line: 3821

         SELECT 1
           INTO l_query_count
           FROM DUAL
          WHERE EXISTS (
                   SELECT parent_line_id
                     FROM wms_waveplan_tasks_temp
                    WHERE parent_line_id IS NOT NULL
                      AND task_type_id <> 3
                      --Change
                      --check for outbound and wip tasks below
                      AND (   transaction_action_id = 28
                           OR (    transaction_source_type_id = 5
                               AND transaction_type_id = 35
                              )
                           OR (    transaction_source_type_id = 13
                               AND transaction_type_id = 51
                              )
                          ));
Line: 3856

         l_insert_query :=
            get_generic_insert (p_is_unreleased      => p_is_unreleased,
                                p_is_pending         => p_is_pending,
                                p_is_queued          => p_is_queued,
                                p_is_dispatched      => p_is_dispatched,
                                p_is_active          => p_is_active,
                                p_is_loaded          => p_is_loaded,
                                p_is_completed       => FALSE
                               );
Line: 3865

         l_insert_query := l_insert_query || ') ';
Line: 3866

         l_select_generic :=
            get_generic_select (p_is_unreleased              => p_is_unreleased,
                                p_is_pending                 => p_is_pending,
                                p_is_queued                  => p_is_queued,
                                p_is_dispatched              => p_is_dispatched,
                                p_is_active                  => p_is_active,
                                p_is_loaded                  => p_is_loaded,
                                p_is_completed               => FALSE,
                                p_populate_merged_tasks      => TRUE
                               );
Line: 3927

               l_insert_query
            || l_select_generic
            || l_from_generic
            || l_where_generic;
Line: 4003

         DELETE FROM wms_waveplan_tasks_temp
               WHERE parent_line_id IS NOT NULL
                 AND status_id <> 6
                 --Change
                 --check for outbound and wip tasks below
                 AND (   transaction_action_id = 28
                      OR (    transaction_source_type_id = 5
                          AND transaction_type_id = 35
                         )
                      OR (    transaction_source_type_id = 13
                          AND transaction_type_id = 51
                         )
                     )
                 AND parent_line_id <> transaction_temp_id;
Line: 4029

         SELECT 1
           INTO l_query_count
           FROM DUAL
          WHERE EXISTS (
                   SELECT parent_line_id
                     FROM wms_waveplan_tasks_temp
                    WHERE parent_line_id IS NOT NULL
                      AND task_type_id <> 3
                      --Change
                      --check for outbound and wip tasks below
                      AND (   transaction_action_id = 28
                           OR (    transaction_source_type_id = 5
                               AND transaction_type_id = 35
                              )
                           OR (    transaction_source_type_id = 13
                               AND transaction_type_id = 51
                              )
                          )
                      --End of change
                      AND status_id = 6);
Line: 4062

         l_insert_query :=
            get_generic_insert (p_is_unreleased      => FALSE
                                                            --p_is_unreleased,
                                                             ,
                                p_is_pending         => FALSE  --p_is_pending,
                                                             ,
                                p_is_queued          => FALSE   --p_is_queued,
                                                             ,
                                p_is_dispatched      => FALSE
                                                            --p_is_dispatched,
                                                             ,
                                p_is_active          => FALSE   --p_is_active,
                                                             ,
                                p_is_loaded          => FALSE   --p_is_loaded,
                                                             ,
                                p_is_completed       => TRUE
                               );
Line: 4079

         l_insert_query := l_insert_query || ') ';
Line: 4080

         l_select_generic :=
            get_generic_select (p_is_unreleased              => FALSE
                                                            --p_is_unreleased,
                                                                     ,
                                p_is_pending                 => FALSE
                                                               --p_is_pending,
                                                                     ,
                                p_is_queued                  => FALSE
                                                                --p_is_queued,
                                                                     ,
                                p_is_dispatched              => FALSE
                                                            --p_is_dispatched,
                                                                     ,
                                p_is_active                  => FALSE
                                                                --p_is_active,
                                                                     ,
                                p_is_loaded                  => FALSE
                                                                --p_is_loaded,
                                                                     ,
                                p_is_completed               => TRUE,
                                p_populate_merged_tasks      => TRUE
                               );
Line: 4156

               l_insert_query
            || l_select_generic
            || l_from_generic
            || l_where_generic;
Line: 4240

      l_insert_query      VARCHAR2 (3000);
Line: 4241

      l_select_generic    VARCHAR2 (4000);
Line: 4242

      l_select_outbound   VARCHAR2 (4000);
Line: 4284

         select lpad(segment1,40), segment2,segment1
           INTO l_from_tonum_mso_seg1,l_from_mso_seg2,l_from_mso_seg1
           from mtl_sales_orders
          WHERE sales_order_id = p_from_sales_order_id;
Line: 4292

            select lpad(segment1,40), segment2
              INTO l_to_tonum_mso_seg1,l_to_mso_seg2
              from mtl_sales_orders
             WHERE sales_order_id = p_to_sales_order_id;
Line: 4372

    l_insert_query    := NULL;
Line: 4373

    l_select_generic  := NULL;
Line: 4374

    l_select_outbound := NULL;
Line: 4424

			l_select_generic := ' SELECT mmtt.wms_task_type, count(*) ';
Line: 4426

			l_select_generic := ' SELECT wdth.task_type, count(*) ';
Line: 4429

         l_insert_query :=
            get_generic_insert (p_is_unreleased      => l_is_unreleased,
                                p_is_pending         => l_is_pending,
                                p_is_queued          => l_is_queued,
                                p_is_dispatched      => l_is_dispatched,
                                p_is_active          => l_is_active,
                                p_is_loaded          => l_is_loaded,
                                p_is_completed       => l_is_completed
							   , p_is_picknone       => l_is_picknone  --ER13869750
                               );
Line: 4439

         l_insert_query := l_insert_query || ', customer_id ';
Line: 4443

            l_insert_query := l_insert_query || ', customer ';
Line: 4446

         l_insert_query := l_insert_query || ', ship_to_location_id ';
Line: 4452

            l_insert_query := l_insert_query || ', ship_to_country ';
Line: 4453

            l_insert_query := l_insert_query || ', ship_to_state ';
Line: 4454

            l_insert_query := l_insert_query || ', ship_to_postal_code ';
Line: 4459

            l_insert_query := l_insert_query || ', delivery ';
Line: 4464

            l_insert_query := l_insert_query || ', ship_method ';
Line: 4467

         l_insert_query := l_insert_query || ', carrier_id ';
Line: 4471

            l_insert_query := l_insert_query || ', carrier ';
Line: 4476

         	l_insert_query := l_insert_query || ', wave_header_id ';
Line: 4479

	 l_insert_query := l_insert_query || ', shipment_date ';
Line: 4480

         l_insert_query := l_insert_query || ', shipment_priority ';
Line: 4481

         l_insert_query := l_insert_query || ', source_header ';
Line: 4482

         l_insert_query := l_insert_query || ', line_number ';
Line: 4485

 	       l_insert_query := l_insert_query || ',trip_id';
Line: 4486

 	       l_insert_query := l_insert_query || ',trip_name';
Line: 4491

	 	l_insert_query := l_insert_query || ', load_seq_number ';
Line: 4493

         l_insert_query := l_insert_query || ') ';
Line: 4494

         l_select_generic :=
            get_generic_select (p_is_unreleased      => l_is_unreleased,
                                p_is_pending         => l_is_pending,
                                p_is_queued          => l_is_queued,
                                p_is_dispatched      => l_is_dispatched,
                                p_is_active          => l_is_active,
                                p_is_loaded          => l_is_loaded,
                                p_is_completed       => l_is_completed
							   ,p_is_picknone        => l_is_picknone  --ER13869750
                               );
Line: 4504

         l_select_outbound := ', wdd.customer_id ';              --customer_id
Line: 4508

            l_select_outbound := l_select_outbound || ', substr( hp.party_name,  1,  50 ) ';
Line: 4512

         l_select_outbound :=
                             l_select_outbound || ', wdd.ship_to_location_id ';
Line: 4520

            l_select_outbound := l_select_outbound || ', hl.country ';
Line: 4522

            l_select_outbound := l_select_outbound || ', hl.state ';
Line: 4524

            l_select_outbound := l_select_outbound || ', hl.postal_code ';
Line: 4530

            l_select_outbound := l_select_outbound || ', wnd.name ';
Line: 4537

            l_select_outbound :=l_select_outbound || ', INV_SHIPPING_TRANSACTION_PUB.GET_SHIPMETHOD_MEANING(Decode(wt.ship_method_code, NULL,
			                       decode(wda.delivery_id,NULL,wdd.ship_method_code,decode(wnd.ship_method_code,NULL,wdd.ship_method_code,wnd.ship_method_code)), wt.ship_method_code))';  -- 4629955
Line: 4542

            l_select_outbound :=l_select_outbound || ', INV_SHIPPING_TRANSACTION_PUB.GET_SHIPMETHOD_MEANING(wdd.ship_method_code)';
Line: 4556

             l_select_outbound := l_select_outbound || ', Decode(wt.carrier_id, NULL, Decode(wda.delivery_id, NULL, wdd.carrier_id,
			                                              Decode(wnd.carrier_id,NULL, wdd.carrier_id, wnd.carrier_id)), wt.carrier_id)'; --bug 15874781
Line: 4559

             l_select_outbound := l_select_outbound || ', wdd.carrier_id ';
Line: 4567

             l_select_outbound := l_select_outbound || ',INV_SHIPPING_TRANSACTION_PUB.GET_FREIGHT_CODE(Decode(wt.carrier_id, NULL, Decode(wda.delivery_id, NULL, wdd.carrier_id,
			                                              Decode(wnd.carrier_id,NULL, wdd.carrier_id, wnd.carrier_id)), wt.carrier_id))';  --bug 15874781
Line: 4571

             l_select_outbound := l_select_outbound || ', INV_SHIPPING_TRANSACTION_PUB.GET_FREIGHT_CODE(wdd.carrier_id)';
Line: 4581

          l_select_outbound := l_select_outbound || ', to_number(null) ';
Line: 4585

          l_select_outbound := l_select_outbound || ', to_number(null) ';
Line: 4588

          l_select_outbound := l_select_outbound || ', to_number(null) ';
Line: 4591

          l_select_outbound := l_select_outbound || ', to_number(null) ';
Line: 4599

          l_select_outbound := l_select_outbound || ', wwl.wave_header_id ';
Line: 4601

          l_select_outbound := l_select_outbound || ', to_number(null) ';
Line: 4605

	 l_select_outbound := l_select_outbound || ', wdd.date_scheduled ';
Line: 4607

         l_select_outbound :=
                          l_select_outbound || ', wdd.shipment_priority_code ';
Line: 4610

         l_select_outbound :=
                            l_select_outbound || ', wdd.source_header_number ';
Line: 4613

         l_select_outbound := l_select_outbound || ', wdd.source_line_number ';
Line: 4618

          l_select_outbound := l_select_outbound || ', wt.trip_id ';
Line: 4620

          l_select_outbound := l_select_outbound || ', wt.name ';
Line: 4623

          l_select_outbound := l_select_outbound || ',to_number(null) ';
Line: 4625

          l_select_outbound := l_select_outbound || ', to_number(null) ';
Line: 4633

		l_select_outbound := l_select_outbound || ', wdd.load_seq_number ';
Line: 4805

               || ', (SELECT COUNT(line_id) line_sum, header_id FROM oe_order_lines_all ';
Line: 4872

            l_where_outbound := l_where_outbound || 'AND wdd.delivery_detail_id = (select delivery_detail_id from wsh_delivery_details_ob_grp_v ';
Line: 4968

/*            l_where_outbound := l_where_outbound || 'AND EXISTS ( SELECT 1 ';
Line: 4978

      l_where_outbound := l_where_outbound || ' AND wdd.delivery_detail_id IN (SELECT Min(wddi.delivery_detail_id) ';
Line: 5002

			l_where_outbound := l_where_outbound || ' AND EXISTS (SELECT 1 FROM  oe_order_lines_all oel ';
Line: 5007

			l_where_outbound := l_where_outbound || ' ( SELECT line_id from oe_order_lines_all oel1 WHERE oel.header_id = oel1.header_id ';
Line: 5311

                  || 'AND EXISTS (SELECT 1 FROM '||
                                  'WMS_DOCK_APPOINTMENTS_B WDAB, '||
                                  'WSH_DELIVERY_LEGS WDL '||
                                  'WHERE '||
                                  'WDAB.TRIP_STOP = WDL.PICK_UP_STOP_ID AND '||
                                  'WDL.DELIVERY_ID = WDA.DELIVERY_ID AND '||
                                  'WDAB.APPOINTMENT_TYPE = 2 AND '|| -- OUTBOUND appt
                                  '(WDAB.START_TIME - sysdate)'||n||' BETWEEN 0 AND :p_time_till_appt) ';
Line: 5334

               l_insert_query
            || l_select_generic
            || l_select_outbound
            || l_from_generic
            || l_from_outbound
            || l_where_generic
            || l_where_outbound;
Line: 5845

      l_insert_query     VARCHAR2 (4000);
Line: 5846

      l_select_generic   VARCHAR2 (4000);
Line: 5887

         l_insert_query := NULL;
Line: 5888

         l_select_generic := NULL;
Line: 5908

			l_select_generic := ' SELECT mmtt.wms_task_type, count(*) ';
Line: 5910

			l_select_generic := ' SELECT wdth.task_type, count(*) ';
Line: 5913

         l_insert_query :=
            get_generic_insert (p_is_pending        => l_is_pending,
                                p_is_loaded         => l_is_loaded,
                                p_is_completed      => l_is_completed
                               );
Line: 5919

         l_insert_query := l_insert_query || ', reference_id ';
Line: 5920

         l_insert_query := l_insert_query || ', reference ';
Line: 5929

            l_insert_query := l_insert_query || ', source_header ';
Line: 5930

            l_insert_query := l_insert_query || ', line_number ';
Line: 5933

         l_insert_query := l_insert_query || ') ';
Line: 5934

         l_select_generic :=
            get_generic_select (p_is_pending        => l_is_pending,
                                p_is_loaded         => l_is_loaded,
                                p_is_completed      => l_is_completed
                               );
Line: 5942

            l_select_generic := l_select_generic || ', mtrl.reference_id ';
Line: 5944

            l_select_generic := l_select_generic || ', mtrl.reference ';
Line: 5948

            l_select_generic :=
                     l_select_generic || ', decode(rt.source_document_code, ';
Line: 5950

            l_select_generic :=
                   l_select_generic || '''INVENTORY'', rt.shipment_line_id, ';
Line: 5952

            l_select_generic :=
                       l_select_generic || '''PO'', rt.po_line_location_id, ';
Line: 5954

            l_select_generic :=
                         l_select_generic || '''REQ'', rt.shipment_line_id, ';
Line: 5956

            l_select_generic :=
                         l_select_generic || '''RMA'', rt.oe_order_line_id) ';
Line: 5959

            l_select_generic :=
                     l_select_generic || ', decode(rt.source_document_code, ';
Line: 5961

            l_select_generic :=
                  l_select_generic || '''INVENTORY'', ''SHIPMENT_LINE_ID'', ';
Line: 5963

            l_select_generic :=
                      l_select_generic || '''PO'', ''PO_LINE_LOCATION_ID'', ';
Line: 5965

            l_select_generic :=
                        l_select_generic || '''REQ'', ''SHIPMENT_LINE_ID'', ';
Line: 5967

            l_select_generic :=
                           l_select_generic || '''RMA'', ''ORDER_LINE_ID'') ';
Line: 5973

            l_select_generic := l_select_generic || ', ph.segment1 ';
Line: 5975

            l_select_generic := l_select_generic || ', pl.line_num ';
Line: 5980

            l_select_generic := l_select_generic || ', ooh.order_number ';
Line: 5982

            l_select_generic := l_select_generic || ', ool.line_number ';
Line: 5987

            l_select_generic := l_select_generic || ', prh.segment1 ';
Line: 5989

            l_select_generic := l_select_generic || ', prl.line_num ';
Line: 6305

               l_insert_query
            || l_select_generic
            || l_from_generic
            || l_from_inbound
            || l_where_generic
            || l_where_inbound;
Line: 6635

      l_insert_query           VARCHAR2 (3000);
Line: 6636

      l_select_manufacturing   VARCHAR2 (3000);
Line: 6639

      l_select_generic         VARCHAR2 (3000);
Line: 6693

    l_insert_query         := NULL;
Line: 6694

    l_select_generic       := NULL;
Line: 6695

    l_select_manufacturing := NULL;
Line: 6740

			l_select_generic := ' SELECT mmtt.wms_task_type, count(*) ';
Line: 6742

			l_select_generic := ' SELECT wdth.task_type, count(*) ';
Line: 6745

         l_insert_query :=
            get_generic_insert (p_is_unreleased      => l_is_unreleased,
                                p_is_pending         => l_is_pending,
                                p_is_queued          => l_is_queued,
                                p_is_dispatched      => l_is_dispatched,
                                p_is_active          => l_is_active,
                                p_is_loaded          => l_is_loaded,
                                p_is_completed       => l_is_completed
							    ,p_is_picknone         => l_is_picknone --ER13869750
                               );
Line: 6759

            l_insert_query := l_insert_query || ', assembly_id ';
Line: 6763

               l_insert_query := l_insert_query || ', assembly ';
Line: 6771

            l_insert_query := l_insert_query || ', line_id ';
Line: 6772

            l_insert_query := l_insert_query || ', line ';
Line: 6777

            l_insert_query := l_insert_query || ', department_id ';
Line: 6781

               l_insert_query := l_insert_query || ', department ';
Line: 6789

            l_insert_query := l_insert_query || ', source_header ';
Line: 6792

         l_insert_query := l_insert_query || ', wip_entity_type ';
Line: 6793

         l_insert_query := l_insert_query || ', wip_entity_id ';
Line: 6794

	 /* Navin INV_Convergence_Gme_Wms_TD REPLACED: l_insert_query := l_insert_query || ') '; */
Line: 6796

             l_insert_query := l_insert_query || ', primary_product ';
Line: 6797

             l_insert_query := l_insert_query || ') ';
Line: 6799

             l_insert_query := l_insert_query || ') ';
Line: 6802

         l_select_generic :=
            get_generic_select (p_is_unreleased      => l_is_unreleased,
                                p_is_pending         => l_is_pending,
                                p_is_queued          => l_is_queued,
                                p_is_dispatched      => l_is_dispatched,
                                p_is_active          => l_is_active,
                                p_is_loaded          => l_is_loaded,
                                p_is_completed       => l_is_completed
								,p_is_picknone       => l_is_picknone  --ER13869750
                               );
Line: 6901

               l_select_manufacturing := ', wdj.primary_item_id ';
Line: 6906

                  l_select_manufacturing :=
                        l_select_manufacturing
                     || ', msiv2.concatenated_segments ';          -- assembly
Line: 6916

               l_select_manufacturing :=
                                    l_select_manufacturing || ', wl.line_id ';
Line: 6919

               l_select_manufacturing :=
                                  l_select_manufacturing || ', wl.line_code ';
Line: 6926

               l_select_manufacturing :=
                             l_select_manufacturing || ', wro.department_id ';
Line: 6932

                  l_select_manufacturing :=
                            l_select_manufacturing || ', bd.department_code ';
Line: 6942

               l_select_manufacturing :=
                            l_select_manufacturing || ', we.wip_entity_name ';
Line: 6947

            l_select_manufacturing :=
                                   l_select_manufacturing || ', to_number(1) ';
Line: 6950

            l_select_manufacturing :=
                              l_select_manufacturing || ', wdj.wip_entity_id ';
Line: 7098

               l_select_manufacturing := ', wfs.primary_item_id ';
Line: 7103

                  l_select_manufacturing :=
                        l_select_manufacturing
                     || ', msiv2.concatenated_segments ';          -- assembly
Line: 7113

               l_select_manufacturing :=
                                    l_select_manufacturing || ', wl.line_id ';
Line: 7116

               l_select_manufacturing :=
                                  l_select_manufacturing || ', wl.line_code ';
Line: 7123

               l_select_manufacturing :=
                             l_select_manufacturing || ', bos.department_id ';
Line: 7129

                  l_select_manufacturing :=
                            l_select_manufacturing || ', bd.department_code ';
Line: 7139

               l_select_manufacturing :=
                           l_select_manufacturing || ', wfs.schedule_number ';
Line: 7144

            l_select_manufacturing :=
                                    l_select_manufacturing || ',to_number(2) ';
Line: 7147

            l_select_manufacturing :=
                              l_select_manufacturing || ', wfs.wip_entity_id ';
Line: 7291

               l_select_manufacturing := ', wri.primary_item_id ';
Line: 7296

                  l_select_manufacturing :=
                        l_select_manufacturing
                     || ', msiv2.concatenated_segments ';          -- assembly
Line: 7306

               l_select_manufacturing :=
                                    l_select_manufacturing || ', wl.line_id ';
Line: 7309

               l_select_manufacturing :=
                                  l_select_manufacturing || ', wl.line_code ';
Line: 7316

               l_select_manufacturing :=
                             l_select_manufacturing || ', wro.department_id ';
Line: 7322

                  l_select_manufacturing :=
                            l_select_manufacturing || ', bd.department_code ';
Line: 7330

               l_select_manufacturing :=
                            l_select_manufacturing || ', we.wip_entity_name ';
Line: 7335

            l_select_manufacturing :=
                                   l_select_manufacturing || ', to_number(3) ';
Line: 7338

            l_select_manufacturing :=
                              l_select_manufacturing || ', wrs.wip_entity_id ';
Line: 7490

               l_select_manufacturing := ', TO_NUMBER (NULL) '; -- Inventory item Identifier
Line: 7495

                  l_select_manufacturing :=
                        l_select_manufacturing
                     || ', NULL ';          -- assembly
Line: 7505

               l_select_manufacturing :=
                                    l_select_manufacturing || ', TO_NUMBER (NULL) ';
Line: 7508

               l_select_manufacturing :=
                                  l_select_manufacturing || ', NULL ';
Line: 7515

               l_select_manufacturing :=
                             l_select_manufacturing || ', TO_NUMBER (NULL) ';
Line: 7521

                  l_select_manufacturing :=
                            l_select_manufacturing || ', NULL ';
Line: 7531

               l_select_manufacturing :=
                            l_select_manufacturing || ', h.batch_no ';
Line: 7536

            l_select_manufacturing :=
                                   l_select_manufacturing || ', to_number(10) ';
Line: 7539

            l_select_manufacturing :=
                              l_select_manufacturing || ', h.batch_id ';
Line: 7545

                 l_select_manufacturing :=
                              l_select_manufacturing || ', msiv2.concatenated_segments ';
Line: 7640

        l_select_manufacturing  := NULL; -- for summary mode we wont need the manufacturing related data
Line: 7651

               l_insert_query
            || l_select_generic
            || l_select_manufacturing
            || l_from_generic
            || l_from_manufacturing
            || l_where_generic
            || l_where_manufacturing;
Line: 7979

      l_select_cc      VARCHAR2 (4000);
Line: 7980

      l_insert_cc      VARCHAR2 (4000);
Line: 8025

         l_insert_cc := NULL;
Line: 8026

         l_select_cc := NULL;
Line: 8053

         l_insert_cc := 'INSERT INTO wms_waveplan_tasks_temp( ';
Line: 8054

         l_insert_cc := l_insert_cc || 'transaction_temp_id ';
Line: 8055

         l_insert_cc := l_insert_cc || ', inventory_item_id ';
Line: 8056

         l_insert_cc := l_insert_cc || ', item ';
Line: 8057

	 l_insert_cc := l_insert_cc || ', item_description ';--Added for Bug 8540985
Line: 8058

         l_insert_cc := l_insert_cc || ', organization_id ';
Line: 8059

         l_insert_cc := l_insert_cc || ', revision ';
Line: 8060

         l_insert_cc := l_insert_cc || ', subinventory ';
Line: 8061

         l_insert_cc := l_insert_cc || ', locator_id ';
Line: 8062

         l_insert_cc := l_insert_cc || ', locator ';
Line: 8063

         l_insert_cc := l_insert_cc || ', status_id ';
Line: 8064

         l_insert_cc := l_insert_cc || ', status_id_original ';
Line: 8065

         l_insert_cc := l_insert_cc || ', status ';
Line: 8066

         l_insert_cc := l_insert_cc || ', transaction_action_id ';
Line: 8067

         l_insert_cc := l_insert_cc || ', transaction_source_type_id ';
Line: 8071

            l_insert_cc := l_insert_cc || ', transaction_source_type ';
Line: 8074

         l_insert_cc := l_insert_cc || ', user_task_type_id ';
Line: 8078

            l_insert_cc := l_insert_cc || ', user_task_type ';
Line: 8081

         l_insert_cc := l_insert_cc || ', mmtt_last_update_date ';
Line: 8082

         l_insert_cc := l_insert_cc || ', mmtt_last_updated_by ';
Line: 8083

         l_insert_cc := l_insert_cc || ', priority ';
Line: 8084

         l_insert_cc := l_insert_cc || ', priority_original ';
Line: 8085

         l_insert_cc := l_insert_cc || ', task_type_id ';
Line: 8086

         l_insert_cc := l_insert_cc || ', task_type ';
Line: 8087

         l_insert_cc := l_insert_cc || ', creation_time ';
Line: 8091

            l_insert_cc := l_insert_cc || ', task_id ';
Line: 8092

            l_insert_cc := l_insert_cc || ', person_id ';
Line: 8093

            l_insert_cc := l_insert_cc || ', person_id_original ';
Line: 8097

               l_insert_cc := l_insert_cc || ', person ';
Line: 8100

            l_insert_cc := l_insert_cc || ', effective_start_date ';
Line: 8101

            l_insert_cc := l_insert_cc || ', effective_end_date ';
Line: 8102

            l_insert_cc := l_insert_cc || ', person_resource_id ';
Line: 8106

               l_insert_cc := l_insert_cc || ', person_resource_code ';
Line: 8109

            l_insert_cc := l_insert_cc || ', machine_resource_id ';
Line: 8113

               l_insert_cc := l_insert_cc || ', machine_resource_code ';
Line: 8116

            l_insert_cc := l_insert_cc || ', equipment_instance ';
Line: 8117

            l_insert_cc := l_insert_cc || ', dispatched_time ';
Line: 8118

            l_insert_cc := l_insert_cc || ', loaded_time ';
Line: 8119

            l_insert_cc := l_insert_cc || ', drop_off_time ';
Line: 8120

            l_insert_cc := l_insert_cc || ', wdt_last_update_date ';
Line: 8121

            l_insert_cc := l_insert_cc || ', wdt_last_updated_by ';
Line: 8124

         l_insert_cc := l_insert_cc || ', is_modified ';
Line: 8128

            l_insert_cc := l_insert_cc || ', source_header ';
Line: 8131

         l_insert_cc := l_insert_cc || ') ';
Line: 8133

         l_select_cc := 'SELECT ';
Line: 8136

         l_select_cc := l_select_cc || 'mcce.cycle_count_entry_id, ';
Line: 8138

         l_select_cc := l_select_cc || 'mcce.inventory_item_id, ';
Line: 8140

         l_select_cc := l_select_cc || 'msiv.concatenated_segments, ';  --item
Line: 8142

	 l_select_cc := l_select_cc || 'msiv.description, '; -- Added for Bug 8540985
Line: 8144

         l_select_cc := l_select_cc || 'mcce.organization_id, ';
Line: 8146

         l_select_cc := l_select_cc || 'mcce.revision, ';           --revision
Line: 8148

         l_select_cc := l_select_cc || 'mcce.subinventory, ';   --subinventory
Line: 8150

         l_select_cc := l_select_cc || 'mcce.locator_id, ';       --locator_id
Line: 8153

         l_select_cc :=
               l_select_cc
            || 'decode(milv.segment19, null, milv.concatenated_segments, null), ';
Line: 8162

           l_select_cc := l_select_cc || 'decode(wdt.status, null, 1, wdt.status), ';
Line: 8165

           l_select_cc := l_select_cc || 'decode(wdt.status, null, 1, wdt.status), ';
Line: 8168

               l_select_cc :=
                     l_select_cc
                  || 'decode(decode(wdt.status, null, 1, wdt.status),'
                  || '1, '''
                  || g_status_codes (1)
                  || ''', 2, '''
                  || g_status_codes (2)
                  || ''', 3, '''
                  || g_status_codes (3)
                  || ''', 4, '''
                  || g_status_codes (4)
                  || ''', 5, '''
                  || g_status_codes (5)
                  || ''', 6, '''
                  || g_status_codes (6)
                  || ''', 7, '''
                  || g_status_codes (7)
                  || ''', 8, '''
                  || g_status_codes (8)
                  || ''', '
                  || '9, '''
                  || g_status_codes (9)
        || '''), ';
Line: 8193

               l_select_cc := l_select_cc || '1, ';
Line: 8195

               l_select_cc := l_select_cc || '1, ';
Line: 8197

               l_select_cc :=
                           l_select_cc || '''' || g_status_codes (1)
                           || ''', ';
Line: 8203

            l_select_cc := l_select_cc || '6, ';                  --status_id
Line: 8204

            l_select_cc := l_select_cc || '6, ';         --status_id_original
Line: 8205

            l_select_cc := l_select_cc || '''' || g_status_codes (6)
                           || ''', ';                                --status
Line: 8209

         l_select_cc := l_select_cc || '4, ';          --transaction_action_id
Line: 8210

         l_select_cc := l_select_cc || '9, ';     --transaction_source_type_id
Line: 8214

            l_select_cc :=
         l_select_cc || 'mtst.transaction_source_type_name, ';
Line: 8219

         l_select_cc := l_select_cc || 'mcce.standard_operation_id, ';
Line: 8224

            l_select_cc := l_select_cc || 'bso.operation_code, ';
Line: 8228

         l_select_cc := l_select_cc || 'mcce.last_update_date, ';
Line: 8230

         l_select_cc := l_select_cc || 'mcce.last_updated_by, ';
Line: 8232

         l_select_cc := l_select_cc || 'mcce.task_priority, ';      --priority
Line: 8234

         l_select_cc := l_select_cc || 'mcce.task_priority, ';
Line: 8236

         l_select_cc := l_select_cc || '3, ';                   --task_type_id
Line: 8239

         l_select_cc := l_select_cc || '''' || g_task_types (3) || ''', ';
Line: 8241

         l_select_cc := l_select_cc || 'mcce.creation_date, '; --creation_time
Line: 8246

            l_select_cc := l_select_cc || 'wdt.task_id, ';          --task_id
Line: 8248

            l_select_cc := l_select_cc || 'wdt.person_id, ';      --person_id
Line: 8250

            l_select_cc := l_select_cc || 'wdt.person_id, ';
Line: 8255

               l_select_cc := l_select_cc || 'pap.full_name, ';   --person_id
Line: 8259

        l_select_cc := l_select_cc || 'wdt.effective_start_date, ';
Line: 8262

        l_select_cc := l_select_cc || 'wdt.effective_end_date, ';
Line: 8265

        l_select_cc := l_select_cc || 'wdt.person_resource_id, ';
Line: 8270

               l_select_cc := l_select_cc || 'br1.resource_code, ';
Line: 8274

            l_select_cc := l_select_cc || 'wdt.machine_resource_id, ';
Line: 8279

               l_select_cc := l_select_cc || 'br2.resource_code, ';
Line: 8283

            l_select_cc := l_select_cc || 'wdt.equipment_instance, ';
Line: 8285

            l_select_cc := l_select_cc || 'wdt.dispatched_time, ';
Line: 8287

            l_select_cc := l_select_cc || 'wdt.loaded_time, ';   --loaded_time
Line: 8289

	    l_select_cc := l_select_cc || 'wdt.drop_off_time, ';
Line: 8291

            l_select_cc := l_select_cc || 'wdt.last_update_date, ';
Line: 8293

            l_select_cc := l_select_cc || 'wdt.last_updated_by, ';
Line: 8297

         l_select_cc := l_select_cc || '''N'' ';                -- is_modified
Line: 8301

            l_select_cc := l_select_cc || ', mcch.cycle_count_header_name ';
Line: 8374

                   'WHERE NOT exists (SELECT 1 FROM wms_waveplan_tasks_temp ';
Line: 8382

             so that when selecting min(mcce.cycle_count_entry_id)all the columns need not be
             in gruop by clause of outer query which is causing many issues.*/
            l_where_cc := l_where_cc || ' and mcce.cycle_count_entry_id IN
            (SELECT MIN(mcce.cycle_count_entry_id) from mtl_cycle_count_entries mcce  , mtl_cycle_count_headers mcch
              WHERE mcce.organization_id                    = :org_id
              and  mcce.cycle_count_header_id              = mcch.cycle_count_header_id ' ;
Line: 8423

                     || 'AND NOT EXISTS (SELECT 1 FROM wms_dispatched_tasks ';
Line: 8797

		l_query := l_insert_cc || l_select_cc || l_from_cc || l_where_cc ;
Line: 8799

		l_query := l_select_cc || l_from_cc || l_where_cc ;
Line: 9047

      l_insert_query     VARCHAR2 (4000);
Line: 9048

      l_select_generic   VARCHAR2 (4000);
Line: 9049

      l_select_repl      VARCHAR2 (4000);
Line: 9106

    l_insert_query   := NULL;
Line: 9107

    l_select_generic := NULL;
Line: 9108

    l_select_repl    := NULL;
Line: 9156

			l_select_generic := ' SELECT mmtt.wms_task_type, count(*) ';
Line: 9158

			l_select_generic := ' SELECT wdth.task_type, count(*) ';
Line: 9161

         l_insert_query :=
            get_generic_insert (p_is_unreleased      => l_is_unreleased,
                                p_is_pending         => l_is_pending,
                                p_is_queued          => l_is_queued,
                                p_is_dispatched      => l_is_dispatched,
                                p_is_active          => l_is_active,
                                p_is_loaded          => l_is_loaded,
                                p_is_completed       => l_is_completed
                               , p_is_picknone        => l_is_picknone   --ER13869750
                               );
Line: 9172

         l_insert_query := l_insert_query || ', source_header ';
Line: 9174

         l_insert_query := l_insert_query || ', line_number ';   --line_number
Line: 9175

         l_insert_query := l_insert_query || ') ';
Line: 9176

         l_select_generic :=
            get_generic_select (p_is_unreleased      => l_is_unreleased,
                                p_is_pending         => l_is_pending,
                                p_is_queued          => l_is_queued,
                                p_is_dispatched      => l_is_dispatched,
                                p_is_active          => l_is_active,
                                p_is_loaded          => l_is_loaded,
                                p_is_completed       => l_is_completed
							   ,p_is_picknone        => l_is_picknone   --ER13869750
                               );
Line: 9187

         l_select_repl := ', mtrh.request_number ';            --source_header
Line: 9188

         l_select_repl := l_select_repl || ', mtrl.line_number ';
Line: 9399

               l_insert_query
            || l_select_generic
            || l_select_repl
            || l_from_generic
            || l_from_repl
            || l_where_generic
            || l_where_repl;
Line: 9708

      l_insert_query     VARCHAR2 (4000);
Line: 9709

      l_select_generic   VARCHAR2 (4000);
Line: 9710

      l_select_repl      VARCHAR2 (4000);
Line: 9760

    l_insert_query   := NULL;
Line: 9761

    l_select_generic := NULL;
Line: 9804

         l_insert_query :=
            get_generic_insert (p_is_unreleased      => l_is_unreleased,
                                p_is_pending         => l_is_pending,
                                p_is_queued          => l_is_queued,
                                p_is_dispatched      => l_is_dispatched,
                                p_is_active          => l_is_active,
                                p_is_loaded          => l_is_loaded,
                                p_is_completed       => l_is_completed
							   ,p_is_picknone        => l_is_picknone 	--ER13869750
                               );
Line: 9814

         l_insert_query := l_insert_query || ') ';
Line: 9815

         l_select_generic :=
            get_generic_select (p_is_unreleased             => l_is_unreleased,
                                p_is_pending                => l_is_pending,
                                p_is_queued                 => l_is_queued,
                                p_is_dispatched             => l_is_dispatched,
                                p_is_active                 => l_is_active,
                                p_is_loaded                 => l_is_loaded,
                                p_is_completed              => l_is_completed
								,p_is_picknone              => l_is_picknone 	--ER13869750
							   );
Line: 9952

               l_insert_query
            || l_select_generic
            || l_from_generic
            || l_where_generic;
Line: 10288

      l_parent_inserted   NUMBER  := 0;
Line: 10300

         DELETE FROM wms_waveplan_tasks_temp;
Line: 10749

                                x_non_complete_parent      => l_parent_inserted
                               );
Line: 10753

	                  as Employee does not hold good for Pending tasks. Hence delete the unwanted records from WWTT */
	IF ( p_is_queued OR p_is_dispatched OR p_is_active OR p_is_loaded OR p_is_completed
	     AND ( p_is_pending OR p_is_unreleased ) ) AND ( p_person_id IS NOT NULL OR
               p_person_resource_id IS NOT NULL OR
               p_equipment_type_id IS NOT NULL OR
               p_machine_resource_id IS NOT NULL OR
               p_machine_instance IS NOT NULL )
	THEN
	  IF (p_is_pending) THEN
	    l_is_pending := FALSE;
Line: 10773

		DELETE FROM wms_waveplan_tasks_temp
		   WHERE status_id = 8;
Line: 10789

          debug('Done populating merged tasks.  Delete unwanted tasks','query_tasks');
Line: 10792

       DELETE FROM wms_waveplan_tasks_temp
         WHERE status_id = 1;
Line: 10807

    /* Bug - 5446146 If a user task type has been entered, delete the records which are not associated with a user task type */
    IF p_user_task_type_id IS NOT NULL THEN

         DELETE FROM wms_waveplan_tasks_temp
         WHERE user_task_type_id IS NULL;
Line: 10819

         IF g_num_of_child_tasks_visible = 'T' AND l_parent_inserted > 0
         THEN
            --calculate number of children associated with parent tasks
            set_num_of_child_tasks;
Line: 10932

      SELECT wms_task_dispatch_device.get_eligible_device
                                                      (mmtt.organization_id,
                                                       mmtt.subinventory_code,
                                                       mmtt.locator_id
                                                      )
        INTO p_device_id
        FROM mtl_material_transactions_temp mmtt
       WHERE mmtt.transaction_temp_id = p_transaction_temp_id;
Line: 10941

      SELECT force_sign_on_flag
        INTO l_force_sign_on
        FROM wms_devices_b
       WHERE device_id = p_device_id;
Line: 10955

   PROCEDURE update_task (
      p_transaction_temp_id     IN              wms_waveplan_tasks_pvt.transaction_temp_table_type,
      p_task_type_id            IN              wms_waveplan_tasks_pvt.task_type_id_table_type,
      p_employee                IN              VARCHAR2,
      p_employee_id             IN              NUMBER,
      p_user_task_type          IN              VARCHAR2,
      p_user_task_type_id       IN              NUMBER,
      p_effective_start_date    IN              DATE,
      p_effective_end_date      IN              DATE,
      p_person_resource_id      IN              NUMBER,
      p_person_resource_code    IN              VARCHAR2,
      p_force_employee_change   IN              BOOLEAN,
      p_to_status               IN              VARCHAR2,
      p_to_status_id            IN              NUMBER,
      p_update_priority_type    IN              VARCHAR2,
      p_update_priority         IN              NUMBER,
      p_clear_priority          IN              VARCHAR2,
      x_result                  OUT NOCOPY      wms_waveplan_tasks_pvt.result_table_type,
      x_message                 OUT NOCOPY      wms_waveplan_tasks_pvt.message_table_type,
      x_task_id                 OUT NOCOPY      wms_waveplan_tasks_pvt.task_id_table_type,
      x_return_status           OUT NOCOPY      VARCHAR2,
      x_return_msg              OUT NOCOPY      VARCHAR2,
      x_msg_count               OUT NOCOPY      NUMBER
   )
   IS
      l_task_id                     NUMBER;
Line: 10994

      IF g_cannot_update_putaway IS NULL
      THEN
         fnd_message.set_name ('WMS', 'WMS_CANNOT_UPDATE_PUTAWAY_TASK');
Line: 10997

         g_cannot_update_putaway := fnd_message.get;
Line: 10998

         fnd_message.set_name ('WMS', 'WMS_CANNOT_UPDATE_STAGING_MOVE');
Line: 10999

         g_cannot_update_staging_move := fnd_message.get;
Line: 11000

         fnd_message.set_name ('WMS', 'WMS_TASK_UPDATED');
Line: 11001

         g_task_updated := fnd_message.get;
Line: 11007

         UPDATE wms_waveplan_tasks_temp
            SET RESULT = 'X'
          WHERE transaction_temp_id = p_transaction_temp_id (i)
            AND task_type_id = p_task_type_id (i);
Line: 11023

      UPDATE wms_waveplan_tasks_temp
         SET RESULT = 'E',
             error =
                DECODE (task_type_id,
                        2, g_cannot_update_putaway,
                        7, g_cannot_update_staging_move
                       )
       WHERE RESULT = 'X' AND task_type_id IN (2, 7);
Line: 11035

         UPDATE wms_waveplan_tasks_temp
            SET RESULT = 'E',
                error = g_cannot_unrelease_cc
          WHERE RESULT = 'X' AND task_type_id = 3;
Line: 11044

         SELECT transaction_temp_id, task_type_id, status
         BULK COLLECT INTO l_transaction_temp_ids, l_task_type_ids, l_statuses
           FROM wms_waveplan_tasks_temp
          WHERE RESULT = 'X'
            AND NOT (   (status_id = 8 AND p_to_status_id IN (1, 2)
                        )                   -- Unreleased to pending or queued
                     OR (status_id = 1 AND p_to_status_id IN (2, 8)
                        )                   -- Pending to queued or unreleased
                     OR (status_id = 2 AND p_to_status_id IN (1, 8)
                        )                   -- Queued to pending or unreleased
                     OR (status_id = 9 AND p_to_status_id IN (1, 8)
                        )                   -- R12:Active to Pending or unreleased
                     OR (status_id = 3 AND p_to_status_id IN (1, 8)
                        )                   -- R12:Dispatched to Pending or unreleased
                     OR (status_id = p_to_status_id)
                    );                      -- No Status Change
Line: 11066

               fnd_message.set_name ('WMS', 'WMS_CANNOT_UPDATE_STATUS');
Line: 11073

               UPDATE wms_waveplan_tasks_temp
                  SET RESULT = 'E',
                      error = l_messages (i)
                WHERE transaction_temp_id = l_transaction_temp_ids (i)
                  AND task_type_id = l_task_type_ids (i);
Line: 11086

	SELECT wwtt.transaction_temp_id, wwtt.task_type_id, wwtt.status
		BULK COLLECT INTO l_transaction_temp_ids, l_task_type_ids, l_statuses
		FROM wms_waveplan_tasks_temp wwtt, mtl_material_transactions_temp mmtt, WMS_DISPATCHED_TASKS wdt
		WHERE wwtt.transaction_temp_id = wdt.transaction_temp_id AND
				   wwtt.transaction_temp_id = mmtt.transaction_temp_id AND
		       wwtt.RESULT = 'X' AND
		       wwtt.status_id = 3   AND
		       EXISTS (   SELECT 1 FROM WMS_DISPATCHED_TASKS wdt2
		                  WHERE  wdt2.person_id = wwtt.person_id AND
		                  wdt2.status = 9 AND
				  wdt2.task_method IS NOT NULL AND
				  wdt2.transaction_temp_id IN( SELECT transaction_temp_id FROM mtl_material_transactions_temp mmtt1
				   			       WHERE DECODE(wdt.TASK_METHOD,
							           	'CARTON', mmtt1.cartonization_id,
									'PICK_SLIP', mmtt1.pick_slip_number,
									'DISCRETE', mmtt1.pick_slip_number,
									mmtt1.transaction_source_id) = DECODE(wdt.TASK_METHOD,
										   			'CARTON', mmtt.cartonization_id,
												 	'PICK_SLIP', mmtt.pick_slip_number,
												 	'DISCRETE', mmtt.pick_slip_number,
													mmtt.transaction_source_id))
		           );
Line: 11114

                  fnd_message.set_name ('WMS', 'WMS_GROUP_TASKS_CANNOT_UPDATE');
Line: 11120

                  UPDATE wms_waveplan_tasks_temp
                     SET RESULT = 'E',
                         error = 'This group of tasks is currently being worked, cannot change status'
                   WHERE transaction_temp_id = l_transaction_temp_ids (i)
                     AND task_type_id = l_task_type_ids (i);
Line: 11129

            SELECT transaction_temp_id, task_type_id, status
            BULK COLLECT INTO l_transaction_temp_ids, l_task_type_ids, l_statuses
              FROM wms_waveplan_tasks_temp wwtt
             WHERE RESULT = 'X' AND
                   status_id = 9 AND
                   EXISTS (   SELECT 1 FROM MTL_MOBILE_LOGIN_HIST MMLH, WMS_DISPATCHED_TASKS WDT
                              WHERE WDT.TRANSACTION_TEMP_ID = WWTT.TRANSACTION_TEMP_ID AND
                                    MMLH.USER_ID = WDT.LAST_UPDATED_BY AND
                                    MMLH.LOGOFF_DATE IS NULL AND
                                    MMLH.EVENT_MESSAGE IS NULL
                               );
Line: 11144

                  UPDATE wms_waveplan_tasks_temp
                     SET RESULT = 'E',
                         error = 'This task is currently being worked, cannot change status'
                   WHERE transaction_temp_id = l_transaction_temp_ids (i)
                     AND task_type_id = l_task_type_ids (i);
Line: 11158

         fnd_message.set_name ('WMS', 'WMS_CANNOT_UPDATE_EMPLOYEE');
Line: 11162

         UPDATE wms_waveplan_tasks_temp wwtt
            SET RESULT = 'E',
                error = l_message
          WHERE RESULT = 'X'
            AND NOT EXISTS (
                   SELECT 1
                     FROM bom_std_op_resources bsor,
                          bom_resource_employees bre
                    WHERE wwtt.user_task_type_id = bsor.standard_operation_id
                      AND bsor.resource_id = bre.resource_id
                      AND bre.person_id = p_employee_id);
Line: 11175

         SELECT transaction_temp_id
         BULK COLLECT INTO l_transaction_temp_ids_temp
           FROM wms_waveplan_tasks_temp
          WHERE RESULT = 'X';
Line: 11190

                  fnd_message.set_name ('WMS', 'WMS_CANNOT_UPDATE_EMPLOYEE');
Line: 11194

		    DEBUG ('l_device_id : ' || l_device_id, ' Update_TAsk :');
Line: 11196

                         ' Update_TAsk :'
                        );
Line: 11200

                  UPDATE wms_waveplan_tasks_temp wwtt
                     SET RESULT = 'E',
                         error = l_message
                   WHERE transaction_temp_id = l_transaction_temp_ids_temp (i)
                     AND NOT EXISTS (
                            SELECT 1
                              FROM wms_device_assignment_temp
                             WHERE device_id = l_device_id
                               AND employee_id = p_employee_id);
Line: 11215

      UPDATE wms_waveplan_tasks_temp wwtt
         SET person_resource_id =
                (SELECT bre.resource_id
                   FROM bom_std_op_resources bsor, bom_resource_employees bre
                  WHERE wwtt.user_task_type_id = bsor.standard_operation_id
                    AND bsor.resource_id = bre.resource_id
                    AND bre.person_id = wwtt.person_id
                    AND ROWNUM < 2)
       WHERE RESULT = 'X';
Line: 11230

            UPDATE    wms_waveplan_tasks_temp wwtt
                  SET RESULT = 'E',
                      error = l_message
                WHERE RESULT = 'X' AND (status_id NOT IN (1, 2, 3, 8, 9) AND p_to_status_id IN (1, 8))
            RETURNING         transaction_temp_id, task_type_id, status
            BULK COLLECT INTO l_transaction_temp_ids, l_task_type_ids, l_statuses;
Line: 11239

            UPDATE    wms_waveplan_tasks_temp wwtt
                  SET RESULT = 'E',
                      error = l_message
                WHERE RESULT = 'X' AND status_id NOT IN (1, 8)
            RETURNING         transaction_temp_id, task_type_id, status
            BULK COLLECT INTO l_transaction_temp_ids, l_task_type_ids, l_statuses;
Line: 11252

               fnd_message.set_name ('WMS', 'WMS_CANNOT_UPDATE_USER_TASK_TYPE');
Line: 11258

               UPDATE wms_waveplan_tasks_temp
                  SET RESULT = 'E',
                      error = l_messages (i)
                WHERE transaction_temp_id = l_transaction_temp_ids (i)
                  AND task_type_id = l_task_type_ids (i);
Line: 11267

      IF (p_update_priority_type IS NOT NULL AND p_update_priority IS NOT NULL) OR p_clear_priority = 'Y'
      THEN
         -- R12: Can update priority if task is dispatched, active  IF
         -- Dispatched or Active tasks are in the process of getting updated to pending or Unreleased
         IF p_to_status_id IS NOT NULL THEN
            UPDATE    wms_waveplan_tasks_temp wwtt
                  SET RESULT = 'E',
                      error = l_message
                WHERE RESULT = 'X' AND (status_id NOT IN (1, 2, 3, 8, 9) AND p_to_status_id IN (1, 8))
            RETURNING         transaction_temp_id, task_type_id, status
            BULK COLLECT INTO l_transaction_temp_ids, l_task_type_ids, l_statuses;
Line: 11281

            UPDATE    wms_waveplan_tasks_temp wwtt
                  SET RESULT = 'E',
                      error = l_message
                WHERE RESULT = 'X' AND status_id NOT IN (1, 2, 8)
            RETURNING         transaction_temp_id, task_type_id, status
            BULK COLLECT INTO l_transaction_temp_ids, l_task_type_ids, l_statuses;
Line: 11294

               fnd_message.set_name ('WMS', 'WMS_CANNOT_UPDATE_PRIORITY');
Line: 11300

               UPDATE wms_waveplan_tasks_temp
                  SET RESULT = 'E',
                      error = l_messages (i)
                WHERE transaction_temp_id = l_transaction_temp_ids (i)
                  AND task_type_id = l_task_type_ids (i);
Line: 11311

         UPDATE wms_waveplan_tasks_temp
            SET task_id = NVL (task_id, wms_dispatched_tasks_s.NEXTVAL),
                status = p_to_status,
                status_id = p_to_status_id,
                priority =
                   DECODE (p_clear_priority,
                           'Y', NULL,
                           DECODE(p_update_priority_type,
                                 'I', NVL(priority,0) + p_update_priority,             -- R12: Increment priority
                                 'D', DECODE(SIGN(NVL(priority,0) - p_update_priority),-- R12: Decrement priority
                                             -1, 0,
                                             +1, NVL(priority,0) - p_update_priority,
                                              0, 0),
                                 'S', NVL(p_update_priority, priority),	               -- R12: Set       priority
                                  priority)
                          ),
                person = p_employee,
                person_id = p_employee_id,
                effective_start_date = p_effective_start_date,
                effective_end_date = p_effective_end_date,
                person_resource_code = p_person_resource_code,
                person_resource_id = p_person_resource_id,
                RESULT = 'S',
                error = g_task_updated,
                is_modified = 'Y'
          WHERE RESULT = 'X';
Line: 11339

	   DEBUG ('Else Part  ______________________: ', ' Update_TAsk :');
Line: 11341

         UPDATE wms_waveplan_tasks_temp
            SET task_id = DECODE (p_to_status_id, 1, NULL, 8, NULL, task_id),
                status = NVL (p_to_status, status),
                status_id = NVL (p_to_status_id, status_id),
                user_task_type = NVL (p_user_task_type, user_task_type),         -- R12: Assign User Task Type
                user_task_type_id = NVL (p_user_task_type_id, user_task_type_id),-- R12: Assign User Task Type
                priority =
                   DECODE (p_clear_priority,
                           'Y', NULL,
                           DECODE(p_update_priority_type,
                                 'I', NVL(priority,0) + p_update_priority,             -- R12: Increment priority
                                 'D', DECODE(SIGN(NVL(priority,0) - p_update_priority),-- R12: Decrement priority
                                             -1, 0,
                                             +1, NVL(priority,0) - p_update_priority,
                                              0, 0),
                                 'S', NVL(p_update_priority, priority),                -- R12: Set Constant priority value
                                  priority)
                          ),
                person = DECODE (p_to_status_id, 1, NULL, 8, NULL, person),
                person_id =
                          DECODE (p_to_status_id,
                                  1, NULL,
                                  8, NULL,
                                  person_id
                                 ),
                effective_start_date =
                   DECODE (p_to_status_id,
                           1, NULL,
                           8, NULL,
                           effective_start_date
                          ),
                effective_end_date =
                   DECODE (p_to_status_id,
                           1, NULL,
                           8, NULL,
                           effective_end_date
                          ),
                person_resource_code =
                   DECODE (p_to_status_id,
                           1, NULL,
                           8, NULL,
                           person_resource_code
                          ),
                person_resource_id =
                   DECODE (p_person_resource_id,
                           1, NULL,
                           8, NULL,
                           person_resource_id
                          ),
                RESULT = 'S',
                error = g_task_updated,
                is_modified = 'Y'
          WHERE RESULT = 'X';
Line: 11397

                ' Update_TAsk :'
               );
Line: 11403

         UPDATE    wms_waveplan_tasks_temp
               SET RESULT = RESULT
             WHERE transaction_temp_id = p_transaction_temp_id (i)
               AND task_type_id = p_task_type_id (i)
         RETURNING         task_id, RESULT, error
         BULK COLLECT INTO x_task_id, x_result, x_message;
Line: 11415

         DEBUG ('Sql Error: ' || SQLERRM, 'Task Planning.Task Update');
Line: 11416

   END update_task;
Line: 11443

      /*IF g_cannot_update_putaway IS NULL
      THEN
         fnd_message.set_name ('WMS', 'WMS_CANNOT_UPDATE_PUTAWAY_TASK');
Line: 11446

         g_cannot_update_putaway := fnd_message.get;
Line: 11447

         fnd_message.set_name ('WMS', 'WMS_CANNOT_UPDATE_STAGING_MOVE');
Line: 11448

         g_cannot_update_staging_move := fnd_message.get;
Line: 11449

         fnd_message.set_name ('WMS', 'WMS_TASK_UPDATED');
Line: 11450

         g_task_updated := fnd_message.get;
Line: 11457

         UPDATE wms_waveplan_tasks_temp
            SET RESULT = 'X'
          WHERE transaction_temp_id = p_transaction_temp_id (i)
            AND task_type_id = p_task_type_id (i);
Line: 11472

      UPDATE wms_waveplan_tasks_temp
         SET RESULT = 'E',
             error =
                DECODE (task_type_id,
                        1, 'Can not cancel pick task',
                        3, 'Can not cancel cycle count task',
                        4, 'Can not cancel replenish task',
                        5, 'Can not cancel move order transfer task',
                        6, 'Can not cancel move order issue task',
                        7, 'Can not cancel staging move task'
                       )
       WHERE RESULT = 'X' AND task_type_id <> 2;
Line: 11488

        UPDATE wms_waveplan_tasks_temp
           SET RESULT = 'E',
             error =
                DECODE (task_type_id,
                        2, 'Can not cancel putaway task'
                       )
         WHERE RESULT = 'X' AND task_type_id = 2;
Line: 11499

      UPDATE wms_waveplan_tasks_temp
         SET RESULT = 'E',
             error =  'Can not cancel completed tasks'
       WHERE RESULT = 'X' AND status_id = 6;
Line: 11504

      UPDATE wms_waveplan_tasks_temp
         SET status_id = 12,
             status = g_status_codes(12),
             is_modified = 'Y',
             RESULT = 'S',
             error = 'Task Canceled'
       WHERE RESULT = 'X';
Line: 11513

         UPDATE    wms_waveplan_tasks_temp
               SET RESULT = RESULT
             WHERE transaction_temp_id = p_transaction_temp_id (i)
               AND task_type_id = p_task_type_id (i)
         RETURNING         task_id, RESULT, error
         BULK COLLECT INTO x_task_id, x_result, x_message;
Line: 11539

         DELETE FROM wms_waveplan_tasks_temp
               WHERE transaction_temp_id = p_transaction_temp_id (i);
Line: 11586

      TYPE user_task_type_id IS TABLE OF wms_waveplan_tasks_temp.user_task_type_id%TYPE   -- R12: Update User Task Type Id
         INDEX BY BINARY_INTEGER;
Line: 11597

      l_user_task_type_id            user_task_type_id;         -- R12: Update User Task Type Id
Line: 11599

      l_update_date                  DATE;
Line: 11607

         SELECT transaction_temp_id, task_type_id, mmtt_last_updated_by,
                mmtt_last_update_date, wdt_last_updated_by,
                wdt_last_update_date, person_id, person_id_original,person_resource_id,/* Bug 5630187 - Added person_resource_id */
                effective_start_date, effective_end_date, status_id,
                status_id_original, priority, priority_original, user_task_type_id, num_of_child_tasks  -- R12: Added User Task Type Id
           FROM wms_waveplan_tasks_temp wwtt
          WHERE wwtt.is_modified = 'Y';
Line: 11619

      SELECT transaction_temp_id
        FROM mtl_material_transactions_temp
        WHERE parent_line_id = trx_temp_id
        AND transaction_temp_id <> trx_temp_id
        FOR UPDATE nowait;
Line: 11636

      IF p_task_action = 'U' THEN -- Update tasks

      FOR rec_wwtt IN cur_wwtt
      LOOP
         BEGIN
            IF rec_wwtt.task_type_id IN (2, 8) AND rec_wwtt.status_id = 12 THEN
               if l_debug = 1 then
      	         DEBUG ('Cancelled Plan');
Line: 11657

               UPDATE wms_waveplan_tasks_temp
                  SET is_modified = 'N',
                  RESULT = 'S',
                   error = g_plan_cancelled
                WHERE transaction_temp_id = rec_wwtt.transaction_temp_id;
Line: 11671

               SELECT     mmtt.transaction_temp_id
                     INTO l_transaction_temp_id_table (i)
                     FROM mtl_material_transactions_temp mmtt,
                          wms_dispatched_tasks wdt
                    WHERE mmtt.transaction_temp_id =
                                                  rec_wwtt.transaction_temp_id
                      AND mmtt.transaction_temp_id = wdt.transaction_temp_id(+)
                      AND mmtt.wms_task_type = wdt.task_type(+)
                      AND DECODE (wdt.status,
                                  NULL, NVL (mmtt.wms_task_status, 1),
                                  wdt.status
                                 ) = NVL (rec_wwtt.status_id_original, -1)
                      AND NVL (mmtt.task_priority, -1) =
                                           NVL (rec_wwtt.priority_original,
                                                -1)
                      AND NVL (wdt.person_id, -1) =
                                          NVL (rec_wwtt.person_id_original,
                                               -1)
                      AND mmtt.last_updated_by = rec_wwtt.mmtt_last_updated_by
                      AND mmtt.last_update_date =
                                                rec_wwtt.mmtt_last_update_date
                      AND NVL (wdt.last_updated_by, -1) =
                                         NVL (rec_wwtt.wdt_last_updated_by,
                                              -1)
                      AND (   wdt.last_update_date =
                                                 rec_wwtt.wdt_last_update_date
                           OR (    wdt.last_update_date IS NULL
                               AND rec_wwtt.wdt_last_update_date IS NULL
                              )
                          )
               FOR UPDATE NOWAIT;
Line: 11705

               SELECT     mcce.cycle_count_entry_id
                     INTO l_transaction_temp_id_table (i)
                     FROM mtl_cycle_count_entries mcce,
                          wms_dispatched_tasks wdt
                    WHERE mcce.cycle_count_entry_id =
                                                  rec_wwtt.transaction_temp_id
                      AND mcce.cycle_count_entry_id = wdt.transaction_temp_id(+)
                      AND 3 = wdt.task_type(+)
                      AND DECODE (wdt.status, NULL, 1, wdt.status) =
                                          NVL (rec_wwtt.status_id_original,
                                               -1)
                      AND NVL (mcce.task_priority, -1) =
                                           NVL (rec_wwtt.priority_original,
                                                -1)
                      AND NVL (wdt.person_id, -1) =
                                          NVL (rec_wwtt.person_id_original,
                                               -1)
                      AND mcce.last_updated_by = rec_wwtt.mmtt_last_updated_by
                      AND mcce.last_update_date =
                                                rec_wwtt.mmtt_last_update_date
                      AND NVL (wdt.last_updated_by, -1) =
                                         NVL (rec_wwtt.wdt_last_updated_by,
                                              -1)
                      AND (   wdt.last_update_date =
                                                 rec_wwtt.wdt_last_update_date
                           OR (    wdt.last_update_date IS NULL
                               AND rec_wwtt.wdt_last_update_date IS NULL
                              )
                          )
               FOR UPDATE NOWAIT;
Line: 11746

            l_user_task_type_id (i) := rec_wwtt.user_task_type_id;  -- R12: Update User Task Type Id
Line: 11768

          l_user_task_type_id (i) := rec_wwtt.user_task_type_id;  -- R12: Update User Task Type Id
Line: 11800

               UPDATE mtl_material_transactions_temp
                  SET wms_task_status =
                         DECODE (l_wms_task_status_table (i),
                                 8, 8,
                                 1, 1,
                                 NULL
                                ),
                      task_priority = l_task_priority_table (i),
                      last_update_date = SYSDATE,
                      last_updated_by = p_user_id,
                      last_update_login = p_login_id,
                      standard_operation_id = l_user_task_type_id (i)
                WHERE transaction_temp_id = l_transaction_temp_id_table (i)   -- R12: Update User Task Type Id
                  AND l_task_type_id (i) <> 3;
Line: 11815

	      DEBUG ('No of records updated are-777 ' || SQL%ROWCOUNT);
Line: 11822

               UPDATE mtl_cycle_count_entries
                  SET task_priority = l_task_priority_table (i),
                      last_update_date = SYSDATE,
                      last_updated_by = p_user_id,
                      last_update_login = p_login_id,
	              standard_operation_id = l_user_task_type_id (i)         --R12: Update User Task Type Id
                WHERE cycle_count_entry_id IN (
                              SELECT mcce.cycle_count_entry_id
                                FROM wms_waveplan_tasks_temp wwtt, mtl_cycle_count_entries mcce, mtl_cycle_count_headers mcch
                               WHERE wwtt.transaction_temp_id=l_transaction_temp_id_table (i)
                                 AND wwtt.is_modified = 'Y'
                                 AND mcce.cycle_count_header_id = mcch.cycle_count_header_id
                                 AND mcce.inventory_item_id = wwtt.inventory_item_id
                                 AND mcce.subinventory = wwtt.subinventory
                                 AND mcce.locator_id = wwtt.locator_id
                                 AND NVL(mcce.revision,'-1') = NVL(wwtt.revision, '-1')
                                 AND mcch.cycle_count_header_name = wwtt.source_header
				 AND mcch.organization_id = wwtt.organization_id
                                 AND mcce.entry_status_code not in (2,4,5))
                  AND l_task_type_id (i) = 3;
Line: 11843

	      DEBUG ('No of records updated are-666 ' || SQL%ROWCOUNT);
Line: 11848

         DELETE      wms_dispatched_tasks wdt
               WHERE wdt.status IN (2, 3, 9) -- R12: Delete the Active or Dispatched tasks which were updated to pending/Unreleased
                 AND wdt.transaction_temp_id IN (
                        SELECT transaction_temp_id
                          FROM wms_waveplan_tasks_temp wwtt
                         WHERE wwtt.status_id IN (1, 8)
                           AND wwtt.is_modified = 'Y'
                           -- adding following condition to delete WDT's with no child tasks
                           AND (
                                  (wdt.task_type = 3 AND NVL(wwtt.num_of_child_tasks,1)<2)
                                  OR
                                  wdt.task_type <> 3
                                )
                            );
Line: 11863

         l_update_date := SYSDATE;
Line: 11865

           DEBUG ('inserting into WDT ' || x_save_count);
Line: 11869

         INSERT INTO wms_dispatched_tasks
                     (task_id, transaction_temp_id, organization_id,
                      user_task_type, person_id, effective_start_date,
                      effective_end_date, person_resource_id,
                      machine_resource_id, status, dispatched_time,
                      last_update_date, last_updated_by, creation_date,
                      created_by, last_update_login, task_type, priority,
                      move_order_line_id, operation_plan_id, transfer_lpn_id)
            (SELECT wwtt.task_id, wwtt.transaction_temp_id,
                    wwtt.organization_id, NVL (wwtt.user_task_type_id, 0),
                    wwtt.person_id,sysdate, sysdate ,  /*bug#6409956.replaced effective dates by sysdate */
		    wwtt.person_resource_id, NULL, 2, -- Queued
                    NULL, l_update_date, p_user_id, l_update_date, p_user_id,
                    p_login_id, wwtt.task_type_id, wwtt.priority,
                    wwtt.move_order_line_id, wwtt.operation_plan_id,
                    wwtt.to_lpn_id
               FROM wms_waveplan_tasks_temp wwtt
              WHERE wwtt.status_id = 2
                AND wwtt.status_id_original IN (1, 8)
                AND wwtt.is_modified = 'Y'
                -- bug 11705135 : adding following condition to insert WDT record with no child tasks
		-- WDT CC records with child tasks will be added later in this procedure
                 AND (
                        (wwtt.task_type_id = 3 AND NVL(wwtt.num_of_child_tasks,1)<2)
                        OR
                        wwtt.task_type_id <> 3
                      )
                AND NOT EXISTS (
                       SELECT 1
                         FROM wms_dispatched_tasks wdt
                        WHERE wdt.transaction_temp_id =
                                                      wwtt.transaction_temp_id));
Line: 11902

           DEBUG ('No of records inserted are-444 ' || SQL%ROWCOUNT);
Line: 11906

            UPDATE wms_dispatched_tasks wdt
               SET person_id = l_person_id_table (i),
	           person_resource_id = l_person_resource_id_table (i),
                   effective_start_date = l_effective_start_date_table (i),
                   effective_end_date = l_effective_end_date_table (i),
                   priority = l_task_priority_table (i),
                   last_update_date = l_update_date,
                   last_updated_by = p_user_id,
                   last_update_login = p_login_id
             WHERE wdt.transaction_temp_id IN (    --modified the where condition for bug 14663231
                        SELECT wwtt.transaction_temp_id
                          FROM wms_waveplan_tasks_temp wwtt
                         WHERE wwtt.transaction_temp_id = l_transaction_temp_id_table (i)
						   --AND wwtt.status_id IN (1, 8)  -- Bug 15898611
               AND wwtt.status_id IN (1, 2, 8)  -- Bug 15898611
                           AND wwtt.is_modified = 'Y'
                           AND (
                                  (wdt.task_type = 3 AND NVL(wwtt.num_of_child_tasks,1)<2)
                                  OR
                                  wdt.task_type <> 3
                                )
                            );
Line: 11929

         DEBUG ('No of records updated are-333' || SQL%ROWCOUNT);
Line: 11938

               DELETE      wms_dispatched_tasks wdt
                     WHERE wdt.status IN (2, 3)
                       AND wdt.task_type = 3
                       AND wdt.transaction_temp_id IN (
                              SELECT mcce.cycle_count_entry_id
                                FROM wms_waveplan_tasks_temp wwtt, mtl_cycle_count_entries mcce, mtl_cycle_count_headers mcch
                               WHERE wwtt.status_id IN (1, 8)
                                 AND wwtt.is_modified = 'Y'
                                 AND NVL(wwtt.num_of_child_tasks,1)>1
                                 AND mcce.cycle_count_header_id = mcch.cycle_count_header_id
                                 AND mcce.inventory_item_id = wwtt.inventory_item_id
                                 AND mcce.subinventory = wwtt.subinventory
                                 AND mcce.locator_id = wwtt.locator_id
                                 AND NVL(mcce.revision,'-1') = NVL(wwtt.revision, '-1')
                                 AND mcch.cycle_count_header_name = wwtt.source_header
                                 AND mcch.organization_id = wwtt.organization_id
                                 AND mcce.entry_status_code not in (2,4,5));
Line: 11956

               DEBUG ('No of records deleted are-999 ' || SQL%ROWCOUNT);
Line: 11957

               l_update_date := SYSDATE;
Line: 11958

               DEBUG ('inserting into WDT ' || x_save_count);
Line: 11962

               INSERT INTO wms_dispatched_tasks
                           (task_id, transaction_temp_id, organization_id,
                            user_task_type, person_id, effective_start_date,
                            effective_end_date, person_resource_id,
                            machine_resource_id, status, dispatched_time,
                            last_update_date, last_updated_by, creation_date,
                            created_by, last_update_login, task_type, priority,
                            move_order_line_id, operation_plan_id, transfer_lpn_id)
                  (SELECT wms_dispatched_tasks_s.NEXTVAL, mcce.cycle_count_entry_id,
                          wwtt.organization_id, NVL (wwtt.user_task_type_id, 0),
                          wwtt.person_id, sysdate, sysdate ,  /*bug#5965353.replaced effective dates by sysdate */
              wwtt.person_resource_id, NULL, 2,  -- Queued
                          NULL, l_update_date, p_user_id, l_update_date, p_user_id,
                          p_login_id, wwtt.task_type_id, wwtt.priority,
                          wwtt.move_order_line_id, wwtt.operation_plan_id,
                          wwtt.to_lpn_id
                     FROM wms_waveplan_tasks_temp wwtt, mtl_cycle_count_entries mcce, mtl_cycle_count_headers mcch
                    WHERE NVL(wwtt.NUM_OF_CHILD_TASKS,1) > 1
              AND mcce.cycle_count_header_id = mcch.cycle_count_header_id
                AND mcce.inventory_item_id = wwtt.inventory_item_id
                AND mcce.subinventory = wwtt.subinventory
                AND mcce.locator_id = wwtt.locator_id
                AND NVL(mcce.revision,'-1') = NVL(wwtt.revision, '-1')
                AND mcch.cycle_count_header_name = wwtt.source_header
                AND mcch.organization_id = wwtt.organization_id
                AND mcce.entry_status_code not in (2,4, 5)
              AND wwtt.status_id = 2
                      AND wwtt.status_id_original IN (1, 8)
                      AND wwtt.task_type_id = 3
                      AND NOT EXISTS (
                             SELECT 1
                               FROM wms_dispatched_tasks wdt
                              WHERE wdt.transaction_temp_id =
                                                            wwtt.transaction_temp_id));
Line: 11997

               DEBUG ('No of records inserted are-888 ' || SQL%ROWCOUNT);
Line: 12002

                  UPDATE wms_dispatched_tasks
                     SET person_id = l_person_id_table (i),
                         effective_start_date = l_effective_start_date_table (i),
                         effective_end_date = l_effective_end_date_table (i),
                         priority = l_task_priority_table (i),
                         last_update_date = l_update_date,
                         last_updated_by = p_user_id,
                         last_update_login = p_login_id
                   WHERE task_type = 3
                        AND transaction_temp_id IN (
                              SELECT mcce.cycle_count_entry_id
                                FROM wms_waveplan_tasks_temp wwtt, mtl_cycle_count_entries mcce, mtl_cycle_count_headers mcch
                               WHERE wwtt.transaction_temp_id=l_transaction_temp_id_table (i)
                                 AND wwtt.is_modified = 'Y'
                                 AND NVL(wwtt.num_of_child_tasks,1)>1
                                 AND mcce.cycle_count_header_id = mcch.cycle_count_header_id
                                 AND mcce.inventory_item_id = wwtt.inventory_item_id
                                 AND mcce.subinventory = wwtt.subinventory
                                 AND mcce.locator_id = wwtt.locator_id
                                 AND NVL(mcce.revision,'-1') = NVL(wwtt.revision, '-1')
                                 AND mcch.cycle_count_header_name = wwtt.source_header
                                 AND mcch.organization_id = wwtt.organization_id
                                 AND mcce.entry_status_code not in (2,4,5));
Line: 12027

               DEBUG ('No of records updated are-777 ' || SQL%ROWCOUNT);
Line: 12051

            UPDATE wms_waveplan_tasks_temp
               SET RESULT = 'S',
                   error = g_task_saved,
                   is_modified = 'N',
                   person_id_original = l_person_id_table (i),
                   status_id_original = l_wms_task_status_table (i),
                   priority_original = l_task_priority_table (i),
                   mmtt_last_updated_by = p_user_id,
                   mmtt_last_update_date = l_update_date,
                   wdt_last_updated_by =
                      DECODE (l_wms_task_status_table (i),
                              1, NULL,
                              8, NULL,
                              p_user_id
                             ),
                   wdt_last_update_date =
                      TO_DATE (DECODE (l_wms_task_status_table (i),
                                       1, NULL,
                                       8, NULL,
                                       TO_CHAR (l_update_date,
                                                'DD-MON-YY HH24:MI:SS'
                                               )
                                      ),
                               'DD-MON-YY HH24:MI:SS'
                              )
             WHERE transaction_temp_id = l_transaction_temp_id_table (i);
Line: 12078

	   DEBUG ('No of records updated are-222 ' || SQL%ROWCOUNT);
Line: 12095

                  UPDATE wms_waveplan_tasks_temp
                     SET RESULT = 'S',
                         error = 'Task Cancelled',
                         is_modified = 'N'
                   WHERE transaction_temp_id = rec_wwtt.transaction_temp_id;
Line: 12110

      UPDATE wms_waveplan_tasks_temp
         SET RESULT = 'E',
             error = l_error_message
       WHERE is_modified = 'Y';
Line: 12116

        DEBUG ('No of records updated are-111 ' || SQL%ROWCOUNT);
Line: 12149

         SELECT   status_id, COUNT (*) task_count
             FROM wms_waveplan_tasks_temp
            WHERE task_type_id = NVL (p_task_type_id, task_type_id)
         GROUP BY status_id;
Line: 12196

         SELECT   task_type_id, COUNT (*) task_count
             FROM wms_waveplan_tasks_temp
            WHERE task_type_id = NVL (p_task_type_id, task_type_id)
         GROUP BY task_type_id;
Line: 12296

         SELECT transaction_temp_id, task_type_id, user_task_type_id,
                unit_volume, volume_uom_code, unit_weight, weight_uom_code,
                inventory_item_id, transaction_quantity
         BULK COLLECT INTO l_transaction_temp_id, l_task_type_id, l_user_task_type_id,
                l_volume, l_volume_uom_code, l_weight, l_weight_uom_code,
                l_inventory_item_id, l_quantity
           FROM wms_waveplan_tasks_temp
          WHERE RESULT IN ('X', 'Y', 'Z');
Line: 12638

            UPDATE wms_waveplan_tasks_temp
               SET time_estimate = l_time (i),
                   display_weight = l_weight (i),
                   display_volume = l_volume (i)
             WHERE transaction_temp_id = l_transaction_temp_id (i)
               AND task_type_id = l_task_type_id (i);
Line: 12646

      DELETE FROM wms_waveplan_summary_temp;
Line: 12648

      INSERT INTO wms_waveplan_summary_temp
                  (task_type_id, task_type, task_type_description,
                   total_tasks, total_time, time_uom, weight, weight_uom,
                   volume, volume_uom, organization_id)
         SELECT   wwtt.user_task_type_id, bso.operation_code,
                  bso.operation_description, COUNT (*),
                  ROUND (SUM (wwtt.time_estimate), 1), p_time_uom,
                  ROUND (SUM (wwtt.display_weight), 1), p_weight_uom,
                  ROUND (SUM (wwtt.display_volume), 1), p_volume_uom,
                  wwtt.organization_id
             FROM wms_waveplan_tasks_temp wwtt, bom_standard_operations bso
            WHERE wwtt.RESULT IN ('X', 'Y', 'Z')
              AND wwtt.user_task_type_id = bso.standard_operation_id(+)
              AND wwtt.organization_id = bso.organization_id(+)
         GROUP BY wwtt.user_task_type_id,
                  bso.operation_code,
                  bso.operation_description,
                  wwtt.organization_id;
Line: 12668

         UPDATE wms_waveplan_tasks_temp
            SET RESULT = l_result (i),
                error = l_error (i)
          WHERE transaction_temp_id = l_transaction_temp_id (i)
            AND task_type_id = l_task_type_id (i);
Line: 12698

           SELECT transaction_temp_id
           INTO l_transaction_temp_id
           FROM wms_waveplan_tasks_temp
           WHERE parent_line_id = p_transaction_temp_table (i)
           AND status = 'Pending';
Line: 12757

            UPDATE wms_waveplan_tasks_temp
               SET is_modified = 'Y',
                   status_id = 12,
                   status = g_status_codes(12)
             WHERE transaction_temp_id = p_transaction_temp_table (i)
               AND x_ret_code (i) = fnd_api.g_ret_sts_success;
Line: 12765

	   DEBUG ('No of records updated are' || SQL%ROWCOUNT);
Line: 12769

            DELETE FROM wms_waveplan_tasks_temp
              WHERE parent_line_id = p_transaction_temp_table (j)
              AND   status_id        = 1
              AND x_ret_code (j)   = fnd_api.g_ret_sts_success;
Line: 12775

	   DEBUG ('No of records deleted are' || SQL%ROWCOUNT);
Line: 12815

     DELETE
	FROM wms_waveplan_tasks_temp  wwtt
	WHERE 1=1
	AND status_id =13
	AND  not exists
	  (SELECT 1
	  FROM wms_exceptions we, mtl_transaction_reasons mtr
	  WHERE we.reason_id = mtr.reason_id
			AND reason_context_code  = 'PN'
			AND  we.TASK_id = wwtt.transaction_temp_id
		 )         ;
Line: 12826

 debug('Delete Not Pick None tasks');
Line: 12867

l_insert_query         VARCHAR2 (3000);
Line: 12868

  l_select_generic       VARCHAR2 (4000);
Line: 12869

  l_select_outbound      VARCHAR2 (4000);
Line: 12890

l_insert_query := get_generic_insert (p_is_unreleased => false, p_is_pending => false, p_is_queued => false, p_is_dispatched => false, p_is_active => false, p_is_loaded => false, p_is_completed => false , p_is_picknone => l_is_picknone --ER13869750
        );
Line: 12892

l_insert_query       := l_insert_query || ') ';
Line: 12894

 debug('Entered into picknone select');
Line: 12895

    l_select_generic            := NULL;
Line: 12896

    l_select_generic            := 'SELECT ';
Line: 12897

    l_select_generic            := l_select_generic || 'null, ';                   -- expansion_code
Line: 12898

    l_select_generic            := l_select_generic || '''' || g_plan_task_types(4) || ''', ';
Line: 12899

   l_select_generic            := l_select_generic || 'wdth.transaction_temp_id, ';
Line: 12900

    l_select_generic            := l_select_generic || 'wdth.parent_transaction_id,';   --parent_line_id
Line: 12901

    l_select_generic            := l_select_generic || 'wdth.inventory_item_id, ';      --inventory_item_id
Line: 12902

    l_select_generic            := l_select_generic || 'msiv.concatenated_segments, ';  --item
Line: 12903

    l_select_generic            := l_select_generic || 'msiv.description, ';            --item description
Line: 12904

    l_select_generic            := l_select_generic || 'msiv.unit_weight, ';            --unit_weight
Line: 12905

    l_select_generic            := l_select_generic || 'msiv.weight_uom_code, ';        --weight_uom_code
Line: 12906

    l_select_generic            := l_select_generic || 'msiv.unit_volume, ';            --unit_volume
Line: 12907

    l_select_generic            := l_select_generic || 'msiv.volume_uom_code, ';        --volume_uom_code
Line: 12908

    l_select_generic            := l_select_generic || 'wdth.organization_id, ';        --organization_id
Line: 12909

    l_select_generic            := l_select_generic || 'wdth.revision, ';               --revision
Line: 12910

    l_select_generic            := l_select_generic || 'wdth.source_subinventory_code, ';     --subinventory
Line: 12911

    l_select_generic            := l_select_generic || 'wdth.source_locator_id, ';      --locator_id
Line: 12912

    l_select_generic            := l_select_generic || 'decode(milv.segment19, null, milv.concatenated_segments, null), '; --locator
Line: 12913

    l_select_generic            := l_select_generic || '13, ';                          --status_id
Line: 12914

    l_select_generic            := l_select_generic || '13, ';                          --status_id_original
Line: 12915

    l_select_generic            := l_select_generic || '''' || g_status_codes (13) || ''', ';  --status
Line: 12916

    l_select_generic            := l_select_generic || 'wdth.transaction_type_id, ';           --transaction_type_id
Line: 12917

    l_select_generic            := l_select_generic || 'wdth.transaction_action_id, ';         --transaction_action_id
Line: 12918

    l_select_generic            := l_select_generic || 'wdth.transaction_source_type_id, ';    --transaction_source_type_id
Line: 12920

      l_select_generic          := l_select_generic || 'mtst.transaction_source_type_name, '; --transaction_source_type
Line: 12922

    l_select_generic                 := l_select_generic || 'to_number(null), ';               --transaction_source_id
Line: 12923

    l_select_generic                 := l_select_generic || 'to_number(null), ';               --transaction_source_line_id
Line: 12924

    l_select_generic                 := l_select_generic || 'wdth.transfer_organization_id, '; --to_organization_id
Line: 12926

      l_select_generic               := l_select_generic || 'mp1.organization_code, '; --to_organization_id
Line: 12928

    l_select_generic       := l_select_generic || ' NVL(wdth.SUGGESTED_DEST_SUBINVENTORY,wdth.DEST_SUBINVENTORY_CODE) , '; --to_subinventory
Line: 12929

    l_select_generic       := l_select_generic || ' NVL(wdth.SUGGESTED_DEST_LOCATOR_ID,wdth.DEST_LOCATOR_ID) ,  ';         --'to_number(null),  ';    --to_locator_id
Line: 12931

      l_select_generic     := l_select_generic || ' null , ';
Line: 12933

    l_select_generic           := l_select_generic || 'wdth.transaction_UOM_CODE, ';       --jan28 'wdd.REQUESTED_QUANTITY_UOM, '   --transaction_uom
Line: 12934

    l_select_generic           := l_select_generic || 'wdth.transaction_QUANTITY, ';       --jan28  'wdd.REQUESTED_QUANTITY, '   --transaction_quantity
Line: 12935

    l_select_generic           := l_select_generic || 'wdth.user_task_type, '; --user_task_type_id
Line: 12937

      l_select_generic         := l_select_generic || 'bso.operation_code, '; --user_task_type
Line: 12939

    l_select_generic              := l_select_generic || 'to_number(null), ';          --move_order_line_id
Line: 12940

    l_select_generic              := l_select_generic || 'to_number(null), '; --pick_slip_number
Line: 12941

    l_select_generic              := l_select_generic || 'to_number(null), ';       --cartonization_id
Line: 12943

      l_select_generic            := l_select_generic || 'null, '; --cartonization_lpn
Line: 12945

    l_select_generic          := l_select_generic || 'to_number(null), '; --allocated_lpn_id
Line: 12947

      l_select_generic        := l_select_generic || 'null, ';
Line: 12949

    l_select_generic           := l_select_generic || 'to_number(null), '; --container_item_id
Line: 12951

      l_select_generic         := l_select_generic || 'null, ';
Line: 12953

    l_select_generic     := l_select_generic || 'wdth.lpn_id, '; --from_lpn_id
Line: 12955

      l_select_generic   := l_select_generic || 'to_number(null), '; --from_lpn
Line: 12957

    l_select_generic        := l_select_generic || 'to_number(null), '; --content_lpn_id
Line: 12959

      l_select_generic      := l_select_generic || 'to_number(null), '; --content_lpn
Line: 12961

    l_select_generic   := l_select_generic || 'wdth.transfer_lpn_id, '; --to_lpn_id
Line: 12963

      l_select_generic := l_select_generic || 'to_number(null), '; --to_lpn
Line: 12965

    l_select_generic           := l_select_generic || 'wdth.LAST_UPDATE_DATE, '; --mmt_last_update_date
Line: 12966

    l_select_generic           := l_select_generic || 'wdth.LAST_UPDATED_BY, ';  --mmt_last_updated_by
Line: 12967

    l_select_generic           := l_select_generic || 'wdth.priority, ';         --priority
Line: 12968

    l_select_generic           := l_select_generic || 'wdth.priority, ';         --priority_original
Line: 12969

    l_select_generic           := l_select_generic || 'wdth.task_type, ';        --task_type_id
Line: 12970

    l_select_generic     :=
	   l_select_generic
	   || 'decode(wdth.task_type,'
	   || '1, '''
	   || g_task_types (1)
	   || ''', 2, '''
	   || g_task_types (2)
	   || ''', 3, '''
	   || g_task_types (3)
	   || ''', 4, '''
	   || g_task_types (4)
	   || ''', 5, '''
	   || g_task_types (5)
	   || ''', 6, '''
	   || g_task_types (6)
	   || ''', 7, '''
	   || g_task_types (7)
	   || ''', 8, '''
	   || g_task_types (8)
	   || '''), ';
Line: 12990

    l_select_generic           := l_select_generic || 'wdth.CREATION_DATE, ';     --creation_time
Line: 12991

    l_select_generic           := l_select_generic || 'wdth.operation_plan_id, '; --operation_plan_id
Line: 12993

      l_select_generic         := l_select_generic || 'wop.operation_plan_name, '; --operation_plan
Line: 12996

      l_select_generic             := l_select_generic || 'to_number(null),  '; --operation_sequence
Line: 12999

    l_select_generic := l_select_generic || 'wdth.op_plan_instance_id,  '; --op_plan_instance_id
Line: 13002

    l_select_generic   := l_select_generic || 'wdth.task_id, ';   --task_id
Line: 13003

    l_select_generic   := l_select_generic || 'wdth.person_id, '; --person_id
Line: 13004

    l_select_generic   := l_select_generic || 'wdth.person_id, '; --person_id_original
Line: 13006

      l_select_generic := l_select_generic || 'pap.full_name, '; --person_id
Line: 13008

    l_select_generic            := l_select_generic || 'wdth.effective_start_date, '; --effective_start_date
Line: 13009

    l_select_generic            := l_select_generic || 'wdth.effective_end_date, ';   --effective_end_date
Line: 13010

    l_select_generic            := l_select_generic || 'wdth.person_resource_id, ';   --person_resource_id
Line: 13012

      l_select_generic          := l_select_generic || 'br1.resource_code, '; --person_resource_code
Line: 13014

    l_select_generic             := l_select_generic || 'wdth.machine_resource_id, '; --machine_resource_id
Line: 13016

      l_select_generic           := l_select_generic || 'br2.resource_code, '; --machine_resource_code
Line: 13018

    l_select_generic := l_select_generic || 'wdth.equipment_instance, '; --equipment_instance
Line: 13019

    l_select_generic := l_select_generic || 'wdth.dispatched_time, ';    --dispatched_time
Line: 13020

    l_select_generic := l_select_generic || 'wdth.loaded_time, ';        --loaded_time
Line: 13021

    l_select_generic := l_select_generic || 'wdth.drop_off_time, ';      --drop_off_time
Line: 13022

    l_select_generic := l_select_generic || 'to_date(null), ';           --wdt_last_update_date
Line: 13023

    l_select_generic := l_select_generic || 'to_number(null), ';         --wdt_last_updated_by
Line: 13025

    l_select_generic := l_select_generic || '''N'' , '; --is_modified    -- bug #5163661
Line: 13026

	l_select_generic := l_select_generic || ' null , ';
Line: 13027

	l_select_generic := l_select_generic || 'to_number(null) ';
Line: 13028

    debug('select for bulk picknone'||l_select_generic);
Line: 13221

 l_query := l_insert_query || l_select_generic || l_from_generic || l_where_generic ;