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

update split transaction handling for csv export #2973

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wdpk
Copy link

@wdpk wdpk commented Jul 3, 2024

Fixes #522

Current behavior: when exporting to CSV, any splits (child) transactions, Payee overridden by the parent transaction, and parent transactions are specifically ignored when exporting.

This PR changes the behavior so children have a "(SPLIT x OF y) " note prefixed to their Notes, parents have a "(SPLIT INTO X) " prefixed to their Notes, and Parents are included in the export. Splits are counted by using the inverse of the sort_order.

There also seemed to be a typo. In my transactions table, it's "isChild" and "isParent" but existing logic appears to expect "is_parent". UPDATE: the "is_parent" logic is correct, but it shows as "isParent" in sqllitestudio.

Question: Do all split children have payees? I may have been a little too overzealous if not. Seems like yes though.


category: Bugfix
authors: [wdpk]

Fix exporting split transactions to CSV by including top-line transactions and noting the split.

@github-actions github-actions bot added the 🔍 Ready for Review Pull Request is not reviewed yet label Jul 3, 2024
@github-actions github-actions bot changed the title update split transaction handling for csv export [WIP] update split transaction handling for csv export Jul 3, 2024
Copy link

netlify bot commented Jul 3, 2024

Deploy Preview for actualbudget ready!

Name Link
🔨 Latest commit 35af118
🔍 Latest deploy log https://app.netlify.com/sites/actualbudget/deploys/6686609c015eff000823215e
😎 Deploy Preview https://deploy-preview-2973.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 github-actions bot added 🚧 WIP Still work-in-progress, please don't review and don't merge and removed 🔍 Ready for Review Pull Request is not reviewed yet labels Jul 3, 2024
Copy link
Contributor

github-actions bot commented Jul 3, 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.91 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
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 76.96 kB 0%
static/js/usePreviewTransactions.js 790 B 0%
static/js/AppliedFilters.js 27.12 kB 0%
static/js/wide.js 273.28 kB 0%
static/js/ReportRouter.js 1.23 MB 0%
static/js/index.js 3.16 MB 0%

Copy link
Contributor

github-actions bot commented Jul 3, 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.13 MB → 1.13 MB (+228 B) +0.02%
Changeset
File Δ Size
packages/loot-core/src/server/accounts/export-to-csv.ts 📈 +733 B (+24.34%) 2.94 kB → 3.66 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
kcab.worker.js 1.13 MB → 1.13 MB (+228 B) +0.02%

Smaller

No assets were smaller

Unchanged

No assets were unchanged

@wdpk
Copy link
Author

wdpk commented Jul 3, 2024

demo build works as almost intended for newly split transactions, i.e. seems to count them correctly. but pre-existing splits in the demo-file seem to have a differing sort_order numbering structure? looking at the test data export, the splits range in value from 0 to -2, but in my actual data (and the newly created splits) have sort_orders ranging from -1 to -5 (or higher as appropriate)
All-Accounts (2).csv

e: whoops and also have to handle some nulls

@wdpk
Copy link
Author

wdpk commented Jul 3, 2024

okay, now works as intended, doesn't add extra 'null' to the line.

my real data works as i wrote the new script, as does newly-created transactions.

I'm guessing that the sort_order being 0 on some of the splits exported from the test-data is because of the test-data and not the performance of code under this PR.

@wdpk wdpk changed the title [WIP] update split transaction handling for csv export update split transaction handling for csv export Jul 3, 2024
@github-actions github-actions 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 Jul 3, 2024
@wdpk wdpk force-pushed the csv-export-split-handling branch from 2cb1de5 to d965232 Compare July 3, 2024 11:46
@wdpk wdpk force-pushed the csv-export-split-handling branch from 628cc5d to 35af118 Compare July 4, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 Ready for Review Pull Request is not reviewed yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Exporting to csv doesn't account for split transactions
1 participant