Wednesday, February 12, 2014

How to split comma separated string and pass to IN clause of select statement/ Create Comma Separated String using Select statement

SELECT   COLUMN_NAME
       , COLUMN_ID
    FROM DBA_TAB_COLUMNS
   WHERE TABLE_NAME = :P_TABLE_NAME
     AND OWNER = :P_OWNER
     AND COLUMN_NAME NOT IN (SELECT REGEXP_SUBSTR (:L_STRING
                                                     , '[^,]+'
                                                     , 1
                                                     , LEVEL
                                                      )
                                   FROM DUAL
                             CONNECT BY REGEXP_SUBSTR (:L_STRING
                                                     , '[^,]+'
                                                     , 1
                                                     , LEVEL
                                                      ) IS NOT NULL)
ORDER BY COLUMN_ID ASC

WHERE AS THE l_STRING CAN BE PASSED AS 'COLUMN1,COLUMN2,COLUMN3'

Use Below SQL to create comma separated string for multiple rows.
Limitations : The below SQL has String length Constraint. If the length of number of rows in a column getting converted into one row searating each other by using any separator, in that case the length should not exceed 2000 characters. 

SELECT SUBSTR(SYS_CONNECT_BY_PATH(''''||lookup_code||''''
                                    , ',')
                , 2)
              lookup_code
      FROM (SELECT lookup_code
                 , ROW_NUMBER() OVER (ORDER BY lookup_code) rownumber
                 , COUNT( *) OVER () cunt
              FROM fnd_lookup_values
             WHERE lookup_type = 'ITEM_TYPE'
               )
     WHERE rownumber = cunt
START WITH rownumber = 1

CONNECT BY rownumber = PRIOR rownumber + 1

How to Search a String for a LONG/CLOB datatype column

CREATE OR REPLACE FUNCTION apps.xx_search_long(
   p_obj_type                 IN             VARCHAR2
 , p_obj_name                 IN             VARCHAR2
 , p_owner                    IN             VARCHAR2
 , p_search_str               IN             VARCHAR2
)
   RETURN VARCHAR2
IS
   temporary_varchar                                 VARCHAR2(31000);
   v1                                                LONG;
   v_src_code                                        CLOB;
   v_length                                          NUMBER;
BEGIN
   BEGIN
      SELECT DBMS_METADATA.get_ddl(p_obj_type
                                 , p_obj_name
                                 , p_owner
                                  )
        INTO v_src_code
        FROM DUAL;
   EXCEPTION
      WHEN OTHERS
      THEN
         DBMS_OUTPUT.put_line('Exception : ' || SUBSTR(SQLERRM
                                                     , 1
                                                     , 150
                                                      ));
   END;
   v_length                                       := DBMS_LOB.getlength(v_src_code);
   DBMS_OUTPUT.put_line('Length of CLOB - ' || v_length);
   IF DBMS_LOB.INSTR(v_src_code
                   , p_search_str
                    ) > 0
   THEN
      DBMS_OUTPUT.put_line('Found ....');
      RETURN('FOUND');
   ELSE
      DBMS_OUTPUT.put_line('Not Found ....');
      RETURN('NOT FOUND');
   END IF;
EXCEPTION
   WHEN NO_DATA_FOUND
   THEN
      RETURN('NOT_FOUND');
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line('Error .' || SQLERRM);
      RETURN('EXCEPTION' || SUBSTR(SQLERRM
                                 , 1
                                 , 150
                                  ));
END;
/

Thursday, February 6, 2014

Sample Scripts to Convert the Rows into One Column with seperator

 SELECT header_id, RTRIM(EXTRACT(EXML,'//ordereditem/text()'),',') ORDERED_ITEM
   FROM (SELECT E.header_id,
          xmlelement("HDR",
              XMLAGG(xmlelement("ordereditem",E.ordered_item||',') ORDER BY ordered_item))EXML
   FROM oe_order_lines_all E
   where header_id= 278563
   GROUP BY E.header_id);
