[master] Bin Capacity Policy "Prohibit More Than Max. Cap." fails and allows more than the maximum Capacity, when you split lines on Inventory Movement#9264
Conversation
Copilot PR ReviewIteration 2 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 1 knowledge-backed · 0 agent findings. Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
Agentic PR Review - Round 1Recommendation: Accept with SuggestionsWhat this PR doesThis PR makes non-directed warehouse activity registration calculate Cubage and Weight on the warehouse journal line before The fix matches the root cause in the work item. SuggestionsS1 - Split Line path is not exercised Risk assessment and necessityRisk: Warehouse bin-capacity validation is sensitive because an incorrect fix can allow overfilled bins or block valid movements. The code change is narrow, uses existing Necessity: The linked bug is clear and valid. Without this fix, users can bypass
|
…Bug-641780-Bin-Capacity-Policy-fails-and-allows-more-than-max-Capacity
| [HandlerFunctions('ConfirmHandler,MessageHandler')] | ||
| procedure InvtMovementProhibitsExceedingBinMaxCubageOnSplitLineMovements() | ||
| var | ||
| CubagePerUnit: Decimal; |
There was a problem hiding this comment.
The var block in the new test procedure InvtMovementProhibitsExceedingBinMaxCubageOnSplitLineMovements interleaves primitive Decimal variables (CubagePerUnit, FirstQty, MaxCubage, SecondQty) with Record variables (FromBin, Item, Location, ToBin, WarehouseActivityHeader, etc.) in alphabetical order across types.
CodeCop AA0021 requires all Record (and other complex-type) declarations to precede primitive types such as Decimal within the same var block.
Suggested fix (apply manually — could not be anchored as a one-click suggestion):
FromBin: Record Bin;
Item: Record Item;
Location: Record Location;
ToBin: Record Bin;
WarehouseActivityHeader: Record "Warehouse Activity Header";
WarehouseActivityLine: Record "Warehouse Activity Line";
WarehouseEmployee: Record "Warehouse Employee";
WarehouseEntry: Record "Warehouse Entry";
CubagePerUnit: Decimal;
FirstQty: Decimal;
MaxCubage: Decimal;
SecondQty: Decimal;Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
Agentic PR Review - Round 2Recommendation: AcceptWhat this PR doesThe new commit updates the regression test so it creates one Inventory Movement, splits both Take and Place lines with The production fix is unchanged since round 1. It still fills Cubage and Weight for non-directed movement warehouse journal lines before Status of previous suggestions
New observations (commits since round 1)None - changes only addressed the previous suggestion. Risk assessment and necessityRisk: Warehouse bin-capacity validation is sensitive because a wrong cubage or weight value can allow overfilled bins or block valid movements. The round-2 change is test-only and uses the existing SplitLine flow. The production change remains narrow and does not change public APIs or event signatures. Necessity: The linked Bug 641780 is clear and valid. Without this fix, users can bypass
|
Workitem: Bug 641780: [master] [ALL-E] Bin Capacity Policy "Prohibit More Than Max. Cap." fails and allows more than the maximum Capacity, when you split lines on Inventory Movement
Fixes AB#641780
Issue: In non-directed (basic) warehouses with Bin Capacity Policy "Prohibit More Than Max. Cap.", registering partial Inventory Movements does not enforce the destination bin's Maximum Cubage/Weight, allowing the bin to be overfilled.
Cause: RegisterWhseJnlLine in WhseActivityRegister Codeunit only computed Cubage/Weight for directed locations, so basic-warehouse movement entries were written with zero cubage, hiding previously moved quantities from the capacity check.
Solution: Calculate Cubage/Weight via WMSMgt.CalcCubageAndWeight (base UoM) in the non-directed branch so movement Warehouse Entries carry cubage and the "Prohibit More Than Max. Cap." check correctly blocks over-capacity registrations.