Codeunit "Depreciation Calculation"

ID 5616
Namespace: Microsoft.FixedAssets.Depreciation

Properties

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

Methods

DeprDays

procedure DeprDays(StartingDate: Date, EndingDate: Date, Year365Days: Boolean): Integer

Parameters

Name Type Description
StartingDate Date
EndingDate Date
Year365Days Boolean

Returns

Type Description
Integer

DeprDays

procedure DeprDays(StartingDate: Date, EndingDate: Date, Year365Days: Boolean, UseAccountingPeriod: Boolean): Integer

Parameters

Name Type Description
StartingDate Date
EndingDate Date
Year365Days Boolean
UseAccountingPeriod Boolean

Returns

Type Description
Integer

ToMorrow

procedure ToMorrow(ThisDate: Date, Year365Days: Boolean): Date

Parameters

Name Type Description
ThisDate Date
Year365Days Boolean

Returns

Type Description
Date

ToMorrow

procedure ToMorrow(ThisDate: Date, Year365Days: Boolean, UseAccountingPeriod: Boolean): Date

Parameters

Name Type Description
ThisDate Date
Year365Days Boolean
UseAccountingPeriod Boolean

Returns

Type Description
Date

Yesterday

procedure Yesterday(ThisDate: Date, Year365Days: Boolean): Date

Parameters

Name Type Description
ThisDate Date
Year365Days Boolean

Returns

Type Description
Date

Yesterday

procedure Yesterday(ThisDate: Date, Year365Days: Boolean, UseAccountingPeriod: Boolean): Date

Parameters

Name Type Description
ThisDate Date
Year365Days Boolean
UseAccountingPeriod Boolean

Returns

Type Description
Date

SetFAFilter

procedure SetFAFilter(var FALedgEntry: Record "FA Ledger Entry", FANo: Code[20], DeprBookCode: Code[10], FAPostingTypeOrder: Boolean)

Parameters

Name Type Description
FALedgEntry Table Microsoft.FixedAssets.Ledger."FA Ledger Entry"
FANo Code[20]
DeprBookCode Code[10]
FAPostingTypeOrder Boolean

CalcEntryAmounts

procedure CalcEntryAmounts(FANo: Code[20], DeprBookCode: Code[10], StartingDate: Date, EndingDate: Date, var EntryAmounts: array[4] of Decimal)

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]
StartingDate Date
EndingDate Date
EntryAmounts array[4] of Decimal

UseDeprStartingDate

procedure UseDeprStartingDate(FANo: Code[20], DeprBookCode: Code[10]): Boolean

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]

Returns

Type Description
Boolean

GetFirstDeprDate

procedure GetFirstDeprDate(FANo: Code[20], DeprBookCode: Code[10], Year365Days: Boolean): Date

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]
Year365Days Boolean

Returns

Type Description
Date

GetFirstDeprDate

procedure GetFirstDeprDate(FANo: Code[20], DeprBookCode: Code[10], Year365Days: Boolean, UseAccountingPeriod: Boolean): Date

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]
Year365Days Boolean
UseAccountingPeriod Boolean

Returns

Type Description
Date

GetMinusBookValue

procedure GetMinusBookValue(FANo: Code[20], DeprBookCode: Code[10], StartingDate: Date, EndingDate: Date): Decimal

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]
StartingDate Date
EndingDate Date

Returns

Type Description
Decimal

AdjustDepr

procedure AdjustDepr(DeprBookCode: Code[10], var Depreciation: Decimal, BookValue: Decimal, SalvageValue: Decimal, EndingBookValue: Decimal, FinalRoundingAmount: Decimal)

Parameters

Name Type Description
DeprBookCode Code[10]
Depreciation Decimal
BookValue Decimal
SalvageValue Decimal
EndingBookValue Decimal
FinalRoundingAmount Decimal

AdjustCustom1

procedure AdjustCustom1(DeprBookCode: Code[10], var DeprAmount: Decimal, var Custom1Amount: Decimal, BookValue: Decimal, SalvageValue: Decimal, EndingBookValue: Decimal, FinalRoundingAmount: Decimal)

Parameters

Name Type Description
DeprBookCode Code[10]
DeprAmount Decimal
Custom1Amount Decimal
BookValue Decimal
SalvageValue Decimal
EndingBookValue Decimal
FinalRoundingAmount Decimal

GetSign

procedure GetSign(BookValue: Decimal, DeprBasis: Decimal, SalvageValue: Decimal, MinusBookValue: Decimal): Integer

