When I started using ledger a few years ago, I defaulted to using the dollar symbol ($) in my journal files. This, of course, works just fine. If I want a balance sheet report, I run the following command:
ledger -f 1.ldg --price-db price_db.txt -V --strict –explicit ^Ass ^Lia --depth 2
This produces the following output:
$xxx.xx Assets
$xxx.xx yyyyy
$xxx.xx yyyyy
$xxx.xx yyyyy
$xxx.xx yyyyy
$xxx.xx yyyyy
$xxx.xx yyyyy
$xxx.xx yyyyy
$xxx.xx yyyyy
$xxx.xx yyyyy
$xxx.xx yyyyy
$xxx.xx yyyyy
$-xxx.xx Liabilities
$-xxx.xx yyyyy
$-xxx.xx yyyyy
$-xxx.xx yyyyy
--------------------
$xx,xxx.xx
I decided to switch to using USD instead of the dollar symbol. To do this I removed all of the dollar symbols from my journal files and price database and added USD. Following is the format I used:
xxx.xx USD
Now when I run the exact same balance sheet report, I see commodities that I didn’t see before I made my changes.
-5.37578 KO
xx,xxx.xx USD
-2,139.718 VTHRX Assets
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
-5.37578 KO
xxx.xx USD
-2,139.718 VTHRX yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
-xxx.xx USD Liabilities
-xxx.xx USD yyyyy
-xxx.xx USD yyyyy
-xxx.xx USD yyyyy
--------------------
-5.37578 KO
xx,xxx.xx USD
-2,139.718 VTHRX
What’s interesting here is that the non-USD commodities appear to be commodities that I’ve previously sold. In other words, I no longer hold VTHRX, and while I do hold some KO, it’s a fraction of a share.
If I run the same command WITHOUT the -V option, I get a report that accurately reflects my current holdings:
ledger -f 1.ldg --price-db price_db.txt --strict –explicit ^Ass ^Lia --depth 2
0.00263224 ABC
0.04860 KO
xx,xxx.xx USD Assets
xxx.xx USD yyyyy
xxx.xx USD yyyyy
0.00263224 ABC yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
0.04860 KO
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
-xxx.xx USD Liabilities
-xxx.xx USD yyyyy
-xxx.xx USD yyyyy
-xxx.xx USD yyyyy
--------------------
0.00263224 ABC
0.04860 KO
xx,xxx.xx USD
Running the original command with -X USD produces the output I expected to get in the first place. In other words, the same output I received before changing $ to USD, but with the new commodity designator.
ledger -f 1.ldg --price-db price_db.txt -V --strict –explicit ^Ass ^Lia --depth 2 -X USD
xx,xxx.xx USD Assets
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
xxx.xx USD yyyyy
-xxx.xx USD Liabilities
-xxx.xx USD yyyyy
-xxx.xx USD yyyyy
-xxx.xx USD yyyyy
--------------------
xx,xxx.xx USD
Any ideas on what’s happening here?