This post is to Correct Assets Updated Cost and book Values for Link Asset Management.
1. Please ensure you have LinkAM version 1.0.0.7 or above
2. The script below will give you the list of assets that have incorrect Updated Cost and Book Value. Use this list to individually execute the procedure to correct these values.
Select a.asset_num, AMOUNT = (select
SUM(case when at.[DESCRIPTION]='Disposal' or at.[DESCRIPTION]='Partial Disposal' or
AC.ACTIVITY_TYPE_ID IS NULL or at.[DESCRIPTION] like '%Depreciation' then abs(ac.AMOUNT) * -1
else isnull(ac.AMOUNT,0) end)
from LT_AM_ACTIVITY ac
left outer join LT_AM_ACTIVITY_TYPE at on at.ID = ac.ACTIVITY_TYPE_ID
where ac.ASSET_ID = A.ID
group by ac.ASSET_ID),
UPDATED_COST
From LT_AM_ASSET a where
a.UPDATED_COST <> (select
SUM(case when at.[DESCRIPTION]='Disposal' or at.[DESCRIPTION]='Partial Disposal' or
AC.ACTIVITY_TYPE_ID IS NULL or at.[DESCRIPTION] like '%Depreciation' then abs(ac.AMOUNT) * -1
else isnull(ac.AMOUNT,0) end)
from LT_AM_ACTIVITY ac
left outer join LT_AM_ACTIVITY_TYPE at on at.ID = ac.ACTIVITY_TYPE_ID
where ac.ASSET_ID = A.ID
group by ac.ASSET_ID)
and a.UPDATED_COST = 0 and a.ORIGINAL_COST = 0
Then use this script to correct the cost values
Exec LT_AM_RebuildAssetValues 'XXXXXX', 'YYYYY' -- Where XXXXX is the ASSET Number and YYYYY is the Reason. Use Case Number in Reference. |