Skip to main content

Query: PA DRAFT INVOICE LINK TO AR INVOICE


PA DRAFT INVOICE LINK TO AR INVOICE
From Flexfield setup in the application:

For RA_CUSTOMER_TRX_ALL AND RA_CUSTOMER_TRX_LINES_ALL
Interface Line context = ‘PROJECTS INVOICES’
Interface_Line_attribute1 -> Project_number
Interface_Line_attribute2 -> Draft Invoice Number
Interface_Line_attribute3 -> Agreement Number
Interface_Line_attribute4 -> Project Organization
Interface_Line_attribute5 -> Project Manager
Interface_Line_attribute6 -> Line Number
Interface_Line_attribute7 -> Type
Interface_Line_attribute8 -> Line Type

And might be able to depend on:
PA_DRAFT_INVOICES_ALL.SYSTEM_REFERENCE = RA_CUSTOMER_TRX_ALL.CUSTOMER_TRX_ID

If the above assumptions are correct then the following SQL should be able to link PA Draft Invoices to AR Invoices:

select PAP.project_id,PAP.segment1 PROJECT_NUMBER,
PAT.TASK_NUMBER, PAP.name,hp.party_name customer,PAP.target_start_date,PAP.target_finish_date,
PAP.project_type,ps.project_system_status_code status,
paa.agreement_num,paa.agreement_type,PAP.project_value,
pdi.transfer_status_code,L.MEANING, L.DESCRIPTION, pdi.transfer_rejection_reason,
PDI.DRAFT_INVOICE_NUM, PDI.CREATION_DATE, PDI.LAST_UPDATE_DATE, PDI.RA_INVOICE_NUMBER, PDI.INVOICE_COMMENT,
PDII.LINE_NUM,PDII.INVOICE_LINE_TYPE, PDII.AMOUNT, PDII.TEXT, ct.trx_number AR_inv_num, ct.complete_flag, ct.status_trx,
ctl.line_number, ctl.line_type, ctl.description inv_line_desc, ctl.extended_amount, ctl.revenue_amount
,ctl.interface_line_attribute1 Project_number
,ctl.interface_line_attribute2 Draft_Invoice_Number
,ctl.interface_line_attribute3 Agreement_Number
,ctl.interface_line_attribute4 Project_Organization
,ctl.interface_line_attribute5 Project_Manager
,ctl.interface_line_attribute6 Line_Number
,ctl.interface_line_attribute7 Type
–,ctl.interface_line_attribute8 Line_Type
–,ct.*
from
APPS.pa_projects_all pap
JOIN APPS.pa_draft_invoices_all pdi ON (pap.project_id=pdi.project_id)
JOIN APPS.pa_draft_invoice_items pdii on (pdi.project_id = pdii.project_id and pdi.draft_invoice_num=pdii.draft_invoice_num)
JOIN APPS.PA_TASKS PAT ON (PDII.TASK_ID = PAT.TASK_ID)
JOIN APPS.pa_agreements_all paa ON (PDI.AGREEMENT_ID = PAA.AGREEMENT_ID)
JOIN APPS.pa_project_statuses ps ON (PAP.PROJECT_STATUS_CODE = PS.PROJECT_STATUS_CODE)
JOIN APPS.hz_cust_accounts_all hca ON (PDI.BILL_TO_CUSTOMER_ID = HCA.CUST_ACCOUNT_ID)
JOIN APPS.hz_parties hp ON (HCA.PARTY_ID = HP.PARTY_ID)
LEFT OUTER JOIN APPS.PA_LOOKUPS L ON (PDI.TRANSFER_STATUS_CODE = L.LOOKUP_CODE AND L.LOOKUP_TYPE = ‘TRANSFER STATUS’)
LEFT OUTER JOIN apps.ra_customer_trx_lines_all ctl on (PDI.SYSTEM_REFERENCE = CTL.CUSTOMER_TRX_ID AND PDII.LINE_NUM = CTL.INTERFACE_LINE_ATTRIBUTE6)
LEFT OUTER JOIN apps.ra_customer_trx_all ct ON (CTL.CUSTOMER_TRX_ID = CT.CUSTOMER_TRX_ID)
where
PAP.PROJECT_ID = &PROJECT_ID
order by PAP.SEGMENT1, PDI.DRAFT_INVOICE_NUM

There might be rejected transactions in PA Draft Invoices – here is how to find those transactions:

select DISTINCT pdi.org_id, PAP.SEGMENT1 PROJECT_NUM, pdi.transfer_status_code,L.MEANING, L.DESCRIPTION, pdi.transfer_rejection_reason,
PDI.DRAFT_INVOICE_NUM, PDI.CREATION_DATE, PDI.LAST_UPDATE_DATE, PDI.RA_INVOICE_NUMBER, PDI.INVOICE_COMMENT,
PAP.TARGET_START_DATE, PAP.TARGET_FINISH_DATE, PAP.PROJECT_TYPE, ORG.NAME ORG_NAME, PS.PROJECT_SYSTEM_STATUS_CODE PROJ_STATUS,
PAPF.FULL_NAME PROJ_MANAGER, PAA.AGREEMENT_NUM, PAA.AGREEMENT_TYPE, PAP.PROJECT_ID
from apps.pa_draft_invoices_all pdi
LEFT OUTER JOIN APPS.PA_LOOKUPS L ON (PDI.TRANSFER_STATUS_CODE = L.LOOKUP_CODE AND L.LOOKUP_TYPE = ‘TRANSFER STATUS’)
JOIN APPS.PA_PROJECTS_ALL PAP ON (PDI.PROJECT_ID = PAP.PROJECT_ID)
JOIN APPS.PA_AGREEMENTS_ALL PAA ON (PDI.AGREEMENT_ID = PAA.AGREEMENT_ID)
JOIN APPS.hr_organization_units org ON (PAP.carrying_out_organization_id = ORG.ORGANIZATION_ID)
JOIN APPS.pa_project_players papp ON (PAP.PROJECT_ID = PAPP.PROJECT_ID AND PAPP.PROJECT_ROLE_TYPE = ‘PROJECT MANAGER’AND SYSDATE < NVL(PAPP.END_DATE_ACTIVE, SYSDATE+10))
JOIN APPS.per_all_people_f papf ON (PAPP.PERSON_ID = PAPF.PERSON_ID)
JOIN APPS.pa_project_statuses ps ON (PAP.PROJECT_STATUS_CODE = PS.PROJECT_STATUS_CODE)
where pdi.system_reference is null
AND PDI.ORG_ID = &ORG_ID
order by PDI.ORG_ID, PAP.SEGMENT1, PDI.DRAFT_INVOICE_NUM

Comments

Popular posts from this blog

Oracle Subledger Accounting (SLA) Tables, Views

Oracle Subledger Accounting (SLA) Tables, Views Oracle Subledger Accounting Tables: TABLE NAME DESCRIPTION XLA_AAD_GROUPS The XLA_AAD_GROUPS table stores the merge dependencies analyzed during the merge analysis.  All application accounting definitions with the same GROUP_NUM must be merged together. XLA_AAD_HDR_ACCT_ATTRS The XLA_AAD_HDR_ACCT_ATTRS stores standard, system and custom sources assigned to an accounting attribute at the AAD level. XLA_AAD_HEADER_AC_ASSGNS Store the analytical criteria for the application accounting definitions. XLA_AAD_LINE_DEFN_ASSGNS This table stores the journal lines definitions for the application accounting definitions. XLA_AAD_LOADER_DEFNS_T The XLA_AAD_LOADER_DEFNS_T table is the interface table that facilitates the data transfer from data files and the database. XLA_AAD_LOADER_LOGS The XLA_AAD_LOADER_LOGS table stores the errors and logs generated by the application accounting definitions loader. XLA_AAD_SOURCES XLA_AAD_SOURCES table stores a...

Oracle Fusion Cloud: Supplier Import Process using File Based Data Import (FBDI)

 Supplier Data Migration or Upload to Oracle Fusion environment File-Based Data Import for Oracle Procurement Cloud Supplier import in oracle fusion   In this post , We will discuss about Supplier import in oracle fusion. Oracle has provided the FBDI tool to import suppliers from External  Source  to the Oracle fusion. Supplier Import in Oracle fusion we first need to  Download  the Supplier Import FDBI  templates  given by the Oracle fusion to import suppliers. Oracle has given 5 Different FBDI templates to Import supplier in Fusion. Here in this post , I will share the Complete steps for Supplier import in oracle fusion. You can refer this post for Supplier Import.   Steps for Supplier import in oracle fusion     Step1- First we need to download Supplier Data  Template  from Oracle Repository. Go to this path for Oracle Repository. ( select Based on your Cloud version) https://docs.oracle.com/en/...

Unbilled Receivables and Unearned Revenue Accounting in Oracle Projects

Unbilled Receivables and Unearned Revenue Accounting in Oracle Projects Introduction When it comes to contractual billing, invoice and revenue generation are two separate processes, which during the lifespan of a project may or may not always coincide with each other and so do the balances in revenue and receivables accounts.  This interim difference between revenue and invoice account balances is bridged using Unbilled Receivables (UBR) and Unearned Revenue (UER) Accounts. Unearned Revenue (UER) Unearned Revenue (also termed as deferred revenue or UER) signifies money received for the goods or services, which are yet to be delivered.  As per the principles of Revenue Recognition, UER is recorded as on the balance sheet unless it is converted to Revenue upon delivery of goods or services For Example XYZ Consulting Ltd. receives an annual maintenance contract of $ 12,000 on Dec 31, 2014 for the period of Jan 01, 2015 to Dec 31, 2015. At the start of the contract as of Dec 31, 2...