---
id: change/bcapps/14574
type: change
title: "#14574 [Main]ERM Purchase Payables.UnreliazedGainLossEntrieAreClearWhenUsingMultiplePostingGroups fails (G/L account not balanced)- #13241"
summary: Fixes the failing UnreliazedGainLossEntrieAreClearWhenUsingMultiplePostingGroups test, which hit an unbalanced G/L account when a payment used a different vendor posting group than the invoice. The test setup now maps alternate vendor posting groups in both directions, and Gen. Jnl.-Post Line is also modified across localization layers.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit gen. jnl.-post line
system: finance
review:
  state: reviewed
  by: opus
  at: "2026-12-01T01:07:31.009Z"
  flags: []
generated:
  at: "2026-12-02T00:15:44.908Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: c0773dd4806ce49759f06140984818fef8ba3b95
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/14574
    title: "microsoft/BCApps#14574: [Main]ERM Purchase Payables.UnreliazedGainLossEntrieAreClearWhenUsingMultiplePostingGroups fails (G/L account not balanced)- #13241"
    date: "2026-11-30"
    commit: c0773dd4806ce49759f06140984818fef8ba3b95
    t: null
    quote: Added the reverse alternate vendor posting-group mapping, from group 2 to group 1.
links:
  learn: []
  objects:
    - object/codeunit/12
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/design-details-general-journal-post-line-overview
      title: General Journal Post Line Overview
      label: possibly related
      why: touches Codeunit 12 "Gen. Jnl.-Post Line"
      by: code
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/types-of-events-for-extensibility
      title: Types of events for extensibility
      label: possibly related
      why: touches Codeunit 12 "Gen. Jnl.-Post Line"
      by: code
    - to: https://learn.microsoft.com/dynamics365/business-central/LocalFunctionality/Czech/how-to-use-multiple-payables-receivables-accounts
      title: Czech local functionality - Multiple payables/receivables accounts
      label: possibly related
      why: Multiple payables/receivables accounts allow posting to alternative G/L accounts via posting groups.
      by: model
number: 14574
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/14574
kind: pr
base_branch: main
major: "30"
merged_at: "2026-11-30T18:55:23Z"
author: sanjmaurya
author_type: User
community_contribution: false
labels:
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: false
breaking: false
files:
  count: 15
  additions: 1084
  deletions: 52
  al: 11
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:
  - 647653
systems:
  - finance
quote: Added the reverse alternate vendor posting-group mapping, from group 2 to group 1.
joined_against:
  major: "30"
  commit: f53bb0f1ecd89fde9f133f9dcaf5bf43cf5f2671
---

# #14574 [Main]ERM Purchase Payables.UnreliazedGainLossEntrieAreClearWhenUsingMultiplePostingGroups fails (G/L account not balanced)- #13241

> Fixes the failing UnreliazedGainLossEntrieAreClearWhenUsingMultiplePostingGroups test, which hit an unbalanced G/L account when a payment used a different vendor posting group than the invoice. The test setup now maps alternate vendor posting groups in both directions, and Gen. Jnl.-Post Line is also modified across localization layers.

[Pull request](https://github.com/microsoft/BCApps/pull/14574) · merged into `main` (BC30) on 2026-11-30 by sanjmaurya · 15 files (+1084 -52), 11 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- The test failed with an unbalanced G/L account when the payment and invoice used different vendor posting groups
- The test setup adds the reverse alternate vendor posting-group mapping, from group 2 to group 1
- Codeunit 12 Gen. Jnl.-Post Line is modified in the APAC, BE, CH, ES, FI, FR, IT, NA, NO, RU and W1 layers
- Tests are updated in the CZ, FI, GB and W1 layers

## AL objects touched

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

## Context

- Work items: AB#647653
- Labels: Team: Finance
- Systems: finance
- From the description: "Added the reverse alternate vendor posting-group mapping, from group 2 to group 1."

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [General Journal Post Line Overview](https://learn.microsoft.com/dynamics365/business-central/design-details-general-journal-post-line-overview) — possibly related: touches Codeunit 12 "Gen. Jnl.-Post Line"
- [Types of events for extensibility](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/types-of-events-for-extensibility) — possibly related: touches Codeunit 12 "Gen. Jnl.-Post Line"
- [Czech local functionality - Multiple payables/receivables accounts](https://learn.microsoft.com/dynamics365/business-central/LocalFunctionality/Czech/how-to-use-multiple-payables-receivables-accounts) — possibly related: Multiple payables/receivables accounts allow posting to alternative G/L accounts via posting groups. (model-linked)

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