diff --git a/hledger/Hledger/Cli/Anon.hs b/hledger/Hledger/Cli/Anon.hs index 09b791e4d..0d5de8daa 100644 --- a/hledger/Hledger/Cli/Anon.hs +++ b/hledger/Hledger/Cli/Anon.hs @@ -42,6 +42,7 @@ instance Anon Posting where instance Anon Transaction where anon txn = txnTieKnot $ txn { tpostings = map anon . tpostings $ txn , tdescription = anon . tdescription $ txn + , tcode = anon . tcode $ txn , tcomment = T.empty } diff --git a/tests/journal/anon.test b/tests/journal/anon.test index 9c2ac5c9d..96810dc66 100644 --- a/tests/journal/anon.test +++ b/tests/journal/anon.test @@ -33,3 +33,8 @@ $ hledger -f- print --anon $ hledger -f- reg --anon > !/borrow/ + +# Basic tests on transaction code + +$ hledger -f- print --anon +> !/receipt/