Codeunit 441 "Prepayment Mgt."
Base Application · Microsoft.Finance.ReceivablesPayables
Across versions
- BC23-27present
- BC282 events added
- BC29-30unchanged
Neighbourhood 19 connected objects and pages
Base Application · Microsoft.Finance.ReceivablesPayables · BC23-30 · source at 4e6a307c · facts from BC29
Events published
OnBeforeUpdatePendingPrepaymentSales(var SalesHeader: Record "Sales Header")+ BC28 (integration): Integration event raised before pending prepayment sales orders are processed for release.OnAfterUpdatePendingPrepaymentSales(var SalesHeader: Record "Sales Header")+ BC28 (integration): Integration event raised after pending prepayment sales orders have been processed for release.OnBeforeTestSalesPrepayment(SalesHeader: Record "Sales Header"; var TestResult: Boolean; var IsHandled: Boolean)(integration): Integration event raised before testing sales prepayment requirements.OnBeforeTestPurchPrepayment(PurchHeader: Record "Purchase Header"; var TestResult: Boolean; var IsHandled: Boolean)(integration): Integration event raised before testing purchase prepayment requirements.OnBeforeTestSalesPayment(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)(integration): Integration event raised before testing sales payment status.OnBeforeTestPurchasePayment(PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean)(integration): Integration event raised before testing purchase payment status.OnTestSalesPaymentOnBeforeCustLedgerEntrySetFilter(var CustLedgerEntry: Record "Cust. Ledger Entry"; SalesHeader: Record "Sales Header"; SalesInvHeader: Record "Sales Invoice Header")(integration): Integration event raised before setting customer ledger entry filters in sales payment test.OnTestPurchasePaymentOnBeforeVendLedgerEntrySetFilter(var VendLedgerEntry: Record "Vendor Ledger Entry"; PurchaseHeader: Record "Purchase Header"; PurchInvHeader: Record "Purch. Inv. Header")(integration): Integration event raised before setting vendor ledger entry filters in purchase payment test.OnBeforeSetSalesPrepaymentPct(var SalesLine: Record "Sales Line"; Date: Date; var IsHandled: Boolean)(integration): Integration event raised before setting sales prepayment percentage.OnBeforeTestSalesOrderLineForGetShptLines(SalesLine: Record "Sales Line"; var IsHandled: Boolean)(integration): Integration event raised before testing sales order lines for get shipment lines operation.OnBeforeTestPurchaseOrderLineForGetRcptLines(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)(integration): Integration event raised before testing purchase order lines for get receipt lines operation.
Procedures
AssertPrepmtAmountNotMoreThanDocAmount(DocumentTotalInclVAT: Decimal; PrepmtTotalInclVAT: Decimal; CurrencyCode: Code[10]; InvoiceRoundingSetup: Boolean): Validates that prepayment amount does not exceed the total document amount including VAT. Applies invoice rounding if configured and throws error if prepayment exceeds document total.SetSalesPrepaymentPct(var SalesLine: Record "Sales Line"; Date: Date): Sets prepayment percentage on sales line based on customer and item prepayment configuration. Determines appropriate prepayment percentage from customer, item, or G/L account setup.SetPurchPrepaymentPct(var PurchLine: Record "Purchase Line"; Date: Date): Sets purchase prepayment percentage based on purchase prepayment setup. Updates purchase line prepayment percentage from purchase prepayment percentage configuration.TestSalesPrepayment(SalesHeader: Record "Sales Header"): Boolean: Tests if sales document has prepayment requirements. Validates whether sales order contains prepayment percentages that require prepayment invoice processing.TestPurchasePrepayment(PurchaseHeader: Record "Purchase Header"): Boolean: Tests if purchase document has prepayment requirements. Validates whether purchase order contains prepayment percentages that require prepayment invoice processing.TestSalesOrderLineForGetShptLines(SalesLine: Record "Sales Line"): Tests sales order line for compatibility with Get Shipment Lines function. Validates that sales line can be processed when using Get Shipment Lines with prepayment scenarios.TestPurchaseOrderLineForGetRcptLines(PurchaseLine: Record "Purchase Line"): Tests purchase order line for compatibility with Get Receipt Lines function. Validates that purchase line can be processed when using Get Receipt Lines with prepayment scenarios.TestSalesPayment(SalesHeader: Record "Sales Header"): Boolean: Tests if sales prepayment invoices are paid before posting.TestPurchasePayment(PurchaseHeader: Record "Purchase Header"): Boolean: Tests if purchase prepayment invoices are paid before posting.UpdatePendingPrepaymentSales(): Updates pending prepayment status for sales orders.UpdatePendingPrepaymentPurchase(): Updates pending prepayment status for purchase orders.CreateAndStartJobQueueEntrySales(UpdateFrequency: Option Never,Daily,Weekly): Creates and starts job queue entry for updating pending prepayment sales orders.CreateAndStartJobQueueEntryPurchase(UpdateFrequency: Option Never,Daily,Weekly): Creates and starts job queue entry for updating pending prepayment purchase orders.CreateAndStartJobQueueEntry(CodeunitID: Integer; UpdateFrequency: Option Never,Daily,Weekly; Category: Text): Creates and starts a job queue entry for automatic prepayment processing.
Plus 3 local procedures.
Triggers
OnRun
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 456 “Job Queue Management” (2 calls:
CreateAndStartJobQueueEntry → CreateJobQueueEntry,CreateAndStartJobQueueEntry → DeleteJobQueueEntries) - Codeunit 414 “Release Sales Document” (1 call:
UpdatePendingPrepaymentSales → (object)) - Codeunit 415 “Release Purchase Document” (1 call:
UpdatePendingPrepaymentPurchase → (object)) - Codeunit 453 “Job Queue - Enqueue” (1 call:
CreateAndStartJobQueueEntry → (object))
Called by
- Table 36 “Sales Header” (4 calls:
ApprovedForPostingBatch → TestSalesPayment,ApprovedForPostingBatch → TestSalesPrepayment,IsApprovedForPosting → TestSalesPayment, …) - Codeunit 414 “Release Sales Document” (3 calls:
CheckPrepaymentsForManualRelease → TestSalesPrepayment,Code → TestSalesPrepayment,PerformManualCheckAndRelease → TestSalesPayment) - Codeunit 415 “Release Purchase Document” (3 calls:
Code → TestPurchasePrepayment,PerformManualCheckAndRelease → TestPurchasePayment,PerformManualRelease → TestPurchasePrepayment) - Table 38 “Purchase Header” (3 calls:
ApprovedForPostingBatch → TestPurchasePayment,IsApprovedForPosting → TestPurchasePayment,TestPurchasePrepayment → TestPurchasePrepayment) - Codeunit 442 “Sales-Post Prepayments” (2 calls:
SalesAssertPrepmtAmountNotMoreThanDocAmount → AssertPrepmtAmountNotMoreThanDocAmount,SalesAssertPrepmtAmountNotMoreThanDocAmountBeforePost → AssertPrepmtAmountNotMoreThanDocAmount) - Codeunit 383 “Upd. Pending Prepmt. Sales” (1 call:
OnRun → UpdatePendingPrepaymentSales) - Codeunit 384 “Upd. Pending Prepmt. Purchase” (1 call:
OnRun → UpdatePendingPrepaymentPurchase) - Codeunit 444 “Purchase-Post Prepayments” (1 call:
PurchaseAssertPrepmtAmountNotMoreThanDocAmount → AssertPrepmtAmountNotMoreThanDocAmount) - Codeunit 5341 “CRM Int. Table. Subscriber” (1 call:
SetSalesOrderStatus → TestSalesPrepayment) - Codeunit 86 “Sales-Quote to Order” (1 call:
TransferQuoteToOrderLines → SetSalesPrepaymentPct) - Codeunit 87 “Blanket Sales Order to Order” (1 call:
CreateSalesOrderLines → SetSalesPrepaymentPct) - Codeunit 96 “Purch.-Quote to Order” (1 call:
TransferQuoteToOrderLines → SetPurchPrepaymentPct) - Codeunit 97 “Blanket Purch. Order to Order” (1 call:
OnRun → SetPurchPrepaymentPct) - Table 111 “Sales Shipment Line” (1 call:
InsertInvLineFromShptLine → TestSalesOrderLineForGetShptLines) - Table 121 “Purch. Rcpt. Line” (1 call:
InsertInvLineFromRcptLine → TestPurchaseOrderLineForGetRcptLines) - Table 37 “Sales Line” (1 call:
CopyFromItem → SetSalesPrepaymentPct) - Table 39 “Purchase Line” (1 call:
CopyFromItem → SetPurchPrepaymentPct)
Recent changes
- 2026-07-16 #9416 [ALAppExtensions #30313]codeunit 441 “Prepayment Mgt.” OnBeforeReleaseSalesDocument (main, BC30, feature)
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Prepayment differences in Russia — possibly related: Codeunit manages prepayment differences in multi-currency environments. (model-linked)
- Setting up vendor prepayments in Russia — possibly related: Prepayment Mgt handles vendor and customer prepayment setup and calculations. (model-linked)
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: "Prepayment Mgt."), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.