2015年9月3日 星期四

APPS.JE_NO_GEI_SREPORT_V 會計科目餘額表

CREATE OR REPLACE FORCE VIEW APPS.JE_NO_GEI_SREPORT_V
(
   AUTHORITY_TYPE,
   PERIOD,
   ACTUAL_FLAG,
   ACCOUNT_NUMBER,
   BALANCE,
   TEMPLATE_ID,
   PERIOD_NUM,
   PERIOD_YEAR
)
AS
   SELECT gcc.segment4     authority_type,
          gbs.period_name  period,
          gbs.actual_flag  actual_flag,
          gcc.segment2     account_number,
          (gbs.period_net_dr - gbs.period_net_cr) balance,
          gbs.template_id  template_id,
          gbs.period_num   period_num,
          gbs.period_year  period_year
     FROM gl_code_combinations gcc,
          gl_balances gbs,
          gl_sets_of_books gso
    WHERE     gbs.code_combination_id = gcc.code_combination_id
          AND gbs.ledger_id           = gso.set_of_books_id
          AND gso.currency_code       = gbs.currency_code;

----簡直就是亂寫----gl_balances 是主題
gl_code_combinations 是抓出 segment4 AS authority_type
gl_sets_of_books     是限制
gl_balances.ledger_id    =gl_sets_of_books.set_of_books_id
gl_balances.currency_code=gl_sets_of_books.currency_code





 

沒有留言:

張貼留言