On Mon, Jun 15, 2020 at 02:23:09PM -0700, Colin Dean wrote:
> I’m updating my finances for the first time in a while starting afresh: a
> whole new transaction record.
> 
> Something I’ve somehow never hit before: My workflow is to append the
> output of ledger-autosync to my tx record, make adjustments, categorize,
> commit, then sort and format using ledger print. What I’m noticing is that
> my commodity directive is getting stripped.
> 
> $ cat test.ledger
> commodity USD
>   alias $
>   format 1,000.00
> 
> 2020/06/16 Test
>   Expenses    $56
>   Assets      -56 USD
'alias' provides an alternate way to INPUT entries.
It is converted and printed in the canonical format.

There's a note in the infodoc that the 'format' directive:
"In the future, using this directive will disable Ledger's observation
of other ways that commodity is used, and will provide the “canonical”
representation."

These two examples will produce different output:
===
commodity USD 
  alias $
  format 1,000.00

2020/06/16 Test
  Expenses    $56 
  Assets      -56 USD 
===
commodity $
  alias USD
  format 1,000.00

2020/06/16 Test
  Expenses    $56 
  Assets      -56 USD 
====


> 
> 
> $ ledger -f test.ledger bal
>              -56 USD  Assets
>               56 USD  Expenses
> --------------------
>                    0
> 
> $ ledger -f test.ledger print
> 2020/06/16 Test
>     Expenses                                  56 USD
>     Assets
> 
> This is making is hard to intermix $ and USD, as ledger-autosync mixes the
> two outputs depending on the converter in use and I tend to use USD when I
> do things manually.
I think ledger-autosync should probably gain options to convert
consistently, and then it would match your USD manual inputs.

> 
> Is there a way to disable removing the commodity? I understand that ‘print’
> is supposed to output the most space-efficient representation of the tx
> log, but it’s annoying to have to re-add the commodity directive every time
> I sort.
It converts to the canonical format, which other than the --raw option,
doesn't help you.


-- 
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
E-Mail   : [email protected]
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/robbat2-20200616T065211-742304586Z%40orbis-terrarum.net.

Attachment: signature.asc
Description: PGP signature

Reply via email to