---
id: change/bcapps/9306
type: change
title: '#9306 [Main] Unbalanced G/L Entries if you apply a Payment and a Posted Purchase Invoice having both different Posting Groups and using the "Applies-to Document No." on the line instead of using Apply Entries in the Spanish version.Initial commit'
summary: Fixed unbalanced G/L entries when applying a payment to a purchase invoice with different posting groups using inline application in the Spanish version.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit gen. jnl.-post line
system: finance
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:12:39.374Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 67bf4c3f68bed43a28ec0483a5fe6f051b069919
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9306
    title: 'microsoft/BCApps#9306: [Main] Unbalanced G/L Entries if you apply a Payment and a Posted Purchase Invoice having both different Posting Groups and using the "Applies-to Document No." on the line instead of using Apply Entries in the Spanish version.Initial commit'
    date: "2026-07-15"
    commit: 67bf4c3f68bed43a28ec0483a5fe6f051b069919
    t: null
    quote: Unbalanced G/L Entries if you apply a Payment and a Posted Purchase Invoice having both different Posting Groups
links:
  learn: []
  objects:
    - object/codeunit/12
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9306
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9306
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-15T11:46:49Z"
author: sanjmaurya
author_type: User
community_contribution: false
labels:
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 99
  deletions: 2
  al: 1
apps:
  - Base Application
objects_touched:
  - key: codeunit/12
    page: codeunit/12
    type: codeunit
    id: 12
    name: Gen. Jnl.-Post Line
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 640410
systems:
  - finance
quote: Unbalanced G/L Entries if you apply a Payment and a Posted Purchase Invoice having both different Posting Groups
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #9306 [Main] Unbalanced G/L Entries if you apply a Payment and a Posted Purchase Invoice having both different Posting Groups and using the "Applies-to Document No." on the line instead of using Apply Entries in the Spanish version.Initial commit

> Fixed unbalanced G/L entries when applying a payment to a purchase invoice with different posting groups using inline application in the Spanish version.

[Pull request](https://github.com/microsoft/BCApps/pull/9306) · merged into `main` (BC30) on 2026-07-15 by sanjmaurya · 2 files (+99 -2), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Application entries now correctly identify whether they belong to the applied document or the payment
- Invoices post to their own posting-group payables account instead of the payment's account
- Special handling in PostDtldVendLedgEntry and PostDtldVendLedgEntryUnapply ensures symmetry between apply and unapply operations
- Issue only occurred with inline Applies-to Document No., not with Apply Entries
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 12 "Gen. Jnl.-Post Line"](../../objects/codeunit/12.md), Base Application (ES layer): modified

## Context

- Work items: AB#640410
- Labels: Team: Finance
- Systems: finance
- From the description: "Unbalanced G/L Entries if you apply a Payment and a Posted Purchase Invoice having both different Posting Groups"

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).