***************************************************************************
SELECT header_id, LTRIM( SYS_CONNECT_BY_PATH( ORDERED_ITEM, ',' ), ',' ) iTEM_STRING
      FROM (SELECT LINE_ID, HEADER_ID, ORDERED_ITEM, ROW_NUMBER( ) OVER (PARTITION BY HEADER_ID ORDER BY ROWNUM) RN
              FROM OE_ORDER_LINES_aLL
             WHERE header_id = 278563)
     WHERE CONNECT_BY_ISLEAF = 1
CONNECT BY HEADER_ID = PRIOR HEADER_ID
       AND RN = PRIOR RN + 1
START WITH rn = 1
  ORDER BY HEADER_ID;
***************************************************************************
SELECT   header_id
       , RTRIM(XMLAGG(XMLELEMENT(e
                               , ordered_item || ','
                                )).EXTRACT('//text()')
             , ','
              ) ordered_item
    FROM oe_order_lines_All
    where header_id = 278563
GROUP BY header_Id
***************************************************************************
SELECT     header_id
         , SUBSTR(SYS_CONNECT_BY_PATH(ordered_item
                                    , ','
                                     )
                , 2
                 ) name_list
      FROM (SELECT ordered_item
                 , header_id
                 , COUNT(*) OVER(PARTITION BY header_id) cnt
                 , ROW_NUMBER() OVER(PARTITION BY header_id ORDER BY ordered_item) seq
              FROM oe_order_lines_all
             WHERE header_id = 278563)
     WHERE seq = cnt
START WITH seq = 1
CONNECT BY PRIOR seq + 1 = seq
       AND PRIOR header_id = header_id;

Wednesday, January 22, 2014

Script to Calculate the Price and Tax details of the Product Line in the Service Contract and Update to the Service Contract.( oks_qp_int_pvt.compute_price)

Please use this Script Carefully as the API updates the values to the base tables.


DECLARE
   l_input_details                                   oks_qp_pkg.input_details;
   l_output_details                                  oks_qp_pkg.price_details;
   l_modif_details                                   qp_preq_grp.line_detail_tbl_type;
   l_pb_details                                      oks_qp_pkg.g_price_break_tbl_type;
   l_return_status                                   VARCHAR2(20);
   l_msg_count                                       NUMBER;
   l_msg_data                                        VARCHAR2(2000);
   l_status_tbl                                      oks_qp_int_pvt.pricing_status_tbl;
   l_final_status_tbl                                oks_qp_int_pvt.pricing_status_tbl;
   l_count                                           NUMBER;
   l_msg_index_out                                   NUMBER;
   l_num                                             NUMBER;
   l_error_message                                   VARCHAR2(2000);
BEGIN
   l_num                                          := 10;
   l_input_details.intent                         := 'SP';
