uncommitted changes from other people...

This commit is contained in:
brmbar 2016-08-19 04:26:40 +02:00
parent 6208ae6027
commit 466b92e7c2
3 changed files with 6 additions and 5 deletions

View file

@ -109,7 +109,7 @@ CREATE VIEW transaction_nicesplits AS
-- List transactions with summary information regarding their cash element.
CREATE VIEW transaction_cashsums AS
SELECT t.id AS id, t.time AS time, SUM(credit_cash) AS cash_credit, SUM(debit_cash) AS cash_debit, t.description AS description
SELECT t.id AS id, t.time AS time, SUM(credit_cash) AS cash_credit, SUM(debit_cash) AS cash_debit, a.name AS responsible, t.description AS description
FROM transactions AS t
LEFT JOIN (SELECT cts.amount AS credit_cash, cts.transaction AS cts_t
FROM transaction_nicesplits AS cts
@ -123,4 +123,5 @@ CREATE VIEW transaction_cashsums AS
WHERE a.currency = (SELECT currency FROM accounts WHERE name = 'BrmBar Cash')
AND a.acctype IN ('cash', 'debt')
AND dts.amount > 0) debit ON dts_t = t.id
GROUP BY t.id ORDER BY t.id DESC;
LEFT JOIN accounts AS a ON a.id = t.responsible
GROUP BY t.id, a.name ORDER BY t.id DESC;

View file

@ -147,9 +147,9 @@ elif sys.argv[1] == "userlog":
acct = load_user(sys.argv[2])
timestamp = sys.argv[3]
res = db.execute_and_fetchall("SELECT transactions.time,transactions.description FROM transactions INNER JOIN accounts ON accounts.id=transactions.responsible WHERE accounts.name=%s and time > TIMESTAMP %s ORDER BY time", [acct.name,timestamp])
res = db.execute_and_fetchall("SELECT * FROM transaction_cashsums WHERE responsible=%s and time > TIMESTAMP %s ORDER BY time", [acct.name,timestamp])
for transaction in res:
print("{}\t{}\t".format(transaction[0],transaction[1]))
print('\t'.join([str(f) for f in transaction]))
elif sys.argv[1] == "iteminfo":
acct = load_item(sys.argv[2])

View file

@ -58,6 +58,6 @@ Item {
x: 65
y: 438
width: 1150
text: "* Mroze a Termixy najdes v lednici *"
text: "* Za uklid brmlabu vam nabijeme kredit. *"
}
}