actual icon indicating copy to clipboard operation
actual copied to clipboard

Template only the relevant amount in a split-schedule category

Open jfdoming opened this issue 10 months ago • 5 comments

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

jfdoming avatar Apr 21 '24 20:04 jfdoming

Deploy Preview for actualbudget ready!

Name Link
Latest commit 3486074c0ee7b8bc8027a58c011dd1c38f776edb
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.

netlify[bot] avatar Apr 21 '24 20:04 netlify[bot]

Deploy Preview for actualbudget ready!

Name Link
Latest commit c979dd8b753e06ee0707194bd58b9e8f4a1751c8
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.

netlify[bot] avatar Apr 21 '24 20:04 netlify[bot]

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%

github-actions[bot] avatar Apr 21 '24 20:04 github-actions[bot]

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

github-actions[bot] avatar Apr 21 '24 20:04 github-actions[bot]

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

youngcw avatar Apr 28 '24 18:04 youngcw

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

jfdoming avatar May 21 '24 14:05 jfdoming

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.

youngcw avatar May 21 '24 15:05 youngcw

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!

jfdoming avatar May 21 '24 16:05 jfdoming