mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Add total amount spent by user
User can see the total amount that he paid for the tickets and total amount spent by him on each ticket
This commit is contained in:
parent
b761e83b45
commit
0d70832f5b
4 changed files with 10 additions and 4 deletions
|
|
@ -27,8 +27,9 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
@total_price = Ticket.total_price(@conference, current_user, paid: true)
|
||||
@total_price = Ticket.total_price_user(@conference, current_user, paid: true)
|
||||
@tickets = current_user.ticket_purchases.by_conference(@conference).paid
|
||||
@total_price_per_ticket = @tickets.group(:ticket_id).sum('amount_paid * quantity')
|
||||
@ticket_payments = @tickets.group_by(&:ticket_id)
|
||||
@total_quantity = @tickets.group(:ticket_id).sum(:quantity)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue