---
id: change/bcapps/9789
type: change
title: "#9789 [Main]-Payment discount tolerance is doubled when posting a vendor payment"
summary: Fixed a bug where payment discount tolerance was calculated twice for vendor payments with Applies-to ID in foreign currency, causing inflated bank amounts and sign errors in GL entries.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit payment tolerance management
system: finance
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:10:53.023Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 92a5d0d570c6ea067599f5e22d989c567f98702b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9789
    title: "microsoft/BCApps#9789: [Main]-Payment discount tolerance is doubled when posting a vendor payment"
    date: "2026-07-31"
    commit: 92a5d0d570c6ea067599f5e22d989c567f98702b
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/426
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9789
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9789
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-31T05:42:50Z"
author: DhavalMore88
author_type: User
community_contribution: true
labels:
  - "ADO: Sync"
  - From Fork
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 7
  additions: 506
  deletions: 10
  al: 5
apps:
  - Base Application
objects_touched:
  - key: codeunit/426
    page: codeunit/426
    type: codeunit
    id: 426
    name: Payment Tolerance Management
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 644282
systems:
  - finance
quote: null
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #9789 [Main]-Payment discount tolerance is doubled when posting a vendor payment

> Fixed a bug where payment discount tolerance was calculated twice for vendor payments with Applies-to ID in foreign currency, causing inflated bank amounts and sign errors in GL entries.

[Pull request](https://github.com/microsoft/BCApps/pull/9789) · merged into `main` (BC30) on 2026-07-31 by DhavalMore88 (community contribution) · 7 files (+506 -10), 5 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Removed the GenJnlLineApplID = '' guard so the netted payment amount is saved to the journal line in the Applies-to ID case
- Added a re-entrancy guard in PmtTolGenJnl to stop recursion when Amount is validated
- Vendor payments applied to several invoices in foreign currency no longer double the discount tolerance
- Fix made in the W1, CH, FR, IT and NL layers; customer path unchanged
- Regression tests added in W1 and IT vendor payment tolerance test codeunits
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 426 "Payment Tolerance Management"](../../objects/codeunit/426.md), Base Application: modified

## Context

- Work items: AB#644282
- Labels: ADO: Sync, From Fork, Team: Finance
- Systems: finance

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
