Professional Documents
Culture Documents
docx
Author: XXXX Creation Date: 7/30/2009 Last Updated: 8/12/2009 Version: 1.0
60368175.docx
Author XXXXXX
Version 1.0
Note: All sections should be completed. If the section contains no information, indicate None.
Reviewers
60368175.docx
2.
3.
Miscellaneous ................................................................................................................ 38
3.1. Report........................................................................................................................................... 38 3.2. Test Cases ................................................................................................................................... 40 3.3. Access/Frequency ........................................................................................................................ 41
60368175.docx
XXXXX Confidential
Page 3 of 57
60368175.docx
4.
4.1. Code Location............................................................................................................................... 42 4.2. Group Members ............................................................................................................................ 42 4.3. Caveats ........................................................................................................................................ 42 4.4. Security Considerations ................................................................................................................ 42 4.5. Privacy Considerations ................................................................................................................. 42 4.6. Logging Plan................................................................................................................................. 42 4.7. Testing Plan.................................................................................................................................. 42 4.8. Monitoring Plan ............................................................................................................................. 42 4.9. Internationalization Plan ................................................................................................................ 42 4.10. Billing and Tax Plan ...................................................................................................................... 42 4.11. Documentation Plan...................................................................................................................... 42 4.12. Work Estimates............................................................................................................................. 42 4.13. Launch Plans ................................................................................................................................ 42 4.14. Potential Plans .............................................................................................................................. 42
5. 6. 7. 8.
Risks ............................................................................................................................... 42 Issues ............................................................................................................................. 43 Appendix A: XXXX Transactions Pseudo SQL Statements .................................... 45 Appendix B: XXXX Transactions Pseudo SQL Statements .................................... 54
60368175.docx
60368175.docx
2.
3.
60368175.docx
XXDEST_AR_IMS_COMP_ENTITY_MAP
, which maps XXXXX Operating Units to XXXX Operating Units to pull appropriate data from XXXX. Please refer Section 2.8 of this TDD for details on the mapping lookup. 4. p_to_org Parameter Name: To Entity Value Set: XXDEST_OPERATING_UNITS Default: Since this is a mandatory parameter, for XXXX Transactions, the To Entity will be populated with same value for From Entity. The program will use the new lookup type, Y Y
XXDEST_AR_IMS_COMP_ENTITY_MAP
, which maps XXXXX Operating Units to XXXX Operating Units to pull appropriate data from XXXX. 5. p_batch_sourc e Parameter Name: Batch Source Value Set: DEST_AR_BATCH_SOURCES Default: As per FSD, Section 3.4, DEST_XXXX_CONV is the new batch source defined for XXXX AR transactions conversions. 6. p_source Parameter Name: Source Value Set: 10 Characters Default: XXXX will be the source for XXXX AR transactions conversions. 7. p_load Parameter Name: Load Value Set: DEST_YES_NO Default: If Y data will be extracted from XXXX tables via DB link @DCOFDEV1.US.ORACLE.COM, and populated in staging tables. If N data will Not be extracted from XXXX tables, but existing records will be re-processed again. The re-loading of XXXX data is also controlled by: a) Profile - 'XXXXX AR Transaction Conv' b) Code also verifies duplicates before inserting same Transaction/Receipts applications into staging table 8. p_trx Parameter Name: Transaction Type Value Set: 10 Characters Y Y Y Y Y Y Y Y
60368175.docx
Default: INV Possible values are INV, CM and DM. This is used for processing only not for loading. This parameter is ignored for loading. For XXXX Conversions, code will accept a value ALL to process all transaction types in a single run 9. p_process Parameter Name: Process Value Set: 1 char Default: Possible values are I and E. This matches to STATUS column in staging table. If I then new records are processed. If E then re-process error records. After successful processing, the STATUS column in the staging tables will be updated to P. These records cannot be processed again 10. p_gl_date Parameter Name: GL Date Value Set: FND_STANDARD_DATE Default: For XXXX conversions, this will be 01-FEB-10 as per FSD, Section 2.5 11. p_account Parameter Name: Unearn Account Value Set: Unearn Account Default: 22130 This is a mandatory parameter for Scott Studio conversions. For XXXX conversions, this parameter will be ignored. Y Y Y Y Y Y
2. The following are the parameters for custom concurrent program XXXXX AR Transactions PostConversion: S. Parameter Description Required Display No. Parameter Name: Source 1. p_source Y Y Value Set: 10 Characters Default: XXXX will be the source for XXXX AR transactions conversions. Parameter Name: Process Value Set: 1 char Default:
2.
p_process
60368175.docx
Possible values are P and ADJ-E. This matches to INTERFACE_STATUS column in staging table XXDEST.XXDEST_AR_TRXS_CONV If P then new records are processed. If ADJ-E then re-process error records. After successful processing, the STATUS column in the staging tables will be updated to ADJ-P. These records cannot be processed again 3. p_gl_date Parameter Name: GL Date Value Set: FND_STANDARD_DATE Default: For XXXX conversions, this will be 01-FEB-10 as per FSD, Section 2.5. Y Y
60368175.docx
Above executable calls Main PL/SQL procedure xxdest_ar_transaction_conv.import_main_prc. Based on the value for Batch source parameter (for XXXX it is DEST_XXXX_CONV), the procedure will invoke xxdest_ar_transaction_conv.import_main_XXXX
PL/SQL procedure does the following: y Main procedure is xxdest_ar_transaction_conv.import_main_XXXX. This does the following: y Checks if Profile 'XXXXX AR Transaction Conv' is set to Yes for the responsibility or not. User has to set this profile to Yes every time before running the conversion. This is to ensure data is not re-loaded again and again. However, code also has checks to ensure duplicates are not loaded. Call Initialize Global Initialize global variables like GL date, Source and User id. It also derives values XXXX Operating Units based on parameter From Org id, XXXXX Operating Unit for To Org id, Set of Books ID etc If load parameter is Y then call, a) xxdest_ar_transaction_conv.load_XXXX_trx_pmt_appl_data procedure b) xxdest_ar_transaction_conv.load_XXXX_trx_data procedure DXXXXX is on Oracle database and has Oracle Applications. So XXXX conversion data is pulled into XXXXX OF via database link. The pull is initiated from XXXXX OF only. There is no file transfer mechanism, for this conversion, between XXXX OF and XXXXX OF. A new database link @DCOFDEV1.US.ORACLE.COM is setup in XXXXX OF to pull data from XXXX OF tables. y load_XXXX_trx_pmt_appl_data procedure uses DB link to pull XXXX Receivable applications data for conversion-eligible XXXX Transactions/Receipts. The procedure will also extract partial conversion Transactions/Receipts. Both data are populated into staging table XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV. Check for duplicates is made before inserting data into staging table, based on columns SOURCE (source = XXXX), PAYMENT_SCHEDULE_ID and RECEIVABLE_APPLICATION_ID. The data in above table is the source for loading Transaction Headers/Lines into staging table XXDEST.XXDEST_AR_TRXS_CONV as explained below. y load_XXXX_trx_data procedure gets all the distinct transactions from the staging table XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV. For each of these transactions, uses DB link to pull XXXX Transaction Headers and Lines and populates into Transactions staging table XXDEST.XXDEST_AR_TRXS_CONV. Check for duplicates is made before inserting data into table, based on columns SOURCE (source = XXXX), CUSTOMER_TRX_D and CUSTOMER_TRX_LINE_ID. For each record, the initial value for column INTERFACE_STATUS = I.
60368175.docx
The PROCESS_TYPE column in this table will have the value FULL CONVERSION or PARTIAL CONVERSION to indicate if the Transaction(s) must be converted fully or partially as per requirements stated in FSD. Partial Conversion Transactions will be converted exactly like a full invoice and the amount will then adjusted downward to the partial conversion amount via a separate concurrent program XXXXX AR Transactions Post-Conversion y The concurrent program is called with parameter I or E. Based on value I or E, it will process records new records (I) or re-process error records (E) respectively, regardless of PROCESS_TYPE. Header Cursor cur_process_ra_trx will get each Transaction Header from staging table XXDEST.XXDEST_AR_TRXS_CONV, for source = XXXX based on source systems (XXXX) CUSTOMER_TRX_ID. Initialize record types ra_interface_lines_all%ROWTYPE, ra_interface_salescredits_all%ROWTYPE and ra_interface_distributions_all%ROWTYPE. Also local variables like - status and global variables like error code etc. Define Save Point rec_process_trx for each transaction Header, so that in case even if any line for a transaction fails, the entire transaction is rolled back to the Save Point. And all the lines for the Transaction is updated to E (error). For each Transaction Header convert XXXX Batch Source and Transaction Type to XXXXX batch Source and appropriate transaction type. As per FSD, Section 2.5, based on Class (INV, CM and DM) and status (OP or CL), the following is used: Transaction Class INV, DM INV, DM CM CM y Status Closed Open Closed Open XXXXX Transaction Type DC-CONVINV-CL DC-CONVINV-OP DC-CONVCM-CL DC-CONVCM-OP
Lines Cursor cur_process_trx will get the Transaction lines for each XXXX transaction header from staging table XXDEST.XXDEST_AR_TRXS_CONV, based on source systems (XXXX) CUSTOMER_TRX_ID. For each of the lines the following are populated: TRANSACTION HEADER/LINES - LINE/TAX: o For each transaction line - derive/populate data elements for the local record type variable, rail_line_rec, needed to insert record into standard Invoice Interface table RA_INTERFACE_LINES_ALL o Call Set_Transaction_Info: This procedure will populate XXXX transaction info like transaction number, date, currency code, Payment terms, transaction comments and Transaction-level DFF attribute values etc, into local Record Type variable rail_line_rec o Call Set_Customer_Info: Derive converted XXXXX customer for the given XXXX transaction customer. Get corresponding XXXXX BILL_TO and SHIP_TO site/contact information for current XXXX transaction. o Call Set_Salesrep: Derive converted XXXXX Sales rep in target operating unit for the XXXX Sales representative in XXXX transaction.
60368175.docx
Call Set_Line_Info: Derive all line level information like line number, line type, item id, unit of measure, description, quantity, unit selling price, amount, line-level DFF attribute values etc. Note: As per FSD, 2.4.2, XXXX Tax lines will be imported as LINE_TYPE = LINE. The inventory item used for tax is TADS00127
Populate local record type variable, rail_line_rec into RA_INTERFACE_LINES_ALL table by invoking existing generic procedure DEST_invoice_interface.createrail
SALES CREDITS: o Open cursor cur_salesrep for each transaction line, to get XXXX Sales Credit record(s) for a given transaction line. o Assign line transaction Flex field values to Sales credit DFF columns. Capture info in local record type variable, rail_scredit_rec o Invoke procedure set_sales_credit_salesrep, to get converted XXXXX Sales person(s) for the given XXXX Sales person(s), based on amount or percentage split. Also get the sales credit type name. o Populate local record type variable, rail_scredit_rec into RA_INTERFACE_SALESCREDITS_ALL table by invoking existing generic procedure DEST_invoice_interface.createrais. DISTRIBUTIONS - TAX/REV: o Call Set_Account_Info: Over-loaded procedure will populate Revenue account distribution for each transaction line. The Receivables account will be automatically populated by Auto accounting. Since TAX line is converted as LINE, there is no separate TAX distribution that is populated. The accounting info is populated as per FSD, Section 2.5: Account Type Receivable Revenue Tax o o Value Automatically populated by Auto accounting (01 or 32).11112.000.000.E10.0000.0000 (01 or 32).11112.000.000.E10.0000.0000
For each XXXX transaction line, assign line transaction values to local record type variables - rail_Rev_dist_rec. Invoke procedures set_Rev_dists to fill-in the above record type variables with Account Class of REV, the line transaction flex field values, seven-segment account value given above etc. Populate the Revenue distribution records into the AR Invoice interface table RA_INTERFACE_DISTRIBUTIONS_ALL table by re-using existing procedure used for XXXXX-IMS interface, XXDEST_AR_DC_INVOICE_LOAD_PKG.p_insert_distribution.
In case of any validation failure, the entire transaction will be rolled back and error messages are captured in existing custom error table XXDEST.XXDEST_AR_TRX_ERROR_LOG. In case of any errors, the record(s) for the transaction will be updated in the staging table, with Status = E (error). These can be reprocessed after any needed data fix.
60368175.docx
When all the records for the transaction have been processed successfully, the records will be updated with Status = P (processed). Run Auto Invoice Master Program for the specific entity. This will create the converted XXXX invoices in XXXXX AR. Run the concurrent program XXXXX AR Transactions Post-Conversion, to create adjustments for Full and Partial converted XXXX invoices.
Sequence
XXDEST_AR_TRXS_PMTS_APP_CONV_ S XXDEST.XXDEST_AR_TRXS_CONV
Table
Sequence Procedur e
Stores XXXX Transaction Headers/Lines that are eligible for conversion. This provides audit of converted XXXX AR Transactions data. Sequence to generate unique value for RECORD_ID column of table, XXDEST_AR_TRXS_CONV Re-use Packaged procedure created for XXXXX-IMS interface (XXXX Conversion Project), to insert distributions into standard invoice interface table, RA_INTERFACE_DISTRIBUTIONS
60368175.docx
3 4 5 6 7
Proposed additional columns 8 9 SOURCE (New column) OWNER_TABLE_NAME (New column) VARCHAR2(1000) VARCHAR2(30) Use XXXX for XXXX conversions 1. For Scott Studios, it is staging table, XXDEST_AR_TRX_IFACE. 2. For XXXX: it is staging table, XXDEST_AR_TRXS_CONV
b) Table: XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV This table stores receivable applications history for XXXX AR Transactions and Receipts that are eligible for conversion. This table provides audit of XXXX Transactions/Receipts applications data. S. No. 1 2 3 4 5 6 7 Column
RECORD_ID SOURCE CUSTOMER_ID ORIG_SYS_CUSTOMER_REF RECEIVABLE_APPLICATION_ID CLASS SRC_ORG_ID
Type
NUMBER VARCHAR2(100 BYTE) NUMBER VARCHAR2 (240 Byte) NUMBER VARCHAR2(30 BYTE) NUMBER
Description Unique key. Generated from sequence. Use XXXX for XXXX conversion errors. XXXX Customer ID XXXX Customer Reference
60368175.docx
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
SRC_ENTITY PAYMENT_SCHEDULE_ID CUSTOMER_TRX_ID TRX_NUMBER CASH_RECEIPT_ID RECEIPT_NUMBER STATUS TRX_CURRENCY_CODE PMT_CURRENCY_CODE AMOUNT_DUE_ORIGINAL AMOUNT_DUE_REMAINING INV_TO_FUNC_CURR_RATE GL_DATE AMOUNT_APPLIED AMOUNT_ADJUSTED AMOUNT_CREDITED AMOUNT_IN_DISPUTE APPLICATION_TYPE APPLIED_PAYMENT_SCHEDULE_ID APP_CLASS APP_STATUS APP_CUSTOMER_TRX_ID APP_TRX_NUMBER APP_CASH_RECEIPT_ID APP_RECEIPT_NUMBER ARA_AMOUNT_APPLIED APPLIED_CURRENCY_CODE ARA_TRANS_TO_RECEIPT_RATE ARA_AMOUNT_APPLIED_FROM ARA_APPLY_DATE ARA_APP_STATUS ARA_APP_GL_DATE PROCESS_STATUS
VARCHAR2(240 BYTE) NUMBER NUMBER VARCHAR2 NUMBER VARCHAR2 VARCHAR2 VARCHAR2 VARCHAR2 NUMBER NUMBER NUMBER DATE NUMBER NUMBER NUMBER NUMBER VARCHAR2(30 BYTE) NUMBER VARCHAR2(30 BYTE) VARCHAR2(30 BYTE) NUMBER VARCHAR2(30 BYTE) NUMBER VARCHAR2(30 BYTE) NUMBER VARCHAR2(3 BYTE) NUMBER NUMBER DATE VARCHAR2(30 BYTE) DATE VARCHAR2(10)
e.g. I, P, E, IP I is initial status, when record is populated from XXXX OF tables If record(s) are for Invoice: if invoice gets created successfully in XXXXX OF and all its applications are completed, status is updated to P If record(s) are for Payments: if Payment gets created in XXXXX OF and all its applications are completed, status is updated to P If Invoice or receipts have errors while processing, status will be set to E
60368175.docx
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ERROR_MESSAGE
VARCHAR2(4000)
If all applications for a Transaction/Receipt are not completed then status is set to IP Any errors encountered while processing records in this table are captured
CREATION_DATE CREATED_BY LAST_UPDATE_DATE LAST_UPDATED_BY DEST_RECV_APPLICATION_ID DEST_PAYMENT_SCHEDULE_ID DEST_CUSTOMER_TRX_ID DEST_CASH_RECEIPT_ID DEST_RECEIPT_NUMBER DEST_APP_CUSTOMER_TRX_ID DEST_APP_TRX_NUMBER DEST_APP_CASH_RECEIPT_ID DEST_APP_RECEIPT_NUMBER DEST_ARA_AMOUNT_APPLIED DEST_APPLIED_CURRENCY_CODE DEST_ARA_APPLY_DATE DEST_ARA_APP_STATUS DEST_ARA_APP_GL_DATE ATTRIBUTE_CATEGORY ATTRIBUTE1 ATTRIBUTE2 ATTRIBUTE3 ATTRIBUTE4 ATTRIBUTE5 ATTRIBUTE6 ATTRIBUTE7 ATTRIBUTE8 ATTRIBUTE9 ATTRIBUTE10 ATTRIBUTE11 ATTRIBUTE12 ATTRIBUTE13 ATTRIBUTE14 ATTRIBUTE15
DATE NUMBER DATE NUMBER NUMBER NUMBER NUMBER NUMBER VARCHAR2(30 BYTE) NUMBER VARCHAR2(30 BYTE) NUMBER VARCHAR2(30 BYTE) NUMBER VARCHAR2(3 BYTE) DATE VARCHAR2(30 BYTE) DATE VARCHAR2(30 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE) VARCHAR2(150 BYTE)
Future use Future use Future use Future use Future use Future use Future use Future use Future use Future use Future use Future use Future use Future use Future use Future use
c) Table: XXDEST.XXDEST_AR_TRXS_CONV y y y y This stores XXXX Transaction Headers/Lines that are eligible for conversion. Table provides audit of XXXX Transactions data. This table is generic and can be re-used for future AR Transaction conversions for any other source(s). This table has all the columns of the standard AR Invoice Interface table RA_INTERFACE_LINES_ALL. Additional columns have been added for converted XXXXX data.
60368175.docx
S. No.
Column
Type
Description
Copy of all columns in standard AR Invoice interface table, RA_INTERFACE_LINES_ALL XXXX Data - Sample Columns NUMBER
REQUEST_ID
INTERFACE_STATUS
Ties back to the request ID of XXXXX AR Transaction Conversion concurrent program run e.g. I, P, E, ADJE , ADJ-P I is initial status, when record is populated from XXXX OF tables If record gets populated into AR invoice interface table the status is updated to P ADJ-E if any adjustments for this transaction end in error. If success, then ADJ-P Original systems (e.g. XXXX) invoice header ID Original systems (e.g. XXXX) invoice number For CM XXXX invoice ID against which this XXXX CM should be applied Use XXXX for XXXX conversion errors. XXXX Operating unit name e.g. DC_ALL, DC_EURO etc e.g. INV, DM, CM e.g. OP, CL
3 4 5
0 1
SOURCE (Additional column) SRC_ENTITY (Additional column) CLASS (Additional column) TRX_STATUS (Additional column)
3.1 3.2
VARCHAR2(30) VARCHAR2(30)
60368175.docx
4 5.1 5.2
PAYMENT_SCHEDULE_ID (Additional column) CUSTOMER_TRX_LINE_ID (Additional column) PREVIOUS_CUSTOMER_TRX_LINE_ID (Additional column) SEGMENT1 (Additional column) CT_REFERENCE (Additional column)
6 7
VARCHAR2(40) VARCHAR2(30)
VARCHAR2(100)
XXXX payment schedule ID for this transaction TRX Line ID of XXXX Transactions For CM - Stores applied TRX Line ID for XXXX CM Transactions Item number for invoiced XXXX item XXXX transaction reference. Needed for Excel output report in FSD, section 4.1 FULL CONVERSION or PARTIAL COVERSION Partial conversion of invoices require additional logic Unique identification for the record
10 12 13 14
NUMBER
LINE or TAX Header/Line Transaction Flex field context. e.g. ADX, Tech IMS Header/Line Transaction Flex fields Line amount
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
DEST_INTERFACE_LINE_ATTRIBUTE1 To DEST_INTERFACE_LINE_ATTRIBUTE15 DEST_BATCH_SOURCE_ID DEST_AMOUNT DEST_LINE_DESCRIPTION DEST_CUST_TRX_TYPE_ID DEST_TERM_ID DEST_BILLTO_CUSTOMER_ID DEST_BILLTO_ADDRESS_ID DEST_BILLTO_CONTACT_ID DEST_SHIPTO_CUSTOMER_ID DEST_SHIPTO_ADDRESS_ID DEST_SHIPTO_CONTACT_ID DEST_INVENTORY_ITEM_ID DEST_VAT_TAX_ID DEST_PRIMARY_SALESREP_ID DEST_TRX_DATE DEST_GL_DATE DEST_TAX_RATE
60368175.docx
VARCHAR2 (30)
NUMBER
XXXXX Confidential
Page 18 of 57
60368175.docx
33 34 35 36 37 38 39 40
60368175.docx
60368175.docx
2.9. Technical Approach XXXX Transactions Conversion 2.9.1. XXXX Data Extraction & Staging: 2.9.1.1.1. XXXX Data Extraction
The concurrent program XXXXX AR Transaction Conversion extracts XXXX data using DB link and populates staging tables in XXXXX OF. Concurrent program will use a new database link @DCOFDEV1.US.ORACLE.COM defined in XXXXX OF to pull data from XXXX OF tables. Data extracted from XXXX OF tables are populated in the following XXXXX OF custom tables in the order given below: a) XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV Stores Receivable applications activity for XXXX AR Transactions/Receipts b) XXDEST.XXDEST_AR_TRXS_CONV Stores XXXX AR Transactions Header/Lines data
2.9.1.1.2.
Staging in XXDEST_AR_TRXS_PMTS_APP_CONV
Package used: XXDEST_AR_TRANSACTION_CONV Procedure used: LOAD_XXXX_TRX_PMT_APPL_DATA The procedure uses DB link to pull XXXX Receivable applications data for eligible XXXX Transactions/Receipts. The procedure does the following to extract/populate XXXX data: 1. Invoices and Debit Memos: y Gets debit transactions and their applications y Please refer to APPENDIX A, for pseudo SQL statement y Ensures duplicates are not loaded 2. Credit Memos: y Gets Credit transactions and their applications y Please refer to APPENDIX A, for pseudo SQL statement y Ensures duplicates are not loaded 3. Payments: y Gets Payments and their applications y Please refer to APPENDIX A, for pseudo SQL statement y Ensures duplicates are not loaded Procedure uses each of the queries in sequence, to populate XXXX data into staging table XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV. Please refer to APPENDIX A, for pseudo SQL insert statements.
2.9.1.1.3.
60368175.docx
Procedure used: LOAD_XXXX_TRX_DATA The procedure does the following: y Extracts distinct INV, DM and CM Transaction headers from staging table XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV y Uses DB link to pull XXXX Transaction headers and lines data and populates into staging table XXDEST.XXDEST_AR_TRXS_CONV Procedure uses following pseudo SQL statement to get distinct INV, DM and CM transactions: Select xx.CUSTOMER_TRX_ID ,xx.class From XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV xx Where xx.class in ('INV','DM', 'CM') And xx.source = 'XXXX' And xx.status <> 'P' UNION Select xx.APP_CUSTOMER_TRX_ID CUSTOMER_TRX_ID ,xx.app_class class From XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV xx Where xx.app_class in ('INV','DM', 'CM') And xx.APP_TRX_NUMBER not in ('On Account' ,'Receipt Write-off') And xx.source = 'XXXX' And xx.status <> 'P' Order by 1 For each of the above transactions, the Procedure gets XXXX transaction Header/Lines data using the pseudo SQL statement(s) furnished in APPENDIX B. This accomplishes the following: y y y y Inserts XXXX Transaction Header/Lines data into staging table XXDEST.XXDEST_AR_TRXS_CONV Checks for duplicates before inserting data into table. Duplicate check is based on SOURCE (source = XXXX), CUSTOMER_TRX_D and CUSTOMER_TRX_LINE_ID being unique. For each record, the initial value for INTERFACE_STATUS = I.
2.10. Converting ORG_ID A new lookup type, XXDEST_AR_IMS_COMP_ENTITY_MAP, has been defined in XXXXX
AR that maps XXXXX Operating Units to XXXX Operating Units. This lookup is accessed via responsibility XXXXX AR US Superuser Responsibility. The navigation path is: Setup System Quick Codes Receivables The following is the screen shot:
60368175.docx
In the mapping above: Description represents XXXX entity (Operating Unit) The DFF stores the corresponding XXXXX entity (Operating Unit) for XXXX entity (Operating Unit) As per FSD - XXXX Transactions in XXXX entities, DC_APAC and DC_EURO will be converted into XXXXX Irish OpCo - OU entity As per FSD - XXXX Transactions in XXXX entity, DC_ALL will be converted into XXXXX, INC entity
2.11.1.
2.11.1.1.1.
(The validation for Batch Source is not needed, since it is coming from Parameter). New Batch source DEST_XXXX_CONV defined in XXXXX AR will be used for converting XXXX transactions. SELECT bs.name ,bs.Batch_Source_ID FROM ar.ra_batch_sources_all bs WHERE bs.name = DEST_XXXX_CONV AND bs.org_id = <ORG_ID as per TDD Section 2.8>;
2.11.1.1.2.
Convert XXXX Transaction Type to XXXXX Transaction Type, based on Class (INV, CM and DM) and status (OP or CL). As per FSD, Section 2.5, the following mapping is used:
60368175.docx XXXXX Confidential Page 23 of 57
60368175.docx
To avoid hard-coding, the following lookup will be defined to get the appropriate transaction type based on XXXX Invoice Type and Status:
2.11.1.1.3.
As a pre-requisite, XXXX customers must be converted into XXXXX AR before XXXX transactions are converted. All converted XXXX customers will have its XXXX ORIG_SYSTEM_REFERENCE pre-fixed with XXXX, except for Tech IMS customers. CURSOR c_customer_ref(ip_customer_ref IN VARCHAR2) IS SELECT c.orig_system_reference FROM apps.ra_customers c ,xxdest.xxdest_ar_Trxs_Conv xx WHERE 1=1 And xx.DEST_ORG_ID = c.org_id And xx.Source = XXXX And xx.Line_Type = LINE And xx.ORIG_SYSTEM_BILL_CUSTOMER_REF = ip_customer_ref And DECODE(xx.INTERFACE_HEADER_CONTEXT ,Tech IMS,xx.ORIG_SYSTEM_BILL_CUSTOMER_REF ,XXXX-||xx.ORIG_SYSTEM_BILL_CUSTOMER_REF )
60368175.docx
= c.orig_system_reference; If validation for the customer fails, then Transaction Header/Lines will be marked as ERROR.
2.11.1.1.4.
As a pre-requisite, XXXX customer sites must be converted into XXXXX AR before XXXX transactions are converted. All converted XXXX customer sites will have its XXXX ORIG_SYSTEM_REFERENCE prefixed with XXXX, except for Tech IMS customer sites. CURSOR c_address_ref(ip_address_ref IN VARCHAR2) IS SELECT c.orig_system_reference FROM apps.HZ_Cust_Acct_Sites c ,xxdest.xxdest_ar_Trxs_Conv xx WHERE 1=1 And xx.DEST_ORG_ID = c.org_id And xx.Source = XXXX And xx.Line_Type = LINE And xx.ORIG_SYSTEM_BILL_ADDRESS_REF = ip_address_ref And DECODE(xx.INTERFACE_HEADER_CONTEXT ,Tech IMS,xx.ORIG_SYSTEM_BILL_ADDRESS_REF ,XXXX-||xx.ORIG_SYSTEM_BILL_ADDRESS_REF ) = c.orig_system_reference; If validation for the customer site fails, then Transaction Header/Lines will be marked as E for error.
2.11.1.1.5.
As a pre-requisite, XXXX customer contacts must be converted into XXXXX AR before XXXX transactions are converted. All converted XXXX customer contacts will have its XXXX ORIG_SYSTEM_REFERENCE pre-fixed with XXXX, except for Tech IMS customer contacts. CURSOR c_contact_ref(ip_contact_ref IN VARCHAR2) IS SELECT c.orig_system_reference FROM apps.Ra_Contacts c ,xxdest.xxdest_ar_Trxs_Conv xx WHERE 1=1 And xx.DEST_ORG_ID = c.org_id And xx.Source = XXXX And xx.Line_Type = LINE And xx.ORIG_SYSTEM_BILL_CONTACT_REF = ip_contact_ref And DECODE(xx.INTERFACE_HEADER_CONTEXT ,Tech IMS,xx.ORIG_SYSTEM_BILL_CONTACT_REF ,XXXX-||xx.ORIG_SYSTEM_BILL_CONTACT_REF ) = c.orig_system_reference; If validation for the customer site fails, then Transaction Header/Lines will be marked as E for error.
60368175.docx
2.11.1.1.6.
As per FSD, Section 3.8.2, XXXX Tech IMS transactions should have Header DFF (ATTRIBUTE8) populated with Billing Analyst. In XXXXX AR, for Tech IMS invoices Billing Analyst will not be defined as Collector but as a new Resource of Role Type of Billing Analyst. The following setups are assumed: 1. JRSE.ATTRIBUTE_CATEGORY is IMS 2. JRSE.ATTRIBUTE1 will store converted IMS HR Employee ID As per above assumptions the Billing Analyst will be verified against the following pseudo code: Select jrset.RESOURCE_NAME ,NVL(jrse.Attribute1 ,jrse.resource_id)Converted IMS HR_EMPLOYEE_ID from jtf_rs_resource_extns jrse ,jtf_rs_resource_extns_tl jrset ,jtf_rs_role_relations jrrr ,jtf_rs_roles_vl jrrv where 1=1 and jrse.Attribute_Category = 'IMS' and jrse.category = OTHER and jrse.resource_id = jrset.resource_id and jrrr.ROLE_RESOURCE_ID = jrse.resource_id and jrrr.role_id = jrrv.role_id and jrrv.ROLE_TYPE_CODE = 'DEST_BILLING_ANALYST' and jrrv.ROLE_NAME = DEST Billing Analyst The Billing Analyst in XXXX transaction is replaced with XXXXX Resource using above logic. If XXXXX Resource is not yet defined, the record will be rejected. Note: If Resource definition for a XXXX Billing Analyst does not exist in XXXXX, a new resource will NOT be created by this program. This will be handled by FSD IMS Salesrep BA Process.doc.
2.11.1.1.7.
In XXXXX AR, for IMS Tech invoices only the XXXX Salesperson will be defined as JTF Resource and Sales person. The following setups are assumed: 1. JRSE.Attribute1 will be IMS 2. JRSE.Attribute2 will store converted IMS HR Employee number and new resource number created in XXXXX. As per above assumptions the Primary Salesperson will be verified against the following pseudo code, for the Operating unit of the responsibility: The XXXXX Salesperson# will be the Resource number prefixed with IMS- Select jrset.RESOURCE_NAME Salesperson Name ,NVL(jrse.Attribute1 ,jrse.resource_id)Converted XXXX Salesperson# ,'IMS-'||jrse.Resource_Number XXXXX Salesperson# from jtf_rs_salesreps jrs
60368175.docx XXXXX Confidential Page 26 of 57
60368175.docx
,jtf_rs_resource_extns jrse ,jtf_rs_resource_extns_tl jrset where 1=1 and jrse.resource_id = jrs.resource_id and jrs.org_id = FND_PROFILE.VALUE(ORG_ID) and jrse.Attribute_Category = 'IMS' and jrse.category = OTHER and jrse.resource_id = jrset.resource_id The Salesperson in XXXX transaction is replaced with XXXXX Salesperson using above logic. If XXXXX Salesperson is not yet defined, the record will be rejected. Note #1: If Resource and Sales person for a XXXX Primary Salesperson does not exist in XXXXX AR, a new resource will not be created by this program. This will be handled independently as per FSD IMS Salesrep BA Process.doc. Note #2: For all XXXX invoices other than Tech IMS As per FSD, Section 2.5, XXXX Sales persons will be mapped to a DFF column of RA_SALESREPS_ALL table. Select ATTRIBUTEN From RA_SALESREPS_ALL Where Salesrep_Number = <XXXX Salesrep#> And Org_ID = FND_GLOBAL.ORG_ID;
2.11.1.1.8.
In XXXXX AR, XXXX Primary Account Manager will be converted same as the XXXX Primary Salesperson.
2.11.1.1.9.
Following logic is used to convert XXXX payment terms in staging table XXDEST.XXDEST_AR_TRXS_CONV, to XXXXX Payment terms: Select Name "XXXXX Payment Terms" From RA_TERMS where ATTRIBUTE1 = <"XXXX Payment Terms">
60368175.docx
2.11.2.
2.11.2.1.1.
UOM in XXDEST.XXDEST_AR_TRXS_CONV staging table is validated as follows: select from where And
2.11.2.1.2.
Bring in data from XXXX As Is, in addition to (or in replacement) as per FSD, Section 3.84. The XXXX data is stored in staging table XXDEST.XXDEST_AR_TRXS_CONV in columns ATTRIBUTE1 to ATTRIBUTE15
2.11.2.1.3.
XXXX inventory items in XXDEST.XXDEST_AR_TRXS_CONV staging table should be defined in XXXXX OF and are validated against XXXXX OF item master as follows: If XXXX Line Type = LINE then: SELECT i.inventory_item_id item_id ,i.segment1 ,i.description FROM inv.mtl_system_items_b i ,inv.mtl_parameters mp, ,xxdest.xxdest_ar_trxs_conv xx WHERE xx.inventory_item_id = i.inventory_item_id AND i.organization_id = mp.organization_id AND mp.organization_id = mp.master_organization_id If XXXX Line Type = TAX then: SELECT i.inventory_item_id item_id ,i.segment1 ,i.description FROM inv.mtl_system_items_b i ,inv.mtl_parameters mp, WHERE i.SEGMENT1 = TADS00127 AND i.organization_id = mp.organization_id AND mp.organization_id = mp.master_organization_id If above validation fails the XXXX transaction line (and Header) will be rejected.
2.11.2.1.4.
As per FSD, Section 1.2, If a transaction has amortization schedules, i.e. the accounting rule duration is more than 1, these will not be converted using a program. They will have to be converted manually. AR.RA_INTERFACE_LINES_ALL.ACCOUTING_RULE_ID = Null;
60368175.docx XXXXX Confidential Page 28 of 57
60368175.docx
2.11.2.1.5.
As per FSD, Section 2.5, the GL date is set to 01-Feb-2010: For INV/DM: AR.RA_INTERFACE_LINES_ALL.GL_DATE = 01-FEB-10; For CM: AR.RA_INTERFACE_LINES_ALL.GL_DATE = Null; As per AR Users Guide, May 2003, Page G-87, If TRX_DATE is null then the GL date is defaulted as the TRX_DATE: AR.RA_INTERFACE_LINES_ALL.TRX_DATE = Null;
2.12.1.
Populate RA_INTERFACE_LINES_ALL
Note #1: DEST_XXXX_CONV is the new Batch source for converting XXXX transactions into XXXXX AR. Depending on the setup interface is populated with either value or ID. Note #2: Data from XXXX OF tables are extraced via DB link @DCOFDEV1.US.ORACLE.COM and stored in custom staging table in XXXXX OF, XXDEST.XXDEST_AR_TRXS_CONV S. No.
0
Interface Columns
TRX_NUMBER
DXXXXX AR Data
As per FSD, Section 2.5, Original TRX# from XXXX. Table: XXDEST_AR_TRXS_CONV Column: TRX_NUMBER
If there are duplicate invoice numbering in DXXXXX Oracle, then append the transaction number with the batch ID.
1 INTERFACE_LINE_CONTEXT Possible values: 'Tech IMS ADX Tech TZ 2 INTERFACE_LINE_ATTRIBUTE1 to INTERFACE_LINE_ATTRIBUTE5 INTERFACE_LINE_ATTRIBUTE6 For 'Tech IMS, Tech TZ and ADX: INTERFACE_HEADER_ATTRIBUTE1 to INTERFACE_LINE_ATTRIBUTE5 For 'Tech IMS and Tech TZ: INTERFACE_HEADER_ATTRIBUTE6 For ADX: XXXX Invoice Line ID CUSTOMER_TRX_LINE_ID
60368175.docx XXXXX Confidential Page 29 of 57
No change
No change
No change
60368175.docx
INTERFACE_LINE_ATTRIBUTE7
For 'Tech IMS, Tech TZ and ADX: XXXX Invoice ID CUSTOMER_TRX_ID For 'Tech IMS, Tech TZ and ADX: INTERFACE_HEADER_ATTRIBUTE8 to INTERFACE_LINE_ATTRIBUTE15 Table: XXDEST_AR_TRXS_CONV Column: LINE_NUMBER
No change
No change
If the line is a tax line from DC (where line type = TAX) set the line number to the next line number at the end of the all the invoice lines
7 LINE_TYPE LINE or TAX LINE only. XXXX TAX lines will be converted as regular line as per FSD, Section 2.4.2 DEST_XXXX_CONV Get SOB for the responsibility from where the program is run: Select SET_OF_BOOKS_ID From AR_System_Parameters Where Org_ID = FND_GLOBAL.ORG_ID For Line Type = LINE: Same as XXXX line description. For XXXX TAX line: (will be converted as LINE) As per FSD, Section 2.4.2:
8 9
BATCH_SOURCE_NAME SET_OF_BOOKS_ID
10
DESCRIPTION
For LINE: Table: XXDEST_AR_TRXS_CONV Column: DESCRIPTION For TAX: Table: XXDEST_AR_TRXS_CONV (xx) Columns: LINE_NUMBER, TAX_CODE, TAX_RATE
original invoice line number associated with the tax line || || tax code || || tax rate
xx.LINE_NUMBER|| ||xx.TAX_CODE|| ||xx.TAX_RATE No change As per FSD, Section 2.5: User No change No change. As per TTD, Section 2.9.1.1.2
11 12 13 14 15
Table: XXDEST_AR_TRXS_CONV Column: CURRENCY_CODE Table: XXDEST_AR_TRXS_CONV Column: CONVERSION_TYPE Table: XXDEST_AR_TRXS_CONV Column: CONVERSION_RATE Table: XXDEST_AR_TRXS_CONV Column: AMOUNT Table: XXDEST_AR_TRXS_CONV Column: CUST_TRX_TYPE_NAME
60368175.docx
16 17 18
TERM_NAME TERM_ID ORIG_SYSTEM_BILL _CUSTOMER_REF ORIG_SYSTEM_BILL _ADDRESS_REF ORIG_SYSTEM_BILL _CONTACT_REF TRX_DATE GL_DATE QUANTITY UNIT_SELLING_PRICE PRIMARY_SALESREP_NUMBER
Table: XXDEST_AR_TRXS_CONV Column: TERM_NAME Table: XXDEST_AR_TRXS_CONV Column: TERM_ID Table: XXDEST_AR_TRXS_CONV Column: ORIG_SYSTEM_BILL _CUSTOMER_REF Table: XXDEST_AR_TRXS_CONV Column: ORIG_SYSTEM_BILL _ADDRESS_REF Table: XXDEST_AR_TRXS_CONV Column: ORIG_SYSTEM_BILL _CONTACT_REF Table: XXDEST_AR_TRXS_CONV Column: TRX_DATE Table: XXDEST_AR_TRXS_CONV Column: GL_DATE Table: XXDEST_AR_TRXS_CONV Column: QUANTITY Table: XXDEST_AR_TRXS_CONV Column: UNIT_SELLING_PRICE Table: XXDEST_AR_TRXS_CONV Column: PRIMARY_SALESREP_NUMBER Table: XXDEST_AR_TRXS_CONV Column: PURCHASE_ORDER Table: XXDEST_AR_TRXS_CONV Column: SEGMENT1
As per TTD, Section 2.9.1.1.10 As per TTD, Section 2.9.1.1.10 As per TTD, Section 2.9.1.1.3
19
20
21 22 23 (a) 23 (b) 24
SYSDATE or GL_DATE As per TTD, Section 2.9.2.1.5 No change. No change. As per TTD, Section 2.9.1.1.7
25 26
PURCHASE_ORDER SEGMENT1
No change For LINE: No change. For TAX: (will be converted as LINE) As per FSD, Section 2.4.2, use TADS00127 This is used for CM creation and application against related INV/DM. Please refer to Open Issues. AR Invoice interface may not handle applying credit memo to multiple INV/DM in a single run. This can be accomplished via API This is used for CM creation and application against related INV/DM. Please refer to Open Issues. AR Invoice interface may not handle applying credit memo to multiple INV/DM in a single run
27 (a)
REFERENCE_LINE_CONTEXT
Table: XXDEST_AR_TRXS_CONV Column: REFERENCE_LINE_CONTEXT INTERFACE_LINE_CONTEXT of a XXXX INV/DM that is being credited. This may not work if CM is applied to multiple INV/DM Table: XXDEST_AR_TRXS_CONV Column: REFERENCE_LINE_ATTRIBUTE1 to REFERENCE_LINE_ATTRIBUTE15 INTERFACE_LINE_ ATTRIBUTE1 to REFERENCE_LINE_ATTRIBUTE15 of a XXXX INV/DM that is being credited.
27 (b)
REFERENCE_LINE_ATTRIBUTE1 to REFERENCE_LINE_ATTRIBUTE15
60368175.docx
28 29
This may not work if CM is applied to multiple INV/DM Table: XXDEST_AR_TRXS_CONV Column: ATTRIBUTE1 to ATTRIBUTE15 Table: XXDEST_AR_TRXS_CONV Column: UOM_CODE Table: XXDEST_AR_TRXS_CONV Column: ORG_ID FND_GLOBAL.USER_ID SYSDATE FND_GLOBAL.USER_ID SYSDATE FND_GLOBAL.CONC_LOGIN_ID SYSDATE Table: XXDEST_AR_TRXS_CONV Column: ATTRIBUTE_CATEGORY Table: XXDEST_AR_TRXS_CONV Column: HEADER_ATTRIBUTE_CATEGORY Table: XXDEST_AR_TRXS_CONV Column: HEADER_ATTRIBUTE1 to Column: HEADER_ATTRIBUTE15 Table: XXDEST_AR_TRXS_CONV Column: INVOICING_RULE_NAME Table: XXDEST_AR_TRXS_CONV Column: INVOICING_RULE_NAME Table: XXDEST_AR_TRXS_CONV Column: ACCOUNTING_RULE_NAME Table: XXDEST_AR_TRXS_CONV Column: COMMENTS
As per FSD, section 3.8.4 for line DFF(s) As explained in Section 2.9.2.1.1 of TDD. (If partial conversion, this is Null) As explained in TDD, Section 2.8 FND_GLOBAL.USER_ID SYSDATE FND_GLOBAL.USER_ID SYSDATE FND_GLOBAL.CONC_LOGIN_ID SYSDATE No change No change As per FSD, section 3.8.4 for Header DFF(s) Null Null No change No change
30 31 32 33 34 35 36 37 38 39 40 41 42 43
ORG_ID LAST_UPDATED_BY LAST_UPDATE_DATE CREATED_BY CREATION_DATE LAST_UPDATE_LOGIN CONVERSION_DATE ATTRIBUTE_CATEGORY HEADER_ATTRIBUTE_CATEGORY HEADER_ATTRIBUTE1 to HEADER_ATTRIBUTE15 INVOICING_RULE_NAME ACCOUNTING_RULE_NAME INTERNAL_NOTES COMMENTS
2.12.2.
Populate RA_INTERFACE_SALESCREDITS_ALL
Note #1: XXXX OF data are obtained via DB link @DCOFDEV1.US.ORACLE.COM and stored in custom staging table in XXXXX OF, XXDEST.XXDEST_AR_TRXS_CONV S. No. 1 Interface Table Columns
INTERFACE_LINE_CONTEXT Possible values: 'Tech IMS ADX Tech TZ
For 'Tech IMS, Tech TZ and ADX: INTERFACE_HEADER_ATTRIBUTE1 to INTERFACE_LINE_ATTRIBUTE5 For 'Tech IMS and Tech TZ: INTERFACE_HEADER_ATTRIBUTE6 For ADX: XXXX Invoice Line ID -
60368175.docx
CUSTOMER_TRX_LINE_ID
INTERFACE_LINE_ATTRIBUTE7
For 'Tech IMS, Tech TZ and ADX: XXXX Invoice ID CUSTOMER_TRX_ID For 'Tech IMS, Tech TZ and ADX: INTERFACE_HEADER_ATTRIBUTE8 to INTERFACE_LINE_ATTRIBUTE15 Table: XXDEST_AR_TRXS_CONV
INTERFACE_LINE_ATTRIBUTE8 to INTERFACE_LINE_ATTRIBUTE15
SALESREP_NUMBER
Column: PRIMARY_SALESPERSON
As per TTD, Section 2.9.1.1.7
7 8 9 10 11 12 13 14 15 16 17 18 19
SALES_CREDIT_TYPE_NAME SALES_CREDIT_AMOUNT_SPLIT
SALES_CREDIT_PERCENT_SPLIT INTERFACE_STATUS REQUEST_ID ATTRIBUTE_CATEGORY ATTRIBUTE1 to ATTRIBUTE15 CREATED_BY CREATION_DATE LAST_UPDATED_BY LAST_UPDATE_DATE LAST_UPDATE_LOGIN ORG_ID
2.12.3.
Receivable Distributions
The Receivable distribution will be created automatically by Auto invoice using Auto Accounting.
2.12.4.
As per FSD, Section 2.4.2, XXXX TAX line will be converted as LINE. As per FSD, section 2.5, the following XXXXX GL accounts are used, for Revenue and Tax accounts, for converted XXXX transactions: REVENUE & TAX Distribution Account Value Source 01 or 32 Company code value. 01 for US. 32 for IE 11112 As per FSD, section 2.5. 000 These values will be put in Lookup codes, 000 to avoid hard-coding. E10 0000 0000
Since the accounts are the same, a separate distribution will NOT be populated for ACCOUNT_CLASS = TAX.
60368175.docx
A Revenue distribution record, will be generated for each XXXX transaction line (regardless of XXXX LINE_TYPE = TAX and LINE), and populated in the RA_INTERFACE_DISTRIBUTIONS_ALL interface table.
2.12.5.
Populate RA_INTERFACE_DISTRIBUTIONS_ALL
Note #1: XXXX OF data are obtained via DB link @DCOFDEV1.US.ORACLE.COM and stored in custom staging table in XXXXX OF, XXDEST.XXDEST_AR_TRXS_CONV S. No. 1 2 3 XXXXX Interface Table Columns INTERFACE_DISTRIBUTION_ID INTERFACE_LINE_ID
INTERFACE_LINE_CONTEXT
For 'Tech IMS, Tech TZ and ADX: INTERFACE_HEADER_ATTRIBUTE1 to INTERFACE_LINE_ATTRIBUTE5 For 'Tech IMS and Tech TZ: INTERFACE_HEADER_ATTRIBUTE6 For ADX: XXXX Invoice Line ID CUSTOMER_TRX_LINE_ID
INTERFACE_LINE_ATTRIBUTE7
For 'Tech IMS, Tech TZ and ADX: XXXX Invoice ID CUSTOMER_TRX_ID For 'Tech IMS, Tech TZ and ADX: INTERFACE_HEADER_ATTRIBUTE8 to INTERFACE_LINE_ATTRIBUTE15
INTERFACE_LINE_ATTRIBUTE8 to INTERFACE_LINE_ATTRIBUTE15
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
ACCOUNT_CLASS AMOUNT PERCENT SEGMENT1 SEGMENT2 SEGMENT3 SEGMENT4 SEGMENT5 SEGMENT6 SEGMENT7 SEGMENT8 SEGMENT9 SEGMENT10 ATTRIBUTE_CATEGORY ATTRIBUTE1 to ATTRIBUTE15 ORG_ID REQUEST_ID
REV (XXXX TAX will also be passed as REV) Null 100.0 01 for XXXXX, INC (OR) 32 for XXXXX Irish OpCo - OU 11112 000 000 E10 0000 0000 Null Null Null Null Null As explained in TDD, Section 2.8 Null
60368175.docx
25 26 27 28 29
2.12.6.
After all the lines for a XXXX transaction, in table XXDEST.XXDEST_AR_TRXNS_CONV, has been processed the staging table record(s) are updated as follows: UPDATE XXDEST.XXDEST_AR_TRXNS_CONV xx SET last_update_date = SYSDATE ,last_updated_by = FND_GLOBAL.USER_ID ,Interface_status = E or P WHERE xx.CUSTOMER_TRX_ID = <XXXX CUSTOMER_TRX_ID> AND Source = XXXX; COMMIT; Note: If errors then insert record into XXDEST.XXDEST_AR_TRX_ERROR_LOG. Pass the RECORD_ID and error message to be populated in columns RECORD_ID and ERROR_DESC respectively.
2.12.7.
Adjustments must be applied for two cases: a) Full Conversion Transactions - which have adjustments in XXXX prior to converting to XXXXX. The adjustments are required in XXXXX OF to maintain history b) Partial Conversion Transactions - which have to be adjusted in XXXXX OF to reduce Invoice amount to Partial conversion amount Note #1: Adjustments can only be applied AFTER Auto Invoice has been run and XXXX Transactions have been successfully converted into XXXXX AR Note #2: Approval Limits must be defined in AR, for the designated user(s) who will use this conversion program Note #3: Adjustments will be applied only at the Payment Schedule level. Line level adjustments will not be made The following is the process flow: y Run the concurrent program XXXXX AR Transactions Post-Conversion, to create adjustments for Full and Partial converted XXXX invoices y Choose parameter, source = XXXX. The program has to be run from the same entity as the Transactions to be adjusted. Get distinct Transactions from XXDEST.XXDEST_AR_TRXS_CONV, that require adjustments: (AMOUNT_ADJUSTED <> 0): Full Conversion Transactions to be adjusted for history: Select xx.Customer_Trx_ID XXXX Customer TRX ID
60368175.docx
,Rct.Customer_Trx_ID XXXXX Customer TRX ID ,xx.Amount_adjusted Adjustment amount From XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV xx ,RA_Customer_Trx Rct ,Ra_batch_sources bs Where 1=1 And xx.Source = XXXX And xx.class in (INV,DM,CM) And NLV(xx.Amount_adjusted,0) <> 0 And xx.DEST_org_id = FND_GLOBAL.Org_ID And xx.Customer_Trx_ID = Rct.Interface_Header_Attribute7 And Rct.Batch_source_ID = bs.Batch_Source_ID And bs.name = 'DEST_XXXX_CONV' And Exists (Select Y From XXDEST.XXDEST_AR_TRXNS_CONV yy Where 1=1 And yy.process_status = P And yy.Source = xx.Source And yy.customer_trx_id = xx.customer_trx_id ) Group by xx.Customer_Trx_ID ,Rct.Customer_Trx_ID; Partial Conversion Transactions to be adjusted for conversion amount: Select xx.App_Customer_Trx_ID XXXX Customer TRX ID ,Rct.Customer_Trx_ID XXXXX Customer TRX ID ,SUM(NVL(xx.Ara_Amount_applied,0)) Invoice to be adjusted to this amount From XXDEST.XXDEST_AR_TRXNS_CONV xx ,RA_Customer_Trx Rct ,Ra_batch_sources bs Where 1=1 And xx.Source = XXXX And xx.app_class in (INV,DM,CM) And xx.DEST_org_id = FND_GLOBAL.Org_ID And xx.App_Customer_Trx_ID = Rct.Interface_Header_Attribute7 And Rct.Batch_source_ID = bs.Batch_Source_ID And bs.name = 'DEST_XXXX_CONV' And Exists (Select Y From XXDEST.XXDEST_AR_TRXNS_CONV yy Where 1=1 And yy.process_status = P And yy.Source = xx.Source And yy.customer_trx_id = xx.customer_trx_id ) Group by xx.App_Customer_Trx_ID ,Rct.Customer_Trx_ID; y Loop through for each of the above XXXX Transaction, get the corresponding XXXXX Transaction (Source = XXXX and INTERFACE_HEADER_ATTRIBUTE7 = Original XXXX Customer TRX ID) Adjustment Type = INVOICE Adjustment Apply Date = 01-FEB-10 Adjustment GL Date = 01-FEB-10
60368175.docx XXXXX Confidential Page 36 of 57
y y y
60368175.docx
Get REVEIVABLES_TRX_ID from AR_RECEIVABLE_TRX_ALL where Adjustment name = DC Conversion Invoke Adjustment API with above details to create the adjustment in XXXXX AR as follows: Define a local Record Type variable, p_adj_rec, as ar_adjustments%rowtype; Entered parameters: p_adj_rec.type = INVOICE, p_adj_rec.payment_schedule_id = <XXXXX Payment Schedule ID>, p_adj_rec.receivables_trx = <ID for Adjustment name = DC Conversion>, p_adj_rec.apply_date = to_date(01-FEB-10, DD-MON-RR), p_adj_rec.gl_date = to_date(01-FEB-10, DD-MON-RR), p_adj_rec.created_from = XXDEST AR XXXX CONV Note: Standard AR Adjustment API (given below) does not have parameter for ORG_ID (entity), so the custom program will be run from each entity where adjustments need be applied. Call to the API:
AR_ADJUST_PUB.Create_Adjustment( p_api_name => AR_ADJUST_PUB, p_api_version => 1.0, p_msg_count => msg_count , p_msg_data => msg_data, p_return_status => return_status, p_adj_rec => adj_rec, p_new_adjust_number => new_adj_num, p_new_adjust_id => new_adj_id );
COMMIT; y y End Loop after all converted XXXX transactions have been processed. If any errors then update status of all records for the given XXXX Transaction, in table, XXDEST.XXDEST_AR_TRXNS_CONV to ADJ-E. Insert error information into error log table If Adjustment API is success then update all records for the transaction in table, XXDEST.XXDEST_AR_TRXNS_CONV to ADJ-P Concurrent program will have detailed log and output
2.12.8.
The following are the metrics for converting eligible XXXX Credit Memos that have one or more receivable applications in XXXX OF PROD: a) Credit Memos having only one Application: 2,433 b) Credit Memos having more than one application: 106 The count of applications for the top few CM(s) are as follows: CM TRX ID TRX# Status GL Date Count of Applications
60368175.docx XXXXX Confidential Page 37 of 57
60368175.docx
792463 1026644 1034886 902971 773999 923141 993331 1043071 909451 1026650 1026651 686478
6902803 6903944 6903992 6905724 6902524 6903436 6903675 6907712 6905861 6903947 6903948 6900918
OP OP OP OP OP OP OP CL OP OP OP OP
4/18/2006 6/30/2009 7/23/2009 2/13/2008 11/11/2005 5/27/2008 2/24/2009 8/13/2009 3/11/2008 6/30/2009 6/30/2009 9/30/2003
144 108 90 82 76 59 46 33 32 32 31 30
As of 19/Aug/09, the above listings are some Credit memos which have been applied to multiple Invoices. This poses a technical challenge, since Auto Invoice may not be able to handle this scenario. So API(s) need to be used for this purpose. The following is the summary of API(s): Note: XXXXX is on: 11.5.9 and 11i.AR.L S. No. 1 2 3 API AR_CREDIT_MEMO_API_PUB AR_CM_APPLICATION_PUB AR_CM_API_PUB Comments For creating CM, not used for CM application Available in 11i.AR.O. Does not exist in current Patchset Available for use only in a) Oracle Receivables - Version: 11.5.10.2 b) Oracle Receivables - Version: 12.0 Can be used to create CM and Credit a Transaction at the same time. This cannot be used for multiple applications Available from 11i.AR.M (included in Family Pack E - 2842697) onwards. Does not exist in current Patchset This works nicely. This is not a public API
4 5 6
Of the above, only option# 6, seems feasible. However this is not a public API. This issue is listed in the Open Issues section.
3. Miscellaneous
3.1. Report
As per FSD, Section 4.1 excel outputs are needed for: I. Transactions that failed to convert II. Receipts that failed to convert A SQL script will be furnished to generate needed output. This script will be manually executed from TOAD on any instance and the output will be saved as a .csv file. The data for the output will be in quotes.
60368175.docx XXXXX Confidential Page 38 of 57
60368175.docx
For Transaction conversions: Failure to convert can happen at two places: a) Custom program validation errors b) Standard AR Interface. This can be assessed only after the program completes. No report is needed for this because Auto Invoice furnishes a detailed error report The following is the SQL pseudo code for Transaction conversion failures: Select xx.TRX_Number, xx.TRX_Date, xx.CT_Reference, xx.Currency_Code, xx.CLASS, xx.CUST_TRX_TYPE_NAME, hca.Bill To customer name and number hcas.Bill to customer address (What columns?) hcsu.Location rc.Bill to contact (What columns?) xx. Term_Name xx.Salesperson (Number or Name?) xx_app.Amount_Due_Original xx.Error_message xx.Line_Number xx.Segment1 xx.Description xx.Quantity xx.Unit_Selling_Price From apps.xxdest_ar_trxs_conv xx ,apps.XXDEST_AR_TRXS_PMTS_APP_CONV xx_app ,apps.HZ_Cust_Accounts_All@DCOFDEV1.US.ORACLE.COM hca ,apps.HZ_Cust_Acct_Sites_ALL@DCOFDEV1.US.ORACLE.COM hcas ,apps.HZ_Cust_Sites_Uses_ALL@DCOFDEV1.US.ORACLE.COM hcsu ,apps.RA_CONTACTS@DCOFDEV1.US.ORACLE.COM rc Where xx.customer_trx_id = xx_app.customer_trx_id And xx.source = DXXXXX And xx. ORIG_SYSTEM_BILL_CUSTOMER_ID = hca.cust_account_id And xx. ORIG_SYSTEM_BILL_ADDRESS_ID = hcas. CUST_ACCT_SITE_ID And hcas. CUST_ACCT_SITE_ID = hcsu. CUST_ACCT_SITE_ID And xx. ORIG_SYSTEM_BILL_CONTACT_ID = rc.contact_id And xx.Status = E UNION Select .. .. From apps.ra_interface_lines_all ril ,apps.xxdest_ar_trxs_conv xx Where ril.Interface_status = E And ril.interface_line_attribute7 = xx.Customer_Trx_ID And ril.Batch_source_name = DEST_XXXX_CONV For Receipts conversions:
60368175.docx XXXXX Confidential Page 39 of 57
60368175.docx
a) Since program uses AR Receipt API(s). Receipt creation failure can be assessed within custom program b) Receipt application failure can also be assessed within custom program The following is the pseudo code for Receipt Conversion failures: Select xx.Receipt Number, xx.Receipt_Date, xx.GL_Date, xx.Customer Name, xx.Customer Number, xx.Location, xx_app.Applied_Trx_Number, xx_app.ARA_Applied_Amount, NVL(xx.Error_Message, xx_app.Error_Message) From Apps.XXDEST_AR_CASH_RECEIPT_IFACE xx ,Apps.XXDEST_AR_TRXS_PMTS_APP_CONV xx_app Where xx.cash_receipt_id = xx_app.cash_receipt_id And (xx.status = E or xx_app.status = E) And xx.source = XXXX
60368175.docx
d) Convert Open XXXX Receipts in XXXXX AR. Verify the following: 1. Receipt# (same as XXXX) 2. GL Date is 01-Feb-2010 3. Currency is correct 4. Receipt DFF has ATTRIBUTE1 to ATTRIBUTE5 populated as per FSD 5. Receipt application amount(s) are correct e) f) g) h) i) j) k) l) m) n) Convert Open XXXX Receipts in XXXXX AR having GL_DATE >= 01-JAN-09 Convert XXXX Reversed Receipt in XXXXX AR Verify sample Receipt applications to INV, DM and CM Convert Receipt with On Account application Convert Receipt having Write-off Create manual credit memo for converted invoice Create receipt for converted invoice Reverse converted receipt Apply converted receipt Repeat the above tests for both US and IE entities
3.3. Access/Frequency
The concurrent programs for XXXX Transactions/Receipts conversions are already assigned to Receivables All Request Group as part of Scott Studio conversion. The programs are accessible from any Receivables responsibility. The programs will be run on demand.
60368175.docx
4. Planning Considerations
4.1. Code Location 4.2. Group Members 4.3. Caveats
N/A
Documentation Plan
N/A
Work Estimates
N/A
Launch Plans
N/A
Potential Plans
N/A
5. Risks
The following are possible: a) No reconciliation between XXXX AR and XXXXX AR transactions/receipts b) XXXX transactions/receipts in XXXXX AR shows incorrect amount/status
60368175.docx
c) XXXX transactions/receipts application history in XXXXX AR does not reconcile (as per FSD specs) to XXXX AR d) Customer-facing invoice print displays incorrect/incomplete data
6. Issues
6.1. Open Issues
Issue Descriptions Transactions conversion: How to apply XXXX CM to multiple XXXX invoices? Date Entered 07/30/09 Business Impacts Auto Invoice may not handle this scenario. Checked with Najeeb and he confirmed that multiple-CM applications were accomplished manually in XXXX. Available approach: Use non-public API ARP_PROCESS_APPLICATION.CM_APPLICATION. POC was successful using this API. Use of this internal API is widely prevalent online. However private API use is not recommended. Regardless of which API is used, custom CM application program must be run after auto invoice program creates regular XXXX Invoices and onaccount XXXX CM(s) Srihari should not have instance name Srihari column for storing source data (from XXXX etc) should have SRC_ prefix to avoid confusion with converted XXXXX data
DB link name to be standardized Column names for custom staging tables need to be changed
08/18/09 08/18/09
07/30/09
Yes. Must run once from XXXXX US and once more from XXXXX Irish Opco. This applies both for extraction of XXXX data and for conversion in XXXXX AR.
60368175.docx
Issue Description
Date Entered
Comments
Transactions conversion: FSD Section 2.4.1 Please refer to Example #2. Full invoice amount is $143.11. But should be converted for partial amount of $.01 only Can the entire invoice be converted first, and then an adjustment applied to drive the invoice amount down to the partial conversion amount? Receipts Conversions: Should XXXX Miscellaneous receipts be converted? Transactions Conversions: Are we converting XXXX Invoice adjustments? Srihari: Add criteria to extract XXXX data for unapplied INV, CM and PMT What Accounting or Invoicing rule should be used for Conversion? Accounting Rule criteria to extract XXXX Transactions
07/30/09
Yes. Robin checked this approach with Anne and business is ok with this. Entire amount $143.11 will be converted into XXXXX AR via Auto Invoice. After which, a separate concurrent Program will be run to adjust the invoice amount to $.01. Require a new adjustment type to be defined in XXXXX AR for handling this. New custom adjustment program is XXXXX AR Transactions Post-Conversion Robin: No Robin: Yes
08/10/09 08/10/09
08/18/09 08/18/09
Added criterion Robin: create invoices with invoice rule as null and accounting rule as null a) If Accounting Rule for all lines of a XXXX invoice is 'Immediate' - then we should process the entire invoice? Robin: YES b) If Accounting Rule for all lines of a XXXX invoice are NULL - do I pull the invoice/lines or ignore? Robin: ALL lines c) Is it possible, Accounting Rule is 'Immediate' for some lines of a XXXX invoice but are NULL for other lines. -- Do I pull only lines having 'Immediate' and ignore other lines which have null Accounting Rule? Convert partial invoice? Robin: PULL ALL as long as the accounting rule duration is null or 1 d) Is it possible, Accounting Rule is 'Immediate' for some lines of a XXXX invoice but are different for other lines Robin: it is possible that rules can be different, but as I stated, if you have an invoice with invoice rule, then ALL lines have to have an accounting rule. So it's possible that one line has the rule of Immediate, while the other has lines with rules of something else. -- Do I pull only lines having 'Immediate' and ignore other lines which have other Accounting Rules? Convert partial invoice? Robin: as stated, pull all lines
08/18/09
60368175.docx
60368175.docx
,Null DEST_PAYMENT_SCHEDULE_ID ,Null DEST_CUSTOMER_TRX_ID ,Null DEST_TRX_NUMBER ,Null DEST_CASH_RECEIPT_ID ,Null DEST_RECEIPT_NUMBER ,Null DEST_CURRENCY_CODE ,Null DEST_APP_CUSTOMER_TRX_ID ,Null DEST_APP_TRX_NUMBER ,Null DEST_APP_CASH_RECEIPT_ID ,Null DEST_APP_RECEIPT_NUMBER ,Null DEST_ARA_AMOUNT_APPLIED ,Null DEST_APPLIED_CURRENCY_CODE ,Null DEST_ARA_APPLY_DATE ,Null DEST_ARA_APP_STATUS ,Null DEST_ARA_APP_GL_DATE ,Null ATTRIBUTE_CATEGORY ,Null ATTRIBUTE1 ,Null ATTRIBUTE2 ,Null ATTRIBUTE3 ,Null ATTRIBUTE4, Null ATTRIBUTE5 ,Null ATTRIBUTE6 ,Null ATTRIBUTE7 ,Null ATTRIBUTE8 ,Null ATTRIBUTE9, Null ATTRIBUTE10 ,Null ATTRIBUTE11 ,Null ATTRIBUTE12 ,Null ATTRIBUTE13 ,Null ATTRIBUTE14, Null ATTRIBUTE15 -FROM apps.ar_payment_schedules_all@DCOFDEV1.US.ORACLE.COM aps ,apps.hz_cust_accounts_all@DCOFDEV1.US.ORACLE.COM hca ,apps.ar_receivable_applications_all@DCOFDEV1.US.ORACLE.COM ara ,apps.hr_operating_units@DCOFDEV1.US.ORACLE.COM hou ,apps.ar_payment_schedules_all@DCOFDEV1.US.ORACLE.COM app_aps ,apps.hz_cust_accounts_all@DCOFDEV1.US.ORACLE.COM hca1 ,apps.fnd_lookup_values flv WHERE 1=1 AND aps.customer_id = hca.cust_account_id -- No need for outer join AND NVL(hca.CUSTOMER_CLASS_CODE,'X') not in ( 'MED', 'ABACUS', 'RES', 'Media') AND aps.org_id = hou.organization_id AND (aps.gl_date >= to_date('01-01-2009','dd-mm-rrrr') OR aps.amount_due_remaining <> 0) AND aps.CLASS IN ('INV', 'DM') AND aps.payment_schedule_id = ara.applied_payment_schedule_id AND ara.payment_schedule_id = app_aps.payment_schedule_id AND app_aps.customer_id = hca1.cust_account_id(+) AND ara.display = 'Y' AND flv.lookup_type = 'XXDEST_AR_IMS_COMP_ENTITY_MAP' AND hou.name = flv.DESCRIPTION -- 'DC_ALL', 'DC_APAC', 'DC_EURO' AND flv.Attribute1 = p_from_org - XXXXX US, XXXXX IE AND flv.enabled_flag = 'Y' AND TRUNC(SYSDATE) Between NVL(flv.START_DATE_ACTIVE,TRUNC(SYSDATE)) And NVL(flv.END_DATE_ACTIVE,TRUNC(SYSDATE)) AND NOT EXISTS (Select 'Y' From XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV xx Where xx.SOURCE = p_source -- 'XXXX' ' And xx.RECEIVABLE_APPLICATION_ID = ara.RECEIVABLE_APPLICATION_ID And xx.PAYMENT_SCHEDULE_ID = aps.payment_schedule_id )
60368175.docx XXXXX Confidential Page 46 of 57
60368175.docx
AND
EXISTS (Select 'Y' From apps.ra_customer_trx_all@DCOFDEV1.US.ORACLE.COM rct ,apps.ra_customer_trx_lines_all@DCOFDEV1.US.ORACLE.COM rctl ,apps.ra_rules@DCOFDEV1.US.ORACLE.COM rr Where rct.customer_trx_id = aps.customer_trx_id And rct.customer_trx_id = rctl.customer_trx_id And NVL(rctl.accounting_rule_id,rr.RULE_ID) = rr.RULE_ID And rr.type = 'A' And rr.OCCURRENCES = 1 )
Statement #2: -- CM transactions which are open (OR) with GL_DATE >= 01-Jan-09, and their applications -- Checks for duplicates INSERT INTO XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV SELECT XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV_S.NEXTVAL ,p_source -- XXXX ,l_extract_date ,ara.RECEIVABLE_APPLICATION_ID ,aps.class ,aps.org_id , hou.name entity ,aps.payment_schedule_id, aps.customer_trx_id CUSTOMER_TRX_ID ,aps.trx_number TRX_NUMBER ,Null CASH_RECEIPT_ID, Null RECEIPT_NUMBER -,aps.customer_ID, hca.ORIG_SYSTEM_REFERENCE ORIG_SYS_CUSTOMER_REF -,aps.status ,aps.INVOICE_CURRENCY_CODE TRX_CURRENCY_CODE ,Null PMT_CURRENCY_CODE ,aps.amount_due_original, aps.amount_due_remaining ,aps.exchange_rate inv_to_func_curr_rate ,aps.gl_date ,aps.AMOUNT_APPLIED, aps.AMOUNT_ADJUSTED, aps.AMOUNT_CREDITED ,aps.AMOUNT_IN_DISPUTE ,ara.application_type ,ara.applied_payment_schedule_id ,app_aps.class app_class ,app_aps.status app_status ,app_aps.customer_trx_id App_customer_trx_id ,DECODE(app_aps.class,'INV',app_aps.trx_number ,'DM',app_aps.trx_number,Null) App_trx_number ,app_aps.cash_receipt_id App_cash_receipt_id ,DECODE(app_aps.class,'PMT',app_aps.trx_number,Null) App_Receipt_number -,app_aps.customer_id APP_CUSTOMER_ID, hca1.ORIG_SYSTEM_REFERENCE APP_ORIG_SYS_CUSTOMER_REF -,ara.AMOUNT_APPLIED ara_AMOUNT_APPLIED ,app_aps.INVOICE_CURRENCY_CODE Applied_CURRENCY_CODE ,ara.TRANS_TO_RECEIPT_RATE ara_TRANS_TO_RECEIPT_RATE ,ara.AMOUNT_APPLIED_FROM ARA_AMOUNT_APPLIED_FROM ,ara.apply_date ara_apply_date, ara.status ara_app_status
60368175.docx XXXXX Confidential Page 47 of 57
60368175.docx
,app_aps.gl_date ara_app_gl_date ,'I',Null ,Sysdate,p_userid ,Sysdate,p_userid -,p_to_org DEST_ORG_ID ,Null DEST_RECV_APPLICATION_ID ,Null DEST_PAYMENT_SCHEDULE_ID ,Null DEST_CUSTOMER_TRX_ID ,Null DEST_TRX_NUMBER ,Null DEST_CASH_RECEIPT_ID ,Null DEST_RECEIPT_NUMBER ,Null DEST_CURRENCY_CODE ,Null DEST_APP_CUSTOMER_TRX_ID ,Null DEST_APP_TRX_NUMBER ,Null DEST_APP_CASH_RECEIPT_ID ,Null DEST_APP_RECEIPT_NUMBER ,Null DEST_ARA_AMOUNT_APPLIED ,Null DEST_APPLIED_CURRENCY_CODE ,Null DEST_ARA_APPLY_DATE ,Null DEST_ARA_APP_STATUS ,Null DEST_ARA_APP_GL_DATE ,Null ATTRIBUTE_CATEGORY ,Null ATTRIBUTE1 ,Null ATTRIBUTE2 ,Null ATTRIBUTE3 ,Null ATTRIBUTE4, Null ATTRIBUTE5 ,Null ATTRIBUTE6 ,Null ATTRIBUTE7 ,Null ATTRIBUTE8 ,Null ATTRIBUTE9, Null ATTRIBUTE10 ,Null ATTRIBUTE11 ,Null ATTRIBUTE12 ,Null ATTRIBUTE13 ,Null ATTRIBUTE14, Null ATTRIBUTE15 -FROM apps.ar_payment_schedules_all@DCOFDEV1.US.ORACLE.COM aps ,apps.hz_cust_accounts_all@DCOFDEV1.US.ORACLE.COM hca ,apps.ar_receivable_applications_all@DCOFDEV1.US.ORACLE.COM ara ,apps.hr_operating_units@DCOFDEV1.US.ORACLE.COM hou ,apps.ar_payment_schedules_all@DCOFDEV1.US.ORACLE.COM app_aps ,apps.hz_cust_accounts_all@DCOFDEV1.US.ORACLE.COM hca1 ,apps.fnd_lookup_values flv WHERE 1=1 AND aps.customer_id = hca.cust_account_id -- No need for outer join AND NVL(hca.CUSTOMER_CLASS_CODE,'X') not in ( 'MED', 'ABACUS', 'RES', 'Media') AND aps.org_id = hou.organization_id AND (aps.gl_date >= to_date('01-01-2009','dd-mm-rrrr') OR aps.amount_due_remaining <> 0) AND aps.CLASS IN ('CM') AND aps.payment_schedule_id = ara.payment_schedule_id AND ara.applied_payment_schedule_id = app_aps.payment_schedule_id AND app_aps.customer_id = hca1.cust_account_id(+) AND ara.display = 'Y' AND flv.lookup_type = 'XXDEST_AR_IMS_COMP_ENTITY_MAP' AND hou.name = flv.DESCRIPTION --'DC_ALL', 'DC_APAC', 'DC_EURO' AND flv.Attribute1 = p_from_org - XXXXX US, XXXXX IE AND flv.enabled_flag = 'Y' AND TRUNC(SYSDATE) Between NVL(flv.START_DATE_ACTIVE,TRUNC(SYSDATE)) And NVL(flv.END_DATE_ACTIVE,TRUNC(SYSDATE))
60368175.docx XXXXX Confidential Page 48 of 57
60368175.docx
AND
AND
NOT EXISTS (Select 'Y' From XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV xx Where xx.SOURCE = p_source -- 'XXXX' ' And xx.RECEIVABLE_APPLICATION_ID = ara.RECEIVABLE_APPLICATION_ID And xx.PAYMENT_SCHEDULE_ID = aps.payment_schedule_id ) EXISTS (Select 'Y' From apps.ra_customer_trx_all@DCOFDEV1.US.ORACLE.COM rct ,apps.ra_customer_trx_lines_all@DCOFDEV1.US.ORACLE.COM rctl ,apps.ra_rules@DCOFDEV1.US.ORACLE.COM rr Where rct.customer_trx_id = aps.customer_trx_id And rct.customer_trx_id = rctl.customer_trx_id And NVL(rctl.accounting_rule_id,rr.RULE_ID) = rr.RULE_ID And rr.type = 'A' And rr.OCCURRENCES = 1 )
/ Statement #3: -- Payments which are open (OR) with GL_DATE >= 01-Jan-09, and their applications -- Checks for duplicates INSERT INTO XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV SELECT XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV_S.NEXTVAL ,p_source -- XXXX ,l_extract_date ,ara.RECEIVABLE_APPLICATION_ID ,aps.class ,aps.org_id , hou.name entity ,aps.payment_schedule_id, Null CUSTOMER_TRX_ID ,Null TRX_NUMBER ,aps.cash_receipt_id CASH_RECEIPT_ID, aps.trx_number RECEIPT_NUMBER -,aps.customer_ID, hca.ORIG_SYSTEM_REFERENCE ORIG_SYS_CUSTOMER_REF -,aps.status ,Null TRX_CURRENCY_CODE ,aps.INVOICE_CURRENCY_CODE PMT_CURRENCY_CODE ,aps.amount_due_original, aps.amount_due_remaining ,aps.exchange_rate inv_to_func_curr_rate ,aps.gl_date ,aps.AMOUNT_APPLIED, aps.AMOUNT_ADJUSTED, aps.AMOUNT_CREDITED ,aps.AMOUNT_IN_DISPUTE ,ara.application_type ,ara.applied_payment_schedule_id ,app_aps.class app_class ,app_aps.status app_status ,app_aps.customer_trx_id App_customer_trx_id ,app_aps.trx_number App_trx_number ,Null App_cash_receipt_id ,Null App_Receipt_number -,app_aps.customer_id APP_CUSTOMER_ID ,hca1.ORIG_SYSTEM_REFERENCE APP_ORIG_SYS_CUSTOMER_REF -60368175.docx XXXXX Confidential Page 49 of 57
60368175.docx
,ara.AMOUNT_APPLIED ara_AMOUNT_APPLIED ,app_aps.INVOICE_CURRENCY_CODE Applied_CURRENCY_CODE ,ara.TRANS_TO_RECEIPT_RATE ara_TRANS_TO_RECEIPT_RATE ,ara.AMOUNT_APPLIED_FROM ARA_AMOUNT_APPLIED_FROM ,ara.apply_date ara_apply_date, ara.status ara_app_status ,app_aps.gl_date ara_app_gl_date ,'I',Null ,Sysdate,p_userid ,Sysdate,p_userid -,p_to_org DEST_ORG_ID ,Null DEST_RECV_APPLICATION_ID ,Null DEST_PAYMENT_SCHEDULE_ID ,Null DEST_CUSTOMER_TRX_ID ,Null DEST_TRX_NUMBER ,Null DEST_CASH_RECEIPT_ID ,Null DEST_RECEIPT_NUMBER ,Null DEST_CURRENCY_CODE ,Null DEST_APP_CUSTOMER_TRX_ID ,Null DEST_APP_TRX_NUMBER ,Null DEST_APP_CASH_RECEIPT_ID ,Null DEST_APP_RECEIPT_NUMBER ,Null DEST_ARA_AMOUNT_APPLIED ,Null DEST_APPLIED_CURRENCY_CODE ,Null DEST_ARA_APPLY_DATE ,Null DEST_ARA_APP_STATUS ,Null DEST_ARA_APP_GL_DATE ,Null ATTRIBUTE_CATEGORY ,Null ATTRIBUTE1 ,Null ATTRIBUTE2 ,Null ATTRIBUTE3 ,Null ATTRIBUTE4, Null ATTRIBUTE5 ,Null ATTRIBUTE6 ,Null ATTRIBUTE7 ,Null ATTRIBUTE8 ,Null ATTRIBUTE9, Null ATTRIBUTE10 ,Null ATTRIBUTE11 ,Null ATTRIBUTE12 ,Null ATTRIBUTE13 ,Null ATTRIBUTE14, Null ATTRIBUTE15 -FROM apps.ar_payment_schedules_all@DCOFDEV1.US.ORACLE.COM aps ,apps.hz_cust_accounts_all@DCOFDEV1.US.ORACLE.COM hca ,apps.ar_receivable_applications_all@DCOFDEV1.US.ORACLE.COM ara ,apps.hr_operating_units@DCOFDEV1.US.ORACLE.COM hou ,apps.ar_payment_schedules_all@DCOFDEV1.US.ORACLE.COM app_aps ,apps.hz_cust_accounts_all@DCOFDEV1.US.ORACLE.COM hca1 ,apps.fnd_lookup_values flv WHERE 1=1 AND aps.customer_id = hca.cust_account_id -- Requires outer join AND NVL(hca.CUSTOMER_CLASS_CODE,'X') not in ( 'MED', 'ABACUS', 'RES', 'Media') AND aps.org_id = hou.organization_id AND (aps.gl_date >= to_date('01-01-2009','dd-mm-rrrr') OR aps.amount_due_remaining <> 0) AND aps.CLASS IN ('PMT') AND aps.payment_schedule_id = ara.payment_schedule_id AND ara.applied_payment_schedule_id = app_aps.payment_schedule_id AND app_aps.customer_id = hca1.cust_account_id(+) AND ara.display = 'Y' AND flv.lookup_type = 'XXDEST_AR_IMS_COMP_ENTITY_MAP'
60368175.docx XXXXX Confidential Page 50 of 57
60368175.docx
hou.name = flv.DESCRIPTION --'DC_ALL', 'DC_APAC', 'DC_EURO' flv.Attribute1 = p_from_org - XXXXX US, XXXXX IE flv.enabled_flag = 'Y' TRUNC(SYSDATE) Between NVL(flv.START_DATE_ACTIVE,TRUNC(SYSDATE)) And NVL(flv.END_DATE_ACTIVE,TRUNC(SYSDATE)) NOT EXISTS (Select 'Y' From XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV xx Where xx.SOURCE = p_source -- 'XXXX' ' And xx.RECEIVABLE_APPLICATION_ID = ara.RECEIVABLE_APPLICATION_ID And xx.PAYMENT_SCHEDULE_ID = aps.payment_schedule_id )
/ Statement #4: -- INV, DM, CM and PMT which are open (OR) with GL_DATE >= 01-Jan-09 but do NOT have applications -- These would not be picked up by previous SQL(s) -- Checks for duplicates INSERT INTO XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV SELECT XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV_S.NEXTVAL ,p_source -- XXXX ,l_extract_date ,Null RECEIVABLE_APPLICATION_ID ,aps.class ,aps.org_id , hou.name entity ,aps.payment_schedule_id, aps.customer_trx_id CUSTOMER_TRX_ID ,aps.Trx_Number TRX_NUMBER ,aps.cash_receipt_id CASH_RECEIPT_ID, aps.trx_number RECEIPT_NUMBER -,aps.customer_ID, hca.ORIG_SYSTEM_REFERENCE ORIG_SYS_CUSTOMER_REF -,aps.status ,Null TRX_CURRENCY_CODE ,aps.INVOICE_CURRENCY_CODE PMT_CURRENCY_CODE ,aps.amount_due_original, aps.amount_due_remaining ,aps.exchange_rate inv_to_func_curr_rate ,aps.gl_date ,aps.AMOUNT_APPLIED, aps.AMOUNT_ADJUSTED, aps.AMOUNT_CREDITED ,aps.AMOUNT_IN_DISPUTE ,Null application_type ,Null applied_payment_schedule_id ,Null app_class ,Null app_status ,Null App_customer_trx_id ,Null App_trx_number ,Null App_cash_receipt_id ,Null App_Receipt_number -,Null APP_CUSTOMER_ID, Null APP_ORIG_SYS_CUSTOMER_REF -,Null ara_AMOUNT_APPLIED ,Null Applied_CURRENCY_CODE ,Null ara_TRANS_TO_RECEIPT_RATE ,Null ARA_AMOUNT_APPLIED_FROM ,Null ara_apply_date, Null ara_app_status
60368175.docx XXXXX Confidential Page 51 of 57
60368175.docx
,Null ara_app_gl_date ,'I',Null ,Sysdate,p_userid ,Sysdate,p_userid -,p_to_org DEST_ORG_ID ,Null DEST_RECV_APPLICATION_ID ,Null DEST_PAYMENT_SCHEDULE_ID ,Null DEST_CUSTOMER_TRX_ID ,Null DEST_TRX_NUMBER ,Null DEST_CASH_RECEIPT_ID ,Null DEST_RECEIPT_NUMBER ,Null DEST_CURRENCY_CODE ,Null DEST_APP_CUSTOMER_TRX_ID ,Null DEST_APP_TRX_NUMBER ,Null DEST_APP_CASH_RECEIPT_ID ,Null DEST_APP_RECEIPT_NUMBER ,Null DEST_ARA_AMOUNT_APPLIED ,Null DEST_APPLIED_CURRENCY_CODE ,Null DEST_ARA_APPLY_DATE ,Null DEST_ARA_APP_STATUS ,Null DEST_ARA_APP_GL_DATE ,Null ATTRIBUTE_CATEGORY ,Null ATTRIBUTE1 ,Null ATTRIBUTE2 ,Null ATTRIBUTE3 ,Null ATTRIBUTE4, Null ATTRIBUTE5 ,Null ATTRIBUTE6 ,Null ATTRIBUTE7 ,Null ATTRIBUTE8 ,Null ATTRIBUTE9, Null ATTRIBUTE10 ,Null ATTRIBUTE11 ,Null ATTRIBUTE12 ,Null ATTRIBUTE13 ,Null ATTRIBUTE14, Null ATTRIBUTE15 -FROM apps.ar_payment_schedules_all@DCOFDEV1.US.ORACLE.COM aps ,apps.hz_cust_accounts_all@DCOFDEV1.US.ORACLE.COM hca ,apps.hr_operating_units@DCOFDEV1.US.ORACLE.COM hou ,apps.fnd_lookup_values flv WHERE 1=1 AND aps.customer_id = hca.cust_account_id(+) AND aps.org_id = hou.organization_id AND (aps.gl_date >= to_date('01-01-2009','dd-mm-rrrr') OR aps.amount_due_remaining <> 0) AND aps.CLASS IN ('INV', 'DM', 'CM', 'PMT') AND flv.lookup_type = 'XXDEST_AR_IMS_COMP_ENTITY_MAP' AND hou.name = flv.DESCRIPTION --'DC_ALL', 'DC_APAC', 'DC_EURO' AND flv.Attribute1 = p_from_org - XXXXX US, XXXXX IE AND flv.enabled_flag = 'Y' AND TRUNC(SYSDATE) Between NVL(flv.START_DATE_ACTIVE,TRUNC(SYSDATE)) And NVL(flv.END_DATE_ACTIVE,TRUNC(SYSDATE)) AND NOT EXISTS (Select 'Y' From XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV xx Where xx.SOURCE = 'XXXX' And xx.PAYMENT_SCHEDULE_ID = aps.payment_schedule_id ) /
60368175.docx
60368175.docx
60368175.docx
,HEADER_ATTRIBUTE3, HEADER_ATTRIBUTE4 ,HEADER_ATTRIBUTE5, HEADER_ATTRIBUTE6, HEADER_ATTRIBUTE7, HEADER_ATTRIBUTE8 ,HEADER_ATTRIBUTE9, HEADER_ATTRIBUTE10,HEADER_ATTRIBUTE11, HEADER_ATTRIBUTE12 ,HEADER_ATTRIBUTE13, HEADER_ATTRIBUTE14, HEADER_ATTRIBUTE15 ,COMMENTS, INTERNAL_NOTES, CUSTOMER_BANK_ACCOUNT_ID, CUSTOMER_BANK_ACCOUNT_NAME ,UOM_CODE, VAT_TAX_ID, PAYING_CUSTOMER_ID, PAYING_SITE_USE_ID ,TAX_EXEMPT_FLAG, TAX_EXEMPT_REASON_CODE, TAX_EXEMPT_NUMBER, SALES_TAX_ID ,CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, ORG_ID ,DEST_ORG_ID ) Select XXDEST.XXDEST_AR_TRXS_CONV_S.Nextval ,1,'XXXX',TRUNC(SYSDATE) ,hou.name,aps.class,aps.payment_schedule_id ,rct.ct_reference ,rct.interface_header_context,rct.interface_header_attribute1 ,rct.interface_header_attribute2,rct.interface_header_attribute3 ,rct.interface_header_attribute4,rct.interface_header_attribute5 ,rct.interface_header_attribute6,rct.interface_header_attribute7 ,rct.interface_header_attribute8,rct.interface_header_attribute9 ,rct.interface_header_attribute10,rct.interface_header_attribute11 ,rct.interface_header_attribute12,rct.interface_header_attribute13 ,rct.interface_header_attribute14,rct.interface_header_attribute15 ,rctl.interface_line_context,rctl.interface_line_attribute1 ,rctl.interface_line_attribute2,rctl.interface_line_attribute3 ,rctl.interface_line_attribute4,rctl.interface_line_attribute5 ,rctl.interface_line_attribute6,rctl.interface_line_attribute7 ,rctl.interface_line_attribute8,rctl.interface_line_attribute9 ,rctl.interface_line_attribute10,rctl.interface_line_attribute11 ,rctl.interface_line_attribute12,rctl.interface_line_attribute13 ,rctl.interface_line_attribute14,rctl.interface_line_attribute15 ,rbs.NAME, rct.set_of_books_id, rctl.line_type ,rctl.DESCRIPTION,rct.INVOICE_CURRENCY_CODE, rctl.extended_amount ,rctt.name, rctt.CUST_TRX_TYPE_ID, rt.NAME, rt.TERM_ID ,rct.ORIG_SYSTEM_BATCH_NAME ,hca_bill.ORIG_SYSTEM_REFERENCE, rct.BILL_TO_CUSTOMER_ID ,hcs_bill.ORIG_SYSTEM_REFERENCE, rct.BILL_TO_ADDRESS_ID ,contact_bill.ORIG_SYSTEM_REFERENCE, rct.BILL_TO_CONTACT_ID ,Null, rct.SHIP_TO_CUSTOMER_ID ,Null, rct.SHIP_TO_ADDRESS_ID ,Null, rct.SHIP_TO_CONTACT_ID ,Null, rct.SOLD_TO_CUSTOMER_ID ,arm.NAME, rct.receipt_method_id ,rct.EXCHANGE_RATE_TYPE, rct.EXCHANGE_RATE, rct.EXCHANGE_DATE ,rct.CUSTOMER_TRX_ID, rct.TRX_DATE, aps.GL_DATE, rct.TRX_NUMBER ,rctl.CUSTOMER_TRX_LINE_ID, rctl.LINE_NUMBER, rctl.QUANTITY_invoiced ,rctl.UNIT_SELLING_PRICE, rctl.UNIT_STANDARD_PRICE ,rct.PREVIOUS_CUSTOMER_TRX_ID, rctl.PREVIOUS_CUSTOMER_TRX_LINE_ID ,rct.reason_code, rctl.TAX_RATE, avta.TAX_CODE, rctl.TAX_PRECEDENCE ,rctl.TAX_EXEMPTION_ID ,rsa.SALESREP_NUMBER, rct.PRIMARY_SALESREP_ID, rct.PURCHASE_ORDER ,rct.PURCHASE_ORDER_REVISION, rct.PURCHASE_ORDER_DATE ,rctl.inventory_item_id, msi.segment1 ,rctl.ATTRIBUTE_CATEGORY, rctl.ATTRIBUTE1, rctl.ATTRIBUTE2 ,rctl.ATTRIBUTE3, rctl.ATTRIBUTE4, rctl.ATTRIBUTE5, rctl.ATTRIBUTE6 ,rctl.ATTRIBUTE7 ,rctl.ATTRIBUTE8
60368175.docx XXXXX Confidential Page 55 of 57
60368175.docx
,rctl.ATTRIBUTE9, rctl.ATTRIBUTE10, rctl.ATTRIBUTE11, rctl.ATTRIBUTE12 ,rctl.ATTRIBUTE13, rctl.ATTRIBUTE14, rctl.ATTRIBUTE15 ,rct.ATTRIBUTE_CATEGORY, rct.ATTRIBUTE1, rct.ATTRIBUTE2, rct.ATTRIBUTE3 ,rct.ATTRIBUTE4 ,rct.ATTRIBUTE5, rct.ATTRIBUTE6, rct.ATTRIBUTE7, rct.ATTRIBUTE8 ,rct.ATTRIBUTE9, rct.ATTRIBUTE10 ,rct.ATTRIBUTE11, rct.ATTRIBUTE12, rct.ATTRIBUTE13, rct.ATTRIBUTE14 ,rct.ATTRIBUTE15 ,rct.COMMENTS, rct.INTERNAL_NOTES, rct.CUSTOMER_BANK_ACCOUNT_ID ,aba.BANK_ACCOUNT_NAME ,rctl.UOM_CODE, rctl.VAT_TAX_ID, rct.PAYING_CUSTOMER_ID ,rct.PAYING_SITE_USE_ID ,rctl.TAX_EXEMPT_FLAG, rctl.TAX_EXEMPT_REASON_CODE ,rctl.TAX_EXEMPT_NUMBER , rctl.SALES_TAX_ID ,FND_GLOBAL.USER_ID, Sysdate, FND_GLOBAL.USER_ID ,Sysdate ,rctl.org_id ,flv.attribute1 DEST_ORG_ID From (Select xx.CUSTOMER_TRX_ID ,xx.class From XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV xx Where xx.class in ('INV','DM', 'CM') And xx.source = 'XXXX' And xx.status <> 'P' UNION Select xx.APP_CUSTOMER_TRX_ID CUSTOMER_TRX_ID ,xx.app_class class From XXDEST.XXDEST_AR_TRXS_PMTS_APP_CONV xx Where xx.app_class in ('INV','DM', 'CM') And xx.APP_TRX_NUMBER not in ('On Account','Receipt Write-off') And xx.source = 'XXXX' And xx.status <> 'P' ) XXXX_trx ,apps.ra_customer_trx_all@DCOFDEV1.US.ORACLE.COM rct ,apps.ra_customer_trx_lines_all@DCOFDEV1.US.ORACLE.COM rctl ,apps.hr_operating_units@DCOFDEV1.US.ORACLE.COM hou ,apps.ar_payment_schedules_all@DCOFDEV1.US.ORACLE.COM aps ,apps.ra_batch_sources_all@DCOFDEV1.US.ORACLE.COM rbs ,apps.ra_cust_trx_types_all@DCOFDEV1.US.ORACLE.COM rctt ,apps.ra_terms@DCOFDEV1.US.ORACLE.COM rt ,apps.hz_cust_accounts_all@DCOFDEV1.US.ORACLE.COM hca_bill ,apps.hz_cust_site_uses_all@DCOFDEV1.US.ORACLE.COM hcsu_bill ,apps.hz_cust_acct_sites_all@DCOFDEV1.US.ORACLE.COM hcs_bill ,apps.ra_contacts@DCOFDEV1.US.ORACLE.COM contact_bill ,apps.ar_receipt_methods@DCOFDEV1.US.ORACLE.COM arm ,apps.ar_vat_tax_all@DCOFDEV1.US.ORACLE.COM avta ,apps.ra_salesreps_all@DCOFDEV1.US.ORACLE.COM rsa ,apps.ap_bank_accounts_all@DCOFDEV1.US.ORACLE.COM aba ,apps.mtl_system_items_b@DCOFDEV1.US.ORACLE.COM msi ,apps.fnd_lookup_values flv Where 1=1 and XXXX_trx.customer_trx_id = rct.customer_trx_id and rct.customer_trx_id = rctl.customer_trx_id and rctl.org_id = hou.organization_id and rct.customer_trx_id = aps.customer_trx_id and rct.batch_source_id = rbs.batch_source_id and rct.cust_trx_type_id = rctt.CUST_TRX_TYPE_ID
60368175.docx XXXXX Confidential Page 56 of 57
60368175.docx
and and and and and and and and and and and and and and and and
rct.term_id = rt.term_id (+) rct.BILL_TO_CUSTOMER_ID = hca_bill.cust_account_id rct.BILL_TO_SITE_USE_ID = hcsu_bill.site_use_id hcsu_bill.CUST_ACCT_SITE_ID = hcs_bill.CUST_ACCT_SITE_ID hcs_bill.cust_account_id = hca_bill.cust_account_id rct.BILL_TO_CONTACT_ID = contact_bill.contact_id rct.receipt_method_id = arm.RECEIPT_METHOD_ID(+) rctl.vat_tax_id = avta.vat_tax_id(+) rct.PRIMARY_SALESREP_ID = rsa.SALESREP_ID(+) rct.CUSTOMER_BANK_ACCOUNT_ID = aba.BANK_ACCOUNT_ID(+) rctl.inventory_item_id = msi.inventory_item_id(+) msi.organization_id(+) = G_XXXX_Master_Orgz_ID -- XXXX Master Orgz ID hou.name = flv.description flv.lookup_type = 'XXDEST_AR_IMS_COMP_ENTITY_MAP' flv.enabled_flag = 'Y' Trunc(sysdate) between NVL(Trunc(flv.START_DATE_ACTIVE),Trunc(sysdate)) and NVL(Trunc(flv.END_DATE_ACTIVE),Trunc(sysdate)) AND NOT EXISTS (Select 'Y' From XXDEST.XXDEST_AR_TRXS_CONV xx Where xx.SOURCE = 'XXXX' And xx.CUSTOMER_TRX_ID = rct.customer_trx_id And xx.CUSTOMER_TRX_LINE_ID = rctl.customer_trx_line_id ) /