mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-07 21:04:00 +02:00
runtime sql error fixed
This commit is contained in:
parent
96bf23662e
commit
5bc7b0e004
1 changed files with 1 additions and 1 deletions
|
@ -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 -%s ELSE %s END)", [side,amount,amount])
|
||||
|
||||
def add_barcode(self, barcode):
|
||||
self.db.execute("INSERT INTO barcodes (account, barcode) VALUES (%s, %s)", [self.id, barcode])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue