#13220 Fix average cost adjustment overflow on same-period transfers
Same-period transfers no longer cause average cost adjustments to overflow when item quantities are zero or negative. The fix skips transfer recalculation when cumulative item ledger quantities are nonpositive, preserving transfer costs and normal forwarding.
- 4files
- 3AL files
- 1objects
Pull request · merged into main (BC30) on 2026-10-28 by alexei-dobriansky · 4 files (+287 -25), 3 AL · fix · tier official · reviewed (checked by Opus)
What changed
- Prevents cost amplification from repeated transfer repricings when cumulative item quantity is zero or negative
- Skips transfer average-cost recalculation in Item-wide average costing when pre-exclusion quantity is nonpositive
- Reuses existing quantity summation through local parameters to avoid additional queries
- Includes regression tests for negative-balance, zero-balance, and positive-balance transfer scenarios
- Applied to W1, APAC, and RU layers
- Behaviour changes for users or extensions.
AL objects touched
- Codeunit 5895 “Inventory Adjustment”, Base Application: modified
src/Layers/APAC/BaseApp/Inventory/Costing/InventoryAdjustment.Codeunit.al: modified, not in the BC30 snapshot
Also merged into
- #13423 into
releases/29.xon 2026-11-03
Context
- Work items: AB#656611
- Labels: Ownership: Manual, Team: SCM
- Systems: inventory
- From the description: “Prevent same-period transfers from repeatedly amplifying costs until average-cost adjustment overflows when the item’s cumulative quantity is zero or negative.”
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Design details - Average cost — possibly related: Explains average cost calculation methodology and adjustments through the Adjust Cost batch job. (model-linked)
- Design details - Cost adjustment — possibly related: Documents cost adjustment mechanism and processing of cost adjustments from sources to recipients. (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).