Share via


Codeunit "Correct Posted Sales Invoice"

ID 1303
Namespace: Microsoft.Sales.History

Properties

Name Value
Permissions TableData "Sales Invoice Header" = rm, TableData "Sales Cr.Memo Header" = rm
TableNo Table Microsoft.Sales.History."Sales Invoice Header"

Methods

CancelPostedInvoice

procedure CancelPostedInvoice(var SalesInvoiceHeader: Record "Sales Invoice Header"): Boolean

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"

Returns

Type Description
Boolean

CreateCreditMemoCopyDocument

procedure CreateCreditMemoCopyDocument(var SalesInvoiceHeader: Record "Sales Invoice Header", var SalesHeader: Record "Sales Header"): Boolean

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
SalesHeader Table Microsoft.Sales.Document."Sales Header"

Returns

Type Description
Boolean

CreateCorrectiveCreditMemo

procedure CreateCorrectiveCreditMemo(var InvoiceNotification: Notification)

Parameters

Name Type Description
InvoiceNotification Notification

ShowAppliedEntries

procedure ShowAppliedEntries(var InvoiceNotification: Notification)

Parameters

Name Type Description
InvoiceNotification Notification

SkipCorrectiveCreditMemo

procedure SkipCorrectiveCreditMemo(var InvoiceNotification: Notification)

Parameters

Name Type Description
InvoiceNotification Notification

CancelPostedInvoiceCreateNewInvoice

procedure CancelPostedInvoiceCreateNewInvoice(var SalesInvoiceHeader: Record "Sales Invoice Header", var SalesHeader: Record "Sales Header")

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
SalesHeader Table Microsoft.Sales.Document."Sales Header"

TestCorrectInvoiceIsAllowed

procedure TestCorrectInvoiceIsAllowed(var SalesInvoiceHeader: Record "Sales Invoice Header", Cancelling: Boolean)

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
Cancelling Boolean

FindItemLedgEntries

procedure FindItemLedgEntries(var ItemLedgEntry: Record "Item Ledger Entry", InvNo: Code[20])

Parameters

Name Type Description
ItemLedgEntry Table Microsoft.Inventory.Ledger."Item Ledger Entry"
InvNo Code[20]

ErrorHelperHeader

procedure ErrorHelperHeader(HeaderErrorType: Enum "Correct Sales Inv. Error Type", SalesInvoiceHeader: Record "Sales Invoice Header")

Parameters

Name Type Description
HeaderErrorType Enum Microsoft.Sales.History."Correct Sales Inv. Error Type"
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"

Events

OnAfterCreateCopyDocument

[IntegrationEvent(False,False)]
local procedure OnAfterCreateCopyDocument(var SalesHeader: Record "Sales Header", var SalesInvoiceHeader: Record "Sales Invoice Header")

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"

OnAfterIsCommentLine

[IntegrationEvent(False,False)]
local procedure OnAfterIsCommentLine(SalesInvoiceLine: Record "Sales Invoice Line", var Result: Boolean)

Parameters

Name Type Description
SalesInvoiceLine Table Microsoft.Sales.History."Sales Invoice Line"
Result Boolean

OnAfterTestCorrectInvoiceIsAllowed

[IntegrationEvent(False,False)]
local procedure OnAfterTestCorrectInvoiceIsAllowed(var SalesInvoiceHeader: Record "Sales Invoice Header", Cancelling: Boolean)

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
Cancelling Boolean

OnAfterTestSalesLineType

