---
id: change/bcapps/10840
type: change
title: "#10840 Bugs/625412 Wrong posted G/L Entries and VAT Entries using Cash Basis Unrealized VAT from a partial Credit Memo if we mix VAT types and use only part of the amount in the Mexican version."
summary: Cash-basis VAT calculations for partial credit memo applications now correctly determine settled amounts per VAT posting group, preventing incorrect G/L entries between realized and unrealized VAT accounts.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit gen. jnl.-post line
  - table cust. ledger entry
system: finance
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:05:13.165Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: ff628473f8593c965918891190240c84a8bd2ba9
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/10840
    title: "microsoft/BCApps#10840: Bugs/625412 Wrong posted G/L Entries and VAT Entries using Cash Basis Unrealized VAT from a partial Credit Memo if we mix VAT types and use only part of the amount in the Mexican version."
    date: "2026-09-14"
    commit: ff628473f8593c965918891190240c84a8bd2ba9
    t: null
    quote: Cash-basis VAT credit memos now realize VAT correctly for each VAT posting group.
links:
  learn: []
  objects:
    - object/codeunit/12
    - object/table/21
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 10840
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/10840
kind: pr
base_branch: main
major: "30"
merged_at: "2026-09-14T14:24:43Z"
author: v-mjofre
author_type: User
community_contribution: false
labels:
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 7
  additions: 582
  deletions: 86
  al: 2
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
  - key: table/21
    page: table/21
    type: table
    id: 21
    name: Cust. Ledger Entry
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 648956
systems:
  - finance
  - sales
quote: Cash-basis VAT credit memos now realize VAT correctly for each VAT posting group.
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #10840 Bugs/625412 Wrong posted G/L Entries and VAT Entries using Cash Basis Unrealized VAT from a partial Credit Memo if we mix VAT types and use only part of the amount in the Mexican version.

> Cash-basis VAT calculations for partial credit memo applications now correctly determine settled amounts per VAT posting group, preventing incorrect G/L entries between realized and unrealized VAT accounts.

[Pull request](https://github.com/microsoft/BCApps/pull/10840) · merged into `main` (BC30) on 2026-09-14 by v-mjofre · 7 files (+582 -86), 2 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Fixed VAT realization to use settled amount per VAT group instead of total settled amount
- Added dedicated calculation for credit memo portion associated with each VAT posting group
- Currency factor is applied before VAT amount calculation
- Added condition to prevent G/L entries when credit memo application does not represent actual VAT realization
- Comprehensive test coverage added for cash-basis VAT credit memo scenarios
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 12 "Gen. Jnl.-Post Line"](../../objects/codeunit/12.md), Base Application (CA layer): modified
- [Table 21 "Cust. Ledger Entry"](../../objects/table/21.md), Base Application (CA layer): modified

## Context

- Work items: AB#648956
- Labels: Team: Finance
- Systems: finance, sales
- From the description: "Cash-basis VAT credit memos now realize VAT correctly for each VAT posting group."

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