WAIT-AMYBE NOT: Add unallocated direct payments to the dashboard equation#1843
Draft
maebeale wants to merge 1 commit into
Draft
WAIT-AMYBE NOT: Add unallocated direct payments to the dashboard equation#1843maebeale wants to merge 1 commit into
maebeale wants to merge 1 commit into
Conversation
The grand-total equation already surfaced bulk-payment money still waiting to be applied. Direct (non-bulk) payments with a leftover balance — e.g. an overpaying registrant — were invisible, so the equation understated cash on hand. Add a parallel term beside the bulk one that links to the payments index filtered to unallocated payments. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the goal of this PR and why is this important?
How did you approach the change?
EventDashboard#unallocated_direct_payment_centsmirroringunallocated_bulk_payment_cents, and folded it intogrand_total_cents.direct_payments: payments that source an allocation to one of the event's active registrations, withamount_cents_remaining > 0, excluding bulk payments so their remainder is never double-counted.events/dashboard.html.erb, shown only when the figure is positive, linking to the payments index filtered to unallocated payments (payments_path(has_remaining: "yes")). Updated the mobile equation label too.Anything else to add?
WAIT): the link target is the global payments index (has_remaining=yes), not event-scoped — the payments index has no event filter, so the list it opens shows unallocated payments across all events while the dashboard figure is this-event-only. The number and the list won't be a perfect 1:1. If we want them to agree, we'd add an event filter toPayment.search_by_params.amount_cents_remainingto the full amount on fully-allocated payments; theAllocationafter_createcallback already decrements that to 0, so values were harmless before but now feed the new figure — left them as realistic full-amount values and let the callback do the math.🤖 Generated with Claude Code