---
id: change/bcapps/9670
type: change
title: "#9670 [Main] - Posting from Released production order affects Firm planned production order with same ID."
summary: A status check was added to prevent Firm Planned production orders from incorrectly reading capacity ledger entries of same-numbered Released orders, which was causing their allocated capacity to be miscalculated.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit calculate routing line
system: manufacturing
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:11:15.454Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 92bfda9f5caa0e8565aafdf0294874d71ac841c0
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9670
    title: "microsoft/BCApps#9670: [Main] - Posting from Released production order affects Firm planned production order with same ID."
    date: "2026-07-27"
    commit: 92bfda9f5caa0e8565aafdf0294874d71ac841c0
    t: null
    quote: Added a status guard at the top of CalcActuallyPostedCapacityTime that returns 0 when the routing line's Status is not Released or Finished.
links:
  learn: []
  objects:
    - object/codeunit/99000774
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9670
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9670
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-27T15:53:15Z"
author: DhavalMore88
author_type: User
community_contribution: true
labels:
  - "ADO: Sync"
  - From Fork
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 67
  deletions: 0
  al: 1
apps:
  - Base Application
objects_touched:
  - key: codeunit/99000774
    page: codeunit/99000774
    type: codeunit
    id: 99000774
    name: Calculate Routing Line
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 643265
systems:
  - manufacturing
quote: Added a status guard at the top of CalcActuallyPostedCapacityTime that returns 0 when the routing line's Status is not Released or Finished.
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

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

> A status check was added to prevent Firm Planned production orders from incorrectly reading capacity ledger entries of same-numbered Released orders, which was causing their allocated capacity to be miscalculated.

[Pull request](https://github.com/microsoft/BCApps/pull/9670) · merged into `main` (BC30) on 2026-07-27 by DhavalMore88 (community contribution) · 2 files (+67 -0), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Added status guard in CalcActuallyPostedCapacityTime that returns 0 for non-Released/Finished statuses
- Prevents Firm Planned, Planned, and Simulated orders from reading capacity ledger entries
- Ensures allocated capacity for Firm Planned orders is calculated correctly as full needed time
- Fixes data corruption where allocated time was wrongly reduced by another order's posted capacity
- Test coverage added for the capacity requirements scenario
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 99000774 "Calculate Routing Line"](../../objects/codeunit/99000774.md), Base Application: modified

## Context

- Work items: AB#643265
- Labels: ADO: Sync, From Fork, Team: SCM
- Systems: manufacturing
- From the description: "Added a status guard at the top of CalcActuallyPostedCapacityTime that returns 0 when the routing line's Status is not Released or Finished."

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