Parameters

Name Type Description
BookValue Decimal
DeprBasis Decimal
SalvageValue Decimal
MinusBookValue Decimal

Returns

Type Description
Integer

GetCustom1Sign

procedure GetCustom1Sign(BookValue: Decimal, AcquisitionCost: Decimal, Custom1: Decimal, SalvageValue: Decimal, MinusBookValue: Decimal): Integer

Parameters

Name Type Description
BookValue Decimal
AcquisitionCost Decimal
Custom1 Decimal
SalvageValue Decimal
MinusBookValue Decimal

Returns

Type Description
Integer

GetNewSigns

procedure GetNewSigns(var BookValue: Decimal, var DeprBasis: Decimal, var SalvageValue: Decimal, var MinusBookValue: Decimal)

Parameters

Name Type Description
BookValue Decimal
DeprBasis Decimal
SalvageValue Decimal
MinusBookValue Decimal

GetNewCustom1Signs

procedure GetNewCustom1Signs(var BookValue: Decimal, var AcquisitionCost: Decimal, var Custom1: Decimal, var SalvageValue: Decimal, var MinusBookValue: Decimal)

Parameters

Name Type Description
BookValue Decimal
AcquisitionCost Decimal
Custom1 Decimal
SalvageValue Decimal
MinusBookValue Decimal

CalcRounding

procedure CalcRounding(DeprBookCode: Code[10], DeprAmount: Decimal): Decimal

Parameters

Name Type Description
DeprBookCode Code[10]
DeprAmount Decimal

Returns

Type Description
Decimal

CalculateDeprInPeriod

procedure CalculateDeprInPeriod(FANo: Code[20], DeprBookCode: Code[10], EndingDate: Date, CalculatedDepr: Decimal, Sign: Integer, var NewBookValue: Decimal, var DeprBasis: Decimal, var SalvageValue: Decimal, var MinusBookValue: Decimal)

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]
EndingDate Date
CalculatedDepr Decimal
Sign Integer
NewBookValue Decimal
DeprBasis Decimal
SalvageValue Decimal
MinusBookValue Decimal

GetDeprPeriod

procedure GetDeprPeriod(FANo: Code[20], DeprBookCode: Code[10], UntilDate: Date, var StartingDate: Date, var EndingDate: Date, var NumberOfDays: Integer, Year365Days: Boolean)

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]
UntilDate Date
StartingDate Date
EndingDate Date
NumberOfDays Integer
Year365Days Boolean

GetDeprPeriod

procedure GetDeprPeriod(FANo: Code[20], DeprBookCode: Code[10], UntilDate: Date, var StartingDate: Date, var EndingDate: Date, var NumberOfDays: Integer, Year365Days: Boolean, UseAccountingPeriod: Boolean)

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]
UntilDate Date
StartingDate Date
EndingDate Date
NumberOfDays Integer
Year365Days Boolean
UseAccountingPeriod Boolean

DeprInFiscalYear

procedure DeprInFiscalYear(FANo: Code[20], DeprBookCode: Code[10], StartingDate: Date): Decimal

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]
StartingDate Date

Returns

Type Description
Decimal

GetPartOfCalculation

procedure GetPartOfCalculation(Type: Option, PostingType: Option, DeprBookCode: Code[10]): Boolean

Parameters

Name Type Description
Type Option
PostingType Option
DeprBookCode Code[10]

Returns

Type Description
Boolean

FAName

procedure FAName(var FA: Record "Fixed Asset", DeprBookCode: Code[10]): Text[200]

Parameters

Name Type Description
FA Table Microsoft.FixedAssets.FixedAsset."Fixed Asset"
DeprBookCode Code[10]

Returns

Type Description
Text[200]

FADeprBookName

procedure FADeprBookName(DeprBookCode: Code[10]): Text[200]

Parameters

Name Type Description
DeprBookCode Code[10]

Returns

Type Description
Text[200]

DeprDays365

procedure DeprDays365(StartingDate: Date, EndingDate: Date): Integer

Parameters

Name Type Description
StartingDate Date
EndingDate Date

Returns

Type Description
Integer

Events

OnAfterAdjustDepr

[IntegrationEvent(False,False)]
local procedure OnAfterAdjustDepr(DeprBookCode: Code[10], BookValue: Decimal, MaxValue: Decimal, var Depreciation: Decimal)

Parameters

