feat: add auto-balancing for the amount edit #173
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Somewhat related issue: #150
Motivation
Very recently I migrated to Spliit from Tricount, and I am missing a feature which I have found very useful when adding shared expenses.
This occurs for example, when a statement contains a personal purchase which I only want to incur on myself, and I want the rest to be shared evenly.
Solution
Example: I have a shared expense of 20€, and I want to incur a 3€ purchase only to myself and divide the rest evenly.
4.25 €
)To avoid errors and provide intuitive balancing on multiple participants, the autobalance occurs only on the participants, whose rows have not yet been edited.
Issues and ideas
This implementation does not automatically allocate a surplus/remaining cent on uneven totals, though whether this should even be automatic, is another discussion.
My implementation reflects how I have worked with expense systems in the past, it works fine when you have the necessary amounts already calculated or arbitrarily given, but its not as intuitive as the proposal in the issue. It quickly becomes obvious that manually calculating these type of expenses is cumbersome. Despite this, I find that my solution is better than none at all
More so related to the existing default splitting options:
15
and12
shares is selected and defaulted, this carries over to other split modes. My implementation overrides this behaviour on the amount split, but this remains for example on the percentages, where you end up with15%
and12%
in the mentioned situation.