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
Monthly expenses #526
Monthly expenses #526
Conversation
To me, monthly expenses are not a goal. However, more statistics is a nice feature :) Your example is very basic, but remember that some people would like to gather them differently, e.g. quarter (3 months), yearly, or even daily if you are using it on holidays. |
It's simple, nice, clear, and extendable. To me, it's OK to merge this. By the way, just a small question: is it OK to have a fixed width in pixels for the 1st column? I know the whole page isn't completely responsive, but it is not a good reason :) |
ihatemoney/models.py
Outdated
monthly = defaultdict(lambda: defaultdict(int)) | ||
|
||
for member in self.active_members: | ||
for bill in self.get_member_bills(member.id).all(): |
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.
Is it possible to rewrite this so that we do a unique SQL request rather than one per members?
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.
Probably; I will change it.
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.
I've changed this - as it turned out, a query for bills by active members was simply wrong for the historical statistics. I now just use get_bills()
.
Hi, thanks for the work on this. If we are to have a « statistics » view like this one, I would rather have a graph rather than have a table like is proposed here, what do you think? |
Both table and chart are valid to me, with different use cases. Sometimes, you want a quick look at raw numbers, or just copy/paste them. Sometimes, you need to compare months with each other, and charts are better. However, charting usually requires external JS libraries, and it usually increases the page loading. |
I think it's ok but I haven't checked on a mobile device or anything. Since I have to change something anyway I will doublecheck.
In my use case I'd rather have a table. An additional chart does not hurt but I'd say that can stay for future work :) |
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.
Hey, thanks for this, I'm okay with the code, with just a few minor changes to do, and we're okay !
Sorry for the delay on all this, it should be easier for contributors to push code around here. Thanks again for you contribution.
ihatemoney/models.py
Outdated
:return: a dict of years mapping to a dict of months mapping to the amount | ||
:rtype dict: | ||
""" | ||
monthly = defaultdict(lambda: defaultdict(int)) |
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.
amount seems to be a float rather than an int.
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.
It doesn't really matter, since it is only used for setting the initial value, which is 0.
And, to be exact, it should be a Decimal
, but that will be for the future :)
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.
You are totally correct, it's better not to confuse types. Changed it to a float :)
ihatemoney/static/css/main.css
Outdated
@@ -311,8 +311,9 @@ footer .footer-left { | |||
background: url("../images/see.png") no-repeat right; | |||
} | |||
|
|||
#bill_table { | |||
#bill_table, #month_table { |
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.
I believe we can improve a bit the naming of this table. what about "monthly_expenses_table" ?
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.
or monthly_stats
as you named it like this elsewhere (I find the naming even better than my proposal)
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.
Changed.
I don't feel like I've had to wait much :) There were longer pauses between my own changes. You guys are doing great! |
This looks good to me! Thanks :-) |
When used as a monthly expenses tracker (without the requirement for settling) this tool lacks an overview. This is a WIP initial attempt to add a monthly overview of all expenses.
This is my first version:
I do not believe it is ready to merge yet, but I wanted to get some feedback on the location of the new table, the design, should it also contain running/yearly totals, etc.
Last but not least, is this a feature you even want? :)
I'm looking forward to your feedback.
Edit: I know I still need to use the translation functions for the strings