Skip to content

Bug 598820: Item Availability by Event from Prod. Order ignores demand after Due Date#9075

Open
alexei-dobriansky wants to merge 1 commit into
mainfrom
bugs/598820-EASY-ItemAvailabilityByEvent
Open

Bug 598820: Item Availability by Event from Prod. Order ignores demand after Due Date#9075
alexei-dobriansky wants to merge 1 commit into
mainfrom
bugs/598820-EASY-ItemAvailabilityByEvent

Conversation

@alexei-dobriansky

@alexei-dobriansky alexei-dobriansky commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#598820

Fixes bug 598820: "Item Availability by Event" from a Production Order only shows events up to the Due Date.

Problem

Opening Item Availability by Event from a Prod. Order line/component calls ItemAvailabilityFormsMgt.FilterItem(...) which sets Item.SetRange("Date Filter", 0D, DueDate). The event calculation honors that upper bound (ToDate := Item.GetRangeMax("Date Filter")), so any demand/supply dated after the Due Date is dropped. The Item Card and by-Period paths do not set that bound.

Fix

Clear Item."Date Filter" in both AvailabilityType::"Event" branches (ShowItemAvailFromProdOrderLine and ShowItemAvailFromProdOrderComp) before calling ShowItemAvailabilityByEvent, so the prod-order Event view matches the Item Card / by-Period views.

Test

Adds ItemAvailByEventFromProdOrderLineShowsDemandAfterDueDate to CU 137009 SCM Availability by Event: an item with a sales order dated one month after a Firm Planned prod order's Due Date; opening availability-by-Event from the prod-order line asserts the later sales demand is present (absent before the fix).

…d after Due Date

Opening Item Availability by Event from a Prod. Order line/component set
Item."Date Filter" to 0D..Due Date via FilterItem, so the event calc dropped
all demand/supply dated after the Due Date. Clear the Date Filter in both Event
branches so the view matches the Item Card / by-Period paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@alexei-dobriansky alexei-dobriansky added the SCM GitHub request for SCM area label Jul 3, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 3, 2026
@alexei-dobriansky alexei-dobriansky self-assigned this Jul 3, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor Author

Agentic PR Review - Round 1

Recommendation: Accept with Suggestions

What this PR does

This clears the Item."Date Filter" before opening Item Availability by Event from production order lines and components, so event calculation is no longer capped at 0D..Due Date. That matches the Period view, which clears the date filter inside ShowItemAvailabilityByPeriod, and it matches the requisition line Event path, which clears the date filter before ShowItemAvailabilityByEvent.

The bug scenario is valid: the linked Bug has clear repro steps and an [AI-REPRO] comment showing that demand after the production order Due Date is hidden from Event but shown from Period and the Item Card. The line test covers the main repro and should fail before this fix because the later sales order is filtered out. The component branch uses the same fix shape, but it is not directly covered by the new test.

Suggestions

S1 - Cover the component event path
The fix also changes ShowItemAvailFromProdOrderComp, but the new test only opens Event from a production order line. Add a small regression test for the component action so both changed branches are protected.

Risk assessment and necessity

Risk: Low to medium. The change is narrow and does not change tables or public signatures, but it changes the date scope for Event availability from production order lines and components. IntegrationEvent subscribers that set Item."Date Filter" in the production-order OnBefore... events could be affected because the clear happens after those events.

Necessity: High. This is a customer-case Bug with detailed repro steps, and the current Event view can hide demand after the production order Due Date. Without this fix, users must change the Due Date or open availability from the Item Card to see the missing events.


[AI-PR-REVIEW] version=1 system=github pr=9075 round=1 by=alexei-dobriansky at=2026-07-06T09:04:35Z lastSha=39269456c3b515174d9bb502cebd6983660a84dc suggestions=S1

@alexei-dobriansky alexei-dobriansky marked this pull request as ready for review July 6, 2026 14:13
@alexei-dobriansky alexei-dobriansky requested a review from a team July 6, 2026 14:13
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 1 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

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.

1 participant