资产事务处理过程SQL

SELECT FL.DESCRIPTION              事务处理描述,
       FT.TRANSACTION_TYPE_CODE    事务处理代码,
       FT.TRANSACTION_DATE_ENTERED 事务处理时间,
       FAA.ASSET_NUMBER            资产编号,
       FB.ORIGINAL_COST            资产原值,
       FFV.DESCRIPTION             机构,
       FAT.DESCRIPTION             资产说明

  FROM FA_TRANSACTION_HEADERS  FT,
       FA_LOOKUPS_VL           FL,
       FA_ADDITIONS_B          FAA,
       FA_ADDITIONS_TL         FAT,
       FA_BOOKS_V              FB,
       FA_DISTRIBUTION_HISTORY FD,
       GL_CODE_COMBINATIONS    GCC,
       FND_FLEX_VALUES_VL      FFV,
       FND_FLEX_VALUE_SETS     FFVS
 WHERE 1 = 1
   AND FAA.ASSET_ID = FT.ASSET_ID
   AND FAT.ASSET_ID = FAA.ASSET_ID
   AND FB.ASSET_ID = FAA.ASSET_ID
   AND FD.ASSET_ID = FB.ASSET_ID
   AND FL.LOOKUP_CODE = FT.TRANSACTION_TYPE_CODE
   AND FL.LOOKUP_TYPE = 'FAXOLTRX'
   AND (FFV.END_DATE_ACTIVE IS NULL OR FFV.END_DATE_ACTIVE > SYSDATE)
   AND FFV.ENABLED_FLAG = 'Y'
   AND FFV.FLEX_VALUE_SET_ID = FFVS.FLEX_VALUE_SET_ID
   AND FFVS.FLEX_VALUE_SET_NAME = 'XXXX_COMPANY' –COA机构段
   AND GCC.CODE_COMBINATION_ID = FD.CODE_COMBINATION_ID
   AND GCC.SEGMENT1 = FFV.FLEX_VALUE
— AND TO_CHAR(FT.TRANSACTION_DATE_ENTERED, 'YYYY-MM-DD') BETWEEN
—    '2014-12-31' AND '2014-12-31'
–AND FT.TRANSACTION_TYPE_CODE = 'ADDITION'
 ORDER BY FFV.FLEX_VALUE, FT.TRANSACTION_DATE_ENTERED ASC;

发表评论

邮箱地址不会被公开。 必填项已用*标注