mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-27 12:24:43 +03:00
lib: fix posting-date-and-balance-assignment error properly (#894)
This commit is contained in:
parent
8c7c59017a
commit
6c57629b8c
@ -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 })]
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user