From 22503c242fe04ba6da8fcb49fc6c435d7eb01378 Mon Sep 17 00:00:00 2001 From: brmbar Date: Sun, 11 Aug 2013 23:07:26 +0200 Subject: [PATCH] USAGE: + recipe to list all cash transactions --- brmbar3/USAGE.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/brmbar3/USAGE.md b/brmbar3/USAGE.md index 11eeec2..7076bc9 100644 --- a/brmbar3/USAGE.md +++ b/brmbar3/USAGE.md @@ -83,7 +83,7 @@ Useful SQL queries select sum(amount) from transactions left join transaction_splits on transaction_splits.transaction = transactions.id - where description like '% sale %' and side = 'debit';` + where description like '% sale %' and side = 'debit'; * List of items not covered by inventory check: @@ -91,5 +91,10 @@ Useful SQL queries where id not in (select account from transactions left join transaction_splits on transaction_splits.transaction = transactions.id where description like '% inventory %') - and acctype = 'inventory' + and acctype = 'inventory'; +* List all cash transactions: + + select time, transactions.id, description, responsible, amount from transactions + left join transaction_splits on transaction_splits.transaction = transactions.id + where transaction_splits.account = 1;