mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 05:14:00 +02:00
brmbar v3 ItemEdit: New view for editing/restocking items (actual editing not supported yet)
This commit is contained in:
parent
db6d2fb372
commit
780395f877
2 changed files with 183 additions and 0 deletions
|
@ -23,6 +23,7 @@ class ShopAdapter(QtCore.QObject):
|
|||
def acct_inventory_map(self, acct):
|
||||
buy, sell = acct.currency.rates(currency)
|
||||
map = acct.__dict__.copy()
|
||||
map["balance"] = "{:.0f}".format(acct.balance())
|
||||
map["buy_price"] = str(buy)
|
||||
map["price"] = str(sell)
|
||||
return map
|
||||
|
@ -54,6 +55,10 @@ class ShopAdapter(QtCore.QObject):
|
|||
return { "acctype": "recharge", "amount": str(credit)+".00" }
|
||||
return self.acct_map(brmbar.Account.load_by_barcode(db, barcode))
|
||||
|
||||
@QtCore.Slot('QVariant', result='QVariant')
|
||||
def loadAccount(self, dbid):
|
||||
return self.acct_map(brmbar.Account.load(db, id = dbid))
|
||||
|
||||
@QtCore.Slot('QVariant', 'QVariant', result='QVariant')
|
||||
def sellItem(self, itemid, userid):
|
||||
user = brmbar.Account.load(db, id = userid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue