1
0

Add description to output tables

This commit is contained in:
Tony Grosinger 2022-07-25 15:13:07 -07:00
parent 2875ed82a4
commit cde3a6ea71

View File

@ -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,