Hello, resurrecting this thread because I think I'm facing a similar issue and found this thread when searching.
I use commodities to track inventory of building supplies. So far it's worked ok, though I've had several hiccups to overcome.
The latest is in closing the books for the previous year. I want to retain the inventory across the transition. My problem is that out of the equity command comes a posting for each commodity I have. Previously, I had managed to suppress this except when desired, but in the new year I have all hundred-plus commodities as postings in the Opening Balance transaction.
I must admit I've gotten my system to work more through trial and error than through a deep understanding of commodities in Ledger. What worked for me up till now was:
* using x COMMODITY @ UNIT-PRICE.
* always appending `--market` to my ledger command, except when I specifically want to see my materials inventory
* always explicitly including the Euro equivalent in the opposite posting. For example, when I 'use' 100 screws, if I don't put the Euro equivalent in the target account posting, I get screws back as a unit from then on.
I tried the `--lots` option as mentioned above. However, this doesn't seem to have any effect.
I'm at a bit of a loss here. It might help to compare an example transaction as it brought in some of these commodities originally:
```
2021-06-01 * Purchase supplies
Assets:Bank -€ 550
Assets:Inventory 5000 "screws4x40_pc" @ €0,01
Assets:Inventory 100 "DougFir2x4_m1" @€5,00
```
But `equity` at the end of the year produces:
```
2021-12-31 * Opening Balances
Assets:Inventory 5000 "Screws4x40_pc"
Assets:Inventory 100 "DougFir2x4_m1"
Equity:Opening Balances 5000 "Screws4x40_pc"
Equity:Opening Balances 100 "DougFir2x4_m1"
```
Using `--lots` adds the `{€0,01}` syntax.
I don't understand whether the different syntax (@ vs {}) is causing this, or something else.
I'm currently in the process of trying to remove all those commodities from Opening Balances and replace them with a single posting in Euros, but I'm afraid I can't post my results yet here because I'm being blocked by parsing errors which I don't understand yet. Also, this approach seems like too much work to do every year even if it will work in the end.
So I'm wondering if there's some way to tease out an Opening Balance statement that will let me keep seeing Euros in reports in the new year? Or, if someone can explain where I'm misunderstanding the use of commodities that's causing my troubles?
Thanks,
Hans