[Subcontracting] Purchase Line FactBox Shows Wrong Transfer Order Count When Return Exists#8696
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: Purchase Line FactBox Shows Wrong Transfer Order Count When Return Exists
Affected Objects
Reproduction Steps
Setup
Given
When
The Subc. Purchase Line Factbox is displayed for the Purchase Line.
Then (pre-fix — wrong behavior)
ShowTransferOrdersAndReturnOrderuses theSubc. Return Orderboolean.False Behavior
GetNoOfTransferOrdersover-counts by including the return transfer order.GetReturnTransferOrderNoreturns blank, unable to locate the return transfer order.Expected Behavior
Root Cause
FilterTransferLineToSubcontractorPurchaseOrder(used byGetNoOfTransferOrdersandGetTransferOrderNo) identifies non-return lines by filtering"Subc. Operation No." <> ''and"Subc. Routing No." <> ''. However, the SubcCreateSubCReturnOrder report populatesSubc. Operation No.andSubc. Routing No.on return transfer lines from theProd. Order Routing Line. This means return lines pass the filter and are incorrectly included in the count.GetReturnTransferOrderNouses the inverse filter —"Subc. Operation No." = ''and"Subc. Routing No." = ''— to find return lines. Because return lines have these fields set, the query finds nothing and returns blank.The
Subc. Return Orderboolean field (set totrueon all return lines by the report) is the authoritative discriminator, as already used byShowTransferOrdersAndReturnOrderandSubcRoutingFactboxMgmt.GetNoOfTransferLinesFromRouting.Fix Description
File:
src/Process/Codeunits/SubcPurchFactboxMgmt.Codeunit.alFilterTransferLineToSubcontractorPurchaseOrder— replace theSubc. Operation No. <> ''andSubc. Routing No. <> ''filters withSetRange("Subc. Return Order", false).GetReturnTransferOrderNo— replace theSubc. Operation No. = ''andSubc. Routing No. = ''filters withSetRange("Subc. Return Order", true).Related Work Item
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility