Skip to content

[Main] - Posting from Released production order affects Firm planned production order with same ID.#9670

Open
DhavalMore88 wants to merge 3 commits into
microsoft:mainfrom
DhavalMore88:bugs/Bug-643265-Main-Posting-from-Released-production-order
Open

[Main] - Posting from Released production order affects Firm planned production order with same ID.#9670
DhavalMore88 wants to merge 3 commits into
microsoft:mainfrom
DhavalMore88:bugs/Bug-643265-Main-Posting-from-Released-production-order

Conversation

@DhavalMore88

@DhavalMore88 DhavalMore88 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Bug 643265: [ALL-E][Main] Posting from Released production order affects Firm planned production order with same ID.

AB#643265

Issue: When a Firm Planned production order shares the same No. as a Released order, refreshing the Firm Planned order corrupts its allocated capacity. The Prod. Order Capacity Need."Allocated Time" is reduced by the other (Released) order's posted capacity, so the Firm Planned order shows less remaining load than it actually has.

Cause: In CalcActuallyPostedCapacityTime in CalculateRoutingLine.Codeunit.al, the Capacity Ledger Entry records are read by "Order No." (plus routing/operation keys) with no production-order-status distinction. Since the ledger has no status field and entries only ever belong to Released/Finished orders, a Firm Planned routing line wrongly sums the same-numbered Released order's entries. That value feeds InitProdOrderCapNeed as Allocated Time := NeededTime - ActuallyPostedTime, corrupting the Firm Planned order's capacity need.

Solution: Added a status guard at the top of CalcActuallyPostedCapacityTime that returns 0 when the routing line's Status is not Released or Finished. This ensures Firm Planned/Planned/Simulated orders never read capacity ledger entries (which can only exist for postable orders), so their allocated capacity is initialized to the full needed time and is unaffected by any same-numbered Released order.

@github-actions github-actions Bot added From Fork Pull request is coming from a fork SCM GitHub request for SCM area Linked Issue is linked to a Azure Boards work item labels Jul 22, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 22, 2026
@DhavalMore88 DhavalMore88 reopened this Jul 23, 2026
@DhavalMore88
DhavalMore88 marked this pull request as ready for review July 23, 2026 13:36
@DhavalMore88
DhavalMore88 requested a review from a team July 23, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

From Fork Pull request is coming from a fork Linked Issue is linked to a Azure Boards work item SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant