darcys22 / godbledger

Accounting Software with GRPC endpoints and SQL Backends
https://www.godbledger.com/
GNU General Public License v3.0
480 stars 56 forks source link

Currency when importing ledger file #179

Open porjo opened 2 years ago

porjo commented 2 years ago

Interesting project, thanks! I have a question and a comment

How to set the currency for data being imported from ledger file? e.g. ./ledger-cli file <filename>

Also, it'd be nice to have an option for reporter to output values in dollars with commas. e.g

$ ./reporter trialbalance

     ACCOUNT   | BALANCE AT 08 JANUARY 2022  |   FORMATTED
---------------+-----------------------------+-------------------------
  acct1        |          1983458.00         |     19,834.58
  acct2        |          -759830.00         |   -  7,598.30
darcys22 commented 2 years ago

Hi Ian! Thanks for the kind words, appreciate the feedback.

I've merged both #180 and #181 into the dev branch which should allow us to do both of those things. The currency for the ledgercli files defaulted to USD only and to be honest i wasn't sure anyone was using it.

But now you should be able to change the currency with the following:

./ledger-cli file --currency AUD <filename>

In addition the reporter now defaults to a formatted output with dollar signs and commas. Then provides a flag line argument for an unformatted output with the following:

./reporter trialbalance --unformatted
darcys22 commented 2 years ago

Although now im looking at it the ledger-cli importer is definitely importing dollars as cents. So that needs addressing too

darcys22 commented 2 years ago

And done in #182

porjo commented 2 years ago

Thanks!

Something still isn't quite right. My input ledger file has values in dollars. When I import that using the latest changes, the trialbalance shows output 100x what it should be (cents instead of dollars?).

Something else I noticed is that I can run ./ledger-cli and it completes without error even if godbledger process isn't running. I think it should fail if it can't make the GRPC connection.

darcys22 commented 2 years ago

Yeah ill need to look i to that some more #182 was ment to resolve that and was working on my local machine.

and yeah it should fail if there is no grpc connection. Might be something to do with the parsing of the ledgercli files.