---
id: change/bcapps/13015
type: change
title: "#13015 Bug/648925 VAT charged in Sales Invoice with Cash Basis (Unrealized VAT) is not paid on Sales Credit Note applied to that Posted Sales Invoice if we use a similar Cash Basis VAT Prod Posting Group in the Mexican version - regression."
summary: Sales credit memos now correctly realize unrealized VAT from invoices when using equivalent but differently coded VAT posting groups in Cash Basis VAT mode, addressing a regression in the Mexican version.
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-11-27T01:03:39.433Z"
  flags: []
generated:
  at: "2026-11-28T00:12:53.289Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 56254fd42d6bee37ab8a3042a7fbcdff01f183a0
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/13015
    title: "microsoft/BCApps#13015: Bug/648925 VAT charged in Sales Invoice with Cash Basis (Unrealized VAT) is not paid on Sales Credit Note applied to that Posted Sales Invoice if we use a similar Cash Basis VAT Prod Posting Group in the Mexican version - regression."
    date: "2026-11-26"
    commit: 56254fd42d6bee37ab8a3042a7fbcdff01f183a0
    t: null
    quote: Updated the Cash Basis VAT realization logic to identify equivalent VAT posting setups between sales invoices and sales credit memos.
links:
  learn: []
  objects:
    - object/codeunit/12
    - object/table/21
  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/finance-setup-unrealized-vat
      title: Set Up Unrealized VAT for Cash-Based Accounting
      label: possibly related
      why: Documents unrealized VAT setup and cash-based accounting configuration for VAT posting.
      by: model
number: 13015
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/13015
kind: pr
base_branch: main
major: "30"
merged_at: "2026-11-26T16:44:24Z"
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: 5
  additions: 2133
  deletions: 51
  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:
  - 654308
systems:
  - finance
  - sales
quote: Updated the Cash Basis VAT realization logic to identify equivalent VAT posting setups between sales invoices and sales credit memos.
joined_against:
  major: "30"
  commit: d2abc1d2ceae394331716c8183ef60e1534c2ce0
---

# #13015 Bug/648925 VAT charged in Sales Invoice with Cash Basis (Unrealized VAT) is not paid on Sales Credit Note applied to that Posted Sales Invoice if we use a similar Cash Basis VAT Prod Posting Group in the Mexican version - regression.

> Sales credit memos now correctly realize unrealized VAT from invoices when using equivalent but differently coded VAT posting groups in Cash Basis VAT mode, addressing a regression in the Mexican version.

[Pull request](https://github.com/microsoft/BCApps/pull/13015) · merged into `main` (BC30) on 2026-11-26 by v-mjofre · 5 files (+2133 -51), 2 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Cash Basis VAT realization logic updated to identify equivalent VAT posting setups between invoices and credit memos
- Equivalence determined by matching VAT business posting groups, calculation types, percentages, and account references
- Supports full and partial credit memos with multiple VAT groups while preserving credit memo VAT posting groups in generated entries
- Prevents unnecessary G/L entries and maintains existing public PostUnrealVATEntry interface
- Automated tests added for full/partial credits, multiple VAT groups, and non-equivalent configurations
- 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#654308
- Labels: Team: Finance
- Systems: finance, sales
- From the description: "Updated the Cash Basis VAT realization logic to identify equivalent VAT posting setups between sales invoices and sales credit memos."

## 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"
- [Set Up Unrealized VAT for Cash-Based Accounting](https://learn.microsoft.com/dynamics365/business-central/finance-setup-unrealized-vat) — possibly related: Documents unrealized VAT setup and cash-based accounting configuration for VAT posting. (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).
