-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add split distribution #2151
Add split distribution #2151
Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Bundle Stats — desktop-clientHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset
View detailed bundle breakdownAdded
Removed
Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Bundle Stats — loot-coreHey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle. As this PR is updated, I'll keep you updated on how the bundle size is impacted. Total
Changeset No files were changed View detailed bundle breakdownAdded No assets were added Removed No assets were removed Bigger No assets were bigger Smaller No assets were smaller Unchanged
|
Nice. This is working in my quick testing |
👋 This feels like it's solving a very edge-case problem. Why is the logic to split them equally among the many transactions? The vast majority of purchases (for example: groceries) will not have items with equal value. The amounts will vary drastically. Hence why this feels to me like it's solving an edge-case problem that won't be applicable to most transactions and use-cases. Which is why I would argue against merging this. However, I would not be against a "fill remaining balance" type button if only a single split transaction remains with empty balance (in which case it's simple to calculate the remaining balance and assign that). |
@MatissJanis I strongly disagree that this is an edge case. Whenever you budget an expense into a reimbursement category, whether it be a set of concert tickets among friends, or a grocery trip with your partner, the amount needs to be split not by individual item but equally. Examples:
Introducing a "Fill remaining" button seems less useful to me, as the remaining balance is already displayed. Typing that in again is muss less effort than dividing random amounts by two, three, etc.. What makes this especially tedious is that if divisions don't work out, one needs to manually figure out the single cent remainders... If you really think this isn't a mainstream problem, then can we put this behind a flag in the settings by chance? I know 4 people using Actual including me, and we could all regularly use this. Personally, I think this would be fine. If its not needed, it's certainly not in the way. |
@NikxDa Can you look into why the test is failing? |
Thanks. Upon further thought I've reconsidered. Having a button that fills in the remaining amount for the last split transaction (1x) makes sense. And since we'd have that button.. we might as well extend it to do equal splits for multiple split transactions. |
@MatissJanis Thanks, I'm glad to hear it! I can try to make the button text dynamic, as in, if there is only one split left, it will display "Fill", whereas if there are multiple it will display "Distribute" (could make it work so that if all splits are set but don't add up, it displays "Add remaining" and adds the extra split). @youngcw I will check the tests shortly. Adding splits still works fine, so I'm not sure what's happening there. |
Managed to fix the remaining test. Unclear to me how to fix the visual regression tests, any guidance appreciated. |
This explains how to update the visual regression snapshots. https://github.com/actualbudget/actual/blob/master/packages/desktop-client/README.md |
@youngcw Can you review again, please? I've added some code so that the "Distribute" button is disabled when there are no empty transactions, because it would appear to do nothing in that case. |
packages/desktop-client/src/components/transactions/TransactionsTable.jsx
Outdated
Show resolved
Hide resolved
This is cool; I wonder if there could be some kind of option that distributes the remaining amount proportionally to all the split categories, in order to cover a usecase for distributing the subtotal among categories, but having the tax amount left over. I referenced that here. |
* Add split distribution feature * Add upcoming release notes * Fix tests * Fix remaining test * Disable distribute button when all transactions are filled * Add canDistributeRemainder --------- Co-authored-by: Matiss Janis Aboltins <[email protected]>
This PR adds support for distributing the remaining balance of a split over all empty splits. This feature was suggested in #1324 and partially implemented in #1271 but never merged.
Examples:
Demo:
As far as I can tell, this is now ready to merge and includes the functionality for both the new transaction editor as well as in existing transactions.