Codeunit "Serv-Amounts Mgt."

ID 5986
Namespace: Microsoft.Service.Posting

Properties

Name Value
Permissions TableData "General Posting Setup" = rimd, TableData "VAT Amount Line" = rimd, TableData "Dimension Buffer" = rimd, TableData "Service Line" = rimd

Methods

Initialize

procedure Initialize(CurrencyCode: Code[10])

Parameters

Name Type Description
CurrencyCode Code[10]

GetDimensions

procedure GetDimensions(DimensionEntryNo: Integer, var TempDimBuf: Record "Dimension Buffer")

Parameters

Name Type Description
DimensionEntryNo Integer
TempDimBuf Table Microsoft.Finance.Dimension."Dimension Buffer"

Finalize

procedure Finalize()

DivideAmount

procedure DivideAmount(QtyType: Option, ServLineQty: Decimal, var ServiceHeader: Record "Service Header", var ServiceLine: Record "Service Line", var TempVATAmountLine: Record "VAT Amount Line", var TempVATAmountLineRemainder: Record "VAT Amount Line")

Parameters

Name Type Description
QtyType Option
ServLineQty Decimal
ServiceHeader Table Microsoft.Service.Document."Service Header"
ServiceLine Table Microsoft.Service.Document."Service Line"
TempVATAmountLine Table Microsoft.Finance.VAT.Calculation."VAT Amount Line"
TempVATAmountLineRemainder Table Microsoft.Finance.VAT.Calculation."VAT Amount Line"

RoundAmount

procedure RoundAmount(ServLineQty: Decimal, var ServiceHeader: Record "Service Header", var ServiceLine: Record "Service Line", var TempServiceLine: Record "Service Line", var TotalServiceLine: Record "Service Line", var TotalServiceLineLCY: Record "Service Line", var ServiceLineACY: Record "Service Line")

Parameters

Name Type Description
ServLineQty Decimal
ServiceHeader Table Microsoft.Service.Document."Service Header"
ServiceLine Table Microsoft.Service.Document."Service Line"
TempServiceLine Table Microsoft.Service.Document."Service Line"
TotalServiceLine Table Microsoft.Service.Document."Service Line"
TotalServiceLineLCY Table Microsoft.Service.Document."Service Line"
ServiceLineACY Table Microsoft.Service.Document."Service Line"

ReverseAmount

procedure ReverseAmount(var ServiceLine: Record "Service Line")

Parameters

Name Type Description
ServiceLine Table Microsoft.Service.Document."Service Line"

InvoiceRounding

procedure InvoiceRounding(var ServiceHeader: Record "Service Header", var ServiceLine: Record "Service Line", var TotalServiceLine: Record "Service Line", var LastLineRetrieved: Boolean, UseTempData: Boolean, BiggestLineNo: Integer)

Parameters

Name Type Description
ServiceHeader Table Microsoft.Service.Document."Service Header"
ServiceLine Table Microsoft.Service.Document."Service Line"
TotalServiceLine Table Microsoft.Service.Document."Service Line"
LastLineRetrieved Boolean
UseTempData Boolean
BiggestLineNo Integer

RoundingLineInserted

procedure RoundingLineInserted(): Boolean

Returns

Type Description
Boolean

GetRoundingLineNo

procedure GetRoundingLineNo(): Integer

Returns

Type Description
Integer

SumServiceLines

procedure SumServiceLines(var NewServHeader: Record "Service Header", QtyType: Option, var NewTotalServLine: Record "Service Line", var NewTotalServLineLCY: Record "Service Line", var VATAmount: Decimal, var VATAmountText: Text[30], var ProfitLCY: Decimal, var ProfitPct: Decimal, var TotalAdjCostLCY: Decimal)

Parameters

Name Type Description
NewServHeader Table Microsoft.Service.Document."Service Header"
QtyType Option
NewTotalServLine Table Microsoft.Service.Document."Service Line"
NewTotalServLineLCY Table Microsoft.Service.Document."Service Line"
VATAmount Decimal
VATAmountText Text[30]
ProfitLCY Decimal
ProfitPct Decimal
TotalAdjCostLCY Decimal

SumServiceLinesTemp

procedure SumServiceLinesTemp(var NewServHeader: Record "Service Header", var OldServLine: Record "Service Line", QtyType: Option, var NewTotalServLine: Record "Service Line", var NewTotalServLineLCY: Record "Service Line", var VATAmount: Decimal, var VATAmountText: Text[30], var ProfitLCY: Decimal, var ProfitPct: Decimal, var TotalAdjCostLCY: Decimal)

Parameters

Name Type Description
NewServHeader Table Microsoft.Service.Document."Service Header"
OldServLine Table Microsoft.Service.Document."Service Line"
QtyType Option
NewTotalServLine Table Microsoft.Service.Document."Service Line"
NewTotalServLineLCY Table Microsoft.Service.Document."Service Line"
VATAmount Decimal
VATAmountText Text[30]
ProfitLCY Decimal
ProfitPct Decimal
TotalAdjCostLCY Decimal

