Sunteți pe pagina 1din 114

Test_AR

Project Documentation

This document was generated by Designer 7.6.1


May 25, 2019

1
Table of Contents

1. Project Description.................................................................................................................................................2
2. All Parameters in Project....................................................................................................................................... 3
3. Project Business Flows and Cartridges................................................................................................................. 13
3.1. Business Flow ReceivablesArchive 7.51.1.12.68.68......................................................................................... 13
3.1.1. Business Flow Description..............................................................................................................................13
3.1.1.1. Business Flow Diagram............................................................................................................................... 33
3.1.1.2. Parameters used in Business Flow Actvities (and Model Compatibilities)....................................................35
3.1.1.3. Order of Parameters for Business Flow Activities.........................................................................................35
3.1.2. Business Flow Activities..................................................................................................................................35
3.1.2.1. Script Activity "OptionalParameter" Description............................................................................................36
3.1.2.2. Condition Activity "SumaryTableConditio" Description................................................................................. 36
3.1.2.2.1. Condition Activity "SumaryTableConditio" Diagram...................................................................................36
3.1.2.2.2. Script Activity "CreateSummaryTable" Description....................................................................................36
3.1.2.3. Interrupt Activity: "Pause"............................................................................................................................. 39
3.1.2.4. Cartridge Activity "ReceivableTransactionsArchive" Description..................................................................39
3.1.2.5. Interrupt Activity: "Pause"............................................................................................................................. 39
3.1.2.6. Script Activity "updateOltpTables" Description............................................................................................. 40
3.1.2.7. Cartridge Activity "ReceivableTransactionsArchive" Description..................................................................42
3.1.2.8. Cartridge Activity "TransactionBatchesArchive" Description........................................................................ 42
3.1.2.9. Cartridge Activity "ReceiptBatchesArchive" Description............................................................................... 43
3.1.2.10. Cartridge Activity "LockboxTransmissionsArchive" Description..................................................................43
3.1.2.11. Cartridge Activity "CorrespondencesArchive" Description..........................................................................43
3.2. Business Flow ReceivablesReload 7.51.1.12.68.68..........................................................................................43
3.2.1. Business Flow Description..............................................................................................................................43
3.2.1.1. Business Flow Diagram............................................................................................................................... 43
3.2.1.2. Parameters used in Business Flow Actvities (and Model Compatibilities)....................................................45
3.2.1.3. Order of Parameters for Business Flow Activities.........................................................................................45
3.2.2. Business Flow Activities..................................................................................................................................45
3.2.2.1. Cartridge Activity "ReceivableTransactionsReload" Description.................................................................. 45
3.2.2.2. Script Activity "getReloadSelTabName" Description.................................................................................... 45
3.2.2.3. Cartridge Activity "TransactionBatchesReload" Description......................................................................... 47
3.2.2.4. Cartridge Activity "ReceiptBatchesReload" Description................................................................................47
3.2.2.5. Cartridge Activity "CorrespondencesReload" Description............................................................................ 48
3.2.2.6. Script Activity "updateBatches" Description..................................................................................................48
3.2.2.7. Cartridge Activity "TransactionBatchesReload" Description......................................................................... 52
3.2.2.8. Cartridge Activity "ReceiptBatchesReload" Description................................................................................52
3.2.2.9. Cartridge Activity "LockboxTransmissionsReload" Description.................................................................... 52
3.2.2.10. Cartridge Activity "CorrespondencesReload" Description.......................................................................... 53
3.2.2.11. Cartridge Activity "ReceivableTransactionsReload" Description................................................................ 53
3.3. Undo Business Flow ReceivablesUndo 7.51.1.12.68.68.................................................................................... 53
3.3.1. Undo Business Flow Description..................................................................................................................... 53
3.3.1.1. Undo Business Flow Diagram.......................................................................................................................53
3.3.2. Undo Business Flow Activities......................................................................................................................... 54
3.3.2.1. Script Activity "undoUpdates" Description.................................................................................................... 54
3.3.2.2. Cartridge Activity "CorrespondencesArchive" Description............................................................................60
3.3.2.3. Cartridge Activity "LockboxTransmissionsArchive" Description....................................................................60
3.3.2.4. Cartridge Activity "ReceiptBatchesArchive" Description............................................................................... 60
3.3.2.5. Cartridge Activity "TransactionBatchesArchive" Description........................................................................ 60
3.3.2.6. Cartridge Activity "ReceivableTransactionsArchive" Description..................................................................60
3.4. Database to Database Cartridge CorrespondencesArchive 7.51.1.12.68.68..................................................... 60
3.4.1. Cartridge CorrespondencesArchive.................................................................................................................60
3.4.1.1. Cartridge operations..................................................................................................................................... 61
3.4.1.2. Cartridge-specific data movement key warnings.......................................................................................... 61
3.4.1.3. Parameters used in the Source Model and Cartridge...................................................................................61
3.4.1.4. Rules in Cartridge......................................................................................................................................... 61
3.5. Database to Database Cartridge CorrespondencesReload 7.51.1.12.68.68......................................................61
3.5.1. Cartridge CorrespondencesReload................................................................................................................. 61
3.5.1.1. Cartridge operations..................................................................................................................................... 62
3.5.1.2. Cartridge-specific data movement key warnings.......................................................................................... 62
3.5.1.3. Data Sources................................................................................................................................................ 62
3.5.1.4. Parameters used in the Source Model and Cartridge...................................................................................62
3.5.1.5. Rules in Cartridge......................................................................................................................................... 62
3.5.1.6. Custom selection.......................................................................................................................................... 62
3.6. Database to Database Cartridge LockboxTransmissionsArchive 7.51.1.12.68.68.............................................63
3.6.1. Cartridge LockboxTransmissionsArchive.........................................................................................................63
3.6.1.1. Cartridge operations..................................................................................................................................... 63
3.6.1.2. Cartridge-specific data movement key warnings.......................................................................................... 63
3.6.1.3. Parameters used in the Source Model and Cartridge...................................................................................64
3.6.1.4. Rules in Cartridge......................................................................................................................................... 64
3.7. Database to Database Cartridge LockboxTransmissionsReload 7.51.1.12.68.68............................................. 64
3.7.1. Cartridge LockboxTransmissionsReload......................................................................................................... 64
3.7.1.1. Cartridge operations..................................................................................................................................... 64
3.7.1.2. Cartridge-specific data movement key warnings.......................................................................................... 64
3.7.1.3. Data Sources................................................................................................................................................ 64
3.7.1.4. Rules in Cartridge......................................................................................................................................... 65
3.8. Database to Database Cartridge ReceiptBatchesArchive 7.51.1.12.68.68........................................................ 65
3.8.1. Cartridge ReceiptBatchesArchive.................................................................................................................... 65
3.8.1.1. Cartridge operations..................................................................................................................................... 65
3.8.1.2. Cartridge-specific data movement key warnings.......................................................................................... 65
3.8.1.3. Parameters used in the Source Model and Cartridge...................................................................................65
3.8.1.4. Rules in Cartridge......................................................................................................................................... 65
3.9. Database to Database Cartridge ReceiptBatchesReload 7.51.1.12.68.68.........................................................66
3.9.1. Cartridge ReceiptBatchesReload.....................................................................................................................66
3.9.1.1. Cartridge operations..................................................................................................................................... 66
3.9.1.2. Cartridge-specific data movement key warnings.......................................................................................... 66
3.9.1.3. Data Sources................................................................................................................................................ 66
3.9.1.4. Parameters used in the Source Model and Cartridge...................................................................................66
3.9.1.5. Rules in Cartridge......................................................................................................................................... 66
3.9.1.6. Custom selection.......................................................................................................................................... 66
3.10. Database to Database Cartridge ReceivableTransactionsArchive 7.51.1.12.68.68......................................... 67
3.10.1. Cartridge ReceivableTransactionsArchive.....................................................................................................67
3.10.1.1. Cartridge operations................................................................................................................................... 67
3.10.1.2. Cartridge-specific data movement key warnings........................................................................................ 68
3.10.1.3. Parameters used in the Source Model and Cartridge.................................................................................68
3.10.1.4. Rules in Cartridge....................................................................................................................................... 69
3.11. Database to Database Cartridge ReceivableTransactionsReload 7.51.1.12.68.68..........................................69
3.11.1. Cartridge ReceivableTransactionsReload..................................................................................................... 69
3.11.1.1. Cartridge operations................................................................................................................................... 70
3.11.1.2. Cartridge-specific data movement key warnings........................................................................................ 70
3.11.1.3. Data Sources.............................................................................................................................................. 70
3.11.1.4. Parameters used in the Source Model and Cartridge.................................................................................71
3.11.1.5. Rules in Cartridge....................................................................................................................................... 71
3.12. Database to Database Cartridge TransactionBatchesArchive 7.51.1.12.68.68................................................72
3.12.1. Cartridge TransactionBatchesArchive........................................................................................................... 72
3.12.1.1. Cartridge operations................................................................................................................................... 72
3.12.1.2. Cartridge-specific data movement key warnings........................................................................................ 72
3.12.1.3. Parameters used in the Source Model and Cartridge.................................................................................72
3.12.1.4. Rules in Cartridge....................................................................................................................................... 72
3.13. Database to Database Cartridge TransactionBatchesReload 7.51.1.12.68.68................................................ 73
3.13.1. Cartridge TransactionBatchesReload............................................................................................................ 73
3.13.1.1. Cartridge operations................................................................................................................................... 73
3.13.1.2. Cartridge-specific data movement key warnings........................................................................................ 73
3.13.1.3. Data Sources.............................................................................................................................................. 73
3.13.1.4. Parameters used in the Source Model and Cartridge.................................................................................73
3.13.1.5. Rules in Cartridge....................................................................................................................................... 73
3.13.1.6. Custom selection........................................................................................................................................ 74
4. Source Models....................................................................................................................................................... 75
4.1. Source Model Correspondences....................................................................................................................... 75
4.1.1. ER Diagram..................................................................................................................................................... 75
4.1.2. Table use List...................................................................................................................................................75
4.1.2.1. Table use AR_CORRESPONDENCES_ALL................................................................................................75
4.1.2.2. Table use AR_CORR_PAY_SCHED_ALL................................................................................................... 76
4.2. Source Model LockboxTransmissions............................................................................................................... 76
4.2.1. ER Diagram..................................................................................................................................................... 77
4.2.2. Table use List...................................................................................................................................................77
4.2.2.1. Table use AR_TRANSMISSIONS_ALL........................................................................................................ 77
4.2.2.2. Table use AR_BATCHES_ALL.....................................................................................................................77
4.3. Source Model ReceiptBatches...........................................................................................................................78
4.3.1. ER Diagram..................................................................................................................................................... 78
4.3.2. Table use List...................................................................................................................................................79
4.3.2.1. Table use AR_BATCHES_ALL.....................................................................................................................79
4.3.2.2. Table use AR_CASH_RECEIPT_HISTORY_ALL........................................................................................ 79
4.4. Source Model ReceivableTransactions............................................................................................................. 80
4.4.1. ER Diagram..................................................................................................................................................... 81
4.4.2. Table use List...................................................................................................................................................83
4.4.2.1. Table use RA_CUSTOMER_TRX_ALL........................................................................................................ 83
4.4.2.2. Table use RA_CUSTOMER_TRX_LINES_ALL............................................................................................85
4.4.2.3. Table use AR_LINE_CONTS_ALL............................................................................................................... 86
4.4.2.4. Table use JAI_AR_TRXS............................................................................................................................. 86
4.4.2.5. Table use JAI_AR_TRX_TAX_LINES.......................................................................................................... 87
4.4.2.6. Table use JAI_AR_TRX_LINES................................................................................................................... 87
4.4.2.7. Table use JAI_AR_TRX_INS_LINES_T....................................................................................................... 88
4.4.2.8. Table use AR_PAYMENT_SCHEDULES_ALL............................................................................................ 89
4.4.2.9. Table use AR_CORR_PAY_SCHED_ALL................................................................................................... 90
4.4.2.10. Table use RA_CUST_TRX_LINE_GL_DIST_ALL......................................................................................90
4.4.2.11. Table use AR_RECEIVABLE_APPLICATIONS_ALL................................................................................. 91
4.4.2.12. Table use AR_CASH_RECEIPTS_ALL......................................................................................................92
4.4.2.13. Table use AR_CASH_RECEIPT_HISTORY_ALL...................................................................................... 93
4.4.2.14. Table use CE_STATEMENT_RECONCILS_ALL....................................................................................... 94
4.4.2.15. Table use AR_DISTRIBUTIONS_ALL........................................................................................................ 95
4.4.2.16. Table use AR_PAYMENT_SCHEDULES_ALL_2...................................................................................... 96
4.4.2.17. Table use AR_RATE_ADJUSTMENTS_ALL..............................................................................................97
4.4.2.18. Table use JAI_AR_CASH_RECEIPTS_ALL...............................................................................................97
4.4.2.19. Table use JAI_CMN_DOCUMENT_TAXES............................................................................................... 98
4.4.2.20. Table use RA_CUSTOMER_TRX_ALL_2.................................................................................................. 99
4.4.2.21. Table use AR_DISTRIBUTIONS_ALL_2.................................................................................................... 101
4.4.2.22. Table use RA_CUST_TRX_LINE_SALESREPS_ALL............................................................................... 101
4.4.2.23. Table use RA_CUST_TRX_TYPES_ALL................................................................................................... 102
4.4.2.24. Table use AR_ADJUSTMENTS_ALL......................................................................................................... 103
4.4.2.25. Table use AR_DISTRIBUTIONS_ALL_3.................................................................................................... 104
4.4.2.26. Table use AR_NOTES................................................................................................................................105
4.4.2.27. Table use AR_CUSTOMER_CALL_TOPICS_ALL.....................................................................................105
4.4.2.28. Table use AR_CALL_ACTIONS................................................................................................................. 106
4.4.2.29. Table use AR_ACTION_NOTIFICATIONS.................................................................................................106
4.4.2.30. Table use AR_DEFERRED_LINES_ALL....................................................................................................107
4.4.2.31. Table use JAI_AR_TRXS_2....................................................................................................................... 108
4.5. Source Model TransactionBatches.................................................................................................................... 108
4.5.1. ER Diagram..................................................................................................................................................... 108
4.5.2. Table use List...................................................................................................................................................108
4.5.2.1. Table use RA_BATCHES_ALL.....................................................................................................................109
4.5.2.2. Table use RA_CUSTOMER_TRX_ALL........................................................................................................ 109
1. Project Description
Project Info
Annotation

2
2. All Parameters in Project
Parameter: pcAdjustmentGLDate
Label Receivables: Override Rule for Adjustment GL Date?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule for checking GL
Date on Postable and Unpostable Adjustments, if you want to purge
postable transactions having adjustments whose GL Date is after the cut
off date or has unpurgable adjustments with posting_control_id=-3. Also
to allow purge for unpostable approved adjustments whose GL Posted
Date is after the cut off date. Default value is No.

Parameter: pcCommitmentRelatedTrx
Label Receivables: Override Rule for Commitment Related Transaction or
Credit Memo?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule -
TrxnNotCommitmentRelated and CMTrxnNotCommitmentRelated, if you
want to purge transactions related to Commitment invoices. Default value
is No.

Parameter: pcCommitmentTrx
Label Receivables: Override Rule for Commitment Type Transactions?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule - Transaction Type
Not Commitment, if you want to purge Commitment invoices. Default
value is No.

3
Parameter: pcCompletedTrx
Label Receivables: Override Rule - Transaction and Credit Memo Must be
Completed?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rules -
TransactionMustBeComplete and CMTransactionMustBeComplete, if you
want to purge invoices and credit memos which are not completed.
Default value is No.

Parameter: pcCreateSummaryTableAR
Label Receivables : Create Summary table for Rule (RunningTotalMustBeZero)
?:
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default Y
Validation Mandatory
Static List of Values Id Label
Y Yes
N No

Parameter: pcMonthsToRetain
Label Receivables: Months to Retain
UID DFC9-BE20-D47B-FFC0
Parameter Type Configuration
Data Type NUMBER
Length 9
Default 12
Validation Mandatory
List of Values <None>
Parameter Annotation Configuration parameter to change the retention policy for AR. Default
value is 12 months.

Parameter: pcPauseAfterSelectionAR
Label Receivables: Pause after Selection?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory

4
Parameter: pcPauseAfterSelectionAR
Static List of Values Id Label
Y Yes
N No
Parameter Annotation This configuration parameter enables pausing the ReceivablesArchive
business flow after the selection job has completed for the cartridge
ReceivableTransactionsArchive.

Parameter: pcPauseAfterSummaryTablePopAR
Label Receivables: Pause after Summary table population ?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No

Parameter: pcPostableApplicationGLDate
Label Receivables: Override Rule for Postable Applications GL Date?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule for Postable
Applications, if you want to purge postable transactions having
applications whose GL Date is after the cut off date or has unpurgable
applications with posting_control_id=-3. Default value is No.

Parameter: pcPostableDistributionGLDate
Label Receivables: Override Rule for Postable Distributions GL Date?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No

5
Parameter: pcPostableDistributionGLDate
Parameter Annotation Configuration parameter to override the eligiblity rule for Postable
Distributions, if you want to purge postable transactions having
distributions whose GL Date is after the cut off date or has unpurgable
distributions with posting_control_id=-3. Default value is No.

Parameter: pcPostableReceiptHistoryGLDate
Label Receivables: Override Rule for Postable Cash Receipt History?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule for Postable Cash
Receipt History, if you want to purge postable transactions having receipt
history whose date is after the cut off date or has unpurgable history with
posting_control_id=-3. Default value is No.

Parameter: pcReceiptCurrHistStatus
Label Receivables: Override Rule for Current Receipt History Status?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule - Current Receipt
History Status, if you want to purge a Receipt that has unpurgeable
history records with status as cleared and not risk eliminated or approved,
remitted, confirmed or reversed. Default value is No.

Parameter: pcReceiptPaySchedClosed
Label Receivables: Override Rule - Payment Schedule Not Open for Receipts?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule - Payment Schedule
Not Open for Receipts, if you want to purge Receipt that has open
payment schedules. Default value is No.

6
Parameter: pcReceiptRefInCE
Label Receivables: Override Rule - Reconciled Bank Statement Should Not
Exist for Receipt?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule - Reconciled Bank
Statement Should Not Exist for Receipt, if you want to purge receipts
when reconciled bank statements exist in Oracle Cash Management.
Default value is No.

Parameter: pcRunningTotal
Label Receivables: Override Rule - Running Total should be Zero?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule for Running Total, if
you want to purge the transactions for which Running Total (comprising:
gl_dist_total + adjustment_total + CM_appl_total - Cash_appl_total ) is not
zero.. Default value is No.

Parameter: pcRunTotalNumericPrecision
Label Receivables: Rounding Factor for Running Total
UID DFC9-BE20-D47B-FFC0
Parameter Type Configuration
Data Type NUMBER
Length 9
Default 99
Validation Mandatory
List of Values <None>
Parameter Annotation Configuration parameter to change Rounding Factor for Running Total.
Default value is 99.

Parameter: pcTrxInPaySched
Label Receivables: Override Rule - Transaction and Credit Memo Should have
Payment Schedules?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING

7
Parameter: pcTrxInPaySched
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule -
TransactionMustHavePaySched and CMTransactionMustHavePaySched,
if you want to purge Invoices and credit memos which do not exists in
AR_PAYMENT_SCHEDULES table per limitation in the Oracle AR Purge
program. Default value is No.

Parameter: pcTrxLineAutoruleComplete
Label Receivables: Override Rule - Transaction Line Autorule Complete?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule - Line Autorule
Complete, if you want to purge the transactions for which Autorule is not
completed (i.e if account assignments are not done). Default value is No.

Parameter: pcTrxPaySchedClass
Label Receivables: Override Rule - Transaction Payment Schedule Class?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule - Payment Schedule
Class, if you want to purge the the transaction for which payment
schedule is not of class - Invoice or Credit Memo or Debit Memo. Default
value is No.

Parameter: pcTrxPaySchedClosed
Label Receivables: Override Rule - Closed Payment Schedule for invoices and
credit memos?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30

8
Parameter: pcTrxPaySchedClosed
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule -
TrxnPaySchedMustBeClosed and CMTrxnPaySchedMustBeClosed, if
you want to purge invoices and credit memos for which payment
schedules are not closed. Default value is No.

Parameter: pcTrxPaySchedGLDate
Label Receivables: Override Rule for Payment Schedule GL Date?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule for Transaction
Payment Schedule GL Date, if you want to purge transactions without
regard to gl closed date in payment schedules. Otherwise this
gl_closed_date must be less than the Cutoff date parameter in the purge
run. Default value is No.

Parameter: pcTrxRevenueComplete
Label Receivables: Override Rule - Line Revenue Complete?
UID 3DA4-BDDB-A225-9E4E
Parameter Type Configuration
Data Type STRING
Length 30
Default N
Validation Mandatory
Static List of Values Id Label
Y Yes
N No
Parameter Annotation Configuration parameter to override the eligiblity rule - Line Revenue
Complete, if you want to purge transactions with revenue not completely
recognized for some of its lines (i.e acctd_amount_due_original is not
equal to acctd_amount_recognized). Default value is No.

Parameter: pdReloadCorrespondenceSelTab
Label P_D_Rel_APS_Sel_Tab
UID DC47-E18E-1ACD-F2B0
Parameter Type Dynamic
Data Type STRING
Code

9
Parameter: pdReloadCorrespondenceSelTab
Parameter Annotation
Dynamic parameter to get the selection table name for ar_corr_pay_sched_all table in target database. This is
required in the custom selection program for cartridge CorrespondencesReload.

Parameter: pdReloadReceiptBatchSelTab
Label P_D_Rel_ACRH_Sel_Tab
UID DC47-E18E-1ACD-F2B0
Parameter Type Dynamic
Data Type STRING
Code

Parameter Annotation
Dynamic parameter to get the selection table name for ar_cash_receipt_history_all table in target database.
This is required in the custom selection program for cartridge ReceiptBatchesReload.

Parameter: pdReloadTransactionBatchSelTab
Label Reload selection table name for ra_customer_trx_all
UID 90F0-9969-7F6B-A37E
Parameter Type Dynamic
Data Type STRING
Code

Parameter Annotation
Dynamic parameter to get the selection table name for ra_customer_trx_all table in target database. This is
required in the custom selection program for cartridge TransactionBatchesReload.

Parameter: prCustomerId
Label Customer Name
UID 4212-7F8B-019C-4FEC
Parameter Type Runtime
Data Type NUMBER
Length 30
Default
Validation <None>
Dynamic List Definition
Query Expression
DB Connection Annotation
Connection Query
Source ansi select cust.cust_account_id,
party.party_name||'
('||cust.account_number||')'
from AR.HZ_CUST_ACCOUNTS cust,
AR.HZ_PARTIES party
where cust.party_id = party.party_id
and upper(party.party_name||'
('||cust.account_number||')') like
upper(:FilterPattern) || '%'
order by party.party_name,
cust.account_number, cust.cust_account_id

10
Parameter: prCustomerId
Parameter Annotation Run time parameter to accept value for the customer for whom the purge
job is to be run.

Parameter: prCutOffDate
Label CutOff Date
UID E3E9-F866-E67D-F9EF
Parameter Type Runtime
Data Type DATE
Length
Default
Validation Script Code
import groovy.time.*
import groovy.runtime.TimeCategory.*

def now = new Date()

use( [TimeCategory] ){
Integer retPrd = pcMonthsToRetain

def maxDate = now - retPrd.months

if (prCutOffDate == null){
return "Cutoff Date cannot be empty"
}
else if (prCutOffDate > maxDate){
return "Cutoff Date must be older than ${pcMonthsToRetain} months."
}
}

List of Values <None>


Parameter Annotation Run time parameter to accept value for the cutoff date for which the purge
job is to be run. Parameter validation ensures that cutoff date does not
violate the purge rettention policy for AR.

Parameter: prOrgId
Label Operating Unit
UID 4214-0E51-24D4-CC10
Parameter Type Runtime
Data Type NUMBER
Length 30
Default
Validation Mandatory
Dynamic List Definition
Query Expression
DB Connection Annotation
Connection Query
Source ansi select organization_id, name from
APPS.HR_OPERATING_UNITS where
upper(name) like upper(:FilterPattern)||'%'
order by name

Parameter Annotation Run time parameter to accept value for the operating unit for which the
purge job is to be run.

11
Parameter: prReloadTransactionId
Label Reload Transaction Id
UID 14B4-DAF7-75EA-9462
Parameter Type Runtime
Data Type NUMBER
Length 9
Default
Validation Script Code
import groovy.sql.*

def cntVal = 0;
String cntQry = """ select count(*) cnt from ${HIST.AR.RA_CUSTOMER_TRX_ALL} a where a.customer_trx_id
= ${prReloadTransactionId}""";
cntVal = INTF_RELOC_DB.firstRow(cntQry).cnt;
if (cntVal == 0) {
return "Transaction ID: ${prReloadTransactionId} is not valid. Please enter a valid Transaction ID for reload"
}

Validation Annotation
This groovy script would validate the value entered for parameter Reload Transaction Id against the
ra_customer_trx_all table in target db/schema. If the value does not exist in target instance then it will error out
prompting to enter a valid transaction id for reload.

List of Values <None>


Parameter Annotation Run time parameter to accept value for the transaction id for which the
reload job is to be run.

Parameter: prTrxDateFrom
Label Trx Date From
UID E3E9-F873-2909-8B6A
Parameter Type Runtime
Data Type DATE
Length
Default
Validation <None>
List of Values <None>

Parameter: prTrxDateTo
Label Trx Date To
UID E3E9-F873-2909-8B6A
Parameter Type Runtime
Data Type DATE
Length
Default
Validation <None>
List of Values <None>

12
3. Project Business Flows and Cartridges
3.1. Business Flow ReceivablesArchive 7.51.1.12.68.68
3.1.1. Business Flow Description

Business Flow Info


Version 7.51.1.12.68.68
UID D686-3343-75AD-4B6E
Annotation This is the archive business flow for Oracle Receivables module for Oracle Apps Version
11.5.10.2. Deployment of this business flow would also create metadata required for the
archive access layer for AR module. It includes adding text replacers for packages/views,
excluding objects/indexes, loading metadata for dummy apps initialization required by
database triggers of some of the managed tables.

This business flow is basically used to archive eligible transactions, receipts, and related
activities like adjustments, credits, reversals and calls.
It accepts the following parameters:
1. Customer Name
2. CutOff Date
3. Operating Unit

Following cartridges are executed by this business flow:


1. ReceivableTransactionsArchive
2. TransactionBatchesArchive
3. ReceiptBatchesArchive
4. LockboxTransmissionsArchive
5. CorrespondencesArchive

The cartridge ReceivableTransactionsArchive uses a PDM selection method to traverse


all the members of a chain which comprises of one or more transactions, receipts, credit
memos having a many to many relationship between each other. If any of the transaction
in the chain is not eligible the complete chain will not be archived.

Data movement method for ReceivableTransactionsArchive cartridge is Advanced


Transactional and for other cartridges it is Standard Transactional.

A batch is eligible for archiving when all the transactions associated with it are assigned
a status of archived. Because a batch is not considered to be part of a transaction chain,
transactions that are part of a batch can be archived even if all transactions in the batch
are not eligible to be archived. That is the reason we have separate cartridges for
batches - TrnasactionBatchesArchive, ReceiptBatchesArchive and
CorrespondencesArchive.

A groovy script updateOltpTables also gets executed to set purged_children_flag for


partially purged batches when this business flow job is run.

13
Business Flow Info
Install script import com.outerbay.api.*;
import com.outerbay.foundation.components.datamovers.PreExecCodeDAO
import groovy.sql.*
import java.util.jar.*;
import groovy.lang.GroovyClassLoader;

// List of variables available for use in Businessflow


println "BUSINESS_FLOW_NAME = ${BUSINESS_FLOW_NAME}";
println "PRODUCT_HOME = ${PRODUCT_HOME}";
println "ENVIRONMENT_NAME = ${ENVIRONMENT_NAME}";

//utils = new oebsUtils();


//Dynamically loading class oebsUtils
def utils;

try
{
def gcl = new GroovyClassLoader();
Class sst = gcl.parseClass(new File("${PRODUCT_HOME}/lib/oebsUtils.groovy")) ;
utils = sst.newInstance();
}

catch(FileNotFoundException cex)
{
println "Please Deploy EBSIntegrationCreateArchiveAccess Businessflow before
module deployment.";
throw new IllegalStateException("Please Deploy EBSIntegrationCreateArchiveAccess
Businessflow before module deployment");
}
catch(Exception ex)
{
println "Exception while loading oebsUtils class"+ex;
throw new IllegalStateException("Exception while loading oebsUtils class"+ex);
}
// oebsUtils loaded

if (!utils.checkInstall(INTF_DB, 'OEBS_INTG2', null)) {


throw new IllegalStateException("Please Deploy EBSIntegrationCreateArchiveAccess
Businessflow before module deployment");

def envId = ""


def codeCnt = 0
def packageOwner = "";
def configName = "";
def dblinkName = "";
def appRelease = "";
def arPatchLevel = "";

//get D2D configuration


String configQry = """select decode(upper(c.name),'SINGLE','SI','DISTRIBUTED','DI')
confName
from obtrep_products a
, obtrep_installed_products b
, obtrep_product_configurations c
, obtrep_installed_product_cfgs d
, obtpa_environment_sources e
where a.product_name = 'LiveArchive'
and e.name = '${ENVIRONMENT_NAME}'
and a.id = b.product_id
and b.environment_source_id = e.id
and a.id = c.product_id
and d.product_configuration_id = c.id
and d.installed_product_id = b.id
""";
configName = REPOS_DB.firstRow(configQry).confName;
println(configName + " configuration found for D2D");

// get db link name

14
Business Flow Info
ConfigurationProperties.createSession("", ENVIRONMENT_NAME);

dblinkName =
ConfigurationProperties.getProductConfigValue("LA","REMOTE_ACCESS_DBLINK");

packageOwner =
ConfigurationProperties.getProductConfigValue("BusinessFlow","pcEBSPackageOwner"
);

ConfigurationProperties.closeSession();

if
(!(utils.objectExists(INTF_DB,utils.getConnectionOwner(INTF_DB),"TABLE","OBT_RA_
CUSTOMER_TRX_RUNING_TOT")))
{
String a1 ="""create table OBT_RA_CUSTOMER_TRX_RUNING_TOT
(CUSTOMER_TRX_ID NUMBER(15) NOT NULL, cust_SUM NUMBER NOT NULL)
nologging """
INTF_DB.execute(a1);
String a2 ="""create synonym
${packageOwner}.OBT_RA_CUSTOMER_TRX_RUNING_TOT for
OBT_RA_CUSTOMER_TRX_RUNING_TOT """
INTF_DB.execute(a2);
}

println("Remote Access DB Link Name: "+dblinkName);


println("Package Owner: "+packageOwner);

// get App release and AR patch level


String appRelQry = """select substr(a.PATCH_LEVEL,0,3) appRel,
substr(a.PATCH_LEVEL,-1,1) arPatchlvl
from ${packageOwner}.fnd_product_installations a
, ${packageOwner}.fnd_application b
where a.application_id = b.application_id
and b.application_short_name = 'AR'
""";

appRelease = INTF_DB.firstRow(appRelQry).appRel;
println("Oracle E-biz Release: "+appRelease);
arPatchLevel = INTF_DB.firstRow(appRelQry).arPatchlvl;
println("Patch Level for Oracle Receivables: "+arPatchLevel);

//--------- Apps Initialize stuff starts --------------


println("");
println("Apps Initialize stuff starts...");
// Read the package spec from file and create the package oebs_ar_apps_init
InputStream is = getClass().getResourceAsStream("oebs_ar_apps_init_ps.sql");
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
String sqltext = "";
while ((line = br.readLine()) != null)
{
sqltext = sqltext + line + "\n";
}
sqltext = sqltext.replaceAll("&pkg_owner",packageOwner);
INTF_DB.execute(sqltext);

br.close();
isr.close();
is.close();
println("successfully created package oebs_ar_apps_init");

// Read the package body from file and create the package body oebs_ar_apps_init
InputStream is2 = getClass().getResourceAsStream("oebs_ar_apps_init_pb.sql");
InputStreamReader isr2 = new InputStreamReader(is2);
BufferedReader br2 = new BufferedReader(isr2);
String line2;
String sqltext2 = "";
while ((line2 = br2.readLine()) != null)

15
Business Flow Info
{
sqltext2 = sqltext2 + line2 + "\n";
}
sqltext2 = sqltext2.replaceAll("&pkg_owner",packageOwner);
INTF_DB.execute(sqltext2);

br2.close();
isr2.close();
is2.close();
println("successfully created package body oebs_ar_apps_init");

//--- Start of: Add apps_init code to preexec_code table ---


LiveArchiveJobManager.createSession("", ENVIRONMENT_NAME);

PreExecCodeDAO preExecCodeDAO =
LiveArchiveJobManager.getPreExecCodeDAO();

preExecCodeValue = "begin " + packageOwner + ".oebs_ar_apps_init.ar_apps_init(-1,-


1,-1); end;";

preExecCodeDAO.createPreExecCode(ENVIRONMENT_NAME, "ar_apps_init",
preExecCodeValue);

LiveArchiveJobManager.commit();

LiveArchiveJobManager.closeSession();
println("Loaded ar_apps_init code");

//--- End of: Add apps_init code to preexec_code table ---

println("Apps Initialize stuff ends...");


//--------- Apps Initialize stuff ends --------------

// -- Archive Access stuff starts ---

println("");
println("Archive Access stuff starts...");

ArchiveAccessConfiguration.createSession(" ",ENVIRONMENT_NAME);
//ArchiveAccessConfiguration.addObjectOwnerPair(null, "APPS", null, "APPS_AA", true,
null);

//Adding Primary/Dependent objects


println("Adding Primary Objects...");

//if (appRelease == "11i") {


ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARPT_SQL_FUNC_UTIL",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_PROCESS_HEADER",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_PS_PKG",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_PROCESS_RCTS",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,

16
Business Flow Info
packageOwner,
"ARP_CASH_RECEIPTS_PKG",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_CT_PKG",
"PACKAGE"
);

if (appRelease == "11i") {
ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_PROCESS_TAX",
"PACKAGE"
);
}

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_CTLGD_PKG",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_CTL_PKG",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_CTL_PRIVATE_PKG",
"PACKAGE"
);
if (appRelease == "11i") {
ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_TAX",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_TAX_CRM_INTEGRATION_PKG",
"PACKAGE"
);
}
ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_BAL_UTIL",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_TRX_SUM_UTIL",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE"
);

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_DISTRIBUTIONS_PKG",
"PACKAGE"

17
Business Flow Info
);

if (utils.objectExists(INTF_DB,"APPS",
"PACKAGE","AR_BILLS_MAINTAIN_STATUS_PUB")) {
ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"AR_BILLS_MAINTAIN_STATUS_PUB",
"PACKAGE"
);
}

if (utils.objectExists(INTF_DB,"APPS", "PACKAGE","ARP_CR_HISTORY_PKG")) {
ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_CR_HISTORY_PKG",
"PACKAGE"
);

if (utils.objectExists(INTF_DB,"APPS", "PACKAGE","ARP_APP_PKG")) {
ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"ARP_APP_PKG",
"PACKAGE"
);

}
//} // if (appRelease == "11i")

ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"AR_APP_ADJ_V",
"VIEW"
);

if (utils.objectExists(INTF_DB,"APPS", "VIEW","HZ_PARTY_WF_USER_ROLES_V")) {
ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"HZ_PARTY_WF_USER_ROLES_V",
"VIEW"
);
}

if (appRelease == "R12") {
ArchiveAccessConfiguration.addPrimaryObject(null,
packageOwner,
"AR_ADD_FETCH_SELECT",
"PACKAGE"
);
}

//Adding Text Replacers


println("Adding Text Replacers...");
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_PROCESS_HEADER",
"PACKAGE_BODY",
1,
"(?i)ct\\.rowid",
"ct.row_id",
true,
true);

ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_PROCESS_HEADER",
"PACKAGE_BODY",
2,
"(?i)ct_prev\\.rowid",

18
Business Flow Info
"ct_prev.row_id",
true,
true);

ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARPT_SQL_FUNC_UTIL",
"PACKAGE_BODY",
1,
"(?i)ct\\.rowid",
"ct.row_id",
true,
true);

if (((appRelease == "11i") && (arPatchLevel >= "N")) || (appRelease == "R12")) {


fromString =
"(?i)SELECT\\s*?MAX\\(h\\.start_date\\)\n\\s*?INTO\\s*?l_dispute_date\n\\s*?FROM\\s*?
ar_dispute_history h,\n\\s*?ar_payment_schedules ps";
toString = "SELECT /*+ ORDERED use_index (H AR_DISPUTE_HISTORY_N1) */
MAX(h.start_date)" + "\n";
toString = toString + "INTO l_dispute_date " + "\n";
toString = toString + "FROM ar_payment_schedules ps, " + "\n";
toString = toString + " ar_dispute_history h";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARPT_SQL_FUNC_UTIL",
"PACKAGE_BODY",
2,
fromString,
toString,
true,
false);

fromString =
"(?i)SELECT\\s*?COUNT\\(\\*\\)\n\\s*?INTO\\s*?l_auto_rec_count\n\\s*?FROM\\s*?ar_pa
yment_schedules";
toString = "SELECT /*+ index (a ar_payment_schedules_n2 ) */ COUNT(*) " + "\n";
toString = toString + "INTO l_auto_rec_count " + "\n";
toString = toString + "FROM ar_payment_schedules a";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARPT_SQL_FUNC_UTIL",
"PACKAGE_BODY",
3,
fromString,
toString,
true,
false);
if (appRelease == "11i") {
fromString =
"(?i)SELECT\\s*?NVL\\(MIN\\(ps\\.due_date\\),*.\n*.arpt_sql_func_util\\.get_first_due_dat
e\\(p_term_id,\\s*?p_trx_date\\)\\)\n\\s*?INTO\\s*?l_term_due_date\n\\s*?FROM\\s*?ar_p
ayment_schedules\\s*?ps,\n\\s*?ra_customer_trx ct";
toString = "SELECT /*+ ORDERED */ NVL(MIN(ps.due_date), " + "\n";
toString = toString + "arpt_sql_func_util.get_first_due_date(p_term_id, p_trx_date)) " +
"\n";
toString = toString + "INTO l_term_due_date " + "\n";
toString = toString + "FROM ra_customer_trx ct, " + "\n";
toString = toString + " ar_payment_schedules ps";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARPT_SQL_FUNC_UTIL",
"PACKAGE_BODY",
4,
fromString,
toString,
true,
false);
}

//fromString =

19
Business Flow Info
"(?i)SELECT\\s*?DECODE\\(\\s*?MAX\\(\\s*?other_ps.payment_schedule_id\\).*.\n\\s*NU
LL,\\s*?'N',\n\\s*'Y'\\)\\s*INTO.*.l_activity_flag\\s*FROM.*.this_ps,\\s*.*\\s*.*\\s*.*\\s*.*\\s*.*\
\s*.*\\s*AND\\s*other_ps.creation_date\\s*>\\s*this_ps.creation_date;"
// below can be used if fromstring size limitation is fixed
fromString =
"(?i)SELECT\\s*?DECODE\\(\\s*?MAX\\(\\s*?other_ps.payment_schedule_id\\).*.\n\\s*NU
LL,\\s*?'N',\n\\s*'Y'\\)\\s*INTO.*.l_activity_flag\\s*FROM.*.this_ps,\\s*.*other_ps,\\s*.*other
_ct\\s*WHERE\\s*.*p_customer_trx_id\\s*AND.*=\\s*p_previous_customer_trx_id.*\\s*AN
D.*other_ps.customer_trx_id\\s*AND\\s*other_ps.creation_date\\s*>\\s*this_ps.creation_
date;"
toString = "SELECT /*+ ORDERED */ DECODE( MAX(
OTHER_PS.PAYMENT_SCHEDULE_ID),NULL,'N','Y') " + "\n";
toString = toString + "INTO l_activity_flag " + "\n";
toString = toString + "FROM RA_CUSTOMER_TRX_ALL OTHER_CT, " + "\n";
toString = toString + " AR_PAYMENT_SCHEDULES_ALL OTHER_PS, " + "\n";
toString = toString + " AR_PAYMENT_SCHEDULES_ALL THIS_PS " + "\n";
toString = toString + "WHERE THIS_PS.CUSTOMER_TRX_ID = p_customer_trx_id " +
"\n";
toString = toString + "AND OTHER_CT.PREVIOUS_CUSTOMER_TRX_ID =
p_previous_customer_trx_id " + "\n";
toString = toString + "AND OTHER_CT.CUSTOMER_TRX_ID =
OTHER_PS.CUSTOMER_TRX_ID " + "\n";
toString = toString + "AND OTHER_PS.CREATION_DATE >
THIS_PS.CREATION_DATE;";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARPT_SQL_FUNC_UTIL",
"PACKAGE_BODY",
5,
fromString,
toString,
true,
false);
// below text mod works only for 11i -- need to check if r12 also has same performance
issue in bug35628
fromString =
"(?i)select\\s*bs\\.name\\s*into\\s*l_bs_name\\s*from\\s*ra_customer_trx\\s*ct,\\s*.*\\s*.*\\
s*and\\s*ct\\.customer_trx_id\\s*=\\s*\\(select\\s*max\\(ctt\\.customer_trx_id\\)\\s*.*\\s*.*\\s
*.*\\s*and\\s*aa\\.customer_trx_id\\s*=\\s*ctt\\.customer_trx_id\\s*\\)";
toString = "SELECT /*+ ordered */ bs.NAME" + "\n";
toString = toString + " into l_bs_name" + "\n";
toString = toString + " FROM" + "\n";
toString = toString + " (SELECT /*+ ordered */ MAX(CTT.CUSTOMER_TRX_ID)
CUSTOMER_TRX_ID" + "\n";
toString = toString + " FROM AR_ADJUSTMENTS AA,RA_CUSTOMER_TRX CTT
" + "\n";
toString = toString + " WHERE AA.CHARGEBACK_CUSTOMER_TRX_ID =
p_customer_trx_id" + "\n";
toString = toString + " AND AA.CUSTOMER_TRX_ID = CTT.CUSTOMER_TRX_ID
) ct1," + "\n";
toString = toString + " RA_CUSTOMER_TRX ct, RA_BATCH_SOURCES bs " +
"\n";
toString = toString + " WHERE ct.BATCH_SOURCE_ID = bs.BATCH_SOURCE_ID
" + "\n";
toString = toString + " AND ct.CUSTOMER_TRX_ID = ct1.CUSTOMER_TRX_ID";
/*ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARPT_SQL_FUNC_UTIL",
"PACKAGE_BODY",
6,
fromString,
toString,
true,
false);
removing the text mod for now for r12*/
} // 111.N and r12

ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_PS_PKG",
"PACKAGE_BODY",

20
Business Flow Info
1,
"(?i)FOR UPDATE OF PS.STATUS NOWAIT",
"/* FOR UPDATE OF PS.STATUS NOWAIT */ ",
true,
true);

ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_PS_PKG",
"PACKAGE_BODY",
2,
"(?i)FOR UPDATE OF payment_schedule_id NOWAIT",
"/* FOR UPDATE OF payment_schedule_id NOWAIT */ ",
true,
false);

ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_PS_PKG",
"PACKAGE_BODY",
3,
"(?i)FOR UPDATE OF PS.amount_due_remaining
NOWAIT",
"/* FOR UPDATE OF PS.amount_due_remaining NOWAIT */
",
true,
false);

// SI specific text mod for RA_CUSTOMER_TRX_PARTIAL_V


if (((appRelease == "11i") &&(configName == "SI")) || ((appRelease == "11i") &&
(arPatchLevel < "N"))) {
println("SI or 11i<N");
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"RA_CUSTOMER_TRX_PARTIAL_V",
"VIEW",
1,
"(?i)\\bSELECT\\b",
"SELECT /*+ ordered first_rows */ ",
true,
true);
fromString = "(?i)FROM[\\s]*?[\n]*?[\\s]*?.RA_CUST.*.[^\$]*?[\\s]*?WHERE";
// ending newline not reqd for tostring below
toString = "FROM ra_customer_trx ct, ra_cust_trx_line_gl_dist gd, ra_customer_trx
ct_rel, hz_cust_accounts rac_bill, hz_parties rac_bill_party, hz_cust_accounts rac_ship,
hz_parties rac_ship_party, hz_cust_accounts rac_sold,";
toString = toString + " hz_parties rac_sold_party, hz_cust_accounts rac_paying,
hz_parties rac_paying_party, hz_cust_site_uses su_bill, hz_cust_site_uses su_ship,
hz_cust_site_uses su_paying, hz_cust_acct_sites raa_bill,";
toString = toString + " hz_party_sites raa_bill_ps, hz_locations raa_bill_loc,
fnd_territories_vl ft_bill, hz_cust_acct_sites raa_ship, hz_party_sites raa_ship_ps,
hz_locations raa_ship_loc, fnd_territories_vl ft_ship,";
toString = toString + " hz_cust_acct_sites raa_remit, hz_party_sites raa_remit_ps,
hz_locations raa_remit_loc, fnd_territories_vl ft_remit, hz_cust_account_roles raco_ship,
hz_relationships raco_ship_rel, hz_parties raco_ship_party,";
toString = toString + " hz_cust_account_roles raco_bill, hz_relationships raco_bill_rel,
hz_parties raco_bill_party, ap_bank_accounts apba, ap_bank_branches apb,
ar_receipt_methods arm, ar_receipt_classes arc,ra_batch_sources bs,";
toString = toString + " ra_batches rab, ra_cust_trx_types ctt, ra_terms rat,
so_agreements soa, org_freight orf, gl_daily_conversion_types gdct, ar_lookups al_fob,
ar_lookups al_tax WHERE";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"RA_CUSTOMER_TRX_PARTIAL_V",
"VIEW",
2,
fromString,
toString,
true,
false,
null,

21
Business Flow Info
1);
} // SI specific text mod for RA_CUSTOMER_TRX_PARTIAL_V

ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"RA_CUSTOMER_TRX_V",
"VIEW",
1,
"(?i)SELECT CT",
"SELECT /*+ ORDERED */ CT",
true,
true);

if (utils.objectExists(INTF_DB,"APPS", "VIEW","RA_CUST_TRX_LINE_V")) {
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"RA_CUST_TRX_LINE_V",
"VIEW",
1,
"(?i)SELECT RCTL",
"SELECT /*+ ORDERED */ RCTL",
true,
true);
}

fromString = "(?i)\\(select 1[\$]*?[\\s]+?[\\s]+?from[\\s]+?ar_receivable_applications ra,";


toString = "(select /*+ ORDERED USE_NL( AR_RECEIVABLE_APPLICATIONS
AR_PAYMENT_SCHEDULES ) */ 1" + "\n";
toString = toString + "from ar_receivable_applications ra,";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_PROCESS_RCTS",
"PACKAGE_BODY",
1,
fromString,
toString,
true,
false);

fromString = "nvl\\(sum\\(rec\\.acctd_amount_applied_from";
toString = "/*+ ORDERED */ nvl(sum(rec.acctd_amount_applied_from";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_BAL_UTIL",
"PACKAGE_BODY",
1,
fromString,
toString,
true,
true);

fromString = "nvl\\(sum\\(rec\\.line_applied";
toString = "/*+ ORDERED */ nvl(sum(rec.line_applied";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_BAL_UTIL",
"PACKAGE_BODY",
2,
fromString,
toString,
true,
true);

fromString = "(?i)SELECT PS";


toString = "SELECT /*+ ORDERED */ PS";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_PAYMENT_SCHEDULES_PMT_V",
"VIEW",

22
Business Flow Info
1,
fromString,
toString,
true,
true,
null,
1);

if (appRelease == "11i") {
fromString = "(?i)ar_lookups al_risk_receipt, ar_cons_inv_all cons, ar_receipt_methods
rm, ar_batch_sources_all bs, ar_batches_all arb2, ar_cash_receipt_history_all crh,
ar_cash_receipt_history_all crh_current,.*.ar_cash_receipts_all cr, hz_cust_site_uses_all
su, hz_cust_accounts cust_acct, hz_parties party, ar_payment_schedules_all ps,
ar_cash_receipt_history_all crh_remit, ar_batches_all arb_remit, fnd_currencies fc";
toString = "ar_payment_schedules_all ps, ar_cons_inv_all cons, ar_cash_receipts_all cr,
hz_cust_site_uses_all su, hz_cust_accounts cust_acct, hz_parties party,
ar_cash_receipt_history_all crh, ar_batches_all arb2, ar_batch_sources_all bs,
ar_receipt_methods rm, ar_cash_receipt_history_all crh_current, /* current_record */
ar_lookups al_risk_receipt, ar_cash_receipt_history_all crh_remit, ar_batches_all
arb_remit, fnd_currencies fc";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_PAYMENT_SCHEDULES_PMT_V",
"VIEW",
2,
fromString,
toString,
true,
false,
null,
1);
}
else if (appRelease == "R12") {
fromString = "(?i)ar_lookups al_risk_receipt, ar_cons_inv_all cons, ar_receipt_methods
rm, ar_batch_sources_all bs, ar_batches_all arb2, ar_cash_receipt_history_all crh,
ar_cash_receipt_history_all crh_current,.*.ar_cash_receipts_all cr, hz_cust_site_uses_all
su, hz_cust_accounts cust_acct, hz_parties party, ar_payment_schedules ps,
ar_cash_receipt_history_all crh_remit, ar_batches_all arb_remit, fnd_currencies fc";
toString = "ar_payment_schedules ps, ar_cons_inv_all cons, ar_cash_receipts_all cr,
hz_cust_site_uses_all su, hz_cust_accounts cust_acct, hz_parties party,
ar_cash_receipt_history_all crh, ar_batches_all arb2, ar_batch_sources_all bs,
ar_receipt_methods rm, ar_cash_receipt_history_all crh_current, /* current_record */
ar_lookups al_risk_receipt, ar_cash_receipt_history_all crh_remit, ar_batches_all
arb_remit, fnd_currencies fc";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_PAYMENT_SCHEDULES_PMT_V",
"VIEW",
2,
fromString,
toString,
true,
false,
null,
1);
} // R12 text mod for AR_PAYMENT_SCHEDULES_PMT_V

fromString = "SELECT PS";


toString = "SELECT /*+ ORDERED */ PS";

ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_PAYMENT_SCHEDULES_V",
"VIEW",
1,
fromString,
toString,
false,
true,
null,

23
Business Flow Info
1);
if (appRelease == "11i") {
fromString = "ar_lookups al_status, ar_collectors ar_coll, ar_cons_inv_all cons,
ra_cust_trx_types_all ctt, ra_batch_sources_all bs, ra_customer_trx_all ct,
hz_cust_site_uses_all su, hz_cust_accounts cust_acct, hz_parties party,
ar_payment_schedules_all ps";
toString = "ar_payment_schedules_all ps, ar_lookups al_status, ar_collectors ar_coll,
ar_cons_inv_all cons, hz_cust_site_uses_all su, ra_customer_trx_all ct,
ra_cust_trx_types_all ctt, ra_batch_sources_all bs, hz_cust_accounts cust_acct,
hz_parties party";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_PAYMENT_SCHEDULES_V",
"VIEW",
2,
fromString,
toString,
true,
false);

fromString = "ar_lookups al_risk_receipt, ar_cons_inv_all cons, ar_receipt_methods rm,


ar_batch_sources_all bs, ar_batches_all arb2, ar_cash_receipt_history_all crh,
ar_cash_receipt_history_all crh_current,.*.ar_cash_receipts_all cr, hz_cust_site_uses_all
su, hz_cust_accounts cust_acct, hz_parties party, ar_payment_schedules_all ps,
ar_cash_receipt_history_all crh_remit, ar_batches_all arb_remit, fnd_currencies fc";
toString = "ar_payment_schedules_all ps, ar_cash_receipts_all cr,
ar_cash_receipt_history_all crh, ar_receipt_methods rm, ar_cash_receipt_history_all
crh_current, /* current_record */ ar_lookups al_risk_receipt, ar_cons_inv_all cons,
ar_batch_sources_all bs, ar_batches_all arb2, hz_cust_site_uses_all su,
hz_cust_accounts cust_acct, hz_parties party, ar_cash_receipt_history_all crh_remit,
ar_batches_all arb_remit, fnd_currencies fc";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_PAYMENT_SCHEDULES_V",
"VIEW",
3,
fromString,
toString,
true,
false);
} else if (appRelease == "R12") {
fromString = "ar_lookups al_risk_receipt, ar_cons_inv_all cons, ar_receipt_methods rm,
ar_batch_sources_all bs, ar_batches_all arb2, ar_cash_receipt_history_all crh,
ar_cash_receipt_history_all crh_current,.*.ar_cash_receipts_all cr, hz_cust_site_uses_all
su, hz_cust_accounts cust_acct, hz_parties party, ar_payment_schedules ps,
ar_cash_receipt_history_all crh_remit, ar_batches_all arb_remit, fnd_currencies fc";
toString = "ar_payment_schedules ps, ar_cash_receipts_all cr,
ar_cash_receipt_history_all crh, ar_receipt_methods rm, ar_cash_receipt_history_all
crh_current, /* current_record */ ar_lookups al_risk_receipt, ar_cons_inv_all cons,
ar_batch_sources_all bs, ar_batches_all arb2, hz_cust_site_uses_all su,
hz_cust_accounts cust_acct, hz_parties party, ar_cash_receipt_history_all crh_remit,
ar_batches_all arb_remit, fnd_currencies fc";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_PAYMENT_SCHEDULES_V",
"VIEW",
2,
fromString,
toString,
false,
false);

} // R12 text mod for AR_PAYMENT_SCHEDULES_V

fromString = "SELECT PS";


toString = "SELECT /*+ ORDERED */ PS";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_PAYMENT_SCHEDULES_TRX2_V",
"VIEW",
1,

24
Business Flow Info
fromString,
toString,
true,
false,
null,
1);

if (appRelease == "11i") {
fromString = "ar_lookups al_status, ar_collectors ar_coll, ar_cons_inv_all cons,
ra_cust_trx_types_all ctt, ra_batch_sources_all bs, ra_customer_trx_all ct,
hz_cust_site_uses_all su, hz_cust_accounts cust_acct, hz_parties party,
ar_payment_schedules_all ps";
toString = "ar_payment_schedules_all ps, ar_lookups al_status, ar_collectors ar_coll,
ar_cons_inv_all cons, hz_cust_site_uses_all su, ra_customer_trx_all ct,
ra_cust_trx_types_all ctt, ra_batch_sources_all bs, hz_cust_accounts cust_acct,
hz_parties party";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_PAYMENT_SCHEDULES_TRX2_V",
"VIEW",
2,
fromString,
toString,
true,
false);
}

fromString = "(?i)\\/\\*\\+ INDEX.*.ORDERED\\*\\/";


