journal: improve unassignable error.

This commit is contained in:
Jesse Rosenthal 2018-10-18 16:02:06 -04:00 committed by Simon Michael
parent 07d0a003a3
commit 11a5809c5c

View File

@ -705,7 +705,13 @@ checkUnassignablePosting :: Posting -> CurrentBalancesModifier s ()
checkUnassignablePosting p = do
unassignable <- R.asks eUnassignable
if (isAssignment p && paccount p `S.member` unassignable)
then throwError $ "Can't assign to account: " ++ (T.unpack $ paccount p)
then throwError $ unlines $
[ "cannot assign amount to account "
, ""
, " " ++ (T.unpack $ paccount p)
, ""
, "because it is also included in transaction modifiers."
]
else return ()