From 6c57629b8c3bbb5446d324e2b2f32fbe5eecc275 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 9 Oct 2018 16:08:47 -0700 Subject: [PATCH] lib: fix posting-date-and-balance-assignment error properly (#894) --- hledger-lib/Hledger/Data/Journal.hs | 4 ++-- tests/journal/balance-assertions.test | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hledger-lib/Hledger/Data/Journal.hs b/hledger-lib/Hledger/Data/Journal.hs index 61238ecbc..65eb23f2a 100644 --- a/hledger-lib/Hledger/Data/Journal.hs +++ b/hledger-lib/Hledger/Data/Journal.hs @@ -636,8 +636,8 @@ discriminateByDate tx | True = do when (any (isJust . pdate) $ tpostings tx) $ throwError $ unlines $ - ["Sorry, a dated posting with a balance assignment and no explicit amount is not" - ,"allowed. Write the amount, or remove the posting date or balance assignment:\n" + ["postings may not have both a custom date and a balance assignment." + ,"Write the posting amount explicitly, or remove the posting date:\n" , showTransaction tx] return [(tdate tx, Right $ tx { tpostings = removePrices <$> tpostings tx })] diff --git a/tests/journal/balance-assertions.test b/tests/journal/balance-assertions.test index 0570ab983..cffefdbdd 100755 --- a/tests/journal/balance-assertions.test +++ b/tests/journal/balance-assertions.test @@ -222,17 +222,17 @@ hledger -f - stats >>> /Transactions/ >>>2 >>>=0 -# 12. Having both assignements and posting dates is not supported. +# 12. Having both assignments and posting dates is not supported. hledger -f - stats <<< 2013/1/1 a $1 =$1 b =$-1 ; date:2012/1/1 ->>>2 /Not supported/ +>>>2 /postings may not have both a custom date and a balance assignment/ >>>=1 -# 13. Having both assignements and posting dates is not supported. +# 13. Having both assignments and posting dates is not supported. hledger -f - stats <<< @@ -246,7 +246,7 @@ hledger -f - stats d = 3 ->>>2 /Not supported/ +>>>2 /postings may not have both a custom date and a balance assignment/ >>>=1 # 14. Posting Date