Prevent math errors in calculating ticket 'turnover'
This commit is contained in:
parent
d0f673b73d
commit
3031bb43cf
5 changed files with 7 additions and 13 deletions
|
|
@ -71,11 +71,6 @@ class TicketPurchase < ApplicationRecord
|
|||
purchase
|
||||
end
|
||||
|
||||
# Total amount
|
||||
def self.total
|
||||
sum('amount_paid * quantity')
|
||||
end
|
||||
|
||||
def pay(payment)
|
||||
update_attributes(paid: true, payment: payment)
|
||||
PhysicalTicket.transaction do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue