Add original and additional comment columns do DB
To have cleared information on manually added transactions to the database, this patch adds the original column so those added after the parsing can be marked as such. Also adds a column to add comments to transaction, when they are not explicit from the transaction message.
This commit is contained in:
parent
865874f637
commit
a1f5699b12
@ -20,12 +20,14 @@ sqlite3.register_adapter(Decimal, lambda d: float(d))
|
|||||||
__DB_NAME = "data.db"
|
__DB_NAME = "data.db"
|
||||||
|
|
||||||
CREATE_TRANSACTIONS_TABLE = """
|
CREATE_TRANSACTIONS_TABLE = """
|
||||||
CREATE TABLE IF NOT EXISTS transactions (
|
CREATE TABLE IF NOT EXISTS "transactions" (
|
||||||
date TEXT NOT NULL,
|
"date" TEXT NOT NULL,
|
||||||
description TEXT,
|
"description" TEXT,
|
||||||
bank TEXT,
|
"bank" TEXT NOT NULL,
|
||||||
value REAL NOT NULL,
|
"value" REAL NOT NULL,
|
||||||
category TEXT
|
"category" TEXT,
|
||||||
|
"original" TEXT,
|
||||||
|
"additional comments" TEXT
|
||||||
);
|
);
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,8 @@ class Transaction:
|
|||||||
self.bank = ""
|
self.bank = ""
|
||||||
self.value = 0
|
self.value = 0
|
||||||
self.category = None
|
self.category = None
|
||||||
|
self.original = ""
|
||||||
|
self.additional_comment = ""
|
||||||
|
|
||||||
arg = args[0] if len(args) == 1 else list(args)
|
arg = args[0] if len(args) == 1 else list(args)
|
||||||
try:
|
try:
|
||||||
@ -29,6 +31,8 @@ class Transaction:
|
|||||||
else:
|
else:
|
||||||
self.value = Decimal(args[3])
|
self.value = Decimal(args[3])
|
||||||
self.category = arg[4]
|
self.category = arg[4]
|
||||||
|
self.original = arg[5]
|
||||||
|
self.additional_comment = arg[6]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
pass
|
pass
|
||||||
except InvalidOperation:
|
except InvalidOperation:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user