icFAAssetBookDepreciationType | input | character | |
iiFAAssetBookId | input | integer | |
iiFAAssetBookPeriodsDepreciated | input | integer | |
itFAAssetBookStartDate | input | date | |
itFAAssetBookNextPostingDate | input | date | |
iiDepreciationYear | input | integer | |
iiDepreciationPeriod | input | integer | |
idFAAssetBookCapitalAmountLC | input | decimal | |
idFAAssetBookDeprecAmountLC | input | decimal | |
idFAAssetBookSalvageAmountLC | input | decimal | |
idFAAssetBookDisposalAmountLC | input | decimal | |
idFAAssetBookDisposalDepAmountLC | input | decimal | |
tNewDepreciation | output | temp-table | |
oiReturnStatus | output | integer | Return status of the method. |
empty temp-table tNewDepreciation. do viCounter = ((year(itFAAssetBookNextPostingDate) * 12) + month(itFAAssetBookNextPostingDate)) to ((iiDepreciationYear * 12) + iiDepreciationPeriod): <Q-1 run FAAssetBookDeprecByAssetBook (all) (Read) (NoCache) (input iiFAAssetBookId, (FAAssetBookId) input integer(truncate(viCounter / 12,0)) - (if viCounter mod 12 = 0 then 1 else 0), (FADepreciationYear) input if viCounter mod 12 = 0 then 12 else viCounter mod 12, (FADepreciationMonth) output dataset tqFAAssetBookDeprecByAssetBook) in BFixedAssetAsset > find first tqFAAssetBookDeprecByAssetBook no-error. if available tqFAAssetBookDeprecByAssetBook then do: create tNewDepreciation. assign tNewDepreciation.tiNewDeprYear = integer(truncate(viCounter / 12,0)) - (if viCounter mod 12 = 0 then 1 else 0) tNewDepreciation.tiNewDeprMonth = if viCounter mod 12 = 0 then 12 else viCounter mod 12 tNewDepreciation.tdNewDeprAmountLC = if icFAAssetBookDepreciationType = {&DEPRECIATIONTYPE-USER1} then tqFAAssetBookDeprecByAssetBook.tdFAAssetBookDeprecAmountLC else (tqFAAssetBookDeprecByAssetBook.tdFAAssetBookDeprecQTY * tqFAAssetBookDeprecByAssetBook.tdFAAssetBookDeprecPRICE). end. end.