-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
add monthly income-expense report #88
Conversation
Thanks for taking the time to submit this pull request @kain88-de, great stuff.
I don't think we need more report tests yet, while we're still figuring out what reports people want. But I noticed the change didn't compile - luckily it looks as if we need a very small change to get it to compile. I noticed the commit was done via the Github web interface - can you compile it on your own machine? |
src/Hledger/Flow/Reports.hs
Outdated
@@ -59,7 +59,7 @@ generateReports' opts ch = do | |||
ownerParams <- ownerParameters opts ch owners | |||
let ownerWithAggregateParams = (if length owners > 1 then [aggregateParams] else []) ++ ownerParams | |||
let sharedOptions = ["--pretty-tables", "--depth", "2"] | |||
let ownerWithAggregateReports = List.concat $ fmap (reportActions opts ch [incomeStatement sharedOptions, balanceSheet sharedOptions]) ownerWithAggregateParams | |||
let ownerWithAggregateReports = List.concat $ fmap (reportActions opts ch [incomeStatement incomeMonthlyStatement sharedOptions, balanceSheet sharedOptions]) ownerWithAggregateParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list [incomeStatement sharedOptions, balanceSheet sharedOptions]
(baseline code) is a list of ReportGenerator
s
In Haskell incomeStatement sharedOptions
means we are supplying one argument (sharedOptions
) to the function named incomeStatement
, and in this case the result type is then ReportGenerator
.
To use your new monthly function, I think you should add an element to the list like this:
[incomeStatement sharedOptions, incomeMonthlyStatement sharedOptions, balanceSheet sharedOptions]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah thanks, I overlooked that yesterday. This also explains where the sharedOptions come from. I was wondering where that variable comes from.
Another reason to compile it yourself is so that you can run it first and look at the results. A lot of the time when I look at the output of what I did it triggers ideas to do it better, or I find out that I actually want to do something a bit differently. |
My monthly income and expenses vary a bit during the year. I usually generate this report manually to know which month has been expensive and check if the income looks reasonable for each month. This level of detail is a lot more helpful for me to see how I am doing in the current year.
Normally I do that too. I'm just trying to do it extra hard and try to run all my builds in Docker containers or VMs. |
Thanks @kain88-de, it is merged. I want to make a small change before this is released. Instead of the current The above example would then become If you want to do it please let me know, otherwise I will look at it when I get a chance. |
I'm not super into that idea. I thought it could be possible to place the reports into a config file. I do not see why this feature should require to recompile the program to add a new report. The program could have a build-in standard config for the current reports. For the config, I would tend to simple key:value design with |
@kain88-de All of your suggestions sound good to me. Adding some config is something I've thought about doing in the past (see #18), but with the amount of free time I currently have to spend on this project I haven't been able to do it. |
I've changed the location of the monthly income statement to be in a |
I can give it a try. But I’m not entirely sure how much time I’ll have either. |
My monthly income and expenses vary a bit during the year. I usually generate this report manually to know which month has been expensive and check if the income looks reasonable for each month. This level of detail is a lot more helpful for me to see how I am doing in the current year.
I'm new to haskell. Are there any tests for the report that should be added to this PR as well?