Open Porrumentzio opened 1 year ago
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:
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 :grin:.
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:
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:
This would lead to a Cospend bill payed by 1, amount would be 30, it would include 2, and 3
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:
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...
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.
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?