(Bug 636078): [Subcontracting] Worksheet pricing passes total base qty instead of qty-per-UoM to ConvertPriceToUOM — wrong Direct Unit Cost#8286
Open
alexei-dobriansky wants to merge 1 commit into
Conversation
…rice list GetSubcPriceForReqLine passed RequisitionLine.GetQuantityBase() (total base qty) as the per-UoM factor to ConvertPriceToUOM, so the Direct Unit Cost on the Subcontracting Worksheet was multiplied by the order quantity whenever the order UoM differed from the price-list UoM. The PO created from carry-out inherited the inflated cost. Fix: pass RequisitionLine.GetQuantityForUOM() instead, matching the routing (SetRoutingPriceListCost) and purchase (GetSubcPriceForPurchLine) call sites. AB#636078 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Fixes the Subcontracting Worksheet Direct Unit Cost when the production order UoM differs from the subcontractor price-list UoM.
Subc. Price Management.GetSubcPriceForReqLinepassedRequisitionLine.GetQuantityBase()(total base quantity of the order) as the per-UoM conversion factor toConvertPriceToUOM. BecauseConvertPriceToUOMcomputesDirectCost := PriceListCost / PriceListQtyPerUOM * ProdQtyPerUoM, the result was multiplied by the order quantity instead of the UoM conversion factor. The Carry-Out Action Message-created Purchase Order then inherited the inflated cost.Comparison of the three call sites (only the worksheet path was wrong):
SetRoutingPriceListCost)ProdQtyPerUomGetSubcPriceForReqLine)RequisitionLine.GetQuantityBase()GetSubcPriceForPurchLine)PurchaseLine.GetQuantityPerUOM()Fix
Pass
RequisitionLine.GetQuantityForUOM()instead, matching the routing and purchase paths.Test
Added
WorksheetDirectUnitCostUsesQtyPerUoMNotBaseQtyForUoMConversioninSubcSubcontractingTest:Direct Unit Cost = 10000(price * Qty-per-UoM), not 30000 (pre-fix behavior).Work Item
AB#636078