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

Create Accounting for a Payment generates errors 95333 and 95359

Create Accounting for a Payment generates errors 95333 and 95359 Error: 95333: A conversion rate does not exist to convert USD to AUD for the conversion type Corporate and conversion date 20-MAR-09 for line -25. Please use the Daily Rates form in General Ledger to enter a conversion rate for these currencies, conversion date and conversion type. 95359: There is no accounted amount for the subledger journal entry line. Please inform your system administrator or support representative that: The source assigned to the accounting attribute Accounted Amount has no value for extract line number 88547. Please make sure the source assigned to the accounting attribute Accounted Amount has a valid value, or assign a different source to this accounting attribute. Solution: 1. Specify a conversion rate for the currencies and conversion date mentioned in the error message 95333 Navigation under the General Ledger responsibility: Setup > Currencies > Currency Rates Manager > Daily Rates ...

Public API’s for FA Transactions

Public API’s for FA Transactions So far Oracle FA is have all the good things except the lack on reporting.Oracle FA is now offer lot of public API's that can be used to interfacing with third party or Oracle application other modules. Here are some of transaction's API's:   Additions API if you have requirement to add assets directly via PL/SQL then use  FA_ADDITION_PUB.DO_ADDITION. If you have selected the Allow CIP Assets check box on the Book Controls window of a tax book when adding CIP assets using the Additions API, the this API automatically adds those CIP assets to that tax book at the same time that they are added to the corporate book. Adjustments API you can make cost adjustments to your assetsdirectly via PL/SQL using  FA_ADJUSTMENT_PUB.DO_ADJUSTMENT  for any  process adjustment. Detail can be found in appendix H) You can use this API if you have a custom interface that makes it difficult to use with the existing Oracle Assets interfaces for adjusti...

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...