Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

1.30: Balance assertion fails when cost is included #2137

Copy link
Copy link

Description

@usaAmch
Issue body actions

When using balance assertion (=) for accounts that contains amounts with costs (@), the balance report fails.

Steps to Reproduce

  • Create a file with the following content:
2012-01-01 open
    assets:wallet                       100.00 MXN
    equity

2012-01-02 buy
    assets:bag                  10 ABC @ 1.000 MXN
    assets:wallet                      = 90.00 MXN
    rounding

2012-01-03 buy
    assets:bag                  10 ABC @ 1.001 MXN
    assets:wallet                      = 80.00 MXN
    rounding

2012-01-04 check
    assets:bag                          0 = 20 ABC
  • Run the command hledger -f example.txt bal

Expected Result

The command finishes without errors, and it prints the correct amount for each account.

Current Result

The following error is thrown:

   | 2012-01-04 check
16 |     assets:bag               0 = 20 ABC
   |                                ^^^^^^^^

This balance assertion failed.
In account:    assets:bag
and commodity: ABC
this balance was asserted:     20
but the calculated balance is: 10
a difference of:               10

Notes

  • If the costs of ABC are the same, then the command works (i.e., update line 9 to have 10 ABC @ 1.00 MXN)
  • Version/OS:
% hledger --version            
hledger 1.32, mac-aarch64
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.Something wrong, confusing or sub-standard in the software, docs, or user experience.affects3-fewAffects just a few users.Affects just a few users.annoyance4-majorMajor usability/doc bug, or any regression or crash.Major usability/doc bug, or any regression or crash.bountyThar's some kind o' loot on offer..Thar's some kind o' loot on offer..duplicatejournalThe journal file format, and its features.The journal file format, and its features.regressionA backwards step, indicating a weakness in our QA. We don't like these.A backwards step, indicating a weakness in our QA. We don't like these.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.