feat(registrations): revenue and average order cards on the Registration page - #528
Merged
Merged
Conversation
…ion page get_event_ticket_types returns revenue per currency: amount collected, refunded, bookings and tickets, from paid, submitted bookings with a non-zero total. Offline bookings awaiting approval and free bookings are left out.
A row without a remove button (a locked currency) now keeps that button's width, so its fields match the other rows.
Contributor
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
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 changed
The Registration page gets Revenue and Average order cards above Ticket Types.
get_event_ticket_typesnow returnsrevenue: one row per currency withcollected,refunded,bookingsandtickets. Rows come from paid, submitted bookings with a non-zero total. The gate is the existingensure_event_team_access, so only team members see it.docstatus=1), sopayment_status="Paid"is the filter that keeps them out of revenue. Free bookings are left out too, so they don't drag down the average.Separate commit: price rows in the ticket type drawer line up. A locked currency row has no remove button, so it now keeps that button's width. Rows are also 8px apart instead of 2px.
PerkListshares the component.Not changed: a booking cancelled without a refund drops out of revenue (
docstatus=2) even though the money was kept.Event Booking.eventandEvent Ticket.bookinghave no index, so these queries scan both tables, like the existingtickets_sold_by_typealready does. Indexing is left for a follow-up.Demo
Testing
Checks:
test_ticket_types(9, 4 new inTestRegistrationRevenue) green on testbuzz. Removing the paid/free/cancelled filters makes the new tests fail. Typecheck and pre-commit clean. Not run: E2E, other test modules.