[Subcontracting] Subcontractor Price with Blank Unit of Measure Not Shown in Purchase Order FactBox#8695
Open
stevengrossGOB wants to merge 1 commit into
Conversation
Contributor
|
Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link. |
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: Subcontractor Price with Blank Unit of Measure Not Shown in Purchase Order FactBox
Affected Objects
Reproduction Steps
Setup
Given
PCS).When
Then
0instead of1.False Behavior
The FactBox shows
0 Subcontractor Priceseven though a matching price exists with a blank Unit of Measure Code. The price is not found becauseFilterSubContractorPriceForPurchLineusesSetRange("Unit of Measure Code", PurchaseLine."Unit of Measure Code"), which requires an exact match. A blank-UoM price is only found when the purchase line's UoM is also blank.Expected Behavior
A Subcontractor Price with a blank Unit of Measure Code should be treated as a "catch-all" using the base unit of measure. The FactBox should count (and drilldown should display) such entries regardless of the Unit of Measure Code on the purchase line.
Root Cause
File:
src/Process/Codeunits/SubcPurchFactboxMgmt.Codeunit.alProcedure:
FilterSubContractorPriceForPurchLine(local)The offending line:
SetRangeperforms an exact equality filter. When the purchase line has"Unit of Measure Code" = 'PCS'and the Subcontractor Price has"Unit of Measure Code" = '', no record is returned.Fix Description
Replace the
SetRangeon"Unit of Measure Code"with aSetFilterthat also accepts blank entries:This ensures prices entered without a Unit of Measure (applicable to any unit) are included in the FactBox count and drilldown, while prices entered for a specific unit are still matched correctly when the purchase line uses that same unit.
When the purchase line itself has a blank UoM the filter becomes
'' | ''(blank or blank), which is equivalent to the originalSetRange— no regression for that case.Related Work Item
To be added.
How I validated this