Bug 8845 Old Prices Calculated in Req. Worksheet - #10213
Bug 8845 Old Prices Calculated in Req. Worksheet#10213Dan Karlsson (Dan-Karlsson) wants to merge 2 commits into
Conversation
Agentic PR Review - Round 1Recommendation: AcceptWhat this PR doesThis fixes purchase price calculation on requisition lines when planning dates would place the order date before the work date. The code now keeps price calculation on the work date while preserving the calculated starting date unless the Order Date field is validated directly. The main changed paths use Order Date as the price document date, so the old-price case is addressed without changing posting code or public APIs. The added regression test covers two vendor price periods and checks that the current price is selected. SuggestionsNo suggestions. Risk assessment and necessityRisk: This touches requisition worksheet planning dates and purchase direct unit cost. A mistake here could choose the wrong vendor cost on planned supply, but the change is narrow and does not change posting code, event signatures, or public procedure signatures. Necessity: The linked bug is valid because a rush order can otherwise use an obsolete purchase price when lead time pushes the calculated order date into the past. The scope is right for the issue, and the tests cover the price regression plus related planning date expectations.
|
What & why
Does not set Order Date in Requisition Line to an older date than workdate when validating other fields, to make the price calculations correct.
Only update Starting Date when it is also validated to not set a faulty starting date. Also doesn't make sense to set starting date without validation since the field Starting Date-Time will not be synchronised.
Same pull request as microsoft/BusinessCentralApps#1869 that was closed when base app moved.
Linked work
Fixes #8845
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility
Starting Date isn't set when validating Order Date on Requisition Line from code. Should be a small risk since Starting Date-Time wasn't synchronised without further field validations.