---
id: object/codeunit/426
type: object
title: Codeunit 426 "Payment Tolerance Management"
summary: Codeunit 426 "Payment Tolerance Management" in Base Application (Microsoft.Finance.ReceivablesPayables). 36 public procedures, 49 events. Present since at least BC23, still in BC30, changed in BC25-28.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "28"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: 8da28028b3459038ce9f16af1d5897608bd853caea13902fbc93da91fc829af3
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Finance/ReceivablesPayables/PaymentToleranceManagement.Codeunit.al
    title: src/Layers/W1/BaseApp/Finance/ReceivablesPayables/PaymentToleranceManagement.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations:
    - localization/ch
    - localization/fr
    - localization/it
    - localization/nl
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/9789
    - change/bcapps/9051
object_type: codeunit
object_id: 426
name: Payment Tolerance Management
namespace: Microsoft.Finance.ReceivablesPayables
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "25"
  - "26"
  - "27"
  - "28"
source_major: "29"
obsolete: null
countries:
  - ch
  - fr
  - it
  - nl
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 118
  events: 49
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 3
  called_by: 14
  implements: 0
---

# Codeunit 426 "Payment Tolerance Management"

> Codeunit 426 "Payment Tolerance Management" in Base Application (Microsoft.Finance.ReceivablesPayables). 36 public procedures, 49 events. Present since at least BC23, still in BC30, changed in BC25-28.

Base Application · Microsoft.Finance.ReceivablesPayables · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Finance/ReceivablesPayables/PaymentToleranceManagement.Codeunit.al) · facts from BC29

## Properties

| Property | Value |
|---|---|
| Permissions | TableData Currency = r, TableData "Cust. Ledger Entry" = rim, TableData "Vendor Ledger Entry" = rim, TableData "Gen. Journal Line" = rim, TableData "General Ledger Setup" = r |

## Events published

