GL追溯各子模块

4. GL追溯子模块(各模块表与xla.xla_transaction_entities 表的关联可以参数此表中的关系 xla.xla_entity_id_mappings)4.1 GL追溯AP发票(关联PO表可以用invoice_id,event_id)当source是Payables,category 是Purchase Invoices 用这段SQL追溯SELECT NVL (ae...
摘要由CSDN通过智能技术生成

4. GL追溯子模块(各模块表与xla.xla_transaction_entities 表的关联可以参数此表中的关系 xla.xla_entity_id_mappings)

4.1 GL追溯AP发票(关联PO表可以用invoice_id,event_id)
当source是Payables,category 是Purchase Invoices 用这段SQL追溯

SELECT NVL (ael.accounted_dr, ael.entered_dr) account_dr,
                NVL (ael.accounted_cr, ael.entered_cr) account_cr,
                aia.invoice_num,
                aia.invoice_date,
                aia.org_id,
                aia.invoice_id,ael.ae_header_id, ael.ae_line_num,
                aeh.event_id
           FROM gl_je_lines jl,
                gl_je_headers jh,
                gl_import_references gir,
                xla_ae_lines ael,
                xla_ae_headers aeh,
                xla.xla_transaction_entities xte,
                ap_invoices_all aia
          WHERE jl.je_header_id = jh.je_header_id
            AND jl.ledger_id = jh.ledger_id
            AND jl.je_header_id = gir.je_header_id
            AND jl.je_line_num = gir.je_line_num
            AND jl.je_header_id = p_header_id
            AND jl.je_line_num = p_line_num
            AND jh.je_batch_id = gir.je_batch_id
            AND jh.je_category = 'Purchase Invoices'
            AND jh.je_source = 'Payables'
            AND gir.gl_sl_link_id = ael.gl_sl_link_id
            AND gir.gl_sl_link_table = ael.gl_sl_link_table
            AND ael.ae_header_id = aeh.ae_header_id
            AND ael.application_id = aeh.application_id
            AND aeh.entity_id = xte.entity_id
            AND aeh.application_id = xte.application_id
            and xte.ledger_Id = p_ledger_id
            AND xte.entity_code = 'AP_INVOICES'
            AND NVL (xte.source_id_int_1, (-99)) = aia.invoice_id
            AND xte.application_id = 200;

4.2 GL追溯AP付款
当source是Payables,category 是payments,则使用下面这个SQL来取出追朔的数据

SELECT DISTINCT aca.bank_account_name l_ref2,
                   pd.payment_document_name
                || '-'
                || aca.doc_sequence_value l_ref3,
                TO_CHAR (aca.check_date, 'yyyy/mm/dd') l_ref4,
                aca.check_id trx_hdr_id,
                ael.accounting_class_code acct_line_type_name,
                pd.payment_document_name NAME,
                NVL (ael.accounted_cr, ael.entered_cr) account_cr,
                NVL (ael.accounted_dr, ael.entered_dr) account_dr,
                ael.ae_header_id, ael.ae_line_num
           FROM gl_je_lines jl,
                gl_je_headers jh,
                gl_import_references gir,
                xla_ae_lines ael,
                xla_ae_headers aeh,
                xla.xla_transaction_entities xte,
                ap_checks_all aca,
                ce_payment_documents pd,
                po_vendor_sites_all pvs
          WHERE jl.je_header_id = jh.je_header_id
            AND jl.ledger_id = jh.ledger_id
            AND jl.je_header_id = gir.je_header_id
            AND jl.je_line_num = gir.je_line_num
            AND jl.je_header_id = p_header_id
            AND jl.je_line_num = p_line_num
            AND jh.je_batch_id = gir.je_batch_id
            AND jh.je_category = 'P

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值