Bug 637846: Item Age Composition '...before' quantity reflected only last entry#9081
Bug 637846: Item Age Composition '...before' quantity reflected only last entry#9081alexei-dobriansky wants to merge 1 commit into
Conversation
…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>
Agentic PR Review - Round 1Recommendation: AcceptWhat this PR doesThis 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. SuggestionsNone. Risk assessment and necessityRisk: 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.
|
Fixes AB#637846
Report 5808 set the quantity buckets
InvtQty[1..5]/TotalInvtQtyper item ledger entry inCalcRemainingQty(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 intoInvtQtyTotal[]and bind the quantity columns (total toRemainingQty). Column names unchanged so layout bindings are preserved. Extends the report test.