• RA_CUST_TRX_LINE_GL_DIST_ALL AR行分配表


    AR/AP/GL中当前帐套本位币金额

    在总账模块中总账行表GL_JE_LINES中ENTERED_DR和ENTERED_CR字段表示总账日记账凭证收入的金额,如果当前输入的金额不是当前帐套的本位币,则在输入时,需要选择汇率折算,折算后数据记录在ACCOUNTED_DR和ACCOUNTED_CR字段中,因此,日记账ACCOUNTED_DR和ACCOUNTED_CR字段金额的币别和当前帐套本位币是一致的。

    在应收模块中,RA_CUST_TRX_LINE_GL_DIST_ALL为行分配表,AMOUNT字段为收入金额,ACCTD_AMOUNT字段为折算后本位币金额。

    在应付模块中,AP_INVOICES_ALL为发票头表,INVOICE_AMOUNT为发票输入金额,BASE_AMOUNT为本位币金额,AP_INVOICE_DISTRIBUTIONS_ALL发票分配表AMOUNT为行输入金额,BASE_AMOUNT为本位币金额


    AR中收入和税的抓取

    在表RA_CUST_TRX_LINE_GL_DIST_ALL中,ACCOUNT_CLASS字段标识收入、应收账款或税,收入为REV,税为TAX,应收账款为REC,如果需要同时显示收入和税,并用事务处理编号关联,可以用下面方式取得:

    select rev.trx_number as ar_invoice_no,
           (rev.rev_amount + tax.tax_amount) as rev_amount,
           tax.tax_amount
      from (  select arh.customer_trx_id,
                     arh.trx_number,
                     sum (arldis.amount) as rev_amount
                from ra_customer_trx_all arh, ra_cust_trx_line_gl_dist_all arldis
               where     arh.customer_trx_id = arldis.customer_trx_id
                     and arh.set_of_books_id = :p_set_of_books_id                            --key
                     and arh.trx_date between to_date (:p_trx_df, 'YYYY-MM-DD')  --key
                                          and to_date (:p_trx_dt, 'YYYY-MM-DD')              --key
                     and arldis.account_class = 'REV'
            group by arh.customer_trx_id, arh.trx_number) rev,
           (  select arh.customer_trx_id, sum (arldis.amount) as tax_amount
                from ra_customer_trx_all arh, ra_cust_trx_line_gl_dist_all arldis
               where     arh.customer_trx_id = arldis.customer_trx_id
                     and arh.set_of_books_id = :p_set_of_books_id                           --key
                     and arh.trx_date between to_date (:p_trx_df, 'YYYY-MM-DD')  --key
                                          and to_date (:p_trx_dt, 'YYYY-MM-DD')              --key
                     and arldis.account_class = 'TAX'
            group by arh.customer_trx_id) tax
    where rev.customer_trx_id = tax.customer_trx_id(+)

  • 相关阅读:
    HTML5触摸屏touch事件使用介绍1
    hdu 1408 acdearm "Money, Money, Money"
    基于QTP的自己主动化測试框架介绍
    ExpandListView onChildClickListener 失效
    hdu1227 Fast Food
    Linux C高级编程——文件操作之系统调用
    nodejs之路-[0]安装及简易配置
    动态加入改动删除html表格内容
    socket网络编程基础小记
    LeetCode OJ Minimum Depth of Binary Tree 递归求解
  • 原文地址:https://www.cnblogs.com/quanweiru/p/2757400.html
Copyright © 2020-2023  润新知