[Master]Error when creating a Pick "Nothing to handle. The quantity to be picked is in bin W-09-0002, which is not set up for picking."#9532
Draft
sanjmaurya wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug 642378: [Master][ALL-E] Error when creating a Pick "Nothing to handle. The quantity to be picked is in bin W-09-0002, which is not set up for picking."
Fixes AB#642378
Issue :- Error when creating a Pick "Nothing to handle. The quantity to be picked is in bin W-09-0002, which is not set up for picking."
Cause :-
The failure is in ValidateQtyPickedInShipmentBin in WarehouseAvailabilityMgt.Codeunit.al:904. It checks the picked-not-shipped quantity only in the location's default Shipment Bin Code (W-09-0001). In the repro (step 7) the shipment bin was changed to W-09-0002, so the default ship bin shows 0 → it wrongly sets QtyPicked := 0. That cascades: QtyReservedOnPickShip becomes 0 while ReservedQtyOnInventory stays 160, so CalcAvailabilityAfterReservationImpact(40, 160, 0, 0) returns max(0, 40 − 160) = 0 → "Nothing to handle."
Solution :-
Replaced the single default-bin check with a new helper CalcQtyOnShipmentBins that sums the item's quantity across all Ship-type bins (any bin whose Bin Type has Ship = true), not just the default one. So the 160 in W-09-0002 is correctly recognized, QtyPicked stays 160, QtyReservedOnPickShip = 160, and availability becomes max(0, 40 − 0) = 40 → the pick for 40 succeeds.
The Bin Mandatory + Shipment Bin Code <> '' guard is kept, so locations without a default shipment bin behave exactly as before. Analyzer/compile is clean.
Note: this is verified by full code tracing, not a live BC run — please rebuild and re-run your exact repro to confirm the pick now creates 40.