Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report to forecast near term cash flow #72

Open
vomikan opened this issue Jan 20, 2021 · 0 comments
Open

Report to forecast near term cash flow #72

vomikan opened this issue Jan 20, 2021 · 0 comments

Comments

@vomikan
Copy link
Member

vomikan commented Jan 20, 2021

I had a desire for a report to forecast my cash flow for the next month. The Upcoming Transactions pane on the MMEX home page does not forecast far enough ahead for my desires. The built-in Cash Flow report when the Monthly option is selected gives you the aggregate information but I wanted detail lines as well as the total. I hope other MMEX users find this helpful. And I would appreciate your telling me if you find any errors. Thank you very much.

SELECT TRANSDATE, b.PAYEENAME AS PAYEES, case when TRANSCODE = 'Deposit' then TRANSAMOUNT else NULL end AS CREDITS, case when TRANSCODE = 'Withdrawal' then -TRANSAMOUNT else NULL end AS DEBITS FROM BILLSDEPOSITS_V1 a join payee_v1 b USING(PAYEEID)
WHERE TRANSDATE < date('now','+32 days') 
UNION ALL
SELECT date('now','+32 days') AS TRANSDATE, ' '  AS PAYEES, NULL AS CREDITS, ' ' AS DEBITS 
UNION ALL
SELECT date('now','+32 days')  AS TRANSDATE, ' ' AS PAYEES, NULL AS CREDITS, ' ' AS DEBITS 
UNION ALL
SELECT  date('now', '+32 days' ) AS TRANSDATE, 'TOTAL NEAR TERM EXPENSES' AS PAYEES, NULL AS CREDITS, sum(case when TRANSCODE = 'Withdrawal' then -TRANSAMOUNT else 0 end )  AS DEBITS FROM BILLSDEPOSITS_V1 WHERE TRANSDATE < date('now','+32 days') 
UNION ALL
SELECT date('now','+32 days' ) AS TRANSDATE, 'TOTAL NEAR TERM INCOME' AS PAYEES, sum(case when TRANSCODE = 'Deposit' then TRANSAMOUNT else 0 end )  AS CREDITS, NULL AS DEBITS FROM BILLSDEPOSITS_V1 WHERE TRANSDATE < date('now','+32 days')  ORDER BY TRANSDATE

https://forum.moneymanagerex.org/viewtopic.php?f=16&t=9580

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant