Skip to content

Add multicurrency support#80

Open
StreliaPico wants to merge 2 commits intotgrosinger:mainfrom
StreliaPico:multicurrency
Open

Add multicurrency support#80
StreliaPico wants to merge 2 commits intotgrosinger:mainfrom
StreliaPico:multicurrency

Conversation

@StreliaPico
Copy link
Copy Markdown

@StreliaPico StreliaPico commented Jan 24, 2025

Pull Request Description

This PR adds slightly more robust methods for dealing with/parsing multiple currencies.

Main changes:

  • Balance graph now only shows transactions/balances with the Currency Symbol specified in the settings, instead of summing all values and ignoring the currency.
  • Transaction list now correctly lists totals of each different currency, instead of summing all values and ignoring the currency.
  • (Internal) fillMissingAmount method now correctly balances multiple currencies.

Known Issues

  • Balance graph only shows a singular currency, that specified in the settings. While this is sufficient for my own personal use it may be a good idea to add graph views supporting the other currencies.
  • Unable to add transaction with multiple currencies with the modal. (You can still do it manually)
  • Attempting to edit a transaction with multiple currencies with the modal fails (appears to cause the same error as Amounts add up to $0.00 but must add up to $0 #51).
    • Given that multiple currencies are not really supported in the UI to begin with this may not be a huge issue. Perhaps a "not supported" modal could show up when trying to edit such transactions?
  • No tests.
    • I was unable to get the testing environment to work on my machine, so I was unable to ensure tests ran/write new tests.
    • Given the amount of changes made to the backend, tests should be written for the new functionality (and existing functionality retested) before this PR can be accepted.

@StreliaPico
Copy link
Copy Markdown
Author

StreliaPico commented Jan 24, 2025

Re c17dc53:

Not sure if this is the right place to put this or if it should be in a separate PR, especially since this modifies one of the same files.

Current recent transactions are ordered backwards if done on the same day, this commit should fix that.

Completely untested, will need to run this one for a few days to see.

@devdammit
Copy link
Copy Markdown

Hello! Is it planned to merge this PR? For now, this is the only reason why I can't use the plugin with an existing transaction database.

@tgrosinger
Copy link
Copy Markdown
Owner

tgrosinger commented Jun 18, 2025

I have not used this plugin for years and unfortunately do not have capacity to maintain it at the moment.

@StreliaPico
Copy link
Copy Markdown
Author

If you can use the terminal and npm, you can install my fork/branch directly. The Obsidian documentation has more info on compiling plugins.

I've been using this daily since the PR and have not encountered any issues so far.

Do note that even with this PR, your existing database may still not work as things aren't parsed 1 to 1.

An example is the limited currency support that only allows several specific one-character non-alphanumeric symbols. This means transactions involving "3 apples" as outlined in the ledger-cli docs don't work here. Neither will currency codes like "USD", "EUR", or "VND", which you may have given that you imply your existing database already has different currencies in it.

I've tried to fix that issue myself but hit a wall with the parser and have not had time to come back to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants