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

fix: Consider all amounts in multi-currency postings #149

Conversation

adamantike
Copy link

@adamantike adamantike commented Jan 18, 2024

For a transaction like:

2024/01/01 Cash transfer
    Assets:Savings
    Assets:Checking                          -20,000 INR
    Assets:Checking                             -500 USD

The posting returned by hledger will have a list of two amounts in the JSON key pamount, for the Assets:Savings account. Currently, we are only considering the first one we find, so the one for USD is ignored.

This change iterates over all the received amounts for each posting, to avoid incorrect calculations when this type of transactions are present.

For a transaction like:

```ledger
2024/01/01 Cash transfer
    Assets:Savings
    Assets:Checking                          -20,000 INR
    Assets:Checking                             -500 USD
```

The posting returned by `hledger` will have a list of two amounts in
the JSON key `pamount`, for the `Assets:Savings` account. Currently, we
are only consider the first one we find, so the one for USD is ignored.

This change iterates over all the received amounts for each posting, to
avoid incorrect calculations when this type of transactions are present.
Copy link

I do not plan to accept any pull request for now. If you
have a feature request, start a discussion, or if you found
a bug, create a new issue.

@github-actions github-actions bot closed this Jan 18, 2024
@adamantike adamantike deleted the fix/consider-all-amounts-in-multi-currency-posting branch January 18, 2024 23:59
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.

1 participant