From 07d0a003a3e165b4a321fbf390c4947612851322 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Thu, 18 Oct 2018 15:26:13 -0400 Subject: [PATCH] journal: fill unassignable list from account names. --- hledger-lib/Hledger/Data/Journal.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Data/Journal.hs b/hledger-lib/Hledger/Data/Journal.hs index 3b64c4343..f31c9a02a 100644 --- a/hledger-lib/Hledger/Data/Journal.hs +++ b/hledger-lib/Hledger/Data/Journal.hs @@ -642,7 +642,7 @@ journalBalanceTransactionsST assrt j createStore storeIn extract = (storeIn txStore) assrt (Just $ journalCommodityStyles j) - S.empty + (getModifierAccountNames j) flip R.runReaderT env $ do dated <- fmap snd . sortBy (comparing fst) . concat <$> mapM' discriminateByDate (jtxns j) @@ -651,6 +651,14 @@ journalBalanceTransactionsST assrt j createStore storeIn extract = where size = genericLength $ journalPostings j + +-- | Collect account names in account modifiers into a set +getModifierAccountNames :: Journal -> S.Set AccountName +getModifierAccountNames j = S.fromList $ + map paccount $ + concatMap tmpostingrules $ + jtxnmodifiers j + -- | Monad transformer stack with a reference to a mutable hashtable -- of current account balances and a mutable array of finished -- transactions in original parsing order.