Share via


Codeunit "Correct Posted Purch. Invoice"

ID 1313
Namespace: Microsoft.Purchases.History

Properties

Name Value
Permissions TableData "Purch. Inv. Header" = rm, TableData "Purch. Cr. Memo Hdr." = rm
TableNo Table Microsoft.Purchases.History."Purch. Inv. Header"

Methods

CancelPostedInvoice

procedure CancelPostedInvoice(var PurchInvHeader: Record "Purch. Inv. Header"): Boolean

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"

Returns

Type Description
Boolean

CreateCreditMemoCopyDocument

procedure CreateCreditMemoCopyDocument(var PurchInvHeader: Record "Purch. Inv. Header", var PurchaseHeader: Record "Purchase Header"): Boolean

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
PurchaseHeader Table Microsoft.Purchases.Document."Purchase 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

CancelPostedInvoiceStartNewInvoice

procedure CancelPostedInvoiceStartNewInvoice(var PurchInvHeader: Record "Purch. Inv. Header", var PurchaseHeader: Record "Purchase Header")

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"

TestCorrectInvoiceIsAllowed

procedure TestCorrectInvoiceIsAllowed(var PurchInvHeader: Record "Purch. Inv. Header", Cancelling: Boolean)

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. 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 Purch. Inv. Error Type", PurchInvHeader: Record "Purch. Inv. Header")

Parameters

Name Type Description
HeaderErrorType Enum Microsoft.Purchases.History."Correct Purch. Inv. Error Type"
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"

Events

OnAfterCreateCorrectivePurchCrMemo

[IntegrationEvent(False,False)]
local procedure OnAfterCreateCorrectivePurchCrMemo(PurchInvHeader: Record "Purch. Inv. Header", var PurchaseHeader: Record "Purchase Header", var CancellingOnly: Boolean, var SuppressCommit: Boolean)

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"
CancellingOnly Boolean
SuppressCommit Boolean

OnAfterTestCorrectInvoiceIsAllowed

[IntegrationEvent(False,False)]
local procedure OnAfterTestCorrectInvoiceIsAllowed(var PurchInvHeader: Record "Purch. Inv. Header", Cancelling: Boolean)

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
Cancelling Boolean

OnBeforeCreateCopyDocument

[IntegrationEvent(False,False)]
local procedure OnBeforeCreateCopyDocument(var PurchInvHeader: Record "Purch. Inv. Header", var PurchaseHeader: Record "Purchase Header", DocumentType: Enum "Purchase Document Type", SkipCopyFromDescription: Boolean)

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"
DocumentType Enum Microsoft.Purchases.Document."Purchase Document Type"
SkipCopyFromDescription Boolean

OnBeforeTestIfInvoiceIsPaid

[IntegrationEvent(False,False)]
local procedure OnBeforeTestIfInvoiceIsPaid(var PurchInvHeader: Record "Purch. Inv. Header", var IsHandled: Boolean)

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
IsHandled Boolean

OnBeforeTestIfAnyFreeNumberSeries