--   l_input_details.lse_id                         := 1;
--   l_input_details.chr_id                         := 1549063;
--   l_input_details.line_id                        := 364326736554344799961890872824534166768;
   l_input_details.subline_id                     := 364326736554364142775004706891329465584; --364326736554353262442628175228757110000;
   l_num                                          := 20;
   oks_qp_int_pvt.compute_price(p_api_version                 => 1.0
                              , p_init_msg_list               => 'T'
                              , p_detail_rec                  => l_input_details
                              , x_price_details               => l_output_details
                              , x_modifier_details            => l_modif_details
                              , x_price_break_details         => l_pb_details
                              , x_return_status               => l_return_status
                              , x_msg_count                   => l_msg_count
                              , x_msg_data                    => l_msg_data
                               );
   l_num                                          := 30;

   IF l_return_status <> fnd_api.g_ret_sts_success
   THEN
      l_num                                          := 40;

      IF l_msg_count > 0
      THEN
         FOR i IN 1 .. l_msg_count
         LOOP
            l_num                                          := 50;
            apps.fnd_msg_pub.get(p_msg_index                   => i, p_encoded => fnd_api.g_false, p_data => l_msg_data
                               , p_msg_index_out               => l_msg_index_out);

            IF l_error_message IS NULL
            THEN
               l_error_message                                := SUBSTR(l_msg_data, 1, 250);
            ELSE
               l_error_message                                := l_error_message || ' /' || SUBSTR(l_msg_data, 1, 250);
            END IF;
         END LOOP;

         DBMS_OUTPUT.put_line('*****************************************');
         DBMS_OUTPUT.put_line('API Error : ' || l_error_message);
         DBMS_OUTPUT.put_line('*****************************************');
      ELSE
         apps.fnd_msg_pub.get(p_msg_index                   => 1, p_encoded => fnd_api.g_false, p_data => l_msg_data
                            , p_msg_index_out               => l_msg_index_out);
         DBMS_OUTPUT.put_line('*****************************************');
         DBMS_OUTPUT.put_line('API Error : ' || l_msg_data);
         DBMS_OUTPUT.put_line('*****************************************');
      END IF;
   ELSE
      l_num                                          := 60;
      DBMS_OUTPUT.put_line('API Success');
      DBMS_OUTPUT.put_line('Product Quantity : ' || l_output_details.prod_qty);
      DBMS_OUTPUT.put_line('Product Quantity UOM : ' || l_output_details.prod_qty_uom);
      DBMS_OUTPUT.put_line('Service Quantity : ' || l_output_details.serv_qty);
      DBMS_OUTPUT.put_line('Service Quantity UOM : ' || l_output_details.serv_qty_uom);
      DBMS_OUTPUT.put_line('Product Price List Id : ' || l_output_details.prod_price_list_id);
      DBMS_OUTPUT.put_line('Service Price List Id : ' || l_output_details.serv_price_list_id);
      DBMS_OUTPUT.put_line('Product Price List Line Id : ' || l_output_details.prod_price_list_line_id);
      DBMS_OUTPUT.put_line('Service Price List Line Id : ' || l_output_details.serv_price_list_line_id);
      DBMS_OUTPUT.put_line('Product List Unit Price : ' || l_output_details.prod_list_unit_price);
      DBMS_OUTPUT.put_line('Service List Unit Price : ' || l_output_details.serv_list_unit_price);
      DBMS_OUTPUT.put_line('Product Adjustment Unit Price : ' || l_output_details.prod_adj_unit_price);
      DBMS_OUTPUT.put_line('Service Adjustment Unit Price : ' || l_output_details.serv_adj_unit_price);
      DBMS_OUTPUT.put_line('Product Priced Quantity : ' || l_output_details.prod_priced_qty);
      DBMS_OUTPUT.put_line('Product Priced UOM : ' || l_output_details.prod_priced_uom);
      DBMS_OUTPUT.put_line('Product Extension Amount : ' || l_output_details.prod_ext_amount);
      DBMS_OUTPUT.put_line('Service Priced Quantity : ' || l_output_details.serv_priced_qty);
      DBMS_OUTPUT.put_line('Service Priced UOM : ' || l_output_details.serv_priced_uom);
      DBMS_OUTPUT.put_line('Service Extended Amount : ' || l_output_details.serv_ext_amount);
      DBMS_OUTPUT.put_line('Service OPerand : ' || l_output_details.serv_operand);
      DBMS_OUTPUT.put_line('Service Operator : ' || l_output_details.serv_operator);
      DBMS_OUTPUT.put_line('Status Code : ' || l_output_details.status_code);
      DBMS_OUTPUT.put_line('Status Text : ' || l_output_details.status_text);

      IF l_modif_details.COUNT > 0
      THEN
         l_num                                          := 70;

         FOR i IN l_modif_details.FIRST .. l_modif_details.LAST
         LOOP
            l_num                                          := 80;
            DBMS_OUTPUT.put_line('List Price : ' || l_modif_details(i).list_price);
         END LOOP;
      END IF;

      l_num                                          := 90;

      IF l_pb_details.COUNT > 0
      THEN
         l_num                                          := 100;

         FOR i IN l_pb_details.FIRST .. l_pb_details.LAST
         LOOP
            l_num                                          := 110;
            DBMS_OUTPUT.put_line('Price Break List Price : ' || l_pb_details(i).list_price);
         END LOOP;
      END IF;
   END IF;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line(l_num || ' Unexpected Error : ' || SUBSTR(SQLERRM, 1, 250));
