brmbar-cli undo: New feature

This commit is contained in:
brmbar 2015-12-13 16:36:50 +01:00
parent feec2c9ac4
commit 3ea61f01d7
2 changed files with 22 additions and 0 deletions

View file

@ -31,6 +31,9 @@ Usage: brmbar-cli.py COMMAND ARGS...
screen of the GUI.
adduser USER
Add user (debt) account with given username.
undo TRANSID
Commit a transaction that reverses all splits of a transaction with
a given id (to find out that id: select * from transaction_cashsums;)
3. Inventorization
@ -152,6 +155,10 @@ elif sys.argv[1] == "adduser":
acct.add_barcode(sys.argv[2]) # will commit
print("{}: id {}".format(acct.name, acct.id));
elif sys.argv[1] == "undo":
newtid = shop.undo(int(sys.argv[2]))
print("Transaction %d undone by reverse transaction %d" % (int(sys.argv[2]), newtid))
elif sys.argv[1] == "inventory":
if (len(sys.argv) % 2 != 0 or len(sys.argv) < 4):
print ("Invalid number of parameters, count your parameters.")