actualbudget / actual

A local-first personal finance app
https://actualbudget.org
MIT License
13.96k stars 1.11k forks source link

Custom Reports: Adjust Net values #2871

Closed carkom closed 3 months ago

carkom commented 3 months ago

There have been many comments - both in github and discord - that a net number is needed. I agree with this sentiment so I'm trying to find the best way to fix it.

This is a POC. There's many little visual/UI issues currently - I'll fix those once the implementation is agreed on.

~~I'm looking for feedback at a high level. How do you think this feature should work? Current state: Payments/Deposits are separated and the "Net" number is only available on certain graphs. Proposal: Payments/Deposits should act as "Net Payments" and "Net Deposits" while constraining the value to only positive or negative final values. "Net" shows all transactions together. Current state can be mimicked by using a filter (inflow/outflow greater than zero). Alternate option: Leave current state unchanged and add options under the "Type" drop down for "Net Payment" and "Net Deposit".~~

Please have a look, play around with it and let me know what you think!

netlify[bot] commented 3 months ago

Deploy Preview for actualbudget ready!

Name Link
Latest commit a4a5654be2dd4eddbed54e9a9ca2247ffc978b22
Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/66790beddd8f0d000866471f
Deploy Preview https://deploy-preview-2871.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.

github-actions[bot] commented 3 months ago

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.76 MB → 4.76 MB (+3.71 kB) +0.08%
Changeset File | Δ | Size ---- | - | ---- `src/components/reports/spreadsheets/custom-spreadsheet.ts` | 📈 +1.03 kB (+23.08%) | 4.45 kB → 5.48 kB `src/components/reports/spreadsheets/recalculate.ts` | 📈 +344 B (+21.34%) | 1.57 kB → 1.91 kB `src/components/reports/spreadsheets/grouped-spreadsheet.ts` | 📈 +723 B (+18.20%) | 3.88 kB → 4.58 kB `src/components/reports/graphs/BarGraph.tsx` | 📈 +663 B (+7.91%) | 8.19 kB → 8.83 kB `src/components/reports/graphs/AreaGraph.tsx` | 📈 +528 B (+6.24%) | 8.26 kB → 8.78 kB `src/components/reports/graphs/showActivity.ts` | 📈 +83 B (+4.82%) | 1.68 kB → 1.76 kB `src/components/reports/graphs/tableGraph/ReportTableList.tsx` | 📈 +72 B (+3.51%) | 2 kB → 2.07 kB `src/components/reports/graphs/tableGraph/ReportTableTotals.tsx` | 📈 +60 B (+3.35%) | 1.75 kB → 1.81 kB `src/components/reports/ReportSummary.tsx` | 📈 +87 B (+2.23%) | 3.82 kB → 3.9 kB `src/components/reports/ReportOptions.ts` | 📈 +129 B (+1.94%) | 6.5 kB → 6.62 kB `src/components/reports/graphs/DonutGraph.tsx` | 📈 +38 B (+0.51%) | 7.29 kB → 7.33 kB `src/components/reports/graphs/StackedBarGraph.tsx` | 📈 +33 B (+0.46%) | 6.97 kB → 7.01 kB `src/components/settings/Encryption.tsx` | 📈 +3 B (+0.07%) | 3.95 kB → 3.95 kB `src/components/reports/reports/CustomReport.tsx` | 📉 -10 B (-0.05%) | 19.84 kB → 19.83 kB `src/components/reports/disabledList.ts` | 📉 -5 B (-0.13%) | 3.82 kB → 3.82 kB
View detailed bundle breakdown
**Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/ReportRouter.js | 1.23 MB → 1.23 MB (+3.71 kB) | +0.30% static/js/index.js | 3.02 MB → 3.02 MB (+3 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 | 75.73 kB | 0% static/js/usePreviewTransactions.js | 790 B | 0% static/js/AppliedFilters.js | 27.22 kB | 0% static/js/wide.js | 266.96 kB | 0%
github-actions[bot] commented 3 months ago

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.13 MB 0%

Changeset

No files were changed

View detailed bundle breakdown
**Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.js | 1.13 MB | 0%
nikolajhendel commented 3 months ago

hi @carkom I have done some early testing, and to be honest the proposed solution confuses me.

The current Payment / Deposit / Net makes total sense - and when looking at the "data table" report output, everything aligns across those 3 types. All graph type outputs except Donut can accommodate net values (positive and negative) - so isn't it better to keep the current reporting structure but expand the graphs to show both positive and negative values?

As for feedback on the PR: Setting mode to time, split to category PAYMENT: Seems to deliver the correct result for payment = payment - deposit. But the total spend and average spending values are incorrect (they seem to still use the payment values only). In "data table" view TOTALS is correct, but average (and summary panel values) uses the original deposit values only.

DEPOSIT: The view is not working correctly - for some reason it only shows the main category and not the sub-category breakdown. Again, total spend and average are incorrect

NET: Seems to work as expected including for Stacked Bar Graph. All values are correct including net payments and average.

Teprifer commented 3 months ago

Had a brief look and my feedback aligns with Niko's, keep the current options in place for deposits and payments.

matt-fidd commented 3 months ago

Personally, I'd like the options for Net Payment and Net Deposit added alongside the existing options - it makes it far easier when, for example, I've grabbed lunch for the office and I have one big payment, then multiple small deposits from people reimbursing me that mark off all but my personal spend.

carkom commented 3 months ago

As for feedback on the PR: Setting mode to time, split to category PAYMENT: Seems to deliver the correct result for payment = payment - deposit. But the total spend and average spending values are incorrect (they seem to still use the payment values only). In "data table" view TOTALS is correct, but average (and summary panel values) uses the original deposit values only.

DEPOSIT: The view is not working correctly - for some reason it only shows the main category and not the sub-category breakdown. Again, total spend and average are incorrect

NET: Seems to work as expected including for Stacked Bar Graph. All values are correct including net payments and average.

As I said in my OP - specific feedback is not needed right now. There's a lot of little things broken within the PR. Rather than focus on this specific number or that specific number being wrong, I'd rather start by discussing high level preferences. It seems you're a fan of option 3 - "alternative option".

carkom commented 3 months ago

Personally, I'd like the options for Net Payment and Net Deposit added alongside the existing options - it makes it far easier when, for example, I've grabbed lunch for the office and I have one big payment, then multiple small deposits from people reimbursing me that mark off all but my personal spend.

Good example. Question for you: When would you use the existing (non-Net Payment) option? Wouldn't you always want those reimbursements added to your payment in this scenario?

matt-fidd commented 3 months ago

Personally, I'd like the options for Net Payment and Net Deposit added alongside the existing options - it makes it far easier when, for example, I've grabbed lunch for the office and I have one big payment, then multiple small deposits from people reimbursing me that mark off all but my personal spend.

Good example. Question for you: When would you use the existing (non-Net Payment) option? Wouldn't you always want those reimbursements added to your payment in this scenario?

I think you're right, I can't see an argument (at least in my personal use) to use the non-net options if the net exist. The net options would mean that reports would show the same data as the budget pages which (again, to me) feels more intuitive.

If I didn't want payments/deposits to cancel each other out I'd be categorising the payment in a spend category and the deposit in an income category. If I wanted them to cancel out then I'd put them together and in both cases the Net would give the expected behaviour.

carkom commented 3 months ago

Here's the example using categories: You pay for a lunch you get reimbursed. This would also apply to retail transaction where you made a full or partial return, etc., etc... image

Type Current New
Payments image image
Deposits image image
Net Does not exist image
Duplicate Current "Payment" option using Newer option with filters NA image
Duplicate Current "Deposit" option using Newer option with filters NA image
carkom commented 3 months ago

So "Net" in most graphs would display both payments and deposits as it does with the current implementation (where it's being used). So the "Data Table" graph under "Net" would look exactly the same as it does now (It may not actually be true in this PR currently but there's some bugs that still need bashing).

Biggest change we are realizing with this suggestion is that the "Splits" are displaying more true to life numbers and we get corrected numbers in the donut graph.

If you like the logic in how things are displayed now you can duplicate that with a quick simple filter: If you want payments where all deposits have been removed just use an "Amount (outflow)" greater than 0 and the filter will remove all transactions where the amount is not negative (eg: deposits).

As always if you find anything confusing you can click on the item/area and review the transactions that are being used to calculate it.

matt-fidd commented 3 months ago

Here's the example using categories: You pay for a lunch you get reimbursed. This would also apply to retail transaction where you made a full or partial return, etc., etc... ! ..............

Yep! I'm in favour of this approach, to me it feels more intuitive as it duplicates the behaviour and numbers seen in the budget table.

Edit: I've just plugged my budget into this PR and my category split YTD graph looks much better

matt-fidd commented 3 months ago

(And a +1 on an option to reverse the axis on net view)

youngcw commented 3 months ago

Maybe changing the name "net" to something else could alleviate some of the confusion that's happening. To me the new "payment" and "deposit" functionality is more net-like than the actual "net" option that has a split view in the bar chart.

carkom commented 3 months ago

Maybe changing the name "net" to something else could alleviate some of the confusion that's happening. To me the new "payment" and "deposit" functionality is more net-like than the actual "net" option that has a split view in the bar chart.

I see your point about the bar graph net, although it's only a problem with that one view. It can be adjusted if necessary.

As for payment and deposit isn't it more true to life like this though? Don't you want to see your refunds in with your payments on the same view? Also, if the answer is no 😉, then I've explained a very simple solution for using new view to show current view with a filter(above)😁.

Teprifer commented 3 months ago

Maybe changing the name "net" to something else could alleviate some of the confusion that's happening. To me the new "payment" and "deposit" functionality is more net-like than the actual "net" option that has a split view in the bar chart.

I see your point about the bar graph net, although it's only a problem with that one view. It can be adjusted if necessary.

As for payment and deposit isn't it more true to life like this though? Don't you want to see your refunds in with your payments on the same view? Also, if the answer is no 😉, then I've explained a very simple solution for using new view to show current view with a filter(above)😁.

To be honest, I find it confusing.

Payment means 'money out', now it's being mingled with the concept of 'money in' which doesn't make sense. That's where 'net' is supposed to come in which is the balance of the two.

If payment is selected, then that is all that should be shown - what went out. It shouldn't require an an extra step(add a filter) to get back to the original meaning of the word.

Changes around Net shouldn't be affecting the Payment and Deposit options as they're distinct concepts and distorting the meaning of the words creates an unintuitive experience and adds unnecessary complexity.

carkom commented 3 months ago

To be honest, I find it confusing.

Payment means 'money out', now it's being mingled with the concept of 'money in' which doesn't make sense. That's where 'net' is supposed to come in which is the balance of the two.

If payment is selected, then that is all that should be shown - what went out. It shouldn't require an an extra step(add a filter) to get back to the original meaning of the word.

Changes around Net shouldn't be affecting the Payment and Deposit options as they're distinct concepts and distorting the meaning of the words creates an unintuitive experience and adds unnecessary complexity.

Okay, so from your feedback, my takeaway is that you find zero benefit in a net payments or net deposits number. You see no use cases where that number would be beneficial. I'm not trying to put words in your mouth, just trying to clarify your perpective. Thanks!

Teprifer commented 3 months ago

@carkom You may wish to re-read and mull over my earlier comment a bit more, it doesn't speak to the value of net payments or net deposits, only to the re-purposing of the current options and language as I outlined.

There is absolutely value in the net figures being discussed being added, however there is also is value in retaining the existing as-is options and keeping things simple in the sense of it is what it says on the tin.

You and I both have more aptitude in this space than most people who will be using Actual, what is easy and simple for us is often confusing and unintuitive to others.

Teprifer commented 3 months ago

To circle back to your original post, the alternate option you described of retaining the existing behaviour and expanding on the options available provides clearer communication to the user about what that option will present to them.

carkom commented 3 months ago

Okay, thanks for all the feedback. Also, thanks for the letting me play devils advocate. Concensus seems to be option 3/alternate option from the OP. Here's a peak at what I'm thinking.

image

carkom commented 3 months ago

Okay, this is ready for review. I'm ready for those detailed nit pick type reviews now. (@nikolajhendel @Teprifer @youngcw and any others that would like to join in).

Let me know if there's any parts that aren't working as expected. Cheers!

youngcw commented 3 months ago

Something that seems weird. Make a bar chart with split: interval, type: net, interval: any Select only expense categories.

The bars are doubled, it looks like its expecting to have both income and expense, but there is only one side so the bars get double long? Income only looks right

image

Even with both expense and income on the chart it looks like the expenses are always showing up double long, but if the net is positive the bar lines up to the right spot, but is doubled if the net is negative. This is easy to see if using a weekly interval split. (Look at the y-axis compared to what the tooltip claims is the net.

image

carkom commented 3 months ago

Something that seems weird. Make a bar chart with split: interval, type: net, interval: any Select only expense categories.

I think I see what I did wrong, fixed it. Can you check it again?

youngcw commented 3 months ago

Nice. It seems to be working now

carkom commented 3 months ago

Does anyone else want to offer their feedback before we merge this?

psybers commented 3 months ago

Shouldn't this net number be negative?

image

Settings:

image
psybers commented 3 months ago

If I toggle on the income, it then shows 10k (income is +16k). So not sure how it can say net 9k in that image, but then net 10k after you goggle income on. That makes it appear like income only added 1k.

psybers commented 3 months ago

Same settings, the table seems off in the average column:

image

It looks like the numbers are dividing by 7, despite being 'last 6 months'.

carkom commented 3 months ago

If I toggle on the income, it then shows 10k (income is +16k). So not sure how it can say net 9k in that image, but then net 10k after you goggle income on. That makes it appear like income only added 1k.

"Net" number was showing abs value. Fixed now.

carkom commented 3 months ago

Same settings, the table seems off in the average column:

It looks like the numbers are dividing by 7, despite being 'last 6 months'.

You've got current month toggled on. Last 6 plus current is 7 months.