Add a parameter for financial_link to Ordergroup.add_financial_transaction

This commit is contained in:
Patrick Gansterer 2017-10-28 20:54:08 +02:00
parent 9f2e5bb992
commit f209f4907e
1 changed files with 3 additions and 3 deletions

View File

@ -55,9 +55,9 @@ class Ordergroup < Group
# Creates a new FinancialTransaction for this Ordergroup and updates the account_balance accordingly.
# Throws an exception if it fails.
def add_financial_transaction!(amount, note, user)
transaction do
t = FinancialTransaction.new(:ordergroup => self, :amount => amount, :note => note, :user => user)
def add_financial_transaction!(amount, note, user, link = nil)
transaction do
t = FinancialTransaction.new(ordergroup: self, amount: amount, note: note, user: user, financial_link: link)
t.save!
self.account_balance = financial_transactions.sum('amount')
save!