julien-nc / cospend-nc

💰 💲hared budget manager Nextcloud app
GNU Affero General Public License v3.0
225 stars 29 forks source link

Function-Request: Weighted-Split by Date #27

Open MaNyh opened 3 years ago

MaNyh commented 3 years ago

See: https://gitlab.com/eneiluj/cospend-nc/-/issues/11 and my issue here (before I realized other ppl already made an issue about this) https://gitlab.com/eneiluj/cospend-nc/-/issues/105 and https://gitlab.com/eneiluj/cospend-nc/-/issues/71

I am not using Cospend because of this. I usually calculate a weighted balance for each month and then I am calculating necessary transactions to sort things out. As I am using my own code, no other member of our shared-household is able to use the programm.

This function would make Cospend usable for this or similiar kinds of problems.

whtv commented 3 years ago

Yes please! To be honest, I don’t even quite understand the usefulness of weights as they are right now. If you change them, all past settlements change as well. That doesn’t make any sense to me. I can see how weight per date is kind of complicated, but how about this: Make weight a per-settlement option, rather than a static user property; or maybe allow the pre-set user weight to be overridden at settlement time?

Also, seeing as there is an option for bills to ignore weights, I think settlement bills should always, or at least by default, do that.

Edit: Sorry, I got it wrong. What happens is, if you change weights after settlement, it’s not the settlement bill that’s taken into account, but all other bills, even the ones before the settlement. How about adding a starting date to the already existing end date at settlement? Better yet, an option to settle all bills starting from the last settlement. That, plus an option to set weights per settlement, seems like a pretty good, feasible solution to me.

whtv commented 3 years ago

After reading #14, I can see how a ‘settle from‘ date is problematic as it kind of contradicts the point of settlement. What if every bill had a ‘settled’ flag instead? The default would then be to only settle unsettled bills. An option at settle time to also include already settled bills (of course taking into account previous settlement bills), in case you change your mind about the weights afterwards, should then result in the current behaviour.

While I’m waiting for others to chime in, I’ll try to explain how I would imagine it:

My use case is a shared flat, where everyone buys food and other stuff for the whole flat. The member weight is the respective member’s days present per settlement period (e.g. per month).

At (e.g.) the end of the month, all unsettled bills are settled. In the settlement dialog, each member’s days are entered. The bills are then flagged as ‘settled’, and the balance is reset, since the balance only takes into account unsettled, non-refund bills. The settled bills remain in the project solely for statistics. Therefore, any change to or deletion of settled bills won’t affect the balance. However, in case a mistake has been made in settlement, settled bills can at any time be reset to ‘unsettled’.

Would that be feasible?

Ezwen commented 2 years ago

Hi there, just wanted to share my own use case, a bit different from the scenario above. In my household, we split the expenses based on the income of each member (ie. someone with a higher salary will contribute more). Our current problem with Cospend is that the income of any given member can change during the year, and that changing weights in the project wreaks havoc in all past expenses.

As a workaround, we can create a new project each time there is a chance in income. While creating a new project is simple, the problem is that we each member need to setup one again all the recurrent expenses (internet provider, etc.), with the risk of forgetting one. This is why we would be extremely interested in a way to change the weights without affecting the past expenses.

schuandr commented 2 years ago

Hi there, just wanted to share my own use case, a bit different from the scenario above. In my household, we split the expenses based on the income of each member (ie. someone with a higher salary will contribute more). Our current problem with Cospend is that the income of any given member can change during the year, and that changing weights in the project wreaks havoc in all past expenses.

As a workaround, we can create a new project each time there is a chance in income. While creating a new project is simple, the problem is that we each member need to setup one again all the recurrent expenses (internet provider, etc.), with the risk of forgetting one. This is why we would be extremely interested in a way to change the weights without affecting the past expenses.

I also have exactly this same use case and would very much appreciate it if Cospend supported this. Or has anyone perhaps figured out a workaround that doesn't involve setting up a new project every time the weighting changes?