Add description to output tables
This commit is contained in:
parent
2875ed82a4
commit
cde3a6ea71
12
src/db.py
12
src/db.py
@ -44,6 +44,7 @@ def create_tables(cursor: sqlite3.Cursor) -> None:
|
|||||||
(
|
(
|
||||||
id integer,
|
id integer,
|
||||||
date text,
|
date text,
|
||||||
|
description text,
|
||||||
comment text,
|
comment text,
|
||||||
cleared integer,
|
cleared integer,
|
||||||
tags text
|
tags text
|
||||||
@ -57,6 +58,7 @@ def create_tables(cursor: sqlite3.Cursor) -> None:
|
|||||||
(
|
(
|
||||||
transaction_id integer,
|
transaction_id integer,
|
||||||
date text,
|
date text,
|
||||||
|
description text,
|
||||||
account text,
|
account text,
|
||||||
amount real,
|
amount real,
|
||||||
cleared integer,
|
cleared integer,
|
||||||
@ -106,14 +108,15 @@ def write_transactions(cursor: sqlite3.Cursor, txs: List[Transaction]) -> None:
|
|||||||
"""
|
"""
|
||||||
INSERT INTO transactions
|
INSERT INTO transactions
|
||||||
(
|
(
|
||||||
id, date, comment, cleared, tags
|
id, date, description, comment, cleared, tags
|
||||||
) VALUES (
|
) VALUES (
|
||||||
?, ?, ?, ?, ?
|
?, ?, ?, ?, ?, ?
|
||||||
)
|
)
|
||||||
""",
|
""",
|
||||||
[
|
[
|
||||||
transaction.get("tindex"),
|
transaction.get("tindex"),
|
||||||
transaction.get("tdate"),
|
transaction.get("tdate"),
|
||||||
|
transaction.get("tdescription"),
|
||||||
comment,
|
comment,
|
||||||
transaction.get("tstatus"),
|
transaction.get("tstatus"),
|
||||||
",".join(transaction.get("ttags") or []),
|
",".join(transaction.get("ttags") or []),
|
||||||
@ -143,14 +146,15 @@ def write_transactions(cursor: sqlite3.Cursor, txs: List[Transaction]) -> None:
|
|||||||
"""
|
"""
|
||||||
INSERT INTO postings
|
INSERT INTO postings
|
||||||
(
|
(
|
||||||
transaction_id, date, account, amount, cleared, tags, comment
|
transaction_id, date, description, account, amount, cleared, tags, comment
|
||||||
) VALUES (
|
) VALUES (
|
||||||
?, ?, ?, ?, ?, ?, ?
|
?, ?, ?, ?, ?, ?, ?, ?
|
||||||
)
|
)
|
||||||
""",
|
""",
|
||||||
[
|
[
|
||||||
transaction.get("tindex"),
|
transaction.get("tindex"),
|
||||||
transaction.get("tdate"),
|
transaction.get("tdate"),
|
||||||
|
transaction.get("tdescription"),
|
||||||
posting.get("paccount"),
|
posting.get("paccount"),
|
||||||
get_posting_amount(posting),
|
get_posting_amount(posting),
|
||||||
status,
|
status,
|
||||||
|
Reference in New Issue
Block a user