1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-03 12:48:38 -04:00

Add more sample reports

Also switch tabs to spaces in existing sample reports
This commit is contained in:
2017-07-13 21:38:30 -04:00
parent f213e1061c
commit 8f884f7a69
7 changed files with 314 additions and 91 deletions

View File

@ -1,26 +1,26 @@
function generate()
year = date.now().year
year = date.now().year
accounts = get_accounts()
t = tabulation.new(12)
t:title(year .. " Monthly Cash Flow")
series = t:series("Income minus expenses")
accounts = get_accounts()
t = tabulation.new(12)
t:title(year .. " Monthly Cash Flow")
series = t:series("Income minus expenses")
for month=1,12 do
begin_date = date.new(year, month, 1)
end_date = date.new(year, month+1, 1)
for month=1,12 do
begin_date = date.new(year, month, 1)
end_date = date.new(year, month+1, 1)
t:label(month, tostring(begin_date))
cash_flow = 0
t:label(month, tostring(begin_date))
cash_flow = 0
for id, acct in pairs(accounts) do
if acct.type == account.Expense or acct.type == account.Income then
balance = acct:balance(begin_date, end_date)
cash_flow = cash_flow - balance.amount
end
end
series:value(month, cash_flow)
end
for id, acct in pairs(accounts) do
if acct.type == account.Expense or acct.type == account.Income then
balance = acct:balance(begin_date, end_date)
cash_flow = cash_flow - balance.amount
end
end
series:value(month, cash_flow)
end
return t
return t
end