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

Template only the relevant amount in a split-schedule category #2652

Conversation

jfdoming
Copy link
Contributor

As it says on the tin. For the logic, there are a few cases to consider; open to changing any of these, but these ones seem logical to me:

  • Category that corresponds to some parts of a split: the category gets the sum of all splits that match the category
    => e.g., if you have a split with "personal trainer" and "gym membership", you can template a "personal trainer" category that just receives the amount due there.
  • Category that corresponds to all parts of a split: the category gets the sum of all splits
    => self-explanatory, the split belongs to only one category

These ones are more subject to change:

  • Category that corresponds to no part of a split: the category gets the sum of all splits
    => this is so that if you write "#template schedule foo" in a category that's unrelated, you don't end up with "0" of the schedule
  • Category that contains a regular rule with a changed amount
    => I think this part is most open to change. This is so that if you add a schedule with a that overwrites the transaction amount, the overwritten amount will get used. I don't see a use-case for overwriting the transaction amount, but it's an option the UI supports so IMO it could be worth handling here

@trafico-bot trafico-bot bot added the 🔍 Ready for Review Pull Request is not reviewed yet label Apr 21, 2024
@github-actions github-actions bot changed the title Template only the relevant amount in a split-schedule category [WIP] Template only the relevant amount in a split-schedule category Apr 21, 2024
@trafico-bot trafico-bot bot added the 🚧 WIP Still work-in-progress, please don't review and don't merge label Apr 21, 2024
Copy link

netlify bot commented Apr 21, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 3486074
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/662576dbdcc04900081bd890
😎 Deploy Preview https://deploy-preview-2652.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@trafico-bot trafico-bot bot removed the 🔍 Ready for Review Pull Request is not reviewed yet label Apr 21, 2024
Copy link

netlify bot commented Apr 21, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit c979dd8
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/664cb48d9f020300086723f0
😎 Deploy Preview https://deploy-preview-2652.demo.actualbudget.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

github-actions bot commented Apr 21, 2024

Bundle Stats — desktop-client

Hey 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

Files count Total bundle size % Changed
9 4.71 MB → 4.71 MB (+74 B) +0.00%
Changeset
File Δ Size
src/components/budget/BalanceWithCarryover.tsx 📈 +74 B (+4.83%) 1.5 kB → 1.57 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
static/js/index.js 3 MB → 3 MB (+74 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
static/js/indexeddb-main-thread-worker-e59fee74.js 13.5 kB 0%
static/js/resize-observer.js 18.37 kB 0%
static/js/BackgroundImage.js 122.29 kB 0%
static/js/narrow.js 59.97 kB 0%
static/js/usePreviewTransactions.js 790 B 0%
static/js/AppliedFilters.js 20.54 kB 0%
static/js/wide.js 261.78 kB 0%
static/js/ReportRouter.js 1.23 MB 0%

Copy link
Contributor

github-actions bot commented Apr 21, 2024

Bundle Stats — loot-core

Hey 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

Files count Total bundle size % Changed
1 1.2 MB → 1.2 MB (+152 B) +0.01%
Changeset
File Δ Size
packages/loot-core/src/server/budget/goals/goalsSchedule.ts 📈 +545 B (+7.85%) 6.78 kB → 7.32 kB
packages/loot-core/src/server/accounts/rules.ts 📉 -53 B (-0.18%) 28.84 kB → 28.79 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
kcab.worker.js 1.2 MB → 1.2 MB (+152 B) +0.01%

Smaller

No assets were smaller

Unchanged

No assets were unchanged

@jfdoming jfdoming changed the title [WIP] Template only the relevant amount in a split-schedule category Template only the relevant amount in a split-schedule category Apr 27, 2024
@trafico-bot trafico-bot bot added 🔍 Ready for Review Pull Request is not reviewed yet and removed 🚧 WIP Still work-in-progress, please don't review and don't merge labels Apr 27, 2024
@youngcw
Copy link
Contributor

youngcw commented Apr 28, 2024

Im getting weird amounts budgeted instead of what the spilts are asking for. All I did was make a $200 schedule that allocated 50 to one category and 150 to another. I could post the schedule as expected, but when applying the template the amounts were really funky

@jfdoming
Copy link
Contributor Author

Im getting weird amounts budgeted instead of what the spilts are asking for. All I did was make a $200 schedule that allocated 50 to one category and 150 to another. I could post the schedule as expected, but when applying the template the amounts were really funky

I updated the logic to handle signs more correctly (or at least what I think is more correctly). Can you try your test case and see if that improves on this at all? If not, wondering if you could provide a video of the issue you're seeing as I was having trouble replicating

@youngcw
Copy link
Contributor

youngcw commented May 21, 2024

Ok, it could have been that I put in a bad amount sign before. Your other PR will help with that. But it is interesting that the template amounts get funky if the split amounts are the wrong sign.

@jfdoming
Copy link
Contributor Author

Ok, it could have been that I put in a bad amount sign before. Your other PR will help with that. But it is interesting that the template amounts get funky if the split amounts are the wrong sign.

Yep! Hopefully that most recent commit helps with the funkiness!

@trafico-bot trafico-bot bot added ✅ Approved Pull Request has been approved and can be merged and removed 🔍 Ready for Review Pull Request is not reviewed yet labels May 21, 2024
@youngcw youngcw merged commit aff5bba into actualbudget:master May 21, 2024
19 checks passed
@trafico-bot trafico-bot bot added ✨ Merged Pull Request has been merged successfully and removed ✅ Approved Pull Request has been approved and can be merged labels May 21, 2024
@jfdoming jfdoming deleted the jfdoming/cross-category-schedule-templates branch May 22, 2024 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Merged Pull Request has been merged successfully
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants