Thursday 21 July 2022

AR Invoice Details in oracle fusion

 SELECT DISTINCT 
null customer_project,
hp_bill.party_name company_name,
hl_bill.country bill_to_country,
rcta.trx_date transaction_date,
rcta.creation_date date_created,
rctta.name transaction_type,
null document_number,
rcta.trx_number cexternal_id,
gjl.description memo,
/*( select distinct gjl.description
from
gl_je_headers gjh,
gl_je_lines gjl,
gl_import_references imp,
xla_ae_lines xal,
xla_ae_headers xah,
xla_events xe,
xla_transaction_entities xte
where 1=1
--and previous_customer_trx_id is not null
AND gjh.je_source = 'Receivables'
AND gjh.je_header_id = gjl.je_header_id
AND gjl.je_header_id = imp.je_header_id
AND gjl.je_line_num = imp.je_line_num
AND imp.gl_sl_link_id = xal.gl_sl_link_id
AND imp.gl_sl_link_table = xal.gl_sl_link_table
AND xal.application_id = xah.application_id
AND xal.ae_header_id = xah.ae_header_id
AND xah.application_id = xe.application_id
AND xah.event_id = xe.event_id
AND xe.application_id = xte.application_id
--AND xte.application_id = 222
AND xe.entity_id = xte.entity_id
AND xte.entity_code = 'TRANSACTIONS'
AND xte.source_id_int_1 = rcta.customer_trx_id) memo,*/
apsa.due_date,
null age,
rcta.invoice_currency_code Currency,
apsa.amount_due_original * nvl(apsa.exchange_rate,1) amount_foreign_currency,
apsa.amount_due_remaining * nvl(apsa.exchange_rate,1) amount_due_foreign_currency,
apsa.exchange_rate,
null Open_Balance,
null account_current_balance,
hou.organization_id,
hou.name
FROM ra_customer_trx_all rcta,
ra_cust_trx_types_all rctta,
ar_payment_schedules_all apsa,
hr_operating_units hou,
hz_cust_accounts hca_bill,
hz_parties hp_bill,
hz_cust_site_uses_all hcsua_bill,
hz_cust_acct_sites_all hcasa_bill,
hz_party_sites hps_bill,
hz_locations hl_bill,
gl_je_headers gjh,
gl_je_lines gjl,
gl_code_combinations gcc,
gl_import_references imp,
xla_ae_lines xal,
xla_ae_headers xah,
xla_events xe,
xla_transaction_entities xte
WHERE 1=1
AND rcta.cust_trx_type_seq_id = rctta.cust_trx_type_seq_id 
AND rcta.customer_trx_id = apsa.customer_trx_id
AND rcta.org_id = hou.organization_id
AND rcta.bill_to_customer_id   = hca_bill.cust_account_id
AND hca_bill.party_id = hp_bill.party_id
AND rcta.bill_to_site_use_id = hcsua_bill.site_use_id
AND hcsua_bill.cust_acct_site_id = hcasa_bill.cust_acct_site_id
AND hcasa_bill.party_site_id = hps_bill.party_site_id
AND hps_bill.location_id = hl_bill.location_id
AND gjh.je_source = 'Receivables'
AND gjh.je_header_id = gjl.je_header_id
AND gjl.je_header_id = imp.je_header_id
AND gjl.je_line_num = imp.je_line_num
AND imp.gl_sl_link_id = xal.gl_sl_link_id
AND imp.gl_sl_link_table = xal.gl_sl_link_table
AND xal.application_id = xah.application_id
AND xal.ae_header_id = xah.ae_header_id
AND xah.application_id = xe.application_id
AND xah.event_id = xe.event_id
AND xe.application_id = xte.application_id
--AND xte.application_id = 222
AND xe.entity_id = xte.entity_id
AND xte.entity_code = 'TRANSACTIONS'
AND xte.source_id_int_1 = rcta.customer_trx_id
AND gjl.code_combination_id = gcc.code_combination_id
AND gcc.segment3 = nvl(:p_account_code,gcc.segment3)
AND rcta.trx_date >= nvl(:p_from_date,rcta.trx_date)
AND rcta.trx_date <= nvl(:p_to_date,rcta.trx_date)
AND hou.organization_id = nvl(:p_business_unit,hou.organization_id)
--AND rcta.trx_number in ('INV23994226','111100001030')

No comments:

Post a Comment