Commit Graph

483 Commits

Author SHA1 Message Date
James Long
df8f5853e8 Route aggregate queries in transaction grouped mode through the correct layer to remove deleted transactions (#247)
I recently migrated my personal usage of Actual over to the open-source
version and imported a bunch of transactions. I have a _lot_ of history
in Actual, including a lot of weird edge cases like deleted split
transactions. While reconciling I noticed that my account balance shown
at the top was incorrect, even though the running balance was current.

Digging into this, I discovered that we aren't correctly handling
aggregate queries when querying transactions in the "grouped" mode.
Aggregate queries don't make sense in the "grouped" mode. Grouped means
that you want a list of transactions that include both the parent and
child transactions (when they are split). If you are summing up all the
amount, you only want to consider non-parent transactions. So we switch
it back to "inline" mode, but the way we did this previously was to
manually stitch the query together.

Even though was add SQL to ignore deleted transactions, we still
possibly include them. A child transaction may not be marked as deleted,
even though the parent transaction is deleted. When a parent transaction
is deleted, all child transactions should be considered deleted as well,
regardless of their tombstone status. This is what the
`v_transactions_internal_alive` view does. Previously we weren't going
through this view though, so we could still potentially include split
transactions even though they've been deleted.

This is little hacky, but it fixes the immediate problem. We fall back
to the inline mode by modifying the where clause, and we also adjust the
view that it queries to use the correct one.
2023-03-12 23:00:15 +00:00
Jakub Kuczys
a5a1c81eaf 🐛 (nordigen) fallback to array version of remittanceInformationUnstructured if necessary (#745)
Try falling back to `remittanceInformationUnstructuredArray.join(', ')`
when neither `debtor/creditorName` nor
`remittanceInformationUnstructured` fields are present.

Addresses a suggestion from
https://github.com/actualbudget/actual/issues/724#issuecomment-1464907064
2023-03-12 21:07:26 +00:00
Jakub Kuczys
0baccfd728 🐛 (nordigen) fix detection of -0.00 "debited" transactions (#744)
Check if the transaction amount is a positive 0 rather than -0.
I went for casting the string with `Number` but I could instead replace
the whole condition with `!trans.amount.startsWith('-')` or with
`trans.amount > 0 || trans.amount == '0.00'` if either of these variants
are preferred.

Fix for
https://github.com/actualbudget/actual/issues/724#issuecomment-1464907064
2023-03-12 16:53:10 -04:00
Jed Fox
b8d7e39110 Set the filename/filetype before attempting to parse (#738)
Fixes #19 by setting the file type before attempting the parse. You’ll
now be able to change the import options even if the first import
attempt failed.

<img width="826" alt="Screenshot_2023-03-10 07 40 23"
src="https://user-images.githubusercontent.com/25517624/224318498-565e1835-8820-4eaf-9e58-df33bb46d744.png">
2023-03-11 16:31:37 -05:00
Matiss Janis Aboltins
0bae379c17 🔖 (5.1.0) upgrade better-sqlite3 to v8.2 (#735)
A new release for `api` too so we could start using `better-sqlite3` v8
in `actual-server`.
v23.3.0
2023-03-09 19:31:00 +00:00
Matiss Janis Aboltins
da9d016550 🔖 (23.3.0) experimental bank-sync integration, maintenace, fixes (#734)
23.3.0

Docs: https://github.com/actualbudget/docs/pull/119
2023-03-09 19:07:58 +00:00
Jed Fox
a82300e20f Remove outdated part of the postinstall script (#733) 2023-03-09 07:36:52 -05:00
Vincent Schmandt
497b2a2009 Implement outdated version indicator (#463) (#621)
This implements a simple indicator showing the user if the currently
used version is outdated by utilising GitHub tags to track the latest
version.
Closes #463

---------

Co-authored-by: Jed Fox <git@jedfox.com>
2023-03-07 22:48:12 -05:00
Jed Fox
2793beab6f Create an artifact with the built web UI for each commit (#729)
Part of fixing the horrendously slow Docker build for the server edge
images.
2023-03-06 16:57:50 -05:00
Matiss Janis Aboltins
f6e6537834 (bank-sync) use full bank list + autocomplete (#727)
Related to: https://github.com/actualbudget/actual-server/pull/144

See the above PR for more details.

---

<img width="577" alt="Screenshot 2023-03-05 at 17 54 10"
src="https://user-images.githubusercontent.com/886567/222977363-605f8b1e-be7d-4594-93c7-dfaa6cb15ac3.png">
2023-03-06 20:45:25 +00:00
Jed Fox
49eda0f4a0 Enable most of the disabled ESLint rules (#720) 2023-03-05 09:23:12 -05:00
Matiss Janis Aboltins
7faed79530 ⬆️ upgrade react-modal to v3.16.1 and remove the patch (#718) 2023-03-05 13:46:13 +00:00
Filip Stybel
5bb4f4b279 Nordigen integration - account sync (#457)
* Update gitignore about .idea folder

The .idea folder is generated by IntelliJ IDEA

* Add integration with Nordigen

* Fix linter

* Use longer access to the account

* Move normalizatoin of accounts to the backend side

* Fix possibility to force remove account

* Move normalization of transactions to the backend side

* Fix Settings.js after merge

* fix enableing bank sync

* delete old Settings component

* Use camelCase for nordigen/remove-account call

* WIP refactor

* Fix auto-selecting existing accounts

* Fix unlinking accounts

* Align to backend changes for Nordigen integration

* Fix AnimatedLoading

* Code review changes

* Fix TZ date issue

* rm mobile package

* rm BankSync settings section

* rm console.log

* rm comment

* applies some alignments from code review

* applies some alignments from code review

* Add prefix for nordigen specific functionality

* Use arrow char

* Add prefix for nordigen functionalities

* Fix linter

* Display only open accounts

* Update packages/desktop-client/src/nordigen.js

Co-authored-by: Jed Fox <git@jedfox.com>

* Fix incorrect calc of TZ for endDate

* Improved error checking

* Fix throwing invalid-schema error

* Fix for syncing large batches in Safari

---------

Co-authored-by: Filip Stybel <filip.stybel@ynd.co>
Co-authored-by: Leon Ebel <24588023+ebelleon@users.noreply.github.com>
Co-authored-by: Jed Fox <git@jedfox.com>
2023-03-03 19:41:07 -05:00
Jed Fox
ec91effe96 Remove code in loot-core/src/server/spreadsheet that uses escodegen (#721) 2023-03-02 12:04:55 -05:00
Matiss Janis Aboltins
28b5124dd8 🚨 re-enable react-hooks/rules-of-hooks eslint rule (#715) 2023-03-02 17:03:11 +00:00
Matiss Janis Aboltins
08b997a791 🔥 remove dead code: budget-sheets-old (#708) 2023-03-02 17:03:02 +00:00
Matiss Janis Aboltins
7d2adfa02e 👷 upgrade github actions (#711)
* 👷  upgrade github actions

* Upgrade actions/checkout
2023-03-02 17:02:50 +00:00
Jed Fox
4e59bdf632 Fix e2e test to not assume it’s been run on Feb 28, 2023 (#717) 2023-03-01 15:08:35 -05:00
Neil
de69e1582c Added option to include exchange rate multiplier during import (#690)
* Addd option to include exchange rate during import

* Added changes to multipler option within form

* Use Input component

* build fixes

* Fix parsing errors

* lint fixes

* Update packages/loot-design/src/components/modals/ImportTransactions.js

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>

* Update packages/loot-design/src/components/modals/ImportTransactions.js

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>

* Update packages/loot-design/src/components/modals/ImportTransactions.js

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>

* Variable name updates

* Record a trace when retrying failing tests

---------

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>
Co-authored-by: Jed Fox <git@jedfox.com>
2023-03-01 14:49:48 -05:00
Jed Fox
9ead7d509d Intelligently adjust field for newly added action (#680)
* Intelligently adjust field for newly added action

* Remove unnecessary switch case

* Dedupe list of fields

* Remove unnecessary conditionFields prop

* Intelligently adjust field for newly added condition

* Use a less specific condition
2023-02-28 16:59:33 -05:00
Jed Fox
a56f295185 Upgrade better-sqlite3 to the latest version (#714)
* Sort transactions by date in updateCategoryRules

* Update better-sqlite3 to 7.5.0

* Update better-sqlite3 to v8
2023-02-28 16:40:33 -05:00
Matiss Janis Aboltins
2093b13c14 🔥 removed usage of babel-preset-jwl-app (#713)
* 🔥  removed usage of babel-preset-jwl-app

* Add @babel/preset-react
2023-02-28 21:07:13 +00:00
Jed Fox
6886049616 Add a missing space to the fatal error message (#712) 2023-02-28 15:58:31 -05:00
Jed Fox
0688c25843 Remove/dedupe/upgrade several dependencies (#702)
* Run `yarn dedupe`

* Update to better-sqlite3@latest

* Remove react-native

* Remove a bunch more unused deps

* Update mitt to 3.0

* Remove a few more

* Remove react-native-gesture-handler

* Revert "Update to better-sqlite3@latest"

This reverts commit d436bc8d73f2745f484def4e40596322d0c56458.

* Dedupe better-sqlite3 versions

* snapshots!

* Fix jsdom error

* Revert "Dedupe better-sqlite3 versions"

This reverts commit f99d2ab6f9.

* Add back jest-watch-typeahead

* Fix conflicting Jest version

(The jest-environment-jsdom package that is magically available seems to only be compatible with Jest 27)
2023-02-28 15:47:53 -05:00
Jed Fox
7a803e1bf1 Update the Bootstrap page to be more welcoming (#676) 2023-02-28 15:25:00 -05:00
Jed Fox
80e135e38f Allow rendering a schedule in <Value /> (#706)
* Allow rendering a schedule rule in <Value />

* Refactor: RulesPage.getNthRule returns arrays for conditions/actions

* Visit the rules page after creating a schedule
2023-02-28 14:35:38 -05:00
Matiss Janis Aboltins
8cff0ba749 🔥 remove more dead code (#710) 2023-02-28 19:34:17 +00:00
Matiss Janis Aboltins
b7f7ad8828 🔥 refactor MonthPicker and remove ElementQuery (#709) 2023-02-28 18:58:43 +00:00
Jed Fox
72f4f1523c Don’t allow bulk editing to set a field to null (#705) 2023-02-28 13:09:35 -05:00
Jed Fox
b90da4404c Fix check for crypto.subtle (#707) 2023-02-28 12:53:37 -05:00
Matiss Janis Aboltins
18eae3ebf6 🏗️ moving back to create-react-app (#697) 2023-02-28 08:50:49 +00:00
Matiss Janis Aboltins
9fd45ce53d 🔥 removing lively from MonthPicker (#703) 2023-02-27 22:02:23 +00:00
Matiss Janis Aboltins
019a1e2c42 🔥 remove unused component library code (#704) 2023-02-27 22:01:52 +00:00
Jed Fox
c82f242c16 Fix notes button not being visible unless hovered (#700)
* Fix notes button not being visible unless hovered

* A few tweaks

* !important
2023-02-27 13:42:43 -05:00
Venkata Krishna S
2d8d5798c9 Adds delay before note is displayed on hover. Solves issue #658. (#668)
* Adds delay

* change delay to half second.

* Added async

* Changed Delay

* lint fix

* Changed hover actions

* onMouseLeave

* Change logic

---------

Co-authored-by: Jed Fox <git@jedfox.com>
2023-02-27 11:23:51 -05:00
Matiss Janis Aboltins
69a54a16e4 (e2e) adding e2e tests for accounts: creating & closing (#695) 2023-02-26 15:25:53 +00:00
George Sumpster
42b5208b8b Add button and 'esc' shortcut to clear transaction filter (#693) 2023-02-26 10:01:26 -05:00
Matiss Janis Aboltins
fa28f28289 (e2e) adding e2e tests for schedules page (#694)
Working on #583
2023-02-25 13:12:56 +00:00
Matiss Janis Aboltins
8f2dc5d531 🐛 (import) date formats supporting digits without leading zeros (#692)
* 🐛 (import) date formats supporting digits without leading zeros

Closes #607

* ISO test case
2023-02-24 22:10:52 +00:00
Jed Fox
081b98cc4b Don’t post messages to the worker until it is ready (#681) 2023-02-24 15:43:19 -05:00
Jed Fox
f43041a39f Don’t run linting while building in CI (#689)
* Don’t run linting while building in CI

* Update webpack.config.js
2023-02-24 13:59:40 -05:00
Jed Fox
93a1f8a944 Updates to the @actual-budget/api package (#464)
* Make it easier to build the bundle.api.js for the API

* Remove budgetId parameter, move config to top level of API

* that’s a breaking change

* Add support for signing into the server in init()

* Add api.downloadBudget(syncId, { password }) method

* Fix lint errors

* Refactor: extract out getSyncError

* api/download-budget: sync if possible instead of downloading

* Don’t bother with fetching remote files and installing key if the file is local

* *groupId

* FIx lint issues

* Remove extra close+reopen

* Refactor out duplicate load-budget logic

* Trailing commas
2023-02-23 23:01:05 -05:00
Jed Fox
2a8b25a366 Fix error cases in displaying filters/rules (#678)
* Add missing imported_payee case

* Switch over to a `switch` to ensure no other cases are missed

* Fix switching from “amount” to “amount (inflow/outflow)”

* fix crash when parsing null value as number

* Fix formatting for “payee/category/account contains” filters
2023-02-23 15:14:16 -05:00
Jed Fox
f2163af9df Make the “Not logged in” warning a button (#674) 2023-02-23 15:14:05 -05:00
Jed Fox
1f486c59af Don’t force user to re-enter password after changing it (#675) 2023-02-23 14:48:11 -05:00
Matiss Janis Aboltins
63b48812d5 add interactive-tools yarn plugin (#684) 2023-02-23 19:44:20 +00:00
Matiss Janis Aboltins
92d18868b6 ⬆️ upgrade yarn to v3.4.1 (latest stable) (#683)
* ⬆️  upgrade yarn to v3.4.1 (latest stable)

* Fix resolutions
2023-02-23 19:19:33 +00:00
Jed Fox
fc308ececc Allow the server to auto-configure the server URL for the client (#649)
* Allow the server to auto-configure the server URL for the client

* Extract server URL/version logic out to ensure consistent updates

* ()

* Be more explicit about when the server version is re-fetched

* Use a single layer of context provider

* Move the bootstrap route to /account/needs-bootstrap

* No more `isActual`

* Refactor to call subscribe-needs-bootstrap instead of fetch()

* Dedupe calls to subscribe-needs-bootstrap

* Don’t revalidate the server when we just validated it

* simplify

* Fix setServerURL
2023-02-21 13:36:11 -05:00
Jed Fox
2bc614633e Log more debugging information for an invalid-schema sync error (#671)
* Provide more debugging information when throwing an invalid-schema sync error

* Don’t log the errors directly

* Update dynamic cell warning to be clearer

* rebuild
2023-02-21 13:27:28 -05:00
Matiss Janis Aboltins
cb0ae2d39a 📝 add demo image to the README (#666)
* 📝  add demo image to the README

* Different image
2023-02-17 18:26:57 +00:00