GetServiceLines

procedure GetServiceLines(var NewServiceHeader: Record "Service Header", var NewServiceLine: Record "Service Line", QtyType: Option)

Parameters

Name Type Description
NewServiceHeader Table Microsoft.Service.Document."Service Header"
NewServiceLine Table Microsoft.Service.Document."Service Line"
QtyType Option

MAX

procedure MAX(number1: Integer, number2: Integer): Integer

Parameters

Name Type Description
number1 Integer
number2 Integer

Returns

Type Description
Integer

GetLastLineNo

procedure GetLastLineNo(ServLine: Record "Service Line"): Integer

Parameters

Name Type Description
ServLine Table Microsoft.Service.Document."Service Line"

Returns

Type Description
Integer

SetSuppressCommit

procedure SetSuppressCommit(NewSuppressCommit: Boolean)

Parameters

Name Type Description
NewSuppressCommit Boolean

AmountsDifferByMoreThanRoundingPrecision

procedure AmountsDifferByMoreThanRoundingPrecision(Amount1: Decimal, Amount2: Decimal, RoundingPrecision: Decimal): Boolean

Parameters

Name Type Description
Amount1 Decimal
Amount2 Decimal
RoundingPrecision Decimal

Returns

Type Description
Boolean

Events

OnAfterDivideAmount

[IntegrationEvent(False,False)]
local procedure OnAfterDivideAmount(var ServiceHeader: Record "Service Header", var ServiceLine: Record "Service Line", QtyType: Option, ServLineQty: Decimal, var TempVATAmountLine: Record "VAT Amount Line" temporary, var TempVATAmountLineRemainder: Record "VAT Amount Line" temporary)

Parameters

Name Type Description
ServiceHeader Table Microsoft.Service.Document."Service Header"
ServiceLine Table Microsoft.Service.Document."Service Line"
QtyType Option
ServLineQty Decimal
TempVATAmountLine Table Microsoft.Finance.VAT.Calculation."VAT Amount Line"
TempVATAmountLineRemainder Table Microsoft.Finance.VAT.Calculation."VAT Amount Line"

OnAfterIncrAmount

[IntegrationEvent(False,False)]
local procedure OnAfterIncrAmount(var TotalServiceLine: Record "Service Line", ServiceLine: Record "Service Line")

Parameters

Name Type Description
TotalServiceLine Table Microsoft.Service.Document."Service Line"
ServiceLine Table Microsoft.Service.Document."Service Line"

OnAfterReverseAmount

[IntegrationEvent(False,False)]
local procedure OnAfterReverseAmount(var ServiceLine: Record "Service Line")

Parameters

Name Type Description
ServiceLine Table Microsoft.Service.Document."Service Line"

OnBeforeDivideAmount

[IntegrationEvent(False,False)]
local procedure OnBeforeDivideAmount(var ServiceHeader: Record "Service Header", var ServiceLine: Record "Service Line", QtyType: Option, ServLineQty: Decimal, var TempVATAmountLine: Record "VAT Amount Line" temporary, var TempVATAmountLineRemainder: Record "VAT Amount Line" temporary)

Parameters

Name Type Description
ServiceHeader Table Microsoft.Service.Document."Service Header"
ServiceLine Table Microsoft.Service.Document."Service Line"
QtyType Option
ServLineQty Decimal
TempVATAmountLine Table Microsoft.Finance.VAT.Calculation."VAT Amount Line"
TempVATAmountLineRemainder Table Microsoft.Finance.VAT.Calculation."VAT Amount Line"

OnBeforeInvoiceRoundingAmount

[IntegrationEvent(False,False)]
local procedure OnBeforeInvoiceRoundingAmount(var ServiceHeader: Record "Service Header", var AmountIncludingVAT: Decimal, UseTempData: Boolean, var InvoiceRoundingAmount: Decimal, CommitIsSuppressed: Boolean)

Parameters

Name Type Description
ServiceHeader Table Microsoft.Service.Document."Service Header"
AmountIncludingVAT Decimal
UseTempData Boolean
InvoiceRoundingAmount Decimal
CommitIsSuppressed Boolean

OnBeforeRoundAmount

[IntegrationEvent(False,False)]
local procedure OnBeforeRoundAmount(var ServiceHeader: Record "Service Header", var ServiceLine: Record "Service Line", ServLineQty: Decimal)

Parameters

Name Type Description
ServiceHeader Table Microsoft.Service.Document."Service Header"
ServiceLine Table Microsoft.Service.Document."Service Line"
ServLineQty Decimal

OnDivideAmountOnAfterCalcLineAmountExpected

[IntegrationEvent(False,False)]
local procedure OnDivideAmountOnAfterCalcLineAmountExpected(var ServiceLine: Record "Service Line", var ChargeableQty: Decimal, var LineAmountExpected: Decimal)

Parameters

Name Type Description
ServiceLine Table Microsoft.Service.Document."Service Line"
ChargeableQty Decimal
LineAmountExpected Decimal

OnRoundAmountOnBeforeIncrAmount

[IntegrationEvent(False,False)]
local procedure OnRoundAmountOnBeforeIncrAmount(var ServiceLine: Record "Service Line", TotalServiceLine: Record "Service Line", TotalServiceLineLCY: Record "Service Line", UseDate: Date, NoVAT: Boolean)

Parameters

Name Type Description
ServiceLine Table Microsoft.Service.Document."Service Line"
TotalServiceLine Table Microsoft.Service.Document."Service Line"
TotalServiceLineLCY Table Microsoft.Service.Document."Service Line"
UseDate Date
NoVAT Boolean

OnSumServiceLines2OnBeforeSetTypeFilters

[IntegrationEvent(False,False)]
local procedure OnSumServiceLines2OnBeforeSetTypeFilters(var ServiceLine: Record "Service Line", ServiceHeader: Record "Service Header", QtyType: Option, var IsHandled: Boolean)

Parameters

Name Type Description
ServiceLine Table Microsoft.Service.Document."Service Line"
ServiceHeader Table Microsoft.Service.Document."Service Header"
QtyType Option
IsHandled Boolean

OnInvoiceRoundingAmountOnBeforeCheckUseTempData

[IntegrationEvent(False,False)]
local procedure OnInvoiceRoundingAmountOnBeforeCheckUseTempData(var ServiceHeader: Record "Service Header", var ServiceLine: Record "Service Line")

Parameters

Name Type Description
ServiceHeader Table Microsoft.Service.Document."Service Header"
ServiceLine Table Microsoft.Service.Document."Service Line"

OnInvoiceRoundingAmountOnAfterCheckUseTempData

[IntegrationEvent(False,False)]
local procedure OnInvoiceRoundingAmountOnAfterCheckUseTempData(var ServiceHeader: Record "Service Header", var ServiceLine: Record "Service Line")

Parameters

Name Type Description
ServiceHeader Table Microsoft.Service.Document."Service Header"
ServiceLine Table Microsoft.Service.Document."Service Line"

OnSumServiceLines2OnBeforeInvoiceRounding

[IntegrationEvent(False,False)]
local procedure OnSumServiceLines2OnBeforeInvoiceRounding(var ServiceHeader: Record "Service Header", var ServiceLine: Record "Service Line", var OldServiceLine: Record "Service Line", var TotalServiceLine: Record "Service Line", QtyType: Option, var LastLineRetrieved: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
ServiceHeader Table Microsoft.Service.Document."Service Header"
ServiceLine Table Microsoft.Service.Document."Service Line"
OldServiceLine Table Microsoft.Service.Document."Service Line"
TotalServiceLine Table Microsoft.Service.Document."Service Line"
QtyType Option
LastLineRetrieved Boolean
IsHandled Boolean

OnDivideAmountOnBeforeTempVATAmountLineRemainderModify

[IntegrationEvent(False,False)]
local procedure OnDivideAmountOnBeforeTempVATAmountLineRemainderModify(var ServiceLine: Record "Service Line", var ServiceHeader: Record "Service Header", var Currency: Record Currency, var TempVATAmountLine: Record "VAT Amount Line" temporary, var TempVATAmountLineRemainder: Record "VAT Amount Line" temporary)

Parameters

Name Type Description
ServiceLine Table Microsoft.Service.Document."Service Line"
ServiceHeader Table Microsoft.Service.Document."Service Header"
Currency Table Microsoft.Finance.Currency.Currency
TempVATAmountLine Table Microsoft.Finance.VAT.Calculation."VAT Amount Line"
TempVATAmountLineRemainder Table Microsoft.Finance.VAT.Calculation."VAT Amount Line"

OnAfterInvoiceRounding

[IntegrationEvent(False,False)]
local procedure OnAfterInvoiceRounding(ServiceHeader: Record "Service Header", var ServiceLine: Record "Service Line", var TotalServiceLine: Record "Service Line", UseTempData: Boolean, InvoiceRoundingAmount: Decimal, Currency: Record Currency, var BiggestLineNo: Integer, var LastLineRetrieved: Boolean, var RoundingLineIsInserted: Boolean, var RoundingLineNo: Integer)

Parameters

Name Type Description
ServiceHeader Table Microsoft.Service.Document."Service Header"
ServiceLine Table Microsoft.Service.Document."Service Line"
TotalServiceLine Table Microsoft.Service.Document."Service Line"
UseTempData Boolean
InvoiceRoundingAmount Decimal
Currency Table Microsoft.Finance.Currency.Currency
BiggestLineNo Integer
LastLineRetrieved Boolean
RoundingLineIsInserted Boolean
RoundingLineNo Integer

See also