julien-nc / cospend-nc

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

bad project settlement? #164

Open adam-lipovsky opened 2 years ago

adam-lipovsky commented 2 years ago

Hello,

I am new to this project, looks good, but it seems to calculate the settlement wrong :|

E.g.:

Users:

Adam Eva Jane and Tom (one user, weight 2)

Expenditures:

Adam spent 5319.815 CZK for Jane and Tom Jane and Tom spent 4353.848 CZK for Adam

Eva spent 24.55 CZK for Jane and Tom Jane and Tom spent 4353.848 CZK for Eva

Adam spent 2727.528 CZK for Eva Eva spent 12.275 CZK for Adam

Settlements as they should be:

Adam should get 966 CZK (5319.815 - 4353.848) from Jane and Tom Jane and Tom should get 4329 CZK (4353.848 - 24.55) from Eva Adam should get 2715 CZK (2727.528 - 12.275) from Eva

Settlements as in Cospend (optimal):

Eva pay Adam 3681.22 CZK Eva pay Jane and Tom 3363.33 CZK


In project statistics there are expenditures without error so I don't understand, what is wrong with this settlement. I forgot to set something?

Thanks for help. Whole Cospend looks fine, but this makes it unusable for me :|

julien-nc commented 2 years ago

Hi. The core concept of Cospend is that inside a group (a project), the member balances are more abstract than the real debts. It's an easier way to settle the debts. A bill has an effect on the involved members balances but then, we don't care about exactly who paid for whom. It's more about if you owe the group or if the group owes you (negative or positive balance).

The settlement plan is one optimal set of real money transaction to set everyone back to a zero balance meaning nobody owes anyone anything.

If you want to track expenses in a more precise way between people, you can create multiple projects with 2 members each.

Did I get your trouble? Did my explanation help?