xkikeg / okane

Plain text accounting software supporting ledger-cli format using Rust
MIT License
4 stars 0 forks source link

Lot price must be amount to be compatible with Ledger #143

Open xkikeg opened 4 months ago

xkikeg commented 4 months ago

Currently my program accepts the one below

2023/4/20 stock
    Assets:Brokers                               -10 FOOBAR {(1000.00/10 USD)} @ 110 USD
    Income:Capital Gain                         -100 USD
    Assets:Banks                               1,100 USD

But Ledger doesn't accept this.

While parsing posting:
  Assets:Brokers                               -10 FOOBAR {(1000.00/10 USD)} @ 110 USD
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: No quantity specified for amount

OTOH, if you remove the parens, Ledger still ignores the expression silently.

> 2023/4/20 stock
>     Assets:Brokers                               -10 FOOBAR {1000.00/10 USD} @ 110 USD
>     Income:Capital Gain                         -100 USD
>     Assets:Banks                               1,100 USD
Unbalanced remainder is:
         -100.00 USD
Amount to balance against:
        1,100.00 USD

So probably we should