Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing SplitWise CSV displays wrong people on "For whom?" #203

Open
Porrumentzio opened this issue Mar 29, 2023 · 1 comment
Open

Importing SplitWise CSV displays wrong people on "For whom?" #203

Porrumentzio opened this issue Mar 29, 2023 · 1 comment

Comments

@Porrumentzio
Copy link

This is definitely related to #159 and might be so to #182

I exported a SplitWise CSV and needed to edit column names to English (following #159). As said in that issue, there is a tiny difference in balances due to the rounding up thing, but it's a matter of cents.

However, the person who paid is excluded from "For whom?" section, when it should not be in every cases.
See this example:

SplitWise Cospend imported
Porru paid 2,84, divided equally between the four people (25 %, so it should be 0,71 per person, including Porru) image

As I already said, the balances are the same, but showing the info that way (the cost and the people to pay being different) is rather confusing. Besides, it may affect the statistics, right?

@julien-nc
Copy link
Owner

Hi,
Yes it definitely affects the stats.

Let's figure out the algorithm to compute the bill to create in Cospend
Relevant info/columns in a Splitwise export line:

  • Cost (let's use C)
  • effect on person 1's balance (e1)
  • effect on person 2's balance (e2)
  • effect on person 3's balance (e3)
  • etc...

I think we can safely assume there can be only one payer in SplitWise, anyway if it's not the case, I don't care if we support importing this 😁.

There should be only one person with a positive effect. This is the payer. Let's call the effect on the payer eP, it's the only positive value in the effect list.
I think it's reasonable to only support those 2 cases:

  1. If the cost is is equal to the effect on the payer (C == eP), then the payer is not in the "for whom" list (not an ower).
    For example:

    • C = 30
    • e1 = 30
    • e2 = -15
    • e3 = -15

    This would lead to a Cospend bill payed by 1, amount would be 30, it would include 2, and 3

  2. If the effects on the owers are all equal (e1 == e2 == e3) and if the cost equals the effect on the payer minus the effect on one ower (C == eP - e2) this is an evenly split bill.
    For example:

    • C = 30
    • e1 = 20
    • e2 = -10
    • e3 = -10

    This would lead to a Cospend bill payed by 1, amount would be 30, it would include 1, 2, and 3

Any other case would be treated like it's implemented now.

Do you think there's a flaw in this?

I see a first obstacle making this hard to implement, this kind of line:

2022-07-05,desc,cat1,8.20,EUR,-2.73,5.47,-2.74

The negative values are not equal...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants