[Main] - Posting from Released production order affects Firm planned production order with same ID.#9670
Open
DhavalMore88 wants to merge 3 commits into
Conversation
…Released-production-order
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.
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.