[IntegrationEvent(False,False)]
local procedure OnAfterTestSalesLineType(SalesInvoiceLine: Record "Sales Invoice Line", var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceLine Table Microsoft.Sales.History."Sales Invoice Line"
IsHandled Boolean

OnAfterCreateCorrSalesInvoice

[IntegrationEvent(False,False)]
local procedure OnAfterCreateCorrSalesInvoice(var SalesHeader: Record "Sales Header", var SalesInvoiceHeader: Record "Sales Invoice Header")

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"

OnAfterCreateCorrectiveSalesCrMemo

[IntegrationEvent(False,False)]
local procedure OnAfterCreateCorrectiveSalesCrMemo(SalesInvoiceHeader: Record "Sales Invoice Header", var SalesHeader: Record "Sales Header", var CancellingOnly: Boolean)

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
SalesHeader Table Microsoft.Sales.Document."Sales Header"
CancellingOnly Boolean

OnAfterUpdateSalesOrderLineInvoicedQuantity

[IntegrationEvent(False,False)]
local procedure OnAfterUpdateSalesOrderLineInvoicedQuantity(var SalesLine: Record "Sales Line", CancelledQuantity: Decimal, CancelledQtyBase: Decimal)

Parameters

Name Type Description
SalesLine Table Microsoft.Sales.Document."Sales Line"
CancelledQuantity Decimal
CancelledQtyBase Decimal

OnBeforeCreateCorrectiveSalesCrMemo

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateCorrectiveSalesCrMemo(var SalesInvoiceHeader: Record "Sales Invoice Header")

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"

OnBeforeCreateCreditMemoCopyDocument

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateCreditMemoCopyDocument(var SalesInvoiceHeader: Record "Sales Invoice Header")

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"

OnBeforeSalesHeaderInsert

[IntegrationEvent(False,False)]
local procedure OnBeforeSalesHeaderInsert(var SalesHeader: Record "Sales Header", var SalesInvoiceHeader: Record "Sales Invoice Header", CancellingOnly: Boolean)

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
CancellingOnly Boolean

OnBeforeSetTrackInfoForCancellation

[IntegrationEvent(False,False)]
local procedure OnBeforeSetTrackInfoForCancellation(var SalesInvoiceHeader: Record "Sales Invoice Header", var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
IsHandled Boolean

OnBeforeTestSalesInvoiceHeaderAmount

Obsolete

This element will become obsolete from version 25.0. OnBeforeTestSalesInvoiceHeaderAmount is not supported anymore.

[Obsolete(OnBeforeTestSalesInvoiceHeaderAmount is not supported anymore.,25.0)]
[IntegrationEvent(False,False)]
local procedure OnBeforeTestSalesInvoiceHeaderAmount(var SalesInvoiceHeader: Record "Sales Invoice Header", Cancelling: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
Cancelling Boolean
IsHandled Boolean

OnBeforeTestIfAnyFreeNumberSeries

[IntegrationEvent(False,False)]
local procedure OnBeforeTestIfAnyFreeNumberSeries(var SalesInvoiceHeader: Record "Sales Invoice Header", var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
IsHandled Boolean

OnHasLineDiscountSetup

[IntegrationEvent(False,False)]
local procedure OnHasLineDiscountSetup(SalesReceivablesSetup: Record "Sales & Receivables Setup", var Result: Boolean)

Parameters

Name Type Description
SalesReceivablesSetup Table Microsoft.Sales.Setup."Sales & Receivables Setup"
Result Boolean

OnBeforeTestInventoryPostingSetup

[IntegrationEvent(False,False)]
local procedure OnBeforeTestInventoryPostingSetup(SalesInvoiceLine: Record "Sales Invoice Line", var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceLine Table Microsoft.Sales.History."Sales Invoice Line"
IsHandled Boolean

OnBeforeUpdateSalesOrderLineInvoicedQuantity

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateSalesOrderLineInvoicedQuantity(var SalesLine: Record "Sales Line", CancelledQuantity: Decimal, CancelledQtyBase: Decimal, var IsHandled: Boolean)

Parameters

Name Type Description
SalesLine Table Microsoft.Sales.Document."Sales Line"
CancelledQuantity Decimal
CancelledQtyBase Decimal
IsHandled Boolean

OnCreateCreditMemoOnBeforePageRun

[IntegrationEvent(False,False)]
local procedure OnCreateCreditMemoOnBeforePageRun(var SalesHeader: Record "Sales Header", var IsHandled: Boolean)

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"
IsHandled Boolean

OnCreateCreditMemoOnBeforePostedPageRun

[IntegrationEvent(False,False)]
local procedure OnCreateCreditMemoOnBeforePostedPageRun(var SalesCrMemoHeader: Record "Sales Cr.Memo Header", var IsHandled: Boolean)

Parameters

Name Type Description
SalesCrMemoHeader Table Microsoft.Sales.History."Sales Cr.Memo Header"
IsHandled Boolean

OnBeforeUnapplyCostApplication

[IntegrationEvent(False,False)]
local procedure OnBeforeUnapplyCostApplication(InvNo: Code[20], var IsHandled: Boolean)

Parameters

Name Type Description
InvNo Code[20]
IsHandled Boolean

OnTestSalesLinesOnAfterCalcShippedQtyNoReturned

[IntegrationEvent(False,False)]
local procedure OnTestSalesLinesOnAfterCalcShippedQtyNoReturned(SalesInvoiceLine: Record "Sales Invoice Line", var ShippedQtyNoReturned: Decimal)

Parameters

Name Type Description
SalesInvoiceLine Table Microsoft.Sales.History."Sales Invoice Line"
ShippedQtyNoReturned Decimal

OnOnRunOnAfterUpdateSalesOrderLinesFromCancelledInvoice

[IntegrationEvent(False,False)]
local procedure OnOnRunOnAfterUpdateSalesOrderLinesFromCancelledInvoice(var Rec: Record "Sales Invoice Header", var SalesHeader: Record "Sales Header")

Parameters

Name Type Description
Rec Table Microsoft.Sales.History."Sales Invoice Header"
SalesHeader Table Microsoft.Sales.Document."Sales Header"

OnBeforeTestIfInvoiceIsPaid

[IntegrationEvent(False,False)]
local procedure OnBeforeTestIfInvoiceIsPaid(var SalesInvoiceHeader: Record "Sales Invoice Header", var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
IsHandled Boolean

OnCreateCorrectiveCreditMemoOnBeforePageRun

[IntegrationEvent(False,False)]
local procedure OnCreateCorrectiveCreditMemoOnBeforePageRun(var SalesHeader: Record "Sales Header", var IsHandled: Boolean)

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"
IsHandled Boolean

OnBeforeTestVATPostingSetup

[IntegrationEvent(False,False)]
local procedure OnBeforeTestVATPostingSetup(SalesInvoiceLine: Record "Sales Invoice Line", var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceLine Table Microsoft.Sales.History."Sales Invoice Line"
IsHandled Boolean

OnBeforeErrorHelperHeader

[IntegrationEvent(False,False)]
local procedure OnBeforeErrorHelperHeader(HeaderErrorType: Enum "Correct Sales Inv. Error Type", SalesInvoiceHeader: Record "Sales Invoice Header", CancellingOnly: Boolean)

Parameters

Name Type Description
HeaderErrorType Enum Microsoft.Sales.History."Correct Sales Inv. Error Type"
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
CancellingOnly Boolean

OnBeforeTestIfInvoiceIsCorrectedOnce

[IntegrationEvent(False,False)]
local procedure OnBeforeTestIfInvoiceIsCorrectedOnce(var SalesInvoiceHeader: Record "Sales Invoice Header", var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
IsHandled Boolean

OnBeforeWasNotCancelled

[IntegrationEvent(False,False)]
local procedure OnBeforeWasNotCancelled(InvNo: Code[20], var Result: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
InvNo Code[20]
Result Boolean
IsHandled Boolean

OnRunOnBeforePostCorrectiveSalesCrMemo

[IntegrationEvent(False,False)]
local procedure OnRunOnBeforePostCorrectiveSalesCrMemo(var SalesInvoiceHeader: Record "Sales Invoice Header", var SalesHeader: Record "Sales Header", var IsHandled: Boolean, var SuppressCommit: Boolean)

Parameters

Name Type Description
SalesInvoiceHeader Table Microsoft.Sales.History."Sales Invoice Header"
SalesHeader Table Microsoft.Sales.Document."Sales Header"
IsHandled Boolean
SuppressCommit Boolean

OnBeforeTestWMSLocation

[IntegrationEvent(False,False)]
local procedure OnBeforeTestWMSLocation(var SalesInvoiceLine: Record "Sales Invoice Line", var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceLine Table Microsoft.Sales.History."Sales Invoice Line"
IsHandled Boolean

OnBeforeCreateAndProcessJobPlanningLines

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateAndProcessJobPlanningLines(var SalesHeader: Record "Sales Header", var IsHandled: Boolean)

Parameters

Name Type Description
SalesHeader Table Microsoft.Sales.Document."Sales Header"
IsHandled Boolean

OnTestGenPostingSetupOnBeforeTestTypeItem

[IntegrationEvent(False,False)]
local procedure OnTestGenPostingSetupOnBeforeTestTypeItem(SalesInvoiceLine: Record "Sales Invoice Line", var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceLine Table Microsoft.Sales.History."Sales Invoice Line"
IsHandled Boolean

OnBeforeUpdateSalesOrderLinesFromCancelledInvoice

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdateSalesOrderLinesFromCancelledInvoice(SalesInvoiceHeaderNo: Code[20], var IsHandled: Boolean)

Parameters

Name Type Description
SalesInvoiceHeaderNo Code[20]
IsHandled Boolean

OnCreateJobPlanningLineOnAfterInitFromJobPlanningLine

[IntegrationEvent(False,False)]
local procedure OnCreateJobPlanningLineOnAfterInitFromJobPlanningLine(var ToJobPlanningLine: Record "Job Planning Line", FromJobPlanningLine: Record "Job Planning Line", SalesLine: Record "Sales Line")

Parameters

Name Type Description
ToJobPlanningLine Table Microsoft.Projects.Project.Planning."Job Planning Line"
FromJobPlanningLine Table Microsoft.Projects.Project.Planning."Job Planning Line"
SalesLine Table Microsoft.Sales.Document."Sales Line"

See also