Skip to content

[QM] Fix internal put-away from Quality Inspection sourcing wrong bin#9168

Open
6CRIPT wants to merge 2 commits into
mainfrom
bugs/641562-its-not-possible-to-create-an-internal-put-away-from-quality-inspection
Open

[QM] Fix internal put-away from Quality Inspection sourcing wrong bin#9168
6CRIPT wants to merge 2 commits into
mainfrom
bugs/641562-its-not-possible-to-create-an-internal-put-away-from-quality-inspection

Conversation

@6CRIPT

@6CRIPT 6CRIPT commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Resolve the source bin for the Create Internal Put-away disposition from the item's actual Bin Content in bin mandatory locations, instead of guessing it from the source document naming conventions which returned stale receive bins or bins without content.

Also validate all resolved source bins for receive bins up front before creating any document, so we no longer emit a 'created' notification for a put-away that is then rolled back.

Fixes AB#641562

Needs a backport to 28.x to fix the original Work Item.

Resolve the source bin for the Create Internal Put-away disposition from the item's actual Bin Content in bin mandatory locations, instead of guessing it from the source document naming conventions which returned stale receive bins or bins without content.

Also validate all resolved source bins for receive bins up front before creating any document, so we no longer emit a 'created' notification for a put-away that is then rolled back.

Fixes AB#640117
@6CRIPT 6CRIPT requested a review from a team July 7, 2026 09:03
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jul 7, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 7, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 2 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

…tification

The failed-document notification printed the raw instruction quantity, which is zero for behaviors that resolve the quantity later (failed/passed sample count), so it misleadingly read '0 PCS'. Fall back to the quantity the user intended to move based on the quantity behavior.

Related to AB#641562
@6CRIPT 6CRIPT added Bug Something isn't working SCM GitHub request for SCM area labels Jul 7, 2026
@6CRIPT 6CRIPT enabled auto-merge July 7, 2026 09:18
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Request Changes

What this PR does

This PR changes Quality Management internal put-away creation so non-tracked inventory at bin-mandatory locations is sourced from current Bin Content instead of the source document bin. It also validates receive bins before document creation and improves the failed-notification quantity.

The direction matches the linked bug: after a purchase receipt is put away, the receive bin is stale and the internal put-away must use the bin that now holds the inventory. The receive-bin precheck is also placed before document creation, which avoids the old created-then-rolled-back notification. However, the new Bin Content resolver can return more than one bin, and the existing quantity-buffer logic applies the full requested quantity to each returned bin. That makes the fix unsafe when the item exists in multiple valid bins.

Suggestions

S1 - Allocates the requested quantity once
TryResolveBinsFromBinContent can add several bins. PopulateQuantityBuffer then gives the full failed or specific quantity to each bin, so one inspection can create too much put-away quantity. Allocate the requested quantity across the bins, or choose one bin that can cover it.

S2 - Adds regression coverage for this flow
This change has no test, but the area is sensitive and existing Quality Management disposition tests can create internal put-aways. Add a test for the WHITE receipt-put-away-fail scenario and assert the From Bin Code is not RECEIVE and the total quantity is the failed quantity.

Risk assessment and necessity

Risk: This touches warehouse source-bin selection for internal put-aways. A wrong result can create a put-away from the wrong bin or for too much quantity. No public API signature or BaseApp event publisher dependency was introduced, but the behavior change is in sensitive warehouse flow logic.

Necessity: The linked Bug is clear and important. The reported WHITE scenario cannot create the internal put-away for the failed quantity because the flow uses a receive or stale bin after the receipt put-away. A fix is needed, but it must preserve the requested quantity across multi-bin inventory.


[AI-PR-REVIEW] version=1 system=github pr=9168 round=1 by=alexei-dobriansky sha=7da827c00027a76cc10daf786f4eae50a81eb9d9

@alexei-dobriansky alexei-dobriansky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review the suggestions

TempToMoveBinContent."Min. Qty." := QuantityBaseValue;
TempToMoveBinContent.Insert(false);
if LocationCode <> '' then
// In bin mandatory locations (including directed put-away and pick) the bin derived from the source

@alexei-dobriansky alexei-dobriansky Jul 8, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't leave so many comments, simply put everything to PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Bug Something isn't working SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants