select distinct
fab.asset_id,
fdh.code_combination_id,
gcc.segment1,
gcc.segment2,
gcc.segment3,
fab.ATTRIBUTE_CATEGORY_CODE "资产类别",
fab.MODEL_NUMBER 型号,
fab.ATTRIBUTE1 单位,
fb.cost 资产原值,
fms.deprn_reserve 累计折旧,
fms.ytd_deprn 本年折旧,
fb.date_placed_in_service 资产启用日期,
fb.life_in_months 资产年限,
fb.salvage_value 资产残值,
fdd.deprn_reserve 资产累计折旧,
--fa.deprn_amount 资产本月折旧额 ,
fdd.deprn_amount 资产本月折旧额,
fb.prorate_convention_code 折旧惯例,
ffv1.DESCRIPTION 存放机构,
ffv2.DESCRIPTION 存放部门,
fl.segment3 保管人
from fa_books fb,
fa_additions_b fab,
fa_distribution_history fdh,
fa_locations fl,
fnd_flex_values_vl ffv1,
fnd_flex_values_vl ffv2,
fa_mass_additions fms,
fa_deprn_detail fdd,
gl_code_combinations gcc
where fb.asset_id = fdd.asset_id
and gcc.code_combination_id = fdh.code_combination_id
and fdh.book_type_code = fb.book_type_code
and fdh.location_id = fl.location_id
and ffv1.flex_value_set_id = 1014154
and ffv2.FLEX_VALUE_SET_ID = 1014155
and fl.segment1 = ffv1.FLEX_VALUE
and fl.segment2 = ffv2.FLEX_VALUE
and fab.ASSET_ID = fdh.asset_id
and fb.asset_id = fab.ASSET_ID
and fms.asset_number = fb.asset_id
and fb.date_ineffective is null
and fdd.deprn_source_code = 'D'
and fab.attribute_category_code like '固定资产%'
order by fab.asset_id
/*
When you add an asset, Oracle Assets inserts a row into this table for
the period before the current period. This row has the asset cost in the
ADDITION_COST_TO_CLEAR column and a DEPRN_SOURCE_CODE
of ’B’. This column is used for reporting on new assets. When you run
depreciation, Oracle Assets transfers the cost to the COST column in the
current period row, this row has a DEPRN_SOURCE_CODE of ’D’.*/