Add missing collateral changes for Transfer

This commit is contained in:
Petr Baudis 2015-12-13 16:10:03 +01:00 committed by brmbar
parent 5c84bd6a8f
commit 099d775102
3 changed files with 22 additions and 3 deletions

View file

@ -78,6 +78,10 @@ class Shop:
user.debit(transaction, credit, "Credit withdrawal")
self.db.commit()
def transfer_credit(self, userfrom, userto, amount):
self.add_credit(amount, userto)
self.withdraw_credit(amount, userfrom)
def buy_for_cash(self, item, amount = 1):
# Buy: Currency conversion from item currency to shop currency
(buy, sell) = item.currency.rates(self.currency)