[Bug]: Old Prices Calculated in Req. Worksheet
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
Describe the issue
When having a purchase price for an item with a new starting date the old price is sometimes used in the requisition worksheet.
This is because of the Order Date-field is calculated by other fields, and when it gets set to a date in the past the prices are also based on historic values.
Expected behavior
A price should never be calculated for a date earlier than the work date. Just because an item is urgent doesn't mean that you can get the price that was current when the item should have been ordered.
Steps to reproduce
- Create a new Purchase Price for an Item with the Starting Date set to the Work Date. Make sure that the item has at least 1 day of delivery time, and that there will be a need for it in the req. worksheet.
- In a Requisiton Worksheet calculate a plan for that item (set the starting date to the work date).
- Confirm that the line gets the new price.
- Change the Due Date of the line to the Work Date.
- Confirm that the line gets the old price.
Additional context
This was being fixed in microsoft/BusinessCentralApps#1715 when the repository closed.
Pull request microsoft/BusinessCentralApps#1869 failed merging because of tests that relies on order dates being set in the past. Hopefully it will be easier to see which remaining tests that needs adjusting in this repository.
I will provide a fix for a bug
- I will provide a fix for a bug
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the requisition worksheet scenario described: compare the selected price when the due date is the work date versus an earlier calculated order date. Inspect the requisition worksheet price-calculation path and the tests mentioned in microsoft/BusinessCentralApps#1869, especially those relying on past order dates. Done means prices are never selected from dates earlier than the work date and the affected tests pass.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100