toString = "/*+ INDEX(AR_RECEIVABLE_APPLICATIONS
AR_RECEIVABLE_APPLICATIONS_N1) INDEX(AR_PAYMENT_SCHEDULES
AR_PAYMENT_SCHEDULES_U1 AR_PAYMENT_SCHEDULES_N2
AR_PAYMENT_SCHEDULES_N6) INDEX(AR_CASH_RECEIPTS
AR_CASH_RECEIPTS_U1) INDEX(RA_CUSTOMER_TRX RA_CUSTOMER_TRX_U1)
INDEX(CTT RA_CUST_TRX_TYPES_U1) INDEX(BS RA_BATCH_SOURCES_U2)
INDEX(SU HZ_CUST_SITE_USES_U1) INDEX(T RA_TERMS_U1) INDEX(ART
AR_RECEIVABLES_TRX_U1) ORDERED */";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_RECEIVABLE_APPLICATIONS_V",
"VIEW",
1,
fromString,
toString,
true,
false);

fromString = "(?i)SELECT nvl\\(sum\\(lgd.amount\\), 0\\)";


toString = "SELECT /*+ ORDERED FIRST_ROWS */ nvl(sum(lgd.amount), 0)";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_TRX_SUM_UTIL",
"PACKAGE_BODY",
1,
fromString,
toString,
true,
true);

fromString = "(?i)where cash_receipt_id=p_cash_receipt_id";


toString = "where cash_receipt_id=p_cash_receipt_id group by cash_receipt_id";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
1,
fromString,
toString,
false,
true);

fromString = "(?i)ar_mrc_engine2.maintain_mrc_data2";

25
Business Flow Info
toString = "/* ar_mrc_engine2.maintain_mrc_data2";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
2,
fromString,
toString,
false,
true);

fromString = "(?i)p_row_info => l_ard_rec\\);";


toString = "p_row_info => l_ard_rec); */";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
3,
fromString,
toString,
false,
true);

fromString = "(?i)p_row_info => ard_tbl_tbl\\(l_ctr\\) \\);";


toString = "p_row_info => ard_tbl_tbl(l_ctr) ); */";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
4,
fromString,
toString,
false,
true);

fromString = "(?i)p_row_info => l_ard_rec \\);";


toString = "p_row_info => l_ard_rec ); */";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
5,
fromString,
toString,
false,
true);

fromString = "(?i)p_row_info => l_ard_tax_rec \\);";


toString = "p_row_info => l_ard_tax_rec ); */";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
6,
fromString,
toString,
false,
true);

fromString = "(?i)p_row_info => ard_tbl_tbl\\(l_ctr\\) \\);";


toString = "p_row_info => ard_tbl_tbl(l_ctr) ); */";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
7,
fromString,
toString,
false,
true);

26
Business Flow Info
fromString = "(?i)arp_misc_cash_dist_pkg";
toString = "null; -- arp_misc_cash_dist_pkg";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
8,
fromString,
toString,
false,
true);

fromString = "(?i)ARP_DISTRIBUTIONS_PKG";
toString = "null; -- ARP_DISTRIBUTIONS_PKG";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
9,
fromString,
toString,
false,
true);

// group by in fromstr got added because of textmod#1


fromString = "(?i)select code_combination_id into return_value\\s* from
ar_distributions\\s* where source_id in \\(select MIN\\(misc_cash_distribution_id\\)\\s*
from ar_misc_cash_distributions\\s*where cash_receipt_id=p_cash_receipt_id group by
cash_receipt_id\\)\\s*and SOURCE_TABLE\\s*=\\s*'MCD'\\s*and
SOURCE_TYPE\\s*=\\s*'TAX'\\s*;";
toString = "select code_combination_id into return_value" + "\n";
toString = toString + "from ar_distributions, (select MIN(misc_cash_distribution_id)
min_cdid" + "\n";
toString = toString + "from ar_misc_cash_distributions" + "\n";
toString = toString + "where cash_receipt_id=p_cash_receipt_id) tab_b" + "\n";
toString = toString + "where ar_distributions.source_id = tab_b.min_cdid" + "\n";
toString = toString + "and SOURCE_TABLE = 'MCD'" + "\n";
toString = toString + "and SOURCE_TYPE = 'TAX';" + "\n";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
10,
fromString,
toString,
false,
false);

// group by in fromstr got added because of textmod#1


// older versions of ar_misc_cash_dist doesn't have a MIN
fromString = "(?i)select code_combination_id into return_value\\s*from
ar_distributions\\s*where source_id in \\(select misc_cash_distribution_id\\s* from
ar_misc_cash_distributions\\s*where cash_receipt_id=p_cash_receipt_id group by
cash_receipt_id\\)\\s*and SOURCE_TABLE\\s*=\\s*'MCD'\\s*and
SOURCE_TYPE\\s*=\\s*'TAX'\\s*;";
toString = "select code_combination_id into return_value" + "\n";
toString = toString + "from ar_distributions, (select MIN(misc_cash_distribution_id)
min_cdid" + "\n";
toString = toString + "from ar_misc_cash_distributions" + "\n";
toString = toString + "where cash_receipt_id=p_cash_receipt_id) tab_b" + "\n";
toString = toString + "where ar_distributions.source_id = tab_b.min_cdid" + "\n";
toString = toString + "and SOURCE_TABLE ='MCD'" + "\n";
toString = toString + "and SOURCE_TYPE = 'TAX';" + "\n";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_MISC_CASH_DIST",
"PACKAGE_BODY",
11,
fromString,
toString,
false,

27
Business Flow Info
false);

if (utils.objectExists(INTF_DB,"APPS", "PACKAGE","ARP_ARXVASUM")) {

fromString = "(?i)select\\s*?decode\\(p_currency_code";
toString = "select /*+ ORDERED */ decode(p_currency_code";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_ARXVASUM",
"PACKAGE_BODY",
1,
fromString,
toString,
true,
false,
null,
2);

fromString = "(?i)SELECT 'Y'";


toString = "select /*+ ORDERED */ 'Y'";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_ARXVASUM",
"PACKAGE_BODY",
2,
fromString,
toString,
true,
false,
null,
1);

fromString =
"(?i)from\\s*?ar_cash_receipts\\s*?cr,.*\n\\s*?ar_payment_schedules\\s*?ps.*\n\\s*?wher
e ";
toString = "from ar_payment_schedules ps, ar_cash_receipts cr where";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_ARXVASUM",
"PACKAGE_BODY",
3,
fromString,
toString,
true,
false,
null,
1);
} // if ARP_ARXVASUM exists

fromString = "(?i)SELECT ";


toString = "SELECT /*+ ORDERED use_nl */ ";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_APP_ADJ_V",
"VIEW",
1,
fromString,
toString,
true,
true);
if (appRelease == "11i") {
fromString = "(?i)FROM ra_customer_trx ct.*.ar_receivable_applications app,
ar_cash_receipt_history crh WHERE";
toString = "FROM ar_receivable_applications app, ar_payment_schedules ps,
ar_cash_receipts cr, ra_customer_trx ct, ra_customer_trx_lines ctl, ra_cust_trx_types ctt,
ar_receipt_methods rm, ar_cash_receipt_history crh WHERE";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_APP_ADJ_V",
"VIEW",
2,

28
Business Flow Info
fromString,
toString,
false,
false);

fromString = "(?i)FROM ra_customer_trx ct.*.ar_payment_schedules ps,


ar_receivable_applications app WHERE";
toString = "FROM ar_receivable_applications app, ar_payment_schedules ps,
ra_customer_trx ct, ra_customer_trx_lines rtl, ra_cust_trx_types ctt WHERE";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_APP_ADJ_V",
"VIEW",
3,
fromString,
toString,
false,
false);

fromString = "(?i)FROM ar_payment_schedules ps.*.ar_payment_schedules psa,


ar_receivable_applications app WHERE";
toString = "FROM ar_payment_schedules ps, ar_receivable_applications app,
ar_payment_schedules psa WHERE";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_APP_ADJ_V",
"VIEW",
4,
fromString,
toString,
false,
false);

fromString = "(?i)FROM ar_payment_schedules ps.*.ar_payment_schedules psa,


ar_receivable_applications app, ar_receivables_trx art WHERE";
toString = "FROM ar_payment_schedules ps, ar_receivable_applications app,
ar_receivables_trx art, ar_payment_schedules psa WHERE";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_APP_ADJ_V",
"VIEW",
5,
fromString,
toString,
false,
false);
} else if (appRelease == "R12") {
fromString = "(?i)FROM ra_customer_trx ct.*.ar_receivable_applications app,
ar_cash_receipt_history crh WHERE";
toString = "FROM ar_receivable_applications app, ar_payment_schedules ps,
ar_cash_receipts cr, ra_customer_trx ct, ra_customer_trx_lines ctl, ra_cust_trx_types ctt,
ar_receipt_methods rm, fnd_user fu, ar_cash_receipt_history crh WHERE";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_APP_ADJ_V",
"VIEW",
2,
fromString,
toString,
false,
true);

fromString = "(?i)FROM ra_customer_trx ct.*.ar_payment_schedules ps,


ar_receivable_applications app WHERE";
toString = "FROM ar_receivable_applications app, ar_payment_schedules ps,
ra_customer_trx ct, ra_customer_trx_lines rtl,fnd_user fu, ra_cust_trx_types ctt
WHERE";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_APP_ADJ_V",
"VIEW",

29
Business Flow Info
3,
fromString,
toString,
false,
true);

fromString = "(?i)FROM ar_payment_schedules ps.*.ar_payment_schedules psa,


ar_receivable_applications app WHERE";
toString = "FROM ar_payment_schedules ps, ar_receivable_applications app, fnd_user
fu,ar_payment_schedules psa WHERE";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_APP_ADJ_V",
"VIEW",
4,
fromString,
toString,
false,
false);

fromString = "(?i)FROM ar_payment_schedules ps.*.ar_payment_schedules psa,


ar_receivable_applications app, ar_receivables_trx art WHERE";
toString = "FROM ar_payment_schedules ps, ar_receivable_applications app,
ar_receivables_trx art, fnd_user fu,ar_payment_schedules psa WHERE";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_APP_ADJ_V",
"VIEW",
5,
fromString,
toString,
false,
false);
} // R12 text mods for ar_app_adj_v

if (utils.objectExists(INTF_DB,"APPS", "VIEW","HZ_PARTY_WF_USER_ROLES_V")) {
String partQry = """select partition_position-1 part_pos from all_tab_partitions where
table_name = 'WF_LOCAL_ROLES' and partition_name = 'HZ_PARTY'""";
def partitionId = INTF_DB.firstRow(partQry).part_pos;
fromString = "(?i)PARTITION \\(HZ_PARTY\\)";
toString = "where partition_id = " + partitionId;
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"HZ_PARTY_WF_USER_ROLES_V",
"VIEW",
1,
fromString,
toString,
true,
true);
}

if (appRelease == "R12") {
fromString = "(?i)app\\.rowid";
toString = "app.row_id";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"AR_ADD_FETCH_SELECT",
"PACKAGE_BODY",
1,
fromString,
toString,
true,
false);
}

// get hist schema name for oltp schema AR


String histQry = """
select target_schema
from obtpa_owner_map om
,obtpa_environment_sources e

30
Business Flow Info
where e.name = '${ENVIRONMENT_NAME}'
and om.environment_source_id = e.id
and om.owner_type = 'HISTORY'
and om.base_schema = 'AR'
"""
def histSchema = "";

REPOS_DB.eachRow(histQry) { row ->


histSchema = row.target_schema
}

// in case of multi-source we need to do history schema mapping before the deployment


of modules in each environment
// in case of non-multi source we will use the default value for history schema name as
AR_HIST

if (histSchema == "") {
// its not a multi-source configuration
// so we pickup the default value for history schema

histSchema = "AR_HIST";
// throw new IllegalStateException("Hist Schema name is:"+ histSchema);
}
println("AR Hist Schema: "+histSchema);

//DI specific text mods for arp_bal_util


if ((configName == "DI") && (((appRelease == "11i") && (arPatchLevel >= "N")) ||
(appRelease == "R12")) ) {

fromString =
"SELECT\\s*?SUM\\(.*\n\\s*?DECODE\\(.*\n\\s*?ct\\.complete_flag,\n.*\n\\s*?DECODE\\(.
*\n\\s*?ctl\\.line_type,\n.*\n.*\n\\s*?ctl\\.extended_amount";
fromString = fromString +
"\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*
\n.*\n.*\n.*";
fromString = fromString +
"FROM\\s*?ra_customer_trx_lines\\s*?ctl,\n\\s*?ra_cust_trx_line_gl_dist\\s*?rec,\n\\s*?ra
_customer_trx\\s*?ct\n\\s*?";
fromString = fromString +
"WHERE\\s*?ct\\.customer_trx_id.*\n.*AND\\s*?ct\\.customer_trx_id.*\n.*rec\\.account_cl
ass.*\n.*rec\\.latest_rec_flag.*\n.*";
fromString = fromString + "ct\\.previous_customer_trx_id\\s*?=\\s*?p_customer_trx_id";

toString = "SELECT '_obt_temp_string_'" + "\n";


toString = toString + "INTO l_line_credits1, l_tax_credits1, l_freight_credits1" + "\n";
toString = toString + "FROM (select /*+ ORDERED */ ct.complete_flag , ctl.line_type ,
ct.previous_customer_trx_id ," + "\n";
toString = toString + "sum(nvl(ctl.extended_amount, 0)) extended_amount" + "\n";
toString = toString + "from " + histSchema + ".RA_CUSTOMER_TRX_ALL@" +
dblinkName + " ct" + "\n";
toString = toString + ", " + histSchema + ".RA_CUSTOMER_TRX_LINES_ALL@" +
dblinkName + " ctl" + "\n";
toString = toString + ", " + histSchema + ".RA_CUST_TRX_LINE_GL_DIST_all@" +
dblinkName + " rec" + "\n";
toString = toString + "WHERE CT.CUSTOMER_TRX_ID = CTL.CUSTOMER_TRX_ID" +
"\n";
toString = toString + "AND CT.CUSTOMER_TRX_ID = REC.CUSTOMER_TRX_ID" +
"\n";
toString = toString + "AND REC.ACCOUNT_CLASS = 'REC' AND
REC.LATEST_REC_FLAG = 'Y'" + "\n";
toString = toString + "AND NVL(ct.ORG_ID,NVL(TO_NUMBER(DECODE(
SUBSTRB(USERENV('CLIENT_INFO'), 1,1),' ', NULL,
SUBSTRB(USERENV('CLIENT_INFO'),1,10))),-99)) = NVL(TO_NUMBER(DECODE(
SUBSTRB(USERENV('CLIENT_INFO'),1,1) ,' ',NULL,
SUBSTRB(USERENV('CLIENT_INFO'),1,10))),-99)" + "\n";
toString = toString + "group by ct.complete_flag, ctl.line_type,
ct.previous_customer_trx_id" + "\n";
toString = toString + "UNION ALL" + "\n";
toString = toString + "select /*+ ORDERED */ ct.complete_flag , ctl.line_type ,
ct.previous_customer_trx_id" + "\n";
toString = toString + ", sum(nvl(ctl.extended_amount, 0)) extended_amount" + "\n";

31
Business Flow Info
toString = toString + "from " + packageOwner + ".RA_CUSTOMER_TRX CT, " + "\n";
toString = toString + packageOwner + ".RA_CUSTOMER_TRX_LINES CTL , " + "\n";
toString = toString + packageOwner + ".RA_CUST_TRX_LINE_GL_DIST REC " + "\n";
toString = toString + "WHERE CT.CUSTOMER_TRX_ID = CTL.CUSTOMER_TRX_ID "
+ "\n";
toString = toString + "AND CT.CUSTOMER_TRX_ID = REC.CUSTOMER_TRX_ID AND
REC.ACCOUNT_CLASS = 'REC'" + "\n";
toString = toString + "AND REC.LATEST_REC_FLAG = 'Y'" + "\n";
toString = toString + "group by ct.complete_flag, ctl.line_type,
ct.previous_customer_trx_id" + "\n";
toString = toString + ") ctall" + "\n";
toString = toString + "where CTall.PREVIOUS_CUSTOMER_TRX_ID =
p_customer_trx_id" + "\n";

ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_BAL_UTIL",
"PACKAGE_BODY",
3,
fromString,
toString,
true,
false);

fromString = "'_obt_temp_string_'";
toString = "SUM( DECODE( ctall.complete_flag, 'N', 0, DECODE( ctall.line_type, 'TAX',
0, 'FREIGHT', 0, ctall.extended_amount)))," + "\n";
toString = toString + "SUM( DECODE( ctall.complete_flag, 'N', 0, DECODE(
ctall.line_type, 'TAX', ctall.extended_amount, 0)))," + "\n";
toString = toString + "SUM( DECODE( ctall.complete_flag, 'N', 0, DECODE(
ctall.line_type, 'FREIGHT', ctall.extended_amount, 0)))";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_BAL_UTIL",
"PACKAGE_BODY",
4,
fromString,
toString,
true,
false);

fromString =
"SELECT\\s*?SUM\\(\\s*?\n\\s*?DECODE\\(\n\\s*?ct\\.complete_flag,\\s*?\n.*\n\\s*?DEC
ODE.*\n\\s*?ctl\\.customer_trx_line_id";
toString = "SELECT /*+ ORDERED USE_CONCAT */ SUM( DECODE(
ct.complete_flag,'N', 0," + "\n";
toString = toString + "DECODE( -- only use the original lines" + "\n";
toString = toString + " ctl.customer_trx_line_id";
ArchiveAccessConfiguration.addTextReplacer(null,
packageOwner,
"ARP_BAL_UTIL",
"PACKAGE_BODY",
5,
fromString,
toString,
true,
false);

} // DI specific text mods for arp_bal_util

//Adding Object Exclusions


//println("Adding Object Exclusions...");

ArchiveAccessConfiguration.commit();
ArchiveAccessConfiguration.closeSession();

//Adding Index Exclusions


println("Adding Index Exclusions...");

32
Business Flow Info

if (configName == "DI") {

LiveArchiveJobManager.createSession("",ENVIRONMENT_NAME);
//usage - LiveArchiveJobManager.addExcludedIndex(envID, tableCatalog, tableSchema,
tableName, indexCatalog, indexSchema, indexName);

LiveArchiveJobManager.addExcludedIndex(ENVIRONMENT_NAME,
null,
"AR",
"RA_CUSTOMER_TRX_ALL",
null,
"AR",
"RA_CUSTOMER_TRX_N14"
);

if (utils.objectExists(INTF_DB,"AR", "INDEX","RA_CUSTOMER_TRX_N21")) {
LiveArchiveJobManager.addExcludedIndex(ENVIRONMENT_NAME,
null,
"AR",
"RA_CUSTOMER_TRX_ALL",
null,
"AR",
"RA_CUSTOMER_TRX_N21"
);
}

if (utils.objectExists(INTF_DB,"AR", "INDEX","RA_CUSTOMER_TRX_N23")) {
LiveArchiveJobManager.addExcludedIndex(ENVIRONMENT_NAME,
null,
"AR",
"RA_CUSTOMER_TRX_ALL",
null,
"AR",
"RA_CUSTOMER_TRX_N23"
);
}

LiveArchiveJobManager.commit();

LiveArchiveJobManager.closeSession();
}

println("Archive Access stuff ends...");


// -- Archive Access stuff ends ---
Install annotation This is the installation script which gets executed during the deployment of
ReceivablesArchive businessflow. It creates metadata required for the archive access
layer for AR module. It includes adding dependent objects as primary objects, adding
text replacers for packages/views, excluding objects/indexes etc. This script would also
create a package in APPS schema which does dummy apps initialization required by
some of the database triggers and further it also loads the metadata for the code pointing
to this package.

3.1.1.1. Business Flow Diagram

33
34
3.1.1.2. Parameters used in Business Flow Actvities (and Model Compatibilities)

Parameters used
pcAdjustmentGLDate,
pcCommitmentRelatedTrx,
pcCommitmentTrx,
pcCompletedTrx,
pcCreateSummaryTableAR,
pcMonthsToRetain,
pcPauseAfterSelectionAR,
pcPauseAfterSummaryTablePopAR,
pcPostableApplicationGLDate,
pcPostableDistributionGLDate,
pcPostableReceiptHistoryGLDate,
pcReceiptCurrHistStatus,
pcReceiptPaySchedClosed,
pcReceiptRefInCE,
pcRunningTotal,
pcTrxInPaySched,
pcTrxLineAutoruleComplete,
pcTrxPaySchedClass,
pcTrxPaySchedClosed,
pcTrxPaySchedGLDate,
pcTrxRevenueComplete,
prCustomerId,
prCutOffDate,
prOrgId,
prTrxDateFrom,
prTrxDateTo

3.1.1.3. Order of Parameters for Business Flow Activities

Parameter Order
pcCommitmentTrx,
pcCompletedTrx,
pcMonthsToRetain,
pcRunningTotal,
pcTrxInPaySched,
pcTrxPaySchedClosed,
prCustomerId,
prCutOffDate,
prOrgId,
pcCommitmentRelatedTrx,
pcReceiptCurrHistStatus,
pcReceiptPaySchedClosed,
pcReceiptRefInCE,
pcAdjustmentGLDate,
pcPostableApplicationGLDate,
pcPostableDistributionGLDate,
pcPostableReceiptHistoryGLDate,
pcTrxLineAutoruleComplete,
pcTrxPaySchedClass,
pcTrxPaySchedGLDate,
pcTrxRevenueComplete,
pcPauseAfterSelectionAR,
pcCreateSummaryTableAR,
pcPauseAfterSummaryTablePopAR,
prTrxDateFrom,
prTrxDateTo

3.1.2. Business Flow Activities

35
3.1.2.1. Script Activity "OptionalParameter" Description

Code
import com.outerbay.api.*;
import groovy.sql.*
import java.text.SimpleDateFormat;
import java.lang.Float

def format = new SimpleDateFormat( "yyyy.MM.dd" )

if (prTrxDateFrom == NULL)
{
prTrxDateFrom=prTrxDateFrom=format.parse("1950.01.01")
}

if (prTrxDateTo == NULL)
{
prTrxDateTo=prCutOffDate
}

3.1.2.2. Condition Activity "SumaryTableConditio" Description

Code
pcCreateSummaryTableAR=="Y"

3.1.2.2.1. Condition Activity "SumaryTableConditio" Diagram

3.1.2.2.2. Script Activity "CreateSummaryTable" Description

36
Code
import com.outerbay.api.*;
import groovy.sql.*
import java.text.SimpleDateFormat;
import java.lang.Float

utils = new oebsUtils();

packageOwner = " ";


String arSchema = "AR"

def format = new SimpleDateFormat( "MM/dd/yyyy" )

p_TRX_DATE_FROM = format.format(prTrxDateFrom)
p_TRX_DATE_TO = format.format(prTrxDateTo)

intfOwner = " ";

utils = new oebsUtils();