- `OnAfterCalcMaxPmtTolerance(DocumentType: Option " ",Payment,Invoice,"Credit Memo","Finance Charge Memo",Reminder,Refund; CurrencyCode: Code[10]; Amount: Decimal; AmountLCY: Decimal; Sign: Decimal; var MaxPaymentTolerance: Decimal)` (integration): Integration event raised after calculating maximum payment tolerance amount. Enables custom calculation of maximum tolerance amounts based on business rules.
- `OnAfterDelPmtTolApllnDocNo(var GenJournalLine: Record "Gen. Journal Line"; DocumentNo: Code[20]; SuppressCommit: Boolean)` (integration): Integration event raised after deleting payment tolerance application document number. Enables custom cleanup operations following tolerance application removal.
- `OnAfterPmtTolGenJnl(GenJournalLine: Record "Gen. Journal Line"; SuppressCommit: Boolean; var Result: Boolean)` (integration): Integration event raised after processing payment tolerance for general journal lines. Enables custom post-processing logic following tolerance calculations.
- `OnAfterPmtTolPmtReconJnl(var BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line"; SuppressCommit: Boolean; var Result: Boolean)` (integration): Integration event raised after processing payment tolerance for payment reconciliation journal. Enables custom processing for bank reconciliation tolerance scenarios.
- `OnBeforeCalcMaxPmtTolerance(DocumentType: Option " ",Payment,Invoice,"Credit Memo","Finance Charge Memo",Reminder,Refund; CurrencyCode: Code[10]; Amount: Decimal; AmountLCY: Decimal; Sign: Decimal; var MaxPaymentTolerance: Decimal; var IsHandled: Boolean)` (integration): Integration event raised before calculating maximum payment tolerance amount. Enables custom tolerance calculation logic to override standard processing.
- `OnBeforeCalcRemainingPmtDisc(var NewCVLedgEntryBuf: Record "CV Ledger Entry Buffer"; var OldCVLedgEntryBuf: Record "CV Ledger Entry Buffer"; var OldCVLedgEntryBuf2: Record "CV Ledger Entry Buffer"; GLSetup: Record "General Ledger Setup"; var Handled: Boolean)` (integration): Integration event raised before calculating remaining payment discount for CV ledger entries. Enables custom payment discount calculation logic in tolerance scenarios.
- `OnBeforeCallPmtDiscTolWarning(PostingDate: Date; No: Code[20]; DocNo: Code[20]; CurrencyCode: Code[10]; Amount: Decimal; AppliedAmount: Decimal; PmtDiscAmount: Decimal; var RemainingAmountTest: Boolean; AccountType: Option Customer,Vendor; var ActionType: Integer; var Result: Boolean; var IsHandled: Boolean; SuppressCommit: Boolean)` (integration): Integration event raised before displaying payment discount tolerance warning dialog. Enables custom validation logic before showing tolerance warnings to users.
- `OnBeforeCheckCalcPmtDisc(var NewCVLedgEntryBuf: Record "CV Ledger Entry Buffer"; var OldCVLedgEntryBuf2: Record "CV Ledger Entry Buffer"; ApplnRoundingPrecision: Decimal; CheckFilter: Boolean; CheckAmount: Boolean; var Handled: Boolean; var Result: Boolean)` (integration): Integration event raised before calculating and checking payment discount for CV ledger entries. Enables custom discount validation logic before standard processing.
- `OnBeforeCheckPmtDiscTolCust(NewPostingdate: Date; NewDocType: Enum "Gen. Journal Document Type"; NewAmount: Decimal; OldCustLedgEntry: Record "Cust. Ledger Entry"; ApplnRoundingPrecision: Decimal; MaxPmtTolAmount: Decimal; var IsHandled: Boolean; var Result: Boolean)` (integration): Integration event raised before checking payment discount tolerance for customer ledger entries. Enables custom validation logic for customer-specific tolerance scenarios.
- `OnBeforeCheckPmtDiscTolVend(NewPostingdate: Date; NewDocType: Enum "Gen. Journal Document Type"; NewAmount: Decimal; OldVendLedgEntry: Record "Vendor Ledger Entry"; ApplnRoundingPrecision: Decimal; MaxPmtTolAmount: Decimal; var IsHandled: Boolean; var Result: Boolean)` (integration): Integration event raised before checking payment discount tolerance for vendor ledger entries. Enables custom validation logic for vendor-specific tolerance scenarios.
- `OnBeforeDelPmtTolApllnDocNo(var GenJournalLine: Record "Gen. Journal Line")` (integration): Integration event raised before deleting payment tolerance application document number. Enables custom validation before tolerance application removal.
- `OnBeforeRunModalPmtTolWarningCallPmtTolWarning(PostingDate: Date; No: Code[20]; DocNo: Code[20]; CurrencyCode: Code[10]; var Amount: Decimal; AppliedAmount: Decimal; AccountType: Option Customer,Vendor; var ActionType: Integer; var IsHandled: Boolean)` (integration): Integration event raised before showing modal payment tolerance warning dialog. Enables custom logic before displaying tolerance warnings to users.
- `OnCalcCustApplnAmountOnBeforeUpdateCustAmountsForApplication(var AppliedCustLedgerEntry: Record "Cust. Ledger Entry"; var CustLedgerEntry: Record "Cust. Ledger Entry"; var AppliedCustLedgerEntryTemp: Record "Cust. Ledger Entry" temporary)` (integration): Integration event raised before updating customer amounts for application in tolerance scenarios. Enables custom modification of customer application amounts.
- `OnCalcCustApplnAmountOnAfterAppliedCustLedgEntryLoop(var AppliedCustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after looping through applied customer ledger entries. Enables custom processing after customer application amount calculations.
- `OnCalcVendApplnAmountOnBeforeUpdateVendAmountsForApplication(var AppliedVendorLedgerEntry: Record "Vendor Ledger Entry"; var VendoerLedgerEntry: Record "Vendor Ledger Entry"; var AppliedVendorLedgerEntryTemp: Record "Vendor Ledger Entry" temporary)` (integration): Integration event raised before updating vendor amounts for application in tolerance scenarios. Enables custom modification of vendor application amounts.
- `OnCalcVendApplnAmountOnAfterAppliedVendLedgEntryLoop(var AppliedVendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after looping through applied vendor ledger entries. Enables custom processing after vendor application amount calculations.
- `OnCalcTolCustLedgEntryOnBeforeModify(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised before modifying customer ledger entry during tolerance calculations. Enables custom validation or modification before tolerance updates.
- `OnCalcTolVendLedgEntryOnBeforeModify(var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before modifying vendor ledger entry during tolerance calculations. Enables custom validation or modification before tolerance updates.
- `OnCalcTolCustLedgEntryOnCustLedgEntryLoopIterationStart(CustLedgerEntry: Record "Cust. Ledger Entry"; GeneralLedgerSetup: Record "General Ledger Setup"; var IsHandled: Boolean)` (integration): Integration event raised at start of customer ledger entry loop iteration during tolerance calculation. Enables custom processing or skipping of specific customer entries.
- `OnGetAccountNameOnCaseElse(AccountType: Enum "Payment Tolerance Account Type"; AccountNo: Code[20]; var Result: text)` (integration): Integration event raised for custom account name resolution in tolerance scenarios. Enables custom account name determination for payment tolerance account types.
- `OnPmtTolCustOnAfterSetCustEntryApplId(var CustLedgerEntry: Record "Cust. Ledger Entry"; var CustEntryApplId: code[50])` (integration): Integration event raised after setting customer entry application ID for payment tolerance. Enables custom handling of customer application identifiers.
- `OnPmtTolVendOnAfterSetVendEntryApplId(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var VendEntryApplId: code[50])` (integration): Integration event raised after setting vendor entry application ID for payment tolerance. Enables custom handling of vendor application identifiers.
- `OnPutCustPmtTolAmountOnAfterAppliedCustLedgEntrySetFilters(var AppliedCustLedgerEntry: Record "Cust. Ledger Entry"; CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after setting filters on applied customer ledger entries for tolerance amounts. Enables custom filter modification for customer payment tolerance calculations.
- `OnPutVendPmtTolAmountOnAfterVendLedgEntrySetFilters(var AppliedVendorLedgerEntry: Record "Vendor Ledger Entry"; VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after setting filters on vendor ledger entries for tolerance amounts. Enables custom filter modification for vendor payment tolerance calculations.
- `OnCalcGracePeriodCVLedgEntryOnBeforeCustLedgEntryModify(var CustLedgerEntry: Record "Cust. Ledger Entry"; PmtTolGracePeriode: DateFormula)` (integration): Integration event raised before modifying customer ledger entry during grace period calculations. Enables custom validation before grace period tolerance updates.
- `OnCalcGracePeriodCVLedgEntryOnBeforeVendLedgEntryModify(var VendorLedgerEntry: Record "Vendor Ledger Entry"; PmtTolGracePeriode: DateFormula)` (integration): Integration event raised before modifying vendor ledger entry during grace period calculations. Enables custom validation before grace period tolerance updates.
- `OnDelTolCustLedgEntryOnBeforeModify(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised before modifying customer ledger entry during tolerance deletion. Enables custom validation before removing customer tolerance entries.
- `OnDelTolVendLedgEntryOnBeforeModify(var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before modifying vendor ledger entry during tolerance deletion. Enables custom validation before removing vendor tolerance entries.
- `OnPmtTolGenJnlOnAfterCheckConditions(GenJournalLine: Record "Gen. Journal Line"; var SuppressCommit: Boolean; var Result: Boolean)` (integration): Integration event raised after checking conditions for payment tolerance in general journal processing. Enables custom post-validation logic following tolerance condition checks.
- `OnCalcCustApplnAmountAfterCalcRemainingAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after calculating remaining amount in customer application scenarios. Enables custom processing following customer application amount calculations.
- `OnCalcVendApplnAmountAfterCalcRemainingAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after calculating remaining amount in vendor application scenarios. Enables custom processing following vendor application amount calculations.
- `OnManagePaymentDiscToleranceWarningCustomerAfterCalcRemainingAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after calculating remaining amount for customer payment discount tolerance warnings. Enables custom processing following customer discount tolerance calculations.
- `OnManagePaymentDiscToleranceWarningVendorAfterCalcRemainingAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after calculating remaining amount for vendor payment discount tolerance warnings. Enables custom processing following vendor discount tolerance calculations.
- `OnPmtTolCustBeforeCalcCustApplnAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised before calculating customer application amount in payment tolerance scenarios. Enables custom pre-processing of customer tolerance calculations.
- `OnPmtTolVendBeforeCalcVendApplnAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised before calculating vendor application amount in payment tolerance scenarios. Enables custom pre-processing of vendor tolerance calculations.
- `OnPutCustPmtTolAmountAfterCalcAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after calculating customer payment tolerance amount. Enables custom post-processing following customer tolerance amount calculations.
- `OnPutVendPmtTolAmountAfterCalcAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after calculating vendor payment tolerance amount. Enables custom post-processing following vendor tolerance amount calculations.
- `OnUpdateCustAmountsForApplicationAfterCalcRemainingAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after calculating remaining amount for customer application updates. Enables custom processing following customer amount updates for application.
- `OnUpdateVendAmountsForApplicationAfterCalcRemainingAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry")` (integration): Integration event raised after calculating remaining amount for vendor application updates. Enables custom processing following vendor amount updates for application.
- `OnPmtTolCustLedgEntryOnBeforeWarning(var CustledgEntry: Record "Cust. Ledger Entry"; GLSetup: Record "General Ledger Setup"; var AppliedAmount: Decimal; var ApplyingAmount: Decimal; var AmounttoApply: Decimal; var PmtDiscAmount: Decimal; var MaxPmtTolAmount: Decimal; CustEntryApplID: Code[50]; var ApplnRoundingPrecision: Decimal; var IsHandled: Boolean; var Result: Boolean)` (integration): Integration event raised before showing warning for customer payment tolerance ledger entries. Enables custom validation and modification before displaying tolerance warnings.
- `OnPmtTolVendLedgEntryOnBeforeWarning(var VendledgEntry: Record "Vendor Ledger Entry"; GLSetup: Record "General Ledger Setup"; var AppliedAmount: Decimal; var ApplyingAmount: Decimal; var AmounttoApply: Decimal; var PmtDiscAmount: Decimal; var MaxPmtTolAmount: Decimal; VendEntryApplID: Code[50]; var ApplnRoundingPrecision: Decimal; var IsHandled: Boolean; var Result: Boolean)` (integration): Integration event raised before showing warning for vendor payment tolerance ledger entries. Enables custom validation and modification before displaying vendor tolerance warnings.
- `OnBeforeCheckPmtTolCust(var NewDocType: Enum "Gen. Journal Document Type"; var OldCustLedgEntry: Record "Cust. Ledger Entry"; var IsHandled: Boolean; var Result: Boolean)` (integration): Integration event raised before checking customer payment tolerance scenarios. Enables custom validation logic before standard customer tolerance checking.
- `OnBeforeDelCustPmtTolAcc2(CustledgEntry: Record "Cust. Ledger Entry"; CustEntryApplID: Code[50]; var IsHandled: Boolean)` (integration): Integration event raised before deleting customer payment tolerance account entries. Enables custom validation before customer tolerance account deletion.
- `OnBeforeGetCustPositiveFilter(DocumentType: Enum "Gen. Journal Document Type"; TempAmount: Decimal; var IsHandled: Boolean; var PositiveFilter: Boolean)` (integration): Integration event raised before determining customer positive filter for payment tolerance. Enables custom logic for customer positive amount filtering.
- `OnCalcGracePeriodCVLedgEntryOnAfterCustLedgEntrySetFilters(var CustLedgEntry: Record "Cust. Ledger Entry")` (integration): Integration event raised after setting filters on customer ledger entries during grace period calculations. Enables custom filter modification for customer grace period processing.
- `OnPmtTolCustOnAfterSetPaymentTolWarning(GLSetup: Record "General Ledger Setup"; var PaymentTolWarning: Boolean)` (integration): Integration event raised after setting payment tolerance warning flag in customer scenarios. Enables custom handling of payment tolerance warnings for customers.
- `OnPmtTolVendOnAfterSetPaymentTolWarning(GLSetup: Record "General Ledger Setup"; var PaymentTolWarning: Boolean)` (integration): Integration event raised after setting payment tolerance warning flag in vendor scenarios. Enables custom handling of payment tolerance warnings for vendors.
- `OnPmtTolCustLedgEntryOnAfterSetPaymentTolWarning(GLSetup: Record "General Ledger Setup"; var PaymentTolWarning: Boolean)` (integration): Integration event raised after setting payment tolerance warning flag in customer ledger entry processing. Enables custom handling of payment tolerance warnings for customer ledger entries.
- `OnPmtTolVendLedgEntryOnAfterSetPaymentTolWarning(GLSetup: Record "General Ledger Setup"; var PaymentTolWarning: Boolean)` (integration): Integration event raised after setting payment tolerance warning flag in vendor ledger entry processing. Enables custom handling of payment tolerance warnings for vendor ledger entries.

## Procedures

- `PmtTolCust(var CustLedgEntry: Record "Cust. Ledger Entry"): Boolean`: Validates payment tolerance for customer ledger entries and shows tolerance warning if needed. Calculates tolerance amounts and displays confirmation dialog for tolerance processing.
- `PmtTolVend(var VendLedgEntry: Record "Vendor Ledger Entry"): Boolean`: Validates payment tolerance for vendor ledger entries and shows tolerance warning if needed. Calculates tolerance amounts and displays confirmation dialog for tolerance processing.
- `PmtTolGenJnl(var NewGenJnlLine: Record "Gen. Journal Line"): Boolean`: Validates payment tolerance for general journal line payments. Determines if tolerance warnings should be shown for customer and vendor payments.
- `PmtTolPmtReconJnl(var NewBankAccReconciliationLine: Record "Bank Acc. Reconciliation Line"): Boolean`: Processes payment tolerance for bank account reconciliation lines. Determines whether payment tolerance should be applied based on account type.
- `CalcCustApplnAmount(CustledgEntry: Record "Cust. Ledger Entry"; GLSetup: Record "General Ledger Setup"; var AppliedAmount: Decimal; var ApplyingAmount: Decimal; var AmounttoApply: Decimal; var PmtDiscAmount: Decimal; var MaxPmtTolAmount: Decimal; CustEntryApplID: Code[50]; var ApplnRoundingPrecision: Decimal)` (internal)
- `CalcVendApplnAmount(VendledgEntry: Record "Vendor Ledger Entry"; GLSetup: Record "General Ledger Setup"; var AppliedAmount: Decimal; var ApplyingAmount: Decimal; var AmounttoApply: Decimal; var PmtDiscAmount: Decimal; var MaxPmtTolAmount: Decimal; VendEntryApplID: Code[50]; var ApplnRoundingPrecision: Decimal)` (internal)
- `CallPmtDiscTolWarning(PostingDate: Date; No: Code[20]; DocNo: Code[20]; CurrencyCode: Code[10]; Amount: Decimal; AppliedAmount: Decimal; PmtDiscAmount: Decimal; var RemainingAmountTest: Boolean; AccountType: Enum "Payment Tolerance Account Type"): Boolean`: Displays payment discount tolerance warning dialog and handles user response. Calculates whether payment discount tolerance should be applied based on user choice.
- `CallPmtTolWarning(PostingDate: Date; No: Code[20]; DocNo: Code[20]; CurrencyCode: Code[10]; var Amount: Decimal; AppliedAmount: Decimal; AccountType: Enum "Payment Tolerance Account Type"): Boolean`: Displays payment tolerance warning dialog and processes user response. Allows user to accept or reject payment tolerance amounts for transactions.
- `PutCustPmtTolAmount(CustledgEntry: Record "Cust. Ledger Entry"; Amount: Decimal; AppliedAmount: Decimal; CustEntryApplID: Code[50])` (internal)
- `PutVendPmtTolAmount(VendLedgEntry: Record "Vendor Ledger Entry"; Amount: Decimal; AppliedAmount: Decimal; VendEntryApplID: Code[50])` (internal)
- `DelCustPmtTolAcc(CustledgEntry: Record "Cust. Ledger Entry"; CustEntryApplID: Code[50])` (internal)
- `DelVendPmtTolAcc(VendLedgEntry: Record "Vendor Ledger Entry"; VendEntryApplID: Code[50])` (internal)
- `CalcGracePeriodCVLedgEntry(PmtTolGracePeriode: DateFormula)`: Calculates and updates payment tolerance grace period for all open customer and vendor ledger entries. Processes entries that fall within the specified grace period for payment tolerance.
- `CalcTolCustLedgEntry(Customer: Record Customer)`: Calculates payment tolerance for customer ledger entries. Updates customer ledger entries with payment tolerance amounts based on General Ledger setup and currency configuration.
- `DelTolCustLedgEntry(Customer: Record Customer)`: Deletes payment tolerance settings for customer ledger entries. Resets payment tolerance amount and maximum payment tolerance to zero for the specified customer.
- `CalcTolVendLedgEntry(Vendor: Record Vendor)`: Calculates payment tolerance for vendor ledger entries. Updates vendor ledger entries with payment tolerance amounts based on General Ledger setup and currency configuration.
- `DelTolVendLedgEntry(Vendor: Record Vendor)`: Deletes payment tolerance settings for vendor ledger entries. Resets payment tolerance amount and maximum payment tolerance to zero for the specified vendor.
- `DelPmtTolApllnDocNo(GenJnlLine: Record "Gen. Journal Line"; DocumentNo: Code[20])`: Deletes payment tolerance for applications with the specified document number. Removes tolerance settings from customer or vendor ledger entries based on account type in the general journal line.
- `ABSMinTol(Decimal1: Decimal; Decimal2: Decimal; Decimal1Tolerance: Decimal): Decimal`: Returns the decimal value with minimum absolute value considering tolerance. Compares two decimal values and returns the one with the smaller absolute value after applying tolerance.
- `GetApplicationRoundingPrecisionForAppliesToDoc(AppliedEntryCurrencyCode: Code[10]; var ApplnRoundingPrecision: Decimal; var AmountRoundingPrecision: Decimal; ApplnCurrencyCode: Code[20])`: Gets application rounding precision for applies-to document currency operations. Determines rounding precision values based on applied entry and application currency codes.
- `GetAmountRoundingPrecision(var ApplnRoundingPrecision: Decimal; var AmountRoundingPrecision: Decimal; ApplnInMultiCurrency: Boolean; ApplnCurrencyCode: Code[20])`: Gets amount rounding precision for multi-currency applications. Determines application and amount rounding precision based on currency and multi-currency settings.
- `CalcRemainingPmtDisc(var NewCVLedgEntryBuf: Record "CV Ledger Entry Buffer"; var OldCVLedgEntryBuf: Record "CV Ledger Entry Buffer"; var OldCVLedgEntryBuf2: Record "CV Ledger Entry Buffer"; GLSetup: Record "General Ledger Setup")`: Calculates remaining payment discount for CV ledger entry buffers. Updates payment discount amounts and remaining payment discount possible fields based on application scenarios.
- `CalcMaxPmtTolerance(DocumentType: Enum "Gen. Journal Document Type"; CurrencyCode: Code[10]; Amount: Decimal; AmountLCY: Decimal; Sign: Decimal; var MaxPaymentTolerance: Decimal)`: Calculates maximum payment tolerance for a document. Determines payment tolerance amount based on document type, currency, amount, and General Ledger setup configuration.
- `CheckCalcPmtDisc(var NewCVLedgEntryBuf: Record "CV Ledger Entry Buffer"; var OldCVLedgEntryBuf2: Record "CV Ledger Entry Buffer"; ApplnRoundingPrecision: Decimal; CheckFilter: Boolean; CheckAmount: Boolean): Boolean`: Checks and calculates payment discount for CV ledger entry buffers. Validates payment discount eligibility and calculates discount amounts based on application parameters.
- `CheckCalcPmtDiscCVCust(var NewCVLedgEntryBuf: Record "CV Ledger Entry Buffer"; var OldCustLedgEntry2: Record "Cust. Ledger Entry"; ApplnRoundingPrecision: Decimal; CheckFilter: Boolean; CheckAmount: Boolean): Boolean`: Checks and calculates payment discount for CV ledger entry buffer against customer ledger entry. Validates payment discount eligibility between CV buffer and customer entries.
- `CheckCalcPmtDiscCust(var NewCustLedgEntry: Record "Cust. Ledger Entry"; var OldCustLedgEntry2: Record "Cust. Ledger Entry"; ApplnRoundingPrecision: Decimal; CheckFilter: Boolean; CheckAmount: Boolean): Boolean`: Checks and calculates payment discount between customer ledger entries. Validates payment discount eligibility between new and existing customer ledger entries.
- `CheckCalcPmtDiscGenJnlCust(GenJnlLine: Record "Gen. Journal Line"; OldCustLedgEntry2: Record "Cust. Ledger Entry"; ApplnRoundingPrecision: Decimal; CheckAmount: Boolean): Boolean`: Checks and calculates payment discount for general journal line against customer ledger entry. Validates payment discount eligibility between journal line and customer entry.
- `CheckCalcPmtDiscCVVend(var NewCVLedgEntryBuf: Record "CV Ledger Entry Buffer"; var OldVendLedgEntry2: Record "Vendor Ledger Entry"; ApplnRoundingPrecision: Decimal; CheckFilter: Boolean; CheckAmount: Boolean): Boolean`: Checks and calculates payment discount for CV ledger entry buffer against vendor ledger entry. Validates payment discount eligibility between CV buffer and vendor entries.
- `CheckCalcPmtDiscVend(var NewVendLedgEntry: Record "Vendor Ledger Entry"; var OldVendLedgEntry2: Record "Vendor Ledger Entry"; ApplnRoundingPrecision: Decimal; CheckFilter: Boolean; CheckAmount: Boolean): Boolean`: Checks and calculates payment discount between vendor ledger entries. Validates payment discount eligibility between new and existing vendor ledger entries.
- `CheckCalcPmtDiscGenJnlVend(GenJnlLine: Record "Gen. Journal Line"; OldVendLedgEntry2: Record "Vendor Ledger Entry"; ApplnRoundingPrecision: Decimal; CheckAmount: Boolean): Boolean`: Checks and calculates payment discount for general journal line against vendor ledger entry. Validates payment discount eligibility between journal line and vendor entry.
- `ManagePaymentDiscToleranceWarningCustomer(var NewCustLedgEntry: Record "Cust. Ledger Entry"; GenJnlLineApplID: Code[50]; var AppliedAmount: Decimal; var AmountToApply: Decimal; AppliesToDocNo: Code[20]): Boolean` (internal)
- `ManagePaymentDiscToleranceWarningVendor(var NewVendLedgEntry: Record "Vendor Ledger Entry"; GenJnlLineApplID: Code[50]; var AppliedAmount: Decimal; var AmountToApply: Decimal; AppliesToDocNo: Code[20]): Boolean` (internal)
- `SetSuppressCommit(NewSuppressCommit: Boolean)`: Sets whether database commit operations should be suppressed during payment tolerance processing. Used to control transaction behavior in batch processing scenarios.
- `SetSuppressWarning(NewSuppressWarning: Boolean)`: Sets whether warning dialogs should be suppressed during payment tolerance processing. Used to control user interaction during automated processing scenarios.
- `CheckAccountType(GenJnlLine: Record "Gen. Journal Line"; AccountType: Enum "Gen. Journal Account Type")`: Validates that the specified account type matches the account type or balance account type in the general journal line. Ensures proper account type validation for payment tolerance operations.
- `GetAppliesToID(GenJnlLine: Record "Gen. Journal Line"): Code[50]`: Gets the applies-to ID from the general journal line for payment application. Returns the applies-to ID if no specific document number is specified.

Plus 33 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 19 "Gen. Jnl.-Post Preview"](../codeunit/19.md) (4 calls: `CallPmtDiscTolWarning → IsActive`, `CallPmtTolWarning → IsActive`, `PurchPmtTolGenJnl → IsActive`, …)
- [Codeunit 366 "Exchange Acc. G/L Journal Line"](../codeunit/366.md) (3 calls: `DelPmtTolApllnDocNo → (object)`, `IsCustBlockPmtToleranceInGenJnlLine → (object)`, `IsVendBlockPmtToleranceInGenJnlLine → (object)`)
- [Codeunit 710 "Math"](../codeunit/710.md) (1 call: `GetMinTolAmountByAbsValue → (object)`)

## Called by

- [Codeunit 225 "Gen. Jnl.-Apply"](../codeunit/225.md) (10 calls: `ApplyCustomerLedgerEntry → CheckCalcPmtDiscGenJnlCust`, `ApplyCustomerLedgerEntry → DelPmtTolApllnDocNo`, `ApplyCustomerLedgerEntry → PmtTolGenJnl`, …)
- [Codeunit 12 "Gen. Jnl.-Post Line"](../codeunit/12.md) (6 calls: `CalcPmtDisc → CheckCalcPmtDisc`, `CalcPmtTolerancePossible → CalcMaxPmtTolerance`, `FindAmtForAppln → CheckCalcPmtDisc`, …)
- [Table 81 "Gen. Journal Line"](../table/81.md) (5 calls: `CheckPaymentTolerance → PmtTolGenJnl`, `SetAmountWithCustLedgEntry → CheckCalcPmtDiscGenJnlCust`, `SetAmountWithVendLedgEntry → CheckCalcPmtDiscGenJnlVend`, …)
- [Page 232 "Apply Customer Entries"](../page/232.md) (3 calls: `CalcApplnAmount → CheckCalcPmtDiscGenJnlCust`, `HandleChosenEntries → CheckCalcPmtDiscCust`, `HandleChosenEntries → CheckCalcPmtDiscGenJnlCust`)
- [Page 233 "Apply Vendor Entries"](../page/233.md) (3 calls: `CalcApplnAmount → CheckCalcPmtDiscGenJnlVend`, `HandleChosenEntries → CheckCalcPmtDiscGenJnlVend`, `HandleChosenEntries → CheckCalcPmtDiscVend`)
- [Page 5939 "Serv. Apply Customer Entries"](../page/5939.md) (3 calls: `CalcApplnAmount → CheckCalcPmtDiscGenJnlCust`, `HandleChosenEntries → CheckCalcPmtDiscCust`, `HandleChosenEntries → CheckCalcPmtDiscGenJnlCust`)
- [Codeunit 20112 "AMC Bank Exp. CT Pre-Map"](../codeunit/20112.md) (2 calls: `GetCVLedgerEntry → CheckCalcPmtDiscGenJnlCust`, `GetCVLedgerEntry → CheckCalcPmtDiscGenJnlVend`)
- [Codeunit 226 "CustEntry-Apply Posted Entries"](../codeunit/226.md) (2 calls: `Apply → PmtTolCust`, `PreviewApply → PmtTolCust`)
- [Codeunit 227 "VendEntry-Apply Posted Entries"](../codeunit/227.md) (2 calls: `Apply → PmtTolVend`, `PreviewApply → PmtTolVend`)
- [Codeunit 980 "Payment Registration Mgt."](../codeunit/980.md) (2 calls: `Post → PmtTolGenJnl`, `Post → SetSuppressCommit`)
- [Table 18 "Customer"](../table/18.md) (2 calls: `UpdatePaymentTolerance → CalcTolCustLedgEntry`, `UpdatePaymentTolerance → DelTolCustLedgEntry`)
- [Page 1190 "Create Payment"](../page/1190.md) (1 call: `CheckCalcPmtDiscGenJnlVend → CheckCalcPmtDisc`)
- [Report 393 "Suggest Vendor Payments"](../report/393.md) (1 call: `SaveAmount → CheckCalcPmtDiscGenJnlVend`)
- [Table 1294 "Applied Payment Entry"](../table/1294.md) (1 call: `InclPmtDisc → PmtTolPmtReconJnl`)

## Recent changes

- 2026-07-31 [#9789 [Main]-Payment discount tolerance is doubled when posting a vendor payment](../../changes/bcapps/9789.md) (main, BC30, fix)
- 2026-07-10 [#9051 [639592][ALAppExtensions #30277][Event Request] Codeunit 426 "Payment Tolerance Management" OnPmtTolGenJnlOnAfterCheckConditions](../../changes/bcapps/9051.md) (main, BC30, feature)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC25-28

## Countries that replace it

[CH](../../localizations/ch.md), [FR](../../localizations/fr.md), [IT](../../localizations/it.md), [NL](../../localizations/nl.md)

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: "Payment Tolerance Management")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
