Skip to content

[Master]-When we run the Order Planning Worksheet by Project, a supply suggestion is created for items that are already received but not invoiced in Purchase Orders, but only after updating Order and Posting Dates on Purchase Order. - #10225

Merged
neeleshsinghal merged 1 commit into
mainfrom
bugs/Bug-646661-Order-Planning-by-Project-Not-already-received-but-not-invoiced
Aug 14, 2026

Conversation

@neeleshsinghal

@neeleshsinghal neeleshsinghal commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#646661

@neeleshsinghal
neeleshsinghal requested a lite review from Copilot August 13, 2026 09:12
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 13, 2026
@github-actions github-actions Bot added the SCM GitHub request for SCM area label Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an Order Planning (by Project/Job Demand) issue where supply could be re-suggested for Purchase Order quantities that were already received but not invoiced after updating PO Order/Posting Dates.

Changes:

  • Update Job Demand netting to also account for Qty. Rcd. Not Invoiced (Base) when computing remaining needed quantity.
  • Add a regression test covering the “received-not-invoiced after date change” scenario and a confirm handler used by the test run.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Layers/W1/Tests/SCM-Planning/SCMOrderPlanningI.Codeunit.al Adds a regression test for AB#646661 and introduces a generic confirm handler used by the test.
src/Layers/W1/BaseApp/Inventory/Requisition/GetUnplannedDemand.Codeunit.al Adjusts Job Planning Line needed-qty calculation to net against received-not-invoiced purchase quantities.
Suppressed comments (1)

src/Layers/W1/Tests/SCM-Planning/SCMOrderPlanningI.Codeunit.al:43

  • The ValidationError label contains a double space after %1, which makes assertion messages look malformed.
        ValidationError: Label '%1  must be %2 in %3.';

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Layers/W1/Tests/SCM-Planning/SCMOrderPlanningI.Codeunit.al
@neeleshsinghal
neeleshsinghal marked this pull request as ready for review August 13, 2026 11:02
@neeleshsinghal
neeleshsinghal requested a review from a team August 13, 2026 11:02
Comment thread src/Layers/W1/Tests/SCM-Planning/SCMOrderPlanningI.Codeunit.al
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Accept

What this PR does

This PR fixes Order Planning for Job Demand so a purchase order line that is received but not invoiced is still counted as supply for the related project planning line. The change is in the early demand gate in GetUnplannedDemand, so the job demand is not inserted when the only remaining quantity is already covered by outstanding or received-not-invoiced purchase quantity. The added test follows the reported date-change scenario and checks that the second calculation creates no requisition lines.

Suggestions

No suggestions.

Risk assessment and necessity

Risk: This is planning logic for project-related purchase supply. A wrong result can create an extra purchase suggestion, but the change is narrow: it reads one existing Purchase Line quantity field using the same job, task, planning line, and item filters already used for outstanding quantity. There is no public API change, no event signature change, and no posting code is changed.

Necessity: The work item gives a clear customer repro where changing dates on a purchase order makes Order Planning suggest supply that has already been received. The fix is needed because the later received-not-invoiced reduction is date-filtered, while this early gate decides whether the job demand is inserted at all.


[AI-PR-REVIEW] version=1 promptVersion=2 system=github pr=10225 round=1 by=alexei-dobriansky at=2026-08-14T08:44:54.7364401Z lastSha=0060d4a077bfa03a38fdb95b393eddccee187920 reviewKey=na suggestions=

@neeleshsinghal
neeleshsinghal added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit 413dd23 Aug 14, 2026
494 of 506 checks passed
@neeleshsinghal
neeleshsinghal deleted the bugs/Bug-646661-Order-Planning-by-Project-Not-already-received-but-not-invoiced branch August 14, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants