zoukankan      html  css  js  c++  java
  • Oracle EBS AR 收款取数

      
    
       -- 收款核销,贷项通知单核销也是通过ar_receivable_applications_all表
    SELECT cr.receipt_number
          ,ad.amount_dr
          ,ad.amount_cr
          ,ad.source_table
          ,ad.source_type
          ,xla_oa_functions_pkg.get_ccid_description(gcc.chart_of_accounts_id
                                                    ,ad.code_combination_id)
          ,ad.creation_date
      FROM ar_distributions_all           ad
          ,ar_receivable_applications_all ra
          ,ar_cash_receipts_all           cr
          ,gl_code_combinations         gcc
     WHERE ad.source_table = 'RA'
       AND ad.source_id = ra.receivable_application_id
       AND ra.cash_receipt_id = cr.cash_receipt_id
       AND gcc.code_combination_id = ad.code_combination_id
    -- 收款记录
    UNION ALL
    SELECT cr.receipt_number
          ,ad.amount_dr
          ,ad.amount_cr
          ,ad.source_table
          ,ad.source_type
          ,xla_oa_functions_pkg.get_ccid_description(gcc.chart_of_accounts_id
                                                    ,ad.code_combination_id)
          ,ad.creation_date
      FROM ar_distributions_all        ad
          ,ar_cash_receipt_history_all crh
          ,ar_cash_receipts_all        cr
          ,gl_code_combinations         gcc
     WHERE ad.source_table = 'CRH'
       AND ad.source_id = crh.cash_receipt_history_id
       AND crh.cash_receipt_id = cr.cash_receipt_id
       AND gcc.code_combination_id = ad.code_combination_id
     ORDER BY creation_date;
     
      --杂项收款
     SELECT cr.receipt_number,cr.cash_receipt_id
          ,ad.amount_dr
          ,ad.amount_cr
          ,ad.source_table
          ,ad.source_type
          ,xla_oa_functions_pkg.get_ccid_description(gcc.chart_of_accounts_id
                                                    ,ad.code_combination_id)
          ,ad.creation_date
      FROM ar_distributions_all           ad
          ,ar_misc_cash_distributions_all mcd
          ,ar_cash_receipts_all           cr
          ,gl_code_combinations         gcc
     WHERE ad.source_table = 'MCD'
       AND ad.source_id = mcd.misc_cash_distribution_id
       AND mcd.cash_receipt_id = cr.cash_receipt_id
       AND gcc.code_combination_id = ad.code_combination_id;
       --应收总账日记账分录
       SELECT h.je_source
          ,h.je_category
          ,fnd_flex_ext.get_segs('SQLGL', 'GL#', gcc.chart_of_accounts_id, l.code_combination_id) acct
          ,xla_oa_functions_pkg.get_ccid_description(gcc.chart_of_accounts_id
                                                    ,l.code_combination_id) acct_descr
          ,l.entered_dr
          ,l.entered_cr
      FROM gl_je_headers        h
          ,gl_je_lines          l
          ,gl_code_combinations gcc
          ,gl_period_statuses   gps
     WHERE h.je_header_id = l.je_header_id
       AND l.code_combination_id = gcc.code_combination_id
       AND h.je_source = 'Receivables'
       AND l.period_name = gps.period_name;
       
    土豆君
  • 相关阅读:
    hdu 2586(最近公共祖先LCA)
    hdu 3394(点双连通)
    hdu 4005(边双连通)
    hdu 2460(tarjan求边双连通分量+LCA)
    【转载】8天学通MongoDB——第四天 索引操作
    【转载】8天学通MongoDB——第三天 细说高级操作
    [转载]MongoDB开发学习 经典入门
    【原创】jQuery 仿百度输入标签插件
    ★《唐琅探案》后记【2】
    ★《唐琅探案》后记【1】
  • 原文地址:https://www.cnblogs.com/jenrry/p/10007373.html
Copyright © 2011-2022 走看看