[IntegrationEvent(False,False)]
local procedure OnBeforeTestIfAnyFreeNumberSeries(var PurchInvHeader: Record "Purch. Inv. Header", CancellingOnly: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
CancellingOnly Boolean
IsHandled Boolean

OnBeforePurchaseHeaderInsert

[IntegrationEvent(False,False)]
local procedure OnBeforePurchaseHeaderInsert(var PurchaseHeader: Record "Purchase Header", PurchInvHeader: Record "Purch. Inv. Header")

Parameters

Name Type Description
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"

OnBeforeUnAppyCostApplication

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

Parameters

Name Type Description
InvNo Code[20]
IsHandled Boolean

OnBeforeUpdatePurchaseOrderLineInvoicedQuantity

[IntegrationEvent(False,False)]
local procedure OnBeforeUpdatePurchaseOrderLineInvoicedQuantity(var PurchaseLine: Record "Purchase Line", CancelledQuantity: Decimal, CancelledQtyBase: Decimal, var IsHandled: Boolean)

Parameters

Name Type Description
PurchaseLine Table Microsoft.Purchases.Document."Purchase Line"
CancelledQuantity Decimal
CancelledQtyBase Decimal
IsHandled Boolean

OnBeforeTestInventoryPostingSetup

[IntegrationEvent(False,False)]
local procedure OnBeforeTestInventoryPostingSetup(PurchInvLine: Record "Purch. Inv. Line", var IsHandled: Boolean)

Parameters

Name Type Description
PurchInvLine Table Microsoft.Purchases.History."Purch. Inv. Line"
IsHandled Boolean

OnHasLineDiscountSetup

[IntegrationEvent(False,False)]
local procedure OnHasLineDiscountSetup(PurchasesPayablesSetup: Record "Purchases & Payables Setup", var Result: Boolean)

Parameters

Name Type Description
PurchasesPayablesSetup Table Microsoft.Purchases.Setup."Purchases & Payables Setup"
Result Boolean

OnRunOnAfterUpdatePurchaseOrderLinesFromCancelledInvoice

[IntegrationEvent(False,False)]
local procedure OnRunOnAfterUpdatePurchaseOrderLinesFromCancelledInvoice(var PurchInvHeader: Record "Purch. Inv. Header", var PurchaseHeader: Record "Purchase Header")

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"

OnRunOnBeforeCreateCopyDocument

[IntegrationEvent(False,False)]
local procedure OnRunOnBeforeCreateCopyDocument(var PurchInvHeader: Record "Purch. Inv. Header")

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"

OnTestPurchaseLinesOnAfterCalcThrowItemReturnedError

[IntegrationEvent(False,False)]
local procedure OnTestPurchaseLinesOnAfterCalcThrowItemReturnedError(PurchInvHeader: Record "Purch. Inv. Header", PurchInvLine: Record "Purch. Inv. Line", var ThrowItemReturnedError: Boolean)

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
PurchInvLine Table Microsoft.Purchases.History."Purch. Inv. Line"
ThrowItemReturnedError Boolean

OnAfterIsCheckDirectCostAppliedAccount

[IntegrationEvent(False,False)]
local procedure OnAfterIsCheckDirectCostAppliedAccount(PurchInvLine: Record "Purch. Inv. Line", var Result: Boolean)

Parameters

Name Type Description
PurchInvLine Table Microsoft.Purchases.History."Purch. Inv. Line"
Result Boolean

OnAfterCreateCopyDocument

[IntegrationEvent(False,False)]
local procedure OnAfterCreateCopyDocument(var PurchaseHeader: Record "Purchase Header", SkipCopyFromDescription: Boolean, PurchInvHeader: Record "Purch. Inv. Header")

Parameters

Name Type Description
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"
SkipCopyFromDescription Boolean
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"

OnBeforeShowPostedPurchCreditMemo

[IntegrationEvent(False,False)]
local procedure OnBeforeShowPostedPurchCreditMemo(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.", var IsHandled: Boolean)

Parameters

Name Type Description
PurchCrMemoHdr Table Microsoft.Purchases.History."Purch. Cr. Memo Hdr."
IsHandled Boolean

OnBeforeShowPurchaseCreditMemo

[IntegrationEvent(False,False)]
local procedure OnBeforeShowPurchaseCreditMemo(var PurchaseHeader: Record "Purchase Header", var IsHandled: Boolean)

Parameters

Name Type Description
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"
IsHandled Boolean

OnCreateCreditMemoOnBeforeConfirmPostingCreditMemoFailedOpen

[IntegrationEvent(False,False)]
local procedure OnCreateCreditMemoOnBeforeConfirmPostingCreditMemoFailedOpen(var PurchaseHeader: Record "Purchase Header", var IsHandled: Boolean)

Parameters

Name Type Description
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"
IsHandled Boolean

OnCancelPostedInvoiceStartNewInvoiceOnAfterCreateCorrPurchaseInvoice

[IntegrationEvent(False,False)]
local procedure OnCancelPostedInvoiceStartNewInvoiceOnAfterCreateCorrPurchaseInvoice(var PurchaseHeader: Record "Purchase Header", var PurchInvHeader: Record "Purch. Inv. Header")

Parameters

Name Type Description
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"

OnAfterIsCommentLine

[IntegrationEvent(False,False)]
local procedure OnAfterIsCommentLine(PurchInvLine: Record "Purch. Inv. Line", var Result: Boolean)

Parameters

Name Type Description
PurchInvLine Table Microsoft.Purchases.History."Purch. Inv. Line"
Result Boolean

OnBeforeSetTrackInfoForCancellation

[IntegrationEvent(False,False)]
local procedure OnBeforeSetTrackInfoForCancellation(var PurchInvHeader: Record "Purch. Inv. Header", var IsHandled: Boolean)

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
IsHandled Boolean

OnBeforeTestPurchaseInvoiceHeaderAmount

Obsolete

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

[Obsolete(OnBeforeTestPurchaseInvoiceHeaderAmount is not supported anymore.,25.0)]
[IntegrationEvent(False,False)]
local procedure OnBeforeTestPurchaseInvoiceHeaderAmount(var PurchInvHeader: Record "Purch. Inv. Header", Cancelling: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
PurchInvHeader Table Microsoft.Purchases.History."Purch. Inv. Header"
Cancelling Boolean
IsHandled Boolean

See also