[Master]-Slice 425446: Payment Journal Batch Total - #10538
[Master]-Slice 425446: Payment Journal Batch Total#10538ViditGupta1277 wants to merge 2 commits into
Conversation
Agentic PR Review - Round 1Recommendation: Request ChangesWhat this PR doesThis Slice adds a Batch Total (LCY) field to Payment Journal pages across localized layers, backed by GenJnlManagement.CalcBatchTotal, and adds tests for totals, empty batches, batch changes, and amount edits. The feature goal is valid: users need a batch-level payment total before posting. The sum itself uses the current page filters and Amount (LCY), which matches the stated batch-total behavior. The main correctness risk is that the page recalculates the total during amount field validation by reading persisted lines, but the edited line has not been explicitly saved first. SuggestionsS1 - Save before recalculating edited amounts S2 - Avoid extra full-batch sums per edit S3 - Document new public extension points Risk assessment and necessityRisk: This is a financial UI surface, so a stale Batch Total can mislead users about the amount selected for payment before posting. The diff does not change posting or ledger-entry creation, but it adds a public helper and event publishers and it runs extra aggregate calculations on Payment Journal navigation and amount validation in all localized page copies. Necessity: The change is justified by Slice 425446 and the Ideas-site request: Balance and Total Balance do not answer the batch-level payment-total question. The scope is mostly right because all Payment Journal page copies are covered and tests were added, but the edited-line refresh path should be fixed before merge.
|
|
UpdateBalance now unconditionally calls UpdateBatchTotal on every current-record refresh and OnNewRecord. That means each row navigation/new line adds another full filtered CalcSums over Gen. Journal Line on top of the existing CalcBalance work, and the same pattern is duplicated across all localized Payment Journal page copies in this PR. Compute Batch Total only when the batch/filter context changes, or fold it into the existing balance calculation instead of issuing a third aggregate query per refresh. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.35.4 |
Agentic PR Review - Round 2Recommendation: Accept with SuggestionsWhat this PR doesThis round updates the Payment Journal Batch Total implementation after round 1. Amount validation now saves the current line and refreshes only Batch Total, so the edited amount is included without forcing the full balance refresh path. The new Batch Total filter hook events were also removed. The feature still matches the Slice goal: show the total selected for payment at batch level, with tests for totals, empty batches, batch switching, and amount edits. Status of previous suggestions
New observations (commits since round 1)None - the new commit only addresses prior review feedback. Risk assessment and necessityRisk: This is a financial UI surface, so a wrong or stale Batch Total can mislead users before posting. The round-2 change lowers the main correctness risk by saving the edited line before recalculating. It does not change posting or ledger entries. One non-blocking maintainability issue remains: the new public Necessity: The Slice remains justified by the Ideas-site request. Balance and Total Balance do not show the batch-level amount selected for payment, and the scope covers the Payment Journal page copies plus relevant tests.
|
Fixes AB#425446
Requirement:
Would be nice to have a Batch Total for Payment Journal. Currently, have to post a payment journal before knowing how much was selected for payment.
Balance and Total Balance is only related to balancing the transaction for each row and not useful for batch totals.