Codeunit 1313 "Correct Posted Purch. Invoice"
Base Application · Microsoft.Purchases.History
Across versions
- BC23present
- BC244 events added, 2 procedures added
- BC25declaration changed
- BC267 procedures added
- BC271 events added
- BC283 procedures added, 1 events removed
- BC29-30unchanged
Neighbourhood 19 connected objects and pages
Base Application · Microsoft.Purchases.History · BC23-30 · source at ea08af5e · facts from BC29
Properties
| Property | Value |
|---|---|
| TableNo | Purch. Inv. Header |
| Permissions | TableData “Purch. Inv. Header” = rm, TableData “Purch. Cr. Memo Hdr.” = rm |
Events published
OnAfterCreateCorrectivePurchCrMemo(PurchInvHeader: Record "Purch. Inv. Header"; var PurchaseHeader: Record "Purchase Header"; var CancellingOnly: Boolean; var SuppressCommit: Boolean)+ BC24 − BC24 (integration)OnAfterTestCorrectInvoiceIsAllowed(var PurchInvHeader: Record "Purch. Inv. Header"; Cancelling: Boolean)(integration)- subscribers: Codeunit 20535 “Subc. Purch. Post Ext” BlockCancelIfHasSubcontractingItemChargeValueEntry
OnBeforeCreateCopyDocument(var PurchInvHeader: Record "Purch. Inv. Header"; var PurchaseHeader: Record "Purchase Header"; DocumentType: Enum "Purchase Document Type"; SkipCopyFromDescription: Boolean)(integration)OnBeforeTestIfInvoiceIsPaid(var PurchInvHeader: Record "Purch. Inv. Header"; var IsHandled: Boolean)(integration)OnBeforeTestIfAnyFreeNumberSeries(var PurchInvHeader: Record "Purch. Inv. Header"; CancellingOnly: Boolean; var IsHandled: Boolean)(integration)OnBeforePurchaseHeaderInsert(var PurchaseHeader: Record "Purchase Header"; PurchInvHeader: Record "Purch. Inv. Header")(integration)OnBeforeUnAppyCostApplication(InvNo: Code[20]; var IsHandled: Boolean)(integration)OnBeforeUpdatePurchaseOrderLineInvoicedQuantity(var PurchaseLine: Record "Purchase Line"; CancelledQuantity: Decimal; CancelledQtyBase: Decimal; var IsHandled: Boolean)(integration)OnBeforeTestInventoryPostingSetup(PurchInvLine: Record "Purch. Inv. Line"; var IsHandled: Boolean)(integration)OnHasLineDiscountSetup(PurchasesPayablesSetup: Record "Purchases & Payables Setup"; var Result: Boolean)(integration)OnRunOnAfterUpdatePurchaseOrderLinesFromCancelledInvoice(var PurchInvHeader: Record "Purch. Inv. Header"; var PurchaseHeader: Record "Purchase Header")(integration)OnRunOnBeforeCreateCopyDocument(var PurchInvHeader: Record "Purch. Inv. Header")(integration)OnTestPurchaseLinesOnAfterCalcThrowItemReturnedError(PurchInvHeader: Record "Purch. Inv. Header"; PurchInvLine: Record "Purch. Inv. Line"; var ThrowItemReturnedError: Boolean)(integration)OnAfterIsCheckDirectCostAppliedAccount(PurchInvLine: Record "Purch. Inv. Line"; var Result: Boolean)(integration)OnAfterCreateCopyDocument(var PurchaseHeader: Record "Purchase Header"; SkipCopyFromDescription: Boolean; PurchInvHeader: Record "Purch. Inv. Header")(integration)- subscribers: Codeunit 5579 “Digital Voucher Impl.” CopyDigitalVoucherOnAfterCreateCopyPurchDocument, Codeunit 8074 “Document Change Management” RemoveBooleanKeyOnAfterCreateCopyPurchaseDocument
OnBeforeShowPostedPurchCreditMemo(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var IsHandled: Boolean)(integration)OnBeforeShowPurchaseCreditMemo(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)(integration)OnCreateCreditMemoOnBeforeConfirmPostingCreditMemoFailedOpen(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)(integration)OnCancelPostedInvoiceStartNewInvoiceOnAfterCreateCorrPurchaseInvoice(var PurchaseHeader: Record "Purchase Header"; var PurchInvHeader: Record "Purch. Inv. Header")+ BC24 (integration)OnAfterIsCommentLine(PurchInvLine: Record "Purch. Inv. Line"; var Result: Boolean)+ BC24 (integration)OnBeforeSetTrackInfoForCancellation(var PurchInvHeader: Record "Purch. Inv. Header"; var IsHandled: Boolean)+ BC24 (integration)OnBeforeTestVATPostingSetup(PurchInvLine: Record "Purch. Inv. Line"; var IsHandled: Boolean)+ BC27 (integration)
Procedures
CancelPostedInvoice(var PurchInvHeader: Record "Purch. Inv. Header"): BooleanCreateCreditMemoCopyDocument(var PurchInvHeader: Record "Purch. Inv. Header"; var PurchaseHeader: Record "Purchase Header"): BooleanCreateCorrectiveCreditMemo(var InvoiceNotification: Notification)ShowAppliedEntries(var InvoiceNotification: Notification)SkipCorrectiveCreditMemo(var InvoiceNotification: Notification)CancelPostedInvoiceStartNewInvoice(var PurchInvHeader: Record "Purch. Inv. Header"; var PurchaseHeader: Record "Purchase Header")TestCorrectInvoiceIsAllowed(var PurchInvHeader: Record "Purch. Inv. Header"; Cancelling: Boolean)FindItemLedgEntries(var ItemLedgEntry: Record "Item Ledger Entry"; InvNo: Code[20])ErrorHelperHeader(HeaderErrorType: Enum "Correct Purch. Inv. Error Type"; PurchInvHeader: Record "Purch. Inv. Header")UpdatePurchaseOrderLineIfExist(PurchaseCreditMemoNo: Code[20])+ BC26 (internal)
Plus 43 local procedures.
Triggers
OnRun
Relations
- runs on Table 122 “Purch. Inv. Header”
Calls
From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an Object::"Name" argument. Interface dispatch and calls through events are not counted, so the list is not complete.
- Codeunit 408 “DimensionManagement” (5 calls:
TestDimensionOnHeader → CheckDimIDComb,TestGLAccount → CheckDimValuePosting,TestPurchaseLines → CheckDimIDComb, …) - Codeunit 6620 “Copy Document Mgt.” (3 calls:
CreateCopyDocument → CopyPurchaseDocForInvoiceCancelling,CreateCopyDocument → SetPropertiesForCorrectiveCreditMemo,CreateCopyDocument → SetPropertiesForInvoiceCorrection) - Codeunit 22 “Item Jnl.-Post Line” (2 calls:
OnRun → RedoApplications,UnapplyCostApplication → UnApply) - Codeunit 5817 “Undo Posting Management” (2 calls:
UpdatePurchaseOrderLinesFromCancelledInvoice → RevertPostedItemTracking,UpdatePurchaseOrderLinesFromCreditMemo → RevertPostedItemTracking) - Page 456 “No. Series” (2 calls:
OnRun → (object),TryPeekNextNo → (object)) - Page 52 “Purchase Credit Memo” (2 calls:
CreateCorrectiveCreditMemo → (object),CreateCreditMemo → (object)) - Codeunit 11 “Gen. Jnl.-Check Line” (1 call:
TestIfPostingIsAllowed → DateNotAllowed) - Codeunit 1511 “Notification Lifecycle Mgt.” (1 call:
ShowInvoiceAppliedNotification → SendNotification) - Codeunit 5805 “Item Charge Assgnt. (Purch.)” (1 call:
UpdateReverseItemChargeAssignment → ReverseItemChargeAssgnt) - Codeunit 90 “Purch.-Post” (1 call:
OnRun → (object)) - Page 140 “Posted Purchase Credit Memo” (1 call:
CreateCreditMemo → (object)) - Page 62 “Applied Vendor Entries” (1 call:
ShowAppliedEntries → (object))
Called by
- Codeunit 1324 “Correct PstdPurchInv (Yes/No)” (4 calls:
CancelPostedInvoice → CancelPostedInvoice,CancelPostedInvoiceAndOpenNewPurchaseInvoice → CancelPostedInvoiceStartNewInvoice,CancelPostedInvoiceAndOpenPurchaseOrder → CancelPostedInvoice, …) - Codeunit 1325 “Cancel PstdPurchInv (Yes/No)” (2 calls:
CancelInvoice → CancelPostedInvoice,CancelInvoice → TestCorrectInvoiceIsAllowed) - Table 38 “Purchase Header” (1 call:
UpdatePurchaseOrderLineIfExist → UpdatePurchaseOrderLineIfExist)
Recent changes
- 2026-08-07 #9985 [Master]-For an Item of ‘Type’ Service or Non-Inventory we allow you to increase the Quantity of the Corrective Credit Memo which then if posted updates the Purchase Order with a negative Received and Invoiced values (main, BC30, fix)
Countries that replace it
Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).
Ask your agent
Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: bcatlas_resolve_node(object_type: "codeunit", object_name: "Correct Posted Purch. Invoice"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.