Skip to content

[29.x] Bug 69369 Movement Worksheet Creates Incorrect Warehouse Movement for FEFO Lot-Tracked Items - #11194

Merged
MSNehaNawal merged 1 commit into
releases/29.xfrom
bugs/Bug-648630-29x-MovementWkst_FEFO_LotItemPendingPick
Sep 10, 2026
Merged

[29.x] Bug 69369 Movement Worksheet Creates Incorrect Warehouse Movement for FEFO Lot-Tracked Items#11194
MSNehaNawal merged 1 commit into
releases/29.xfrom
bugs/Bug-648630-29x-MovementWkst_FEFO_LotItemPendingPick

Conversation

@MSNehaNawal

@MSNehaNawal MSNehaNawal commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Bug 649369: [29.x][ALL-E] Movement Worksheet Creates Incorrect Warehouse Movement for FEFO Lot-Tracked Items When Picked-Not-Shipped and Pending Picks Exist. - regression.

Fixes AB#649369

Issue
Movement Worksheet Creates Incorrect Warehouse Movement for FEFO Lot-Tracked Items When Picked-Not-Shipped and Pending Picks Exist.

Root Cause
The availability calculation in CalcTotalAvailQtyToPick (codeunit 7312 "Create Pick") didn't exclude quantity that was already picked but not yet shipped (sitting in an outbound/ship-type bin) or committed to a pending pick. Since a movement can never source stock from the ship zone, this caused the worksheet to select the wrong (FEFO-earliest) lot for the movement — the lot that was already fully committed to outstanding sales orders — instead of the next available lot.

Solution
In CreatePick.Codeunit.al, when called from the Movement Worksheet (CalledFromMoveWksh), subtract the quantity already sitting on outbound bins (WarehouseAvailabilityMgt.CalcQtyOnOutboundBins) from MaxPickableQtyInWhse before it's added to the total available quantity, clamping at zero.

@github-actions github-actions Bot added the Team: SCM GitHub request for SCM area label Sep 8, 2026
@github-actions github-actions Bot added this to the Version 29.1 milestone Sep 8, 2026
@MSNehaNawal MSNehaNawal changed the title [29.x] Bug 648630 Movement Worksheet Creates Incorrect Warehouse Movement for FEFO Lot-Tracked Items [29.x] Bug 69369 Movement Worksheet Creates Incorrect Warehouse Movement for FEFO Lot-Tracked Items Sep 8, 2026
@MSNehaNawal
MSNehaNawal marked this pull request as ready for review September 8, 2026 12:21
@MSNehaNawal
MSNehaNawal requested a review from a team September 8, 2026 12:21
@MSNehaNawal
MSNehaNawal requested a review from a team as a code owner September 8, 2026 12:21
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept

What this PR does

This PR adjusts Create Pick availability for movement worksheet lines on directed put-away and pick locations. When the destination is not a ship zone, it removes quantity already on outbound bins before FEFO availability is added, so picked-not-shipped stock is not offered as a movement source.

The added regression test sets up a FEFO lot-tracked item with one lot partly picked to shipment and partly assigned to an open pick, then verifies the movement uses the next lot. The code follows the existing movement-from-ship-zone guard and keeps the subtraction limited to the movement worksheet path.

Problem-solution fit

Fit: Strong

The reported scenario is specific: FEFO movement replenishment must ignore lot quantity that cannot be moved because it is outbound or already assigned to a pick. The diff changes that exact availability calculation and adds a test that exercises both picked-not-shipped and pending-pick quantities.

Suggestions

No suggestions.

Risk assessment and necessity

Risk: The regression surface is the movement worksheet FEFO availability calculation for directed put-away and pick locations. The code path affects inventory movement and lot selection, but the change is narrow, keeps ship-zone destinations exempt through the existing IsShipZone check, and does not change public signatures or event contracts. The diff also passes git diff --check; no local BC test run was available in this review.

Necessity: The change is required because movement creation can otherwise choose an FEFO-earlier lot that is already unavailable for movement, producing an incorrect warehouse movement. The scope is right for a bug fix: one availability adjustment plus a focused regression test.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11194 round=1 by=alexei-dobriansky at=2026-09-08T18:29:42Z lastSha=91abbd360ae6ba419d5235496d00250864147159 reviewKey=04ed770e3c817f45342cab8b2440c78b4cf95a7e81c390c9e30a146dc563383f suggestions=none

@MSNehaNawal
MSNehaNawal merged commit 9b642ec into releases/29.x Sep 10, 2026
336 of 338 checks passed
@MSNehaNawal
MSNehaNawal deleted the bugs/Bug-648630-29x-MovementWkst_FEFO_LotItemPendingPick branch September 10, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team: SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants