|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
SELECT Fbc.Book_Type_Code,
Fbc.Book_Type_Name,
Fa_Addit.Asset_Id,
Fa_Addit.Asset_Number, --资产编号
Fdt.Description, --资产说明
Fak.Segment1 || '.' || Fak.Segment2 || '.' || Fak.Segment3 || '.' ||
Fak.Segment4 Key_Name, --资产关键字
Fak.Segment1 Key1, --
Fak.Segment2 Key2, --
Fak.Segment3 Key3, --
Fak.Segment4 Key4, --
Fa_Addit.Asset_Category_Id, --资产类别ID
Fa_Addit.Attribute_Category_Code, --资产类别
Fa_Addit.Current_Units, --数量
Fa_Books.Cost, --原值
Fa_Books.Salvage_Value, --残值
Fdss.Deprn_Reserve, --累计折旧
Fdss.Ytd_Deprn, --本年累计折旧()
Fdp.Period_Name, --折旧期间
(Fa_Books.Cost - Fdss.Deprn_Reserve) Nbv, --净值
Fa_Addit.Attribute30 --是否已经调拨
FROM Fa.Fa_Additions_b Fa_Addit, --资产信息表
Fa_Additions_Tl Fdt, --资产多语言表
Fa_Asset_Keywords Fak, --资产关键字表
Fa.Fa_Books Fa_Books, --资产账簿关联表
Gl.Gl_Code_Combinations Gcc1,
Fa_Category_Books Fac, --资产类别
Fa.Fa_Book_Controls Fbc, --资产账簿明细表
Gl.Gl_Code_Combinations Gcc2,
(SELECT Fds.Asset_Id,
Fds.Book_Type_Code,
Fds.Deprn_Reserve,
Fds.Period_Counter,
Fds.Ytd_Deprn
FROM Fa_Deprn_Summary Fds
WHERE Fds.Period_Counter =
(SELECT MAX(Period_Counter)
FROM Fa_Deprn_Summary Fds2
WHERE Fds2.Book_Type_Code = Fds.Book_Type_Code
AND Fds2.Asset_Id = Fds.Asset_Id)) Fdss, --
Fa_Deprn_Periods Fdp
WHERE 1 = 1
AND Fa_Addit.Asset_Id = Fa_Books.Asset_Id
AND Fa_Addit.Asset_Id = Fdt.Asset_Id
AND Fdt.Language = 'ZHS'
AND Fa_Addit.Asset_Key_Ccid = Fak.Code_Combination_Id
AND Fac.Reserve_Account_Ccid = Gcc2.Code_Combination_Id
AND (Fa_Books.Transaction_Header_Id_Out IS NULL) --
AND Fac.Asset_Cost_Account_Ccid = Gcc1.Code_Combination_Id
AND Fac.Category_Id = Fa_Addit.Asset_Category_Id
AND Fac.Book_Type_Code = Fa_Books.Book_Type_Code
AND Fdss.Book_Type_Code = Fa_Books.Book_Type_Code
AND Fdss.Asset_Id = Fa_Books.Asset_Id
AND Fbc.Book_Type_Code = Fa_Books.Book_Type_Code
AND Fdp.Book_Type_Code = Fa_Books.Book_Type_Code
AND Fdp.Period_Counter = Fdss.Period_Counter
ORDER BY Fa_Books.Asset_Id;
计算损益后,取得的Ytd_Deprn的值就不对了(比如这里是800,实际上计算完损益,系统中已经反映成了900,这个要怎么处理)在做跨账簿调拨,卡在这个取值上,, |
|