{{ message }}
Repository navigation
fix(stock): round whole-number components in partial disassembly - #61784
Open
mihir-kandoi wants to merge 11 commits into
Open
mihir-kandoi wants to merge 11 commits into
mihir-kandoi wants to merge 11 commits into
Conversation
A partial disassembly scaled every component by the share of the source it disassembled, so whole-number UOMs got fractional quantities that could not be saved. Round these rows down on the qty disassembled so far and subtract what earlier disassemblies moved; the one that completes the source takes the remainder.
Batch qty was scaled from the source, which split whole-number items into fractional batches and could not add up to a rounded row qty. Take the source batches in order instead, skipping qty earlier disassemblies moved.
This branch has not been deployed
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.

Problem: A partial disassembly scaled each component by the share of the source it disassembled, so components with a whole-number UOM got fractional quantities. The fraction failed the whole-number check, and a rounded qty failed the "quantity derived from the source" check, so the entry could not be saved. Batch quantities were scaled the same way.
Fix: For whole-number UOMs, round down on the quantity disassembled so far and subtract what earlier disassemblies moved. The disassembly that completes the source takes the remainder, so the total never exceeds what was consumed. Batches are filled in order from what is left in each.
Steps to reproduce:
With the fix, the rows are 922 and then 212 for the remaining 191.
Closes #61729