mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 05:14:00 +02:00
uncommitted changes from other people...
This commit is contained in:
parent
6208ae6027
commit
466b92e7c2
3 changed files with 6 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue