julien-nc / cospend-nc

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

Feature Request | Cross-Project, Person-Based balances #281

Open AkshayRao27 opened 3 months ago

AkshayRao27 commented 3 months ago

Context

Cospend (and 99.9% of all expense-splitting platforms) currently calculate balances within groups / projects / bubbles / whatever else they call it. However, it's entirely possible that there is an overlap between the members of several groups / projects. In such a scenario, being able to calculate balances between people across / regardless of projects would make it significantly easier for users to have an overview of their debts.

Example

I have the following situation:

So now, we have multiple people who may or may not be part of a group, and multiple people who are a part of multiple groups. In Cospend, I would need to set up at least 4 groups:

  1. Group for Dave & me
  2. Group for Jolly & me
  3. "Home" with Jolly, James, and me
  4. "Vacation" with the everyone except James and Dave.

Instead, if balances can be calculated across groups, we have a situation like this: image

This is literally the one single thing that is keeping me from migrating to Cospend and fully ditching Splitwise for good. My Nextcloud instance is all set up; I despise Splitwise and the direction they have gone in, but person-based balances are indispensible for me because of the number of friends that share various groups. I sincerely hope that something like that can indeed be implemented in Cospend! There are literally NO other platforms that offer this at all right now.

hoopahmadness commented 3 months ago

Perhaps these meta-payments could be implemented as a series of transactions, one in every group shared by the two parties (Jolly and Akshay in this case). They would look like any other transaction but would all have some title such as "Jolly and Akshay settle up" perhaps with some ID number to connect all the piecemeal transactions.

AkshayRao27 commented 3 months ago

This is precisely how Splitwise does it. It would still be important to calculate the total across all groups, though.

eikaramba commented 2 months ago

i also highly long for this feature. i don't think that the users of various groups are linkable between projects (only if they are nextcloud users), but it might be sufficient to just use the case-insensitive name as an identifier. just make sure to not have friends with the same name or at least name them differently ;)

AkshayRao27 commented 2 months ago

There could be two ways to approach this:

  1. Allow cross-group balance calculation only if the users have nextcloud accounts.
  2. Allow the admin to specify a unique ID for users (which is independent of their display name).
eikaramba commented 1 month ago

i am currently trying to develop this feature, finally after a lot of time setting my env up i have this now: grafik

AkshayRao27 commented 4 weeks ago

This is a great start and thank you so much for putting this together! I do have a Question though:

Who does "admin" owe the total of 99.67 to? In this example, it's clear that admin should transfer 66.67 to donald and 33.00 to test, but in case of more projects with more users and more transactions, you would still need to go through each project and see how much admin owes to every single user and then either manually sum everything up, or make several different transfers.

Your solution addresses the first part of the issue (green). Is there any way to solve the second part (red) with how CoSpend is set up? image For example, when Jolly Bingus looks at their version of this dashboard, they can make a single transfer of €1060.20 to me instead of making three smaller, separate transfers for every project.

eikaramba commented 4 weeks ago

hey exactly currently it only sums up the total the current user ows EVERYONE across EVERY projects. this is already very handy to manage your deps. e.g. we have often 4-5 projects with different people and my girlfriend is often suprised how much she actually ows in total ;) so it is merely just an indicator for your depts and the actual repayments must be done per project basis as it is.

but you are absolutely right that this is the first version and i think later on one could click on the total amount and then come to a page where you will see the second part(red) in more detail per person. unfortunately i wasn't able yet to do this as i wasn't completely sure how to set it up. do you think this first version could nevertheless be released already?

btw: in the screenshot above there was also a second project "test" where admin owed money. i should have included that as well.

AkshayRao27 commented 4 weeks ago

this is already very handy to manage your deps. e.g. we have often 4-5 projects with different people and my girlfriend is often suprised how much she actually ows in total ;)

Oh for sure. My SO has the exact same issue and I think this is an excellent start!

do you think this first version could nevertheless be released already?

Conceptually, I don't see why not. Things don't need to be 100% feature complete when you release them! Once this is up, people can test it and then who knows, maybe someone else has more or better ideas than I do and there's better feedback 😄

From a coding persepctive, I'm not knowledgable enough to know whether or not there's something specific that would be required for your next idea:

i think later on one could click on the total amount and then come to a page where you will see the second part(red) in more detail per person. unfortunately i wasn't able yet to do this as i wasn't completely sure how to set it up.