forked from brmlab/brmbar-github
sign fix (credit vs. debit)
This commit is contained in:
parent
15bb03e5fe
commit
0d2bb2eed7
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 -amount ELSE amount END)", [side])
|
||||
|
||||
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