当前位置: 首页 > 开发 > 正文

AX 2012 使用原始方法获得固定资产折旧相关数值

未有时间在Wordpress中做格式化,参考思路即可。

// by LuoHu

static void TC_AssetDepCalc(Args _args)

{

container       depResult;

TmpDateSum      tmpDateSum;

TransDate       transDate = systemDateGet();

AssetTable      assetTable = AssetTable::find(“BUILD-000001”);

AssetBook       assetBook = AssetBook::find(assetTable.AssetId, AssetParameters::find().BookIdDefault);

 

if(!assetBook)

return;

 

depResult = AssetBook::calculateCatchUpDepreciation(assetBook);

//Method 1

// #5   Total Depreciation calculated for the Primary profile

info(strFmt(“M1, Acq. amount: %1”, assetBook.assetAcquisitionValue()));

info(strFmt(“M1, Total Dep. amount: %1”, conPeek(depResult, 5)));

 

//Method 2

//calc dep. amount per period

tmpDateSum.setTmpData(assetBook.initDepreciationProfile());

 

//last line of dep. profile

select firstOnly tmpDateSum

order by tmpDateSum.TransDate desc;

 

if(tmpDateSum)

{

info(strFmt(“M2, Acq. amount: %1”, tmpDateSum.Total + tmpDateSum.TmpNumerals02));  // Accumulated value + Posted value

info(strFmt(“M2, Total Dep. amount: %1”, tmpDateSum.Total)); // Accumulated value

}

 

select firstOnly tmpDateSum

order by tmpDateSum.TransDate asc

where tmpDateSum.TransDate >= mkDate(1, mthOfYr(transDate), year(transDate))

&& tmpDateSum.TmpNumerals01;

 

if(tmpDateSum)

info(strFmt(“M2, Dep. amount – current month: %1”, tmpDateSum.TmpNumerals01));

}

本文固定链接: http://www.erpgolive.com/archives/318 | 我心依旧

该日志由 虎哥 于2017年02月10日发表在 开发 分类下,
原创文章转载请注明: AX 2012 使用原始方法获得固定资产折旧相关数值 | 我心依旧

报歉!评论已关闭.