Skip to main content

AP-SLA-GL Link Query


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
SELECT
    aia.INVOICE_ID "Invoice Id",
    aia.INVOICE_NUM "Invoice Number",
    aia.INVOICE_DATE "Invoice Date",
    aia.INVOICE_AMOUNT "Amount",
    xal.ENTERED_DR "Entered DR in SLA",
    xal.ENTERED_CR "Entered CR in SLA",
    xal.ACCOUNTED_DR "Accounted DR in SLA",
    xal.ACCOUNTED_CR "Accounted CR in SLA",
    gjl.ENTERED_DR "Entered DR in GL",
    gjl.ACCOUNTED_DR "Accounted DR in GL",
    xal.ACCOUNTING_CLASS_CODE "Accounting Class",
    gcc.SEGMENT1||'.'||gcc.SEGMENT2||'.'
        ||gcc.SEGMENT3||'.'||gcc.SEGMENT4||'.'
        ||gcc.SEGMENT5||'.'||gcc.SEGMENT6||'.'
        ||gcc.SEGMENT7 "Code Combination",
    aia.INVOICE_CURRENCY_CODE "Inv Curr Code",
    aia.PAYMENT_CURRENCY_CODE "Pay Curr Code",
    aia.GL_DATE "GL Date",
    xah.PERIOD_NAME "Period",
    aia.PAYMENT_METHOD_CODE "Payment Method",
    aia.VENDOR_ID "Vendor Id",
    aps.VENDOR_NAME "Vendor Name",
    xah.JE_CATEGORY_NAME "JE Category Name"
FROM
    apps.ap_invoices_all aia,
    xla.xla_transaction_entities XTE,
    apps.xla_events xev,
    apps.xla_ae_headers XAH,
    apps.xla_ae_lines XAL,
    apps.GL_IMPORT_REFERENCES gir,
    apps.gl_je_headers gjh,
    apps.gl_je_lines  gjl,
    apps.gl_code_combinations gcc,
    apps.ap_suppliers aps,
    (select aid1.invoice_id,
            pa.project_id,
            nvl(pa.segment1,'NO PROJECT') Project
    from    apps.ap_invoice_distributions_all aid1,
            apps.PA_PROJECTS_ALL pa
    where aid1.rowid in
        (select MAx(rowid)
        from apps.ap_invoice_distributions_all aid2
        where aid1.INvoice_ID=aid2.INvoice_ID
        group by aid1.invoice_id)
    and aid1.project_id=pa.project_id(+)) sql1,
    (select aid1.invoice_id,
            pt.task_id,
            nvl(pt.task_number,'NO TASK') Task
    from    apps.ap_invoice_distributions_all aid1,
            apps.PA_TASKS pt
    where aid1.rowid in
        (select MAx(rowid)
        from apps.ap_invoice_distributions_all aid2
        where aid1.INvoice_ID=aid2.INvoice_ID
        group by aid1.invoice_id)
    and aid1.task_id=pt.task_id(+)) sql2
WHERE
    aia.INVOICE_ID = xte.source_id_int_1
    and aia.INVOICE_ID=sql1.Invoice_ID
    and aia.INVOICE_ID=sql2.Invoice_ID
    and xev.entity_id= xte.entity_id
    and xah.entity_id= xte.entity_id
    and xah.event_id= xev.event_id
    and XAH.ae_header_id = XAL.ae_header_id
    and XAH.je_category_name = 'Purchase Invoices'
    and XAH.gl_transfer_status_code= 'Y'
    and XAL.GL_SL_LINK_ID=gir.GL_SL_LINK_ID
    and gir.GL_SL_LINK_TABLE = xal.GL_SL_LINK_TABLE
    and gjl.JE_HEADER_ID=gjh.JE_HEADER_ID
    and gjh.JE_HEADER_ID=gir.JE_HEADER_ID
    and gjl.JE_HEADER_ID=gir.JE_HEADER_ID
    and gir.JE_LINE_NUM=gjl.JE_LINE_NUM
    and gcc.CODE_COMBINATION_ID=XAL.CODE_COMBINATION_ID
    and gcc.CODE_COMBINATION_ID=gjl.CODE_COMBINATION_ID
    and aia.VENDOR_ID=aps.VENDOR_ID
    and gjh.STATUS='P'
    and gjh.Actual_flag='A'
    and gjh.CURRENCY_CODE='USD'
    and aia.Invoice_id=&Invoice_Id;

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

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

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