Skip to content

Bug 637846: Item Age Composition '...before' quantity reflected only last entry#9081

Draft
alexei-dobriansky wants to merge 1 commit into
mainfrom
bugs/637846-EASY-ItemAgeCompositionBeforeQty
Draft

Bug 637846: Item Age Composition '...before' quantity reflected only last entry#9081
alexei-dobriansky wants to merge 1 commit into
mainfrom
bugs/637846-EASY-ItemAgeCompositionBeforeQty

Conversation

@alexei-dobriansky

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

Copy link
Copy Markdown
Contributor

Fixes AB#637846

Report 5808 set the quantity buckets InvtQty[1..5]/TotalInvtQty per item ledger entry in CalcRemainingQty (clearing then setting one bucket) but output them once after the ILE loop, so quantities reflected only the last ILE. Value columns were correct because they accumulate with +=. Accumulate the quantities into InvtQtyTotal[] and bind the quantity columns (total to RemainingQty). Column names unchanged so layout bindings are preserved. Extends the report test.

…last entry

Report 5808 set the quantity buckets InvtQty[1..5]/TotalInvtQty per item ledger
entry in CalcRemainingQty (clearing then setting one bucket) but output them once
after the ILE loop, so quantities reflected only the last ILE. Value columns were
correct because they accumulate with +=. Accumulate the quantities into
InvtQtyTotal[] and bind the quantity columns (and the total to RemainingQty).
Column names are unchanged so the layout bindings are preserved.

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

What this PR does

This PR fixes Report 5808 so the quantity columns are accumulated across all open item ledger entries for the item, instead of showing the bucket values left by the last entry. The change matches the root cause in Bug 637846: CalcRemainingQty() clears and sets one per-entry bucket, while the dataset row is emitted after the item ledger entry loop.

The new InvtQtyTotal[1..5] is cleared per item and accumulated after each item ledger entry. TotalInvtQty is also bound to RemainingQty, which is already the per-item sum. This matches the obsolete quantity report pattern, keeps dataset column names stable for the Excel layout, and the added test would fail on the old last-entry behavior.

Suggestions

None.

Risk assessment and necessity

Risk: The change is limited to Report 5808 dataset quantities and its test code. It does not change public signatures, events, or layout field names. The extra work is a fixed five-bucket addition per item ledger entry, so the performance risk is very small.

Necessity: The linked bug has clear repro steps and shows a real customer-visible Excel quantity error for items with more than one remaining item ledger entry in the same aging bucket. Without this change, the report can continue to show only the last entry in the ...before quantity column, while the obsolete quantity report shows the correct sum.


[AI-PR-REVIEW] version=1 system=github pr=9081 round=1 by=alexei-dobriansky at=2026-07-06T09:01:35.0142190Z lastSha=6a6e3642ac70e0203b567aa0f67f937e24ca7495 suggestions=none

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