Codeunit "Calculate Normal Depreciation"

ID 5611
Namespace: Microsoft.FixedAssets.Depreciation

Properties

Name Value
Permissions TableData "FA Ledger Entry" = r, TableData "FA Posting Type Setup" = r

Methods

Calculate

procedure Calculate(var DeprAmount: Decimal, var NumberOfDays4: Integer, FANo: Code[20], DeprBookCode2: Code[10], UntilDate2: Date, EntryAmounts2: array[4] of Decimal, DateFromProjection2: Date, DaysInPeriod2: Integer)

Parameters

Name Type Description
DeprAmount Decimal
NumberOfDays4 Integer
FANo Code[20]
DeprBookCode2 Code[10]
UntilDate2 Date
EntryAmounts2 array[4] of Decimal
DateFromProjection2 Date
DaysInPeriod2 Integer

CalcDB1Amount

procedure CalcDB1Amount(): Decimal

Returns

Type Description
Decimal

Events

OnBeforeCalculate

[IntegrationEvent(False,False)]
local procedure OnBeforeCalculate(var DeprAmount: Decimal, var NumberOfDays4: Integer, FANo: Code[20], DeprBookCode2: Code[10], UntilDate2: Date, EntryAmounts2: array[4] of Decimal, DateFromProjection2: Date, DaysInPeriod2: Integer, var IsHandled: Boolean)

Parameters

Name Type Description
DeprAmount Decimal
NumberOfDays4 Integer
FANo Code[20]
DeprBookCode2 Code[10]
UntilDate2 Date
EntryAmounts2 array[4] of Decimal
DateFromProjection2 Date
DaysInPeriod2 Integer
IsHandled Boolean

OnAfterGetDeprBooks

[IntegrationEvent(False,False)]
local procedure OnAfterGetDeprBooks(var DepreciationBook: Record "Depreciation Book", var FADepreciationBook: Record "FA Depreciation Book")

Parameters

Name Type Description
DepreciationBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"

OnCalculateOnBeforeTransferValue

