diff --git a/brmbar3/brmbar/Account.py b/brmbar3/brmbar/Account.py index b22c041..d474e6c 100644 --- a/brmbar3/brmbar/Account.py +++ b/brmbar3/brmbar/Account.py @@ -66,7 +66,7 @@ class Account: """ Common part of credit() and debit(). """ self.db.execute("INSERT INTO transaction_splits (transaction, side, account, amount, memo) VALUES (%s, %s, %s, %s, %s)", [transaction, side, self.id, amount, memo]) - self.db.execute("UPDATE accounts set crbalance = crbalance - (CASE WHEN %s = 'credit' THEN -amount ELSE amount END)", [side]) + self.db.execute("UPDATE accounts set crbalance = crbalance - (CASE WHEN %s = 'credit' THEN -amount ELSE amount END)", [side]) def add_barcode(self, barcode): self.db.execute("INSERT INTO barcodes (account, barcode) VALUES (%s, %s)", [self.id, barcode]) diff --git a/brmbar3/brmbar/Shop.py b/brmbar3/brmbar/Shop.py index 1adcdbf..a170fcd 100644 --- a/brmbar3/brmbar/Shop.py +++ b/brmbar3/brmbar/Shop.py @@ -135,7 +135,7 @@ class Shop: """list all accounts (people or items, as per acctype)""" accts = [] cur = self.db.execute_and_fetchall("SELECT id FROM accounts WHERE acctype = %s AND name ILIKE %s ORDER BY name ASC", [acctype, like_str]) - #FIXME: sanitize input like_str ^ + #FIXME: sanitize input like_str ^ for inventory in cur: accts += [ Account.load(self.db, id = inventory[0]) ] return accts