END;

Script to Calculate the Tax details of the Product Line in the Service Contract(apps.oks_tax_util_pvt.get_tax)


DECLARE
   p_chr_id                                          NUMBER;
   p_cle_id                                          NUMBER;
   x_rail_rec                                        apps.oks_tax_util_pvt.ra_rec_type;
   l_return_status                                   VARCHAR2(20);
   l_msg_count                                       NUMBER;
   l_msg_data                                        VARCHAR2(2000);
   l_msg_index_out                                   NUMBER;
   l_error_message                                   VARCHAR2(2000);
   l_num                                             NUMBER;
BEGIN
   p_chr_id                                       := 1549063;
   p_cle_id                                       := 364326736554364142775004706891329465584;
   apps.oks_tax_util_pvt.get_tax(p_api_version                 => 1.0
                               , p_init_msg_list               => fnd_api.g_false
                               , p_chr_id                      => p_chr_id
                               , p_cle_id                      => p_cle_id
                               , px_rail_rec                   => x_rail_rec
                               , x_msg_count                   => l_msg_count
                               , x_msg_data                    => l_msg_data
                               , x_return_status               => l_return_status
                                );

   IF l_return_status <> fnd_api.g_ret_sts_success
   THEN
      l_num                                          := 40;

      IF l_msg_count > 0
      THEN
         FOR i IN 1 .. l_msg_count
         LOOP
            l_num                                          := 50;
            apps.fnd_msg_pub.get(p_msg_index                   => i, p_encoded => fnd_api.g_false, p_data => l_msg_data
                               , p_msg_index_out               => l_msg_index_out);

            IF l_error_message IS NULL
            THEN
               l_error_message                                := SUBSTR(l_msg_data, 1, 250);
            ELSE
               l_error_message                                := l_error_message || ' /' || SUBSTR(l_msg_data, 1, 250);
            END IF;
         END LOOP;

         DBMS_OUTPUT.put_line('*****************************************');
         DBMS_OUTPUT.put_line('API Error : ' || l_error_message);
         DBMS_OUTPUT.put_line('*****************************************');
      ELSE
         apps.fnd_msg_pub.get(p_msg_index                   => 1, p_encoded => fnd_api.g_false, p_data => l_msg_data
                            , p_msg_index_out               => l_msg_index_out);
         DBMS_OUTPUT.put_line('*****************************************');
         DBMS_OUTPUT.put_line('API Error : ' || l_msg_data);
         DBMS_OUTPUT.put_line('*****************************************');
      END IF;
   ELSE
      l_num                                          := 60;
      DBMS_OUTPUT.put_line('*******************************************************************************************************');
      DBMS_OUTPUT.put_line('API Success');
      DBMS_OUTPUT.put_line('Header Id : ' || x_rail_rec.header_id);
      DBMS_OUTPUT.put_line('Line Id : ' || x_rail_rec.line_id);
      DBMS_OUTPUT.put_line('Tax Exempt Flag : ' || x_rail_rec.tax_exempt_flag);
      DBMS_OUTPUT.put_line('Tax exempt reason : ' || x_rail_rec.tax_exempt_reason);
      DBMS_OUTPUT.put_line('Tax exempt number : ' || x_rail_rec.tax_exempt_number);
      DBMS_OUTPUT.put_line('Sales Tax ID : ' || x_rail_rec.sales_tax_id);
      DBMS_OUTPUT.put_line('Org Id : ' || x_rail_rec.org_id);
      DBMS_OUTPUT.put_line('Orig_system_ship_address_id : ' || x_rail_rec.orig_system_ship_address_id);
      DBMS_OUTPUT.put_line('Orig_system_ship_contact_id : ' || x_rail_rec.orig_system_ship_contact_id);
      DBMS_OUTPUT.put_line('ORIG_SYSTEM_SHIP_CUSTOMER_I : ' || x_rail_rec.orig_system_ship_customer_id);
      DBMS_OUTPUT.put_line('SHIP_TO_SITE_USE_ID         : ' || x_rail_rec.ship_to_site_use_id);
      DBMS_OUTPUT.put_line('SHIP_TO_POSTAL_CODE         : ' || x_rail_rec.ship_to_postal_code);
      DBMS_OUTPUT.put_line('SHIP_TO_LOCATION_ID         : ' || x_rail_rec.ship_to_location_id);
      DBMS_OUTPUT.put_line('SHIP_TO_CUSTOMER_NUMBER     : ' || x_rail_rec.ship_to_customer_number);
      DBMS_OUTPUT.put_line('SHIP_TO_CUSTOMER_NAME       : ' || x_rail_rec.ship_to_customer_name);
      DBMS_OUTPUT.put_line('SHIP_TO_ORG_ID              : ' || x_rail_rec.ship_to_org_id);
      DBMS_OUTPUT.put_line('WAREHOUSE_ID                : ' || x_rail_rec.warehouse_id);
      DBMS_OUTPUT.put_line('ORIG_SYSTEM_SOLD_CUSTOMER_I : ' || x_rail_rec.orig_system_sold_customer_id);
      DBMS_OUTPUT.put_line('ORIG_SYSTEM_BILL_CUSTOMER_I : ' || x_rail_rec.orig_system_bill_customer_id);
      DBMS_OUTPUT.put_line('ORIG_SYSTEM_BILL_ADDRESS_ID : ' || x_rail_rec.orig_system_bill_address_id);
      DBMS_OUTPUT.put_line('ORIG_SYSTEM_BILL_CONTACT_ID : ' || x_rail_rec.orig_system_bill_contact_id);
      DBMS_OUTPUT.put_line('BILL_TO_SITE_USE_ID         : ' || x_rail_rec.bill_to_site_use_id);
      DBMS_OUTPUT.put_line('BILL_TO_POSTAL_CODE         : ' || x_rail_rec.bill_to_postal_code);
      DBMS_OUTPUT.put_line('BILL_TO_LOCATION_ID         : ' || x_rail_rec.bill_to_location_id);
      DBMS_OUTPUT.put_line('BILL_TO_CUSTOMER_NUMBER     : ' || x_rail_rec.bill_to_customer_number);
      DBMS_OUTPUT.put_line('BILL_TO_CUSTOMER_NAME       : ' || x_rail_rec.bill_to_customer_name);
      DBMS_OUTPUT.put_line('BILL_TO_ORG_ID              : ' || x_rail_rec.bill_to_org_id);
      DBMS_OUTPUT.put_line('RECEIPT_METHOD_NAME         : ' || x_rail_rec.receipt_method_name);
      DBMS_OUTPUT.put_line('RECEIPT_METHOD_ID           : ' || x_rail_rec.receipt_method_id);
      DBMS_OUTPUT.put_line('CONVERSION_TYPE             : ' || x_rail_rec.conversion_type);
      DBMS_OUTPUT.put_line('CONVERSION_DATE             : ' || x_rail_rec.conversion_date);
      DBMS_OUTPUT.put_line('CONVERSION_RATE             : ' || x_rail_rec.conversion_rate);
      DBMS_OUTPUT.put_line('CUSTOMER_TRX_ID             : ' || x_rail_rec.customer_trx_id);
      DBMS_OUTPUT.put_line('TRX_DATE                    : ' || x_rail_rec.trx_date);
      DBMS_OUTPUT.put_line('GL_DATE                     : ' || x_rail_rec.gl_date);
      DBMS_OUTPUT.put_line('DOCUMENT_NUMBER             : ' || x_rail_rec.document_number);
      DBMS_OUTPUT.put_line('TRX_NUMBER                  : ' || x_rail_rec.trx_number);
      DBMS_OUTPUT.put_line('LINE_NUMBER                 : ' || x_rail_rec.line_number);
      DBMS_OUTPUT.put_line('QUANTITY                    : ' || x_rail_rec.quantity);
      DBMS_OUTPUT.put_line('QUANTITY_ORDERED            : ' || x_rail_rec.quantity_ordered);
      DBMS_OUTPUT.put_line('UNIT_SELLING_PRICE          : ' || x_rail_rec.unit_selling_price);
      DBMS_OUTPUT.put_line('UNIT_STANDARD_PRICE         : ' || x_rail_rec.unit_standard_price);
      DBMS_OUTPUT.put_line('PRINTING_OPTION             : ' || x_rail_rec.printing_option);
      DBMS_OUTPUT.put_line('INVENTORY_ITEM_ID           : ' || x_rail_rec.inventory_item_id);
      DBMS_OUTPUT.put_line('INVENTORY_ORG_ID            : ' || x_rail_rec.inventory_org_id);
      DBMS_OUTPUT.put_line('UOM_CODE                    : ' || x_rail_rec.uom_code);
      DBMS_OUTPUT.put_line('UOM_NAME                    : ' || x_rail_rec.uom_name);
      DBMS_OUTPUT.put_line('RELATED_TRX_NUMBER          : ' || x_rail_rec.related_trx_number);
      DBMS_OUTPUT.put_line('RELATED_CUSTOMER_TRX_ID     : ' || x_rail_rec.related_customer_trx_id);
      DBMS_OUTPUT.put_line('PREVIOUS_CUSTOMER_TRX_ID    : ' || x_rail_rec.previous_customer_trx_id);
      DBMS_OUTPUT.put_line('REASON_CODE                 : ' || x_rail_rec.reason_code);
      DBMS_OUTPUT.put_line('TAX_RATE                    : ' || x_rail_rec.tax_rate);
      DBMS_OUTPUT.put_line('TAX_CODE                    : ' || x_rail_rec.tax_code);
      DBMS_OUTPUT.put_line('TAX_PRECEDENCE              : ' || x_rail_rec.tax_precedence);
      DBMS_OUTPUT.put_line('INVOICING_RULE_NAME         : ' || x_rail_rec.invoicing_rule_name);
      DBMS_OUTPUT.put_line('INVOICING_RULE_ID           : ' || x_rail_rec.invoicing_rule_id);
      DBMS_OUTPUT.put_line('PURCHASE_ORDER              : ' || x_rail_rec.purchase_order);
      DBMS_OUTPUT.put_line('SET_OF_BOOKS_ID             : ' || x_rail_rec.set_of_books_id);
      DBMS_OUTPUT.put_line('LINE_TYPE                   : ' || x_rail_rec.line_type);
      DBMS_OUTPUT.put_line('DESCRIPTION                 : ' || x_rail_rec.description);
      DBMS_OUTPUT.put_line('CURRENCY_CODE               : ' || x_rail_rec.currency_code);
      DBMS_OUTPUT.put_line('AMOUNT                      : ' || x_rail_rec.amount);
      DBMS_OUTPUT.put_line('CUST_TRX_TYPE_NAME          : ' || x_rail_rec.cust_trx_type_name);
      DBMS_OUTPUT.put_line('CUST_TRX_TYPE_ID            : ' || x_rail_rec.cust_trx_type_id);
      DBMS_OUTPUT.put_line('PAYMENT_TERM_ID             : ' || x_rail_rec.payment_term_id);
      DBMS_OUTPUT.put_line('AMOUNT_INCLUDES_TAX_FLAG    : ' || x_rail_rec.amount_includes_tax_flag);
      DBMS_OUTPUT.put_line('TAX_CAL_PLSQL_BLOCK         : ' || x_rail_rec.tax_cal_plsql_block);
      DBMS_OUTPUT.put_line('MINIMUM_ACCOUNTABLE_UNIT    : ' || x_rail_rec.minimum_accountable_unit);
      DBMS_OUTPUT.put_line('PRECISION                   : ' || x_rail_rec.PRECISION);
      DBMS_OUTPUT.put_line('FOB_POINT                   : ' || x_rail_rec.fob_point);
      DBMS_OUTPUT.put_line('TAXABLE_BASIS               : ' || x_rail_rec.taxable_basis);
      DBMS_OUTPUT.put_line('VAT_TAX_ID                  : ' || x_rail_rec.vat_tax_id);
      DBMS_OUTPUT.put_line('TAX_VALUE                   : ' || x_rail_rec.tax_value);
      DBMS_OUTPUT.put_line('TOTAL_PLUS_TAX              : ' || x_rail_rec.total_plus_tax);
      DBMS_OUTPUT.put_line('*******************************************************************************************************');
   END IF;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line(l_num || ' Unexpected Error : ' || SUBSTR(SQLERRM, 1, 250));
