spiral-project / ihatemoney

A simple shared budget manager web application
https://ihatemoney.org
Other
1.18k stars 267 forks source link

Feature : Division by join / leave time and bill period #1228

Closed wargreen closed 5 months ago

wargreen commented 1 year ago

We don't find any software that seem to do that :

If someone leave (or join) during the time of a bill, we can't share this bill. Divide the bill price by number of days isn't fair, a day divided by 5 come back cheaper than divided by 3 for the same person.

So the feature could be :

At the math side, at each join / leave, the part price should be adjusted from the total bill, then multiply by time of participant.

I can imagine the UI with one periods picker for each bill / participant. I can write some python, but i don't know the ihatemoney architecture and i have lot of work (for not so many money, i don't like that ;)

I'll open a similar issue on cospend, we have a nextcloud instance. But both tools can be really useful !

zorun commented 1 year ago

Let's discuss the requirement in more details first. At first glance, the solution you are proposing looks like the kind of complex optional feature we want to avoid in the project (even though we already have some optional features that bring complexity, see #603 for some context)

I had a similar use-case recently, here is the situation and how I handle it:

There is a disadvantage with the method: if an expense needs to be split equally among a subset of participants (e.g. going for a trip as a sub-event of the bigger event), then you definitely don't want to apply the same participant weights as the bigger event (since they are proportional to the number of days of each participant in the bigger event, while you want equal split for the sub-event). Solving this in the same project would require per-bill weights, which we don't have in Ihatemoney. So the solution here is to put these expenses in a separate Ihatemoney project with all participant weights set to 1 (the default).

Does that make sense? I agree it is a bit of a workaround.

Btw, I don't understand what you mean by "Divide the bill price by number of days isn't fair, a day divided by 5 come back cheaper than divided by 3 for the same person."

almet commented 1 year ago

Hi, and thanks for your input. I wonder if a feature like what's discussed here https://github.com/spiral-project/ihatemoney/issues/471#issuecomment-1655790140 could be a good fit for you?

cc @azmeuk

wargreen commented 1 year ago

I'm happy to not be alone with this situation !

Btw, I don't understand what you mean by "Divide the bill price by number of days isn't fair, a day divided by 5 come back cheaper than divided by 3 for the same person."

Sorry for my poor english ! I think that i've tried to say the same thing that your last point. The price of one day (if always the same, as a house rent) is not the same by person if it is 3 or 5 person inside. So we can't just divide the total of the bill and multiply by a weight. So i'm not sure if #471 can be used on this situation.

zorun commented 1 year ago

Ah, I see, I think we have a different notion of fairness.

Let me show off my ASCII-art skills to give an example of number of people over time:

amount of people
^
|    ## ##
|    #####
|  ########
|  ##########
|#############
+------------------> time

Let's assume you paid a total of 1300 € for the whole place for 13 days.

If I understand well, your definition of fairness is: divide the total price by 13 days, which means 100 € per day. Then for each day, figure out how many people were present, and divide 100 € by the number of people.

My definition of fairness is: everybody should pay the same price for staying one day. So I count the total number of people x day (40 in my example), and I divide the total price by 40, which means 32.5 € per person per day.

With your definition, you could add a separate bill for each day, with different people having to pay for it.

almet commented 11 months ago

I've just received an email from Michigan students who would like to contribute to this discussion and propose an implementation. Here is their mail :

Dear ihatemoney Group,

I hope this email finds you well. We are senior students at the University of Michigan - Ann Arbor who are very interested in your ihatemoney project. We are currently enrolled in a software engineering course that requires us to contribute to open-source projects, and we hope to work on your project in the coming weeks. Specifically, we would like to assist by adding new features to the website. We have noticed a feature request regarding Division by join/leave time and the bill period. After reviewing the details on [this issue], we would like to clarify the definition of fairness: we understand it as ensuring that everybody pays the same price for staying one day. Our understanding is as follows:

Sum = The sum of total number of people each day.

Per person per day = Total Price / Sum.

A person's contribution should be calculated as: Per person per day * the number of days they participated.

Furthermore, we would like to confirm if we should incorporate this feature into the "adding this bill" section, along with specifying the days for each individual.

We are looking forward to your response.

Sincerely,

Nicole Tian and Andrew Gao

almet commented 11 months ago

Nicole and Andrew, thanks for proposing your help here.

This feature (in one form or another) has been requested for many years, but was never implemented.

One related discussion is at #471, where @azmeuk nails it in the end (I modified his example to stick with zorun's one):

For instance, a few people go in vacation together during 13 days and they rent a house. They all come and go at different times. They want to split the bills by the number of days passed in the house. With percentage it is not obvious at all, with weights you just assign the number of days to people.

This seems to match with @zorun's definition of fairness, and I believe it should be the default in IHM, because it's what you probably expect from a "simple" implementation.

Data

Let's say we've ranted a house for 4 days.

Data-wise, this could look like :

what amount payer owers weights
rental 100 alexis alexis, zorun, wargreen, azmuk 3, 2, 2, 2
wargreen commented 11 months ago

It is a so cool contribution, thank you !

I understand the point of view "same price for all usage day". It is more fair at a political viewpoint (mine inside) but not realistic for capitalist view, example :

What make me open this issue : We live at 6 persons in a rented house. The rent agency ask for price by month. Some bill are on 3 month periods or other by year. Someone leave the house and don't find anybody for take his room for moment, but someone come later. So, all the bills should be fully paid but it should be share by 5 for a period, maybe another period by 4...

Manual count the number of day per person (with old and new) per bill for each bill is very long. So my proposal for date picker for the bill period and join/leave at the participant level for get a direct effect on each bill. Maybe that use weight by full timestamp (not only by day) can open other usages ? Not sure about that.

NicoleeeTian commented 10 months ago

Hello! I am not sure your explanation through the angle of capitalist. Could you explain more on that? Maybe we can start with "simple" implementation of fairness?

wargreen commented 10 months ago

Huhu ! I can understand :) As "capitalistic", i mean about the rent agency that just want the exact money regardless your situation, and about a simple person that can't pay more that it use because it haven't enough money. That is sadly the most frequent situation.

In a "good" (for me) society, the price of a room is the price of a room an if one person leave, it don't change.

But in reality, a good society come with room and food for everybody, so this price == 0.

zorun commented 5 months ago

We recently published the current direction of the project: https://ihatemoney.readthedocs.io/en/latest/contributing.html#current-direction-as-of-2024

Unfortunately, if we look at the "simplicity" criteria, this feature looks too complex to be integrated into the project.

Here is how I believe you can address your use-case:

We realize it might not be satisfying, but we believe that keeping the project simple is to only way it can survive in the long term.