From 6dcddadd9f0534df89ef2fdd9e5ccf8e18901799 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 1 Oct 2019 20:30:31 -1000 Subject: [PATCH] ;journal: in generated-transaction:/posting: tags, add a space before the value --- .../Hledger/Data/PeriodicTransaction.hs | 54 +++++++-------- hledger-lib/Hledger/Data/Posting.hs | 14 ++-- .../Hledger/Data/TransactionModifier.hs | 4 +- tests/forecast.test | 8 +-- tests/journal/auto-postings.test | 46 ++++++------- tests/journal/default-commodity.test | 2 +- tests/rewrite.test | 66 +++++++++---------- 7 files changed, 98 insertions(+), 96 deletions(-) diff --git a/hledger-lib/Hledger/Data/PeriodicTransaction.hs b/hledger-lib/Hledger/Data/PeriodicTransaction.hs index 3f986cff5..593ed2fd1 100644 --- a/hledger-lib/Hledger/Data/PeriodicTransaction.hs +++ b/hledger-lib/Hledger/Data/PeriodicTransaction.hs @@ -87,107 +87,107 @@ instance Show PeriodicTransaction where -- -- >>> _ptgen "monthly from 2017/1 to 2017/4" -- 2017/01/01 --- ; generated-transaction:~ monthly from 2017/1 to 2017/4 +-- ; generated-transaction: ~ monthly from 2017/1 to 2017/4 -- a $1.00 -- -- 2017/02/01 --- ; generated-transaction:~ monthly from 2017/1 to 2017/4 +-- ; generated-transaction: ~ monthly from 2017/1 to 2017/4 -- a $1.00 -- -- 2017/03/01 --- ; generated-transaction:~ monthly from 2017/1 to 2017/4 +-- ; generated-transaction: ~ monthly from 2017/1 to 2017/4 -- a $1.00 -- -- -- >>> _ptgen "monthly from 2017/1 to 2017/5" -- 2017/01/01 --- ; generated-transaction:~ monthly from 2017/1 to 2017/5 +-- ; generated-transaction: ~ monthly from 2017/1 to 2017/5 -- a $1.00 -- -- 2017/02/01 --- ; generated-transaction:~ monthly from 2017/1 to 2017/5 +-- ; generated-transaction: ~ monthly from 2017/1 to 2017/5 -- a $1.00 -- -- 2017/03/01 --- ; generated-transaction:~ monthly from 2017/1 to 2017/5 +-- ; generated-transaction: ~ monthly from 2017/1 to 2017/5 -- a $1.00 -- -- 2017/04/01 --- ; generated-transaction:~ monthly from 2017/1 to 2017/5 +-- ; generated-transaction: ~ monthly from 2017/1 to 2017/5 -- a $1.00 -- -- -- >>> _ptgen "every 2nd day of month from 2017/02 to 2017/04" -- 2017/01/02 --- ; generated-transaction:~ every 2nd day of month from 2017/02 to 2017/04 +-- ; generated-transaction: ~ every 2nd day of month from 2017/02 to 2017/04 -- a $1.00 -- -- 2017/02/02 --- ; generated-transaction:~ every 2nd day of month from 2017/02 to 2017/04 +-- ; generated-transaction: ~ every 2nd day of month from 2017/02 to 2017/04 -- a $1.00 -- -- 2017/03/02 --- ; generated-transaction:~ every 2nd day of month from 2017/02 to 2017/04 +-- ; generated-transaction: ~ every 2nd day of month from 2017/02 to 2017/04 -- a $1.00 -- -- -- >>> _ptgen "every 30th day of month from 2017/1 to 2017/5" -- 2016/12/30 --- ; generated-transaction:~ every 30th day of month from 2017/1 to 2017/5 +-- ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5 -- a $1.00 -- -- 2017/01/30 --- ; generated-transaction:~ every 30th day of month from 2017/1 to 2017/5 +-- ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5 -- a $1.00 -- -- 2017/02/28 --- ; generated-transaction:~ every 30th day of month from 2017/1 to 2017/5 +-- ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5 -- a $1.00 -- -- 2017/03/30 --- ; generated-transaction:~ every 30th day of month from 2017/1 to 2017/5 +-- ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5 -- a $1.00 -- -- 2017/04/30 --- ; generated-transaction:~ every 30th day of month from 2017/1 to 2017/5 +-- ; generated-transaction: ~ every 30th day of month from 2017/1 to 2017/5 -- a $1.00 -- -- -- >>> _ptgen "every 2nd Thursday of month from 2017/1 to 2017/4" -- 2016/12/08 --- ; generated-transaction:~ every 2nd Thursday of month from 2017/1 to 2017/4 +-- ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4 -- a $1.00 -- -- 2017/01/12 --- ; generated-transaction:~ every 2nd Thursday of month from 2017/1 to 2017/4 +-- ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4 -- a $1.00 -- -- 2017/02/09 --- ; generated-transaction:~ every 2nd Thursday of month from 2017/1 to 2017/4 +-- ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4 -- a $1.00 -- -- 2017/03/09 --- ; generated-transaction:~ every 2nd Thursday of month from 2017/1 to 2017/4 +-- ; generated-transaction: ~ every 2nd Thursday of month from 2017/1 to 2017/4 -- a $1.00 -- -- -- >>> _ptgen "every nov 29th from 2017 to 2019" -- 2016/11/29 --- ; generated-transaction:~ every nov 29th from 2017 to 2019 +-- ; generated-transaction: ~ every nov 29th from 2017 to 2019 -- a $1.00 -- -- 2017/11/29 --- ; generated-transaction:~ every nov 29th from 2017 to 2019 +-- ; generated-transaction: ~ every nov 29th from 2017 to 2019 -- a $1.00 -- -- 2018/11/29 --- ; generated-transaction:~ every nov 29th from 2017 to 2019 +-- ; generated-transaction: ~ every nov 29th from 2017 to 2019 -- a $1.00 -- -- -- >>> _ptgen "2017/1" -- 2017/01/01 --- ; generated-transaction:~ 2017/1 +-- ; generated-transaction: ~ 2017/1 -- a $1.00 -- -- @@ -214,21 +214,21 @@ instance Show PeriodicTransaction where -- -- >>> _ptgenspan "every 3 months from 2019-05" (mkdatespan "2020-02-01" "2020-03-01") -- 2020/02/01 --- ; generated-transaction:~ every 3 months from 2019-05 +-- ; generated-transaction: ~ every 3 months from 2019-05 -- a $1.00 -- -- >>> _ptgenspan "every 3 days from 2018" (mkdatespan "2018-01-01" "2018-01-05") -- 2018/01/01 --- ; generated-transaction:~ every 3 days from 2018 +-- ; generated-transaction: ~ every 3 days from 2018 -- a $1.00 -- -- 2018/01/04 --- ; generated-transaction:~ every 3 days from 2018 +-- ; generated-transaction: ~ every 3 days from 2018 -- a $1.00 -- -- >>> _ptgenspan "every 3 days from 2018" (mkdatespan "2018-01-02" "2018-01-05") -- 2018/01/04 --- ; generated-transaction:~ every 3 days from 2018 +-- ; generated-transaction: ~ every 3 days from 2018 -- a $1.00 -- diff --git a/hledger-lib/Hledger/Data/Posting.hs b/hledger-lib/Hledger/Data/Posting.hs index 6a2fda36c..7679bd7de 100644 --- a/hledger-lib/Hledger/Data/Posting.hs +++ b/hledger-lib/Hledger/Data/Posting.hs @@ -372,18 +372,20 @@ commentJoin c1 c2 | otherwise = c1 <> ", " <> c2 -- | Add a tag to a comment, comma-separated from any prior content. +-- A space is inserted following the colon, before the value. commentAddTag :: Text -> Tag -> Text commentAddTag c (t,v) | T.null c' = tag | otherwise = c' `commentJoin` tag where c' = textchomp c - tag = t <> ":" <> v + tag = t <> ": " <> v -- | Add a tag on its own line to a comment, preserving any prior content. +-- A space is inserted following the colon, before the value. commentAddTagNextLine :: Text -> Tag -> Text commentAddTagNextLine cmt (t,v) = - cmt <> if "\n" `T.isSuffixOf` cmt then "" else "\n" <> t <> ":" <> v + cmt <> if "\n" `T.isSuffixOf` cmt then "" else "\n" <> t <> ": " <> v -- tests @@ -417,13 +419,13 @@ tests_Posting = tests "Posting" [ ] ,tests "commentAddTag" [ - commentAddTag "" ("a","") `is` "a:" - ,commentAddTag "[1/2]" ("a","") `is` "[1/2], a:" + commentAddTag "" ("a","") `is` "a: " + ,commentAddTag "[1/2]" ("a","") `is` "[1/2], a: " ] ,tests "commentAddTagNextLine" [ - commentAddTagNextLine "" ("a","") `is` "\na:" - ,commentAddTagNextLine "[1/2]" ("a","") `is` "[1/2]\na:" + commentAddTagNextLine "" ("a","") `is` "\na: " + ,commentAddTagNextLine "[1/2]" ("a","") `is` "[1/2]\na: " ] ] diff --git a/hledger-lib/Hledger/Data/TransactionModifier.hs b/hledger-lib/Hledger/Data/TransactionModifier.hs index 99fb64f4d..9b5d1a0af 100644 --- a/hledger-lib/Hledger/Data/TransactionModifier.hs +++ b/hledger-lib/Hledger/Data/TransactionModifier.hs @@ -57,7 +57,7 @@ modifyTransactions tmods = map applymods -- >>> putStr $ showTransaction $ transactionModifierToFunction (TransactionModifier "" ["pong" `post` usd 2]) nulltransaction{tpostings=["ping" `post` usd 1]} -- 0000/01/01 -- ping $1.00 --- pong $2.00 ; generated-posting:= +-- pong $2.00 ; generated-posting: = -- -- >>> putStr $ showTransaction $ transactionModifierToFunction (TransactionModifier "miss" ["pong" `post` usd 2]) nulltransaction{tpostings=["ping" `post` usd 1]} -- 0000/01/01 @@ -66,7 +66,7 @@ modifyTransactions tmods = map applymods -- >>> putStr $ showTransaction $ transactionModifierToFunction (TransactionModifier "ping" ["pong" `post` amount{aismultiplier=True, aquantity=3}]) nulltransaction{tpostings=["ping" `post` usd 2]} -- 0000/01/01 -- ping $2.00 --- pong $6.00 ; generated-posting:= ping +-- pong $6.00 ; generated-posting: = ping -- -- transactionModifierToFunction :: TransactionModifier -> (Transaction -> Transaction) diff --git a/tests/forecast.test b/tests/forecast.test index bebd43f80..608c59b35 100644 --- a/tests/forecast.test +++ b/tests/forecast.test @@ -51,7 +51,7 @@ hledger print -b 2016-11 -e 2017-02 -f - --forecast assets:cash 2017/01/01 * marked cleared, and with a description - ; generated-transaction:~ monthly from 2016/1 + ; generated-transaction: ~ monthly from 2016/1 income $-1000 expenses:food $20 expenses:leisure $15 @@ -118,7 +118,7 @@ Y 2000 >>> 2000/02/01 forecast - ; generated-transaction:~ 2/1 + ; generated-transaction: ~ 2/1 >>>2 >>>=0 @@ -135,7 +135,7 @@ Y 2000 >>> 2000/01/15 forecast - ; generated-transaction:~ 15 + ; generated-transaction: ~ 15 >>>2 >>>=0 @@ -152,7 +152,7 @@ Y 2000 >>> 2000/02/01 forecast - ; generated-transaction:~ next month + ; generated-transaction: ~ next month >>>2 >>>=0 diff --git a/tests/journal/auto-postings.test b/tests/journal/auto-postings.test index 227a6dba8..9dd99eeaf 100644 --- a/tests/journal/auto-postings.test +++ b/tests/journal/auto-postings.test @@ -17,9 +17,9 @@ $ hledger print -f- --auto 2016/01/01 paycheck ; modified: income:remuneration $-100 - (liabilities:tax) $-33 ; income tax, generated-posting:= ^income + (liabilities:tax) $-33 ; income tax, generated-posting: = ^income income:donations $-15 - (liabilities:tax) $-5 ; income tax, generated-posting:= ^income + (liabilities:tax) $-5 ; income tax, generated-posting: = ^income assets:bank 2016/01/01 withdraw @@ -82,8 +82,8 @@ $ hledger register -f- --auto $ hledger print -f- --auto 2018/10/07 * MARKET ; modified: expenses:groceries:food - [budget:groceries] $-20 ; generated-posting:= ^expenses:groceries - [assets:bank:checking] $20 ; generated-posting:= ^expenses:groceries + [budget:groceries] $-20 ; generated-posting: = ^expenses:groceries + [assets:bank:checking] $20 ; generated-posting: = ^expenses:groceries assets:bank:checking $-20 >= @@ -101,8 +101,8 @@ $ hledger print -f- --auto $ hledger -f- print --auto -x 2018/01/01 ; modified: (assets:billable:client1) 0.50h @ $90 - assets:receivable:client1 50.00h @ $90 ; generated-posting:= assets:billable:client1 - revenues:client1 $-4500 ; generated-posting:= assets:billable:client1 + assets:receivable:client1 50.00h @ $90 ; generated-posting: = assets:billable:client1 + revenues:client1 $-4500 ; generated-posting: = assets:billable:client1 >= @@ -119,8 +119,8 @@ $ hledger -f- print --auto -x $ hledger -f- print --auto -x 2018/01/01 ; modified: (assets:billable:client1) 0.50h - assets:receivable:client1 $50 ; generated-posting:= assets:billable:client1 - revenues:client1 $-50 ; generated-posting:= assets:billable:client1 + assets:receivable:client1 $50 ; generated-posting: = assets:billable:client1 + revenues:client1 $-50 ; generated-posting: = assets:billable:client1 >= @@ -137,8 +137,8 @@ $ hledger -f- print --auto -x $ hledger -f- print --auto -x 2018/01/01 ; modified: (assets:billable:client1) 0.50h @ $90 - assets:receivable:client1 0.50 "Client1 Hours" @ $100.00 ; generated-posting:= assets:billable:client1 - revenues:client1 $-50.00 ; generated-posting:= assets:billable:client1 + assets:receivable:client1 0.50 "Client1 Hours" @ $100.00 ; generated-posting: = assets:billable:client1 + revenues:client1 $-50.00 ; generated-posting: = assets:billable:client1 >= @@ -182,9 +182,9 @@ $ hledger print -f- --auto $ hledger -f- print --auto 2018/01/01 ; modified: Expenses:Joint:Widgets $100.00 @ £0.50 - Expenses:Joint $-100.00 @ £0.50 ; generated-posting:= ^Expenses:Joint - Liabilities:Joint:Bob $50.00 @ £0.50 ; generated-posting:= ^Expenses:Joint - Liabilities:Joint:Bill $50.00 @ £0.50 ; generated-posting:= ^Expenses:Joint + Expenses:Joint $-100.00 @ £0.50 ; generated-posting: = ^Expenses:Joint + Liabilities:Joint:Bob $50.00 @ £0.50 ; generated-posting: = ^Expenses:Joint + Liabilities:Joint:Bill $50.00 @ £0.50 ; generated-posting: = ^Expenses:Joint Assets:Joint:Bank £-50.00 >=0 @@ -204,9 +204,9 @@ $ hledger -f- print --auto $ hledger -f- print --auto 2018/01/01 ; modified: Expenses:Joint:Widgets $100.00 @@ £50 - Expenses:Joint $-100.00 @@ £50 ; generated-posting:= ^Expenses:Joint - Liabilities:Joint:Bob $50.00 @@ £25 ; generated-posting:= ^Expenses:Joint - Liabilities:Joint:Bill $50.00 @@ £25 ; generated-posting:= ^Expenses:Joint + Expenses:Joint $-100.00 @@ £50 ; generated-posting: = ^Expenses:Joint + Liabilities:Joint:Bob $50.00 @@ £25 ; generated-posting: = ^Expenses:Joint + Liabilities:Joint:Bill $50.00 @@ £25 ; generated-posting: = ^Expenses:Joint Assets:Joint:Bank £-50.00 >=0 @@ -233,9 +233,9 @@ $ hledger -f- print --auto $ hledger -f- print --auto 2018/01/01 ; modified: Expenses:Joint:Widgets $100.00 - Expenses:Joint $-100.00 @@ £50 ; generated-posting:= ^Expenses:Joint - Liabilities:Joint:Bob $50.00 @@ £25 ; generated-posting:= ^Expenses:Joint - Liabilities:Joint:Bill $50.00 @@ £25 ; generated-posting:= ^Expenses:Joint + Expenses:Joint $-100.00 @@ £50 ; generated-posting: = ^Expenses:Joint + Liabilities:Joint:Bob $50.00 @@ £25 ; generated-posting: = ^Expenses:Joint + Liabilities:Joint:Bill $50.00 @@ £25 ; generated-posting: = ^Expenses:Joint Assets:Joint:Bank £-50.00 >=0 @@ -264,11 +264,11 @@ $ hledger print -f- --auto --forecast -b 2016-01 -e 2016-03 assets:bank 2016/02/01 paycheck - ; generated-transaction:~ monthly from 2016-01, modified: + ; generated-transaction: ~ monthly from 2016-01, modified: income:remuneration $-100 - (liabilities:tax) $-33 ; income tax, generated-posting:= ^income + (liabilities:tax) $-33 ; income tax, generated-posting: = ^income income:donations $-15 - (liabilities:tax) $-5 ; income tax, generated-posting:= ^income + (liabilities:tax) $-5 ; income tax, generated-posting: = ^income assets:bank >= @@ -280,7 +280,7 @@ $ hledger print -f- --forecast -b 2016-01 -e 2016-03 assets:bank 2016/02/01 paycheck - ; generated-transaction:~ monthly from 2016-01 + ; generated-transaction: ~ monthly from 2016-01 income:remuneration $-100 income:donations $-15 assets:bank diff --git a/tests/journal/default-commodity.test b/tests/journal/default-commodity.test index c1ebec1ee..4a75b394e 100644 --- a/tests/journal/default-commodity.test +++ b/tests/journal/default-commodity.test @@ -87,7 +87,7 @@ D $1000. >>> 2018/01/01 ; modified: (a) €1 - (b) €2 ; generated-posting:= a + (b) €2 ; generated-posting: = a >>>= diff --git a/tests/rewrite.test b/tests/rewrite.test index 50036da9e..93e058fb5 100644 --- a/tests/rewrite.test +++ b/tests/rewrite.test @@ -12,9 +12,9 @@ hledger rewrite -f- ^income --add-posting '(liabilities:tax) *.33 ; income tax >>> 2016/01/01 paycheck ; modified: income:remuneration $-100 - (liabilities:tax) $-33 ; income tax, generated-posting:= ^income + (liabilities:tax) $-33 ; income tax, generated-posting: = ^income income:donations $-15 - (liabilities:tax) $-5 ; income tax, generated-posting:= ^income + (liabilities:tax) $-5 ; income tax, generated-posting: = ^income assets:bank 2016/01/01 withdraw @@ -43,7 +43,7 @@ hledger rewrite -f- expenses:gifts --add-posting '(budget:gifts) *-1' 2016/01/01 gift ; modified: assets:cash $-15 expenses:gifts ; [1/2] - (budget:gifts) $-15 ; [2016/01/02], generated-posting:= expenses:gifts + (budget:gifts) $-15 ; [2016/01/02], generated-posting: = expenses:gifts >>>2 >>>=0 @@ -69,15 +69,15 @@ hledger rewrite -f- >>> 2017/04/24 * 09:00-09:25 ; modified: (assets:unbilled:client1) 0.42h - (assets:to bill:client1) 42.00 CAD ; generated-posting:= ^assets:unbilled:client1 + (assets:to bill:client1) 42.00 CAD ; generated-posting: = ^assets:unbilled:client1 2017/04/25 * 10:00-11:15 ; modified: (assets:unbilled:client1) 1.25h - (assets:to bill:client1) 125.00 CAD ; generated-posting:= ^assets:unbilled:client1 + (assets:to bill:client1) 125.00 CAD ; generated-posting: = ^assets:unbilled:client1 2017/04/25 * 14:00-15:32 ; modified: (assets:unbilled:client2) 1.54h - (assets:to bill:client2) 231.00 CAD ; generated-posting:= ^assets:unbilled:client2 + (assets:to bill:client2) 231.00 CAD ; generated-posting: = ^assets:unbilled:client2 >>>2 >>>=0 @@ -106,18 +106,18 @@ hledger rewrite -f- -B >>> 2017/04/24 * 09:00-09:25 ; modified: (assets:unbilled:client1) 0.42h - assets:to bill:client1 $42.00 ; generated-posting:= ^assets:unbilled:client1 - income:consulting:client1 ; generated-posting:= ^assets:unbilled:client1 + assets:to bill:client1 $42.00 ; generated-posting: = ^assets:unbilled:client1 + income:consulting:client1 ; generated-posting: = ^assets:unbilled:client1 2017/04/25 * 10:00-11:15 ; modified: (assets:unbilled:client1) 1.25h - assets:to bill:client1 $125.00 ; generated-posting:= ^assets:unbilled:client1 - income:consulting:client1 ; generated-posting:= ^assets:unbilled:client1 + assets:to bill:client1 $125.00 ; generated-posting: = ^assets:unbilled:client1 + income:consulting:client1 ; generated-posting: = ^assets:unbilled:client1 2017/04/25 * 14:00-15:32 ; modified: (assets:unbilled:client2) 1.54h - assets:to bill:client2 $231.00 ; generated-posting:= ^assets:unbilled:client2 - income:consulting:client2 ; generated-posting:= ^assets:unbilled:client2 + assets:to bill:client2 $231.00 ; generated-posting: = ^assets:unbilled:client2 + income:consulting:client2 ; generated-posting: = ^assets:unbilled:client2 >>>2 >>>=0 @@ -142,14 +142,14 @@ hledger rewrite -f- assets:bank and 'amt:<0' --add-posting 'expenses:fee $5' - 2016/01/01 withdraw ; modified: assets:cash $20 assets:bank - expenses:fee $5 ; generated-posting:= assets:bank and amt:<0 - assets:bank $-5 ; generated-posting:= assets:bank and amt:<0 + expenses:fee $5 ; generated-posting: = assets:bank and amt:<0 + assets:bank $-5 ; generated-posting: = assets:bank and amt:<0 2016/01/02 withdraw ; modified: assets:cash assets:bank $-30 - expenses:fee $5 ; generated-posting:= assets:bank and amt:<0 - assets:bank $-5 ; generated-posting:= assets:bank and amt:<0 + expenses:fee $5 ; generated-posting: = assets:bank and amt:<0 + assets:bank $-5 ; generated-posting: = assets:bank and amt:<0 >>>2 >>>=0 @@ -190,30 +190,30 @@ hledger rewrite -f- date:2017/1 --add-posting 'Here comes Santa $0' >>> 2016/12/31 ; modified: expenses:housing $600.00 - (budget:housing) $-600.00 ; generated-posting:= ^expenses:housing + (budget:housing) $-600.00 ; generated-posting: = ^expenses:housing assets:cash 2017/01/01 ; modified: expenses:food $20.00 - (budget:food) $-20.00 ; generated-posting:= ^expenses:grocery ^expenses:food - Here comes Santa 0 ; generated-posting:= date:2017/1 + (budget:food) $-20.00 ; generated-posting: = ^expenses:grocery ^expenses:food + Here comes Santa 0 ; generated-posting: = date:2017/1 expenses:leisure $15.00 - (budget:misc) $-15.00 ; generated-posting:= ^expenses not:housing not:grocery not:food - Here comes Santa 0 ; generated-posting:= date:2017/1 + (budget:misc) $-15.00 ; generated-posting: = ^expenses not:housing not:grocery not:food + Here comes Santa 0 ; generated-posting: = date:2017/1 expenses:grocery $30.00 - (budget:food) $-30.00 ; generated-posting:= ^expenses:grocery ^expenses:food - Here comes Santa 0 ; generated-posting:= date:2017/1 + (budget:food) $-30.00 ; generated-posting: = ^expenses:grocery ^expenses:food + Here comes Santa 0 ; generated-posting: = date:2017/1 assets:cash - Here comes Santa 0 ; generated-posting:= date:2017/1 + Here comes Santa 0 ; generated-posting: = date:2017/1 2017/01/02 ; modified: assets:cash $200.00 - Here comes Santa 0 ; generated-posting:= date:2017/1 + Here comes Santa 0 ; generated-posting: = date:2017/1 assets:bank - assets:bank $-1.60 ; generated-posting:= ^assets:bank$ date:2017/1 amt:<0 - expenses:fee $1.60 ; cash withdraw fee, generated-posting:= ^assets:bank$ date:2017/1 amt:<0 - (budget:misc) $-1.60 ; generated-posting:= ^expenses not:housing not:grocery not:food - Here comes Santa 0 ; generated-posting:= date:2017/1 + assets:bank $-1.60 ; generated-posting: = ^assets:bank$ date:2017/1 amt:<0 + expenses:fee $1.60 ; cash withdraw fee, generated-posting: = ^assets:bank$ date:2017/1 amt:<0 + (budget:misc) $-1.60 ; generated-posting: = ^expenses not:housing not:grocery not:food + Here comes Santa 0 ; generated-posting: = date:2017/1 2017/02/01 assets:cash $100.00 @@ -240,14 +240,14 @@ hledger rewrite --diff -f- assets:bank and 'amt:<0' --add-posting 'expenses:fee +2016/01/01 withdraw ; modified: assets:cash $20 assets:bank -+ expenses:fee $5 ; generated-posting:= assets:bank and amt:<0 -+ assets:bank $-5 ; generated-posting:= assets:bank and amt:<0 ++ expenses:fee $5 ; generated-posting: = assets:bank and amt:<0 ++ assets:bank $-5 ; generated-posting: = assets:bank and amt:<0 @@ -5,3 +7,5 @@ -2016/01/02 withdraw +2016/01/02 withdraw ; modified: assets:cash assets:bank $-30 -+ expenses:fee $5 ; generated-posting:= assets:bank and amt:<0 -+ assets:bank $-5 ; generated-posting:= assets:bank and amt:<0 ++ expenses:fee $5 ; generated-posting: = assets:bank and amt:<0 ++ assets:bank $-5 ; generated-posting: = assets:bank and amt:<0 >>>2 >>>=0