Transaction Resolution Report
Resolves Receivables transactions against China's Golden Tax (VAT) system — matching each AR invoice to its Golden Tax record and flagging transactions not yet transferred or out of sync, so the China VAT filing ties to AR.
Related Pairs with the Golden Tax Reconciliation Report — this matches at transaction level; that reconciles the VAT totals.
Sample build of the Transaction Resolution Report — reconciled, and rendered tool-neutral so it runs in Power BI, ThoughtSpot, or Tableau.
| Transaction | Customer | Ar Amount | Golden Tax Amount | Status | Difference |
|---|---|---|---|---|---|
| Sample | Acme Industrial | $1,240,500.00 | $1,240,500.00 | Open | Sample |
| — | Northwind Trading | $842,150.75 | $842,150.75 | Posted | — |
| Sample | Globex Holdings | $96,400.00 | $96,400.00 | Validated | Sample |
| — | Initech LLC | $1,005,233.10 | $1,005,233.10 | Open | — |
| Sample | Umbrella Corp | $58,720.40 | $58,720.40 | Paid | Sample |
| Sample | Acme Industrial | $1,240,500.00 | $1,240,500.00 | Open | Sample |
The report matches AR transactions to their JA_CN Golden Tax headers, flagging mismatches.
80 AR invoices have no Golden Tax record — they can't be reported for China VAT until transferred to the Golden Tax system.
Transfer the 80 to Golden Tax before the filing; an untransferred invoice is invisible to the China VAT return.
This is the report's BI Publisher data model — the SQL data set BI Publisher runs against Oracle tables to produce the output. The same SQL becomes a dbt model in your warehouse, so one definition drives both the formatted report and the analytics layer.
Data sources
- RA_CUSTOMER_TRX_ALL
- RA_CUSTOMER_TRX_LINES_ALL
- JA_CN_TRX_HEADERS_ALL
- AR_PAYMENT_SCHEDULES_ALL
- HZ_CUST_ACCOUNTS
Show / hide SQL
-- CUSTOM Transaction Resolution Report SQL
select a.trx_number,a.Transaction_amount,a.Transaction_Balance,a.invoice_currency_code, a.PURCHASE_ORDER
,a.Govt_Inv_Number, a.Golden_Tax_Number, a.Transaction_Status, a.bu_name, a.legal_entity_name, a.LEGAL_ENTITY
,a.customer_Registry_id, a.customer_name, a.account_number, a.bill_to_location , to_char(a.TRX_DATE,'MM/DD/YYYY') TRX_DATE ,a.receipt_number,a.AMOUNT_APPLIED
,a.Receipt_method, to_char(a.GL_DATE,'MM/DD/YYYY') gl_date, to_char(a.application_date,'MM/DD/YYYY')application_date , a.Application_Type, a.Application_Ref,a.Application_Reference_Reason
from
(
select rcta.trx_number,rcta.customer_trx_id
,(select sum(extended_amount) from RA_CUSTOMER_TRX_LINES_ALL where ORG_ID = rcta.ORG_ID and customer_trx_id = rcta.customer_trx_id) Transaction_amount
,(select sum(AMOUNT_DUE_REMAINING) from ar_payment_schedules_all where ORG_ID= rcta.ORG_ID and CUSTOMER_TRX_ID=rcta.customer_trx_id) Transaction_Balance
,rcta.invoice_currency_code
,rcta.PURCHASE_ORDER
,rcta.ATTRIBUTE1 Govt_Inv_Number
,(select gta_trx_number from ja_cn_trx_headers_all where ra_trx_id= rcta.customer_trx_id and org_id=rcta.org_id ) Golden_Tax_Number
,DECODE (rcta.COMPLETE_FLAG, 'Y', 'Complete',
'Incomplete') Transaction_Status
,fub.bu_name
,GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL(gcc.CHART_OF_ACCOUNTS_ID,1,gcc.segment1) legal_entity_name
,gcc.segment1 LEGAL_ENTITY
,hp.party_number customer_Registry_id
,hp.party_name customer_name
,hca.account_number
,hcsu.location bill_to_location
,rcta.TRX_DATE
,acra.receipt_number
,araa.AMOUNT_APPLIED*-1 AMOUNT_APPLIED
,arm.name Receipt_method
,araa.GL_DATE
,araa.APPLY_DATE application_date
--,rcta.TRX_CLASS Application_Type
,rctt.name Application_Type
,nvl(araa.APPLICATION_REF_NUM,rcta.trx_number) Application_Ref
,null Application_Reference_Reason
from ra_customer_trx_all rcta
,fun_all_business_units_v fub
,hz_cust_accounts hca
,hz_parties hp
,hz_cust_site_uses_all hcsu
,ar_receivable_applications_all araa
,ar_cash_receipts_all acra
,ar_receipt_methods arm
,ra_cust_trx_types_all rctt
,ra_cust_trx_line_gl_dist_all rctlg
,gl_code_combinations gcc
where 1=1
-- and rcta.trx_number = '49001'
and rcta.COMPLETE_FLAG='Y'
and rcta.org_id = fub.bu_id
and hca.cust_account_id = rcta.bill_to_customer_id
and hp.party_id = hca.party_id
and rcta.bill_to_site_use_id = hcsu.site_use_id(+)
and araa.APPLIED_CUSTOMER_TRX_ID=rcta.CUSTOMER_TRX_ID
and araa.DISPLAY ='Y'
and araa.CASH_RECEIPT_ID=acra.CASH_RECEIPT_ID
and arm.receipt_method_id=acra.receipt_method_id
and rcta.cust_trx_type_seq_id = rctt.cust_trx_type_seq_id
and rcta.customer_trx_id = rctlg.customer_trx_id
and rctlg.code_combination_id = gcc.code_combination_id
and rctlg.account_class ='REC'
and rcta.org_id = rctlg.org_id
and (fub.bu_id IN (:p_org_id)OR 1 IN (:p_org_id||'1'))
and (gcc.segment1 IN (:p_entity)OR 1 IN (:p_entity||'1'))
and (((araa.GL_DATE BETWEEN NVL(:p_date_from , araa.GL_DATE) AND NVL(:p_date_to, araa.GL_DATE)) AND :p_run_by_date='GL Date')
or
(( rcta.TRX_DATE between NVL(:p_date_from , rcta.TRX_DATE) AND NVL(:p_date_to, rcta.TRX_DATE)) and :p_run_by_date='Transaction Date'))
and (rcta.TRX_CLASS in (:p_trx_class)OR '1' IN (:p_trx_class||'1'))
and (hca.account_number in (:p_cust_num) or '1' in (:p_cust_num||'1'))
union ALL -- Discount at receipt
select rcta.trx_number,rcta.customer_trx_id
,(select sum(extended_amount) from RA_CUSTOMER_TRX_LINES_ALL where ORG_ID = rcta.ORG_ID and customer_trx_id = rcta.customer_trx_id) Transaction_amount
,(select sum(AMOUNT_DUE_REMAINING) from ar_payment_schedules_all where ORG_ID= rcta.ORG_ID and CUSTOMER_TRX_ID=rcta.customer_trx_id) Transaction_Balance
,rcta.invoice_currency_code
,rcta.PURCHASE_ORDER
,rcta.ATTRIBUTE1 Govt_Inv_Number
,(select gta_trx_number from ja_cn_trx_headers_all where ra_trx_id= rcta.customer_trx_id and org_id=rcta.org_id ) Golden_Tax_Number
,DECODE (rcta.COMPLETE_FLAG, 'Y', 'Complete',
'Incomplete') Transaction_Status
,fub.bu_name
,GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL(gcc.CHART_OF_ACCOUNTS_ID,1,gcc.segment1) legal_entity_name
,gcc.segment1 LEGAL_ENTITY
,hp.party_number customer_Registry_id
,hp.party_name customer_name
,hca.account_number
,hcsu.location bill_to_location
,rcta.TRX_DATE
,acra.receipt_number
,araa.LINE_EDISCOUNTED*-1
,arm.name Receipt_method
,araa.GL_DATE
,araa.APPLY_DATE application_date
--,rcta.TRX_CLASS Application_Type
,'Discount' Application_Type
,nvl(araa.APPLICATION_REF_NUM,rcta.trx_number) Application_Ref
,null Application_Reference_Reason
from ra_customer_trx_all rcta
,fun_all_business_units_v fub
,hz_cust_accounts hca
,hz_parties hp
,hz_cust_site_uses_all hcsu
,ar_receivable_applications_all araa
,ar_cash_receipts_all acra
,ar_receipt_methods arm
,ra_cust_trx_types_all rctt
,ra_cust_trx_line_gl_dist_all rctlg
,gl_code_combinations gcc
where 1=1
--and rcta.trx_number = '65462'
and rcta.COMPLETE_FLAG='Y'
and rcta.org_id = fub.bu_id
and hca.cust_account_id = rcta.bill_to_customer_id
and hp.party_id = hca.party_id
and rcta.bill_to_site_use_id = hcsu.site_use_id(+)
and araa.APPLIED_CUSTOMER_TRX_ID=rcta.CUSTOMER_TRX_ID
and araa.DISPLAY ='Y'
and araa.CASH_RECEIPT_ID=acra.CASH_RECEIPT_ID
and arm.receipt_method_id=acra.receipt_method_id
and rcta.cust_trx_type_seq_id = rctt.cust_trx_type_seq_id
and rcta.customer_trx_id = rctlg.customer_trx_id
and rctlg.code_combination_id = gcc.code_combination_id
and rctlg.account_class ='REC'
and rcta.org_id = rctlg.org_id
and (fub.bu_id IN (:p_org_id)OR 1 IN (:p_org_id||'1'))
and (gcc.segment1 IN (:p_entity)OR 1 IN (:p_entity||'1'))
and (((araa.GL_DATE BETWEEN NVL(:p_date_from , araa.GL_DATE) AND NVL(:p_date_to, araa.GL_DATE)) AND :p_run_by_date='GL Date')
or
(( rcta.TRX_DATE between NVL(:p_date_from , rcta.TRX_DATE) AND NVL(:p_date_to, rcta.TRX_DATE)) and :p_run_by_date='Transaction Date'))
and (rcta.TRX_CLASS in (:p_trx_class)OR '1' IN (:p_trx_class||'1'))
and (hca.account_number in (:p_cust_num) or '1' in (:p_cust_num||'1'))
and (nvl(araa.LINE_EDISCOUNTED,0)<>0)
union ALL -- for Credit_Memo
select rcta.trx_number,rcta.customer_trx_id
,(select sum(extended_amount) from RA_CUSTOMER_TRX_LINES_ALL where ORG_ID = rcta.ORG_ID and customer_trx_id = rcta.customer_trx_id) Transaction_amount
,(select sum(AMOUNT_DUE_REMAINING) from ar_payment_schedules_all where ORG_ID= rcta.ORG_ID and CUSTOMER_TRX_ID=rcta.customer_trx_id) Transaction_Balance
,rcta.invoice_currency_code
,rcta.PURCHASE_ORDER
,rcta.ATTRIBUTE1 Govt_Inv_Number
,(select gta_trx_number from ja_cn_trx_headers_all where ra_trx_id= rcta.customer_trx_id and org_id=rcta.org_id ) Golden_Tax_Number
,DECODE (rcta.COMPLETE_FLAG, 'Y', 'Complete',
'Incomplete') Transaction_Status
,fub.bu_name
,GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL(gcc.CHART_OF_ACCOUNTS_ID,1,gcc.segment1) legal_entity_name
,gcc.segment1 LEGAL_ENTITY
,hp.party_number customer_Registry_id
,hp.party_name customer_name
,hca.account_number
,hcsu.location bill_to_location
,rcta.TRX_DATE
,null receipt_number
,(select sum(extended_amount) from RA_CUSTOMER_TRX_LINES_ALL where ORG_ID = rcta2.ORG_ID and customer_trx_id = rcta2.customer_trx_id) AMOUNT_APPLIED
,null Receipt_method
,rcta2.TRX_DATE GL_DATE
,rcta2.TRX_DATE application_date
--,rcta2.TRX_CLASS Application_Type
,rctt.name Application_Type
,rcta2.trx_number Application_Ref
,null Application_Reference_Reason
from ra_customer_trx_all rcta
,fun_all_business_units_v fub
,hz_cust_accounts hca
,hz_parties hp
,hz_cust_site_uses_all hcsu
,ra_customer_trx_all rcta2
,ra_cust_trx_types_all rctt
,ra_cust_trx_line_gl_dist_all rctlg
,gl_code_combinations gcc
where 1=1
--and rcta.trx_number = '49001'
and rcta.COMPLETE_FLAG='Y'
and rcta.org_id = fub.bu_id
and hca.cust_account_id = rcta.bill_to_customer_id
and hp.party_id = hca.party_id
and rcta.bill_to_site_use_id = hcsu.site_use_id(+)
and rcta.CUSTOMER_TRX_ID = rcta2.PREVIOUS_CUSTOMER_TRX_ID
and rcta2.cust_trx_type_seq_id = rctt.cust_trx_type_seq_id
and rcta2.COMPLETE_FLAG='Y'
and rcta.customer_trx_id = rctlg.customer_trx_id
and rctlg.code_combination_id = gcc.code_combination_id
and rctlg.account_class ='REC'
and rcta.org_id = rctlg.org_id
and (fub.bu_id IN (:p_org_id)OR 1 IN (:p_org_id||'1'))
and (gcc.segment1 IN (:p_entity)OR 1 IN (:p_entity||'1'))
and (((rcta2.TRX_DATE BETWEEN NVL(:p_date_from , rcta2.TRX_DATE) AND NVL(:p_date_to, rcta2.TRX_DATE)) AND :p_run_by_date='GL Date')
or
(( rcta.TRX_DATE between NVL(:p_date_from , rcta.TRX_DATE) AND NVL(:p_date_to, rcta.TRX_DATE)) and :p_run_by_date='Transaction Date'))
and (rcta.TRX_CLASS in (:p_trx_class)OR '1' IN (:p_trx_class||'1'))
and (hca.account_number in (:p_cust_num) or '1' in (:p_cust_num||'1'))
union all --invoice adjustments
select rcta.trx_number,rcta.customer_trx_id
,(select sum(extended_amount) from RA_CUSTOMER_TRX_LINES_ALL where ORG_ID = rcta.ORG_ID and customer_trx_id = rcta.customer_trx_id) Transaction_amount
,(select sum(AMOUNT_DUE_REMAINING) from ar_payment_schedules_all where ORG_ID= rcta.ORG_ID and CUSTOMER_TRX_ID=rcta.customer_trx_id) Transaction_Balance
,rcta.invoice_currency_code
,rcta.PURCHASE_ORDER
,rcta.ATTRIBUTE1 Govt_Inv_Number
,(select gta_trx_number from ja_cn_trx_headers_all where ra_trx_id= rcta.customer_trx_id and org_id=rcta.org_id ) Golden_Tax_Number
,DECODE (rcta.COMPLETE_FLAG, 'Y', 'Complete',
'Incomplete') Transaction_Status
,fub.bu_name
,GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL(gcc.CHART_OF_ACCOUNTS_ID,1,gcc.segment1) legal_entity_name
,gcc.segment1 LEGAL_ENTITY
,hp.party_number customer_Registry_id
,hp.party_name customer_name
,hca.account_number
,hcsu.location bill_to_location
,rcta.TRX_DATE
,null receipt_number
,adj.AMOUNT AMOUNT_APPLIED
,null Receipt_method
,adj.GL_DATE GL_DATE
,adj.APPLY_DATE application_date
,arta.name Application_Type
,INITCAP(adj.TYPE||' '|| arta.TYPE) Application_Ref
,INITCAP(adj.reason_code) Application_Reference_Reason
from ra_customer_trx_all rcta
,fun_all_business_units_v fub
,hz_cust_accounts hca
,hz_parties hp
,hz_cust_site_uses_all hcsu
,ar_adjustments_all adj
,ar_receivables_trx_all arta
,ra_cust_trx_line_gl_dist_all rctlg
,gl_code_combinations gcc
where 1=1
-- and rcta.trx_number = '49001'
and rcta.COMPLETE_FLAG='Y'
and rcta.org_id = fub.bu_id
and hca.cust_account_id = rcta.bill_to_customer_id
and hp.party_id = hca.party_id
and rcta.bill_to_site_use_id = hcsu.site_use_id(+)
and rcta.customer_trx_id = adj.customer_trx_id
and rcta.org_id=adj.org_id
and adj.status ='A' -- only approved need to consider
and adj.receivables_trx_id = arta.receivables_trx_id
and adj.org_id = arta.org_id
and rcta.customer_trx_id = rctlg.customer_trx_id
and rctlg.code_combination_id = gcc.code_combination_id
and rctlg.account_class ='REC'
and rcta.org_id = rctlg.org_id
and (fub.bu_id IN (:p_org_id)OR 1 IN (:p_org_id||'1'))
and (gcc.segment1 IN (:p_entity)OR 1 IN (:p_entity||'1'))
and (((adj.gl_date BETWEEN NVL(:p_date_from , adj.gl_date) AND NVL(:p_date_to, adj.gl_date)) AND :p_run_by_date='GL Date')
or
(( rcta.TRX_DATE between NVL(:p_date_from , rcta.TRX_DATE) AND NVL(:p_date_to, rcta.TRX_DATE)) and :p_run_by_date='Transaction Date'))
and (rcta.TRX_CLASS in (:p_trx_class) OR '1' IN (:p_trx_class||'1'))
and (hca.account_number in (:p_cust_num) or '1' in (:p_cust_num||'1'))
) a
where 1=1
order by a.bu_name,a.LEGAL_ENTITY,a.customer_name, a.account_number, a.trx_number,a.TRX_DATEThe data-warehouse model — one fact surrounded by conformed dimensions (what you slice by) and measures (what you aggregate), expressed as dbt so it migrates with you. Grain: one row per source transaction.
| Element | Type | Definition |
|---|---|---|
| RA_CUSTOMER_TRX_LINES_ALL | dimension | dimension |
| JA_CN_TRX_HEADERS_ALL | dimension | dimension |
| AR_PAYMENT_SCHEDULES_ALL | dimension | dimension |
| HZ_CUST_ACCOUNTS | dimension | dimension |
| Ar Amount | measure | measure |
| Golden Tax Amount | measure | measure |
Every source object behind this report. Each linked table has its own page with full column descriptions, drawn from the Oracle BICC lineage and articulated for practitioners.
| Table | Reporting columns | Subject areas |
|---|---|---|
| RA_CUSTOMER_TRX_ALL | 58 | 16 |
| RA_CUSTOMER_TRX_LINES_ALL | 56 | 7 |
| JA_CN_TRX_HEADERS_ALL | Setup / configuration table — joined for reference, not exposed for analytics | |
| AR_PAYMENT_SCHEDULES_ALL | 32 | 6 |
| HZ_CUST_ACCOUNTS | 14 | 43 |