END;

Output for the above Script.

=====================================

*******************************************************************************************************
API Success
Header Id : 1549063
Line Id : 364326736554364142775004706891329465584
Tax Exempt Flag : S
Tax exempt reason :
Tax exempt number :
Sales Tax ID :
Org Id : 102
Orig_system_ship_address_id : 326265
Orig_system_ship_contact_id :
ORIG_SYSTEM_SHIP_CUSTOMER_I : 2043938
SHIP_TO_SITE_USE_ID         : 401915
SHIP_TO_POSTAL_CODE         : 98031
SHIP_TO_LOCATION_ID         : 2143
SHIP_TO_CUSTOMER_NUMBER     :
SHIP_TO_CUSTOMER_NAME       :
SHIP_TO_ORG_ID              : 102
WAREHOUSE_ID                :
ORIG_SYSTEM_SOLD_CUSTOMER_I : 491186
ORIG_SYSTEM_BILL_CUSTOMER_I : 491186
ORIG_SYSTEM_BILL_ADDRESS_ID : 72442
ORIG_SYSTEM_BILL_CONTACT_ID :
BILL_TO_SITE_USE_ID         : 101790
BILL_TO_POSTAL_CODE         : 80112
BILL_TO_LOCATION_ID         : 2870
BILL_TO_CUSTOMER_NUMBER     :
BILL_TO_CUSTOMER_NAME       :
BILL_TO_ORG_ID              : 102
RECEIPT_METHOD_NAME         :
RECEIPT_METHOD_ID           :
CONVERSION_TYPE             :
CONVERSION_DATE             : 22-JAN-14
CONVERSION_RATE             :
CUSTOMER_TRX_ID             :
TRX_DATE                    :
GL_DATE                     :
DOCUMENT_NUMBER             :
TRX_NUMBER                  :
LINE_NUMBER                 :
QUANTITY                    : 1
QUANTITY_ORDERED            :
UNIT_SELLING_PRICE          : 5500.53
UNIT_STANDARD_PRICE         :
PRINTING_OPTION             :
INVENTORY_ITEM_ID           : 109135
INVENTORY_ORG_ID            : 103
UOM_CODE                    : Ea
UOM_NAME                    :
RELATED_TRX_NUMBER          :
RELATED_CUSTOMER_TRX_ID     :
PREVIOUS_CUSTOMER_TRX_ID   
REASON_CODE                 :
TAX_RATE                    : 0
TAX_CODE                    : Sales Tax
TAX_PRECEDENCE              :
INVOICING_RULE_NAME         :
INVOICING_RULE_ID           :
PURCHASE_ORDER              :
SET_OF_BOOKS_ID             : 1002
LINE_TYPE                   :
DESCRIPTION                 :
CURRENCY_CODE               : USD
AMOUNT                      : 2712.590136812997
CUST_TRX_TYPE_NAME          :
CUST_TRX_TYPE_ID            : 1005
PAYMENT_TERM_ID             :
AMOUNT_INCLUDES_TAX_FLAG    : N
TAX_CAL_PLSQL_BLOCK         :
MINIMUM_ACCOUNTABLE_UNIT    :
PRECISION                   : 2
FOB_POINT                   :
TAXABLE_BASIS               :
VAT_TAX_ID                  : 10094
TAX_VALUE                   : 0
TOTAL_PLUS_TAX              : 2712.590136812997
*******************************************************************************************************