[IntegrationEvent(True,False)]
local procedure OnCalculateOnBeforeTransferValue(FANo: Code[20], var StorageDecimal: Dictionary of [Text, Decimal], var StorageInterger: Dictionary of [Text, Integer], var StorageDate: Dictionary of [Text, Date], var StorageCode: Dictionary of [Text, Code[10]], var EntryAmounts2: array[4] of Decimal, var EntryAmounts: array[4] of Decimal, var DeprMethod: Enum "FA Depr. Method Internal", var Year365Days: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
FANo Code[20]
StorageDecimal Dictionary of [Text, Decimal]
StorageInterger Dictionary of [Text, Integer]
StorageDate Dictionary of [Text, Date]
StorageCode Dictionary of [Text, Code[10]]
EntryAmounts2 array[4] of Decimal
EntryAmounts array[4] of Decimal
DeprMethod Enum Microsoft.FixedAssets.Depreciation."FA Depr. Method Internal"
Year365Days Boolean
IsHandled Boolean

OnBeforeSkipRecord

[IntegrationEvent(False,False)]
local procedure OnBeforeSkipRecord(FixedAsset: Record "Fixed Asset", DeprBook: Record "Depreciation Book", DisposalDate: Date, AcquisitionDate: Date, UntilDate: Date, FADeprMethod: Enum "FA Depreciation Method", BookValue: Decimal, DeprBasis: Decimal, SalvageValue: Decimal, MinusBookValue: Decimal, var ReturnValue: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
DeprBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
DisposalDate Date
AcquisitionDate Date
UntilDate Date
FADeprMethod Enum Microsoft.FixedAssets.Depreciation."FA Depreciation Method"
BookValue Decimal
DeprBasis Decimal
SalvageValue Decimal
MinusBookValue Decimal
ReturnValue Boolean
IsHandled Boolean

OnBeforeCalcTransferValueSetVariables

[IntegrationEvent(False,False)]
local procedure OnBeforeCalcTransferValueSetVariables(var FirstDate: Date, var Year365Days: Boolean, var UseDeprStartingDate: Boolean, var NumberOfDays2: Integer, var UseHalfYearConvention: Boolean)

Parameters

Name Type Description
FirstDate Date
Year365Days Boolean
UseDeprStartingDate Boolean
NumberOfDays2 Integer
UseHalfYearConvention Boolean

OnBeforeNumberofDayCalculateNumberofDays

[IntegrationEvent(False,False)]
local procedure OnBeforeNumberofDayCalculateNumberofDays(FixedAsset: Record "Fixed Asset", DeprBook: Record "Depreciation Book", var NumberofDays: Integer, FirstDeprDate: Date, var UntilDate: Date, Year365Days: Boolean, var IsHandled: Boolean, FADepreciationBook: Record "FA Depreciation Book")

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
DeprBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
NumberofDays Integer
FirstDeprDate Date
UntilDate Date
Year365Days Boolean
IsHandled Boolean
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"

UpdateDaysInFiscalYear

[IntegrationEvent(False,False)]
local procedure UpdateDaysInFiscalYear(FixedAsset: Record "Fixed Asset", DeprBook: Record "Depreciation Book", var NumberofDays: Integer, var DaysInFiscalYear: Integer, var IsHandled: Boolean)

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
DeprBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
NumberofDays Integer
DaysInFiscalYear Integer
IsHandled Boolean

OnAfterBookValueRecalculateBookValue

[IntegrationEvent(False,False)]
local procedure OnAfterBookValueRecalculateBookValue(FixedAsset: Record "Fixed Asset", DeprBook: Record "Depreciation Book", FAledgEntry2: Record "FA Ledger Entry", var DeprBasis: Decimal, var BookValue: Decimal, var DeprEndingDate: Date, DisposalDate: Date, var FADepreciationBook: Record "FA Depreciation Book", DateFromProjection: Date, var SalvageValue: Decimal)

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
DeprBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
FAledgEntry2 Table Microsoft.FixedAssets.Ledger."FA Ledger Entry"
DeprBasis Decimal
BookValue Decimal
DeprEndingDate Date
DisposalDate Date
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
DateFromProjection Date
SalvageValue Decimal

OnAfterBookValueCheckAddedDeprApplicable

[IntegrationEvent(False,False)]
local procedure OnAfterBookValueCheckAddedDeprApplicable(FADepBook: Record "FA Depreciation Book", DeprBook: Record "Depreciation Book", FALedgerEntry: Record "FA Ledger Entry", UntilDate: Date, var DBPercent: Decimal, var SlPercent: Decimal)

Parameters

Name Type Description
FADepBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
DeprBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
FALedgerEntry Table Microsoft.FixedAssets.Ledger."FA Ledger Entry"
UntilDate Date
DBPercent Decimal
SlPercent Decimal

OnAfterDaysinFYRecalculateDaysInFiscalYear

[IntegrationEvent(False,False)]
local procedure OnAfterDaysinFYRecalculateDaysInFiscalYear(FADepBook: Record "FA Depreciation Book", DeprBook: Record "Depreciation Book", UntilDate: Date, var DaysInFiscalYear: Integer, Year365Days: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
FADepBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
DeprBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
UntilDate Date
DaysInFiscalYear Integer
Year365Days Boolean
IsHandled Boolean

OnAfterCalculateFinalAmount

[IntegrationEvent(False,False)]
local procedure OnAfterCalculateFinalAmount(DepreBook: Record "Depreciation Book", var Amount: Decimal, var IsHandled: Boolean, FA: Record "Fixed Asset", UntilDate: Date, BookValue: Decimal)

Parameters

Name Type Description
DepreBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
Amount Decimal
IsHandled Boolean
FA Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
UntilDate Date
BookValue Decimal

OnAfterSkipOnZeroValue

[IntegrationEvent(False,False)]
local procedure OnAfterSkipOnZeroValue(DepreBook: Record "Depreciation Book", var SkipOnZero: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
DepreBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
SkipOnZero Boolean
IsHandled Boolean

OnAfterCalcFinalDeprAmount

[IntegrationEvent(False,False)]
local procedure OnAfterCalcFinalDeprAmount(FANo: Code[20], FADeprBook: Record "FA Depreciation Book", DepreBook: Record "Depreciation Book", Sign: Integer, BookValue: Decimal, var DeprAmount: Decimal, var IsHandled: Boolean, var NumberOfDays: Integer)

Parameters

Name Type Description
FANo Code[20]
FADeprBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
DepreBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
Sign Integer
BookValue Decimal
DeprAmount Decimal
IsHandled Boolean
NumberOfDays Integer

OnAfterCalculateDeprAmount

[IntegrationEvent(False,False)]
local procedure OnAfterCalculateDeprAmount(FixedAsset: Record "Fixed Asset", SkipOnZero: Boolean, DeprBookCode: Code[20], var Amount: Decimal, BookValue: Decimal, SalvageValue: Decimal, EndingBookValue: Decimal, FinalRoundingAmount: Decimal)

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
SkipOnZero Boolean
DeprBookCode Code[20]
Amount Decimal
BookValue Decimal
SalvageValue Decimal
EndingBookValue Decimal
FinalRoundingAmount Decimal

OnAfterCalcSL

[IntegrationEvent(False,False)]
local procedure OnAfterCalcSL(FixedAsset: Record "Fixed Asset", FADepreciationBook: Record "FA Depreciation Book", UntilDate: Date, BookValue: Decimal, DeprBasis: Decimal, DeprYears: Decimal, NumberOfDays: Integer, DaysInFiscalYear: Integer, var ExitValue: Decimal, var IsHandled: Boolean, var RemainingLife: Decimal, var FirstDeprDate: Date)

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
UntilDate Date
BookValue Decimal
DeprBasis Decimal
DeprYears Decimal
NumberOfDays Integer
DaysInFiscalYear Integer
ExitValue Decimal
IsHandled Boolean
RemainingLife Decimal
FirstDeprDate Date

OnAfterCalcDB1Amount

[IntegrationEvent(False,False)]
local procedure OnAfterCalcDB1Amount(DBPercent: Decimal, NumberOfDays: Integer, DaysInFiscalYear: Integer, BookValue: Decimal, SalvageValue: Decimal, MinusBookValue: Decimal, Sign: Integer, DeprInFiscalYear: Decimal, var Result: Decimal, FADepreciationBook: Record "FA Depreciation Book", FirstDeprDate: Date)

Parameters

Name Type Description
DBPercent Decimal
NumberOfDays Integer
DaysInFiscalYear Integer
BookValue Decimal
SalvageValue Decimal
MinusBookValue Decimal
Sign Integer
DeprInFiscalYear Decimal
Result Decimal
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
FirstDeprDate Date

OnAfterTransferValues2

[IntegrationEvent(False,False)]
local procedure OnAfterTransferValues2(FixedAsset: Record "Fixed Asset", FADepreciationBook: Record "FA Depreciation Book", Year365Days: Boolean, var DeprYears: Decimal, var DeprMethod: Enum "FA Depr. Method Internal", var DeprBasis: Decimal, var BookValue: Decimal)

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
Year365Days Boolean
DeprYears Decimal
DeprMethod Enum Microsoft.FixedAssets.Depreciation."FA Depr. Method Internal"
DeprBasis Decimal
BookValue Decimal

OnAfterProcessDaysInPeriod

[IntegrationEvent(False,False)]
local procedure OnAfterProcessDaysInPeriod(var NumberofDays: Integer, var DaysInPeriod: Integer, var Factor: Decimal, FixedAsset: Record "Fixed Asset", DeprBook: Record "Depreciation Book", var FirstDeprDate: Date, UntilDate: Date, Year365Days: Boolean)

Parameters

Name Type Description
NumberofDays Integer
DaysInPeriod Integer
Factor Decimal
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
DeprBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
FirstDeprDate Date
UntilDate Date
Year365Days Boolean

OnBeforeCalcHalfYearPercent

[IntegrationEvent(False,False)]
local procedure OnBeforeCalcHalfYearPercent(FADeprBook: Record "FA Depreciation Book", NewYearDate: Date, Year365Days: Boolean, DaysInFiscalYear: Integer, DeprMethod: Enum "FA Depr. Method Internal", SLPercent: Decimal, var HalfYearPercent: Decimal, var IsHandled: Boolean)

Parameters

Name Type Description
FADeprBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
NewYearDate Date
Year365Days Boolean
DaysInFiscalYear Integer
DeprMethod Enum Microsoft.FixedAssets.Depreciation."FA Depr. Method Internal"
SLPercent Decimal
HalfYearPercent Decimal
IsHandled Boolean

OnCalculateDeprAmountOnAfterAssignAmountLastEntry

[IntegrationEvent(False,False)]
local procedure OnCalculateDeprAmountOnAfterAssignAmountLastEntry(FADepreciationBook: Record "FA Depreciation Book", UntilDate: Date, DateFromProjection: Date, BookValue: Decimal, UseHalfYearConvention: Boolean, DaysInFiscalYear: Integer, NumberOfDays: Integer)

Parameters

Name Type Description
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
UntilDate Date
DateFromProjection Date
BookValue Decimal
UseHalfYearConvention Boolean
DaysInFiscalYear Integer
NumberOfDays Integer

OnCalcSLAmountOnAfterCalcFromSLPercent

[IntegrationEvent(False,False)]
local procedure OnCalcSLAmountOnAfterCalcFromSLPercent(FixedAsset: Record "Fixed Asset", FADepreciationBook: Record "FA Depreciation Book", BookValue: Decimal, DeprBasis: Decimal, DaysInFiscalYear: Integer, NumberOfDays: Integer, SLPercent: Decimal, var Result: Decimal)

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
BookValue Decimal
DeprBasis Decimal
DaysInFiscalYear Integer
NumberOfDays Integer
SLPercent Decimal
Result Decimal

OnCalcSLAmountOnAfterCalcResultForRemainingLifeExpired

[IntegrationEvent(False,False)]
local procedure OnCalcSLAmountOnAfterCalcResultForRemainingLifeExpired(FixedAsset: Record "Fixed Asset", FADepreciationBook: Record "FA Depreciation Book", BookValue: Decimal, var Result: Decimal)

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
BookValue Decimal
Result Decimal

OnCalculateDeprAmountOnDeprMethodCaseLastEntry

[IntegrationEvent(True,False)]
local procedure OnCalculateDeprAmountOnDeprMethodCaseLastEntry(FADepreciationBook: Record "FA Depreciation Book", BookValue: Decimal, DeprBasis: Decimal, DeprYears: Decimal, DaysInFiscalYear: Integer, NumberOfDays: Integer, var Amount: Decimal, DateFromProjection: Date, UntilDate: Date, DeprMethod: Enum "FA Depr. Method Internal")

Parameters

Name Type Description
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
BookValue Decimal
DeprBasis Decimal
DeprYears Decimal
DaysInFiscalYear Integer
NumberOfDays Integer
Amount Decimal
DateFromProjection Date
UntilDate Date
DeprMethod Enum Microsoft.FixedAssets.Depreciation."FA Depr. Method Internal"

OnCalculateDeprAmountOnDeprMethodCaseLastDeprEntry

[IntegrationEvent(True,False)]
local procedure OnCalculateDeprAmountOnDeprMethodCaseLastDeprEntry(FADepreciationBook: Record "FA Depreciation Book", BookValue: Decimal, DeprBasis: Decimal, DeprYears: Decimal, DaysInFiscalYear: Integer, NumberOfDays: Integer, var Amount: Decimal, DateFromProjection: Date, UntilDate: Date, DeprMethod: Enum "FA Depr. Method Internal")

Parameters

Name Type Description
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
BookValue Decimal
DeprBasis Decimal
DeprYears Decimal
DaysInFiscalYear Integer
NumberOfDays Integer
Amount Decimal
DateFromProjection Date
UntilDate Date
DeprMethod Enum Microsoft.FixedAssets.Depreciation."FA Depr. Method Internal"

OnCalcHalfYearConventionDeprOnAfterFirstCalcDeprAmount

[IntegrationEvent(False,False)]
local procedure OnCalcHalfYearConventionDeprOnAfterFirstCalcDeprAmount(FADeprBook: Record "FA Depreciation Book", FixedAmount: Decimal, NumberOfDays: Integer, DaysInFiscalYear: Integer, HalfYearFactor: Decimal, UntilDate: Date, HalfYearPercent: Decimal, NewYearDate: Date, FirstDeprDate: Date, var DeprAmount: Decimal)

Parameters

Name Type Description
FADeprBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
FixedAmount Decimal
NumberOfDays Integer
DaysInFiscalYear Integer
HalfYearFactor Decimal
UntilDate Date
HalfYearPercent Decimal
NewYearDate Date
FirstDeprDate Date
DeprAmount Decimal

OnTransferValuesOnAfterSetDeprMethod

[IntegrationEvent(False,False)]
local procedure OnTransferValuesOnAfterSetDeprMethod(var FADepreciationBook: Record "FA Depreciation Book", UntilDate: Date)

Parameters

Name Type Description
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
UntilDate Date

OnCalculateDeprAmountOnBeforeCalculateDeprAmount

[IntegrationEvent(False,False)]
local procedure OnCalculateDeprAmountOnBeforeCalculateDeprAmount(FixedAsset: Record "Fixed Asset", SkipOnZero: Boolean, DeprBookCode: Code[20], var Amount: Decimal, BookValue: Decimal, SalvageValue2: Decimal, EndingBookValue: Decimal, FinalRoundingAmount: Decimal, var IsHandled: Boolean)

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
SkipOnZero Boolean
DeprBookCode Code[20]
Amount Decimal
BookValue Decimal
SalvageValue2 Decimal
EndingBookValue Decimal
FinalRoundingAmount Decimal
IsHandled Boolean

OnCalculateOnBeforeAssignSkipOnZeroValue

[IntegrationEvent(False,False)]
local procedure OnCalculateOnBeforeAssignSkipOnZeroValue(FANo: Code[20], FADepreciationBook: Record "FA Depreciation Book", var Sign: Integer, var BookValue: Decimal, var DeprBasis: Decimal, var SalvageValue: Decimal, var MinusBookValue: Decimal, var SkipOnZero: Boolean, EndingBookValue: Decimal, var IsHandled: Boolean)

Parameters

Name Type Description
FANo Code[20]
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
Sign Integer
BookValue Decimal
DeprBasis Decimal
SalvageValue Decimal
MinusBookValue Decimal
SkipOnZero Boolean
EndingBookValue Decimal
IsHandled Boolean

OnAfterCalcDBSLAmount

[IntegrationEvent(False,False)]
local procedure OnAfterCalcDBSLAmount(var DBAmount: Decimal, SLAmount: Decimal, FADepreciationBook: Record "FA Depreciation Book", DateFromProjection: Date)

Parameters

Name Type Description
DBAmount Decimal
SLAmount Decimal
FADepreciationBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
DateFromProjection Date

OnCalcSLAmountOnBeforeCheckFixedAmount

[IntegrationEvent(False,False)]
local procedure OnCalcSLAmountOnBeforeCheckFixedAmount(FixedAsset: Record "Fixed Asset", FixedAmount: Decimal, NumberOfDays: Integer, DaysInFiscalYear: Integer, var IsHandled: Boolean, var Result: Decimal)

Parameters

Name Type Description
FixedAsset Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
FixedAmount Decimal
NumberOfDays Integer
DaysInFiscalYear Integer
IsHandled Boolean
Result Decimal

OnBeforeSetHalfYearConventionMethod

[IntegrationEvent(False,False)]
local procedure OnBeforeSetHalfYearConventionMethod(FADeprBook: Record "FA Depreciation Book", DeprMethod: Enum "FA Depr. Method Internal", Year365Days: Boolean, FirstDeprDate: Date, NewYearDate: Date, var Result: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
FADeprBook Table Microsoft.FixedAssets.Depreciation."FA Depreciation Book"
DeprMethod Enum Microsoft.FixedAssets.Depreciation."FA Depr. Method Internal"
Year365Days Boolean
FirstDeprDate Date
NewYearDate Date
Result Boolean
IsHandled Boolean

See also