RA_CUST_TRX_LINE_GL_DIST_ALL

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=1002

AND ARH.TRX_DATE BETWEEN TO_DATE(&TRX_DF,'YYYY-MM-DD') AND TO_DATE(&TRX_DT,'YYYY-MM-DD')
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=1002
AND ARH.TRX_DATE BETWEEN TO_DATE(&TRX_DF,'YYYY-MM-DD') AND TO_DATE(&TRX_DT,'YYYY-MM-DD')
AND ARLDIS.ACCOUNT_CLASS='TAX'
GROUP BY ARH.CUSTOMER_TRX_ID) TAX
WHERE REV.CUSTOMER_TRX_ID=TAX.CUSTOMER_TRX_ID(+)

posted @ 2011-11-24 09:18  郭振斌  阅读(3373)  评论(0编辑  收藏  举报