Name Type Description
DeprBookCode Code[10]
BookValue Decimal
MaxValue Decimal
Depreciation Decimal

OnAfterCalcDepreciation

[IntegrationEvent(False,False)]
local procedure OnAfterCalcDepreciation(DeprBookCode: Code[10], var Depreciation: Decimal, BookValue: Decimal)

Parameters

Name Type Description
DeprBookCode Code[10]
Depreciation Decimal
BookValue Decimal

OnAfterDeprDays

[IntegrationEvent(False,False)]
local procedure OnAfterDeprDays(StartingDate: Date, EndingDate: Date, var NumberOfDeprDays: Integer, Year365Days: Boolean)

Parameters

Name Type Description
StartingDate Date
EndingDate Date
NumberOfDeprDays Integer
Year365Days Boolean

OnAfterGetDeprPeriod

[IntegrationEvent(False,False)]
local procedure OnAfterGetDeprPeriod(FANo: Code[20], DeprBookCode: Code[10], UntilDate: Date, var StartingDate: Date, var EndingDate: Date, var NumberOfDays: Integer, Year365Days: Boolean)

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]
UntilDate Date
StartingDate Date
EndingDate Date
NumberOfDays Integer
Year365Days Boolean

OnBeforeCalcRounding

[IntegrationEvent(False,False)]
local procedure OnBeforeCalcRounding(DeprBook: Record "Depreciation Book", OrigDeprAmount: Decimal, var DeprAmount: Decimal, var IsHandled: Boolean)

Parameters

Name Type Description
DeprBook Table Microsoft.FixedAssets.Depreciation."Depreciation Book"
OrigDeprAmount Decimal
DeprAmount Decimal
IsHandled Boolean

OnBeforeFindMaxDate

[IntegrationEvent(False,False)]
local procedure OnBeforeFindMaxDate(var FALedgEntry: Record "FA Ledger Entry", EntryDates: array[4] of Date, Year365Days: Boolean, var MaxDate: Date, var IsHandled: Boolean)

Parameters

Name Type Description
FALedgEntry Table Microsoft.FixedAssets.Ledger."FA Ledger Entry"
EntryDates array[4] of Date
Year365Days Boolean
MaxDate Date
IsHandled Boolean

OnBeforeGetFirstDeprDate

[IntegrationEvent(False,False)]
local procedure OnBeforeGetFirstDeprDate(FixedAssetNo: Code[20], DepreciationBookCode: Code[10], Year365Days: Boolean, var LocalDate: Date, var IsHandled: Boolean)

Parameters

Name Type Description
FixedAssetNo Code[20]
DepreciationBookCode Code[10]
Year365Days Boolean
LocalDate Date
IsHandled Boolean

OnBeforeUseDeprStartingDate

[IntegrationEvent(False,False)]
local procedure OnBeforeUseDeprStartingDate(FANo: Code[20], DeprBookCode: Code[10], var Result: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
FANo Code[20]
DeprBookCode Code[10]
Result Boolean
IsHandled Boolean

OnAfterGetFAPostingTypeSetup

[IntegrationEvent(False,False)]
local procedure OnAfterGetFAPostingTypeSetup(var FAPostingTypeSetup: Record "FA Posting Type Setup", Type: Option)

Parameters

Name Type Description
FAPostingTypeSetup Table Microsoft.FixedAssets.Posting."FA Posting Type Setup"
Type Option

OnCalcEntryAmountsOnAfterSetFALedgEntryFilters

[IntegrationEvent(False,False)]
local procedure OnCalcEntryAmountsOnAfterSetFALedgEntryFilters(var FALedgerEntry: Record "FA Ledger Entry", I: Integer)

Parameters

Name Type Description
FALedgerEntry Table Microsoft.FixedAssets.Ledger."FA Ledger Entry"
I Integer

OnGetFirstDeprDateOnAfterSetFAFilter

[IntegrationEvent(False,False)]
local procedure OnGetFirstDeprDateOnAfterSetFAFilter(var FALedgerEntry: Record "FA Ledger Entry")

Parameters

Name Type Description
FALedgerEntry Table Microsoft.FixedAssets.Ledger."FA Ledger Entry"

OnAfterSetFAFilter

[IntegrationEvent(False,False)]
local procedure OnAfterSetFAFilter(var FALedgerEntry: Record "FA Ledger Entry")

Parameters

Name Type Description
FALedgerEntry Table Microsoft.FixedAssets.Ledger."FA Ledger Entry"

See also