howeyc / ledger

Command line double-entry accounting program
https://howeyc.github.io/ledger/
ISC License
461 stars 43 forks source link

No input validation #17

Closed slaxor closed 5 years ago

slaxor commented 5 years ago

I created a transaction with no values. after submitting the file was broken because it had an entry with empty amounts. Offending entry:

-----------8<-----------8<-----------8<-----------8<-----------8<-----------
2019/02/13 jkljlkjl
    Konto
    cash
    bar
----------->8----------->8----------->8----------->8----------->8-----------

This left the entire app broken, there was no (obvious) way to fix this in the webui. Error message:

-----------8<-----------8<-----------8<-----------8<-----------8<-----------
ledger.dat:18: Unable to balance transaction, more than one account change empty)
----------->8----------->8----------->8----------->8----------->8-----------

How it should be

Either valildate entries before writing or parse broken entries and let me open the form again. Deleting or ignoring would not be acceptable because the bookkeeping would not be trustworthy anymore

howeyc commented 5 years ago

You're right, there's no way to fix in webui.

I usually edit the ledger with a text editor, and use the webui for view and reports mostly.

I'll look into validating the transaction in the webui before appending to the file.