Featured post

Functionality of Segment Value Inheritance ESS Process

  The Segment Value Inheritance process simplifies the maintenance of the chart of accounts. When the characteristics of values in the value...

Tuesday 29 May 2018

AP Table Relation Oracle Apps

AP Table Relation Oracle Apps

ORACLE PAYABLE TABLE RELATION
Source Table
Dependent Table
Condition
AP_INVOICE_LINES_ALL AIL
ZX_LINES_SUMMARY ZLS
AIL.invoice_id=ZLS.trx_id
and ZLS.application_id = 200
and ZLS.entity_code = 'AP_INVOICES'
and ZLS.event_class_code in ('STANDARD
INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS')
and AIL.summary_tax_line_id=ZLS.summary_tax_line_id
AP_INVOICE_LINES_ALL AIL
ZX_LINES ZL
AIL.invoice_id=ZL.trx_id
and ZL.application_id = 200
and ZL.entity_code = 'AP_INVOICES'
and ZL.event_class_code in ('STANDARD
INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS')
and AIL.line_number=ZL.trx_line_number
AP_INVOICE_DISTRIBUTIONS_ALL AID
ZX_REC_NREC_DIST ZD
AID.invoice_id=ZD.trx_id
and ZD.application_id = 200
and ZD.entity_code = 'AP_INVOICES'
and ZD.event_class_code in ('STANDARD
INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS')
and AID.summary_tax_line_id =
ZD.summary_tax_line_id
and AID.detail_tax_dist_id =
ZD.rec_nrec_tax_dist_id
AP_SELF_ASSESSED_TAX_DIST_ALL ASTD
ZX_REC_NREC_DIST ZD
ASTD.invoice_id=ZD.trx_id
and ZD.application_id = 200
and ZD.entity_code = 'AP_INVOICES'
and ZD.event_class_code in ('STANDARD
INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS')
and ASTD.summary_tax_line_id =
ZD.summary_tax_line_id
and ASTD.detail_tax_dist_id=ZD.rec_nrec_tax_dist_id
and ZD.self_assessed_flag='Y'
AP_INVOICE_LINES_ALL AIL
ZX_LINES_DET_FACTORS ZLDF
AIL.invoice_id=ZLDF.trx_id
and ZLDF.application_id = 200
and ZLDF.entity_code = 'AP_INVOICES'
and ZLDF.event_class_code in ('STANDARD
INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS')
and AIL.line_number=ZLDF.trx_line_number
AP_INVOICE_DISTRIBUTIONS_ALL or
AP_SELF_ASSESSED_TAX_DIST_ALL AID
XLA_EVENTS XE
Actual Event:
--------------
xe.event_id = aid.accounting_event_id
and xe.application_id = 200
Budgetary Event:
-----------------
xe.event_id = aid.bc_event_id
and xe.application_id = 200
AP_INVOICE_DISTRIBUTIONS_ALL or
AP_SELF_ASSESSED_TAX_DIST_ALL AID
RCV_TRANSACTIONS RT
aid.rcv_transaction_id = rt.transaction_id
AP_INVOICE_DISTRIBUTIONS_ALL or
AP_SELF_ASSESSED_TAX_DIST_ALL AID
GL_CODE_COMBINATIONS GCC
aid.dist_code_combination_id=gcc.code_combination_id
AP_PAYMENT_HISTORY_ALL APH
XLA_EVENTS XE
aph.accounting_event_id = xe.event_id    and xe.application_id = 200
AP_INVOICE_PAYMENTS_ALL AIP
XLA_EVENTS XE
aip.accounting_event_id = xe.event_id
and xe.application_id = 200
AP_INVOICE_DISTRIBUTIONS_ALL or
AP_SELF_ASSESSED_TAX_DIST_ALL AID
PO_DISTRIBUTIONS_ALL
PD aid.po_distribution_id = pd.po_distribution_id
AP_INVOICES_ALL AI
PO_HEADERS_ALL PH
ai.po_header_id = ph.po_header_id
AP_SUPPLIER_SITES_ALL ASS
HZ_PARTY_SITES HPS
ass.party_site_id = hps.party_site_id
AP_SUPPLIERS AS
HZ_PARTIES HP
as.party_id = hp.party_id
AP_PRERPAY_APP_DISTS or
AP_PAYMENT_HIST_DISTS APA
XLA_EVENTS XE
apa.accounting_event_id = xe.event_id
xe.application_id = 200
AP_PREPAY_HISTORY_ALL APH
XLA_EVENTS XE
aph.accounting_event_id = xe.event_id
and xe.application_id = 200
AP_INVOICES_ALL AI
XLA.XLA_TRANSACTION_ENTITIES XTE
ai.invoice_id = nvl(xte.source_id_int_1, -99)
and xte.entity_code = 'AP_INVOICES'
and xte.application_id = 200
AP_CHECKS_ALL AC
XLA.XLA_TRANSACTION_ENTITIES XTE
ac.check_id = nvl(xte.source_id_int_1, -99)
and xte.entity_code = 'AP_PAYMENTS'
and xte.application_id =200

Sunday 27 May 2018

Link between the table GL_IMPORT_REFERENCES and AP tables

When you say Link I'm presuming you mean BACKTRACK or REFER TO=20 

In Metalink look for:=20 

NOTE 130542.1 


Note 1011799.6 - 'How Does Oracle Payables Populate References Columns 
In GL_IMPORT_REFERENCES' helps at all.=20 

The reference fields are used in different ways by each subledger. 
Following is the use that Oracle Accounts Payable gives to these fields: 

USER_JE_CATEGORY_NAME: Payments 
USER_JE_SOURCE_NAME: Payables 

Reference21 Supplier name 
Reference22 Internal Invoice identification 
Reference23 Internal Check identification 
Reference24 External check number 
Reference25 Paid invoice number 
Reference26 'AP Invoices' 
Reference27 Payment number 
Reference29 Paid invoice identification 
Reference30 'CASH' or 'DISCOUNT' or 'LIABILITY' 
- 19 - 
USER_JE_CATEGORY_NAME: Purchase Invoices 
USER_JE_SOURCE_NAME: Payables 
Reference21 Supplier Name 
Reference22 Internal invoice identification 
Reference23 Distribution line number 
Reference25 Invoice number 
Reference26 'AP Invoices' 
Reference30 'EXPENSE' or 'IPV' or 'LIABILITY' 
The following query groups journal lines for a particular group_id 
coming from Oracle 
Payables by Category and Internal Invoice Id, and sums the debit and 
credit amounts: 
q_ji3.sql : 
set linesize 120 
col s_en_cr format S999,999,999.99 
col s_en_dr format S999,999,999.99 
col s_acc_cr format S999,999,999.99 
col s_acc_dr format S999,999,999.99 
col reference22 format a15 
spool q_ji4 
Select USER_JE_CATEGORY_NAME category 
, reference22 invoice_id 
, sum (entered_cr) s_en_cr 
, sum (entered_dr) s_en_dr 
, sum (accounted_cr) s_acc_cr 
, sum (accounted_dr) s_acc_dr 
, count(*) 
from gl_interface 
where user_jr_source_name =3D 'Payables' and 
group_id =3D &group_id 
group by USER_JE_CATEGORY_NAME, reference22 

spool off 

Saturday 12 May 2018

Draft Invoices / Revenues in project model


Draft Revenue

-- draft revenue against project headers
 
SELECT ppa.segment1
     , ppa.name
     , pdra.draft_revenue_num rev_num
     , pdra.creation_date
     , pdra.transfer_status_code
     , pdra.transferred_date
     , pdra.transfer_rejection_reason
     , pdra.*
  FROM pa.pa_draft_revenues_all pdra
     , pa.pa_projects_all ppa
 WHERE pdra.project_id = ppa.project_id
      AND pdra.creation_date >= '26-FEB-2013';
 
-- draft revenue against tasks
 
SELECT ppa.segment1
     , ppa.name
     , pdri.creation_date
     , pdri.amount
     , pdri.draft_revenue_num rev_num
     , pt.task_number
     , pt.task_name
  FROM pa.pa_draft_revenue_items pdri
     , pa.pa_projects_all ppa
     , pa.pa_tasks pt
 WHERE pdri.project_id = ppa.project_id
   AND pt.project_id = ppa.project_id
   AND pdri.task_id = pt.task_id
   AND pdri.creation_date >= '31-OCT-2012';
 

Draft Invoices

 

-- invoices
 
  SELECT ppa.segment1
       , ppa.name
       , ppa.project_id
       , ppa.distribution_rule
       , pdia.draft_invoice_num inv_num
       , fu.user_name created_by
       , pdia.creation_date
       , pdia.approved_date
       , pdia.released_date
       , pdia.unearned_revenue_cr amt
       , pdia.generation_error_flag err_flag
       , pdia.request_id
       , pdia.draft_invoice_num invno
       , pdia.ra_invoice_number ar_inv
    FROM pa.pa_draft_invoices_all pdia
       , applsys.fnd_user fu
       , pa.pa_projects_all ppa
   WHERE ppa.created_by = fu.user_id
     AND pdia.project_id = ppa.project_id
     AND pdia.creation_date >= '06-JAN-2005'
ORDER BY pdia.creation_date DESC;
 
-- invoices and invoice items
 
SELECT pdia.draft_invoice_num
     , pdia.creation_date
     , pdia.transfer_status_code
     , pdia.generation_error_flag
     , pdia.pa_date
     , pdia.invoice_date
     , pdia.ra_invoice_number
     , pdia.transferred_date
     , pdia.transfer_rejection_reason
     , pdia.gl_date
     , pdii.event_num
     , pdii.inv_amount
     , pdii.taxable_flag
  FROM pa.pa_draft_invoices_all pdia
     , pa.pa_draft_invoice_items pdii
 WHERE pdia.draft_invoice_num = pdii.draft_invoice_num
   AND pdia.project_id = pdii.project_id
   AND pdia.creation_date >= '06-JAN-2005';