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

Adding expenses without adding account makes Ledger sad #4

Open
waynew opened this issue Feb 10, 2016 · 2 comments
Open

Adding expenses without adding account makes Ledger sad #4

waynew opened this issue Feb 10, 2016 · 2 comments

Comments

@waynew
Copy link

waynew commented Feb 10, 2016

Using Ledger 3.1.1-20160111, but I assume it's the same for all versions?

Click on the expenses page, then fill out the form. Do not check account, but do put a name in the account. Click add:

This expense will break things

Now, click on Home.

If you have debugging mode on you'll see a stack trace. Apparently, the above will create an entry in your ledger file that looks like this:

2016-02-10 Breaking Things
    ;This will break ledger
    Taking Names                            €    1000

As there's no account to subtract from, ledger has a big problem trying to balance it:

  File "/home/wayne/programming/ledger-dashboard/env/lib/python3.5/site-packages/sh.py", line 516, in handle_command_exit_code
    raise exc(self.ran, self.process.stdout, self.process.stderr)
sh.ErrorReturnCode_1:

  RAN: '/usr/bin/ledger --no-color --file=/path/to/example.dat balance ^Assets --balance-format=%A %(display_total)\n%/'

  STDOUT:


  STDERR:
While parsing file "/path/to/example.dat", line 9:
While balancing transaction from "/path/to/example.dat", lines 7-9:
> 2016-02-10 Breaking Things
>     ;This will break ledger
>     Taking Names                            €    1000
Unbalanced remainder is:
              € 1000
Amount to balance against:
              € 1000
Error: Transaction does not balance

I'm just getting started with ledger, so I'm not sure if it should require both accounts, or if it's OK to have neither.

@Ikke
Copy link
Owner

Ikke commented Feb 14, 2016

Thanks for this report. I will look into it.

@MartyLake
Copy link

I can confirm this bug. By default ledger needs another account to balance with. Right now, the entry form can break the ledger file. not a big deal since it is plain text.

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

No branches or pull requests

3 participants