julien-nc / cospend-nc

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

Bill-splitting results in a wrong balance. #206

Open CodeRoutineDev opened 1 year ago

CodeRoutineDev commented 1 year ago

Nextcloud-Version: 26.0.1 Cospend-Version: 1.5.8

What happened: I added a bill of 30.00€ and split it across 7 people. Each person involved was charged 4.29€. This results in a total reimbursement to the payer of 30.03€ for this bill. If not taken care of later manually, this results in a bad balance.

Expected behavior: Share the bill across the involved people in such a way that the balance stays intact.

I can think of two ways of doing this:

  1. Share the bill across the involved persons in a slightly unfair way, charging some a value that is +/- 1 in the smallest fraction of the selected currency. In my example some people would have been charged 4.28€ instead of 4.29€, such that the balance stays intact. To make it as fair as poossible, choose the favored persons randomly or let the user choose which people should pay 1 less than the others.

  2. Share the bill to smaller fractions than supported by the currency and reflect this accordingly in the balance. An appropriate handling of non-equal splitting to the smallest fraction supported by the currency must be taken care of during settlement.

I personally prefer solution 1 but any solution is fine as long as the balance stays intact.

If you need more information, I'll be happy to provide them.

Screenshots of my example:

Screenshot_20230509_184431

Screenshot_20230509_184504

blipp commented 3 months ago

I can confirm that this is still an issue in version 1.6.1. For example, the amount of 40 gets divided into 3 times 13.33.

Splitwise implements solution 1 proposed in the above post.