---
id: change/bcapps/14638
type: change
title: "#14638 [29.x]-Adjust Cost Creates an Output Value Entry with Entry Type = Variance and Expected Cost = Yes After Reversing a Finished Production Order."
summary: Fixed a bug where Adjust Cost incorrectly created variance value entries with Expected Cost set to Yes instead of No for reopened and reversed production orders, which caused G/L posting failures.
tier: official
language: en
tags:
  - fix
  - releases/29.x
  - bc29
  - codeunit inventory adjustment
system: inventory
review:
  state: reviewed
  by: opus
  at: "2026-12-01T01:07:31.009Z"
  flags: []
generated:
  at: "2026-12-06T00:14:19.053Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 4c849ee3d5d440408c769e68b719f765b7e488cd
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/14638
    title: "microsoft/BCApps#14638: [29.x]-Adjust Cost Creates an Output Value Entry with Entry Type = Variance and Expected Cost = Yes After Reversing a Finished Production Order."
    date: "2026-11-30"
    commit: 4c849ee3d5d440408c769e68b719f765b7e488cd
    t: null
    quote: For Variance and Indirect Cost entries with no invoiced quantity, it returns the original entry's Valued Quantity.
links:
  learn: []
  objects:
    - object/codeunit/5895
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/finance-about-finished-production-order-costs
      title: About finished production order costs
      label: possibly related
      why: Explains cost adjustment on finished production orders and variance entries creation.
      by: model
number: 14638
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/14638
kind: pr
base_branch: releases/29.x
major: "29"
merged_at: "2026-11-30T16:37:44Z"
author: DhavalMore88
author_type: User
community_contribution: true
labels:
  - "ADO: Sync"
  - From Fork
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 4
  additions: 202
  deletions: 3
  al: 3
apps:
  - Base Application
objects_touched:
  - key: codeunit/5895
    page: codeunit/5895
    type: codeunit
    id: 5895
    name: Inventory Adjustment
    app: Base Application
    status: modified
objects_unjoined:
  - path: src/Layers/APAC/BaseApp/Inventory/Costing/InventoryAdjustment.Codeunit.al
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 652998
systems:
  - inventory
quote: For Variance and Indirect Cost entries with no invoiced quantity, it returns the original entry's Valued Quantity.
joined_against:
  major: "29"
  commit: 4e6a307ce8a2e8c5a28f8f0c4c2c7d561f4fe679
---

# #14638 [29.x]-Adjust Cost Creates an Output Value Entry with Entry Type = Variance and Expected Cost = Yes After Reversing a Finished Production Order.

> Fixed a bug where Adjust Cost incorrectly created variance value entries with Expected Cost set to Yes instead of No for reopened and reversed production orders, which caused G/L posting failures.

[Pull request](https://github.com/microsoft/BCApps/pull/14638) · merged into `releases/29.x` (BC29) on 2026-11-30 by DhavalMore88 (community contribution) · 4 files (+202 -3), 3 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Variance and Indirect Cost entries now use Valued Quantity instead of Invoiced Quantity when posting cost adjustments
- New GetActualCostAdjmtInvoicedQty procedure ensures these entries are posted as actual cost with Expected Cost = No
- Prevents imbalanced expected cost amounts and Post Inventory Cost to G/L failures
- Applied consistently across W1, APAC, and RU layers
- Fixes a specific scenario where reopening, reversing, and re-posting production orders caused the issue
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 5895 "Inventory Adjustment"](../../objects/codeunit/5895.md), Base Application: modified
- `src/Layers/APAC/BaseApp/Inventory/Costing/InventoryAdjustment.Codeunit.al`: modified, not in the BC29 snapshot

## Context

- Work items: AB#652998
- Labels: ADO: Sync, From Fork, Team: SCM
- Systems: inventory
- From the description: "For Variance and Indirect Cost entries with no invoiced quantity, it returns the original entry's Valued Quantity."

## Possibly related

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

- [About finished production order costs](https://learn.microsoft.com/dynamics365/business-central/finance-about-finished-production-order-costs) — possibly related: Explains cost adjustment on finished production orders and variance entries creation. (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).