try
{
intfOwner = utils.getConnectionOwner(INTF_DB) ;
}
catch (Exception e)
{
println("Exception occured while getting the DB handlers.");
e.printStackTrace();
throw new IllegalStateException(println(e.getMessage()));

try
{
ConfigurationProperties.createSession("", ENVIRONMENT_NAME);
numWorkers = ConfigurationProperties.getProductConfigValue("LA","NUM_WORKERS");
/*selectionBatchSize = ConfigurationProperties.getProductConfigValue("LA","SEL_BATCH_SIZE");
packageOwner = ConfigurationProperties.getProductConfigValue("BusinessFlow", "pcEBSPackageOwner");
*/
ConfigurationProperties.closeSession();

println("numWorkers : "+numWorkers);
/*println("selectionBatchSize : "+selectionBatchSize);
println("packageOwner : "+packageOwner);
*/
}
catch (Exception e)
{
println("Exception occured while getting the config param values :"+ packageOwner+ " "+ "
"+selectionBatchSize+" "+numWorkers );
e.printStackTrace();
throw new IllegalStateException(println(e.getMessage()));
}

if
((utils.objectExists(INTF_DB,utils.getConnectionOwner(INTF_DB),"TABLE","OBT_RA_CUSTOMER_TRX_RU
NING_TOT")))
{
String a2 ="""truncate table OBT_RA_CUSTOMER_TRX_RUNING_TOT """
INTF_DB.execute(a2)
if
((utils.objectExists(INTF_DB,utils.getConnectionOwner(INTF_DB),"INDEX","OBT_CUSTOMER_TRX_ID_U1"))
)
{
String a3 ="""drop index OBT_CUSTOMER_TRX_ID_U1"""

37
Code
INTF_DB.execute(a3);
}
}

if (!(utils.objectExists(INTF_DB,utils.getConnectionOwner(INTF_DB),"TABLE","rct_temp")))
{
String a30 ="""CREATE TABLE RCT_TEMP (SEQNO NUMBER, CUSTOMER_TRX_ID NUMBER)"""
println(a30)
INTF_DB.execute(a30);
}

String a10 = """ alter session enable parallel dml """


println(a10)
INTF_DB.execute(a10)

if ((utils.objectExists(INTF_DB,utils.getConnectionOwner(INTF_DB),"TABLE","rct_temp")))
{
String a22 ="""truncate table rct_temp """
println(a22)
INTF_DB.execute(a22);
String a2 ="""insert /*+ parallel(RCT,${numWorkers}) */ into rct_temp rct select /*+
parallel(RCTl,${numWorkers}) */ ROWNUM SEQNO, customer_trx_id from ar.ra_customer_trx_all rctl
where org_id= ${prOrgId} and trx_date between cast(to_date('${p_TRX_DATE_FROM}','mm/dd/yyyy')
as date)
and cast(to_date('${p_TRX_DATE_TO}','mm/dd/yyyy') as date) """
println(a2)
INTF_DB.execute(a2);
INTF_DB.execute("COMMIT");
if (!(utils.objectExists(INTF_DB,utils.getConnectionOwner(INTF_DB),"INDEX","rct_temp_u1")))
{
String a3 ="""create /*+ parallel(${numWorkers}) */ unique index rct_temp_u1 on rct_temp(seqno)"""
println(a3)
INTF_DB.execute(a3);
}
}

String a101 = """ alter session enable parallel dml """


println(a101)
INTF_DB.execute(a101)

String insertRunningTot =
""" INSERT /*+ parallel(OBT_RCT,${numWorkers}) */ INTO OBT_RA_CUSTOMER_TRX_RUNING_TOT
obt_rct
select /*+ parallel(a,${numWorkers}) */ A.CUSTOMER_TRX_ID , ROUND(
( select /*+ parallel(gld,${numWorkers}) */ nvl(sum(nvl(gld.acctd_amount,0)),0) total
from ${arSchema}.RA_CUST_TRX_LINE_GL_DIST_ALL gld
where gld.customer_trx_id = A.CUSTOMER_TRX_ID
and gld.account_class = 'REC'
and gld.latest_rec_flag = 'Y'
)
+
(select /*+ parallel(adj,${numWorkers}) */ nvl(sum(nvl(adj.acctd_amount,0)),0) total
from ${arSchema}.AR_ADJUSTMENTS_ALL adj
where adj.customer_trx_id = A.CUSTOMER_TRX_ID
and adj.status in ('A', 'M', 'W')
)
+
( select /*+ parallel(rec,${numWorkers}) */ -1*nvl(sum(NVL(rec.acctd_amount_applied_to,0)), 0) total
from ${arSchema}.AR_RECEIVABLE_APPLICATIONS_ALL rec
where rec.applied_customer_trx_id = A.CUSTOMER_TRX_ID
and rec.application_type = 'CM'
)
+
( select /*+ parallel(rec,${numWorkers}) */ nvl(sum(NVL(rec.acctd_amount_applied_from,0)), 0) total
from ${arSchema}.AR_RECEIVABLE_APPLICATIONS_ALL rec
where rec.customer_trx_id = A.customer_trx_id
and rec.application_type = 'CM'
)

38
Code
+
(
select /*+ parallel(rec,${numWorkers}) */ -1 * nvl(sum(nvl(rec.acctd_amount_applied_to,0) +
NVL(rec.acctd_earned_discount_taken,0) + NVL(rec.acctd_unearned_discount_taken,0)),0) total
from ${arSchema}.AR_RECEIVABLE_APPLICATIONS_ALL rec
where rec.applied_customer_trx_id = A.CUSTOMER_TRX_ID
and rec.application_type = 'CASH'
and rec.status = 'APP'
), 99) a
from rct_temp A
"""
println(insertRunningTot)

INTF_DB.execute(insertRunningTot);
INTF_DB.execute("COMMIT")

String a11 = """ alter session disable parallel dml """


println(a11)
INTF_DB.execute(a11)

if
((utils.objectExists(INTF_DB,utils.getConnectionOwner(INTF_DB),"TABLE","OBT_RA_CUSTOMER_TRX_RU
NING_TOT")))
{
String a4 ="""CREATE UNIQUE INDEX /*+ parallel(${numWorkers}) */ OBT_CUSTOMER_TRX_ID_U1 ON
OBT_RA_CUSTOMER_TRX_RUNING_TOT(CUSTOMER_TRX_ID)"""
INTF_DB.execute(a4);
String a5 ="""begin
dbms_stats.gather_table_stats(ownname=>'${intfOwner}',tabname=>'OBT_RA_CUSTOMER_TRX_RUNING_T
OT',estimate_percent=>5,cascade=>true); end;"""
INTF_DB.execute(a5);
}

3.1.2.3. Interrupt Activity: "Pause"

Interrupt Activity
Type Pause
Message Job Paused
Condition
pcPauseAfterSummaryTablePopAR=="Y"

3.1.2.4. Cartridge Activity "ReceivableTransactionsArchive" Description

Cartridge Activity Info


Subjobs Selection
Cartridge reference Cartridge "ReceivableTransactionsArchive" definition

3.1.2.5. Interrupt Activity: "Pause"

Interrupt Activity
Type Pause
Message Job Paused

39
Interrupt Activity
Condition
pcPauseAfterSelectionAR=="Y"

Annotation
This Pause Activity would enable temporary pausing of the ReceivablesArchive business flow after the
selection job has completed for the cartridge ReceivableTransactionsArchive. One can resume the
businessflow by pressing the continue button for the job.

3.1.2.6. Script Activity "updateOltpTables" Description

40
Code
import groovy.sql.*

def intfSchema = ""


def selTable = ""
def oltpSchema = ""
def oltpTable = ""

// Get the name of Selection table for RA_CUSTOMER_TRX_ALL,AR_CASH_RECEIPT_HISTORY_ALL and


AR_CORR_PAY_SCHED_ALL

String query = """


Select m.base_table_name, m.base_table_schema, m.shadow_TABLE_SCHEMA,m.shadow_TABLE_NAME
from OBTPA_APPSPACKS a,
OBTPA_SHADOW_TABLE_MAP m,
OBTREP_INSTALLED_PRODUCTS p,
OBTPA_BUSFLOW_COMPONENTS bc,
OBTPA_BUSINESSFLOWS bf,
OBTREP_PRODUCTS b,
obtpa_environment_sources e
where b.product_name = 'LiveArchive'
and e.name = '${ENVIRONMENT_NAME}'
and b.id = p.product_id
and p.environment_source_id = e.id
and p.ID = a.INSTALLED_PRODUCT_ID
and a.id = bc.component_id
and bc.businessflow_id = bf.id
and bc.component_name = 'ReceivableTransactionsArchive'
and bf.businessflow_name = '${BUSINESS_FLOW_NAME}'
and m.appspack_id = a.id
and m.base_table_name in
('RA_CUSTOMER_TRX_ALL','AR_CASH_RECEIPT_HISTORY_ALL','AR_CORR_PAY_SCHED_ALL')
and m.table_type ='selectionOLTP'

"""

//println(query)
println("current runid:"+CURRENT_RUN_ID);

// start of query cursor


REPOS_DB.eachRow(query) { row ->

oltpSchema = row.BASE_TABLE_SCHEMA
oltpTable = row.BASE_TABLE_NAME
intfSchema = row.SHADOW_TABLE_SCHEMA
selTable = row.SHADOW_TABLE_NAME

if (oltpTable == "RA_CUSTOMER_TRX_ALL") {
// update ra_batches on oltp

String updStmnt = """


Update ${oltpSchema}.ra_batches_all rb
set rb.purged_children_flag = 'Y'
where rb.batch_id in (select distinct rct.batch_id
from ${oltpSchema}.${oltpTable} rct, ${intfSchema}.${selTable} rct_sel
where rct.rowid = rct_sel.obt_saved_rowid)

"""
// println(updStmnt)

INTF_DB.execute(updStmnt)

// println("Updated data")

INTF_DB.execute("COMMIT")

// println("commited")

println("Done updating ra_batches");

}
else if (oltpTable == "AR_CASH_RECEIPT_HISTORY_ALL") {

41
Code
// update ar_batches on oltp

String updStmnt = """


Update ${oltpSchema}.ar_batches_all ab
set ab.purged_children_flag = 'Y'
where ab.batch_id in (select distinct crh.batch_id
from ${oltpSchema}.${oltpTable} crh, ${intfSchema}.${selTable} crh_sel
where crh.rowid = crh_sel.obt_saved_rowid)

"""
// println(updStmnt)

INTF_DB.execute(updStmnt)

// println("Updated data")

INTF_DB.execute("COMMIT")

// println("commited")
println("Done updating ar_batches");
}
else if (oltpTable == "AR_CORR_PAY_SCHED_ALL") {
// update ar_correspondences on oltp

String updStmnt = """


Update ${oltpSchema}.ar_correspondences_all ac
set ac.purged_children_flag = 'Y'
where ac.correspondence_id in (select distinct cps.correspondence_id
from ${oltpSchema}.${oltpTable} cps, ${intfSchema}.${selTable} cps_sel
where cps.rowid = cps_sel.obt_saved_rowid)

"""
// println(updStmnt)

INTF_DB.execute(updStmnt)

//println("Updated data")

INTF_DB.execute("COMMIT")

//println("commited")
println("Done updating ar_correspondences");
}

} // end of query cursor


Annotation
This script will set the purged_children_flag to Y for partially purged batches. This is done for 3 tables
ra_batches_all, ar_batches_all and ar_correspondences_all based on the rows selected for archive in the
tables ra_customer_trx_all, ar_cash_Receipt_history_all and ar_corr_pay_sched_all respectively.

3.1.2.7. Cartridge Activity "ReceivableTransactionsArchive" Description

Cartridge Activity Info


Subjobs Archive,
Clean Up
Cartridge reference Cartridge "ReceivableTransactionsArchive" definition

3.1.2.8. Cartridge Activity "TransactionBatchesArchive" Description

Cartridge Activity Info


Subjobs <All SubJobs>
Cartridge reference Cartridge "TransactionBatchesArchive" definition

42
3.1.2.9. Cartridge Activity "ReceiptBatchesArchive" Description

Cartridge Activity Info


Subjobs <All SubJobs>
Cartridge reference Cartridge "ReceiptBatchesArchive" definition

3.1.2.10. Cartridge Activity "LockboxTransmissionsArchive" Description

Cartridge Activity Info


Subjobs <All SubJobs>
Cartridge reference Cartridge "LockboxTransmissionsArchive" definition

3.1.2.11. Cartridge Activity "CorrespondencesArchive" Description

Cartridge Activity Info


Subjobs <All SubJobs>
Cartridge reference Cartridge "CorrespondencesArchive" definition

3.2. Business Flow ReceivablesReload 7.51.1.12.68.68


3.2.1. Business Flow Description

Business Flow Info


Version 7.51.1.12.68.68
UID 956D-53DF-60A8-7E92
Annotation Transactional Reload business flow for Oracle Receivables.
This business flow will reload a transaction and all its related activities including other
transaction which are members of the same chain. A chain usually comprises of one or
more transactions, receipts, credit memos and their child activities.
It accepts the following parameters for reloading
1. Reload Operating Unit
2. Reload Tranasaction Number

Based on the above parameters the initial transaction is decided and using a PDM
algorithm the BF will reload other members of the chain too.

Following cartridges are executed by this business flow:


1. ReceivableTransactionsReload
2. ReceiptBatchesReload
3. TransactionBatchesReload
4. LockboxTransmissionsReload
5. CorrespondencesReload

Data movement method for ReceivableTransactionsReload cartridge is Advanced


Transactional and for other cartridges it is Standard Transactional.

The updates done during archive will be re-evaluated based on the transactions for the
batch being in source or target database or both. This will be done by a groovy script
updateBatches.

3.2.1.1. Business Flow Diagram

43
44
3.2.1.2. Parameters used in Business Flow Actvities (and Model Compatibilities)

Parameters used
pdReloadCorrespondenceSelTab,
pdReloadReceiptBatchSelTab,
pdReloadTransactionBatchSelTab,
prReloadTransactionId

3.2.1.3. Order of Parameters for Business Flow Activities

Parameter Order
pdReloadCorrespondenceSelTab,
pdReloadReceiptBatchSelTab,
pdReloadTransactionBatchSelTab,
prReloadTransactionId

3.2.2. Business Flow Activities


3.2.2.1. Cartridge Activity "ReceivableTransactionsReload" Description

Cartridge Activity Info


Subjobs Reload Selection
Cartridge reference Cartridge "ReceivableTransactionsReload" definition

3.2.2.2. Script Activity "getReloadSelTabName" Description

45
Code
// Get the reload selection table names and populate the dynamic parameters with same values

import groovy.sql.*

def intfSchema = ""


def selTable = ""
def oltpSchema = ""
def oltpTable = ""
def histSchema = ""
def histTable = ""
def cntSelTab = 0
def rctCnt = 0
def crhCnt = 0
def cpsCnt = 0

// Get the name of Selection table for RA_CUSTOMER_TRX_ALL, AR_CASH_RECEIPT_HISTORY_ALL and


AR_CORR_PAY_SCHED_ALL on History

String query = """


Select m1.base_table_name base_table_name, m1.base_table_schema base_table_schema
, m1.shadow_TABLE_SCHEMA hist_sel_schema, m1.shadow_TABLE_NAME hist_sel_table
, m2.shadow_TABLE_SCHEMA hist_table_schema, m2.shadow_TABLE_NAME hist_table_name
from OBTPA_APPSPACKS a,
OBTPA_SHADOW_TABLE_MAP m1,
OBTPA_SHADOW_TABLE_MAP m2,
OBTREP_INSTALLED_PRODUCTS p,
OBTPA_BUSFLOW_COMPONENTS bc,
OBTPA_BUSINESSFLOWS bf,
OBTREP_INSTALLED_PRODUCT_CFGS pc,
OBTREP_PRODUCTS b,
obtpa_environment_sources e,
OBTREP_PRODUCT_CONFIGURATIONS c
where b.product_name = 'LiveArchive'
and e.name = '${ENVIRONMENT_NAME}'
and b.id = p.product_id
and b.id = c.product_id
and p.environment_source_id = e.id
and p.ID = a.INSTALLED_PRODUCT_ID
and p.ID = pc.INSTALLED_PRODUCT_ID
and pc.product_configuration_id = c.id
and a.id = bc.component_id
and bc.businessflow_id = bf.id
and bc.component_name = 'ReceivableTransactionsReload'
and bf.businessflow_name = '${BUSINESS_FLOW_NAME}'
and m1.appspack_id = a.id
and m1.base_table_name in
('RA_CUSTOMER_TRX_ALL','AR_CASH_RECEIPT_HISTORY_ALL','AR_CORR_PAY_SCHED_ALL')
and m1.table_type = decode(upper(c.name),'DISTRIBUTED', 'selectionHistory', 'SINGLE', 'selectionOLTP')
and m2.appspack_id = a.id
and m2.base_table_name in
('RA_CUSTOMER_TRX_ALL','AR_CASH_RECEIPT_HISTORY_ALL','AR_CORR_PAY_SCHED_ALL')
and m2.table_type ='history'
and m1.base_table_name = m2.base_table_name
and m1.base_table_schema = m2.base_table_schema

"""

//println(query)
println("current runid:"+CURRENT_RUN_ID);

// start of query cursor


REPOS_DB.eachRow(query) { row ->

oltpSchema = row.BASE_TABLE_SCHEMA
oltpTable = row.BASE_TABLE_NAME
intfSchema = row.HIST_SEL_SCHEMA
selTable = row.HIST_SEL_TABLE
histSchema = row.HIST_TABLE_SCHEMA
histTable = row.HIST_TABLE_NAME

if (oltpTable == "RA_CUSTOMER_TRX_ALL") {

46
Code

cntSelTab = 0;
String cntQry = """ select count(*) cnt from ${intfSchema}.${selTable} """;
cntSelTab = INTF_RELOC_DB.firstRow(cntQry).cnt;
if (cntSelTab > 0) {
pdReloadTransactionBatchSelTab = intfSchema + "." + selTable;
rctCnt = 1;
}
else if (rctCnt == 0) {
pdReloadTransactionBatchSelTab = intfSchema + "." + selTable;

} // if rct
else if (oltpTable == "AR_CASH_RECEIPT_HISTORY_ALL") {

cntSelTab = 0;
String cntQry = """ select count(*) cnt from ${intfSchema}.${selTable} """;
cntSelTab = INTF_RELOC_DB.firstRow(cntQry).cnt;
if (cntSelTab > 0) {
pdReloadReceiptBatchSelTab = intfSchema + "." + selTable;
crhCnt = 1;
}

else if (crhCnt == 0) {
pdReloadReceiptBatchSelTab = intfSchema + "." + selTable;

} // if acrh
else if (oltpTable == "AR_CORR_PAY_SCHED_ALL") {

cntSelTab = 0;
String cntQry = """ select count(*) cnt from ${intfSchema}.${selTable} """;
cntSelTab = INTF_RELOC_DB.firstRow(cntQry).cnt;
if (cntSelTab > 0) {
pdReloadCorrespondenceSelTab = intfSchema + "." + selTable;
cpsCnt = 0;
}
else if (cpsCnt == 0) {
pdReloadCorrespondenceSelTab = intfSchema + "." + selTable;

} // if aps
} // end of query cursor
Annotation
This script returns the selection table name for ra_customer_trx_all, ar_cash_receipt_history_all and
ar_corr_pay_sched_all in the interface schema on history side which is populated with data. If none of the
selection tables are populated then the last selection tablename is returned for a table. The table names are
required in the custom selection programs for reload cartridges.

3.2.2.3. Cartridge Activity "TransactionBatchesReload" Description

Cartridge Activity Info


Subjobs Reload Selection
Cartridge reference Cartridge "TransactionBatchesReload" definition

3.2.2.4. Cartridge Activity "ReceiptBatchesReload" Description

Cartridge Activity Info


Subjobs Reload Selection
Cartridge reference Cartridge "ReceiptBatchesReload" definition

47
3.2.2.5. Cartridge Activity "CorrespondencesReload" Description

Cartridge Activity Info


Subjobs Reload Selection
Cartridge reference Cartridge "CorrespondencesReload" definition

3.2.2.6. Script Activity "updateBatches" Description

48
Code
// Update the purged_children_flag to Y for those batches that have some transactions in history and some in
oltp

import groovy.sql.*

def intfSchema = ""


def selTable = ""
def oltpSchema = ""
def oltpTable = ""
def histSchema = ""
def histTable = ""
def rowCount = 0
def batchId = -1
def cntSelTab = 0

// Get the name of Selection table for RA_CUSTOMER_TRX_ALL,AR_CASH_RECEIPT_HISTORY_ALL and


AR_CORR_PAY_SCHED_ALL on History

String query = """


Select m1.base_table_name base_table_name, m1.base_table_schema base_table_schema
, m1.shadow_TABLE_SCHEMA hist_sel_schema, m1.shadow_TABLE_NAME hist_sel_table
, m2.shadow_TABLE_SCHEMA hist_table_schema, m2.shadow_TABLE_NAME hist_table_name
from OBTPA_APPSPACKS a,
OBTPA_SHADOW_TABLE_MAP m1,
OBTPA_SHADOW_TABLE_MAP m2,
OBTREP_INSTALLED_PRODUCTS p,
OBTPA_BUSFLOW_COMPONENTS bc,
OBTPA_BUSINESSFLOWS bf,
OBTREP_INSTALLED_PRODUCT_CFGS pc,
OBTREP_PRODUCTS b,
obtpa_environment_sources e,
OBTREP_PRODUCT_CONFIGURATIONS c
where b.product_name = 'LiveArchive'
and e.name = '${ENVIRONMENT_NAME}'
and b.id = p.product_id
and b.id = c.product_id
and p.environment_source_id = e.id
and p.ID = a.INSTALLED_PRODUCT_ID
and p.ID = pc.INSTALLED_PRODUCT_ID
and pc.product_configuration_id = c.id
and a.id = bc.component_id
and bc.businessflow_id = bf.id
and bc.component_name = 'ReceivableTransactionsReload'
and bf.businessflow_name = '${BUSINESS_FLOW_NAME}'
and m1.appspack_id = a.id
and m1.base_table_name in
('RA_CUSTOMER_TRX_ALL','AR_CASH_RECEIPT_HISTORY_ALL','AR_CORR_PAY_SCHED_ALL')
and m1.table_type = decode(upper(c.name),'DISTRIBUTED', 'selectionHistory', 'SINGLE', 'selectionOLTP')
and m2.appspack_id = a.id
and m2.base_table_name in
('RA_CUSTOMER_TRX_ALL','AR_CASH_RECEIPT_HISTORY_ALL','AR_CORR_PAY_SCHED_ALL')
and m2.table_type ='history'
and m1.base_table_name = m2.base_table_name
and m1.base_table_schema = m2.base_table_schema

"""

//println(query)
println("current runid:"+CURRENT_RUN_ID);

// start of query cursor


REPOS_DB.eachRow(query) { row ->

oltpSchema = row.BASE_TABLE_SCHEMA
oltpTable = row.BASE_TABLE_NAME
intfSchema = row.HIST_SEL_SCHEMA
selTable = row.HIST_SEL_TABLE
histSchema = row.HIST_TABLE_SCHEMA
histTable = row.HIST_TABLE_NAME

if (oltpTable == "RA_CUSTOMER_TRX_ALL") {

49
Code

cntSelTab = 0;
String cntQry = """ select count(*) cnt from ${intfSchema}.${selTable} """
cntSelTab = INTF_RELOC_DB.firstRow(cntQry).cnt;
if (cntSelTab > 0) {

println("Updating ra_batches...");
// update ra_batches on history

String updStmnt = """


Update ${histSchema}.ra_batches_all rbh
set rbh.purged_children_flag = null
where not exists (select rcth.rowid
from ${histSchema}.${histTable} rcth
where rcth.batch_id = rbh.batch_id
minus
select rcth_sel.obt_saved_rowid
from ${histSchema}.${histTable} rcth, ${intfSchema}.${selTable} rcth_sel
where rcth.rowid = rcth_sel.obt_saved_rowid
and rcth.batch_id = rbh.batch_id
)
"""
// println(updStmnt)

INTF_RELOC_DB.execute(updStmnt)

// println("Updated data")
INTF_RELOC_DB.execute("COMMIT")
//println("commited")

// update ra_batches on oltp


def rb_oltp = CARTRIDGE_TOKENS['SOURCE.AR.RA_BATCHES_ALL'];

updStmnt = """
Update ${rb_oltp} rb
set purged_children_flag = null
where batch_id in ( Select distinct nvl(rcth1.batch_id,-1) batch_id
from ${histSchema}.${histTable} rcth1, ${intfSchema}.${selTable} rcth_sel
where rcth1.rowid = rcth_sel.obt_saved_rowid
and not exists (select rcth.rowid
from ${histSchema}.${histTable} rcth
where rcth.batch_id = rcth1.batch_id
minus
select rcth_sel.obt_saved_rowid
from ${histSchema}.${histTable} rcth, ${intfSchema}.${selTable} rcth_sel
where rcth.rowid = rcth_sel.obt_saved_rowid
and rcth.batch_id = rcth1.batch_id
)
)
"""

INTF_RELOC_DB.execute(updStmnt)
INTF_RELOC_DB.execute("COMMIT")

println("Done updating ra_batches");


} // if cntSelTab
} // if rct

else if (oltpTable == "AR_CASH_RECEIPT_HISTORY_ALL") {

cntSelTab = 0;
String cntQry = """ select count(*) cnt from ${intfSchema}.${selTable} """
cntSelTab = INTF_RELOC_DB.firstRow(cntQry).cnt;
if (cntSelTab > 0) {

println("Updating ar_batches...");
// update ar_batches on history

String updStmnt = """

50
Code
Update ${histSchema}.ar_batches_all abh
set abh.purged_children_flag = null
where not exists (select crhh.rowid
from ${histSchema}.${histTable} crhh
where crhh.batch_id = abh.batch_id
minus
select crhh_sel.obt_saved_rowid
from ${histSchema}.${histTable} crhh, ${intfSchema}.${selTable} crhh_sel
where crhh.rowid = crhh_sel.obt_saved_rowid
and crhh.batch_id = abh.batch_id
)
"""
// println(updStmnt)

INTF_RELOC_DB.execute(updStmnt)

// println("Updated data")
INTF_RELOC_DB.execute("COMMIT")
// println("commited")

// update ar_batches on oltp


def ab_oltp = CARTRIDGE_TOKENS['SOURCE.AR.AR_BATCHES_ALL'];
//println("ab_oltp: "+ab_oltp);
updStmnt = """
Update ${ab_oltp} rb
set purged_children_flag = null
where batch_id in ( Select distinct nvl(crhh1.batch_id,-1) batch_id
from ${histSchema}.${histTable} crhh1, ${intfSchema}.${selTable} crhh_sel
where crhh1.rowid = crhh_sel.obt_saved_rowid
and not exists (select crhh.rowid
from ${histSchema}.${histTable} crhh
where crhh.batch_id = crhh1.batch_id
minus
select crhh_sel.obt_saved_rowid
from ${histSchema}.${histTable} crhh, ${intfSchema}.${selTable} crhh_sel
where crhh.rowid = crhh_sel.obt_saved_rowid
and crhh.batch_id = crhh1.batch_id
)
)
"""
//println(updStmnt);
INTF_RELOC_DB.execute(updStmnt)
INTF_RELOC_DB.execute("COMMIT")

println("Done updating ar_batches");


} // if cntSelTab
} // if crh

else if (oltpTable == "AR_CORR_PAY_SCHED_ALL") {

cntSelTab = 0;
String cntQry = """ select count(*) cnt from ${intfSchema}.${selTable} """
cntSelTab = INTF_RELOC_DB.firstRow(cntQry).cnt;
if (cntSelTab > 0) {

println("Updating ar_correspondences...");
// update ar_correspondences on history

String updStmnt = """


Update ${histSchema}.ar_correspondences_all ach
set ach.purged_children_flag = null
where not exists (select cpsh.correspondence_pay_sched_id
from ${histSchema}.${histTable} cpsh
where cpsh.correspondence_id = ach.correspondence_id
minus
select cpsh.correspondence_pay_sched_id
from ${histSchema}.${histTable} cpsh, ${intfSchema}.${selTable} cpsh_sel
where cpsh.rowid = cpsh_sel.obt_saved_rowid
and cpsh.correspondence_id = ach.correspondence_id
)

51
Code
"""
// println(updStmnt)

INTF_RELOC_DB.execute(updStmnt)

// println("Updated data")
INTF_RELOC_DB.execute("COMMIT")
// println("commited")

// update ar_correspondences on oltp


def ar_oltp = CARTRIDGE_TOKENS['SOURCE.AR.AR_CORRESPONDENCES_ALL'];

updStmnt = """
Update ${ar_oltp} rb
set purged_children_flag = null
where correspondence_id in ( Select distinct nvl(cpsh1.correspondence_id,-1) batch_id
from ${histSchema}.${histTable} cpsh1, ${intfSchema}.${selTable} cpsh_sel
where cpsh1.rowid = cpsh_sel.obt_saved_rowid
and not exists (select cpsh.correspondence_pay_sched_id
from ${histSchema}.${histTable} cpsh
where cpsh.correspondence_id = cpsh1.correspondence_id
minus
select cpsh.correspondence_pay_sched_id
from ${histSchema}.${histTable} cpsh, ${intfSchema}.${selTable} cpsh_sel
where cpsh.rowid = cpsh_sel.obt_saved_rowid
and cpsh.correspondence_id = cpsh1.correspondence_id
)
)
"""

INTF_RELOC_DB.execute(updStmnt)
INTF_RELOC_DB.execute("COMMIT")
println("Done updating ar_correspondences");
} // if cntSelTab
} // if aps

} // end of query cursor


Annotation
This script will set the purged_children_flag to null for the batches in history and oltp side based on the rows
selected for reload for transaction tables. This is done for 3 tables ra_batches_all, ar_batches_all and
ar_correspondences_all based on the selected records in the tables ra_customer_trx_all,
ar_cash_Receipt_history_all and ar_corr_pay_sched_all respectively.

3.2.2.7. Cartridge Activity "TransactionBatchesReload" Description

Cartridge Activity Info


Subjobs Reload,
Clean Up
Cartridge reference Cartridge "TransactionBatchesReload" definition

3.2.2.8. Cartridge Activity "ReceiptBatchesReload" Description

Cartridge Activity Info


Subjobs Reload,
Clean Up
Cartridge reference Cartridge "ReceiptBatchesReload" definition

3.2.2.9. Cartridge Activity "LockboxTransmissionsReload" Description

52
Cartridge Activity Info
Subjobs <All SubJobs>
Cartridge reference Cartridge "LockboxTransmissionsReload" definition

3.2.2.10. Cartridge Activity "CorrespondencesReload" Description

Cartridge Activity Info


Subjobs Reload,
Clean Up
Cartridge reference Cartridge "CorrespondencesReload" definition

3.2.2.11. Cartridge Activity "ReceivableTransactionsReload" Description

Cartridge Activity Info


Subjobs Reload,
Clean Up
Cartridge reference Cartridge "ReceivableTransactionsReload" definition

3.3. Undo Business Flow ReceivablesUndo 7.51.1.12.68.68


3.3.1. Undo Business Flow Description

Undo Business Flow Info


Version 7.51.1.12.68.68
Base Business Flow ReceivablesArchive
UID 7787-0C80-497D-75CC
Annotation This business flow is used to undo the archive operations done as a result of a particular
run of the archive business flow ReceivablesArchive. A parameter bfGroupRunId is
passed internally when the undo job is launched. Based on this parameter all the
transactions will be reloaded back to the source database which got archived by the
business flow job with group run id = bfGroupRunId.

It reverses the activities performed by the following cartridges for a particular run of
ReceivablesArchive business flow:
1. RecivableTransactionsArchive
2. TransactionBatchesArchive
3. ReceiptBatchesArchive
4. LockboxTransmissionsArchive
5. CorrespondencesArchive

The updates done during archive will be re-evaluated based on the transactions for the
batch being in source or target database or both. This will be done by a groovy script
undoUpdates.

3.3.1.1. Undo Business Flow Diagram

53
3.3.2. Undo Business Flow Activities
3.3.2.1. Script Activity "undoUpdates" Description

54
Code
// Update the purged_children_flag to null for those batches that have all transactions in oltp

import groovy.sql.*
import com.outerbay.api.*;

// method to get WFRunIds for a particular cartridge


def getCartridgeInstanceRuns(dbConn, cartInstName, groupRunId) {

def getSubJobRuns = """


select r.run_id run_id
from obtwc_run_details_v r
where task_name = 'BFInternal' and
status = 'COMPLETED' and
parent_run_id = ?"""

def getCartridgeInstanceSql = """


select appspack_instance_name cartridge_instance_name, run_id run_id
from obtwc_run_details_v
where (task_name = 'Archive Selection Step' or
task_name = 'PDM Selection Step') and
parent_run_id = ? and appspack_instance_name = ? """

def l = [ groupRunId ];
def WFRunIds = "";

while (!l.isEmpty()) {
def runId = l.remove(0)
def bindVar1 = [ runId, cartInstName ]

// get runid
dbConn.eachRow(getCartridgeInstanceSql, bindVar1) { row ->

WFRunIds = WFRunIds + row.run_id ;


}

def bindVar2 = [ runId ]

dbConn.eachRow(getSubJobRuns, bindVar2) { row ->


l.add(row.run_id)

if (!l.isEmpty) {
WFRunIds = WFRunIds + ", ";
}
}
} // while l.isempty

if (WFRunIds != "") {
WFRunIds = "( " + WFRunIds + " )";
}

return WFRunIds
} // end of getCartridgeInstanceRuns

def oltpSchema = ""


def oltpTable = ""
def histSchema = ""
def histTable = ""
def rowCount = 0
def batchId = -1

def cartInstName = ""


def ARMainWFRunIds = ""
def txnBatWFRunIds = ""
def rcptBatWFRunIds = ""
def corrWFRunIds = ""

// List of variables available for use in Businessflow


println "BUSINESS_FLOW_NAME = ${BUSINESS_FLOW_NAME}";
println "PRODUCT_HOME = ${PRODUCT_HOME}";
println "ENVIRONMENT_NAME = ${ENVIRONMENT_NAME}";

55
Code
println "Current Run Id = ${CURRENT_RUN_ID}";
println "bfGroupRunId = ${bfGroupRunId}";

// get WFRunids for all cartridges ReceivableTransactionsArchive, TransactionBatchesArchive,


ReceiptBatchesArchive and CorrespondencesArchive

cartInstName = "ReceivableTransactionsArchive";
ARMainWFRunIds = getCartridgeInstanceRuns(REPOS_DB, cartInstName, bfGroupRunId);
println("ARMainWFRunIds = " + ARMainWFRunIds);

cartInstName = "TransactionBatchesArchive";
txnBatWFRunIds = getCartridgeInstanceRuns(REPOS_DB, cartInstName, bfGroupRunId);
println("txnBatWFRunIds = " + txnBatWFRunIds);

cartInstName = "ReceiptBatchesArchive";
rcptBatWFRunIds = getCartridgeInstanceRuns(REPOS_DB, cartInstName, bfGroupRunId);
println("rcptBatWFRunIds = " + rcptBatWFRunIds);

cartInstName = "CorrespondencesArchive";
corrWFRunIds = getCartridgeInstanceRuns(REPOS_DB, cartInstName, bfGroupRunId);
println("corrWFRunIds = " + corrWFRunIds);

def productConfig =""


def dblinkName =" "

String configQry = """select decode(upper(c.name),'SINGLE','SI','DISTRIBUTED','DI') confName


from obtrep_products a
, obtrep_installed_products b
, obtrep_product_configurations c
, obtrep_installed_product_cfgs d
, obtpa_environment_sources e
where a.product_name = 'LiveArchive'
and e.name = '${ENVIRONMENT_NAME}'
and a.id = b.product_id
and b.environment_source_id = e.id
and a.id = c.product_id
and d.product_configuration_id = c.id
and d.installed_product_id = b.id
""";
REPOS_DB.eachRow(configQry) { row ->

productConfig = row.confName
}

if (productConfig == "DI") {
ConfigurationProperties.createSession("", ENVIRONMENT_NAME);

dblinkName = ConfigurationProperties.getProductConfigValue("LA","HIST_TO_OLTP_LINK");
ConfigurationProperties.closeSession();

dblinkName = "@" + dblinkName


}

println("dblinkName: "+dblinkName);

// Get the name of history table for RA_CUSTOMER_TRX_ALL,AR_CASH_RECEIPT_HISTORY_ALL and


AR_CORR_PAY_SCHED_ALL

String query = """


Select m2.base_table_name base_table_name, m2.base_table_schema base_table_schema
, m2.shadow_TABLE_SCHEMA hist_table_schema, m2.shadow_TABLE_NAME hist_table_name
from OBTPA_APPSPACKS a,
OBTPA_SHADOW_TABLE_MAP m2,
OBTREP_INSTALLED_PRODUCTS p,
OBTPA_BUSFLOW_COMPONENTS bc,
OBTPA_BUSINESSFLOWS bf,
OBTPA_BUSINESSFLOWS bf1,
OBTREP_INSTALLED_PRODUCT_CFGS pc,
OBTREP_PRODUCTS b,
obtpa_environment_sources e,

56
Code
OBTREP_PRODUCT_CONFIGURATIONS c
where b.product_name = 'LiveArchive'
and e.name = '${ENVIRONMENT_NAME}'
and b.id = p.product_id
and b.id = c.product_id
and p.environment_source_id = e.id
and p.ID = a.INSTALLED_PRODUCT_ID
and p.ID = pc.INSTALLED_PRODUCT_ID
and pc.product_configuration_id = c.id
and a.id = bc.component_id
and bc.businessflow_id = bf1.id
and bc.component_name = 'ReceivableTransactionsArchive'
and bf.businessflow_name = '${BUSINESS_FLOW_NAME}'
and bf.base_busflow = bf1.businessflow_name
and m2.appspack_id = a.id
and m2.base_table_name in
('RA_CUSTOMER_TRX_ALL','AR_CASH_RECEIPT_HISTORY_ALL','AR_CORR_PAY_SCHED_ALL')
and m2.table_type ='history'

"""

//println(query)

// start of query cursor


REPOS_DB.eachRow(query) { row ->

oltpSchema = row.BASE_TABLE_SCHEMA
oltpTable = row.BASE_TABLE_NAME
histSchema = row.HIST_TABLE_SCHEMA
histTable = row.HIST_TABLE_NAME

if (oltpTable == "RA_CUSTOMER_TRX_ALL") {
println("Updating ra_batches...");
// update ra_batches on history
String updStmnt = """
Update ${histSchema}.ra_batches_all rbh
set rbh.purged_children_flag = null
where rbh.obt_wf_run_id in ${txnBatWFRunIds}
and not exists (select rcth.rowid
from ${histSchema}.${histTable} rcth
where rcth.batch_id = rbh.batch_id
minus
select rcth.rowid
from ${histSchema}.${histTable} rcth
where rcth.batch_id = rbh.batch_id
and rcth.obt_wf_run_id in ${ARMainWFRunIds}
)
"""
// println(updStmnt)

INTF_RELOC_DB.execute(updStmnt)

// println("Updated ra_batches on history")

INTF_RELOC_DB.execute("COMMIT")

// println("commited")

// update ra_batches on oltp


def rb_oltp = "AR.RA_BATCHES_ALL"+dblinkName

updStmnt = """
Update ${rb_oltp} rb
set purged_children_flag = null
where batch_id in (Select distinct nvl(rcth1.batch_id,-1) batch_id
from ${histSchema}.${histTable} rcth1
where rcth1.obt_wf_run_id in ${ARMainWFRunIds}
and not exists (select rbh.batch_id
from ${histSchema}.ra_batches_all rbh
where rbh.obt_wf_run_id in ${txnBatWFRunIds}
and rbh.batch_id = rcth1.batch_id)

57
Code
and not exists (select rcth.rowid
from ${histSchema}.${histTable} rcth
where rcth.batch_id = rcth1.batch_id
minus
select rcth.rowid
from ${histSchema}.${histTable} rcth
where rcth.batch_id = rcth1.batch_id
and rcth.obt_wf_run_id in ${ARMainWFRunIds}
)
)
"""

INTF_RELOC_DB.execute(updStmnt)
INTF_RELOC_DB.execute("COMMIT")

println("Done updating ra_batches");


} // if rct

else if (oltpTable == "AR_CASH_RECEIPT_HISTORY_ALL") {


println("Updating ar_batches...");
// update ar_batches on history

String updStmnt = """


Update ${histSchema}.ar_batches_all abh
set abh.purged_children_flag = null
where abh.obt_wf_run_id in ${rcptBatWFRunIds}
and not exists (select crhh.rowid
from ${histSchema}.${histTable} crhh
where crhh.batch_id = abh.batch_id
minus
select crhh.rowid
from ${histSchema}.${histTable} crhh
where crhh.batch_id = abh.batch_id
and crhh.obt_wf_run_id in ${ARMainWFRunIds}
)
"""
// println(updStmnt)

INTF_RELOC_DB.execute(updStmnt)

// println("Updated ar_batches on history")

INTF_RELOC_DB.execute("COMMIT")

//println("commited")

// update ar_batches on oltp


def ab_oltp = "AR.AR_BATCHES_ALL"+dblinkName
//println("ab_oltp: "+ab_oltp);
updStmnt = """
Update ${ab_oltp} rb
set purged_children_flag = null
where batch_id in (Select distinct nvl(crhh1.batch_id,-1) batch_id
from ${histSchema}.${histTable} crhh1
where crhh1.obt_wf_run_id in ${ARMainWFRunIds}
and not exists (select abh.batch_id
from ${histSchema}.ar_batches_all abh
where abh.obt_wf_run_id in ${rcptBatWFRunIds}
and abh.batch_id = crhh1.batch_id)
and not exists (select crhh.rowid
from ${histSchema}.${histTable} crhh
where crhh.batch_id = crhh1.batch_id
minus
select crhh.rowid
from ${histSchema}.${histTable} crhh
where crhh.obt_wf_run_id in ${ARMainWFRunIds}
and crhh.batch_id = crhh1.batch_id
)
)
"""
//println(updStmnt);

58
Code
INTF_RELOC_DB.execute(updStmnt)
INTF_RELOC_DB.execute("COMMIT")
println("Done updating ar_batches");
} // if crh

else if (oltpTable == "AR_CORR_PAY_SCHED_ALL") {


println("Updating ar_correspondences...");
// update ar_correspondences on history

String updStmnt = """


Update ${histSchema}.ar_correspondences_all ach
set ach.purged_children_flag = null
where ach.obt_wf_run_id in ${corrWFRunIds}
and not exists (select cpsh.correspondence_pay_sched_id
from ${histSchema}.${histTable} cpsh
where cpsh.correspondence_id = ach.correspondence_id
minus
select cpsh.correspondence_pay_sched_id
from ${histSchema}.${histTable} cpsh
where cpsh.obt_wf_run_id in ${ARMainWFRunIds}
and cpsh.correspondence_id = ach.correspondence_id
)
"""
// println(updStmnt)

INTF_RELOC_DB.execute(updStmnt)

//println("Updated ar_corrspondeces in history")

INTF_RELOC_DB.execute("COMMIT")

//println("commited")

// update ar_correspondences on oltp


def ar_oltp = "AR.AR_CORRESPONDENCES_ALL"+dblinkName

updStmnt = """
Update ${ar_oltp} rb
set purged_children_flag = null
where correspondence_id in ( Select distinct nvl(cpsh1.correspondence_id,-1) batch_id
from ${histSchema}.${histTable} cpsh1
where cpsh1.obt_wf_run_id in ${ARMainWFRunIds}
and not exists (select ach.correspondence_id
from ${histSchema}.ar_correspondences_all ach
where ach.obt_wf_run_id in ${corrWFRunIds}
and ach.correspondence_id = cpsh1.correspondence_id)
and not exists (select cpsh.correspondence_pay_sched_id
from ${histSchema}.${histTable} cpsh
where cpsh.correspondence_id = cpsh1.correspondence_id
minus
select cpsh.correspondence_pay_sched_id
from ${histSchema}.${histTable} cpsh
where cpsh.obt_wf_run_id in ${ARMainWFRunIds}
and cpsh.correspondence_id = cpsh1.correspondence_id
)
)
"""

INTF_RELOC_DB.execute(updStmnt)
INTF_RELOC_DB.execute("COMMIT")
println("Done updating ar_correspondences");

} // if aps

} // end of query cursor


Annotation

59
Code
This script will set the purged_children_flag to null for the batches in history and oltp side for the rows in
transaction tables which got archived by a particular run of ReceivablesArchive BF. Basically the updates will
happen based on the rows which are going to be reloaded back by the ReceivablesUndo BF. This is done for 3
tables ra_batches_all, ar_batches_all and ar_correspondences_all based on the selected records in the tables
ra_customer_trx_all, ar_cash_Receipt_history_all and ar_corr_pay_sched_all respectively.

3.3.2.2. Cartridge Activity "CorrespondencesArchive" Description

Cartridge Activity Info


Subjobs <All SubJobs>
Cartridge reference Cartridge "CorrespondencesArchive" definition

3.3.2.3. Cartridge Activity "LockboxTransmissionsArchive" Description

Cartridge Activity Info


Subjobs <All SubJobs>
Cartridge reference Cartridge "LockboxTransmissionsArchive" definition

3.3.2.4. Cartridge Activity "ReceiptBatchesArchive" Description

Cartridge Activity Info


Subjobs <All SubJobs>
Cartridge reference Cartridge "ReceiptBatchesArchive" definition

3.3.2.5. Cartridge Activity "TransactionBatchesArchive" Description

Cartridge Activity Info


Subjobs <All SubJobs>
Cartridge reference Cartridge "TransactionBatchesArchive" definition

3.3.2.6. Cartridge Activity "ReceivableTransactionsArchive" Description

Cartridge Activity Info


Subjobs <All SubJobs>
Cartridge reference Cartridge "ReceivableTransactionsArchive" definition

3.4. Database to Database Cartridge CorrespondencesArchive


7.51.1.12.68.68
3.4.1. Cartridge CorrespondencesArchive

Cartridge Info
Source Model Correspondences
reference

60
Cartridge Info
Version 7.51.1.12.68.68
UID C3CC-64F4-9BE1-123A
Annotation This cartridge is based on the model Correspondences. It is defined as a Database to
Database cartridge meant for archiving data in the underlying tables from source to a
target database. It copies data from ar_correspondences_all table in oracle receivables
to the target database and then purges the same rows in the source database.

3.4.1.1. Cartridge operations

Table use name Copy Purge Annotation


AR_CORRESPONDENCES_ALL Yes Yes

3.4.1.2. Cartridge-specific data movement key warnings

Data movement key warnings


Reload could result in duplicate rows. This is because some tables in the cartridge do not have a unique key
set or auto-chosen as the data movement key.

3.4.1.3. Parameters used in the Source Model and Cartridge

Parameters used
prOrgId

3.4.1.4. Rules in Cartridge

Included Rules Excluded Rules


OperatingUnitParam
AllPaySchedArchivedForCorr

3.5. Database to Database Cartridge CorrespondencesReload


7.51.1.12.68.68
3.5.1. Cartridge CorrespondencesReload

Cartridge Info
Source Model Correspondences
reference
Version 7.51.1.12.68.68
UID C97A-8583-2187-BB9C
Annotation This cartridge is based on the model Correspondences. It is defined as a Reload from
Database cartridge meant for archiving data in the underlying tables from target to
source database. It has a custom selection program to populate a custom selection table
AR_CORRESPOND_REL_CS based on the rows selected in ar_corr_pay_sched_all
table for reload and for which the batch exists in target database. It copies data from
ar_correspondences_all table in target database to the source database and then
purges the same rows in the target database.

61
3.5.1.1. Cartridge operations

Table use name Copy Purge Annotation


AR_CORRESPONDENCES_ALL Yes Yes

3.5.1.2. Cartridge-specific data movement key warnings

Data movement key warnings


Reload could result in duplicate rows. This is because some tables in the cartridge do not have a unique key
set or auto-chosen as the data movement key.

3.5.1.3. Data Sources

Table use name Data Source Annotation


AR_CORR_PAY_SCHED_ALL History
AR_CORRESPONDENCES_ALL History

3.5.1.4. Parameters used in the Source Model and Cartridge

Parameters used
pdReloadCorrespondenceSelTab

3.5.1.5. Rules in Cartridge

Included Rules Excluded Rules


OperatingUnitParam
AllPaySchedArchivedForCorr

3.5.1.6. Custom selection

Custom Selection
Table Name AR_CORRESPOND_REL_CS

62
Custom Selection
Database Code Annotation
oracle declare This custom selection program will populate
stmt varchar2(2000); a custom selection table
dummy number; AR_CORRESPOND_REL_CS based on
c integer; the rows selected in ar_corr_pay_sched_all
begin table for reload and for which the batch
stmt := 'INSERT INTO exists in target database.
AR_CORRESPOND_REL_CS
(OBT_WF_RUN_ID, OBT_SAVED_ROWID
)'
|| ' SELECT DISTINCT
'||:OBT_WF_RUN_ID ||', ach.ROWID '||
' FROM
${HIST.AR.AR_CORRESPONDENCES_AL
L} ach,
${HIST.AR.AR_CORR_PAY_SCHED_ALL}
cpshh, '
|| :pdReloadCorrespondenceSelTab || '
cpshh_sel '||
' WHERE cpshh.rowid =
cpshh_sel.obt_saved_rowid '||
' AND cpshh.correspondence_id =
ach.correspondence_id ';

c := dbms_sql.open_cursor;
dbms_sql.parse(c, stmt,
dbms_sql.NATIVE);
dummy := dbms_sql.execute(c);
dbms_sql.close_cursor(c);
end;

3.6. Database to Database Cartridge


LockboxTransmissionsArchive 7.51.1.12.68.68
3.6.1. Cartridge LockboxTransmissionsArchive

Cartridge Info
Source Model LockboxTransmissions
reference
Version 7.51.1.12.68.68
UID D122-3C09-4E55-45A2
Annotation This cartridge is based on the model LockboxTransmissions. It is defined as a Database
to Database cartridge meant for archiving data in the underlying tables from source to a
target database. It copies data from ar_transmissions_all table in oracle receivables to
the target database and then purges the same rows in the source database.

3.6.1.1. Cartridge operations

Table use name Copy Purge Annotation


AR_TRANSMISSIONS_ALL Yes Yes

3.6.1.2. Cartridge-specific data movement key warnings

63
Data movement key warnings
Reload could result in duplicate rows. This is because some tables in the cartridge do not have a unique key
set or auto-chosen as the data movement key.

3.6.1.3. Parameters used in the Source Model and Cartridge

Parameters used
prOrgId

3.6.1.4. Rules in Cartridge

Included Rules Excluded Rules


OperatingUnitParam
AllRcptBatchArchived4Transmisn

3.7. Database to Database Cartridge


LockboxTransmissionsReload 7.51.1.12.68.68
3.7.1. Cartridge LockboxTransmissionsReload

Cartridge Info
Source Model LockboxTransmissions
reference
Version 7.51.1.12.68.68
UID 4931-7EB1-9644-F15C
Annotation This cartridge is based on the model LockboxTransmission. It is defined as a Reload
from Database cartridge meant for archiving data in the underlying tables from target to
source database. It copies data from ar_transmissions_all table in target database to the
source database and then purges the same rows in the target database.

3.7.1.1. Cartridge operations

Table use name Copy Purge Annotation


AR_TRANSMISSIONS_ALL Yes Yes

3.7.1.2. Cartridge-specific data movement key warnings

Data movement key warnings


Reload could result in duplicate rows. This is because some tables in the cartridge do not have a unique key
set or auto-chosen as the data movement key.

3.7.1.3. Data Sources

Table use name Data Source Annotation


AR_BATCHES_ALL History
AR_TRANSMISSIONS_ALL History

64
3.7.1.4. Rules in Cartridge

Included Rules Excluded Rules


AllRcptBatchArchived4Transmisn OperatingUnitParam

3.8. Database to Database Cartridge ReceiptBatchesArchive


7.51.1.12.68.68
3.8.1. Cartridge ReceiptBatchesArchive

Cartridge Info
Source Model ReceiptBatches
reference
Version 7.51.1.12.68.68
UID 9F68-3ED4-3767-1655
Annotation This cartridge is based on the model ReceiptBatches. It is defined as a Database to
Database cartridge meant for archiving data in the underlying tables from source to a
target database. It copies data from ar_batches_all table in oracle receivables to the
target database and then purges the same rows in the source database.

3.8.1.1. Cartridge operations

Table use name Copy Purge Annotation


AR_BATCHES_ALL Yes Yes

3.8.1.2. Cartridge-specific data movement key warnings

Data movement key warnings


Reload could result in duplicate rows. This is because some tables in the cartridge do not have a unique key
set or auto-chosen as the data movement key.

3.8.1.3. Parameters used in the Source Model and Cartridge

Parameters used
prOrgId

3.8.1.4. Rules in Cartridge

Included Rules Excluded Rules


OperatingUnitParam
AllReceiptsArchivedForBatch

65
3.9. Database to Database Cartridge ReceiptBatchesReload
7.51.1.12.68.68
3.9.1. Cartridge ReceiptBatchesReload

Cartridge Info
Source Model ReceiptBatches
reference
Version 7.51.1.12.68.68
UID 3F6B-A7D9-2B86-0701
Annotation This cartridge is based on the model ReceiptBatches. It is defined as a Reload from
Database cartridge meant for archiving data in the underlying tables from target to
source database. It has a custom selection program to populate a custom selection table
AR_BATCHES_REL_CS based on the rows selected in ar_cash_receipt_history_all
table for reload and for which the batch exists in target database. It copies data from
ar_batches_all table in target database to the source database and then purges the
same rows in the target database.

3.9.1.1. Cartridge operations

Table use name Copy Purge Annotation


AR_BATCHES_ALL Yes Yes

3.9.1.2. Cartridge-specific data movement key warnings

Data movement key warnings


Reload could result in duplicate rows. This is because some tables in the cartridge do not have a unique key
set or auto-chosen as the data movement key.

3.9.1.3. Data Sources

Table use name Data Source Annotation


AR_BATCHES_ALL History
AR_CASH_RECEIPT_HISTORY_ALL History

3.9.1.4. Parameters used in the Source Model and Cartridge

Parameters used
pdReloadReceiptBatchSelTab

3.9.1.5. Rules in Cartridge

Included Rules Excluded Rules


OperatingUnitParam
AllReceiptsArchivedForBatch

3.9.1.6. Custom selection

66
Custom Selection
Table Name AR_BATCHES_REL_CS
Database Code Annotation
oracle declare This custom selection program will populate
stmt varchar2(2000); a custom selection table
dummy number; AR_BATCHES_REL_CS based on the
c integer; rows selected in
begin ar_cash_receipt_history_all table for reload
stmt := 'INSERT INTO and for which the batch exists in target
AR_BATCHES_REL_CS database.
(OBT_WF_RUN_ID, OBT_SAVED_ROWID
)'
|| ' SELECT DISTINCT
'||:OBT_WF_RUN_ID ||', abh.ROWID '||
' FROM ${HIST.AR.AR_BATCHES_ALL}
abh,
${HIST.AR.AR_CASH_RECEIPT_HISTOR
Y_ALL} acrhh, '
|| :pdReloadReceiptBatchSelTab || '
acrhh_sel '||
' WHERE acrhh.rowid =
acrhh_sel.obt_saved_rowid '||
' AND acrhh.batch_id = abh.batch_id ';

c := dbms_sql.open_cursor;
dbms_sql.parse(c, stmt,
dbms_sql.NATIVE);
dummy := dbms_sql.execute(c);
dbms_sql.close_cursor(c);
end;

3.10. Database to Database Cartridge


ReceivableTransactionsArchive 7.51.1.12.68.68
3.10.1. Cartridge ReceivableTransactionsArchive

Cartridge Info
Source Model ReceivableTransactions
reference
Version 7.51.1.12.68.68
UID 9ADF-F475-6E46-D66D
Annotation This cartridge is based on the model AR_Main. It is defined as a Database to Database
cartridge meant for archiving data in the underlying tables from source to a target
database. It copies data from all the main tables for oracle receivables which does not
include the batch related tables, to the target database and then purges the same rows
in the source database.

3.10.1.1. Cartridge operations

Table use name Copy Purge Annotation


AR_ACTION_NOTIFICATIONS Yes Yes
AR_ADJUSTMENTS_ALL Yes Yes
AR_CALL_ACTIONS Yes Yes
AR_CASH_RECEIPT_HISTORY_ALL Yes Yes
AR_CASH_RECEIPTS_ALL Yes Yes
AR_CORR_PAY_SCHED_ALL Yes Yes

67
Table use name Copy Purge Annotation
AR_CUSTOMER_CALL_TOPICS_ALL Yes Yes
AR_DEFERRED_LINES_ALL Yes Yes
AR_DISTRIBUTIONS_ALL Yes Yes
AR_DISTRIBUTIONS_ALL_2 Yes Yes
AR_DISTRIBUTIONS_ALL_3 Yes Yes
AR_LINE_CONTS_ALL Yes Yes
AR_NOTES Yes Yes
AR_PAYMENT_SCHEDULES_ALL Yes Yes
AR_PAYMENT_SCHEDULES_ALL_2 Yes Yes
AR_RATE_ADJUSTMENTS_ALL Yes Yes
AR_RECEIVABLE_APPLICATIONS_ALL Yes Yes
JAI_AR_CASH_RECEIPTS_ALL Yes Yes
JAI_AR_TRX_INS_LINES_T Yes Yes
JAI_AR_TRX_LINES Yes Yes
JAI_AR_TRX_TAX_LINES Yes Yes
JAI_AR_TRXS Yes Yes
JAI_AR_TRXS_2 Yes Yes
JAI_CMN_DOCUMENT_TAXES Yes Yes
RA_CUST_TRX_LINE_GL_DIST_ALL Yes Yes
RA_CUST_TRX_LINE_SALESREPS_ALL Yes Yes
RA_CUSTOMER_TRX_ALL Yes Yes
RA_CUSTOMER_TRX_ALL_2 Yes Yes
RA_CUSTOMER_TRX_LINES_ALL Yes Yes

3.10.1.2. Cartridge-specific data movement key warnings

Data movement key warnings


Reload could result in duplicate rows. This is because some tables in the cartridge do not have a unique key
set or auto-chosen as the data movement key.

3.10.1.3. Parameters used in the Source Model and Cartridge

Parameters used
pcAdjustmentGLDate,
pcCommitmentRelatedTrx,
pcCommitmentTrx,
pcCompletedTrx,
pcPostableApplicationGLDate,
pcPostableDistributionGLDate,
pcPostableReceiptHistoryGLDate,
pcReceiptCurrHistStatus,
pcReceiptPaySchedClosed,
pcReceiptRefInCE,
pcRunningTotal,
pcTrxInPaySched,
pcTrxLineAutoruleComplete,
pcTrxPaySchedClass,
pcTrxPaySchedClosed,
pcTrxPaySchedGLDate,
pcTrxRevenueComplete,
prCustomerId,
prCutOffDate,
prOrgId,
prTrxDateFrom,
prTrxDateTo

68
3.10.1.4. Rules in Cartridge

Included Rules Excluded Rules


OperatingUnitParam ReloadTransactionIdParam
TransactionCustomerNameParam
TrxnNotCommitmentRelated
TransactionMustBeComplete
TransactionMustHavePaySched
TrxnPaySchedMustBeClosed
RunningTotalMustBeZero
TrxDateFromToParam
TrxnLineAutoruleMustBeComplete
TrxnPaySchedGLDateParam
TrxnPaySchedClassShudBeInvCMDM
PostableDistributinGLDateParam
PostableApplicationGLDateParam
ReceiptCustomerNameParam
PostableReceiptHistGLDateParam
ReceiptMustBeClearedWithNoRisk
ReceipttShudntHaveRefInCashMgt
ReceiptPaySchedMustBeClosed
CMRunningTotalMustBeZero
CMTransactionCustomerNameParam
CMTransactionDateParam
CMTransactionMustBeComplete
CMTransactionMustHavePaySched
CMTrxnNotCommitmentRelated
CMTrxnPaySchedMustBeClosed
TrxnTypeShudNotBeCommitment
AdjustmentGLDateParam
TrxRevenueCompletelyRecognized

3.11. Database to Database Cartridge


ReceivableTransactionsReload 7.51.1.12.68.68
3.11.1. Cartridge ReceivableTransactionsReload

Cartridge Info
Source Model ReceivableTransactions
reference
Version 7.51.1.12.68.68
UID B564-178B-3115-1359
Annotation This cartridge is based on the model AR_Main. It is defined as a Reload from Database
cartridge meant for reloading data in the underlying tables from target database back to
source database. It copies data from all the main tables for oracle receivables which
does not include the batch related tables, to the source database and then purges the
same rows in the target database.

69
3.11.1.1. Cartridge operations

Table use name Copy Purge Annotation


AR_ACTION_NOTIFICATIONS Yes Yes
AR_ADJUSTMENTS_ALL Yes Yes
AR_CALL_ACTIONS Yes Yes
AR_CASH_RECEIPT_HISTORY_ALL Yes Yes
AR_CASH_RECEIPTS_ALL Yes Yes
AR_CORR_PAY_SCHED_ALL Yes Yes
AR_CUSTOMER_CALL_TOPICS_ALL Yes Yes
AR_DEFERRED_LINES_ALL Yes Yes
AR_DISTRIBUTIONS_ALL Yes Yes
AR_DISTRIBUTIONS_ALL_2 Yes Yes
AR_DISTRIBUTIONS_ALL_3 Yes Yes
AR_LINE_CONTS_ALL Yes Yes
AR_NOTES Yes Yes
AR_PAYMENT_SCHEDULES_ALL Yes Yes
AR_PAYMENT_SCHEDULES_ALL_2 Yes Yes
AR_RATE_ADJUSTMENTS_ALL Yes Yes
AR_RECEIVABLE_APPLICATIONS_ALL Yes Yes
JAI_AR_CASH_RECEIPTS_ALL Yes Yes
JAI_AR_TRX_INS_LINES_T Yes Yes
JAI_AR_TRX_LINES Yes Yes
JAI_AR_TRX_TAX_LINES Yes Yes
JAI_AR_TRXS Yes Yes
JAI_AR_TRXS_2 Yes Yes
JAI_CMN_DOCUMENT_TAXES Yes Yes
RA_CUST_TRX_LINE_GL_DIST_ALL Yes Yes
RA_CUST_TRX_LINE_SALESREPS_ALL Yes Yes
RA_CUSTOMER_TRX_ALL Yes Yes
RA_CUSTOMER_TRX_ALL_2 Yes Yes
RA_CUSTOMER_TRX_LINES_ALL Yes Yes

3.11.1.2. Cartridge-specific data movement key warnings

Data movement key warnings


Reload could result in duplicate rows. This is because some tables in the cartridge do not have a unique key
set or auto-chosen as the data movement key.

3.11.1.3. Data Sources

Table use name Data Source Annotation


AR_ACTION_NOTIFICATIONS History
AR_ADJUSTMENTS_ALL History
AR_CALL_ACTIONS History
AR_CASH_RECEIPT_HISTORY_ALL History
AR_CASH_RECEIPTS_ALL History
AR_CORR_PAY_SCHED_ALL History
AR_CUSTOMER_CALL_TOPICS_ALL History
AR_DEFERRED_LINES_ALL History

70
Table use name Data Source Annotation
AR_DISTRIBUTIONS_ALL History
AR_DISTRIBUTIONS_ALL_2 History
AR_DISTRIBUTIONS_ALL_3 History
AR_LINE_CONTS_ALL History
AR_NOTES History
AR_PAYMENT_SCHEDULES_ALL History
AR_PAYMENT_SCHEDULES_ALL_2 History
AR_RATE_ADJUSTMENTS_ALL History
AR_RECEIVABLE_APPLICATIONS_ALL History
CE_STATEMENT_RECONCILS_ALL History
JAI_AR_CASH_RECEIPTS_ALL History
JAI_AR_TRX_INS_LINES_T History
JAI_AR_TRX_LINES History
JAI_AR_TRX_TAX_LINES History
JAI_AR_TRXS History
JAI_AR_TRXS_2 History
JAI_CMN_DOCUMENT_TAXES History
RA_CUST_TRX_LINE_GL_DIST_ALL History
RA_CUST_TRX_LINE_SALESREPS_ALL History
RA_CUST_TRX_TYPES_ALL History
RA_CUSTOMER_TRX_ALL History
RA_CUSTOMER_TRX_ALL_2 History
RA_CUSTOMER_TRX_LINES_ALL History

3.11.1.4. Parameters used in the Source Model and Cartridge

Parameters used
prReloadTransactionId

3.11.1.5. Rules in Cartridge

Included Rules Excluded Rules


ReloadTransactionIdParam OperatingUnitParam
TransactionCustomerNameParam
TrxnNotCommitmentRelated
TransactionMustBeComplete
TransactionMustHavePaySched
TrxnPaySchedMustBeClosed
RunningTotalMustBeZero
TrxDateFromToParam
TrxnLineAutoruleMustBeComplete
TrxnPaySchedGLDateParam
TrxnPaySchedClassShudBeInvCMDM
PostableDistributinGLDateParam
PostableApplicationGLDateParam
ReceiptCustomerNameParam
PostableReceiptHistGLDateParam
ReceiptMustBeClearedWithNoRisk
ReceipttShudntHaveRefInCashMgt

71
Included Rules Excluded Rules
ReceiptPaySchedMustBeClosed
CMRunningTotalMustBeZero
CMTransactionCustomerNameParam
CMTransactionDateParam
CMTransactionMustBeComplete
CMTransactionMustHavePaySched
CMTrxnNotCommitmentRelated
CMTrxnPaySchedMustBeClosed
TrxnTypeShudNotBeCommitment
AdjustmentGLDateParam
TrxRevenueCompletelyRecognized

3.12. Database to Database Cartridge TransactionBatchesArchive


7.51.1.12.68.68
3.12.1. Cartridge TransactionBatchesArchive

Cartridge Info
Source Model TransactionBatches
reference
Version 7.51.1.12.68.68
UID 71F5-998F-D164-3D23
Annotation This cartridge is based on the model TransactionBatches. It is defined as a Database to
Database cartridge meant for archiving data in the underlying tables from source to a
target database. It copies data from ra_batches_all table in oracle receivables to the
target database and then purges the same rows in the source database.

3.12.1.1. Cartridge operations

Table use name Copy Purge Annotation


RA_BATCHES_ALL Yes Yes

3.12.1.2. Cartridge-specific data movement key warnings

Data movement key warnings


Reload could result in duplicate rows. This is because some tables in the cartridge do not have a unique key
set or auto-chosen as the data movement key.

3.12.1.3. Parameters used in the Source Model and Cartridge

Parameters used
prOrgId

3.12.1.4. Rules in Cartridge

72
Included Rules Excluded Rules
OperatingUnitParam
AllTrxnArchivedForBatch

3.13. Database to Database Cartridge TransactionBatchesReload


7.51.1.12.68.68
3.13.1. Cartridge TransactionBatchesReload

Cartridge Info
Source Model TransactionBatches
reference
Version 7.51.1.12.68.68
UID B26A-82F2-628D-8F4C
Annotation This cartridge is based on the model TransactionBatches. It is defined as a Reload from
Database cartridge meant for archiving data in the underlying tables from target to
source database. It has a custom selection program to populate a custom selection table
RA_BATCHES_REL_CS based on the rows selected in ra_customer_trx_all table for
reload and for which the batch exists in target database. It copies data from
ra_batches_all table in target database to the source database and then purges the
same rows in the target database.

3.13.1.1. Cartridge operations

Table use name Copy Purge Annotation


RA_BATCHES_ALL Yes Yes

3.13.1.2. Cartridge-specific data movement key warnings

Data movement key warnings


Reload could result in duplicate rows. This is because some tables in the cartridge do not have a unique key
set or auto-chosen as the data movement key.

3.13.1.3. Data Sources

Table use name Data Source Annotation


RA_BATCHES_ALL History
RA_CUSTOMER_TRX_ALL History

3.13.1.4. Parameters used in the Source Model and Cartridge

Parameters used
pdReloadTransactionBatchSelTab

3.13.1.5. Rules in Cartridge

73
Included Rules Excluded Rules
OperatingUnitParam
AllTrxnArchivedForBatch

3.13.1.6. Custom selection

Custom Selection
Table Name RA_BATCHES_REL_CS
Database Code Annotation
oracle declare This custom selection program will populate
stmt varchar2(2000); a custom selection table
dummy number; RA_BATCHES_REL_CS based on the
c integer; rows selected in ra_customer_trx_all table
begin for reload and for which the batch exists in
stmt := 'INSERT INTO target database.
RA_BATCHES_REL_CS
(OBT_WF_RUN_ID, OBT_SAVED_ROWID
)'
|| ' SELECT DISTINCT
'||:OBT_WF_RUN_ID ||', rbh.ROWID '||
' FROM ${HIST.AR.RA_BATCHES_ALL}
rbh,
${HIST.AR.RA_CUSTOMER_TRX_ALL}
rcth, '
|| :pdReloadTransactionBatchSelTab || '
rcth_sel '||
' WHERE rcth.rowid =
rcth_sel.obt_saved_rowid '||
' AND rcth.batch_id = rbh.batch_id ';

c := dbms_sql.open_cursor;
dbms_sql.parse(c, stmt,
dbms_sql.NATIVE);
dummy := dbms_sql.execute(c);
dbms_sql.close_cursor(c);
end;

74
4. Source Models
4.1. Source Model Correspondences
Source Model Info
UID 8259-8A6E-652F-F09E
Annotation This model has a driving table AR.AR_CORRESPONDENCES_ALL and a lookup table
AR.AR_CORR_PAY_SCHED_ALL. A correspondence is eligible for archiving when all
the correspondence payment schedule associated with it are assigned a status of
archived. Data movement only happens for the driving table based on related rows exist
in the lookup table. If there are no rows in ar_corr_pay_sched_all for a particular
correspondence_id then the same row from AR_CORRESPONDENCES_ALL gets
archived to the target database. If for a particular correspondence_id some rows are in
target and some in source database then purged_children_flag is set to Y in the business
flow groovy scripts which use this model.

4.1.1. ER Diagram

4.1.2. Table use List


4.1.2.1. Table use AR_CORRESPONDENCES_ALL

AR_CORRESPONDENCES_ALL
Table Name AR.AR_CORRESPONDENCES_ALL
Table Alias AR_CORRESPONDENCES_ALL
Use Type Transactional
Annotation This table stores one record for each dunning letter you send to a
customer. Each row includes dunning letter information, date, customer,
and site use. The primary key for this table is CORRESPONDENCE_ID. It
is a driving table for model Correspondences. Please refer to Oracle E-Biz
TRM for more information about this table.

Data movement key for AR_CORRESPONDENCES_ALL


DM Key name <Row ID>
DM Key Info "AR_CORRESPONDENCES_ALL" is set to have data movement done by
row ID.

Rules on AR_CORRESPONDENCES_ALL
Name Attributes Annotation
OperatingUnitParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Disabled states that correspondence is
eligible for purge if it belongs to the
Mode: Exclusive operation unit prOrgId, provided as
Customization: Mandatory parameter. This rule cannot be
overridden.
Query Expression
Database ansi
Query

75
Rules on AR_CORRESPONDENCES_ALL
AR_CORRESPONDENCES_ALL.PURGED_CHILDREN_FLAG = 'Y'
and AR_CORRESPONDENCES_ALL.ORG_ID = :prOrgId

4.1.2.2. Table use AR_CORR_PAY_SCHED_ALL

AR_CORR_PAY_SCHED_ALL
Table Name AR.AR_CORR_PAY_SCHED_ALL
Table Alias AR_CORR_PAY_SCHED_ALL
Use Type Lookup
Annotation This is added as a lookup table in model Correspondences. It is basically
used to check for the existence of payment schedules for a particular
correspondence on source database for archive and target database for
reload. Please refer to Oracle E-Biz TRM for more information about this
table.

Relation between AR_CORR_PAY_SCHED_ALL and parent AR_CORRESPONDENCES_ALL


Parent Table Name AR.AR_CORRESPONDENCES_ALL
Parent Table Alias AR_CORRESPONDENCES_ALL
Unique Key Name AR_CORR_PAY_SCHED_ALL_UK
Foreign Key Name AR_CORR_PAY_SCHED_ALL_AR_CORRESPONDENCES_ALL_FK
UK Columns FK Columns (FK is on parent)
CORRESPONDENCE_ID CORRESPONDENCE_ID

Data movement key for AR_CORR_PAY_SCHED_ALL


DM Key name <Row ID>
DM Key Info "AR_CORR_PAY_SCHED_ALL" is set to have data movement done by
row ID.

Rules on AR_CORR_PAY_SCHED_ALL
Name Attributes Annotation
AllPaySchedArchivedForCorr Category:
Analytics: Disabled
Mode: Exclusive
Customization: Mandatory
Query Expression
Database ansi
Query
(1=2)

4.2. Source Model LockboxTransmissions


Source Model Info
UID B981-96A4-7E69-DE06

76
Source Model Info
Annotation This model has a driving table AR.AR_TRANSMISSIONS_ALL and a lookup table
AR.AR_BATCHES_ALL. A lockbox transmission record is eligible for archiving when all
the receipt batches associated with it are assigned a status of archived. Data movement
only happens for the driving table based on related rows exist in the lookup table. If there
are no rows in AR_BATCHES_ALL for a particular transmission_request_id then the
same row from AR_TRANSMISSIONS_ALL gets archived to the target database.

4.2.1. ER Diagram

4.2.2. Table use List


4.2.2.1. Table use AR_TRANSMISSIONS_ALL

AR_TRANSMISSIONS_ALL
Table Name AR.AR_TRANSMISSIONS_ALL
Table Alias AR_TRANSMISSIONS_ALL
Use Type Transactional
Annotation This table stores information about each Lockbox transmission. Each row
includes the original transmission request ID, the transmission date, time,
count, and amount. The primary key for this table is
TRANSMISSION_REQUEST_ID. It is a driving table for model
RcptTransmission. Please refer to Oracle E-Biz TRM for more information
about this table.

Data movement key for AR_TRANSMISSIONS_ALL


DM Key name <Row ID>
DM Key Info "AR_TRANSMISSIONS_ALL" is set to have data movement done by row
ID.

Rules on AR_TRANSMISSIONS_ALL
Name Attributes Annotation
OperatingUnitParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Disabled states that receipt transmission is
eligible for purge if it belongs to the
Mode: Exclusive operation unit prOrgId, provided as
Customization: Mandatory parameter. This rule cannot be
overridden.
Query Expression
Database ansi
Query
AR_TRANSMISSIONS_ALL.ORG_ID = :prOrgId

4.2.2.2. Table use AR_BATCHES_ALL

AR_BATCHES_ALL
Table Name AR.AR_BATCHES_ALL
Table Alias AR_BATCHES_ALL

77
AR_BATCHES_ALL
Use Type Lookup
Annotation This is added as a lookup table in model RcptTransmission. It is basically
used to check for the existence of receipt batches for a particular
transmission on source database for archive and target database for
reload. Please refer to Oracle E-Biz TRM for more information about this
table.

Relation between AR_BATCHES_ALL and parent AR_TRANSMISSIONS_ALL


Parent Table Name AR.AR_TRANSMISSIONS_ALL
Parent Table Alias AR_TRANSMISSIONS_ALL
Unique Key Name AR_BATCHES_ALL_UK
Foreign Key Name AR_BATCHES_ALL_AR_TRANSMISSIONS_ALL_FK
UK Columns FK Columns (FK is on parent)
TRANSMISSION_REQUEST_ID TRANSMISSION_REQUEST_ID

Data movement key for AR_BATCHES_ALL


DM Key name <Row ID>
DM Key Info "AR_BATCHES_ALL" is set to have data movement done by row ID.

Rules on AR_BATCHES_ALL
Name Attributes Annotation
AllRcptBatchArchived4Transmisn Category:
Analytics: Disabled
Mode: Exclusive
Customization: Mandatory
Query Expression
Database ansi
Query
(1=2)

4.3. Source Model ReceiptBatches


Source Model Info
UID D327-C422-CB56-6079
Annotation This model has a driving table AR.AR_BATCHES_ALL, a lookup table
AR.AR_CASH_RECEIPT_HISTORY_ALL and a transaction table
AR.AR_MC_BATCHES. A receipt batch is eligible for archiving when all the receipts
associated with it are assigned a status of archived. Data movement for the driving table
happens based on related rows exist in the lookup table. If there are no rows in
AR_CASH_RECEIPT_HISTORY_ALL for a particular batch_id then the same row from
AR_BATCHES_ALL gets archived to the target database. If for a particular batch_id
some rows are in target and some in source database then purged_children_flag is set to
Y in the business flow groovy scripts which use this model.

4.3.1. ER Diagram

78
4.3.2. Table use List
4.3.2.1. Table use AR_BATCHES_ALL

AR_BATCHES_ALL
Table Name AR.AR_BATCHES_ALL
Table Alias AR_BATCHES_ALL
Use Type Transactional
Annotation This table stores information about each receipt batch that you create in
Oracle Receivables. Each row includes information about a specific batch
such as batch source, status, batch type, control count, and control
amount. The primary key for this table is BATCH_ID. It is a driving table
for model ReceiptBatches. Please refer to Oracle E-Biz TRM for more
information about this table.

Data movement key for AR_BATCHES_ALL


DM Key name <Row ID>
DM Key Info "AR_BATCHES_ALL" is set to have data movement done by row ID.

Rules on AR_BATCHES_ALL
Name Attributes Annotation
OperatingUnitParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Disabled states that receipt batch is eligible
for purge if it belongs to the
Mode: Exclusive operation unit prOrgId, provided as
Customization: Mandatory parameter. This rule cannot be
overridden.
Query Expression
Database ansi
Query
AR_BATCHES_ALL.PURGED_CHILDREN_FLAG = 'Y'
and AR_BATCHES_ALL.ORG_ID = :prOrgId

4.3.2.2. Table use AR_CASH_RECEIPT_HISTORY_ALL

AR_CASH_RECEIPT_HISTORY_ALL
Table Name AR.AR_CASH_RECEIPT_HISTORY_ALL
Table Alias AR_CASH_RECEIPT_HISTORY_ALL
Use Type Lookup
Annotation This is added as a lookup table in model ReceiptBatches. It is basically
used to check for the existence of receipts for a particular batch on source
database for archive and target database for reload. Please refer to
Oracle E-Biz TRM for more information about this table.

Relation between AR_CASH_RECEIPT_HISTORY_ALL and parent AR_BATCHES_ALL


Parent Table Name AR.AR_BATCHES_ALL

79
Relation between AR_CASH_RECEIPT_HISTORY_ALL and parent AR_BATCHES_ALL
Parent Table Alias AR_BATCHES_ALL
Unique Key Name AR_CASH_RECEIPT_HISTORY_ALL_UK
Foreign Key Name AR_CASH_RECEIPT_HISTORY_ALL_AR_BATCHES_ALL_FK
UK Columns FK Columns (FK is on parent)
BATCH_ID BATCH_ID

Data movement key for AR_CASH_RECEIPT_HISTORY_ALL


DM Key name <Row ID>
DM Key Info "AR_CASH_RECEIPT_HISTORY_ALL" is set to have data movement
done by row ID.

Rules on AR_CASH_RECEIPT_HISTORY_ALL
Name Attributes Annotation
AllReceiptsArchivedForBatch Category:
Analytics: Disabled
Mode: Exclusive
Customization: Mandatory
Query Expression
Database ansi
Query
(1=2)

4.4. Source Model ReceivableTransactions


Source Model Info
UID DA68-A237-6BCD-F053

80
Source Model Info
Annotation This model has one driving table AR.RA_CUSTOMER_TRX_ALL. It also contains other
main transaction tables in oracle receivables module which store data about
transactions, receipts and other related information.

Given below is the list of managed tables included in this model:

AR_ACTION_NOTIFICATIONS
AR_ADJUSTMENTS_ALL
AR_CALL_ACTIONS
AR_CASH_RECEIPT_HISTORY_ALL
AR_CASH_RECEIPTS_ALL
AR_CORR_PAY_SCHED_ALL
AR_CUSTOMER_CALL_TOPICS_ALL
AR_DEFERRED_LINES_ALL
AR_DISTRIBUTIONS_ALL
AR_LINE_CONTS_ALL
AR_MC_ADJUSTMENTS
AR_MC_CASH_RECEIPT_HIST
AR_MC_CASH_RECEIPTS
AR_MC_DISTRIBUTIONS_ALL
AR_MC_PAYMENT_SCHEDULES
AR_MC_RATE_ADJUSTMENTS
AR_MC_RECEIVABLE_APPS
AR_NOTES
AR_PAYMENT_SCHEDULES_ALL
AR_RATE_ADJUSTMENTS_ALL
AR_RECEIVABLE_APPLICATIONS_ALL
RA_CUST_TRX_LINE_GL_DIST_ALL
RA_CUST_TRX_LINE_SALESREPS_ALL
RA_CUSTOMER_TRX_ALL
RA_CUSTOMER_TRX_LINES_ALL
RA_MC_CUSTOMER_TRX
RA_MC_TRX_LINE_GL_DIST

All the tables are added as transaction table in the model with following exception.

Since there is a many to many relationship between transactions and receipts,


ar_cash_receipts_all is added as a chaining table to the intermediate table
ar_receivable_applications_all. Similarly many to many relationship also exists between
transaction and credit memo, so we have ra_customer_trx_all table also added as a
chaining table to ar_receivable_applications_all.

There are two lookup tables in this model:


RA_CUST_TRX_TYPES_ALL
CE_STATEMENT_RECONCILS_ALL

There wont be any data movement for the above two tables.

4.4.1. ER Diagram

81
82
4.4.2. Table use List
4.4.2.1. Table use RA_CUSTOMER_TRX_ALL

RA_CUSTOMER_TRX_ALL
Table Name AR.RA_CUSTOMER_TRX_ALL
Table Alias RCT
Use Type Transactional
Annotation This table stores invoice, debit memo, commitment, and credit memo
header information. Each row includes general invoice information such
as customer, transaction type, and printing instructions. You need one
row for each invoice, debit memo, commitment, and credit memo you
create in Oracle Receivables. The primary key for this table is
CUSTOMER_TRX_ID. This table appears as a driving table and also as a
chaining table for AR_RECEIVABLE_APPLICATIONS_ALL. Please refer
to Oracle E-Biz TRM for more information about this table.

Data movement key for RA_CUSTOMER_TRX_ALL


DM Key name <Row ID>
DM Key Info "RA_CUSTOMER_TRX_ALL" is set to have data movement done by row
ID.

Rules on RA_CUSTOMER_TRX_ALL
Name Attributes Annotation
OperatingUnitParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Disabled states that transaction is eligible for
purge if it belongs to the operation
Mode: Exclusive unit prOrgId, provided as parameter.
Customization: Mandatory This rule cannot be overridden.
Query Expression
Database ansi
Query
RCT.ORG_ID = :prOrgId
Name Attributes Annotation
TransactionCustomerNameParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Disabled states that transaction is eligible for
purge if the bill to customer is same
Mode: Exclusive as prCustomerId. This rule cannot
Customization: Mandatory be overridden.
Query Expression
Database ansi
Query
RCT.BILL_TO_CUSTOMER_ID=NVL(:prCustomerId,RCT.BILL_TO_CUSTOMER_ID)
Name Attributes Annotation
TrxnNotCommitmentRelated Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that transaction is eligible for
purge if it is not related to a
Mode: Exclusive commitment type of invoice or if this
Customization: Mandatory rule is overridden by means of
configuration parameter
pcCommitmentRelatedTrx.
Query Expression
Database ansi
Query

83
Rules on RA_CUSTOMER_TRX_ALL
(RCT.INITIAL_CUSTOMER_TRX_ID is null
OR upper(:pcCommitmentRelatedTrx) = 'Y')
Name Attributes Annotation
TransactionMustBeComplete Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that transaction is eligible for
purge if invoice is in complete status
Mode: Exclusive or if this rule is overridden by means
Customization: Mandatory of configuration parameter
pcCompletedTrx.
Query Expression
Database ansi
Query
(RCT.COMPLETE_FLAG = 'Y'
OR
upper(:pcCompletedTrx) = 'Y')
Name Attributes Annotation
TransactionMustHavePaySched Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that transaction is eligible for
purge if there exists at least one
Mode: Exclusive payent schedule for this transaction
Customization: Mandatory or if this rule is overridden by means
of configuration parameter
pcTrxInPaySched.
Query Expression
Database ansi
Query
(exists (select 1 from AR.ar_payment_schedules_all APSA where APSA.customer_trx_id =
RCT.CUSTOMER_TRX_ID and APSA.org_id = RCT.ORG_ID)
OR upper(:pcTrxInPaySched) = 'Y')
Name Attributes Annotation
TrxnPaySchedMustBeClosed Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that transaction is eligible for
purge if the corresponding payment
Mode: Exclusive schedules are in closed status or if
Customization: Mandatory this rule is overridden by means of
configuration parameter
pcTrxPaySchedClosed.
Query Expression
Database ansi
Query
(0= (select NVL(SUM(ABS(A.amount_due_remaining)),0) from AR.AR_PAYMENT_SCHEDULES_ALL A
WHERE A.customer_trx_id = RCT.CUSTOMER_TRX_ID)
OR upper(:pcTrxPaySchedClosed) = 'Y')
Name Attributes Annotation
ReloadTransactionIdParam Category: Data Integrity This Reload Only inclusive eligiblity
Analytics: Disabled rule states that transaction provided
as parameter
Mode: Inclusive prReloadTransactionId is eligible for
Customization: Mandatory reload. At the same time it also
makes eligible all the other
members of the chain consisting of
transactions, receipts and credit
memos. This rule cannot be
overridden.
Query Expression
Database ansi
Query
RCT.CUSTOMER_TRX_ID = :prReloadTransactionId
Name Attributes Annotation

84
Rules on RA_CUSTOMER_TRX_ALL
RunningTotalMustBeZero Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that transaction is eligible for
purge if the Running Total
Mode: Exclusive (comprising: gl_dist_total +
Customization: Mandatory adjustment_total + CM_appl_total -
Cash_appl_total ) is zero or if this
rule is overridden by means of
configuration parameter
pcRunningTotal.

Query Expression
Database ansi
Query
(exists (select 1 from apps.OBT_RA_CUSTOMER_TRX_RUNING_TOT a where a.customer_trx_id =
RCT.CUSTOMER_TRX_ID and cust_sum=0) OR upper(:pcRunningTotal) = 'Y')
Name Attributes Annotation
TrxDateFromToParam Category:
Analytics: Disabled
Mode: Inclusive
Customization: Optional
Query Expression
Database ansi
Query
RCT.TRX_DATE >= cast(:prTrxDateFrom as date) and RCT.TRX_DATE <= cast(:prTrxDateTo as date)

4.4.2.2. Table use RA_CUSTOMER_TRX_LINES_ALL

RA_CUSTOMER_TRX_LINES_ALL
Table Name AR.RA_CUSTOMER_TRX_LINES_ALL
Table Alias RCTL
Use Type Transactional
Annotation This table stores information about invoice, debit memo, credit memo, and
commitment lines. For example, an invoice can have one line for Product
A and another line for Product B. You need one row for each line. The
primary key for this table is CUSTOMER_TRX_LINE_ID. It is a
transaction table to RA_CUSTOMER_TRX_ALL. Please refer to Oracle
E-Biz TRM for more information about this table.

Relation between RA_CUSTOMER_TRX_LINES_ALL and parent RA_CUSTOMER_TRX_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_RA_CUSTOMER_TRX_LINES_ALL_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID

Data movement key for RA_CUSTOMER_TRX_LINES_ALL


DM Key name <Row ID>
DM Key Info "RA_CUSTOMER_TRX_LINES_ALL" is set to have data movement done
by row ID.

85
Rules on RA_CUSTOMER_TRX_LINES_ALL
Name Attributes Annotation
TrxnLineAutoruleMustBeComplete Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that transaction is eligible for
purge if the corresponding lines
Mode: Exclusive have autorule flag in completed
Customization: Mandatory status or if this rule is overridden by
means of configuration parameter
pcTrxLineAutoruleComplete.

Query Expression
Database ansi
Query
(NVL(RCTL.autorule_complete_flag,
'Y') = decode(RCTL.line_type,'LINE','Y',
NVL(RCTL.autorule_complete_flag,
'Y')
)
OR upper(:pcTrxLineAutoruleComplete) = 'Y')

4.4.2.3. Table use AR_LINE_CONTS_ALL

AR_LINE_CONTS_ALL
Table Name AR.AR_LINE_CONTS_ALL
Table Alias AR_LINE_CONTS_ALL
Use Type Transactional
Annotation This table exists only for oracle receivables patch level 11i.AR.O and
higher. The AR_LINE_CONTS_ALL table stores, for each line,
contingencies that impact revenue. It is a transaction table to
RA_CUSTOMER_TRX_LINES_ALL. Please refer to Oracle E-Biz TRM
for more information about this table.

Relation between AR_LINE_CONTS_ALL and parent RA_CUSTOMER_TRX_LINES_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_LINES_ALL
Parent Table Alias RCTL
Unique Key Name RA_CUSTOMER_TRX_LINES_U1
Foreign Key Name RA_CUSTOMER_TRX_LINES_ALL_AR_LINE_CONTS_ALL_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_LINE_ID CUSTOMER_TRX_LINE_ID

Data movement key for AR_LINE_CONTS_ALL


DM Key name <Row ID>
DM Key Info "AR_LINE_CONTS_ALL" is set to have data movement done by row ID.

4.4.2.4. Table use JAI_AR_TRXS

JAI_AR_TRXS
Table Name JA.JAI_AR_TRXS
Table Alias JAI_AR_TRXS
Use Type Transactional

86
Relation between JAI_AR_TRXS and parent RA_CUSTOMER_TRX_LINES_ALL
Parent Table Name AR.RA_CUSTOMER_TRX_LINES_ALL
Parent Table Alias RCTL
Unique Key Name RA_CUSTOMER_TRX_LINES_ALL_UK
Foreign Key Name RA_CUSTOMER_TRX_LINES_ALL_JAI_AR_TRXS_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID
Conditional Relationship on foreign key
Database Code
ansi 'INR' = (select a.currency_code from ${SOURCE.GL.GL_LEDGERS} a,
${SOURCE.APPS.HR_OPERATING_UNITS} b where a.ledger_id =
b.set_of_books_id and b.organization_id = ${PK_ALIAS}.ORG_ID)

Data movement key for JAI_AR_TRXS


DM Key name <Row ID>
DM Key Info "JAI_AR_TRXS" is set to have data movement done by row ID.

4.4.2.5. Table use JAI_AR_TRX_TAX_LINES

JAI_AR_TRX_TAX_LINES
Table Name JA.JAI_AR_TRX_TAX_LINES
Table Alias JAI_AR_TRX_TAX_LINES
Use Type Transactional

Relation between JAI_AR_TRX_TAX_LINES and parent RA_CUSTOMER_TRX_LINES_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_LINES_ALL
Parent Table Alias RCTL
Unique Key Name RA_CUSTOMER_TRX_LINES_U1
Foreign Key Name RA_CUSTOMER_TRX_LINES_ALL_JAI_AR_TRX_TAX_LINES_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_LINE_ID LINK_TO_CUST_TRX_LINE_ID
Conditional Relationship on foreign key
Database Code
ansi 'INR' = (select a.currency_code from ${SOURCE.GL.GL_LEDGERS} a,
${SOURCE.APPS.HR_OPERATING_UNITS} b where a.ledger_id =
b.set_of_books_id and b.organization_id = ${PK_ALIAS}.ORG_ID)
and ${PK_ALIAS}.LINE_TYPE = 'LINE'

Data movement key for JAI_AR_TRX_TAX_LINES


DM Key name <Row ID>
DM Key Info "JAI_AR_TRX_TAX_LINES" is set to have data movement done by row
ID.

4.4.2.6. Table use JAI_AR_TRX_LINES

JAI_AR_TRX_LINES
Table Name JA.JAI_AR_TRX_LINES
Table Alias JAI_AR_TRX_LINES

87
JAI_AR_TRX_LINES
Use Type Transactional

Relation between JAI_AR_TRX_LINES and parent RA_CUSTOMER_TRX_LINES_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_LINES_ALL
Parent Table Alias RCTL
Unique Key Name RA_CUSTOMER_TRX_LINES_ALL_UK_2
Foreign Key Name RA_CUSTOMER_TRX_LINES_ALL_JAI_AR_TRX_LINES_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID
CUSTOMER_TRX_LINE_ID CUSTOMER_TRX_LINE_ID
Conditional Relationship on foreign key
Database Code
ansi 'INR' = (select a.currency_code from ${SOURCE.GL.GL_LEDGERS} a,
${SOURCE.APPS.HR_OPERATING_UNITS} b where a.ledger_id =
b.set_of_books_id and b.organization_id = ${PK_ALIAS}.ORG_ID)
and ${PK_ALIAS}.LINE_TYPE = 'LINE'

Data movement key for JAI_AR_TRX_LINES


DM Key name <Row ID>
DM Key Info "JAI_AR_TRX_LINES" is set to have data movement done by row ID.

4.4.2.7. Table use JAI_AR_TRX_INS_LINES_T

JAI_AR_TRX_INS_LINES_T
Table Name JA.JAI_AR_TRX_INS_LINES_T
Table Alias JAI_AR_TRX_INS_LINES_T
Use Type Transactional

Relation between JAI_AR_TRX_INS_LINES_T and parent RA_CUSTOMER_TRX_LINES_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_LINES_ALL
Parent Table Alias RCTL
Unique Key Name RA_CUSTOMER_TRX_LINES_ALL_UK_2
Foreign Key Name RA_CUSTOMER_TRX_LINES_ALL_JAI_AR_TRX_INS_LINES_T_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID
CUSTOMER_TRX_LINE_ID LINK_TO_CUST_TRX_LINE_ID
Conditional Relationship on foreign key
Database Code
ansi 'INR' = (select a.currency_code from ${SOURCE.GL.GL_LEDGERS} a,
${SOURCE.APPS.HR_OPERATING_UNITS} b where a.ledger_id =
b.set_of_books_id and b.organization_id = ${PK_ALIAS}.ORG_ID)
and ${PK_ALIAS}.LINE_TYPE = 'LINE'

Data movement key for JAI_AR_TRX_INS_LINES_T


DM Key name <Row ID>
DM Key Info "JAI_AR_TRX_INS_LINES_T" is set to have data movement done by row
ID.

88
4.4.2.8. Table use AR_PAYMENT_SCHEDULES_ALL

AR_PAYMENT_SCHEDULES_ALL
Table Name AR.AR_PAYMENT_SCHEDULES_ALL
Table Alias APS
Use Type Transactional
Annotation This table stores all transactions except adjustments and miscellaneous
cash receipts. Oracle Receivables groups different transactions by the
column CLASS. These classes include invoice (INV), debit memos (DM),
guarantees (GUAR), credit memos (CM), deposits (DEP), chargebacks
(CB), and receipts (PMT). The primary key for this table is
PAYMENT_SCHEDULE_ID. It is a transaction table to
RA_CUSTOMER_TRX_ALL and AR_CASH_RECEIPTS_ALL. Please
refer to Oracle E-Biz TRM for more information about this table.

Relation between AR_PAYMENT_SCHEDULES_ALL and parent RA_CUSTOMER_TRX_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_AR_PAYMENT_SCHEDULES_ALL_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID

Data movement key for AR_PAYMENT_SCHEDULES_ALL


DM Key name <Row ID>
DM Key Info "AR_PAYMENT_SCHEDULES_ALL" is set to have data movement done
by row ID.

Rules on AR_PAYMENT_SCHEDULES_ALL
Name Attributes Annotation
TrxnPaySchedGLDateParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that transaction is eligible for
purge if the corresponding payment
Mode: Exclusive schedule's gl_date_closed must be
Customization: Mandatory less than the Cutoff date parameter
or if this rule is overridden by means
of configuration parameter
pcTrxPaySchedGLDate.
Query Expression
Database ansi
Query
(APS.GL_DATE_CLOSED<=cast(:prCutOffDate as date)
OR upper(:pcTrxPaySchedGLDate) = 'Y')
Name Attributes Annotation
TrxnPaySchedClassShudBeInvCM Category: Data Integrity This Archive Only eligiblity rule
DM Analytics: Enabled states that transaction is eligible for
purge if the corresponding payment
Mode: Exclusive schedules have class as Invoice,
Customization: Mandatory Credit Memo or Debit Memo or if
this rule is overridden by means of
configuration parameter
pcTrxPaySchedClass.
Query Expression
Database ansi

89
Rules on AR_PAYMENT_SCHEDULES_ALL
Query
(APS.CLASS IN ('INV','CM', 'DM')
OR upper(:pcTrxPaySchedClass) = 'Y')

4.4.2.9. Table use AR_CORR_PAY_SCHED_ALL

AR_CORR_PAY_SCHED_ALL
Table Name AR.AR_CORR_PAY_SCHED_ALL
Table Alias ACPS
Use Type Transactional
Annotation This table stores one record for each invoice selected for dunning by
Oracle Receivables. Each row includes invoice and correspondence
information. The primary key for this table is
CORRESPONDENCE_PAY_SCHED_ID. It is a transaction table to
AR_PAYMENT_SCHEDULES_ALL. Please refer to Oracle E-Biz TRM for
more information about this table.

Relation between AR_CORR_PAY_SCHED_ALL and parent AR_PAYMENT_SCHEDULES_ALL


Parent Table Name AR.AR_PAYMENT_SCHEDULES_ALL
Parent Table Alias APS
Unique Key Name AR_PAYMENT_SCHEDULES_ALL_UK
Foreign Key Name AR_PAYMENT_SCHEDULES_ALL_AR_CORR_PAY_SCHED_ALL_FK_
2
UK Columns (UK is on parent) FK Columns
PAYMENT_SCHEDULE_ID PAYMENT_SCHEDULE_ID

Data movement key for AR_CORR_PAY_SCHED_ALL


DM Key name <Row ID>
DM Key Info "AR_CORR_PAY_SCHED_ALL" is set to have data movement done by
row ID.

4.4.2.10. Table use RA_CUST_TRX_LINE_GL_DIST_ALL

RA_CUST_TRX_LINE_GL_DIST_ALL
Table Name AR.RA_CUST_TRX_LINE_GL_DIST_ALL
Table Alias RCTLGD
Use Type Transactional
Annotation This table stores the accounting records for revenue, unearned revenue
and unbilled receivables for each invoice or credit memo line. Each row
includes the GL account and the amount of the accounting entry. The
ACCOUNT_CLASS REC represents the receivable account and is for the
total amount of the invoice. The primary key for this table is
CUST_TRX_LINE_GL_DIST_ID. It is a transaction table to
RA_CUSTOMER_TRX_ALL and AR_CASH_RECEIPTS_ALL. Please
refer to Oracle E-Biz TRM for more information about this table.

Relation between RA_CUST_TRX_LINE_GL_DIST_ALL and parent RA_CUSTOMER_TRX_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_RA_CUST_TRX_LINE_GL_DIST_ALL_FK

90
Relation between RA_CUST_TRX_LINE_GL_DIST_ALL and parent RA_CUSTOMER_TRX_ALL
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID

Data movement key for RA_CUST_TRX_LINE_GL_DIST_ALL


DM Key name <Row ID>
DM Key Info "RA_CUST_TRX_LINE_GL_DIST_ALL" is set to have data movement
done by row ID.

Rules on RA_CUST_TRX_LINE_GL_DIST_ALL
Name Attributes Annotation
PostableDistributinGLDateParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that postable transactions are
eligible for purge if corresponding
Mode: Exclusive distributions have GL Date less than
Customization: Mandatory cutoff date and posting_control_id
<> -3 or if this rule is overridden by
means of configuration parameter
pcPostableDistributionGLDate.

Query Expression
Database ansi
Query
-- for postable trx_types
((('Y' = (select a.post_to_gl
from ar.ra_cust_trx_types_all a,
ar.ra_customer_trx_all b
where
RCTLGD.CUSTOMER_TRX_ID=b.CUSTOMER_TRX_ID and
a.cust_trx_type_id=b.cust_trx_type_id
and a.org_id=b.org_id)
and (
RCTLGD.ACCOUNT_SET_FLAG != 'N'
OR ( RCTLGD.POSTING_CONTROL_ID != -3 and
RCTLGD.GL_DATE <= cast(:prCutOffDate as date) )
)
)
OR
upper(:pcPostableDistributionGLDate) = 'Y'
)
OR -- for unpostable trx_types
('N' = (select a.post_to_gl
from ar.ra_cust_trx_types_all a,
ar.ra_customer_trx_all b
where
RCTLGD.CUSTOMER_TRX_ID=b.CUSTOMER_TRX_ID and
a.cust_trx_type_id=b.cust_trx_type_id
and a.org_id=b.org_id)
))

4.4.2.11. Table use AR_RECEIVABLE_APPLICATIONS_ALL

AR_RECEIVABLE_APPLICATIONS_ALL
Table Name AR.AR_RECEIVABLE_APPLICATIONS_ALL
Table Alias ARA
Use Type Transactional

91
AR_RECEIVABLE_APPLICATIONS_ALL
Annotation This table stores all accounting entries for your cash and credit memo
applications. Each row includes the amount applied, status, and
accounting flexfield information. Possible statuses of your applications
include APP, UNAPP, ACC, and UNID. CUSTOMER_TRX_ID,
CASH_RECEIPT_ID, and PAYMENT_SCHEDULE_ID identify the
transaction that you are actually applying.
APPLIED_CUSTOMER_TRX_ID and
APPLIED_PAYMENT_SCHEDULE_ID identify the invoice or credit memo
that receives the application. The primary key for this table is
RECEIVABLE_APPLICATION_ID. The two parents for this table are
RA_CUSTOMER_TRX_ALL and AR_CASH_RECEIPTS_ALL. Please
refer to Oracle E-Biz TRM for more information about this table.

Relation between AR_RECEIVABLE_APPLICATIONS_ALL and parent RA_CUSTOMER_TRX_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_AR_RECEIVABLE_APPLICATIONS_ALL_F
K
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID APPLIED_CUSTOMER_TRX_ID

Data movement key for AR_RECEIVABLE_APPLICATIONS_ALL


DM Key name <Row ID>
DM Key Info "AR_RECEIVABLE_APPLICATIONS_ALL" is set to have data movement
done by row ID.

Rules on AR_RECEIVABLE_APPLICATIONS_ALL
Name Attributes Annotation
PostableApplicationGLDateParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that postable transactions are
eligible for purge if corresponding
Mode: Exclusive applications have GL Date less than
Customization: Mandatory cutoff date and posting_control_id
<> -3 or if this rule is overridden by
means of configuration parameter
pcPostableApplicationGLDate.
Query Expression
Database ansi
Query
((decode(NVL(ARA.POSTABLE,'Y'),'Y',ARA.POSTING_CONTROL_ID,0)!= -3
and decode(NVL(ARA.POSTABLE,'Y'),'Y', ARA.GL_DATE, cast(:prCutOffDate as date)-1) <=
cast(:prCutOffDate as date)
)
OR upper(:pcPostableApplicationGLDate) = 'Y')

4.4.2.12. Table use AR_CASH_RECEIPTS_ALL

AR_CASH_RECEIPTS_ALL
Table Name AR.AR_CASH_RECEIPTS_ALL
Table Alias ACR
Use Type Chaining

92
AR_CASH_RECEIPTS_ALL
Annotation This table stores one record for each receipt that you enter. Oracle
Receivables associates a STATUS with each receipt. These statuses
include applied (APP), unapplied (UNAPP), unidentified (UNID), non-
sufficient funds (NSF), reversed receipt (REV), and stop payment
(STOP). The primary key for this table is CASH_RECEIPT_ID. It is added
as a chaining table to AR_RECEIVABLE_APPLICATIONS_ALL in the
model AR_Main. Please refer to Oracle E-Biz TRM for more information
about this table.

Relation between AR_CASH_RECEIPTS_ALL and parent AR_RECEIVABLE_APPLICATIONS_ALL


Parent Table Name AR.AR_RECEIVABLE_APPLICATIONS_ALL
Parent Table Alias ARA
Unique Key Name AR_CASH_RECEIPTS_U1
Foreign Key Name AR_CASH_RECEIPTS_ALL_AR_RECEIVABLE_APPLICATIONS_ALL_F
K
UK Columns FK Columns (FK is on parent)
CASH_RECEIPT_ID CASH_RECEIPT_ID

Data movement key for AR_CASH_RECEIPTS_ALL


DM Key name <Row ID>
DM Key Info "AR_CASH_RECEIPTS_ALL" is set to have data movement done by row
ID.

Rules on AR_CASH_RECEIPTS_ALL
Name Attributes Annotation
ReceiptCustomerNameParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Disabled states that receipt is eligible for
purge if the pay from customer is
Mode: Exclusive same as P_R_CustomerId. This rule
Customization: Mandatory cannot be overridden.
Query Expression
Database ansi
Query
(:prCustomerId IS NULL
OR
NVL(ACR.PAY_FROM_CUSTOMER,:prCustomerId) = :prCustomerId)

4.4.2.13. Table use AR_CASH_RECEIPT_HISTORY_ALL

AR_CASH_RECEIPT_HISTORY_ALL
Table Name AR.AR_CASH_RECEIPT_HISTORY_ALL
Table Alias ACRH
Use Type Transactional
Annotation This table contains each step in the life cycle of a receipt. The status field
tells you which step the receipt has reached which could be APPROVED,
CONFIRMED, REMITTED, CLEARED or REVERSED. The
CURRENT_RECORD_FLAG points you to the current row that is, the
current status of the cash receipt. The primary key for this table is
CASH_RECEIPT_HISTORY_ID. It is a transaction table to
AR_CASH_RECEIPTS_ALL. Please refer to Oracle E-Biz TRM for more
information about this table.

93
Relation between AR_CASH_RECEIPT_HISTORY_ALL and parent AR_CASH_RECEIPTS_ALL
Parent Table Name AR.AR_CASH_RECEIPTS_ALL
Parent Table Alias ACR
Unique Key Name AR_CASH_RECEIPTS_U1
Foreign Key Name AR_CASH_RECEIPTS_ALL_AR_CASH_RECEIPT_HISTORY_ALL_FK
UK Columns (UK is on parent) FK Columns
CASH_RECEIPT_ID CASH_RECEIPT_ID

Data movement key for AR_CASH_RECEIPT_HISTORY_ALL


DM Key name <Row ID>
DM Key Info "AR_CASH_RECEIPT_HISTORY_ALL" is set to have data movement
done by row ID.

Rules on AR_CASH_RECEIPT_HISTORY_ALL
Name Attributes Annotation
PostableReceiptHistGLDateParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that postable receipt is
eligible for purge if the
Mode: Exclusive corresponding history records have
Customization: Mandatory GL Date less than cutoff date and
posting_control_id <> -3 or if this
rule is overridden by means of
configuration parameter
pcPostableReceiptHistoryGLDate.
Query Expression
Database ansi
Query
((ACRH.POSTING_CONTROL_ID != -3 and
ACRH.GL_DATE <= cast(:prCutOffDate as date)
)
OR upper(:pcPostableReceiptHistoryGLDate) = 'Y'
)
Name Attributes Annotation
ReceiptMustBeClearedWithNoRisk Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that receipt is eligible for
purge if the current history status is
Mode: Exclusive in cleared state and is risk
Customization: Mandatory eliminated (determined by
factor_flag=N) or if this rule is
overridden by means of
configuration parameter
pcReceiptCurrHistStatus.
Query Expression
Database ansi
Query
(
NVL(ACRH.CURRENT_RECORD_FLAG,'N') <> 'Y'
OR
(ACRH.STATUS = 'CLEARED' AND ACRH.FACTOR_FLAG = 'N')
OR upper(:pcReceiptCurrHistStatus) = 'Y'
)

4.4.2.14. Table use CE_STATEMENT_RECONCILS_ALL

CE_STATEMENT_RECONCILS_ALL
Table Name CE.CE_STATEMENT_RECONCILS_ALL

94
CE_STATEMENT_RECONCILS_ALL
Table Alias CSR
Use Type Lookup
Annotation The CE_STATEMENT_RECONCILS_ALL table stores information about
reconciliation history or audit trail. Each row represents an action
performed against a statement line. This is a lookup table to
AR_CASH_RECEIPT_HISTORY_ALL. Please refer to Oracle E-Biz TRM
for more information about this table.

Relation between CE_STATEMENT_RECONCILS_ALL and parent AR_CASH_RECEIPT_HISTORY_ALL


Parent Table Name AR.AR_CASH_RECEIPT_HISTORY_ALL
Parent Table Alias ACRH
Unique Key Name CE_STATEMENT_RECONCILS_ALL_UK
Foreign Key Name CE_STATEMENT_RECONCILS_ALL_AR_CASH_RECEIPT_HISTORY_
ALL_FK
Foreign Key Annotation The join condition is to get the current reference identifier in
ce_statement_reconcils_all which matches with
ar_cash_receipt_history_all.cash_receipt_history_id for the reference
(Trasaction) type RECEIPT.
UK Columns FK Columns (FK is on parent)
REFERENCE_ID CASH_RECEIPT_HISTORY_ID
Conditional Relationship on foreign key
Database Code
ansi ${PK_ALIAS}.REFERENCE_TYPE = 'RECEIPT'
AND ${PK_ALIAS}.CURRENT_RECORD_FLAG = 'Y'

Data movement key for CE_STATEMENT_RECONCILS_ALL


DM Key name <Row ID>
DM Key Info "CE_STATEMENT_RECONCILS_ALL" is set to have data movement
done by row ID.

Rules on CE_STATEMENT_RECONCILS_ALL
Name Attributes Annotation
ReceipttShudntHaveRefInCashMgt Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that receipt is eligible for
purge if reconciled bank statements
Mode: Exclusive does not exist in Oracle Cash
Customization: Mandatory Management or if this rule is
overridden by means of
configuration parameter
pcReceiptRefInCE.
Query Expression
Database ansi
Query
(CSR.STATUS_FLAG <> 'M'
OR upper(:pcReceiptRefInCE) = 'Y'
)

4.4.2.15. Table use AR_DISTRIBUTIONS_ALL

AR_DISTRIBUTIONS_ALL
Table Name AR.AR_DISTRIBUTIONS_ALL
Table Alias AD

95
AR_DISTRIBUTIONS_ALL
Use Type Transactional
Annotation This table stores the distributions generated by the different steps in the
life cycle of a cash receipt. The primary key for this table is SOURCE_ID,
SOURCE_TABLE, SOURCE_TYPE. It is added as a transaction table to
AR_CASH_RECEIPT_HISTORY_ALL,
AR_RECEIVABLE_APPLICATIONS_ALL and AR_ADJUSTMENTS_ALL
based on conditional relationship being (SOURCE_TABLE = 'CRH',
SOURCE_TABLE = 'RA' or SOURCE_TABLE = 'ADJ') respectively for
each parent table. SOURCE_ID and SOURCE_TABLE will have values
based on the parent. Please refer to Oracle E-Biz TRM for more
information about this table.

Relation between AR_DISTRIBUTIONS_ALL and parent AR_CASH_RECEIPT_HISTORY_ALL


Parent Table Name AR.AR_CASH_RECEIPT_HISTORY_ALL
Parent Table Alias ACRH
Unique Key Name AR_CASH_RECEIPT_HISTORY_U1
Foreign Key Name AR_CASH_RECEIPT_HISTORY_ALL_AR_DISTRIBUTIONS_ALL_FK
UK Columns (UK is on parent) FK Columns
CASH_RECEIPT_HISTORY_ID SOURCE_ID
Conditional Relationship on foreign key
Database Code
ansi ${FK_ALIAS}.SOURCE_TABLE = 'CRH'

Data movement key for AR_DISTRIBUTIONS_ALL


DM Key name <Row ID>
DM Key Info "AR_DISTRIBUTIONS_ALL" is set to have data movement done by row
ID.

4.4.2.16. Table use AR_PAYMENT_SCHEDULES_ALL_2

AR_PAYMENT_SCHEDULES_ALL_2
Table Name AR.AR_PAYMENT_SCHEDULES_ALL
Table Alias APS2
Use Type Transactional
Annotation This table stores all transactions except adjustments and miscellaneous
cash receipts. Oracle Receivables groups different transactions by the
column CLASS. These classes include invoice (INV), debit memos (DM),
guarantees (GUAR), credit memos (CM), deposits (DEP), chargebacks
(CB), and receipts (PMT). The primary key for this table is
PAYMENT_SCHEDULE_ID. It is a transaction table to
RA_CUSTOMER_TRX_ALL and AR_CASH_RECEIPTS_ALL. Please
refer to Oracle E-Biz TRM for more information about this table.

Relation between AR_PAYMENT_SCHEDULES_ALL_2 and parent AR_CASH_RECEIPTS_ALL


Parent Table Name AR.AR_CASH_RECEIPTS_ALL
Parent Table Alias ACR
Unique Key Name AR_CASH_RECEIPTS_U1
Foreign Key Name AR_CASH_RECEIPTS_ALL_AR_PAYMENT_SCHEDULES_ALL_FK
UK Columns (UK is on parent) FK Columns
CASH_RECEIPT_ID CASH_RECEIPT_ID

96
Data movement key for AR_PAYMENT_SCHEDULES_ALL_2
DM Key name <Row ID>
DM Key Info "AR_PAYMENT_SCHEDULES_ALL_2" is set to have data movement
done by row ID.

Rules on AR_PAYMENT_SCHEDULES_ALL_2
Name Attributes Annotation
ReceiptPaySchedMustBeClosed Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that receipt is eligible for
purge if the corresponding payment
Mode: Exclusive schedules are in closed status or if
Customization: Mandatory this rule is overridden by means of
configuration parameter
pcReceiptPaySchedClosed.
Query Expression
Database ansi
Query
("APS2".STATUS != 'OP'
OR upper(:pcReceiptPaySchedClosed) = 'Y')

4.4.2.17. Table use AR_RATE_ADJUSTMENTS_ALL

AR_RATE_ADJUSTMENTS_ALL
Table Name AR.AR_RATE_ADJUSTMENTS_ALL
Table Alias AR_RATE_ADJUSTMENTS_ALL
Use Type Transactional
Annotation This table stores information about your currency exchange rate
adjustments. The primary key for this table is RATE_ADJUSTMENT_ID. It
is a transaction table to AR_CASH_RECEIPTS_ALL. Please refer to
Oracle E-Biz TRM for more information about this table.

Relation between AR_RATE_ADJUSTMENTS_ALL and parent AR_CASH_RECEIPTS_ALL


Parent Table Name AR.AR_CASH_RECEIPTS_ALL
Parent Table Alias ACR
Unique Key Name AR_CASH_RECEIPTS_U1
Foreign Key Name AR_CASH_RECEIPTS_ALL_AR_RATE_ADJUSTMENTS_ALL_FK
UK Columns (UK is on parent) FK Columns
CASH_RECEIPT_ID CASH_RECEIPT_ID

Data movement key for AR_RATE_ADJUSTMENTS_ALL


DM Key name <Row ID>
DM Key Info "AR_RATE_ADJUSTMENTS_ALL" is set to have data movement done by
row ID.

4.4.2.18. Table use JAI_AR_CASH_RECEIPTS_ALL

JAI_AR_CASH_RECEIPTS_ALL
Table Name JA.JAI_AR_CASH_RECEIPTS_ALL
Table Alias JAI_AR_CASH_RECEIPTS_ALL
Use Type Transactional

97
Relation between JAI_AR_CASH_RECEIPTS_ALL and parent AR_CASH_RECEIPTS_ALL
Parent Table Name AR.AR_CASH_RECEIPTS_ALL
Parent Table Alias ACR
Unique Key Name AR_CASH_RECEIPTS_U1
Foreign Key Name AR_CASH_RECEIPTS_ALL_JAI_AR_CASH_RECEIPTS_ALL_FK
UK Columns (UK is on parent) FK Columns
CASH_RECEIPT_ID CASH_RECEIPT_ID
Conditional Relationship on foreign key
Database Code
ansi 'INR' = (select a.currency_code from ${SOURCE.GL.GL_LEDGERS} a,
${SOURCE.APPS.HR_OPERATING_UNITS} b where a.ledger_id =
b.set_of_books_id and b.organization_id = ${PK_ALIAS}.ORG_ID) and exists
(select'1' flag FROM ${SOURCE.AR.AR_RECEIPT_CLASSES} a,
${SOURCE.AR.AR_RECEIPT_METHODS} bWHERE a.receipt_class_id =
b.receipt_class_idAND a.name = (SELECT a.attribute_value receipt_class FROM
${SOURCE.JA.JAI_RGM_REGISTRATIONS} a,
${SOURCE.JA.JAI_RGM_DEFINITIONS} b
WHEREa.attribute_code = 'AR_RECEIPT_CLASS'
AND a.registration_type = 'OTHERS'
ANDa.attribute_type_code = 'OTHERS'
AND a.regime_id = b.regime_id
ANDb.regime_code = 'TCS'
)
AND b.receipt_method_id = ${PK_ALIAS}.RECEIPT_METHOD_ID
)
and NVL(${FK_ALIAS}.CONFIRM_FLAG,'N') in ('N','I')

Data movement key for JAI_AR_CASH_RECEIPTS_ALL


DM Key name <Row ID>
DM Key Info "JAI_AR_CASH_RECEIPTS_ALL" is set to have data movement done by
row ID.

4.4.2.19. Table use JAI_CMN_DOCUMENT_TAXES

JAI_CMN_DOCUMENT_TAXES
Table Name JA.JAI_CMN_DOCUMENT_TAXES
Table Alias JAI_CMN_DOCUMENT_TAXES
Use Type Transactional

Relation between JAI_CMN_DOCUMENT_TAXES and parent JAI_AR_CASH_RECEIPTS_ALL


Parent Table Name JA.JAI_AR_CASH_RECEIPTS_ALL
Parent Table Alias JAI_AR_CASH_RECEIPTS_ALL
Unique Key Name JAI_AR_CASH_RECEIPTS_ALL_UK
Foreign Key Name JAI_AR_CASH_RECEIPTS_ALL_JAI_CMN_DOCUMENT_TAXES_FK
UK Columns (UK is on parent) FK Columns
CASH_RECEIPT_ID SOURCE_DOC_ID
Conditional Relationship on foreign key
Database Code
ansi ${FK_ALIAS}.SOURCE_TABLE_NAME = 'JAI_AR_CASH_RECEIPTS_ALL'

Data movement key for JAI_CMN_DOCUMENT_TAXES


DM Key name <Row ID>

98
Data movement key for JAI_CMN_DOCUMENT_TAXES
DM Key Info "JAI_CMN_DOCUMENT_TAXES" is set to have data movement done by
row ID.

4.4.2.20. Table use RA_CUSTOMER_TRX_ALL_2

RA_CUSTOMER_TRX_ALL_2
Table Name AR.RA_CUSTOMER_TRX_ALL
Table Alias RCT2
Use Type Chaining

Relation between RA_CUSTOMER_TRX_ALL_2 and parent AR_RECEIVABLE_APPLICATIONS_ALL


Parent Table Name AR.AR_RECEIVABLE_APPLICATIONS_ALL
Parent Table Alias ARA
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_AR_RECEIVABLE_APPLICATIONS_ALL_F
K_2
UK Columns FK Columns (FK is on parent)
CUSTOMER_TRX_ID CUSTOMER_TRX_ID

Data movement key for RA_CUSTOMER_TRX_ALL_2


DM Key name <Row ID>
DM Key Info "RA_CUSTOMER_TRX_ALL_2" is set to have data movement done by
row ID.

Rules on RA_CUSTOMER_TRX_ALL_2
Name Attributes Annotation
CMRunningTotalMustBeZero Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that a Credit Memo
transaction is eligible for purge if the
Mode: Exclusive Running Total (comprising:
Customization: Mandatory gl_dist_total + adjustment_total +
CM_appl_total - Cash_appl_total ) is
zero or if this rule is overridden by
means of configuration parameter
pcRunningTotal.
Query Expression
Database ansi
Query
(exists (select 1 from apps.OBT_RA_CUSTOMER_TRX_RUNING_TOT a where a.customer_trx_id =
RCT2.CUSTOMER_TRX_ID and cust_sum=0) OR upper(:pcRunningTotal) = 'Y')
Name Attributes Annotation
CMTransactionCustomerNamePara Category: Data Integrity This Archive Only eligiblity rule
m Analytics: Disabled states that a credit memo
transaction is eligible for purge if the
Mode: Exclusive bill to customer is same as
Customization: Mandatory prCustomerId. This rule cannot be
overridden.
Query Expression
Database ansi
Query
RCT2.BILL_TO_CUSTOMER_ID=NVL(:prCustomerId,RCT2.BILL_TO_CUSTOMER_ID)
Name Attributes Annotation

99
Rules on RA_CUSTOMER_TRX_ALL_2
CMTransactionDateParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Disabled states that a credit memo
transaction is eligible for purge if the
Mode: Exclusive transaction_date is less than the
Customization: Mandatory cutoff date - prCutOffDate. This rule
cannot be overridden.
Query Expression
Database ansi
Query
RCT2.TRX_DATE<=cast(:prCutOffDate as date)
Name Attributes Annotation
CMTransactionMustBeComplete Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that a credit memo
transaction is eligible for purge if
Mode: Exclusive invoice is in complete status or if
Customization: Mandatory this rule is overridden by means of
configuration parameter
pcCompletedTrx.
Query Expression
Database ansi
Query
(RCT2.COMPLETE_FLAG = 'Y'
OR
upper(:pcCompletedTrx) = 'Y')
Name Attributes Annotation
CMTransactionMustHavePaySched Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that a credit memo
transaction is eligible for purge if
Mode: Exclusive there exists at least one payent
Customization: Mandatory schedule for this transaction or if
this rule is overridden by means of
configuration parameter
pcTrxInPaySched.
Query Expression
Database ansi
Query
(exists (select 1 from AR.ar_payment_schedules_all APSA where APSA.customer_trx_id =
RCT2.CUSTOMER_TRX_ID and APSA.org_id = RCT2.ORG_ID)
OR upper(:pcTrxInPaySched) = 'Y')
Name Attributes Annotation
CMTrxnNotCommitmentRelated Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that a credit memo
transaction is eligible for purge if it is
Mode: Exclusive not related to a commitment type of
Customization: Mandatory invoice or if this rule is overridden by
means of configuration parameter
pcCommitmentRelatedTrx.
Query Expression
Database ansi
Query
(RCT2.INITIAL_CUSTOMER_TRX_ID is null
OR upper(:pcCommitmentRelatedTrx) = 'Y')
Name Attributes Annotation
CMTrxnPaySchedMustBeClosed Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that a credit memo
transaction is eligible for purge if the
Mode: Exclusive corresponding payment schedules
Customization: Mandatory are in closed status or if this rule is
overridden by means of
configuration parameter
pcTrxPaySchedClosed.

100
Rules on RA_CUSTOMER_TRX_ALL_2
Query Expression
Database ansi
Query
(0= (select NVL(SUM(ABS(A.amount_due_remaining)),0) from AR.AR_PAYMENT_SCHEDULES_ALL A
WHERE A.customer_trx_id = RCT2.CUSTOMER_TRX_ID)
OR upper(:pcTrxPaySchedClosed) = 'Y')

4.4.2.21. Table use AR_DISTRIBUTIONS_ALL_2

AR_DISTRIBUTIONS_ALL_2
Table Name AR.AR_DISTRIBUTIONS_ALL
Table Alias AD2
Use Type Transactional
Annotation This table stores the distributions generated by the different steps in the
life cycle of a cash receipt. The primary key for this table is SOURCE_ID,
SOURCE_TABLE, SOURCE_TYPE. It is added as a transaction table to
AR_CASH_RECEIPT_HISTORY_ALL,
AR_RECEIVABLE_APPLICATIONS_ALL and AR_ADJUSTMENTS_ALL
based on conditional relationship being (SOURCE_TABLE = 'CRH',
SOURCE_TABLE = 'RA' or SOURCE_TABLE = 'ADJ') respectively for
each parent table. SOURCE_ID and SOURCE_TABLE will have values
based on the parent. Please refer to Oracle E-Biz TRM for more
information about this table.

Relation between AR_DISTRIBUTIONS_ALL_2 and parent AR_RECEIVABLE_APPLICATIONS_ALL


Parent Table Name AR.AR_RECEIVABLE_APPLICATIONS_ALL
Parent Table Alias ARA
Unique Key Name AR_RECEIVABLE_APPLICATIONS_U1
Foreign Key Name AR_RECEIVABLE_APPLICATIONS_ALL_AR_DISTRIBUTIONS_ALL_FK
UK Columns (UK is on parent) FK Columns
RECEIVABLE_APPLICATION_ID SOURCE_ID
Conditional Relationship on foreign key
Database Code
ansi ${FK_ALIAS}.SOURCE_TABLE = 'RA'

Data movement key for AR_DISTRIBUTIONS_ALL_2


DM Key name <Row ID>
DM Key Info "AR_DISTRIBUTIONS_ALL_2" is set to have data movement done by
row ID.

4.4.2.22. Table use RA_CUST_TRX_LINE_SALESREPS_ALL

RA_CUST_TRX_LINE_SALESREPS_ALL
Table Name AR.RA_CUST_TRX_LINE_SALESREPS_ALL
Table Alias RCTLS
Use Type Transactional
Annotation This table stores sales credit assignments for invoice lines. The primary
key for this table is CUST_TRX_LINE_SALESREP_ID. It is a transaction
table to RA_CUSTOMER_TRX_ALL. Please refer to Oracle E-Biz TRM
for more information about this table.

101
Relation between RA_CUST_TRX_LINE_SALESREPS_ALL and parent RA_CUSTOMER_TRX_ALL
Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_RA_CUST_TRX_LINE_SALESREPS_ALL_
FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID

Data movement key for RA_CUST_TRX_LINE_SALESREPS_ALL


DM Key name <Row ID>
DM Key Info "RA_CUST_TRX_LINE_SALESREPS_ALL" is set to have data
movement done by row ID.

4.4.2.23. Table use RA_CUST_TRX_TYPES_ALL

RA_CUST_TRX_TYPES_ALL
Table Name AR.RA_CUST_TRX_TYPES_ALL
Table Alias RCTT
Use Type Lookup
Annotation This table stores information about each transaction type used for
invoices, commitments and credit memos. Each row includes
AutoAccounting information as well as standard defaults for the resulting
invoices. POST_TO_GL stores Y for Yes and N for No to indicate
whether this transaction can post to your general ledger. This is a lookup
table to RA_CUSTOMER_TRX_ALL. Please refer to Oracle E-Biz TRM
for more information about this table.

Relation between RA_CUST_TRX_TYPES_ALL and parent RA_CUSTOMER_TRX_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUST_TRX_TYPES_ALL_UK
Foreign Key Name RA_CUST_TRX_TYPES_ALL_RA_CUSTOMER_TRX_ALL_FK_2
UK Columns FK Columns (FK is on parent)
CUST_TRX_TYPE_ID CUST_TRX_TYPE_ID
ORG_ID ORG_ID

Data movement key for RA_CUST_TRX_TYPES_ALL


DM Key name <Row ID>
DM Key Info "RA_CUST_TRX_TYPES_ALL" is set to have data movement done by
row ID.

Rules on RA_CUST_TRX_TYPES_ALL
Name Attributes Annotation
TrxnTypeShudNotBeCommitment Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that transaction is eligible for
purge if Transaction Type Not
Mode: Exclusive Commitment (i.e. Deposit or
Customization: Mandatory gaurantee) or if this rule is
overridden by means of
configuration parameter
pcCommitmentTrx.

102
Rules on RA_CUST_TRX_TYPES_ALL
Query Expression
Database ansi
Query
(RCTT.TYPE not in ('DEP', 'GUAR' )
OR
upper(:pcCommitmentTrx) = 'Y')

4.4.2.24. Table use AR_ADJUSTMENTS_ALL

AR_ADJUSTMENTS_ALL
Table Name AR.AR_ADJUSTMENTS_ALL
Table Alias AA
Use Type Transactional
Annotation This table stores information about your invoice adjustments. The primary
key for this table is ADJUSTMENT_ID. It is a transaction table to the table
RA_CUSTOMER_TRX_ALL. Please refer to Oracle E-Biz TRM for more
information about this table.

Relation between AR_ADJUSTMENTS_ALL and parent RA_CUSTOMER_TRX_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_AR_ADJUSTMENTS_ALL_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID

Data movement key for AR_ADJUSTMENTS_ALL


DM Key name <Row ID>
DM Key Info "AR_ADJUSTMENTS_ALL" is set to have data movement done by row
ID.

Rules on AR_ADJUSTMENTS_ALL
Name Attributes Annotation
AdjustmentGLDateParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that postable transaction is
eligible for purge if the
Mode: Exclusive corresponding adjustments have GL
Customization: Mandatory Date less than cutoff date and
posting_control_id <> -3 and
unpostable approved adjustment is
eligible for purge if Gl Posted Date
is less than cutoff date or if this rule
is overridden by means of
configuration parameter
pcAdjustmentGLDate.

Query Expression
Database ansi
Query

103
Rules on AR_ADJUSTMENTS_ALL
-- postable trx_types
(('Y' = (select a.post_to_gl
from ar.ra_cust_trx_types_all a,
ar.ra_customer_trx_all b
where
AA.CUSTOMER_TRX_ID=b.CUSTOMER_TRX_ID and
a.cust_trx_type_id=b.cust_trx_type_id
and a.org_id=b.org_id)
and (AA.STATUS not in ('A','M','W')
OR ( AA.POSTING_CONTROL_ID != -3 and
AA.GL_DATE <= cast(:prCutOffDate as date) )
)
)
OR -- unpostable trx_types

('N' = (select a.post_to_gl


from ar.ra_cust_trx_types_all a,
ar.ra_customer_trx_all b
where
AA.CUSTOMER_TRX_ID=b.CUSTOMER_TRX_ID and
a.cust_trx_type_id=b.cust_trx_type_id
and a.org_id=b.org_id)
and (AA.STATUS not in ('A','M','W')
OR decode(AA.STATUS,'A',AA.GL_DATE,cast(:prCutOffDate as date)+1) <= cast(:prCutOffDate as date)
)
)
OR upper(:pcAdjustmentGLDate) = 'Y'
)

4.4.2.25. Table use AR_DISTRIBUTIONS_ALL_3

AR_DISTRIBUTIONS_ALL_3
Table Name AR.AR_DISTRIBUTIONS_ALL
Table Alias AD3
Use Type Transactional
Annotation This table stores the distributions generated by the different steps in the
life cycle of a cash receipt. The primary key for this table is SOURCE_ID,
SOURCE_TABLE, SOURCE_TYPE. It is added as a transaction table to
AR_CASH_RECEIPT_HISTORY_ALL,
AR_RECEIVABLE_APPLICATIONS_ALL and AR_ADJUSTMENTS_ALL
based on conditional relationship being (SOURCE_TABLE = 'CRH',
SOURCE_TABLE = 'RA' or SOURCE_TABLE = 'ADJ') respectively for
each parent table. SOURCE_ID and SOURCE_TABLE will have values
based on the parent. Please refer to Oracle E-Biz TRM for more
information about this table.

Relation between AR_DISTRIBUTIONS_ALL_3 and parent AR_ADJUSTMENTS_ALL


Parent Table Name AR.AR_ADJUSTMENTS_ALL
Parent Table Alias AA
Unique Key Name AR_ADJUSTMENTS_U1
Foreign Key Name AR_ADJUSTMENTS_ALL_AR_DISTRIBUTIONS_ALL_FK_2
UK Columns (UK is on parent) FK Columns
ADJUSTMENT_ID SOURCE_ID
Conditional Relationship on foreign key
Database Code
ansi ${FK_ALIAS}.SOURCE_TABLE = 'ADJ'

104
Data movement key for AR_DISTRIBUTIONS_ALL_3
DM Key name <Row ID>
DM Key Info "AR_DISTRIBUTIONS_ALL_3" is set to have data movement done by
row ID.

4.4.2.26. Table use AR_NOTES

AR_NOTES
Table Name AR.AR_NOTES
Table Alias AN
Use Type Transactional
Annotation This table stores MemoPad information for customer calls that are
entered in the Customer Calls window. The primary key for this table is
NOTE_ID. It is a transaction table to RA_CUSTOMER_TRX_ALL. Please
refer to Oracle E-Biz TRM for more information about this table.

Relation between AR_NOTES and parent RA_CUSTOMER_TRX_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_AR_NOTES_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID

Data movement key for AR_NOTES


DM Key name <Row ID>
DM Key Info "AR_NOTES" is set to have data movement done by row ID.

4.4.2.27. Table use AR_CUSTOMER_CALL_TOPICS_ALL

AR_CUSTOMER_CALL_TOPICS_ALL
Table Name AR.AR_CUSTOMER_CALL_TOPICS_ALL
Table Alias ACCT
Use Type Transactional
Annotation This table stores information about the topic of customer calls, such as
the outcome of the call, the customer

Relation between AR_CUSTOMER_CALL_TOPICS_ALL and parent RA_CUSTOMER_TRX_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_AR_CUSTOMER_CALL_TOPICS_ALL_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID

Data movement key for AR_CUSTOMER_CALL_TOPICS_ALL


DM Key name <Row ID>

105
Data movement key for AR_CUSTOMER_CALL_TOPICS_ALL
DM Key Info "AR_CUSTOMER_CALL_TOPICS_ALL" is set to have data movement
done by row ID.

4.4.2.28. Table use AR_CALL_ACTIONS

AR_CALL_ACTIONS
Table Name AR.AR_CALL_ACTIONS
Table Alias ACA
Use Type Transactional
Annotation This table stores information about each call action you enter in the
Customer Calls window. Each row includes the action and amount of a
call action. The primary key for this table is CALL_ACTION_ID. It is a
transaction table to AR_CUSTOMER_CALL_TOPICS_ALL. Please refer
to Oracle E-Biz TRM for more information about this table.

Relation between AR_CALL_ACTIONS and parent AR_CUSTOMER_CALL_TOPICS_ALL


Parent Table Name AR.AR_CUSTOMER_CALL_TOPICS_ALL
Parent Table Alias ACCT
Unique Key Name AR_CUSTOMER_CALL_TOPICS_U1
Foreign Key Name AR_CUSTOMER_CALL_TOPICS_ALL_AR_CALL_ACTIONS_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_CALL_TOPIC_ID CUSTOMER_CALL_TOPIC_ID

Data movement key for AR_CALL_ACTIONS


DM Key name <Row ID>
DM Key Info "AR_CALL_ACTIONS" is set to have data movement done by row ID.

4.4.2.29. Table use AR_ACTION_NOTIFICATIONS

AR_ACTION_NOTIFICATIONS
Table Name AR.AR_ACTION_NOTIFICATIONS
Table Alias AAN
Use Type Transactional
Annotation AR_ACTION_NOTIFICATIONS identifies which employees are to be
notified concerning a particular customer call action. The primary key for
this table is ACTION_NOTIFICATION_ID. It is a transaction table to table
AR_CALL_ACTIONS. Please refer to Oracle E-Biz TRM for more
information about this table.

Relation between AR_ACTION_NOTIFICATIONS and parent AR_CALL_ACTIONS


Parent Table Name AR.AR_CALL_ACTIONS
Parent Table Alias ACA
Unique Key Name AR_CALL_ACTIONS_U1
Foreign Key Name AR_CALL_ACTIONS_AR_ACTION_NOTIFICATIONS_FK
UK Columns (UK is on parent) FK Columns
CALL_ACTION_ID CALL_ACTION_ID

106
Data movement key for AR_ACTION_NOTIFICATIONS
DM Key name <Row ID>
DM Key Info "AR_ACTION_NOTIFICATIONS" is set to have data movement done by
row ID.

4.4.2.30. Table use AR_DEFERRED_LINES_ALL

AR_DEFERRED_LINES_ALL
Table Name AR.AR_DEFERRED_LINES_ALL
Table Alias AR_DEFERRED_LINES_ALL
Use Type Transactional
Annotation This table exists only for oracle receivables patch level 11i.AR.O and
higher. The AR_DEFERRED_LINES_ALL table records invoice status
changes, as invoices move through the revenue management life cycle.
It is a transaction table to RA_CUSTOMER_TRX_ALL. Please refer to
Oracle E-Biz TRM for more information about this table.

Relation between AR_DEFERRED_LINES_ALL and parent RA_CUSTOMER_TRX_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_AR_DEFERRED_LINES_ALL_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID

Data movement key for AR_DEFERRED_LINES_ALL


DM Key name <Row ID>
DM Key Info "AR_DEFERRED_LINES_ALL" is set to have data movement done by
row ID.

Rules on AR_DEFERRED_LINES_ALL
Name Attributes Annotation
TrxRevenueCompletelyRecognized Category: Data Integrity This Archive Only eligiblity rule
Analytics: Enabled states that transaction is eligible for
purge if revenue is recognized
Mode: Exclusive completely for each line or if this
Customization: Mandatory rule is overridden by means of
configuration parameter
pcTrxRevenueComplete.

Query Expression
Database ansi
Query
( ("AR_DEFERRED_LINES_ALL"."LINE_COLLECTIBLE_FLAG" != 'N')
OR
("AR_DEFERRED_LINES_ALL"."MANUAL_OVERRIDE_FLAG" != 'N')
OR
("AR_DEFERRED_LINES_ALL"."ACCTD_AMOUNT_DUE_ORIGINAL" =
"AR_DEFERRED_LINES_ALL"."ACCTD_AMOUNT_RECOGNIZED")
OR
(upper(:pcTrxRevenueComplete) = 'Y' ) )

107
4.4.2.31. Table use JAI_AR_TRXS_2

JAI_AR_TRXS_2
Table Name JA.JAI_AR_TRXS
Table Alias JAI_AR_TRXS_2
Use Type Transactional

Relation between JAI_AR_TRXS_2 and parent RA_CUSTOMER_TRX_ALL


Parent Table Name AR.RA_CUSTOMER_TRX_ALL
Parent Table Alias RCT
Unique Key Name RA_CUSTOMER_TRX_U1
Foreign Key Name RA_CUSTOMER_TRX_ALL_JAI_AR_TRXS_FK
UK Columns (UK is on parent) FK Columns
CUSTOMER_TRX_ID CUSTOMER_TRX_ID
Conditional Relationship on foreign key
Database Code
ansi 'INR' = (select a.currency_code from ${SOURCE.GL.GL_LEDGERS} a,
${SOURCE.APPS.HR_OPERATING_UNITS} b where a.ledger_id =
b.set_of_books_id and b.organization_id = ${PK_ALIAS}.ORG_ID)

Data movement key for JAI_AR_TRXS_2


DM Key name <Row ID>
DM Key Info "JAI_AR_TRXS_2" is set to have data movement done by row ID.

4.5. Source Model TransactionBatches


Source Model Info
UID C7A7-3F4D-586A-E2C7
Annotation This model has a driving table AR.RA_BATCHES_ALL, a lookup table
AR.RA_CUSTOMER_TRX_ALL and a transaction table AR.RA_MC_BATCHES. A batch
is eligible for archiving when all the transactions associated with it are assigned a status
of archived. Data movement for the driving table happens based on related rows exist in
the lookup table. If there are no rows in RA_CUSTOMER_TRX_ALL for a particular
batch_id then the same row from RA_BATCHES_ALL gets archived to the target
database. If for a particular batch_id some rows are in target and some in source
database then purged_children_flag is set to Y in the business flow groovy scripts which
use this model.

4.5.1. ER Diagram

4.5.2. Table use List

108
4.5.2.1. Table use RA_BATCHES_ALL

RA_BATCHES_ALL
Table Name AR.RA_BATCHES_ALL
Table Alias RA_BATCHES_ALL
Use Type Transactional
Annotation This table stores information about each batch of invoices you enter in
Oracle Receivables. The primary key for this table is BATCH_ID. It is a
driving table for model TransactionBatches. Please refer to Oracle E-Biz
TRM for more information about this table.

Data movement key for RA_BATCHES_ALL


DM Key name <Row ID>
DM Key Info "RA_BATCHES_ALL" is set to have data movement done by row ID.

Rules on RA_BATCHES_ALL
Name Attributes Annotation
OperatingUnitParam Category: Data Integrity This Archive Only eligiblity rule
Analytics: Disabled states that transaction batch is
eligible for purge if it belongs to the
Mode: Exclusive operation unit prOrgId, provided as
Customization: Mandatory parameter. This rule cannot be
overridden.

Query Expression
Database ansi
Query
RA_BATCHES_ALL.PURGED_CHILDREN_FLAG = 'Y'
and RA_BATCHES_ALL.ORG_ID = :prOrgId

4.5.2.2. Table use RA_CUSTOMER_TRX_ALL

RA_CUSTOMER_TRX_ALL
Table Name AR.RA_CUSTOMER_TRX_ALL
Table Alias RA_CUSTOMER_TRX_ALL
Use Type Lookup
Annotation This is added as a lookup table in model TransactionBatches. It is
basically used to check for the existence of transactions for a particular
batch on source database for archive and target database for reload.
Please refer to Oracle E-Biz TRM for more information about this table.

Relation between RA_CUSTOMER_TRX_ALL and parent RA_BATCHES_ALL


Parent Table Name AR.RA_BATCHES_ALL
Parent Table Alias RA_BATCHES_ALL
Unique Key Name RA_CUSTOMER_TRX_ALL_UK
Foreign Key Name RA_CUSTOMER_TRX_ALL_RA_BATCHES_ALL_FK
UK Columns FK Columns (FK is on parent)
BATCH_ID BATCH_ID

Data movement key for RA_CUSTOMER_TRX_ALL


DM Key name <Row ID>

109
Data movement key for RA_CUSTOMER_TRX_ALL
DM Key Info "RA_CUSTOMER_TRX_ALL" is set to have data movement done by row
ID.

Rules on RA_CUSTOMER_TRX_ALL
Name Attributes Annotation
AllTrxnArchivedForBatch Category:
Analytics: Disabled
Mode: Exclusive
Customization: Mandatory
Query Expression
Database ansi
Query
(1=2)

110

S-ar putea să vă placă și