diff --git a/hledger-web/Foundation.hs b/hledger-web/Foundation.hs index 6e31774cd..a77df3c6c 100644 --- a/hledger-web/Foundation.hs +++ b/hledger-web/Foundation.hs @@ -364,7 +364,7 @@ addform _ vd@VD{..} = [hamlet| defdate = "" :: String -- #322 don't set a default, typeahead(?) clears it on tab. See also hledger.js dates = ["today","yesterday","tomorrow"] :: [String] descriptions = sort $ nub $ map tdescription $ jtxns j - accts = sort $ journalAccountNamesUsed j + accts = journalAccountNamesDeclaredOrImplied j escapeJSSpecialChars = regexReplaceCI "" "<\\/script>" -- #236 listToJsonValueObjArrayStr as = preEscapedString $ escapeJSSpecialChars $ encode $ JSArray $ map (\a -> JSObject $ toJSObject [("value", showJSON a)]) as numpostings = 4 diff --git a/hledger/Hledger/Cli/Commands/Add.hs b/hledger/Hledger/Cli/Commands/Add.hs index 8896753c6..bfb406f2b 100644 --- a/hledger/Hledger/Cli/Commands/Add.hs +++ b/hledger/Hledger/Cli/Commands/Add.hs @@ -262,7 +262,7 @@ accountWizard EntryState{..} = do flip evalState esJournal $ runParserT (accountnamep <* eof) "" (T.pack s) -- otherwise, try to parse the input as an accountname where validateAccount :: Text -> Maybe Text - validateAccount t | no_new_accounts_ esOpts && not (t `elem` journalAccountNames esJournal) = Nothing + validateAccount t | no_new_accounts_ esOpts && not (t `elem` journalAccountNamesDeclaredOrImplied esJournal) = Nothing | otherwise = Just t dbg1 = id -- strace @@ -337,7 +337,7 @@ descriptionCompleter :: Journal -> String -> CompletionFunc IO descriptionCompleter j = completer (map T.unpack $ journalDescriptions j) accountCompleter :: Journal -> String -> CompletionFunc IO -accountCompleter j = completer (map T.unpack $ journalAccountNamesUsed j) +accountCompleter j = completer (map T.unpack $ journalAccountNamesDeclaredOrImplied j) amountCompleter :: String -> CompletionFunc IO amountCompleter = completer []