brmbar v3 Withdraw: New view for user withdrawal of previously added money

This commit is contained in:
Petr Baudis 2012-09-24 04:40:56 +02:00
parent eda6eaf9e4
commit 83735fec98
4 changed files with 128 additions and 5 deletions

View file

@ -67,6 +67,12 @@ class ShopAdapter(QtCore.QObject):
shop.add_credit(credit = credit, user = user)
return user.negbalance_str()
@QtCore.Slot('QVariant', 'QVariant', result='QVariant')
def withdrawCredit(self, credit, userid):
user = brmbar.Account.load(db, id = userid)
shop.withdraw_credit(credit = credit, user = user)
return user.negbalance_str()
@QtCore.Slot(result='QVariant')
def balance_cash(self):
return shop.cash.balance_str()