hledger 1.9.1 → 1.10
raw patch · 36 files changed
+2420/−1591 lines, 36 filesdep +base-compat-batteriesdep −base-compatdep ~hledger-libdep ~megaparsecPVP ok
version bump matches the API change (PVP)
Dependencies added: base-compat-batteries
Dependencies removed: base-compat
Dependency ranges changed: hledger-lib, megaparsec
API changes (from Hackage documentation)
+ Hledger.Cli: Arg :: Update a -> FlagHelp -> Bool -> Arg a
+ Hledger.Cli: CompleteDir :: String -> FilePath -> Complete
+ Hledger.Cli: CompleteFile :: String -> FilePath -> Complete
+ Hledger.Cli: CompleteValue :: String -> Complete
+ Hledger.Cli: Flag :: [Name] -> FlagInfo -> Update a -> FlagHelp -> Help -> Flag a
+ Hledger.Cli: FlagNone :: FlagInfo
+ Hledger.Cli: FlagOpt :: String -> FlagInfo
+ Hledger.Cli: FlagOptRare :: String -> FlagInfo
+ Hledger.Cli: FlagReq :: FlagInfo
+ Hledger.Cli: Group :: [a] -> [a] -> [(Help, [a])] -> Group a
+ Hledger.Cli: HelpFormatAll :: HelpFormat
+ Hledger.Cli: HelpFormatBash :: HelpFormat
+ Hledger.Cli: HelpFormatDefault :: HelpFormat
+ Hledger.Cli: HelpFormatOne :: HelpFormat
+ Hledger.Cli: HelpFormatZsh :: HelpFormat
+ Hledger.Cli: Mode :: Group Mode a -> [Name] -> a -> a -> Either String a -> a -> Maybe [String] -> Bool -> Help -> [String] -> ([Arg a], Maybe Arg a) -> Group Flag a -> Mode a
+ Hledger.Cli: [argRequire] :: Arg a -> Bool
+ Hledger.Cli: [argType] :: Arg a -> FlagHelp
+ Hledger.Cli: [argValue] :: Arg a -> Update a
+ Hledger.Cli: [flagHelp] :: Flag a -> Help
+ Hledger.Cli: [flagInfo] :: Flag a -> FlagInfo
+ Hledger.Cli: [flagNames] :: Flag a -> [Name]
+ Hledger.Cli: [flagType] :: Flag a -> FlagHelp
+ Hledger.Cli: [flagValue] :: Flag a -> Update a
+ Hledger.Cli: [groupHidden] :: Group a -> [a]
+ Hledger.Cli: [groupNamed] :: Group a -> [(Help, [a])]
+ Hledger.Cli: [groupUnnamed] :: Group a -> [a]
+ Hledger.Cli: [modeArgs] :: Mode a -> ([Arg a], Maybe Arg a)
+ Hledger.Cli: [modeCheck] :: Mode a -> a -> Either String a
+ Hledger.Cli: [modeExpandAt] :: Mode a -> Bool
+ Hledger.Cli: [modeGroupFlags] :: Mode a -> Group Flag a
+ Hledger.Cli: [modeGroupModes] :: Mode a -> Group Mode a
+ Hledger.Cli: [modeHelpSuffix] :: Mode a -> [String]
+ Hledger.Cli: [modeHelp] :: Mode a -> Help
+ Hledger.Cli: [modeNames] :: Mode a -> [Name]
+ Hledger.Cli: [modeReform] :: Mode a -> a -> Maybe [String]
+ Hledger.Cli: [modeValue] :: Mode a -> a
+ Hledger.Cli: checkMode :: () => Mode a -> Maybe String
+ Hledger.Cli: class Remap (m :: * -> *)
+ Hledger.Cli: complete :: () => Mode a -> [String] -> (Int, Int) -> [Complete]
+ Hledger.Cli: data Arg a
+ Hledger.Cli: data Complete
+ Hledger.Cli: data Flag a
+ Hledger.Cli: data FlagInfo
+ Hledger.Cli: data Group a
+ Hledger.Cli: data HelpFormat
+ Hledger.Cli: data Mode a
+ Hledger.Cli: expandArgsAt :: [String] -> IO [String]
+ Hledger.Cli: flagArg :: () => Update a -> FlagHelp -> Arg a
+ Hledger.Cli: flagBool :: () => [Name] -> Bool -> a -> a -> Help -> Flag a
+ Hledger.Cli: flagHelpFormat :: () => HelpFormat -> TextFormat -> a -> a -> Flag a
+ Hledger.Cli: flagHelpSimple :: () => a -> a -> Flag a
+ Hledger.Cli: flagNone :: () => [Name] -> a -> a -> Help -> Flag a
+ Hledger.Cli: flagNumericVersion :: () => a -> a -> Flag a
+ Hledger.Cli: flagOpt :: () => String -> [Name] -> Update a -> FlagHelp -> Help -> Flag a
+ Hledger.Cli: flagReq :: () => [Name] -> Update a -> FlagHelp -> Help -> Flag a
+ Hledger.Cli: flagVersion :: () => a -> a -> Flag a
+ Hledger.Cli: flagsVerbosity :: () => Verbosity -> a -> a -> [Flag a]
+ Hledger.Cli: fromFlagOpt :: FlagInfo -> String
+ Hledger.Cli: fromGroup :: () => Group a -> [a]
+ Hledger.Cli: helpText :: () => [String] -> HelpFormat -> Mode a -> [Text]
+ Hledger.Cli: joinArgs :: [String] -> String
+ Hledger.Cli: mode :: () => Name -> a -> Help -> Arg a -> [Flag a] -> Mode a
+ Hledger.Cli: modeEmpty :: () => a -> Mode a
+ Hledger.Cli: modeFlags :: () => Mode a -> [Flag a]
+ Hledger.Cli: modeModes :: () => Mode a -> [Mode a]
+ Hledger.Cli: modes :: () => String -> a -> Help -> [Mode a] -> Mode a
+ Hledger.Cli: parseBool :: String -> Maybe Bool
+ Hledger.Cli: process :: () => Mode a -> [String] -> Either String a
+ Hledger.Cli: processArgs :: () => Mode a -> IO a
+ Hledger.Cli: processValue :: () => Mode a -> [String] -> a
+ Hledger.Cli: processValueIO :: () => Mode a -> [String] -> IO a
+ Hledger.Cli: remap :: Remap m => a -> b -> b -> (a, a -> b) -> m a -> m b
+ Hledger.Cli: remap2 :: Remap m => a -> b -> b -> a -> m a -> m b
+ Hledger.Cli: remapUpdate :: () => a -> b -> b -> (a, a -> b) -> Update a -> Update b
+ Hledger.Cli: splitArgs :: String -> [String]
+ Hledger.Cli: toGroup :: () => [a] -> Group a
+ Hledger.Cli: type FlagHelp = String
+ Hledger.Cli: type Help = String
+ Hledger.Cli: type Update a = String -> a -> Either String a
+ Hledger.Cli.Utils: journalTransform :: CliOpts -> Journal -> IO Journal
- Hledger.Cli.Commands.Activity: printDayWith :: (PrintfType t2, PrintfArg t1) => (t3 -> t1) -> (DateSpan, t3) -> t2
+ Hledger.Cli.Commands.Activity: printDayWith :: (PrintfArg t1, PrintfType t2) => t3 -> t1 -> (DateSpan, t3) -> t2
- Hledger.Cli.CompoundBalanceCommand: CBCSubreportSpec :: String -> (Journal -> Query) -> NormalSign -> Bool -> CBCSubreportSpec
+ Hledger.Cli.CompoundBalanceCommand: CBCSubreportSpec :: String -> Journal -> Query -> NormalSign -> Bool -> CBCSubreportSpec
- Hledger.Cli.Utils: data Test :: *
+ Hledger.Cli.Utils: data Test
Files
- CHANGES +73/−4
- Hledger/Cli/CliOptions.hs +10/−11
- Hledger/Cli/Commands/Add.hs +6/−5
- Hledger/Cli/Commands/Help.hs +2/−1
- Hledger/Cli/Commands/Register.hs +3/−2
- Hledger/Cli/Commands/Rewrite.hs +2/−4
- Hledger/Cli/DocFiles.hs +2/−2
- Hledger/Cli/Utils.hs +54/−30
- embeddedfiles/hledger-api.1 +1/−1
- embeddedfiles/hledger-api.info +4/−4
- embeddedfiles/hledger-api.txt +1/−1
- embeddedfiles/hledger-ui.1 +1/−1
- embeddedfiles/hledger-ui.info +16/−16
- embeddedfiles/hledger-ui.txt +1/−1
- embeddedfiles/hledger-web.1 +1/−1
- embeddedfiles/hledger-web.info +4/−4
- embeddedfiles/hledger-web.txt +1/−1
- embeddedfiles/hledger.1 +66/−25
- embeddedfiles/hledger.info +166/−151
- embeddedfiles/hledger.txt +371/−345
- embeddedfiles/hledger_csv.5 +1/−1
- embeddedfiles/hledger_csv.info +30/−30
- embeddedfiles/hledger_csv.txt +1/−1
- embeddedfiles/hledger_journal.5 +329/−89
- embeddedfiles/hledger_journal.info +353/−199
- embeddedfiles/hledger_journal.txt +266/−114
- embeddedfiles/hledger_timeclock.5 +1/−1
- embeddedfiles/hledger_timeclock.info +2/−2
- embeddedfiles/hledger_timeclock.txt +1/−1
- embeddedfiles/hledger_timedot.5 +1/−1
- embeddedfiles/hledger_timedot.info +4/−4
- embeddedfiles/hledger_timedot.txt +1/−1
- hledger.1 +66/−25
- hledger.cabal +42/−16
- hledger.info +166/−151
- hledger.txt +371/−345
CHANGES view
@@ -1,15 +1,81 @@ User-visible changes in the hledger command line tool. +# 1.10 (2018/6/30)++* journal: many parse error messages have become more informative, and+ some now show the source line and error location.++* journal: ;tag: is no longer parsed as a tag named ";tag" (#655)++* journal: transaction price amounts having their own price amounts is+ now a parse error++* journal: amounts with space as digit group separator and trailing whitespace + now parse correctly (#780)++* journal: in amounts containing digits and a single space, the space+ is now interpreted as a digit group separator, not a decimal separator (#749)++* journal: in commodity/format/D directives, the amount must now include a decimal separator.++ When more precise control is needed over number parsing, our+ recommended solution is commodity directives. Commodity directives+ that don't specify the decimal separator leave things ambiguous,+ increasing the chance of misparsing numbers. In some cases it could+ cause amounts with a decimal point to be parsed as if with a digit+ group separator, so 1.234 became 1234.++ It seems the simple and really only way to do this reliably is to require+ an explicit decimal point character. Most folks probably do this already.+ Unfortunately, it makes another potential incompatiblity with ledger and+ beancount journals. But the error message will be clear and easy to+ work around.++* journal: directives currently have diverse and somewhat tricky+ semantics, especially with multiple files. The manual now describes+ their behaviour precisely.++* journal: `alias` and `apply account` directives now affect `account` directives (#825)++* journal: periodic transactions can now have all the usual transaction fields+ (status mark, code, description, comment), for generating more expressive+ forecast transactions.++* journal: forecast transactions now have the generating period+ expression attached as a tag named "recur".++* journal: periodic transactions now start on the first instance of the + recurring date, rather than the day after the last regular transaction (#750)++* journal: periodic transaction rules now allow period expressions relative to today's date++* csv: amount-in/amount-out errors are more detailed++* balance: --drop is now ignored when not in flat mode, + rather than producing a corrupted report (#754)++* budget: --drop now preserves the <unbudgeted> top-level account in --budget reports++* register: in CSV output, the code field is now included (#746)++* smart dates now allow the YYYYMM format, and are better documented++* use hledger-lib 1.10++ # 1.9.1 (2018/4/30) * use hledger-lib 1.9.1 -* budget (balance --budget): budgets can be built from periodic- transactions with different intervals again. In 1.9, budgets were- restricted to a single interval, but this was a mistake. This- restores the 1.5 behaviour.+* budget (balance --budget): monthly columns are displayed in the+ proper order. This fixes a regression in 1.9. +* budget: budgets can be built from periodic transactions with+ different intervals again. In 1.9, budgets were restricted to a+ single interval, but this was a mistake. This restores the 1.5+ behaviour.+ * budget: budget reports are more intuitive and much less likely to produce no output. @@ -33,6 +99,9 @@ * journal: automated postings are now generated early, before journal finalisation, so they are present for amount inference, transaction balancing, and balance assertions+ (#729)++* journal: automated postings are now inserted right after the posting that triggered them (#729) * cli: command-line account aliases are now applied early, before journal finalisation,
Hledger/Cli/CliOptions.hs view
@@ -5,7 +5,7 @@ -} -{-# LANGUAGE CPP, ScopedTypeVariables, DeriveDataTypeable, FlexibleContexts, TypeFamilies, OverloadedStrings #-}+{-# LANGUAGE CPP, ScopedTypeVariables, DeriveDataTypeable, FlexibleContexts, TypeFamilies, OverloadedStrings, PackageImports #-} module Hledger.Cli.CliOptions ( @@ -71,22 +71,20 @@ where import Prelude ()-import Prelude.Compat+import "base-compat-batteries" Prelude.Compat import qualified Control.Exception as C import Control.Monad (when) import Data.Char import Data.Default-#if !MIN_VERSION_base(4,8,0)-import Data.Functor.Compat ((<$>))-#endif import Data.Functor.Identity (Identity)-import Data.List.Compat+import "base-compat-batteries" Data.List.Compat import Data.List.Split (splitOneOf) import Data.Ord import Data.Maybe --import Data.String.Here -- import Data.Text (Text) import qualified Data.Text as T+import Data.Void (Void) import Safe import System.Console.CmdArgs hiding (Default,def) import System.Console.CmdArgs.Explicit@@ -99,7 +97,8 @@ import System.Exit (exitSuccess) import System.FilePath import Test.HUnit-import Text.Megaparsec.Compat+import Text.Megaparsec+import Text.Megaparsec.Char import Hledger import Hledger.Cli.DocFiles@@ -554,7 +553,7 @@ widthFromOpts :: CliOpts -> Int widthFromOpts CliOpts{width_=Nothing, available_width_=w} = w widthFromOpts CliOpts{width_=Just s} =- case runParser (read `fmap` some digitChar <* eof :: ParsecT MPErr String Identity Int) "(unknown)" s of+ case runParser (read `fmap` some digitChar <* eof :: ParsecT Void String Identity Int) "(unknown)" s of Left e -> usageError $ "could not parse width option: "++show e Right w -> w @@ -576,7 +575,7 @@ Left e -> usageError $ "could not parse width option: "++show e Right ws -> ws where- registerwidthp :: (Stream s, Char ~ Token s) => ParsecT MPErr s m (Int, Maybe Int)+ registerwidthp :: (Stream s, Char ~ Token s) => ParsecT Void s m (Int, Maybe Int) registerwidthp = do totalwidth <- read `fmap` some digitChar descwidth <- optional (char ',' >> read `fmap` some digitChar)@@ -665,10 +664,10 @@ isHledgerExeName = isRight . parsewith hledgerexenamep . T.pack where hledgerexenamep = do- _ <- mptext $ T.pack progname+ _ <- string $ T.pack progname _ <- char '-' _ <- some $ noneOf ['.']- optional (string "." >> choice' (map (mptext . T.pack) addonExtensions))+ optional (string "." >> choice' (map (string . T.pack) addonExtensions)) eof stripAddonExtension :: String -> String
Hledger/Cli/Commands/Add.hs view
@@ -3,7 +3,7 @@ |-} {-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-unused-do-bind #-}-{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable, RecordWildCards, TypeOperators, FlexibleContexts, OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable, RecordWildCards, TypeOperators, FlexibleContexts, OverloadedStrings, PackageImports #-} module Hledger.Cli.Commands.Add ( addmode@@ -15,7 +15,7 @@ where import Prelude ()-import Prelude.Compat+import "base-compat-batteries" Prelude.Compat import Control.Exception as E import Control.Monad import Control.Monad.Trans.Class@@ -23,7 +23,7 @@ import Control.Monad.Trans (liftIO) import Data.Char (toUpper, toLower) import Data.Functor.Identity (Identity(..))-import Data.List.Compat+import "base-compat-batteries" Data.List.Compat import qualified Data.Set as S import Data.Maybe import Data.Text (Text)@@ -37,7 +37,8 @@ import System.Console.Wizard import System.Console.Wizard.Haskeline import System.IO ( stderr, hPutStr, hPutStrLn )-import Text.Megaparsec.Compat+import Text.Megaparsec+import Text.Megaparsec.Char import Text.Printf import Hledger@@ -199,7 +200,7 @@ c <- optional codep skipMany spacenonewline eof- return (d, T.pack $ fromMaybe "" c)+ return (d, fromMaybe "" c) -- defday = fixSmartDate today $ fromparse $ (parse smartdate "" . lowercase) defdate -- datestr = showDate $ fixSmartDate defday smtdate
Hledger/Cli/Commands/Help.hs view
@@ -7,6 +7,7 @@ --TODO substring matching {-# LANGUAGE QuasiQuotes #-}+{-# LANGUAGE PackageImports #-} module Hledger.Cli.Commands.Help ( @@ -16,7 +17,7 @@ ) where import Prelude ()-import Prelude.Compat+import "base-compat-batteries" Prelude.Compat import Data.Char import Data.List import Data.Maybe
Hledger/Cli/Commands/Register.hs view
@@ -68,15 +68,16 @@ postingsReportAsCsv :: PostingsReport -> CSV postingsReportAsCsv (_,is) =- ["txnidx","date","description","account","amount","total"]+ ["txnidx","date","code","description","account","amount","total"] : map postingsReportItemAsCsvRecord is postingsReportItemAsCsvRecord :: PostingsReportItem -> Record-postingsReportItemAsCsvRecord (_, _, _, p, b) = [idx,date,desc,acct,amt,bal]+postingsReportItemAsCsvRecord (_, _, _, p, b) = [idx,date,code,desc,acct,amt,bal] where idx = show $ maybe 0 tindex $ ptransaction p date = showDate $ postingDate p -- XXX csv should show date2 with --date2+ code = maybe "" (T.unpack . tcode) $ ptransaction p desc = T.unpack $ maybe "" tdescription $ ptransaction p acct = bracket $ T.unpack $ paccount p where
Hledger/Cli/Commands/Rewrite.hs view
@@ -14,10 +14,8 @@ import Data.String.Here import qualified Data.Text as T import Hledger-import Hledger.Data.AutoTransaction (runModifierTransaction) import Hledger.Cli.CliOptions import Hledger.Cli.Commands.Print---import Hledger.Cli hiding (outputflags) import System.Console.CmdArgs.Explicit import Text.Printf import Text.Megaparsec@@ -177,8 +175,8 @@ outputFromOpts rawopts opts{reportopts_=ropts{query_=""}} j j' postingp' :: T.Text -> IO Posting-postingp' t = runErroringJournalParser (postingp Nothing <* eof) t' >>= \case- Left err -> fail err+postingp' t = runJournalParser (postingp Nothing <* eof) t' >>= \case+ Left err -> fail $ parseErrorPretty' t' err Right p -> return p where t' = " " <> t <> "\n" -- inject space and newline for proper parsing
Hledger/Cli/DocFiles.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}+{-# LANGUAGE TemplateHaskell, OverloadedStrings, PackageImports #-} {-| Embedded documentation files in various formats, and helpers for viewing them.@@ -21,7 +21,7 @@ ) where import Prelude ()-import Prelude.Compat+import "base-compat-batteries" Prelude.Compat import Data.FileEmbed import Data.String import System.IO
Hledger/Cli/Utils.hs view
@@ -10,7 +10,8 @@ ( withJournalDo, writeOutput,- journalApplyValue, + journalTransform,+ journalApplyValue, journalAddForecast, generateAutomaticPostings, journalReload,@@ -28,7 +29,8 @@ ) where import Control.Exception as C-import Control.Monad ((<=<))+import Control.Monad+ import Data.Hashable (hash) import Data.List import Data.Maybe@@ -58,22 +60,33 @@ import Hledger.Reports import Hledger.Utils --- | Parse the user's specified journal file, maybe apply some transformations--- (aliases, pivot) and run a hledger command on it, or throw an error.+-- | Parse the user's specified journal file(s) as a Journal, maybe apply some+-- transformations according to options, and run a hledger command with it. +-- Or, throw an error. withJournalDo :: CliOpts -> (CliOpts -> Journal -> IO ()) -> IO () withJournalDo opts cmd = do -- We kludgily read the file before parsing to grab the full text, unless -- it's stdin, or it doesn't exist and we are adding. We read it strictly -- to let the add command work. journalpaths <- journalFilePathFromOpts opts- ej <- readJournalFiles (inputopts_ opts) journalpaths- let f = cmd opts- . pivotByOpts opts- . anonymiseByOpts opts- <=< journalApplyValue (reportopts_ opts)- <=< journalAddForecast opts- either error' f ej+ readJournalFiles (inputopts_ opts) journalpaths + >>= mapM (journalTransform opts)+ >>= either error' (cmd opts) +-- | Apply some transformations to the journal if specified by options.+-- These include:+-- +-- - adding forecast transactions (--forecast)+-- - converting amounts to market value (--value)+-- - pivoting account names (--pivot)+-- - anonymising (--anonymise).+journalTransform :: CliOpts -> Journal -> IO Journal+journalTransform opts@CliOpts{reportopts_=ropts} =+ journalAddForecast opts+ >=> journalApplyValue ropts+ >=> return . pivotByOpts opts+ >=> return . anonymiseByOpts opts+ -- | Apply the pivot transformation on a journal, if option is present. pivotByOpts :: CliOpts -> Journal -> Journal pivotByOpts opts =@@ -120,23 +133,34 @@ | otherwise = id return $ convert j --- | Run PeriodicTransactions from journal from today or journal end to requested end day.--- Add generated transactions to the journal+-- | Generate periodic transactions from all periodic transaction rules in the journal.+-- These transactions are added to the in-memory Journal (but not the on-disk file).+--+-- They start on or after the day following the latest normal transaction in the journal,+-- or today if there are none.+-- They end on or before the specified report end date, or 180 days from today if unspecified.+-- journalAddForecast :: CliOpts -> Journal -> IO Journal-journalAddForecast opts j = do+journalAddForecast opts@CliOpts{reportopts_=ropts} j = do today <- getCurrentDay- -- Create forecast starting from end of journal + 1 day, and until the end of requested reporting period- -- If end is not provided, do 180 days of forecast.- -- Note that jdatespan already returns last day + 1- let startDate = fromMaybe today $ spanEnd (jdatespan j) - endDate = fromMaybe (addDays 180 today) $ periodEnd (period_ ropts)- dates = DateSpan (Just startDate) (Just endDate)- withForecast = [makeForecast t | pt <- jperiodictxns j, t <- runPeriodicTransaction pt dates, spanContainsDate dates (tdate t) ] ++ (jtxns j)- makeForecast t = txnTieKnot $ t { tdescription = T.pack "Forecast transaction" }- ropts = reportopts_ opts- if forecast_ ropts - then return $ journalBalanceTransactions' opts j { jtxns = withForecast }- else return j++ -- "They start on or after the day following the latest normal transaction in the journal, or today if there are none."+ let DateSpan _ mjournalend = dbg2 "journalspan" $ journalDateSpan False j -- ignore secondary dates+ forecaststart = dbg2 "forecaststart" $ fromMaybe today mjournalend++ -- "They end on or before the specified report end date, or 180 days from today if unspecified."+ mspecifiedend <- snd . dbg2 "specifieddates" <$> specifiedStartEndDates ropts+ let forecastend = dbg2 "forecastend" $ fromMaybe (addDays 180 today) mspecifiedend++ let forecastspan = DateSpan (Just forecaststart) (Just forecastend)+ forecasttxns = [ txnTieKnot t | pt <- jperiodictxns j+ , t <- runPeriodicTransaction pt forecastspan+ , spanContainsDate forecastspan (tdate t)+ ]+ return $+ if forecast_ ropts + then journalBalanceTransactions' opts j{ jtxns = forecasttxns ++ jtxns j } -- XXX wouldn't appending be better ?+ else j where journalBalanceTransactions' opts j = let assrt = not . ignore_assertions_ $ inputopts_ opts@@ -154,14 +178,14 @@ -- readJournal :: CliOpts -> String -> IO Journal -- readJournal opts s = readJournal def Nothing s >>= either error' return --- | Re-read the journal file(s) specified by options and maybe apply some--- transformations (aliases, pivot), or return an error string.+-- | Re-read the journal file(s) specified by options, applying any+-- transformations specified by options. Or return an error string. -- Reads the full journal, without filtering. journalReload :: CliOpts -> IO (Either String Journal) journalReload opts = do journalpaths <- journalFilePathFromOpts opts- (pivotByOpts opts <$>) <$>- readJournalFiles (inputopts_ opts) journalpaths+ readJournalFiles (inputopts_ opts) journalpaths+ >>= mapM (journalTransform opts) -- | Re-read the option-specified journal file(s), but only if any of -- them has changed since last read. (If the file is standard input,
embeddedfiles/hledger-api.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-api" "1" "April 2018" "hledger\-api 1.9.1" "hledger User Manuals"+.TH "hledger\-api" "1" "June 2018" "hledger\-api 1.9.99" "hledger User Manuals"
embeddedfiles/hledger-api.info view
@@ -3,8 +3,8 @@ File: hledger-api.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-api(1) hledger-api 1.9.1-********************************+hledger-api(1) hledger-api 1.9.99+********************************* hledger-api is a simple web API server, intended to support client-side web apps operating on hledger data. It comes with a series of simple@@ -80,7 +80,7 @@ Tag Table: Node: Top72-Node: OPTIONS1662-Ref: #options1747+Node: OPTIONS1664+Ref: #options1749 End Tag Table
embeddedfiles/hledger-api.txt view
@@ -117,4 +117,4 @@ -hledger-api 1.9.1 April 2018 hledger-api(1)+hledger-api 1.9.99 June 2018 hledger-api(1)
embeddedfiles/hledger-ui.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-ui" "1" "April 2018" "hledger\-ui 1.9.1" "hledger User Manuals"+.TH "hledger\-ui" "1" "June 2018" "hledger\-ui 1.9.99" "hledger User Manuals"
embeddedfiles/hledger-ui.info view
@@ -3,8 +3,8 @@ File: hledger-ui.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-ui(1) hledger-ui 1.9.1-******************************+hledger-ui(1) hledger-ui 1.9.99+******************************* hledger-ui is hledger's curses-style interface, providing an efficient full-window text UI for viewing accounts and transactions, and some@@ -377,19 +377,19 @@ Tag Table: Node: Top71-Node: OPTIONS825-Ref: #options922-Node: KEYS4139-Ref: #keys4234-Node: SCREENS7193-Ref: #screens7278-Node: Accounts screen7368-Ref: #accounts-screen7496-Node: Register screen9726-Ref: #register-screen9881-Node: Transaction screen11955-Ref: #transaction-screen12113-Node: Error screen12983-Ref: #error-screen13105+Node: OPTIONS827+Ref: #options924+Node: KEYS4141+Ref: #keys4236+Node: SCREENS7195+Ref: #screens7280+Node: Accounts screen7370+Ref: #accounts-screen7498+Node: Register screen9728+Ref: #register-screen9883+Node: Transaction screen11957+Ref: #transaction-screen12115+Node: Error screen12985+Ref: #error-screen13107 End Tag Table
embeddedfiles/hledger-ui.txt view
@@ -384,4 +384,4 @@ -hledger-ui 1.9.1 April 2018 hledger-ui(1)+hledger-ui 1.9.99 June 2018 hledger-ui(1)
embeddedfiles/hledger-web.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-web" "1" "April 2018" "hledger\-web 1.9.1" "hledger User Manuals"+.TH "hledger\-web" "1" "June 2018" "hledger\-web 1.9.99" "hledger User Manuals"
embeddedfiles/hledger-web.info view
@@ -3,8 +3,8 @@ File: hledger-web.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-web(1) hledger-web 1.9.1-********************************+hledger-web(1) hledger-web 1.9.99+********************************* hledger-web is hledger's web interface. It starts a simple web application for browsing and adding transactions, and optionally opens@@ -209,7 +209,7 @@ Tag Table: Node: Top72-Node: OPTIONS3156-Ref: #options3241+Node: OPTIONS3158+Ref: #options3243 End Tag Table
embeddedfiles/hledger-web.txt view
@@ -248,4 +248,4 @@ -hledger-web 1.9.1 April 2018 hledger-web(1)+hledger-web 1.9.99 June 2018 hledger-web(1)
embeddedfiles/hledger.1 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "April 2018" "hledger 1.9.1" "hledger User Manuals"+.TH "hledger" "1" "June 2018" "hledger 1.9.99" "hledger User Manuals" @@ -493,51 +493,85 @@ tab(@); l l. T{-\f[C]2009/1/1\f[], \f[C]2009/01/01\f[], \f[C]2009\-1\-1\f[],-\f[C]2009.1.1\f[]+\f[C]2004/10/1\f[], \f[C]2004\-01\-01\f[], \f[C]2004.9.1\f[] T}@T{-simple dates, several separators allowed+exact date, several separators allowed.+Year is 4+ digits, month is 1\-12, day is 1\-31 T} T{-\f[C]2009/1\f[], \f[C]2009\f[]+\f[C]2004\f[] T}@T{-same as above \- a missing day or month defaults to 1+start of year T} T{-\f[C]1/1\f[], \f[C]january\f[], \f[C]jan\f[], \f[C]this\ year\f[]+\f[C]2004/10\f[] T}@T{-relative dates, meaning january 1 of the current year+start of month T} T{-\f[C]next\ year\f[]+\f[C]10/1\f[] T}@T{-january 1 of next year+month and day in current year T} T{-\f[C]this\ month\f[]+\f[C]21\f[] T}@T{-the 1st of the current month+day in current month T} T{-\f[C]this\ week\f[]+\f[C]october,\ oct\f[] T}@T{-the most recent monday+start of month in current year T} T{-\f[C]last\ week\f[]+\f[C]yesterday,\ today,\ tomorrow\f[] T}@T{-the monday of the week before this one+\-1, 0, 1 days from today T} T{-\f[C]lastweek\f[]+\f[C]last/this/next\ day/week/month/quarter/year\f[] T}@T{-spaces are optional+\-1, 0, 1 periods from the current period T} T{-\f[C]today\f[], \f[C]yesterday\f[], \f[C]tomorrow\f[]+\f[C]20181201\f[] T}@T{+8 digit YYYYMMDD with valid year month and day T}+T{+\f[C]201812\f[]+T}@T{+6 digit YYYYMM with valid year and month+T} .TE+.PP+Counterexamples \- malformed digit sequences might give surprising+results:+.PP+.TS+tab(@);+l l.+T{+\f[C]201813\f[]+T}@T{+6 digits with an invalid month is parsed as start of 6\-digit year+T}+T{+\f[C]20181301\f[]+T}@T{+8 digits with an invalid month is parsed as start of 8\-digit year+T}+T{+\f[C]20181232\f[]+T}@T{+8 digits with an invalid day gives an error+T}+T{+\f[C]201801012\f[]+T}@T{+9+ digits beginning with a valid YYYYMMDD gives an error+T}+.TE .SS Report start & end date .PP Most hledger reports show the full span of time represented by the@@ -928,6 +962,9 @@ .PP The \f[C]\-V/\-\-value\f[] flag converts reported amounts to their current market value.+.PD 0+.P+.PD Specifically, when there is a market price (P directive) for the amount's commodity, dated on or before today's date (or the report end date if specified), the amount will be converted to the price's@@ -957,32 +994,36 @@ .IP .nf \f[C]-$\ hledger\ \-f\ t.j\ bal\ euros+$\ hledger\ \-f\ t.j\ bal\ \-N\ euros \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ €100\ \ assets:euros \f[] .fi .PP-What are they worth on nov 3 ?-(no report end date specified, defaults to the last date in the journal)+What are they worth at end of nov 3 ? .IP .nf \f[C]-$\ hledger\ \-f\ t.j\ bal\ euros\ \-V+$\ hledger\ \-f\ t.j\ bal\ \-N\ euros\ \-V\ \-e\ 2016/11/4 \ \ \ \ \ \ \ \ \ \ \ \ \ $110.00\ \ assets:euros \f[] .fi .PP-What are they worth on dec 21 ?+What are they worth after 2016/12/21 ?+(no report end date specified, defaults to today) .IP .nf \f[C]-$\ hledger\ \-f\ t.j\ bal\ euros\ \-V\ \-e\ 2016/12/21+$\ hledger\ \-f\ t.j\ bal\ \-N\ euros\ \-V \ \ \ \ \ \ \ \ \ \ \ \ \ $103.00\ \ assets:euros \f[] .fi .PP Currently, hledger's \-V only uses market prices recorded with P directives, not transaction prices (unlike Ledger).+.PP+Currently, \-V has a limitation in multicolumn balance reports: it uses+the market prices on the report end date for all columns.+(Instead of the prices on each column's end date.) .SS Combining \-B and \-V .PP Using \-B/\[en]cost and \-V/\[en]value together is currently allowed,
embeddedfiles/hledger.info view
@@ -3,8 +3,8 @@ File: hledger.info, Node: Top, Next: EXAMPLES, Up: (dir) -hledger(1) hledger 1.9.1-************************+hledger(1) hledger 1.9.99+************************* This is hledger's command-line interface (there are also curses and web interfaces). Its basic function is to read a plain text file describing@@ -390,16 +390,26 @@ Examples: -'2009/1/1', '2009/01/01', '2009-1-1', '2009.1.1' simple dates, several separators allowed-'2009/1', '2009' same as above - a missing day or month defaults to 1-'1/1', 'january', 'jan', 'this year' relative dates, meaning january 1 of the current year-'next year' january 1 of next year-'this month' the 1st of the current month-'this week' the most recent monday-'last week' the monday of the week before this one-'lastweek' spaces are optional-'today', 'yesterday', 'tomorrow'+'2004/10/1', '2004-01-01', '2004.9.1' exact date, several separators allowed. Year is 4+ digits, month is 1-12, day is 1-31+'2004' start of year+'2004/10' start of month+'10/1' month and day in current year+'21' day in current month+'october, oct' start of month in current year+'yesterday, today, tomorrow' -1, 0, 1 days from today+'last/this/next -1, 0, 1 periods from the current period+day/week/month/quarter/year'+'20181201' 8 digit YYYYMMDD with valid year month and day+'201812' 6 digit YYYYMM with valid year and month + Counterexamples - malformed digit sequences might give surprising+results:++'201813' 6 digits with an invalid month is parsed as start of 6-digit year+'20181301' 8 digits with an invalid month is parsed as start of 8-digit year+'20181232' 8 digits with an invalid day gives an error+'201801012' 9+ digits beginning with a valid YYYYMMDD gives an error+ File: hledger.info, Node: Report start & end date, Next: Report intervals, Prev: Smart dates, Up: OPTIONS @@ -635,7 +645,8 @@ ================= The '-V/--value' flag converts reported amounts to their current market-value. Specifically, when there is a market price (P directive) for the+value.+Specifically, when there is a market price (P directive) for the amount's commodity, dated on or before today's date (or the report end date if specified), the amount will be converted to the price's commodity.@@ -658,23 +669,27 @@ How many euros do I have ? -$ hledger -f t.j bal euros+$ hledger -f t.j bal -N euros €100 assets:euros - What are they worth on nov 3 ? (no report end date specified,-defaults to the last date in the journal)+ What are they worth at end of nov 3 ? -$ hledger -f t.j bal euros -V+$ hledger -f t.j bal -N euros -V -e 2016/11/4 $110.00 assets:euros - What are they worth on dec 21 ?+ What are they worth after 2016/12/21 ? (no report end date+specified, defaults to today) -$ hledger -f t.j bal euros -V -e 2016/12/21+$ hledger -f t.j bal -N euros -V $103.00 assets:euros Currently, hledger's -V only uses market prices recorded with P directives, not transaction prices (unlike Ledger). + Currently, -V has a limitation in multicolumn balance reports: it+uses the market prices on the report end date for all columns. (Instead+of the prices on each column's end date.)+ File: hledger.info, Node: Combining -B and -V, Next: Output destination, Prev: Market value, Up: OPTIONS @@ -2418,138 +2433,138 @@ Tag Table: Node: Top68-Node: EXAMPLES1886-Ref: #examples1986-Node: OPTIONS3632-Ref: #options3734-Node: General options4099-Ref: #general-options4224-Node: Command options6823-Ref: #command-options6974-Node: Command arguments7372-Ref: #command-arguments7526-Node: Argument files7647-Ref: #argument-files7798-Node: Special characters8064-Ref: #special-characters8217-Node: Input files9636-Ref: #input-files9772-Node: Smart dates11742-Ref: #smart-dates11883-Node: Report start & end date12862-Ref: #report-start-end-date13032-Node: Report intervals14097-Ref: #report-intervals14260-Node: Period expressions14661-Ref: #period-expressions14821-Node: Depth limiting18778-Ref: #depth-limiting18922-Node: Pivoting19264-Ref: #pivoting19382-Node: Cost21058-Ref: #cost21166-Node: Market value21284-Ref: #market-value21419-Node: Combining -B and -V22602-Ref: #combining--b-and--v22765-Node: Output destination22912-Ref: #output-destination23074-Node: Output format23357-Ref: #output-format23509-Node: Regular expressions23894-Ref: #regular-expressions24031-Node: QUERIES25392-Ref: #queries25494-Node: COMMANDS29456-Ref: #commands29568-Node: accounts30550-Ref: #accounts30648-Node: activity31894-Ref: #activity32004-Node: add32364-Ref: #add32463-Node: balance35124-Ref: #balance35235-Node: Classic balance report38318-Ref: #classic-balance-report38491-Node: Customising the classic balance report39860-Ref: #customising-the-classic-balance-report40088-Node: Colour support42162-Ref: #colour-support42329-Node: Flat mode42502-Ref: #flat-mode42650-Node: Depth limited balance reports43063-Ref: #depth-limited-balance-reports43263-Node: Multicolumn balance report43719-Ref: #multicolumn-balance-report43917-Node: Budget report49097-Ref: #budget-report49240-Ref: #output-format-152274-Node: balancesheet52352-Ref: #balancesheet52488-Node: balancesheetequity54799-Ref: #balancesheetequity54948-Node: cashflow55485-Ref: #cashflow55613-Node: check-dates57736-Ref: #check-dates57863-Node: check-dupes57980-Ref: #check-dupes58104-Node: close58241-Ref: #close58348-Node: help58678-Ref: #help58778-Node: import59852-Ref: #import59966-Node: incomestatement60696-Ref: #incomestatement60830-Node: prices63234-Ref: #prices63349-Node: print63392-Ref: #print63502-Node: print-unique68396-Ref: #print-unique68522-Node: register68590-Ref: #register68717-Node: Custom register output73218-Ref: #custom-register-output73347-Node: register-match74577-Ref: #register-match74711-Node: rewrite74894-Ref: #rewrite75011-Node: stats75080-Ref: #stats75183-Node: tags76053-Ref: #tags76151-Node: test76387-Ref: #test76471-Node: ADD-ON COMMANDS76839-Ref: #add-on-commands76949-Node: Official add-ons78236-Ref: #official-add-ons78376-Node: api78463-Ref: #api78552-Node: ui78604-Ref: #ui78703-Node: web78761-Ref: #web78850-Node: Third party add-ons78896-Ref: #third-party-add-ons79071-Node: diff79206-Ref: #diff79303-Node: iadd79402-Ref: #iadd79516-Node: interest79599-Ref: #interest79720-Node: irr79815-Ref: #irr79913-Node: Experimental add-ons79991-Ref: #experimental-add-ons80143-Node: autosync80423-Ref: #autosync80534-Node: chart80773-Ref: #chart80892-Node: check80963-Ref: #check81065+Node: EXAMPLES1888+Ref: #examples1988+Node: OPTIONS3634+Ref: #options3736+Node: General options4101+Ref: #general-options4226+Node: Command options6825+Ref: #command-options6976+Node: Command arguments7374+Ref: #command-arguments7528+Node: Argument files7649+Ref: #argument-files7800+Node: Special characters8066+Ref: #special-characters8219+Node: Input files9638+Ref: #input-files9774+Node: Smart dates11744+Ref: #smart-dates11885+Node: Report start & end date13291+Ref: #report-start-end-date13461+Node: Report intervals14526+Ref: #report-intervals14689+Node: Period expressions15090+Ref: #period-expressions15250+Node: Depth limiting19207+Ref: #depth-limiting19351+Node: Pivoting19693+Ref: #pivoting19811+Node: Cost21487+Ref: #cost21595+Node: Market value21713+Ref: #market-value21848+Node: Combining -B and -V23214+Ref: #combining--b-and--v23377+Node: Output destination23524+Ref: #output-destination23686+Node: Output format23969+Ref: #output-format24121+Node: Regular expressions24506+Ref: #regular-expressions24643+Node: QUERIES26004+Ref: #queries26106+Node: COMMANDS30068+Ref: #commands30180+Node: accounts31162+Ref: #accounts31260+Node: activity32506+Ref: #activity32616+Node: add32976+Ref: #add33075+Node: balance35736+Ref: #balance35847+Node: Classic balance report38930+Ref: #classic-balance-report39103+Node: Customising the classic balance report40472+Ref: #customising-the-classic-balance-report40700+Node: Colour support42774+Ref: #colour-support42941+Node: Flat mode43114+Ref: #flat-mode43262+Node: Depth limited balance reports43675+Ref: #depth-limited-balance-reports43875+Node: Multicolumn balance report44331+Ref: #multicolumn-balance-report44529+Node: Budget report49709+Ref: #budget-report49852+Ref: #output-format-152886+Node: balancesheet52964+Ref: #balancesheet53100+Node: balancesheetequity55411+Ref: #balancesheetequity55560+Node: cashflow56097+Ref: #cashflow56225+Node: check-dates58348+Ref: #check-dates58475+Node: check-dupes58592+Ref: #check-dupes58716+Node: close58853+Ref: #close58960+Node: help59290+Ref: #help59390+Node: import60464+Ref: #import60578+Node: incomestatement61308+Ref: #incomestatement61442+Node: prices63846+Ref: #prices63961+Node: print64004+Ref: #print64114+Node: print-unique69008+Ref: #print-unique69134+Node: register69202+Ref: #register69329+Node: Custom register output73830+Ref: #custom-register-output73959+Node: register-match75189+Ref: #register-match75323+Node: rewrite75506+Ref: #rewrite75623+Node: stats75692+Ref: #stats75795+Node: tags76665+Ref: #tags76763+Node: test76999+Ref: #test77083+Node: ADD-ON COMMANDS77451+Ref: #add-on-commands77561+Node: Official add-ons78848+Ref: #official-add-ons78988+Node: api79075+Ref: #api79164+Node: ui79216+Ref: #ui79315+Node: web79373+Ref: #web79462+Node: Third party add-ons79508+Ref: #third-party-add-ons79683+Node: diff79818+Ref: #diff79915+Node: iadd80014+Ref: #iadd80128+Node: interest80211+Ref: #interest80332+Node: irr80427+Ref: #irr80525+Node: Experimental add-ons80603+Ref: #experimental-add-ons80755+Node: autosync81035+Ref: #autosync81146+Node: chart81385+Ref: #chart81504+Node: check81575+Ref: #check81677 End Tag Table
embeddedfiles/hledger.txt view
@@ -332,35 +332,56 @@ Examples: - 2009/1/1, 2009/01/01, simple dates, several sep-- 2009-1-1, 2009.1.1 arators allowed - 2009/1, 2009 same as above - a missing- day or month defaults to 1- 1/1, january, jan, relative dates, meaning- this year january 1 of the current- year- next year january 1 of next year- this month the 1st of the current- month- this week the most recent monday- last week the monday of the week- before this one- lastweek spaces are optional- today, yesterday, tomorrow ++ 2004/10/1, 2004-01-01, exact date, several sepa-+ 2004.9.1 rators allowed. Year is+ 4+ digits, month is 1-12,+ day is 1-31+ 2004 start of year+ 2004/10 start of month+ 10/1 month and day in current+ year+ 21 day in current month+ october, oct start of month in current+ year+ yesterday, today, tomorrow -1, 0, 1 days from today+ last/this/next day/week/month/quar- -1, 0, 1 periods from the+ ter/year current period+ 20181201 8 digit YYYYMMDD with+ valid year month and day+ 201812 6 digit YYYYMM with valid+ year and month++ Counterexamples - malformed digit sequences might give surprising+ results:+++ 201813 6 digits with an invalid+ month is parsed as start+ of 6-digit year+ 20181301 8 digits with an invalid+ month is parsed as start+ of 8-digit year+ 20181232 8 digits with an invalid+ day gives an error+ 201801012 9+ digits beginning with a+ valid YYYYMMDD gives an+ error+ Report start & end date- Most hledger reports show the full span of time represented by the+ Most hledger reports show the full span of time represented by the journal data, by default. So, the effective report start and end dates- will be the earliest and latest transaction or posting dates found in+ will be the earliest and latest transaction or posting dates found in the journal. - Often you will want to see a shorter time span, such as the current- month. You can specify a start and/or end date using -b/--begin,+ Often you will want to see a shorter time span, such as the current+ month. You can specify a start and/or end date using -b/--begin, -e/--end, -p/--period or a date: query (described below). All of these- accept the smart date syntax. One important thing to be aware of when- specifying end dates: as in Ledger, end dates are exclusive, so you+ accept the smart date syntax. One important thing to be aware of when+ specifying end dates: as in Ledger, end dates are exclusive, so you need to write the date after the last day you want to include. Examples:@@ -370,10 +391,10 @@ 2016 -e 12/1 end at the start of decem- ber 1st of the current- year (11/30 will be the+ year (11/30 will be the last date included)- -b thismonth all transactions on or- after the 1st of the cur-+ -b thismonth all transactions on or+ after the 1st of the cur- rent month -p thismonth all transactions in the current month@@ -385,24 +406,24 @@ Report intervals A report interval can be specified so that commands like register, bal-- ance and activity will divide their reports into multiple subperiods.- The basic intervals can be selected with one of -D/--daily,- -W/--weekly, -M/--monthly, -Q/--quarterly, or -Y/--yearly. More com-- plex intervals may be specified with a period expression. Report+ ance and activity will divide their reports into multiple subperiods.+ The basic intervals can be selected with one of -D/--daily,+ -W/--weekly, -M/--monthly, -Q/--quarterly, or -Y/--yearly. More com-+ plex intervals may be specified with a period expression. Report intervals can not be specified with a query, currently. Period expressions- The -p/--period option accepts period expressions, a shorthand way of- expressing a start date, end date, and/or report interval all at once.+ The -p/--period option accepts period expressions, a shorthand way of+ expressing a start date, end date, and/or report interval all at once. - Here's a basic period expression specifying the first quarter of 2009.- Note, hledger always treats start dates as inclusive and end dates as+ Here's a basic period expression specifying the first quarter of 2009.+ Note, hledger always treats start dates as inclusive and end dates as exclusive: -p "from 2009/1/1 to 2009/4/1" - Keywords like "from" and "to" are optional, and so are the spaces, as- long as you don't run two dates together. "to" can also be written as+ Keywords like "from" and "to" are optional, and so are the spaces, as+ long as you don't run two dates together. "to" can also be written as "-". These are equivalent to the above: @@ -410,7 +431,7 @@ -p2009/1/1to2009/4/1 -p2009/1/1-2009/4/1 - Dates are smart dates, so if the current year is 2009, the above can+ Dates are smart dates, so if the current year is 2009, the above can also be written as: @@ -426,25 +447,25 @@ 1, 2009 -p "from 2009/1" the same -p "from 2009" the same- -p "to 2009" everything before january+ -p "to 2009" everything before january 1, 2009 - A single date with no "from" or "to" defines both the start and end+ A single date with no "from" or "to" defines both the start and end date like so: - -p "2009" the year 2009; equivalent+ -p "2009" the year 2009; equivalent to "2009/1/1 to 2010/1/1"- -p "2009/1" the month of jan; equiva-+ -p "2009/1" the month of jan; equiva- lent to "2009/1/1 to 2009/2/1"- -p "2009/1/1" just that day; equivalent+ -p "2009/1/1" just that day; equivalent to "2009/1/1 to 2009/1/2" - The argument of -p can also begin with, or be, a report interval- expression. The basic report intervals are daily, weekly, monthly,+ The argument of -p can also begin with, or be, a report interval+ expression. The basic report intervals are daily, weekly, monthly, quarterly, or yearly, which have the same effect as the -D,-W,-M,-Q, or- -Y flags. Between report interval and start/end dates (if any), the+ -Y flags. Between report interval and start/end dates (if any), the word in is optional. Examples: @@ -452,23 +473,23 @@ -p "monthly in 2008" -p "quarterly" - Note that weekly, monthly, quarterly and yearly intervals will always+ Note that weekly, monthly, quarterly and yearly intervals will always start on the first day on week, month, quarter or year accordingly, and- will end on the last day of same period, even if associated period+ will end on the last day of same period, even if associated period expression specifies different explicit start and end date. For example: -p "weekly from 2009/1/1 to 2009/4/1" -- starts on 2008/12/29, closest preceed-+ starts on 2008/12/29, closest preceed- ing Monday- -p "monthly in 2008/11/25" - starts on+ -p "monthly in 2008/11/25" - starts on 2018/11/01 -p "quar- terly from 2009-05-05 to 2009-06-01" -- starts on 2009/04/01, ends on- 2009/06/30, which are first and last+ starts on 2009/04/01, ends on+ 2009/06/30, which are first and last days of Q2 2009 -p "yearly from 2009-12-29" - starts on 2009/01/01, first day of 2009@@ -477,7 +498,7 @@ biweekly, bimonthly, every day|week|month|quarter|year, every N days|weeks|months|quarters|years. - All of these will start on the first day of the requested period and+ All of these will start on the first day of the requested period and end on the last one, as described above. Examples:@@ -486,13 +507,13 @@ -p "bimonthly from 2008" - periods will have boundaries on 2008/01/01, 2008/03/01, ...- -p "every 2 weeks" - starts on closest+ -p "every 2 weeks" - starts on closest preceeding Monday -p "every 5 month from 2009/03" - peri- ods will have boundaries on 2009/03/01, 2009/08/01, ... - If you want intervals that start on arbitrary day of your choosing and+ If you want intervals that start on arbitrary day of your choosing and span a week, month or year, you need to use any of the following: every Nth day of week, every <weekday>, every Nth day [of month],@@ -502,47 +523,47 @@ Examples: - -p "every 2nd day of week" - periods+ -p "every 2nd day of week" - periods will go from Tue to Tue -p "every Tue" - same -p "every 15th day" - period boundaries will be on 15th of each month- -p "every 2nd Monday" - period bound-- aries will be on second Monday of each+ -p "every 2nd Monday" - period bound-+ aries will be on second Monday of each month- -p "every 11/05" - yearly periods with+ -p "every 11/05" - yearly periods with boundaries on 5th of Nov -p "every 5th Nov" - same -p "every Nov 5th" - same - Show historical balances at end of 15th each month (N is exclusive end+ Show historical balances at end of 15th each month (N is exclusive end date): hledger balance -H -p "every 16th day" - Group postings from start of wednesday to end of next tuesday (N is+ Group postings from start of wednesday to end of next tuesday (N is start date and exclusive end date): hledger register checking -p "every 3rd day of week" Depth limiting With the --depth N option (short form: -N), commands like account, bal-- ance and register will show only the uppermost accounts in the account- tree, down to level N. Use this when you want a summary with less- detail. This flag has the same effect as a depth: query argument (so+ ance and register will show only the uppermost accounts in the account+ tree, down to level N. Use this when you want a summary with less+ detail. This flag has the same effect as a depth: query argument (so -2, --depth=2 or depth:2 are basically equivalent). Pivoting Normally hledger sums amounts, and organizes them in a hierarchy, based- on account name. The --pivot FIELD option causes it to sum and orga-- nize hierarchy based on the value of some other field instead. FIELD+ on account name. The --pivot FIELD option causes it to sum and orga-+ nize hierarchy based on the value of some other field instead. FIELD can be: code, description, payee, note, or the full name (case insensi- tive) of any tag. As with account names, values containing colon:sepa- rated:parts will be displayed hierarchically in reports. - --pivot is a general option affecting all reports; you can think of+ --pivot is a general option affecting all reports; you can think of hledger transforming the journal before any other processing, replacing- every posting's account name with the value of the specified field on+ every posting's account name with the value of the specified field on that posting, inheriting it from the transaction or using a blank value if it's not present. @@ -568,7 +589,7 @@ -------------------- 0 - One way to show only amounts with a member: value (using a query,+ One way to show only amounts with a member: value (using a query, described below): $ hledger balance --pivot member tag:member=.@@ -576,7 +597,7 @@ -------------------- -2 EUR - Another way (the acct: query matches against the pivoted "account+ Another way (the acct: query matches against the pivoted "account name"): $ hledger balance --pivot member acct:.@@ -585,17 +606,18 @@ -2 EUR Cost- The -B/--cost flag converts amounts to their cost at transaction time,+ The -B/--cost flag converts amounts to their cost at transaction time, if they have a transaction price specified. Market value- The -V/--value flag converts reported amounts to their current market- value. Specifically, when there is a market price (P directive) for- the amount's commodity, dated on or before today's date (or the report- end date if specified), the amount will be converted to the price's- commodity.+ The -V/--value flag converts reported amounts to their current market+ value.+ Specifically, when there is a market price (P directive) for the+ amount's commodity, dated on or before today's date (or the report end+ date if specified), the amount will be converted to the price's commod-+ ity. - When there are multiple applicable P directives, -V chooses the most+ When there are multiple applicable P directives, -V chooses the most recent one, or in case of equal dates, the last-parsed one. For example:@@ -613,39 +635,43 @@ How many euros do I have ? - $ hledger -f t.j bal euros+ $ hledger -f t.j bal -N euros 100 assets:euros - What are they worth on nov 3 ? (no report end date specified, defaults- to the last date in the journal)+ What are they worth at end of nov 3 ? - $ hledger -f t.j bal euros -V+ $ hledger -f t.j bal -N euros -V -e 2016/11/4 $110.00 assets:euros - What are they worth on dec 21 ?+ What are they worth after 2016/12/21 ? (no report end date specified,+ defaults to today) - $ hledger -f t.j bal euros -V -e 2016/12/21+ $ hledger -f t.j bal -N euros -V $103.00 assets:euros - Currently, hledger's -V only uses market prices recorded with P direc-+ Currently, hledger's -V only uses market prices recorded with P direc- tives, not transaction prices (unlike Ledger). + Currently, -V has a limitation in multicolumn balance reports: it uses+ the market prices on the report end date for all columns. (Instead of+ the prices on each column's end date.)+ Combining -B and -V- Using -B/-cost and -V/-value together is currently allowed, but the+ Using -B/-cost and -V/-value together is currently allowed, but the results are probably not meaningful. Let us know if you find a use for this. Output destination- Some commands (print, register, stats, the balance commands) can write- their output to a destination other than the console. This is con-+ Some commands (print, register, stats, the balance commands) can write+ their output to a destination other than the console. This is con- trolled by the -o/--output-file option. $ hledger balance -o - # write to stdout (the default) $ hledger balance -o FILE # write to FILE Output format- Some commands can write their output in other formats. Eg print and- register can output CSV, and the balance commands can output CSV or+ Some commands can write their output in other formats. Eg print and+ register can output CSV, and the balance commands can output CSV or HTML. This is controlled by the -O/--output-format option, or by spec- ifying a .csv or .html file extension with -o/--output-file. @@ -655,56 +681,56 @@ Regular expressions hledger uses regular expressions in a number of places: - o query terms, on the command line and in the hledger-web search form:+ o query terms, on the command line and in the hledger-web search form: REGEX, desc:REGEX, cur:REGEX, tag:...=REGEX o CSV rules conditional blocks: if REGEX ... - o account alias directives and options: alias /REGEX/ = REPLACEMENT,+ o account alias directives and options: alias /REGEX/ = REPLACEMENT, --alias /REGEX/=REPLACEMENT - hledger's regular expressions come from the regex-tdfa library. In+ hledger's regular expressions come from the regex-tdfa library. In general they: o are case insensitive - o are infix matching (do not need to match the entire thing being+ o are infix matching (do not need to match the entire thing being matched) o are POSIX extended regular expressions o also support GNU word boundaries (\<, \>, \b, \B) - o and parenthesised capturing groups and numeric backreferences in+ o and parenthesised capturing groups and numeric backreferences in replacement strings o do not support mode modifiers like (?s) Some things to note: - o In the alias directive and --alias option, regular expressions must- be enclosed in forward slashes (/REGEX/). Elsewhere in hledger,+ o In the alias directive and --alias option, regular expressions must+ be enclosed in forward slashes (/REGEX/). Elsewhere in hledger, these are not required. - o In queries, to match a regular expression metacharacter like $ as a- literal character, prepend a backslash. Eg to search for amounts+ o In queries, to match a regular expression metacharacter like $ as a+ literal character, prepend a backslash. Eg to search for amounts with the dollar sign in hledger-web, write cur:\$. - o On the command line, some metacharacters like $ have a special mean-+ o On the command line, some metacharacters like $ have a special mean- ing to the shell and so must be escaped at least once more. See Spe- cial characters. QUERIES- One of hledger's strengths is being able to quickly report on precise- subsets of your data. Most commands accept an optional query expres-- sion, written as arguments after the command name, to filter the data- by date, account name or other criteria. The syntax is similar to a+ One of hledger's strengths is being able to quickly report on precise+ subsets of your data. Most commands accept an optional query expres-+ sion, written as arguments after the command name, to filter the data+ by date, account name or other criteria. The syntax is similar to a web search: one or more space-separated search terms, quotes to enclose- whitespace, prefixes to match specific fields, a not: prefix to negate+ whitespace, prefixes to match specific fields, a not: prefix to negate the match. - We do not yet support arbitrary boolean combinations of search terms;- instead most commands show transactions/postings/accounts which match+ We do not yet support arbitrary boolean combinations of search terms;+ instead most commands show transactions/postings/accounts which match (or negatively match): o any of the description terms AND@@ -725,31 +751,31 @@ o match all the other terms. - The following kinds of search terms can be used. Remember these can+ The following kinds of search terms can be used. Remember these can also be prefixed with not:, eg to exclude a particular subaccount. REGEX, acct:REGEX- match account names by this regular expression. (With no pre-+ match account names by this regular expression. (With no pre- fix, acct: is assumed.) same as above amt:N, amt:<N, amt:<=N, amt:>N, amt:>=N- match postings with a single-commodity amount that is equal to,- less than, or greater than N. (Multi-commodity amounts are not+ match postings with a single-commodity amount that is equal to,+ less than, or greater than N. (Multi-commodity amounts are not tested, and will always match.) The comparison has two modes: if N is preceded by a + or - sign (or is 0), the two signed numbers- are compared. Otherwise, the absolute magnitudes are compared,+ are compared. Otherwise, the absolute magnitudes are compared, ignoring sign. code:REGEX match by transaction code (eg check number) cur:REGEX- match postings or transactions including any amounts whose cur-- rency/commodity symbol is fully matched by REGEX. (For a par-+ match postings or transactions including any amounts whose cur-+ rency/commodity symbol is fully matched by REGEX. (For a par- tial match, use .*REGEX.*). Note, to match characters which are regex-significant, like the dollar sign ($), you need to prepend- \. And when using the command line you need to add one more+ \. And when using the command line you need to add one more level of quoting to hide it from the shell, so eg do: hledger print cur:'\$' or hledger print cur:\\$. @@ -758,20 +784,20 @@ date:PERIODEXPR match dates within the specified period. PERIODEXPR is a period- expression (with no report interval). Examples: date:2016,- date:thismonth, date:2000/2/1-2/15, date:lastweek-. If the- --date2 command line flag is present, this matches secondary+ expression (with no report interval). Examples: date:2016,+ date:thismonth, date:2000/2/1-2/15, date:lastweek-. If the+ --date2 command line flag is present, this matches secondary dates instead. date2:PERIODEXPR match secondary dates within the specified period. depth:N- match (or display, depending on command) accounts at or above+ match (or display, depending on command) accounts at or above this depth note:REGEX- match transaction notes (part of description right of |, or+ match transaction notes (part of description right of |, or whole description when there's no |) payee:REGEX@@ -785,38 +811,38 @@ match unmarked, pending, or cleared transactions respectively tag:REGEX[=REGEX]- match by tag name, and optionally also by tag value. Note a- tag: query is considered to match a transaction if it matches- any of the postings. Also remember that postings inherit the+ match by tag name, and optionally also by tag value. Note a+ tag: query is considered to match a transaction if it matches+ any of the postings. Also remember that postings inherit the tags of their parent transaction. The following special search term is used automatically in hledger-web, only: inacct:ACCTNAME- tells hledger-web to show the transaction register for this+ tells hledger-web to show the transaction register for this account. Can be filtered further with acct etc. Some of these can also be expressed as command-line options (eg depth:2- is equivalent to --depth 2). Generally you can mix options and query- arguments, and the resulting query will be their intersection (perhaps+ is equivalent to --depth 2). Generally you can mix options and query+ arguments, and the resulting query will be their intersection (perhaps excluding the -p/--period option). COMMANDS- hledger provides a number of subcommands; hledger with no arguments+ hledger provides a number of subcommands; hledger with no arguments shows a list. If you install additional hledger-* packages, or if you put programs or- scripts named hledger-NAME in your PATH, these will also be listed as+ scripts named hledger-NAME in your PATH, these will also be listed as subcommands. - Run a subcommand by writing its name as first argument (eg+ Run a subcommand by writing its name as first argument (eg hledger incomestatement). You can also write one of the standard short- aliases displayed in parentheses in the command list (hledger b), or+ aliases displayed in parentheses in the command list (hledger b), or any any unambiguous prefix of a command name (hledger inc). - Here are all the builtin commands in alphabetical order. See also- hledger for a more organised command list, and hledger CMD -h for+ Here are all the builtin commands in alphabetical order. See also+ hledger for a more organised command list, and hledger CMD -h for detailed command help. accounts@@ -834,12 +860,12 @@ --drop=N in flat mode: omit N leading account name parts - This command lists account names, either declared with account direc-- tives (-declared), posted to (-used), or both (default). With query- arguments, only matched account names and account names referenced by- matched postings are shown. It shows a flat list by default. With- --tree, it uses indentation to show the account hierarchy. In flat- mode you can add --drop N to omit the first few account name compo-+ This command lists account names, either declared with account direc-+ tives (-declared), posted to (-used), or both (default). With query+ arguments, only matched account names and account names referenced by+ matched postings are shown. It shows a flat list by default. With+ --tree, it uses indentation to show the account hierarchy. In flat+ mode you can add --drop N to omit the first few account name compo- nents. Account names can be depth-clipped with --depth N or depth:N. Examples:@@ -882,8 +908,8 @@ activity Show an ascii barchart of posting counts per interval. - The activity command displays an ascii histogram showing transaction- counts by day, week, month or other reporting interval (by day is the+ The activity command displays an ascii histogram showing transaction+ counts by day, week, month or other reporting interval (by day is the default). With query arguments, it counts only matched transactions. $ hledger activity --quarterly@@ -896,24 +922,24 @@ Prompt for transactions and add them to the journal. --no-new-accounts- don't allow creating new accounts; helps prevent typos when+ don't allow creating new accounts; helps prevent typos when entering account names - Many hledger users edit their journals directly with a text editor, or- generate them from CSV. For more interactive data entry, there is the- add command, which prompts interactively on the console for new trans-- actions, and appends them to the journal file (if there are multiple+ Many hledger users edit their journals directly with a text editor, or+ generate them from CSV. For more interactive data entry, there is the+ add command, which prompts interactively on the console for new trans-+ actions, and appends them to the journal file (if there are multiple -f FILE options, the first file is used.) Existing transactions are not- changed. This is the only hledger command that writes to the journal+ changed. This is the only hledger command that writes to the journal file. To use it, just run hledger add and follow the prompts. You can add as- many transactions as you like; when you are finished, enter . or press+ many transactions as you like; when you are finished, enter . or press control-d or control-c to exit. Features: - o add tries to provide useful defaults, using the most similar recent+ o add tries to provide useful defaults, using the most similar recent transaction (by description) as a template. o You can also set the initial defaults with command line arguments.@@ -921,20 +947,20 @@ o Readline-style edit keys can be used during data entry. o The tab key will auto-complete whenever possible - accounts, descrip-- tions, dates (yesterday, today, tomorrow). If the input area is+ tions, dates (yesterday, today, tomorrow). If the input area is empty, it will insert the default value. - o If the journal defines a default commodity, it will be added to any+ o If the journal defines a default commodity, it will be added to any bare numbers entered. o A parenthesised transaction code may be entered following a date. o Comments and tags may be entered following a description or amount. - o If you make a mistake, enter < at any prompt to restart the transac-+ o If you make a mistake, enter < at any prompt to restart the transac- tion. - o Input prompts are displayed in a different colour when the terminal+ o Input prompts are displayed in a different colour when the terminal supports it. Example (see the tutorial for a detailed explanation):@@ -971,7 +997,7 @@ show balance change in each period (default) --cumulative- show balance change accumulated across periods (in multicolumn+ show balance change accumulated across periods (in multicolumn reports) -H --historical@@ -1006,14 +1032,14 @@ select the output format. Supported formats: txt, csv, html. -o FILE --output-file=FILE- write output to FILE. A file extension matching one of the+ write output to FILE. A file extension matching one of the above formats selects that format. --pretty-tables use unicode to display prettier tables. --sort-amount- sort by amount instead of account code/name (in flat mode).+ sort by amount instead of account code/name (in flat mode). With multiple columns, sorts by the row total, or by row average if that is displayed. @@ -1021,36 +1047,36 @@ display all amounts with reversed sign --budget- show performance compared to budget goals defined by periodic+ show performance compared to budget goals defined by periodic transactions --show-unbudgeted with -budget, show unbudgeted accounts also The balance command is hledger's most versatile command. Note, despite- the name, it is not always used for showing real-world account bal-- ances; the more accounting-aware balancesheet and incomestatement may+ the name, it is not always used for showing real-world account bal-+ ances; the more accounting-aware balancesheet and incomestatement may be more convenient for that. By default, it displays all accounts, and each account's change in bal- ance during the entire period of the journal. Balance changes are cal-- culated by adding up the postings in each account. You can limit the- postings matched, by a query, to see fewer accounts, changes over a+ culated by adding up the postings in each account. You can limit the+ postings matched, by a query, to see fewer accounts, changes over a different time period, changes from only cleared transactions, etc. If you include an account's complete history of postings in the report,- the balance change is equivalent to the account's current ending bal-- ance. For a real-world account, typically you won't have all transac-+ the balance change is equivalent to the account's current ending bal-+ ance. For a real-world account, typically you won't have all transac- tions in the journal; instead you'll have all transactions after a cer-- tain date, and an "opening balances" transaction setting the correct- starting balance on that date. Then the balance command will show- real-world account balances. In some cases the -H/-historical flag is+ tain date, and an "opening balances" transaction setting the correct+ starting balance on that date. Then the balance command will show+ real-world account balances. In some cases the -H/-historical flag is used to ensure this (more below). The balance command can produce several styles of report: Classic balance report- This is the original balance report, as found in Ledger. It usually+ This is the original balance report, as found in Ledger. It usually looks like this: $ hledger balance@@ -1067,23 +1093,23 @@ -------------------- 0 - By default, accounts are displayed hierarchically, with subaccounts- indented below their parent. At each level of the tree, accounts are- sorted by account code if any, then by account name. Or with+ By default, accounts are displayed hierarchically, with subaccounts+ indented below their parent. At each level of the tree, accounts are+ sorted by account code if any, then by account name. Or with -S/--sort-amount, by their balance amount. "Boring" accounts, which contain a single interesting subaccount and no- balance of their own, are elided into the following line for more com-- pact output. (Eg above, the "liabilities" account.) Use --no-elide to+ balance of their own, are elided into the following line for more com-+ pact output. (Eg above, the "liabilities" account.) Use --no-elide to prevent this. - Account balances are "inclusive" - they include the balances of any+ Account balances are "inclusive" - they include the balances of any subaccounts. - Accounts which have zero balance (and no non-zero subaccounts) are+ Accounts which have zero balance (and no non-zero subaccounts) are omitted. Use -E/--empty to show them. - A final total is displayed by default; use -N/--no-total to suppress+ A final total is displayed by default; use -N/--no-total to suppress it, eg: $ hledger balance -p 2008/6 expenses --no-total@@ -1092,7 +1118,7 @@ $1 supplies Customising the classic balance report- You can customise the layout of classic balance reports with --for-+ You can customise the layout of classic balance reports with --for- mat FMT: $ hledger balance --format "%20(account) %12(total)"@@ -1110,7 +1136,7 @@ 0 The FMT format string (plus a newline) specifies the formatting applied- to each account/balance pair. It may contain any suitable text, with+ to each account/balance pair. It may contain any suitable text, with data fields interpolated like so: %[MIN][.MAX](FIELDNAME)@@ -1121,14 +1147,14 @@ o FIELDNAME must be enclosed in parentheses, and can be one of: - o depth_spacer - a number of spaces equal to the account's depth, or+ o depth_spacer - a number of spaces equal to the account's depth, or if MIN is specified, MIN * depth spaces. o account - the account's name o total - the account's balance/posted total, right justified - Also, FMT can begin with an optional prefix to control how multi-com-+ Also, FMT can begin with an optional prefix to control how multi-com- modity amounts are rendered: o %_ - render on multiple lines, bottom-aligned (the default)@@ -1137,7 +1163,7 @@ o %, - render on one line, comma-separated - There are some quirks. Eg in one-line mode, %(depth_spacer) has no+ There are some quirks. Eg in one-line mode, %(depth_spacer) has no effect, instead %(account) has indentation built in. Experimentation may be needed to get pleasing results. @@ -1145,14 +1171,14 @@ o %(total) - the account's total - o %-20.20(account) - the account's name, left justified, padded to 20+ o %-20.20(account) - the account's name, left justified, padded to 20 characters and clipped at 20 characters - o %,%-50(account) %25(total) - account name padded to 50 characters,- total padded to 20 characters, with multiple commodities rendered on+ o %,%-50(account) %25(total) - account name padded to 50 characters,+ total padded to 20 characters, with multiple commodities rendered on one line - o %20(total) %2(depth_spacer)%-(account) - the default format for the+ o %20(total) %2(depth_spacer)%-(account) - the default format for the single-column balance report Colour support@@ -1163,9 +1189,9 @@ o the output is not being redirected or piped anywhere Flat mode- To see a flat list instead of the default hierarchical display, use- --flat. In this mode, accounts (unless depth-clipped) show their full- names and "exclusive" balance, excluding any subaccount balances. In+ To see a flat list instead of the default hierarchical display, use+ --flat. In this mode, accounts (unless depth-clipped) show their full+ names and "exclusive" balance, excluding any subaccount balances. In this mode, you can also use --drop N to omit the first few account name components. @@ -1174,8 +1200,8 @@ $1 supplies Depth limited balance reports- With --depth N or depth:N or just -N, balance reports show accounts- only to the specified numeric depth. This is very useful to summarise+ With --depth N or depth:N or just -N, balance reports show accounts+ only to the specified numeric depth. This is very useful to summarise a complex set of accounts and get an overview. $ hledger balance -N -1@@ -1188,17 +1214,17 @@ inclusive balances at the depth limit. Multicolumn balance report- Multicolumn or tabular balance reports are a very useful hledger fea-- ture, and usually the preferred style. They share many of the above- features, but they show the report as a table, with columns represent-- ing time periods. This mode is activated by providing a reporting+ Multicolumn or tabular balance reports are a very useful hledger fea-+ ture, and usually the preferred style. They share many of the above+ features, but they show the report as a table, with columns represent-+ ing time periods. This mode is activated by providing a reporting interval. - There are three types of multicolumn balance report, showing different+ There are three types of multicolumn balance report, showing different information: 1. By default: each column shows the sum of postings in that period, ie- the account's change of balance in that period. This is useful eg+ the account's change of balance in that period. This is useful eg for a monthly income statement: $ hledger balance --quarterly income expenses -E@@ -1213,8 +1239,8 @@ -------------------++--------------------------------- || $-1 $1 0 0 - 2. With --cumulative: each column shows the ending balance for that- period, accumulating the changes across periods, starting from 0 at+ 2. With --cumulative: each column shows the ending balance for that+ period, accumulating the changes across periods, starting from 0 at the report start date: $ hledger balance --quarterly income expenses -E --cumulative@@ -1230,8 +1256,8 @@ || $-1 0 0 0 3. With --historical/-H: each column shows the actual historical ending- balance for that period, accumulating the changes across periods,- starting from the actual balance at the report start date. This is+ balance for that period, accumulating the changes across periods,+ starting from the actual balance at the report start date. This is useful eg for a multi-period balance sheet, and when you are showing only the data after a certain start date: @@ -1247,26 +1273,26 @@ ----------------------++------------------------------------- || 0 0 0 - Multicolumn balance reports display accounts in flat mode by default;+ Multicolumn balance reports display accounts in flat mode by default; to see the hierarchy, use --tree. - With a reporting interval (like --quarterly above), the report- start/end dates will be adjusted if necessary so that they encompass+ With a reporting interval (like --quarterly above), the report+ start/end dates will be adjusted if necessary so that they encompass the displayed report periods. This is so that the first and last peri- ods will be "full" and comparable to the others. - The -E/--empty flag does two things in multicolumn balance reports:- first, the report will show all columns within the specified report- period (without -E, leading and trailing columns with all zeroes are- not shown). Second, all accounts which existed at the report start- date will be considered, not just the ones with activity during the+ The -E/--empty flag does two things in multicolumn balance reports:+ first, the report will show all columns within the specified report+ period (without -E, leading and trailing columns with all zeroes are+ not shown). Second, all accounts which existed at the report start+ date will be considered, not just the ones with activity during the report period (use -E to include low-activity accounts which would oth- erwise would be omitted). The -T/--row-total flag adds an additional column showing the total for each row. - The -A/--average flag adds a column showing the average value in each+ The -A/--average flag adds a column showing the average value in each row. Here's an example of all three:@@ -1290,20 +1316,20 @@ Limitations: In multicolumn reports the -V/--value flag uses the market price on the- report end date, for all columns (not the price on each column's end+ report end date, for all columns (not the price on each column's end date). - Eliding of boring parent accounts in tree mode, as in the classic bal-+ Eliding of boring parent accounts in tree mode, as in the classic bal- ance report, is not yet supported in multicolumn reports. Budget report- With --budget, extra columns are displayed showing budget goals for- each account and period, if any. Budget goals are defined by periodic- transactions. This is very useful for comparing planned and actual+ With --budget, extra columns are displayed showing budget goals for+ each account and period, if any. Budget goals are defined by periodic+ transactions. This is very useful for comparing planned and actual income, expenses, time usage, etc. -budget is most often combined with a report interval. - For example, you can take average monthly expenses in the common+ For example, you can take average monthly expenses in the common expense categories to construct a minimal monthly budget: ;; Budget@@ -1346,7 +1372,7 @@ ----------------------++------------------------------------------------- || 0 0 - By default, only accounts with budget goals during the report period+ By default, only accounts with budget goals during the report period are shown. --show-unbudgeted shows unbudgeted accounts as well. Top-level accounts with no budget goals anywhere below them are grouped under <unbudgeted>.@@ -1367,22 +1393,22 @@ ----------------------++------------------------------------------------- || 0 0 - Note, the -S/--sort-amount flag is not yet fully supported with --bud-+ Note, the -S/--sort-amount flag is not yet fully supported with --bud- get. For more examples, see Budgeting and Forecasting. Output format- The balance command supports output destination and output format+ The balance command supports output destination and output format selection. balancesheet This command displays a simple balance sheet, showing historical ending- balances of asset and liability accounts (ignoring any report begin- date). It assumes that these accounts are under a top-level asset or- liability account (case insensitive, plural forms also allowed). Note- this report shows all account balances with normal positive sign (like- conventional financial statements, unlike balance/print/register)+ balances of asset and liability accounts (ignoring any report begin+ date). It assumes that these accounts are under a top-level asset or+ liability account (case insensitive, plural forms also allowed). Note+ this report shows all account balances with normal positive sign (like+ conventional financial statements, unlike balance/print/register) (experimental). (bs) --change@@ -1390,7 +1416,7 @@ balances --cumulative- show balance change accumulated across periods (in multicolumn+ show balance change accumulated across periods (in multicolumn reports), instead of historical ending balances -H --historical@@ -1446,16 +1472,16 @@ 0 With a reporting interval, multiple columns will be shown, one for each- report period. As with multicolumn balance reports, you can alter the- report mode with --change/--cumulative/--historical. Normally bal-- ancesheet shows historical ending balances, which is what you need for+ report period. As with multicolumn balance reports, you can alter the+ report mode with --change/--cumulative/--historical. Normally bal-+ ancesheet shows historical ending balances, which is what you need for a balance sheet; note this means it ignores report begin dates. - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. balancesheetequity- Just like balancesheet, but also reports Equity (which it assumes is+ Just like balancesheet, but also reports Equity (which it assumes is under a top-level equity account). Example:@@ -1485,10 +1511,10 @@ 0 cashflow- This command displays a simple cashflow statement, showing changes in- "cash" accounts. It assumes that these accounts are under a top-level- asset account (case insensitive, plural forms also allowed) and do not- contain receivable or A/R in their name. Note this report shows all+ This command displays a simple cashflow statement, showing changes in+ "cash" accounts. It assumes that these accounts are under a top-level+ asset account (case insensitive, plural forms also allowed) and do not+ contain receivable or A/R in their name. Note this report shows all account balances with normal positive sign (like conventional financial statements, unlike balance/print/register) (experimental). (cf) @@ -1496,7 +1522,7 @@ show balance change in each period (default) --cumulative- show balance change accumulated across periods (in multicolumn+ show balance change accumulated across periods (in multicolumn reports), instead of changes during periods -H --historical@@ -1547,38 +1573,38 @@ $-1 With a reporting interval, multiple columns will be shown, one for each- report period. Normally cashflow shows changes in assets per period,- though as with multicolumn balance reports you can alter the report+ report period. Normally cashflow shows changes in assets per period,+ though as with multicolumn balance reports you can alter the report mode with --change/--cumulative/--historical. - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. check-dates- Check that transactions are sorted by increasing date. With a query,+ Check that transactions are sorted by increasing date. With a query, only matched transactions' dates are checked. check-dupes- Report account names having the same leaf but different prefixes. An+ Report account names having the same leaf but different prefixes. An example: http://stefanorodighiero.net/software/hledger-dupes.html close- Print closing/opening transactions that bring some or all account bal-- ances to zero and back. Can be useful for bringing asset/liability+ Print closing/opening transactions that bring some or all account bal-+ ances to zero and back. Can be useful for bringing asset/liability balances across file boundaries, or for closing out income/expenses for- a period. This was formerly called "equity", as in Ledger, and that+ a period. This was formerly called "equity", as in Ledger, and that alias is also accepted. See close -help for more. help Show any of the hledger manuals. - The help command displays any of the main hledger manuals, in one of- several ways. Run it with no argument to list the manuals, or provide+ The help command displays any of the main hledger manuals, in one of+ several ways. Run it with no argument to list the manuals, or provide a full or partial manual name to select one. - hledger manuals are available in several formats. hledger help will- use the first of these display methods that it finds: info, man,- $PAGER, less, stdout (or when non-interactive, just stdout). You can+ hledger manuals are available in several formats. hledger help will+ use the first of these display methods that it finds: info, man,+ $PAGER, less, stdout (or when non-interactive, just stdout). You can force a particular viewer with the --info, --man, --pager, --cat flags. $ hledger help@@ -1602,7 +1628,7 @@ ... import- Read new transactions added to each FILE since last run, and add them+ Read new transactions added to each FILE since last run, and add them to the main journal file. --dry-run@@ -1612,28 +1638,28 @@ each one. So eg to add new transactions from all CSV files to the main journal, it's just: hledger import *.csv - New transactions are detected in the same way as print -new: by assum-+ New transactions are detected in the same way as print -new: by assum- ing transactions are always added to the input files in increasing date order, and by saving .latest.FILE state files. - The -dry-run output is in journal format, so you can filter it, eg to+ The -dry-run output is in journal format, so you can filter it, eg to see only uncategorised transactions: $ hledger import --dry ... | hledger -f- print unknown --ignore-assertions incomestatement- This command displays a simple income statement, showing revenues and- expenses during a period. It assumes that these accounts are under a- top-level revenue or income or expense account (case insensitive, plu-- ral forms also allowed). Note this report shows all account balances- with normal positive sign (like conventional financial statements,+ This command displays a simple income statement, showing revenues and+ expenses during a period. It assumes that these accounts are under a+ top-level revenue or income or expense account (case insensitive, plu-+ ral forms also allowed). Note this report shows all account balances+ with normal positive sign (like conventional financial statements, unlike balance/print/register) (experimental). (is) --change show balance change in each period (default) --cumulative- show balance change accumulated across periods (in multicolumn+ show balance change accumulated across periods (in multicolumn reports), instead of changes during periods -H --historical@@ -1667,8 +1693,8 @@ --sort-amount sort by amount instead of account code/name - This command displays a simple income statement. It currently assumes- that you have top-level accounts named income (or revenue) and expense+ This command displays a simple income statement. It currently assumes+ that you have top-level accounts named income (or revenue) and expense (plural forms also allowed.) $ hledger incomestatement@@ -1693,11 +1719,11 @@ 0 With a reporting interval, multiple columns will be shown, one for each- report period. Normally incomestatement shows revenues/expenses per- period, though as with multicolumn balance reports you can alter the+ report period. Normally incomestatement shows revenues/expenses per+ period, though as with multicolumn balance reports you can alter the report mode with --change/--cumulative/--historical. - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. prices@@ -1707,7 +1733,7 @@ Show transactions from the journal. Aliases: p, txns. -m STR --match=STR- show the transaction whose description is most similar to STR,+ show the transaction whose description is most similar to STR, and is most recent --new show only newer-dated transactions added in each file since last@@ -1720,7 +1746,7 @@ select the output format. Supported formats: txt, csv. -o FILE --output-file=FILE- write output to FILE. A file extension matching one of the+ write output to FILE. A file extension matching one of the above formats selects that format. $ hledger print@@ -1751,39 +1777,39 @@ it does not preserve directives or inter-transaction comments Normally, the journal entry's explicit or implicit amount style is pre-- served. Ie when an amount is omitted in the journal, it will be omit-- ted in the output. You can use the -x/--explicit flag to make all+ served. Ie when an amount is omitted in the journal, it will be omit-+ ted in the output. You can use the -x/--explicit flag to make all amounts explicit, which can be useful for troubleshooting or for making your journal more readable and robust against data entry errors. Note,- -x will cause postings with a multi-commodity amount (these can arise- when a multi-commodity transaction has an implicit amount) will be- split into multiple single-commodity postings, for valid journal out-+ -x will cause postings with a multi-commodity amount (these can arise+ when a multi-commodity transaction has an implicit amount) will be+ split into multiple single-commodity postings, for valid journal out- put. - With -B/--cost, amounts with transaction prices are converted to cost+ With -B/--cost, amounts with transaction prices are converted to cost using that price. This can be used for troubleshooting. - With -m/--match and a STR argument, print will show at most one trans-- action: the one one whose description is most similar to STR, and is- most recent. STR should contain at least two characters. If there is+ With -m/--match and a STR argument, print will show at most one trans-+ action: the one one whose description is most similar to STR, and is+ most recent. STR should contain at least two characters. If there is no similar-enough match, no transaction will be shown. With --new, for each FILE being read, hledger reads (and writes) a spe-- cial state file (.latest.FILE in the same directory), containing the- latest transaction date(s) that were seen last time FILE was read.- When this file is found, only transactions with newer dates (and new- transactions on the latest date) are printed. This is useful for- ignoring already-seen entries in import data, such as downloaded CSV+ cial state file (.latest.FILE in the same directory), containing the+ latest transaction date(s) that were seen last time FILE was read.+ When this file is found, only transactions with newer dates (and new+ transactions on the latest date) are printed. This is useful for+ ignoring already-seen entries in import data, such as downloaded CSV files. Eg: $ hledger -f bank1.csv print --new # shows transactions added since last print --new on this file - This assumes that transactions added to FILE always have same or- increasing dates, and that transactions on the same day do not get+ This assumes that transactions added to FILE always have same or+ increasing dates, and that transactions on the same day do not get reordered. See also the import command. - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. Here's an example of print's CSV output: $ hledger print -Ocsv@@ -1800,20 +1826,20 @@ "5","2008/12/31","","*","","pay off","","liabilities:debts","1","$","","1","","" "5","2008/12/31","","*","","pay off","","assets:bank:checking","-1","$","1","","","" - o There is one CSV record per posting, with the parent transaction's+ o There is one CSV record per posting, with the parent transaction's fields repeated. o The "txnidx" (transaction index) field shows which postings belong to- the same transaction. (This number might change if transactions are- reordered within the file, files are parsed/included in a different+ the same transaction. (This number might change if transactions are+ reordered within the file, files are parsed/included in a different order, etc.) - o The amount is separated into "commodity" (the symbol) and "amount"+ o The amount is separated into "commodity" (the symbol) and "amount" (numeric quantity) fields. o The numeric amount is repeated in either the "credit" or "debit" col-- umn, for convenience. (Those names are not accurate in the account-- ing sense; it just puts negative amounts under credit and zero or+ umn, for convenience. (Those names are not accurate in the account-+ ing sense; it just puts negative amounts under credit and zero or greater amounts under debit.) print-unique@@ -1826,7 +1852,7 @@ show running total from report start date (default) -H --historical- show historical running total/balance (includes postings before+ show historical running total/balance (includes postings before report start date) -A --average@@ -1837,18 +1863,18 @@ show postings' siblings instead -w N --width=N- set output width (default: terminal width or COLUMNS. -wN,M+ set output width (default: terminal width or COLUMNS. -wN,M sets description width as well) -O FMT --output-format=FMT select the output format. Supported formats: txt, csv. -o FILE --output-file=FILE- write output to FILE. A file extension matching one of the+ write output to FILE. A file extension matching one of the above formats selects that format. The register command displays postings, one per line, and their running- total. This is typically used with a query selecting a particular+ total. This is typically used with a query selecting a particular account, to see that account's activity: $ hledger register checking@@ -1857,8 +1883,8 @@ 2008/06/02 save assets:bank:checking $-1 $1 2008/12/31 pay off assets:bank:checking $-1 0 - The --historical/-H flag adds the balance from any undisplayed prior- postings to the running total. This is useful when you want to see+ The --historical/-H flag adds the balance from any undisplayed prior+ postings to the running total. This is useful when you want to see only recent activity, with a historically accurate running balance: $ hledger register checking -b 2008/6 --historical@@ -1868,23 +1894,23 @@ The --depth option limits the amount of sub-account detail displayed. - The --average/-A flag shows the running average posting amount instead+ The --average/-A flag shows the running average posting amount instead of the running total (so, the final number displayed is the average for- the whole report period). This flag implies --empty (see below). It- is affected by --historical. It works best when showing just one+ the whole report period). This flag implies --empty (see below). It+ is affected by --historical. It works best when showing just one account and one commodity. - The --related/-r flag shows the other postings in the transactions of+ The --related/-r flag shows the other postings in the transactions of the postings which would normally be shown. - With a reporting interval, register shows summary postings, one per+ With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account: $ hledger register --monthly income 2008/01 income:salary $-1 $-1 2008/06 income:gifts $-1 $-2 - Periods with no activity, and summary postings with a zero amount, are+ Periods with no activity, and summary postings with a zero amount, are not shown by default; use the --empty/-E flag to see them: $ hledger register --monthly income -E@@ -1901,7 +1927,7 @@ 2008/11 0 $-2 2008/12 0 $-2 - Often, you'll want to see just one line per interval. The --depth+ Often, you'll want to see just one line per interval. The --depth option helps with this, causing subaccounts to be aggregated: $ hledger register --monthly assets --depth 1h@@ -1909,18 +1935,18 @@ 2008/06 assets $-1 0 2008/12 assets $-1 $-1 - Note when using report intervals, if you specify start/end dates these- will be adjusted outward if necessary to contain a whole number of- intervals. This ensures that the first and last intervals are full+ Note when using report intervals, if you specify start/end dates these+ will be adjusted outward if necessary to contain a whole number of+ intervals. This ensures that the first and last intervals are full length and comparable to the others in the report. Custom register output- register uses the full terminal width by default, except on windows.- You can override this by setting the COLUMNS environment variable (not+ register uses the full terminal width by default, except on windows.+ You can override this by setting the COLUMNS environment variable (not a bash shell variable) or by using the --width/-w option. - The description and account columns normally share the space equally- (about half of (width - 40) each). You can adjust this by adding a+ The description and account columns normally share the space equally+ (about half of (width - 40) each). You can adjust this by adding a description width as part of -width's argument, comma-separated: --width W,D . Here's a diagram: @@ -1937,12 +1963,12 @@ $ hledger reg -w 100,40 # set overall width 100, description width 40 $ hledger reg -w $COLUMNS,40 # use terminal width, and set description width - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. register-match Print the one posting whose transaction description is closest to DESC,- in the style of the register command. Helps ledger-autosync detect+ in the style of the register command. Helps ledger-autosync detect already-seen transactions when importing. rewrite@@ -1952,7 +1978,7 @@ Show some journal statistics. -o FILE --output-file=FILE- write output to FILE. A file extension matching one of the+ write output to FILE. A file extension matching one of the above formats selects that format. $ hledger stats@@ -1967,16 +1993,16 @@ Accounts : 8 (depth 3) Commodities : 1 ($) - The stats command displays summary information for the whole journal,- or a matched part of it. With a reporting interval, it shows a report+ The stats command displays summary information for the whole journal,+ or a matched part of it. With a reporting interval, it shows a report for each report period. - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. tags- List all the tag names used in the journal. With a TAGREGEX argument,- only tag names matching the regular expression (case insensitive) are+ List all the tag names used in the journal. With a TAGREGEX argument,+ only tag names matching the regular expression (case insensitive) are shown. With additional QUERY arguments, only transactions matching the query are considered. @@ -1986,34 +2012,34 @@ $ hledger test Cases: 74 Tried: 74 Errors: 0 Failures: 0 - This command runs hledger's built-in unit tests and displays a quick+ This command runs hledger's built-in unit tests and displays a quick report. With a regular expression argument, it selects only tests with matching names. It's mainly used in development, but it's also nice to be able to check your hledger executable for smoke at any time. ADD-ON COMMANDS- hledger also searches for external add-on commands, and will include+ hledger also searches for external add-on commands, and will include these in the commands list. These are programs or scripts in your PATH- whose name starts with hledger- and ends with a recognised file exten-+ whose name starts with hledger- and ends with a recognised file exten- sion (currently: no extension, bat,com,exe, hs,lhs,pl,py,rb,rkt,sh). - Add-ons can be invoked like any hledger command, but there are a few+ Add-ons can be invoked like any hledger command, but there are a few things to be aware of. Eg if the hledger-web add-on is installed, o hledger -h web shows hledger's help, while hledger web -h shows hledger-web's help. - o Flags specific to the add-on must have a preceding -- to hide them- from hledger. So hledger web --serve --port 9000 will be rejected;+ o Flags specific to the add-on must have a preceding -- to hide them+ from hledger. So hledger web --serve --port 9000 will be rejected; you must use hledger web -- --serve --port 9000. - o You can always run add-ons directly if preferred:+ o You can always run add-ons directly if preferred: hledger-web --serve --port 9000. - Add-ons are a relatively easy way to add local features or experiment- with new ideas. They can be written in any language, but haskell- scripts have a big advantage: they can use the same hledger (and- haskell) library functions that built-in commands do, for command-line+ Add-ons are a relatively easy way to add local features or experiment+ with new ideas. They can be written in any language, but haskell+ scripts have a big advantage: they can use the same hledger (and+ haskell) library functions that built-in commands do, for command-line options, journal parsing, reporting, etc. Here are some hledger add-ons available:@@ -2031,7 +2057,7 @@ hledger-web provides a simple web interface. Third party add-ons- These are maintained separately, and usually updated shortly after a+ These are maintained separately, and usually updated shortly after a hledger release. diff@@ -2039,7 +2065,7 @@ journal file and another. iadd- hledger-iadd is a curses-style, more interactive replacement for the+ hledger-iadd is a curses-style, more interactive replacement for the add command. interest@@ -2047,19 +2073,19 @@ ing to various schemes. irr- hledger-irr calculates the internal rate of return of an investment+ hledger-irr calculates the internal rate of return of an investment account. Experimental add-ons- These are available in source form in the hledger repo's bin/ direc-+ These are available in source form in the hledger repo's bin/ direc- tory; installing them is pretty easy. They may be less mature and doc-- umented than built-in commands. Reading and tweaking these is a good+ umented than built-in commands. Reading and tweaking these is a good way to start making your own! autosync hledger-autosync is a symbolic link for easily running ledger-autosync,- if installed. ledger-autosync does deduplicating conversion of OFX- data and some CSV formats, and can also download the data if your bank+ if installed. ledger-autosync does deduplicating conversion of OFX+ data and some CSV formats, and can also download the data if your bank offers OFX Direct Connect. chart@@ -2069,21 +2095,21 @@ hledger-check.hs checks more powerful account balance assertions. ENVIRONMENT- COLUMNS The screen width used by the register command. Default: the+ COLUMNS The screen width used by the register command. Default: the full terminal width. LEDGER_FILE The journal file path when not specified with -f. Default:- ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-+ ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- nal). FILES- Reads data from one or more files in hledger journal, timeclock, time-- dot, or CSV format specified with -f, or $LEDGER_FILE, or- $HOME/.hledger.journal (on windows, perhaps+ Reads data from one or more files in hledger journal, timeclock, time-+ dot, or CSV format specified with -f, or $LEDGER_FILE, or+ $HOME/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.journal). BUGS- The need to precede addon command options with -- when invoked from+ The need to precede addon command options with -- when invoked from hledger is awkward. When input data contains non-ascii characters, a suitable system locale@@ -2096,33 +2122,33 @@ In a Cygwin/MSYS/Mintty window, the tab key is not supported in hledger add. - Not all of Ledger's journal file syntax is supported. See file format+ Not all of Ledger's journal file syntax is supported. See file format differences. - On large data files, hledger is slower and uses more memory than+ On large data files, hledger is slower and uses more memory than Ledger. TROUBLESHOOTING- Here are some issues you might encounter when you run hledger (and- remember you can also seek help from the IRC channel, mail list or bug+ Here are some issues you might encounter when you run hledger (and+ remember you can also seek help from the IRC channel, mail list or bug tracker): Successfully installed, but "No command `hledger' found" stack and cabal install binaries into a special directory, which should- be added to your PATH environment variable. Eg on unix-like systems,+ be added to your PATH environment variable. Eg on unix-like systems, that is ~/.local/bin and ~/.cabal/bin respectively. I set a custom LEDGER_FILE, but hledger is still using the default file- LEDGER_FILE should be a real environment variable, not just a shell- variable. The command env | grep LEDGER_FILE should show it. You may+ LEDGER_FILE should be a real environment variable, not just a shell+ variable. The command env | grep LEDGER_FILE should show it. You may need to use export. Here's an explanation. - "Illegal byte sequence" or "Invalid or incomplete multibyte or wide+ "Illegal byte sequence" or "Invalid or incomplete multibyte or wide character" errors In order to handle non-ascii letters and symbols (like ), hledger needs an appropriate locale. This is usually configured system-wide; you can also configure it temporarily. The locale may need to be one that sup-- ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always,+ ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always, I'm not sure yet). Here's an example of setting the locale temporarily, on ubuntu@@ -2141,7 +2167,7 @@ $ echo "export LANG=en_US.UTF-8" >>~/.bash_profile $ bash --login - If we preferred to use eg fr_FR.utf8, we might have to install that+ If we preferred to use eg fr_FR.utf8, we might have to install that first: $ apt-get install language-pack-fr@@ -2162,7 +2188,7 @@ REPORTING BUGS- Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel+ Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel or hledger mail list) @@ -2176,7 +2202,7 @@ SEE ALSO- hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),+ hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time- dot(5), ledger(1) @@ -2184,4 +2210,4 @@ -hledger 1.9.1 April 2018 hledger(1)+hledger 1.9.99 June 2018 hledger(1)
embeddedfiles/hledger_csv.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_csv" "5" "April 2018" "hledger 1.9.1" "hledger User Manuals"+.TH "hledger_csv" "5" "June 2018" "hledger 1.9.99" "hledger User Manuals"
embeddedfiles/hledger_csv.info view
@@ -3,8 +3,8 @@ File: hledger_csv.info, Node: Top, Next: CSV RULES, Up: (dir) -hledger_csv(5) hledger 1.9.1-****************************+hledger_csv(5) hledger 1.9.99+***************************** hledger can read CSV (comma-separated value) files as if they were journal files, automatically converting each CSV record into a@@ -317,33 +317,33 @@ Tag Table: Node: Top72-Node: CSV RULES2165-Ref: #csv-rules2273-Node: skip2535-Ref: #skip2629-Node: date-format2801-Ref: #date-format2928-Node: field list3434-Ref: #field-list3571-Node: field assignment4276-Ref: #field-assignment4431-Node: conditional block4935-Ref: #conditional-block5089-Node: include5985-Ref: #include6115-Node: newest-first6346-Ref: #newest-first6460-Node: CSV TIPS6871-Ref: #csv-tips6965-Node: CSV ordering7083-Ref: #csv-ordering7201-Node: CSV accounts7382-Ref: #csv-accounts7520-Node: CSV amounts7774-Ref: #csv-amounts7920-Node: CSV balance assertions8695-Ref: #csv-balance-assertions8877-Node: Reading multiple CSV files9082-Ref: #reading-multiple-csv-files9252+Node: CSV RULES2167+Ref: #csv-rules2275+Node: skip2537+Ref: #skip2631+Node: date-format2803+Ref: #date-format2930+Node: field list3436+Ref: #field-list3573+Node: field assignment4278+Ref: #field-assignment4433+Node: conditional block4937+Ref: #conditional-block5091+Node: include5987+Ref: #include6117+Node: newest-first6348+Ref: #newest-first6462+Node: CSV TIPS6873+Ref: #csv-tips6967+Node: CSV ordering7085+Ref: #csv-ordering7203+Node: CSV accounts7384+Ref: #csv-accounts7522+Node: CSV amounts7776+Ref: #csv-amounts7922+Node: CSV balance assertions8697+Ref: #csv-balance-assertions8879+Node: Reading multiple CSV files9084+Ref: #reading-multiple-csv-files9254 End Tag Table
embeddedfiles/hledger_csv.txt view
@@ -249,4 +249,4 @@ -hledger 1.9.1 April 2018 hledger_csv(5)+hledger 1.9.99 June 2018 hledger_csv(5)
embeddedfiles/hledger_journal.5 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger_journal" "5" "April 2018" "hledger 1.9.1" "hledger User Manuals"+.TH "hledger_journal" "5" "June 2018" "hledger 1.9.99" "hledger User Manuals" @@ -439,8 +439,9 @@ or if there are no such amounts in the journal, a default format is used (like \f[C]$1000.00\f[]). .PP-Price amounts and amounts in D directives usually don't affect amount-format inference, but in some situations they can do so indirectly.+Price amounts and amounts in \f[C]D\f[] directives usually don't affect+amount format inference, but in some situations they can do so+indirectly. (Eg when D's default commodity is applied to a commodity\-less amount, or when an amountless posting is balanced using a price's commodity, or when \-V is used.) If you find this causing problems, set the desired@@ -627,7 +628,6 @@ Note that using balance assignments makes your journal a little less explicit; to know the exact amount posted, you have to run hledger or do the calculations yourself, instead of just reading it.-.SS Prices .SS Transaction prices .PP Within a transaction, you can note an amount's price in another@@ -636,10 +636,10 @@ (in a sale). For example, transaction prices are useful to record purchases of a foreign currency.-.PP-Transaction prices are fixed, and do not change over time.-(Ledger users: Ledger uses a different syntax for fixed prices,-\f[C]{=UNITPRICE}\f[], which hledger currently ignores).+Note transaction prices are fixed at the time of the transaction, and do+not change over time.+See also market prices, which represent prevailing exchange rates on a+certain date. .PP There are several ways to record a transaction price: .IP "1." 3@@ -680,10 +680,13 @@ .fi .RE .PP-Amounts with transaction prices can be displayed in the transaction-price's commodity by using the \f[C]\-B/\-\-cost\f[] flag (except for-#551) (\[lq]B\[rq] is from \[lq]cost Basis\[rq]).-Eg for the above, here is how \-B affects the balance report:+(Ledger users: Ledger uses a different syntax for fixed prices,+\f[C]{=UNITPRICE}\f[], which hledger currently ignores).+.PP+Use the \f[C]\-B/\-\-cost\f[] flag to convert amounts to their+transaction price's commodity, if any.+(mnemonic: \[lq]B\[rq] is from \[lq]cost Basis\[rq], as in Ledger).+Eg here is how \-B affects the balance report for the example above: .IP .nf \f[C]@@ -717,40 +720,6 @@ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ €100\ \ assets:euros \f[] .fi-.SS Market prices-.PP-Market prices are not tied to a particular transaction; they represent-historical exchange rates between two commodities.-(Ledger calls them historical prices.) For example, the prices published-by a stock exchange or the foreign exchange market.-hledger can use these prices to show the market value of things at a-given date, see market value.-.PP-To record market prices, use P directives in the main journal or in an-included file.-Their format is:-.IP-.nf-\f[C]-P\ DATE\ COMMODITYBEINGPRICED\ UNITPRICE-\f[]-.fi-.PP-DATE is a simple date as usual.-COMMODITYBEINGPRICED is the symbol of the commodity being priced.-UNITPRICE is an ordinary amount (symbol and quantity) in a second-commodity, specifying the unit price or conversion rate for the first-commodity in terms of the second, on the given date.-.PP-For example, the following directives say that one euro was worth 1.35-US dollars during 2009, and $1.40 from 2010 onward:-.IP-.nf-\f[C]-P\ 2009/1/1\ €\ $1.35-P\ 2010/1/1\ €\ $1.40-\f[]-.fi .SS Comments .PP Lines in the journal beginning with a semicolon (\f[C];\f[]) or hash@@ -853,6 +822,176 @@ Tags are like Ledger's metadata feature, except hledger's tag values are simple strings. .SS Directives+.PP+A directive is a line in the journal beginning with a special keyword,+that influences how the journal is processed.+hledger's directives are based on a subset of Ledger's, but there are+many differences (and also some differences between hledger versions).+.PP+Directives' behaviour and interactions can get a little bit complex, so+here is a table summarising the directives and their effects, with links+to more detailed docs.+.PP+.TS+tab(@);+lw(7.8n) lw(8.6n) lw(7.0n) lw(27.8n) lw(18.8n).+T{+directive+T}@T{+end directive+T}@T{+subdirectives+T}@T{+purpose+T}@T{+can affect (as of 2018/06)+T}+_+T{+\f[C]account\f[]+T}@T{+T}@T{+any text+T}@T{+declare an account name & optional account code+T}@T{+account code: balance reports (except \f[C]balance\f[] single\-column+mode)+T}+T{+\f[C]alias\f[]+T}@T{+\f[C]end\ aliases\f[]+T}@T{+T}@T{+rewrite account names+T}@T{+following inline/included entries until end of current file or end+directive+T}+T{+\f[C]apply\ account\f[]+T}@T{+\f[C]end\ apply\ account\f[]+T}@T{+T}@T{+prepend a common parent to account names+T}@T{+following inline/included entries until end of current file or end+directive+T}+T{+\f[C]comment\f[]+T}@T{+\f[C]end\ comment\f[]+T}@T{+T}@T{+ignore part of journal+T}@T{+following inline/included entries until end of current file or end+directive+T}+T{+\f[C]commodity\f[]+T}@T{+T}@T{+\f[C]format\f[]+T}@T{+declare a commodity and its number notation & display style+T}@T{+number notation: following entries in that commodity in all files;+display style: amounts of that commodity in reports+T}+T{+\f[C]D\f[]+T}@T{+T}@T{+T}@T{+declare a commodity, number notation & display style for commodityless+amounts+T}@T{+commodity: all commodityless entries in all files; number notation:+following commodityless entries and entries in that commodity in all+files; display style: amounts of that commodity in reports+T}+T{+\f[C]include\f[]+T}@T{+T}@T{+T}@T{+include entries/directives from another file+T}@T{+what the included directives affect+T}+T{+\f[C]P\f[]+T}@T{+T}@T{+T}@T{+declare a market price for a commodity+T}@T{+amounts of that commodity in reports, when \-V is used+T}+T{+\f[C]Y\f[]+T}@T{+T}@T{+T}@T{+declare a year for yearless dates+T}@T{+following inline/included entries until end of current file+T}+.TE+.PP+And some definitions:+.PP+.TS+tab(@);+lw(8.9n) lw(61.1n).+T{+subdirective+T}@T{+optional indented directive or unparsed text lines immediately following+a parent directive+T}+T{+account code+T}@T{+numeric code influencing account display order in most balance reports+T}+T{+number notation+T}@T{+how to interpret numbers when parsing journal entries (the identity of+the decimal separator character).+(Currently each commodity can have its own notation, even in the same+file.)+T}+T{+display style+T}@T{+how to display amounts of a commodity in reports (symbol side and+spacing, digit groups, decimal separator, decimal places)+T}+T{+directive scope+T}@T{+which entries and (when there are multiple files) which files are+affected by a directive+T}+.TE+.PP+As you can see, directives vary in which journal entries and files they+affect, and whether they are focussed on input (parsing) or output+(reports).+Some directives have multiple effects.+.PP+If you have a journal made up of multiple files, or pass multiple \-f+options on the command line, note that directives which affect input+typically last only until the end of their defining file.+This provides more simplicity and predictability, eg reports are not+changed by writing file options in a different order.+It can be surprising at times though. .SS Comment blocks .PP A line containing just \f[C]comment\f[] starts a commented region of the@@ -946,11 +1085,11 @@ digits). .SS Default commodity .PP-The D directive sets a default commodity (and display format), to be-used for amounts without a commodity symbol (ie, plain numbers).+The \f[C]D\f[] directive sets a default commodity (and display format),+to be used for amounts without a commodity symbol (ie, plain numbers). (Note this differs from Ledger's default commodity directive.) The commodity and display format will be applied to all subsequent-commodity\-less amounts, or until the next D directive.+commodity\-less amounts, or until the next \f[C]D\f[] directive. .IP .nf \f[C]@@ -966,6 +1105,41 @@ .PP As with the \f[C]commodity\f[] directive, the amount must always be written with a decimal point.+.SS Market prices+.PP+The \f[C]P\f[] directive declares a market price, which is an exchange+rate between two commodities on a certain date.+(In Ledger, they are called \[lq]historical prices\[rq].) These are+often obtained from a stock exchange, cryptocurrency exchange, or the+foreign exchange market.+.PP+Here is the format:+.IP+.nf+\f[C]+P\ DATE\ COMMODITYA\ COMMODITYBAMOUNT+\f[]+.fi+.IP \[bu] 2+DATE is a simple date+.IP \[bu] 2+COMMODITYA is the symbol of the commodity being priced+.IP \[bu] 2+COMMODITYBAMOUNT is an amount (symbol and quantity) in a second+commodity, giving the price in commodity B of one unit of commodity A.+.PP+These two market price directives say that one euro was worth 1.35 US+dollars during 2009, and $1.40 from 2010 onward:+.IP+.nf+\f[C]+P\ 2009/1/1\ €\ $1.35+P\ 2010/1/1\ €\ $1.40+\f[]+.fi+.PP+The \f[C]\-V/\-\-value\f[] flag can be used to convert reported amounts+to another commodity using these prices. .SS Declaring accounts .PP The \f[C]account\f[] directive predeclares account names.@@ -996,11 +1170,24 @@ \f[] .fi .PP-This affects account display order in reports: accounts with codes are-listed before accounts without codes, in increasing code order.-(Otherwise, accounts are listed alphabetically.) Account codes should be-all numeric digits, unique, and separated from the account name by at-least two spaces (since account names may contain single spaces).+This affects how accounts are sorted in account and balance reports:+accounts with codes are listed before accounts without codes, and in+increasing code order (instead of listing all accounts alphabetically).+Warning, this feature is incomplete; account codes do not yet affect+sort order in+.IP \[bu] 2+the \f[C]accounts\f[] command+.IP \[bu] 2+the \f[C]balance\f[] command's single\-column mode+.IP \[bu] 2+flat mode balance reports (to work around this, declare account codes on+the subaccounts as well).+.IP \[bu] 2+hledger\-web's sidebar+.PP+Account codes should be all numeric digits, unique, and separated from+the account name by at least two spaces (since account names may contain+single spaces). By convention, often the first digit indicates the type of account, as in this numbering scheme and the example above. In future, we might use this to recognize account types.@@ -1021,9 +1208,9 @@ .fi .SS Rewriting accounts .PP-You can define aliases which rewrite your account names (after reading-the journal, before generating reports).-hledger's account aliases can be useful for:+You can define account alias rules which rewrite your account names, or+parts of them, before generating reports.+This can be useful for: .IP \[bu] 2 expanding shorthand account names to their full form, allowing easier data entry and a less verbose journal@@ -1035,6 +1222,10 @@ .IP \[bu] 2 customising reports .PP+Account aliases also rewrite account names in account directives.+They do not affect account names being entered via hledger add or+hledger\-web.+.PP See also Cookbook: Rewrite account names. .SS Basic aliases .PP@@ -1055,7 +1246,7 @@ This affects all entries. It's useful for trying out aliases interactively. .PP-OLD and NEW are full account names.+OLD and NEW are case sensitive full account names. hledger will replace any occurrence of the old account name with the new one. Subaccounts are also affected.@@ -1165,50 +1356,99 @@ .PP Prior to hledger 1.0, legacy \f[C]account\f[] and \f[C]end\f[] spellings were also supported.+.PP+A default parent account also affects account directives.+It does not affect account names being entered via hledger add or+hledger\-web.+If account aliases are present, they are applied after the default+parent account. .SS Periodic transactions .PP-Periodic transaction rules (enabled by \f[C]\-\-forecast\f[] or-\f[C]\-\-budget\f[]) describe recurring transactions.-They look like a transaction where the first line is a tilde-(\f[C]~\f[]) followed by a period expression (mnemonic: \f[C]~\f[] is-like a recurring sine wave):+Periodic transaction rules describe transactions that recur.+They allow you to generate future transactions for forecasting, without+having to write them out explicitly in the journal (with+\f[C]\-\-forecast\f[]).+Secondly, they also can be used to define budget goals (with+\f[C]\-\-budget\f[]).+.PP+A periodic transaction rule looks like a normal journal entry, with the+date replaced by a tilde (\f[C]~\f[]) followed by a period expression+(mnemonic: \f[C]~\f[] looks like a repeating sine wave): .IP .nf \f[C]-~\ weekly-\ \ assets:bank:checking\ \ \ $400\ ;\ paycheck-\ \ income:acme\ inc+~\ monthly+\ \ \ \ expenses:rent\ \ \ \ \ \ \ \ \ \ $2000+\ \ \ \ assets:bank:checking \f[] .fi .PP-Periodic transactions have a dual purpose:-.IP \[bu] 2-With \f[C]\-\-forecast\f[], each periodic transaction rule generates-future transactions, recurring at the specified interval, which can be-seen in reports.-Forecast transactions begin the day after the latest recorded journal-transaction (or today, if there are no transactions) and end 6 months-from today (or at the report end date, if specified).-.IP \[bu] 2-With \f[C]\-\-budget\f[] (supported by the balance command), each-periodic transaction rule declares recurring budget goals for the-specified accounts, which can be seen in budget reports.-Eg the example above declares the goal of receiving $400 from-\f[C]income:acme\ inc\f[] (and also, depositing $400 into-\f[C]assets:bank:checking\f[]) every week.+There is an additional constraint on the period expression: the start+date must fall on a natural boundary of the interval.+Eg \f[C]monthly\ from\ 2018/1/1\f[] is valid, but+\f[C]monthly\ from\ 2018/1/15\f[] is not. .PP-(Actually, you can generate one\-off transactions too, by writing a-period expression with no report interval.)+If you write a transaction description or same\-line comment, it must be+separated from the period expression by \f[B]two or more spaces\f[].+Eg:+.IP+.nf+\f[C]+;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\ or\ more\ spaces+;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ||+;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ vv+~\ every\ 2\ weeks\ from\ 2018/6\ to\ 2018/9\ \ paycheck+\ \ \ \ assets:bank:checking\ \ \ $1500+\ \ \ \ income:acme\ inc+\f[]+.fi+.SS Forecasting with periodic transactions .PP+With the \f[C]\-\-forecast\f[] flag, each periodic transaction rule+generates future transactions recurring at the specified interval.+These are not saved in the journal, but appear in all reports.+They will look like normal transactions, but with an extra tag named+\f[C]recur\f[], whose value is the generating period expression.+.PP+Forecast transactions begin on or after the day after the latest normal+(non\-periodic) transaction in the journal, or today if there are none.+.PP+They end on or before the report end date if specified, or 180 days from+today if unspecified.+.PP+Forecasting can be useful for estimating balances into the future, and+experimenting with different scenarios.+Note the start date logic means that forecasted transactions are+automatically replaced by normal transactions as you add those.+.PP+Forecasting can also help with data entry: describe most of your+transactions with periodic rules, and every so often copy the output of+\f[C]print\ \-\-forecast\f[] to the journal.+.PP+You can generate one\-time transactions too: just write a period+expression specifying a date with no report interval.+(You could also write a normal transaction with a future date, but+remember this disables forecast transactions on previous dates.)+.SS Budgeting with periodic transactions+.PP+With the \f[C]\-\-budget\f[] flag, currently supported by the balance+command, each periodic transaction rule declares recurring budget goals+for the specified accounts.+Eg the first example above declares a goal of spending $2000 on rent+(and also, a goal of depositing $2000 into checking) every month.+Goals and actual performance can then be compared in budget reports.+.PP For more details, see: balance: Budget report and Cookbook: Budgeting and Forecasting. .SS Automated postings .PP-Automated postings (enabled by \f[C]\-\-auto\f[]) are postings added-automatically by rule to certain transactions.-An automated posting rule looks like a transaction where the first line-is an equal sign (\f[C]=\f[]) followed by a query (mnemonic: \f[C]=\f[]-tests for matching transactions, and also looks like posting lines):+Automated posting rules describe extra postings that should be added to+certain transactions at report time, when the \f[C]\-\-auto\f[] flag is+used.+.PP+An automated posting rule looks like a normal journal entry, except the+first line is an equal sign (\f[C]=\f[]) followed by a query (mnemonic:+\f[C]=\f[] looks like posting lines): .IP .nf \f[C]@@ -1277,7 +1517,7 @@ T{ Vim T}@T{-https://github.com/ledger/ledger/wiki/Getting\-started+https://github.com/ledger/vim\-ledger T} T{ Sublime Text
embeddedfiles/hledger_journal.info view
@@ -4,8 +4,8 @@ File: hledger_journal.info, Node: Top, Next: FILE FORMAT, Up: (dir) -hledger_journal(5) hledger 1.9.1-********************************+hledger_journal(5) hledger 1.9.99+********************************* hledger's usual data source is a plain text file containing journal entries in hledger journal format. This file represents a standard@@ -77,7 +77,7 @@ * Virtual Postings:: * Balance Assertions:: * Balance Assignments::-* Prices::+* Transaction prices:: * Comments:: * Tags:: * Directives::@@ -400,12 +400,12 @@ * or if there are no such amounts in the journal, a default format is used (like '$1000.00'). - Price amounts and amounts in D directives usually don't affect amount-format inference, but in some situations they can do so indirectly. (Eg-when D's default commodity is applied to a commodity-less amount, or-when an amountless posting is balanced using a price's commodity, or-when -V is used.) If you find this causing problems, set the desired-format with a commodity directive.+ Price amounts and amounts in 'D' directives usually don't affect+amount format inference, but in some situations they can do so+indirectly. (Eg when D's default commodity is applied to a+commodity-less amount, or when an amountless posting is balanced using a+price's commodity, or when -V is used.) If you find this causing+problems, set the desired format with a commodity directive. File: hledger_journal.info, Node: Virtual Postings, Next: Balance Assertions, Prev: Amounts, Up: FILE FORMAT@@ -569,7 +569,7 @@ query. -File: hledger_journal.info, Node: Balance Assignments, Next: Prices, Prev: Balance Assertions, Up: FILE FORMAT+File: hledger_journal.info, Node: Balance Assignments, Next: Transaction prices, Prev: Balance Assertions, Up: FILE FORMAT 1.10 Balance Assignments ========================@@ -602,30 +602,18 @@ hledger or do the calculations yourself, instead of just reading it. -File: hledger_journal.info, Node: Prices, Next: Comments, Prev: Balance Assignments, Up: FILE FORMAT--1.11 Prices-===========--* Menu:--* Transaction prices::-* Market prices::---File: hledger_journal.info, Node: Transaction prices, Next: Market prices, Up: Prices+File: hledger_journal.info, Node: Transaction prices, Next: Comments, Prev: Balance Assignments, Up: FILE FORMAT -1.11.1 Transaction prices--------------------------+1.11 Transaction prices+======================= Within a transaction, you can note an amount's price in another commodity. This can be used to document the cost (in a purchase) or selling price (in a sale). For example, transaction prices are useful-to record purchases of a foreign currency.-- Transaction prices are fixed, and do not change over time. (Ledger-users: Ledger uses a different syntax for fixed prices, '{=UNITPRICE}',-which hledger currently ignores).+to record purchases of a foreign currency. Note transaction prices are+fixed at the time of the transaction, and do not change over time. See+also market prices, which represent prevailing exchange rates on a+certain date. There are several ways to record a transaction price: @@ -648,11 +636,14 @@ assets:euros €100 ; one hundred euros purchased assets:dollars $-135 ; for $135 - Amounts with transaction prices can be displayed in the transaction-price's commodity by using the '-B/--cost' flag (except for #551) ("B"-is from "cost Basis"). Eg for the above, here is how -B affects the-balance report:+ (Ledger users: Ledger uses a different syntax for fixed prices,+'{=UNITPRICE}', which hledger currently ignores). + Use the '-B/--cost' flag to convert amounts to their transaction+price's commodity, if any. (mnemonic: "B" is from "cost Basis", as in+Ledger). Eg here is how -B affects the balance report for the example+above:+ $ hledger bal -N --flat $-135 assets:dollars €100 assets:euros@@ -674,36 +665,7 @@ €100 assets:euros -File: hledger_journal.info, Node: Market prices, Prev: Transaction prices, Up: Prices--1.11.2 Market prices-----------------------Market prices are not tied to a particular transaction; they represent-historical exchange rates between two commodities. (Ledger calls them-historical prices.) For example, the prices published by a stock-exchange or the foreign exchange market. hledger can use these prices-to show the market value of things at a given date, see market value.-- To record market prices, use P directives in the main journal or in-an included file. Their format is:--P DATE COMMODITYBEINGPRICED UNITPRICE-- DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol-of the commodity being priced. UNITPRICE is an ordinary amount (symbol-and quantity) in a second commodity, specifying the unit price or-conversion rate for the first commodity in terms of the second, on the-given date.-- For example, the following directives say that one euro was worth-1.35 US dollars during 2009, and $1.40 from 2010 onward:--P 2009/1/1 € $1.35-P 2010/1/1 € $1.40---File: hledger_journal.info, Node: Comments, Next: Tags, Prev: Prices, Up: FILE FORMAT+File: hledger_journal.info, Node: Comments, Next: Tags, Prev: Transaction prices, Up: FILE FORMAT 1.12 Comments =============@@ -792,6 +754,96 @@ 1.14 Directives =============== +A directive is a line in the journal beginning with a special keyword,+that influences how the journal is processed. hledger's directives are+based on a subset of Ledger's, but there are many differences (and also+some differences between hledger versions).++ Directives' behaviour and interactions can get a little bit complex,+so here is a table summarising the directives and their effects, with+links to more detailed docs.++directiveend subdirectivespurpose can affect (as of+ directive 2018/06)+-----------------------------------------------------------------------------+'account' any declare an account name & account code:+ text optional account code balance reports+ (except 'balance'+ single-column+ mode)+'alias' 'end rewrite account names following+ aliases' inline/included+ entries until end+ of current file+ or end directive+'apply 'end prepend a common parent to following+account' apply account names inline/included+ account' entries until end+ of current file+ or end directive+'comment''end ignore part of journal following+ comment' inline/included+ entries until end+ of current file+ or end directive+'commodity' 'format'declare a commodity and its number notation:+ number notation & display following entries+ style in that commodity+ in all files;+ display style:+ amounts of that+ commodity in+ reports+'D' declare a commodity, number commodity: all+ notation & display style commodityless+ for commodityless amounts entries in all+ files; number+ notation:+ following+ commodityless+ entries and+ entries in that+ commodity in all+ files; display+ style: amounts of+ that commodity in+ reports+'include' include entries/directives what the included+ from another file directives affect+'P' declare a market price for amounts of that+ a commodity commodity in+ reports, when -V+ is used+'Y' declare a year for yearless following+ dates inline/included+ entries until end+ of current file++ And some definitions:++subdirectiveoptional indented directive or unparsed text lines+ immediately following a parent directive+account numeric code influencing account display order in most+code balance reports+number how to interpret numbers when parsing journal entries (the+notation identity of the decimal separator character). (Currently+ each commodity can have its own notation, even in the same+ file.)+display how to display amounts of a commodity in reports (symbol side+style and spacing, digit groups, decimal separator, decimal places)+directive which entries and (when there are multiple files) which files+scope are affected by a directive++ As you can see, directives vary in which journal entries and files+they affect, and whether they are focussed on input (parsing) or output+(reports). Some directives have multiple effects.++ If you have a journal made up of multiple files, or pass multiple -f+options on the command line, note that directives which affect input+typically last only until the end of their defining file. This provides+more simplicity and predictability, eg reports are not changed by+writing file options in a different order. It can be surprising at+times though. * Menu: * Comment blocks::@@ -799,6 +851,7 @@ * Default year:: * Declaring commodities:: * Default commodity::+* Market prices:: * Declaring accounts:: * Rewriting accounts:: * Default parent account::@@ -895,16 +948,16 @@ or more decimal digits). -File: hledger_journal.info, Node: Default commodity, Next: Declaring accounts, Prev: Declaring commodities, Up: Directives+File: hledger_journal.info, Node: Default commodity, Next: Market prices, Prev: Declaring commodities, Up: Directives 1.14.5 Default commodity ------------------------ -The D directive sets a default commodity (and display format), to be+The 'D' directive sets a default commodity (and display format), to be used for amounts without a commodity symbol (ie, plain numbers). (Note this differs from Ledger's default commodity directive.) The commodity and display format will be applied to all subsequent commodity-less-amounts, or until the next D directive.+amounts, or until the next 'D' directive. # commodity-less amounts should be treated as dollars # (and displayed with symbol on the left, thousands separators and two decimal places)@@ -918,9 +971,39 @@ with a decimal point. -File: hledger_journal.info, Node: Declaring accounts, Next: Rewriting accounts, Prev: Default commodity, Up: Directives+File: hledger_journal.info, Node: Market prices, Next: Declaring accounts, Prev: Default commodity, Up: Directives -1.14.6 Declaring accounts+1.14.6 Market prices+--------------------++The 'P' directive declares a market price, which is an exchange rate+between two commodities on a certain date. (In Ledger, they are called+"historical prices".) These are often obtained from a stock exchange,+cryptocurrency exchange, or the foreign exchange market.++ Here is the format:++P DATE COMMODITYA COMMODITYBAMOUNT++ * DATE is a simple date+ * COMMODITYA is the symbol of the commodity being priced+ * COMMODITYBAMOUNT is an amount (symbol and quantity) in a second+ commodity, giving the price in commodity B of one unit of commodity+ A.++ These two market price directives say that one euro was worth 1.35 US+dollars during 2009, and $1.40 from 2010 onward:++P 2009/1/1 € $1.35+P 2010/1/1 € $1.40++ The '-V/--value' flag can be used to convert reported amounts to+another commodity using these prices.+++File: hledger_journal.info, Node: Declaring accounts, Next: Rewriting accounts, Prev: Market prices, Up: Directives++1.14.7 Declaring accounts ------------------------- The 'account' directive predeclares account names. The simplest form is@@ -940,15 +1023,24 @@ account revenues 4000 account expenses 6000 - This affects account display order in reports: accounts with codes-are listed before accounts without codes, in increasing code order.-(Otherwise, accounts are listed alphabetically.) Account codes should-be all numeric digits, unique, and separated from the account name by at-least two spaces (since account names may contain single spaces). By-convention, often the first digit indicates the type of account, as in-this numbering scheme and the example above. In future, we might use-this to recognize account types.+ This affects how accounts are sorted in account and balance reports:+accounts with codes are listed before accounts without codes, and in+increasing code order (instead of listing all accounts alphabetically).+Warning, this feature is incomplete; account codes do not yet affect+sort order in + * the 'accounts' command+ * the 'balance' command's single-column mode+ * flat mode balance reports (to work around this, declare account+ codes on the subaccounts as well).+ * hledger-web's sidebar++ Account codes should be all numeric digits, unique, and separated+from the account name by at least two spaces (since account names may+contain single spaces). By convention, often the first digit indicates+the type of account, as in this numbering scheme and the example above.+In future, we might use this to recognize account types.+ An account directive can also have indented subdirectives following it, which are currently ignored. Here is the full syntax: @@ -962,12 +1054,11 @@ File: hledger_journal.info, Node: Rewriting accounts, Next: Default parent account, Prev: Declaring accounts, Up: Directives -1.14.7 Rewriting accounts+1.14.8 Rewriting accounts ------------------------- -You can define aliases which rewrite your account names (after reading-the journal, before generating reports). hledger's account aliases can-be useful for:+You can define account alias rules which rewrite your account names, or+parts of them, before generating reports. This can be useful for: * expanding shorthand account names to their full form, allowing easier data entry and a less verbose journal@@ -976,6 +1067,10 @@ or combining two accounts into one * customising reports + Account aliases also rewrite account names in account directives.+They do not affect account names being entered via hledger add or+hledger-web.+ See also Cookbook: Rewrite account names. * Menu: @@ -987,7 +1082,7 @@ File: hledger_journal.info, Node: Basic aliases, Next: Regex aliases, Up: Rewriting accounts -1.14.7.1 Basic aliases+1.14.8.1 Basic aliases ...................... To set an account alias, use the 'alias' directive in your journal file.@@ -1000,9 +1095,9 @@ This affects all entries. It's useful for trying out aliases interactively. - OLD and NEW are full account names. hledger will replace any-occurrence of the old account name with the new one. Subaccounts are-also affected. Eg:+ OLD and NEW are case sensitive full account names. hledger will+replace any occurrence of the old account name with the new one.+Subaccounts are also affected. Eg: alias checking = assets:bank:wells fargo:checking # rewrites "checking" to "assets:bank:wells fargo:checking", or "checking:a" to "assets:bank:wells fargo:checking:a"@@ -1010,7 +1105,7 @@ File: hledger_journal.info, Node: Regex aliases, Next: Multiple aliases, Prev: Basic aliases, Up: Rewriting accounts -1.14.7.2 Regex aliases+1.14.8.2 Regex aliases ...................... There is also a more powerful variant that uses a regular expression,@@ -1035,7 +1130,7 @@ File: hledger_journal.info, Node: Multiple aliases, Next: end aliases, Prev: Regex aliases, Up: Rewriting accounts -1.14.7.3 Multiple aliases+1.14.8.3 Multiple aliases ......................... You can define as many aliases as you like using directives or@@ -1051,7 +1146,7 @@ File: hledger_journal.info, Node: end aliases, Prev: Multiple aliases, Up: Rewriting accounts -1.14.7.4 'end aliases'+1.14.8.4 'end aliases' ...................... You can clear (forget) all currently defined aliases with the 'end@@ -1062,7 +1157,7 @@ File: hledger_journal.info, Node: Default parent account, Prev: Rewriting accounts, Up: Directives -1.14.8 Default parent account+1.14.9 Default parent account ----------------------------- You can specify a parent account which will be prepended to all accounts@@ -1095,39 +1190,95 @@ Prior to hledger 1.0, legacy 'account' and 'end' spellings were also supported. + A default parent account also affects account directives. It does+not affect account names being entered via hledger add or hledger-web.+If account aliases are present, they are applied after the default+parent account.+ File: hledger_journal.info, Node: Periodic transactions, Next: Automated postings, Prev: Directives, Up: FILE FORMAT 1.15 Periodic transactions ========================== -Periodic transaction rules (enabled by '--forecast' or '--budget')-describe recurring transactions. They look like a transaction where the-first line is a tilde ('~') followed by a period expression (mnemonic:-'~' is like a recurring sine wave):+Periodic transaction rules describe transactions that recur. They allow+you to generate future transactions for forecasting, without having to+write them out explicitly in the journal (with '--forecast'). Secondly,+they also can be used to define budget goals (with '--budget'). -~ weekly- assets:bank:checking $400 ; paycheck- income:acme inc+ A periodic transaction rule looks like a normal journal entry, with+the date replaced by a tilde ('~') followed by a period expression+(mnemonic: '~' looks like a repeating sine wave): - Periodic transactions have a dual purpose:+~ monthly+ expenses:rent $2000+ assets:bank:checking - * With '--forecast', each periodic transaction rule generates future- transactions, recurring at the specified interval, which can be- seen in reports. Forecast transactions begin the day after the- latest recorded journal transaction (or today, if there are no- transactions) and end 6 months from today (or at the report end- date, if specified).+ There is an additional constraint on the period expression: the start+date must fall on a natural boundary of the interval. Eg 'monthly from+2018/1/1' is valid, but 'monthly from 2018/1/15' is not. - * With '--budget' (supported by the balance command), each periodic- transaction rule declares recurring budget goals for the specified- accounts, which can be seen in budget reports. Eg the example- above declares the goal of receiving $400 from 'income:acme inc'- (and also, depositing $400 into 'assets:bank:checking') every week.+ If you write a transaction description or same-line comment, it must+be separated from the period expression by *two or more spaces*. Eg: - (Actually, you can generate one-off transactions too, by writing a-period expression with no report interval.)+; 2 or more spaces+; ||+; vv+~ every 2 weeks from 2018/6 to 2018/9 paycheck+ assets:bank:checking $1500+ income:acme inc +* Menu:++* Forecasting with periodic transactions::+* Budgeting with periodic transactions::+++File: hledger_journal.info, Node: Forecasting with periodic transactions, Next: Budgeting with periodic transactions, Up: Periodic transactions++1.15.1 Forecasting with periodic transactions+---------------------------------------------++With the '--forecast' flag, each periodic transaction rule generates+future transactions recurring at the specified interval. These are not+saved in the journal, but appear in all reports. They will look like+normal transactions, but with an extra tag named 'recur', whose value is+the generating period expression.++ Forecast transactions begin on or after the day after the latest+normal (non-periodic) transaction in the journal, or today if there are+none.++ They end on or before the report end date if specified, or 180 days+from today if unspecified.++ Forecasting can be useful for estimating balances into the future,+and experimenting with different scenarios. Note the start date logic+means that forecasted transactions are automatically replaced by normal+transactions as you add those.++ Forecasting can also help with data entry: describe most of your+transactions with periodic rules, and every so often copy the output of+'print --forecast' to the journal.++ You can generate one-time transactions too: just write a period+expression specifying a date with no report interval. (You could also+write a normal transaction with a future date, but remember this+disables forecast transactions on previous dates.)+++File: hledger_journal.info, Node: Budgeting with periodic transactions, Prev: Forecasting with periodic transactions, Up: Periodic transactions++1.15.2 Budgeting with periodic transactions+-------------------------------------------++With the '--budget' flag, currently supported by the balance command,+each periodic transaction rule declares recurring budget goals for the+specified accounts. Eg the first example above declares a goal of+spending $2000 on rent (and also, a goal of depositing $2000 into+checking) every month. Goals and actual performance can then be+compared in budget reports.+ For more details, see: balance: Budget report and Cookbook: Budgeting and Forecasting. @@ -1137,12 +1288,13 @@ 1.16 Automated postings ======================= -Automated postings (enabled by '--auto') are postings added-automatically by rule to certain transactions. An automated posting-rule looks like a transaction where the first line is an equal sign-('=') followed by a query (mnemonic: '=' tests for matching-transactions, and also looks like posting lines):+Automated posting rules describe extra postings that should be added to+certain transactions at report time, when the '--auto' flag is used. + An automated posting rule looks like a normal journal entry, except+the first line is an equal sign ('=') followed by a query (mnemonic: '='+looks like posting lines):+ = expenses:gifts budget:gifts *-1 assets:budget *1@@ -1189,7 +1341,7 @@ Editor -------------------------------------------------------------------------- Emacs http://www.ledger-cli.org/3.0/doc/ledger-mode.html-Vim https://github.com/ledger/ledger/wiki/Getting-started+Vim https://github.com/ledger/vim-ledger Sublime https://github.com/ledger/ledger/wiki/Editing-Ledger-files-with-Sublime-Text-or-RubyMine Text Textmate https://github.com/ledger/ledger/wiki/Using-TextMate-2@@ -1202,89 +1354,91 @@ Tag Table: Node: Top76-Node: FILE FORMAT2374-Ref: #file-format2498-Node: Transactions2770-Ref: #transactions2891-Node: Postings3575-Ref: #postings3702-Node: Dates4697-Ref: #dates4812-Node: Simple dates4877-Ref: #simple-dates5003-Node: Secondary dates5369-Ref: #secondary-dates5523-Node: Posting dates7086-Ref: #posting-dates7215-Node: Status8589-Ref: #status8709-Node: Description10417-Ref: #description10555-Node: Payee and note10874-Ref: #payee-and-note10988-Node: Account names11230-Ref: #account-names11373-Node: Amounts11860-Ref: #amounts11996-Node: Virtual Postings15011-Ref: #virtual-postings15170-Node: Balance Assertions16390-Ref: #balance-assertions16565-Node: Assertions and ordering17461-Ref: #assertions-and-ordering17647-Node: Assertions and included files18347-Ref: #assertions-and-included-files18588-Node: Assertions and multiple -f options18921-Ref: #assertions-and-multiple--f-options19175-Node: Assertions and commodities19307-Ref: #assertions-and-commodities19542-Node: Assertions and subaccounts20238-Ref: #assertions-and-subaccounts20470-Node: Assertions and virtual postings20991-Ref: #assertions-and-virtual-postings21198-Node: Balance Assignments21340-Ref: #balance-assignments21509-Node: Prices22629-Ref: #prices22762-Node: Transaction prices22813-Ref: #transaction-prices22958-Node: Market prices25114-Ref: #market-prices25249-Node: Comments26209-Ref: #comments26331-Node: Tags27501-Ref: #tags27619-Node: Directives29021-Ref: #directives29164-Node: Comment blocks29357-Ref: #comment-blocks29502-Node: Including other files29678-Ref: #including-other-files29858-Node: Default year30247-Ref: #default-year30416-Node: Declaring commodities30839-Ref: #declaring-commodities31022-Node: Default commodity32249-Ref: #default-commodity32430-Node: Declaring accounts33062-Ref: #declaring-accounts33242-Node: Rewriting accounts34589-Ref: #rewriting-accounts34774-Node: Basic aliases35378-Ref: #basic-aliases35524-Node: Regex aliases36214-Ref: #regex-aliases36385-Node: Multiple aliases37103-Ref: #multiple-aliases37278-Node: end aliases37776-Ref: #end-aliases37923-Node: Default parent account38024-Ref: #default-parent-account38190-Node: Periodic transactions38849-Ref: #periodic-transactions39028-Node: Automated postings40327-Ref: #automated-postings40481-Node: EDITOR SUPPORT41614-Ref: #editor-support41732+Node: FILE FORMAT2376+Ref: #file-format2500+Node: Transactions2784+Ref: #transactions2905+Node: Postings3589+Ref: #postings3716+Node: Dates4711+Ref: #dates4826+Node: Simple dates4891+Ref: #simple-dates5017+Node: Secondary dates5383+Ref: #secondary-dates5537+Node: Posting dates7100+Ref: #posting-dates7229+Node: Status8603+Ref: #status8723+Node: Description10431+Ref: #description10569+Node: Payee and note10888+Ref: #payee-and-note11002+Node: Account names11244+Ref: #account-names11387+Node: Amounts11874+Ref: #amounts12010+Node: Virtual Postings15027+Ref: #virtual-postings15186+Node: Balance Assertions16406+Ref: #balance-assertions16581+Node: Assertions and ordering17477+Ref: #assertions-and-ordering17663+Node: Assertions and included files18363+Ref: #assertions-and-included-files18604+Node: Assertions and multiple -f options18937+Ref: #assertions-and-multiple--f-options19191+Node: Assertions and commodities19323+Ref: #assertions-and-commodities19558+Node: Assertions and subaccounts20254+Ref: #assertions-and-subaccounts20486+Node: Assertions and virtual postings21007+Ref: #assertions-and-virtual-postings21214+Node: Balance Assignments21356+Ref: #balance-assignments21537+Node: Transaction prices22657+Ref: #transaction-prices22826+Node: Comments25094+Ref: #comments25228+Node: Tags26398+Ref: #tags26516+Node: Directives27918+Ref: #directives28061+Node: Comment blocks33917+Ref: #comment-blocks34062+Node: Including other files34238+Ref: #including-other-files34418+Node: Default year34807+Ref: #default-year34976+Node: Declaring commodities35399+Ref: #declaring-commodities35582+Node: Default commodity36809+Ref: #default-commodity36985+Node: Market prices37621+Ref: #market-prices37786+Node: Declaring accounts38627+Ref: #declaring-accounts38803+Node: Rewriting accounts40474+Ref: #rewriting-accounts40659+Node: Basic aliases41393+Ref: #basic-aliases41539+Node: Regex aliases42243+Ref: #regex-aliases42414+Node: Multiple aliases43132+Ref: #multiple-aliases43307+Node: end aliases43805+Ref: #end-aliases43952+Node: Default parent account44053+Ref: #default-parent-account44219+Node: Periodic transactions45103+Ref: #periodic-transactions45282+Node: Forecasting with periodic transactions46492+Ref: #forecasting-with-periodic-transactions46735+Node: Budgeting with periodic transactions47976+Ref: #budgeting-with-periodic-transactions48215+Node: Automated postings48674+Ref: #automated-postings48828+Node: EDITOR SUPPORT49967+Ref: #editor-support50085 End Tag Table
embeddedfiles/hledger_journal.txt view
@@ -466,16 +466,14 @@ less explicit; to know the exact amount posted, you have to run hledger or do the calculations yourself, instead of just reading it. - Prices Transaction prices Within a transaction, you can note an amount's price in another commod- ity. This can be used to document the cost (in a purchase) or selling price (in a sale). For example, transaction prices are useful to- record purchases of a foreign currency.-- Transaction prices are fixed, and do not change over time. (Ledger- users: Ledger uses a different syntax for fixed prices, {=UNITPRICE},- which hledger currently ignores).+ record purchases of a foreign currency. Note transaction prices are+ fixed at the time of the transaction, and do not change over time. See+ also market prices, which represent prevailing exchange rates on a cer-+ tain date. There are several ways to record a transaction price: @@ -498,11 +496,13 @@ assets:euros 100 ; one hundred euros purchased assets:dollars $-135 ; for $135 - Amounts with transaction prices can be displayed in the transaction- price's commodity by using the -B/--cost flag (except for #551) ("B" is- from "cost Basis"). Eg for the above, here is how -B affects the bal-- ance report:+ (Ledger users: Ledger uses a different syntax for fixed prices, {=UNIT-+ PRICE}, which hledger currently ignores). + Use the -B/--cost flag to convert amounts to their transaction price's+ commodity, if any. (mnemonic: "B" is from "cost Basis", as in Ledger).+ Eg here is how -B affects the balance report for the example above:+ $ hledger bal -N --flat $-135 assets:dollars 100 assets:euros@@ -510,8 +510,8 @@ $-135 assets:dollars $135 assets:euros # <- the euros' cost - Note -B is sensitive to the order of postings when a transaction price- is inferred: the inferred price will be in the commodity of the last+ Note -B is sensitive to the order of postings when a transaction price+ is inferred: the inferred price will be in the commodity of the last amount. So if example 3's postings are reversed, while the transaction is equivalent, -B shows something different: @@ -523,40 +523,16 @@ -100 assets:dollars # <- the dollars' selling price 100 assets:euros - Market prices- Market prices are not tied to a particular transaction; they represent- historical exchange rates between two commodities. (Ledger calls them- historical prices.) For example, the prices published by a stock- exchange or the foreign exchange market. hledger can use these prices- to show the market value of things at a given date, see market value.-- To record market prices, use P directives in the main journal or in an- included file. Their format is:-- P DATE COMMODITYBEINGPRICED UNITPRICE-- DATE is a simple date as usual. COMMODITYBEINGPRICED is the symbol of- the commodity being priced. UNITPRICE is an ordinary amount (symbol- and quantity) in a second commodity, specifying the unit price or con-- version rate for the first commodity in terms of the second, on the- given date.-- For example, the following directives say that one euro was worth 1.35- US dollars during 2009, and $1.40 from 2010 onward:-- P 2009/1/1 $1.35- P 2010/1/1 $1.40- Comments Lines in the journal beginning with a semicolon (;) or hash (#) or star- (*) are comments, and will be ignored. (Star comments cause org-mode- nodes to be ignored, allowing emacs users to fold and navigate their+ (*) are comments, and will be ignored. (Star comments cause org-mode+ nodes to be ignored, allowing emacs users to fold and navigate their journals with org-mode or orgstruct-mode.) - You can attach comments to a transaction by writing them after the- description and/or indented on the following lines (before the post-- ings). Similarly, you can attach comments to an individual posting by- writing them after the amount and/or indented on the following lines.+ You can attach comments to a transaction by writing them after the+ description and/or indented on the following lines (before the post-+ ings). Similarly, you can attach comments to an individual posting by+ writing them after the amount and/or indented on the following lines. Transaction and posting comments must begin with a semicolon (;). Some examples:@@ -580,24 +556,24 @@ ; another comment line for posting 2 ; a file comment (because not indented) - You can also comment larger regions of a file using comment and+ You can also comment larger regions of a file using comment and end comment directives. Tags- Tags are a way to add extra labels or labelled data to postings and+ Tags are a way to add extra labels or labelled data to postings and transactions, which you can then search or pivot on. - A simple tag is a word (which may contain hyphens) followed by a full+ A simple tag is a word (which may contain hyphens) followed by a full colon, written inside a transaction or posting comment line: 2017/1/16 bought groceries ; sometag: - Tags can have a value, which is the text after the colon, up to the+ Tags can have a value, which is the text after the colon, up to the next comma or end of line, with leading/trailing whitespace removed: expenses:food $10 ; a-posting-tag: the tag value - Note this means hledger's tag values can not contain commas or new-+ Note this means hledger's tag values can not contain commas or new- lines. Ending at commas means you can write multiple short tags on one line, comma separated: @@ -611,39 +587,132 @@ o "tag2" is another tag, whose value is "some value ..." - Tags in a transaction comment affect the transaction and all of its- postings, while tags in a posting comment affect only that posting.- For example, the following transaction has three tags (A, TAG2,+ Tags in a transaction comment affect the transaction and all of its+ postings, while tags in a posting comment affect only that posting.+ For example, the following transaction has three tags (A, TAG2, third-tag) and the posting has four (those plus posting-tag): 1/1 a transaction ; A:, TAG2: ; third-tag: a third transaction tag, <- with a value (a) $1 ; posting-tag: - Tags are like Ledger's metadata feature, except hledger's tag values+ Tags are like Ledger's metadata feature, except hledger's tag values are simple strings. Directives+ A directive is a line in the journal beginning with a special keyword,+ that influences how the journal is processed. hledger's directives are+ based on a subset of Ledger's, but there are many differences (and also+ some differences between hledger versions).++ Directives' behaviour and interactions can get a little bit complex, so+ here is a table summarising the directives and their effects, with+ links to more detailed docs.+++ direc- end subdi- purpose can affect (as of+ tive directive rec- 2018/06)+ tives+ -------------------------------------------------------------------------------------------------+ account any declare an account name & account code: bal-+ text optional account code ance reports+ (except balance+ single-column mode)+ alias end aliases rewrite account names following+ inline/included+ entries until end+ of current file or+ end directive+ apply account end apply account prepend a common parent to following+ account names inline/included+ entries until end+ of current file or+ end directive+ comment end comment ignore part of journal following+ inline/included+ entries until end+ of current file or+ end directive+ commodity format declare a commodity and its number notation:+ number notation & display following entries+ style in that commodity+ in all files; dis-+ play style: amounts+ of that commodity+ in reports+ D declare a commodity, number commodity: all com-+ notation & display style for modityless entries+ commodityless amounts in all files; num-+ ber notation: fol-+ lowing commodity-+ less entries and+ entries in that+ commodity in all+ files; display+ style: amounts of+ that commodity in+ reports+ include include entries/directives what the included+ from another file directives affect+ P declare a market price for a amounts of that+ commodity commodity in+ reports, when -V is+ used+ Y declare a year for yearless following+ dates inline/included+ entries until end+ of current file++ And some definitions:+++ subdirec- optional indented directive or unparsed text lines immedi-+ tive ately following a parent directive+ account numeric code influencing account display order in most bal-+ code ance reports++++ number how to interpret numbers when parsing journal entries (the+ notation identity of the decimal separator character). (Currently+ each commodity can have its own notation, even in the same+ file.)+ display how to display amounts of a commodity in reports (symbol side+ style and spacing, digit groups, decimal separator, decimal places)+ directive which entries and (when there are multiple files) which files+ scope are affected by a directive++ As you can see, directives vary in which journal entries and files they+ affect, and whether they are focussed on input (parsing) or output+ (reports). Some directives have multiple effects.++ If you have a journal made up of multiple files, or pass multiple -f+ options on the command line, note that directives which affect input+ typically last only until the end of their defining file. This pro-+ vides more simplicity and predictability, eg reports are not changed by+ writing file options in a different order. It can be surprising at+ times though.+ Comment blocks- A line containing just comment starts a commented region of the file,+ A line containing just comment starts a commented region of the file, and a line containing just end comment (or the end of the current file) ends it. See also comments. Including other files- You can pull in the content of additional files by writing an include+ You can pull in the content of additional files by writing an include directive, like this: include path/to/file.journal - If the path does not begin with a slash, it is relative to the current+ If the path does not begin with a slash, it is relative to the current file. Glob patterns (*) are not currently supported. - The include directive can only be used in journal files. It can+ The include directive can only be used in journal files. It can include journal, timeclock or timedot files, but not CSV files. Default year- You can set a default year to be used for subsequent dates which don't- specify a year. This is a line beginning with Y followed by the year.+ You can set a default year to be used for subsequent dates which don't+ specify a year. This is a line beginning with Y followed by the year. Eg: Y2009 ; set default year to 2009@@ -663,8 +732,8 @@ assets Declaring commodities- The commodity directive declares commodities which may be used in the- journal (though currently we do not enforce this). It may be written+ The commodity directive declares commodities which may be used in the+ journal (though currently we do not enforce this). It may be written on a single line, like this: ; commodity EXAMPLEAMOUNT@@ -674,8 +743,8 @@ ; separating thousands with comma. commodity 1,000.0000 AAAA - or on multiple lines, using the "format" subdirective. In this case- the commodity symbol appears twice and should be the same in both+ or on multiple lines, using the "format" subdirective. In this case+ the commodity symbol appears twice and should be the same in both places: ; commodity SYMBOL@@ -687,19 +756,19 @@ commodity INR format INR 9,99,99,999.00 - Commodity directives have a second purpose: they define the standard+ Commodity directives have a second purpose: they define the standard display format for amounts in the commodity. Normally the display for-- mat is inferred from journal entries, but this can be unpredictable;- declaring it with a commodity directive overrides this and removes- ambiguity. Towards this end, amounts in commodity directives must- always be written with a decimal point (a period or comma, followed by+ mat is inferred from journal entries, but this can be unpredictable;+ declaring it with a commodity directive overrides this and removes+ ambiguity. Towards this end, amounts in commodity directives must+ always be written with a decimal point (a period or comma, followed by 0 or more decimal digits). Default commodity- The D directive sets a default commodity (and display format), to be+ The D directive sets a default commodity (and display format), to be used for amounts without a commodity symbol (ie, plain numbers). (Note- this differs from Ledger's default commodity directive.) The commodity- and display format will be applied to all subsequent commodity-less+ this differs from Ledger's default commodity directive.) The commodity+ and display format will be applied to all subsequent commodity-less amounts, or until the next D directive. # commodity-less amounts should be treated as dollars@@ -713,13 +782,39 @@ As with the commodity directive, the amount must always be written with a decimal point. + Market prices+ The P directive declares a market price, which is an exchange rate+ between two commodities on a certain date. (In Ledger, they are called+ "historical prices".) These are often obtained from a stock exchange,+ cryptocurrency exchange, or the foreign exchange market.++ Here is the format:++ P DATE COMMODITYA COMMODITYBAMOUNT++ o DATE is a simple date++ o COMMODITYA is the symbol of the commodity being priced++ o COMMODITYBAMOUNT is an amount (symbol and quantity) in a second com-+ modity, giving the price in commodity B of one unit of commodity A.++ These two market price directives say that one euro was worth 1.35 US+ dollars during 2009, and $1.40 from 2010 onward:++ P 2009/1/1 $1.35+ P 2010/1/1 $1.40++ The -V/--value flag can be used to convert reported amounts to another+ commodity using these prices.+ Declaring accounts- The account directive predeclares account names. The simplest form is+ The account directive predeclares account names. The simplest form is account ACCTNAME, eg: account assets:bank:checking - Currently this mainly helps with account name autocompletion in eg+ Currently this mainly helps with account name autocompletion in eg hledger add, hledger-iadd, hledger-web, and ledger-mode. In future it will also help detect misspelled accounts. @@ -731,15 +826,27 @@ account revenues 4000 account expenses 6000 - This affects account display order in reports: accounts with codes are- listed before accounts without codes, in increasing code order. (Oth-- erwise, accounts are listed alphabetically.) Account codes should be- all numeric digits, unique, and separated from the account name by at- least two spaces (since account names may contain single spaces). By- convention, often the first digit indicates the type of account, as in- this numbering scheme and the example above. In future, we might use- this to recognize account types.+ This affects how accounts are sorted in account and balance reports:+ accounts with codes are listed before accounts without codes, and in+ increasing code order (instead of listing all accounts alphabetically).+ Warning, this feature is incomplete; account codes do not yet affect+ sort order in + o the accounts command++ o the balance command's single-column mode++ o flat mode balance reports (to work around this, declare account codes+ on the subaccounts as well).++ o hledger-web's sidebar++ Account codes should be all numeric digits, unique, and separated from+ the account name by at least two spaces (since account names may con-+ tain single spaces). By convention, often the first digit indicates+ the type of account, as in this numbering scheme and the example above.+ In future, we might use this to recognize account types.+ An account directive can also have indented subdirectives following it, which are currently ignored. Here is the full syntax: @@ -751,9 +858,8 @@ some-tag:12345 Rewriting accounts- You can define aliases which rewrite your account names (after reading- the journal, before generating reports). hledger's account aliases can- be useful for:+ You can define account alias rules which rewrite your account names, or+ parts of them, before generating reports. This can be useful for: o expanding shorthand account names to their full form, allowing easier data entry and a less verbose journal@@ -765,6 +871,10 @@ o customising reports + Account aliases also rewrite account names in account directives. They+ do not affect account names being entered via hledger add or+ hledger-web.+ See also Cookbook: Rewrite account names. Basic aliases@@ -777,9 +887,9 @@ Or, you can use the --alias 'OLD=NEW' option on the command line. This affects all entries. It's useful for trying out aliases interactively. - OLD and NEW are full account names. hledger will replace any occur-- rence of the old account name with the new one. Subaccounts are also- affected. Eg:+ OLD and NEW are case sensitive full account names. hledger will+ replace any occurrence of the old account name with the new one. Sub-+ accounts are also affected. Eg: alias checking = assets:bank:wells fargo:checking # rewrites "checking" to "assets:bank:wells fargo:checking", or "checking:a" to "assets:bank:wells fargo:checking:a"@@ -853,44 +963,85 @@ Prior to hledger 1.0, legacy account and end spellings were also sup- ported. + A default parent account also affects account directives. It does not+ affect account names being entered via hledger add or hledger-web. If+ account aliases are present, they are applied after the default parent+ account.+ Periodic transactions- Periodic transaction rules (enabled by --forecast or --budget) describe- recurring transactions. They look like a transaction where the first- line is a tilde (~) followed by a period expression (mnemonic: ~ is- like a recurring sine wave):+ Periodic transaction rules describe transactions that recur. They+ allow you to generate future transactions for forecasting, without hav-+ ing to write them out explicitly in the journal (with --forecast).+ Secondly, they also can be used to define budget goals (with --budget). - ~ weekly- assets:bank:checking $400 ; paycheck- income:acme inc+ A periodic transaction rule looks like a normal journal entry, with the+ date replaced by a tilde (~) followed by a period expression (mnemonic:+ ~ looks like a repeating sine wave): - Periodic transactions have a dual purpose:+ ~ monthly+ expenses:rent $2000+ assets:bank:checking - o With --forecast, each periodic transaction rule generates future- transactions, recurring at the specified interval, which can be seen- in reports. Forecast transactions begin the day after the latest- recorded journal transaction (or today, if there are no transactions)- and end 6 months from today (or at the report end date, if speci-- fied).+ There is an additional constraint on the period expression: the start+ date must fall on a natural boundary of the interval. Eg+ monthly from 2018/1/1 is valid, but monthly from 2018/1/15 is not. - o With --budget (supported by the balance command), each periodic- transaction rule declares recurring budget goals for the specified- accounts, which can be seen in budget reports. Eg the example above- declares the goal of receiving $400 from income:acme inc (and also,- depositing $400 into assets:bank:checking) every week.+ If you write a transaction description or same-line comment, it must be+ separated from the period expression by two or more spaces. Eg: - (Actually, you can generate one-off transactions too, by writing a- period expression with no report interval.)+ ; 2 or more spaces+ ; ||+ ; vv+ ~ every 2 weeks from 2018/6 to 2018/9 paycheck+ assets:bank:checking $1500+ income:acme inc - For more details, see: balance: Budget report and Cookbook: Budgeting+ Forecasting with periodic transactions+ With the --forecast flag, each periodic transaction rule generates+ future transactions recurring at the specified interval. These are not+ saved in the journal, but appear in all reports. They will look like+ normal transactions, but with an extra tag named recur, whose value is+ the generating period expression.++ Forecast transactions begin on or after the day after the latest normal+ (non-periodic) transaction in the journal, or today if there are none.++ They end on or before the report end date if specified, or 180 days+ from today if unspecified.++ Forecasting can be useful for estimating balances into the future, and+ experimenting with different scenarios. Note the start date logic+ means that forecasted transactions are automatically replaced by normal+ transactions as you add those.++ Forecasting can also help with data entry: describe most of your trans-+ actions with periodic rules, and every so often copy the output of+ print --forecast to the journal.++ You can generate one-time transactions too: just write a period expres-+ sion specifying a date with no report interval. (You could also write+ a normal transaction with a future date, but remember this disables+ forecast transactions on previous dates.)++ Budgeting with periodic transactions+ With the --budget flag, currently supported by the balance command,+ each periodic transaction rule declares recurring budget goals for the+ specified accounts. Eg the first example above declares a goal of+ spending $2000 on rent (and also, a goal of depositing $2000 into+ checking) every month. Goals and actual performance can then be com-+ pared in budget reports.++ For more details, see: balance: Budget report and Cookbook: Budgeting and Forecasting. Automated postings- Automated postings (enabled by --auto) are postings added automatically- by rule to certain transactions. An automated posting rule looks like- a transaction where the first line is an equal sign (=) followed by a- query (mnemonic: = tests for matching transactions, and also looks like- posting lines):+ Automated posting rules describe extra postings that should be added to+ certain transactions at report time, when the --auto flag is used. + An automated posting rule looks like a normal journal entry, except the+ first line is an equal sign (=) followed by a query (mnemonic: = looks+ like posting lines):+ = expenses:gifts budget:gifts *-1 assets:budget *1@@ -933,12 +1084,13 @@ Editor -------------------------------------------------------------------------- Emacs http://www.ledger-cli.org/3.0/doc/ledger-mode.html- Vim https://github.com/ledger/ledger/wiki/Getting-started+ Vim https://github.com/ledger/vim-ledger Sublime Text https://github.com/ledger/ledger/wiki/Edit- ing-Ledger-files-with-Sublime-Text-or-RubyMine Textmate https://github.com/ledger/ledger/wiki/Using-TextMate-2 Text Wran- https://github.com/ledger/ledger/wiki/Edit- gler ing-Ledger-files-with-TextWrangler+ Visual Stu- https://marketplace.visualstudio.com/items?item- dio Code Name=mark-hansen.hledger-vscode @@ -967,4 +1119,4 @@ -hledger 1.9.1 April 2018 hledger_journal(5)+hledger 1.9.99 June 2018 hledger_journal(5)
embeddedfiles/hledger_timeclock.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timeclock" "5" "April 2018" "hledger 1.9.1" "hledger User Manuals"+.TH "hledger_timeclock" "5" "June 2018" "hledger 1.9.99" "hledger User Manuals"
embeddedfiles/hledger_timeclock.info view
@@ -4,8 +4,8 @@ File: hledger_timeclock.info, Node: Top, Up: (dir) -hledger_timeclock(5) hledger 1.9.1-**********************************+hledger_timeclock(5) hledger 1.9.99+*********************************** hledger can read timeclock files. As with Ledger, these are (a subset of) timeclock.el's format, containing clock-in and clock-out entries as
embeddedfiles/hledger_timeclock.txt view
@@ -77,4 +77,4 @@ -hledger 1.9.1 April 2018 hledger_timeclock(5)+hledger 1.9.99 June 2018 hledger_timeclock(5)
embeddedfiles/hledger_timedot.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timedot" "5" "April 2018" "hledger 1.9.1" "hledger User Manuals"+.TH "hledger_timedot" "5" "June 2018" "hledger 1.9.99" "hledger User Manuals"
embeddedfiles/hledger_timedot.info view
@@ -4,8 +4,8 @@ File: hledger_timedot.info, Node: Top, Next: FILE FORMAT, Up: (dir) -hledger_timedot(5) hledger 1.9.1-********************************+hledger_timedot(5) hledger 1.9.99+********************************* Timedot is a plain text format for logging dated, categorised quantities (of time, usually), supported by hledger. It is convenient for@@ -110,7 +110,7 @@ Tag Table: Node: Top76-Node: FILE FORMAT809-Ref: #file-format910+Node: FILE FORMAT811+Ref: #file-format912 End Tag Table
embeddedfiles/hledger_timedot.txt view
@@ -124,4 +124,4 @@ -hledger 1.9.1 April 2018 hledger_timedot(5)+hledger 1.9.99 June 2018 hledger_timedot(5)
hledger.1 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "April 2018" "hledger 1.9.1" "hledger User Manuals"+.TH "hledger" "1" "June 2018" "hledger 1.9.99" "hledger User Manuals" @@ -493,51 +493,85 @@ tab(@); l l. T{-\f[C]2009/1/1\f[], \f[C]2009/01/01\f[], \f[C]2009\-1\-1\f[],-\f[C]2009.1.1\f[]+\f[C]2004/10/1\f[], \f[C]2004\-01\-01\f[], \f[C]2004.9.1\f[] T}@T{-simple dates, several separators allowed+exact date, several separators allowed.+Year is 4+ digits, month is 1\-12, day is 1\-31 T} T{-\f[C]2009/1\f[], \f[C]2009\f[]+\f[C]2004\f[] T}@T{-same as above \- a missing day or month defaults to 1+start of year T} T{-\f[C]1/1\f[], \f[C]january\f[], \f[C]jan\f[], \f[C]this\ year\f[]+\f[C]2004/10\f[] T}@T{-relative dates, meaning january 1 of the current year+start of month T} T{-\f[C]next\ year\f[]+\f[C]10/1\f[] T}@T{-january 1 of next year+month and day in current year T} T{-\f[C]this\ month\f[]+\f[C]21\f[] T}@T{-the 1st of the current month+day in current month T} T{-\f[C]this\ week\f[]+\f[C]october,\ oct\f[] T}@T{-the most recent monday+start of month in current year T} T{-\f[C]last\ week\f[]+\f[C]yesterday,\ today,\ tomorrow\f[] T}@T{-the monday of the week before this one+\-1, 0, 1 days from today T} T{-\f[C]lastweek\f[]+\f[C]last/this/next\ day/week/month/quarter/year\f[] T}@T{-spaces are optional+\-1, 0, 1 periods from the current period T} T{-\f[C]today\f[], \f[C]yesterday\f[], \f[C]tomorrow\f[]+\f[C]20181201\f[] T}@T{+8 digit YYYYMMDD with valid year month and day T}+T{+\f[C]201812\f[]+T}@T{+6 digit YYYYMM with valid year and month+T} .TE+.PP+Counterexamples \- malformed digit sequences might give surprising+results:+.PP+.TS+tab(@);+l l.+T{+\f[C]201813\f[]+T}@T{+6 digits with an invalid month is parsed as start of 6\-digit year+T}+T{+\f[C]20181301\f[]+T}@T{+8 digits with an invalid month is parsed as start of 8\-digit year+T}+T{+\f[C]20181232\f[]+T}@T{+8 digits with an invalid day gives an error+T}+T{+\f[C]201801012\f[]+T}@T{+9+ digits beginning with a valid YYYYMMDD gives an error+T}+.TE .SS Report start & end date .PP Most hledger reports show the full span of time represented by the@@ -928,6 +962,9 @@ .PP The \f[C]\-V/\-\-value\f[] flag converts reported amounts to their current market value.+.PD 0+.P+.PD Specifically, when there is a market price (P directive) for the amount's commodity, dated on or before today's date (or the report end date if specified), the amount will be converted to the price's@@ -957,32 +994,36 @@ .IP .nf \f[C]-$\ hledger\ \-f\ t.j\ bal\ euros+$\ hledger\ \-f\ t.j\ bal\ \-N\ euros \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ €100\ \ assets:euros \f[] .fi .PP-What are they worth on nov 3 ?-(no report end date specified, defaults to the last date in the journal)+What are they worth at end of nov 3 ? .IP .nf \f[C]-$\ hledger\ \-f\ t.j\ bal\ euros\ \-V+$\ hledger\ \-f\ t.j\ bal\ \-N\ euros\ \-V\ \-e\ 2016/11/4 \ \ \ \ \ \ \ \ \ \ \ \ \ $110.00\ \ assets:euros \f[] .fi .PP-What are they worth on dec 21 ?+What are they worth after 2016/12/21 ?+(no report end date specified, defaults to today) .IP .nf \f[C]-$\ hledger\ \-f\ t.j\ bal\ euros\ \-V\ \-e\ 2016/12/21+$\ hledger\ \-f\ t.j\ bal\ \-N\ euros\ \-V \ \ \ \ \ \ \ \ \ \ \ \ \ $103.00\ \ assets:euros \f[] .fi .PP Currently, hledger's \-V only uses market prices recorded with P directives, not transaction prices (unlike Ledger).+.PP+Currently, \-V has a limitation in multicolumn balance reports: it uses+the market prices on the report end date for all columns.+(Instead of the prices on each column's end date.) .SS Combining \-B and \-V .PP Using \-B/\[en]cost and \-V/\[en]value together is currently allowed,
hledger.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 43b8d8dfa1791a15d30d4e99714152b6bf36889a6038841e7d750f58a7cfede8+-- hash: 9d4dec437459d541e707fa97a836aa8b4878e685d84738bcb462c370387ad83a name: hledger-version: 1.9.1+version: 1.10 synopsis: Command-line interface for the hledger accounting tool description: This is hledger's command-line interface. Its basic function is to read a plain text file describing@@ -25,7 +25,7 @@ maintainer: Simon Michael <simon@joyful.com> license: GPL-3 license-file: LICENSE-tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.1+tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.1 build-type: Simple cabal-version: >= 1.10 extra-source-files:@@ -109,14 +109,14 @@ other-modules: Paths_hledger ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path- cpp-options: -DVERSION="1.9.1"+ cpp-options: -DVERSION="1.10" build-depends: Decimal , Diff , HUnit , ansi-terminal >=0.6.2.3 , base >=4.8 && <4.12- , base-compat >=0.8.1+ , base-compat-batteries >=0.10.1 && <0.11 , bytestring , cmdargs >=0.10 , containers@@ -128,12 +128,13 @@ , hashable >=1.2.4 , haskeline >=0.6 , here- , hledger-lib >=1.9.1 && <2.0+ , hledger-lib >=1.10 && <1.11 , lucid- , megaparsec >=5.0+ , megaparsec >=6.4.1 , mtl , mtl-compat , old-time+ , parsec >=3 , pretty-show >=1.6.4 , process , regex-tdfa@@ -161,13 +162,13 @@ hs-source-dirs: app ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path- cpp-options: -DVERSION="1.9.1"+ cpp-options: -DVERSION="1.10" build-depends: Decimal , HUnit , ansi-terminal >=0.6.2.3 , base >=4.8 && <4.12- , base-compat >=0.8.1+ , base-compat-batteries >=0.10.1 && <0.11 , bytestring , cmdargs >=0.10 , containers@@ -179,7 +180,8 @@ , haskeline >=0.6 , here , hledger- , hledger-lib >=1.9.1 && <2.0+ , hledger-lib >=1.10 && <1.11+ , megaparsec >=6.4.1 , mtl , mtl-compat , old-time@@ -194,6 +196,7 @@ , temporary , text >=0.11 , time >=1.5+ , transformers , unordered-containers , utf8-string >=0.3.5 , utility-ht >=0.0.13@@ -213,13 +216,13 @@ hs-source-dirs: test ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path- cpp-options: -DVERSION="1.9.1"+ cpp-options: -DVERSION="1.10" build-depends: Decimal , HUnit , ansi-terminal >=0.6.2.3 , base >=4.8 && <4.12- , base-compat >=0.8.1+ , base-compat-batteries >=0.10.1 && <0.11 , bytestring , cmdargs >=0.10 , containers@@ -231,7 +234,8 @@ , haskeline >=0.6 , here , hledger- , hledger-lib >=1.9.1 && <2.0+ , hledger-lib >=1.10 && <1.11+ , megaparsec >=6.4.1 , mtl , mtl-compat , old-time@@ -248,6 +252,7 @@ , test-framework-hunit , text >=0.11 , time >=1.5+ , transformers , unordered-containers , utf8-string >=0.3.5 , utility-ht >=0.0.13@@ -266,25 +271,46 @@ bench ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans -optP-Wno-nonportable-include-path build-depends:- ansi-terminal >=0.6.2.3+ Decimal+ , HUnit+ , ansi-terminal >=0.6.2.3 , base >=4.8 && <4.12- , base-compat >=0.8.1+ , base-compat-batteries >=0.10.1 && <0.11+ , bytestring+ , cmdargs >=0.10+ , containers , criterion+ , csv+ , data-default >=0.5 , directory , file-embed >=0.0.10 , filepath+ , haskeline >=0.6 , here , hledger- , hledger-lib >=1.9.1 && <2.0+ , hledger-lib >=1.10 && <1.11 , html+ , megaparsec >=6.4.1+ , mtl+ , mtl-compat+ , old-time+ , parsec >=3 , pretty-show >=1.6.4 , process+ , regex-tdfa+ , safe >=0.2 , shakespeare >=2.0.2.2+ , split >=0.1 , tabular >=0.2 , temporary+ , text >=0.11 , time >=1.5 , timeit+ , transformers+ , unordered-containers+ , utf8-string >=0.3.5 , utility-ht >=0.0.13+ , wizards >=1.0 if (!(os(windows))) && (flag(terminfo)) build-depends: terminfo
hledger.info view
@@ -3,8 +3,8 @@ File: hledger.info, Node: Top, Next: EXAMPLES, Up: (dir) -hledger(1) hledger 1.9.1-************************+hledger(1) hledger 1.9.99+************************* This is hledger's command-line interface (there are also curses and web interfaces). Its basic function is to read a plain text file describing@@ -390,16 +390,26 @@ Examples: -'2009/1/1', '2009/01/01', '2009-1-1', '2009.1.1' simple dates, several separators allowed-'2009/1', '2009' same as above - a missing day or month defaults to 1-'1/1', 'january', 'jan', 'this year' relative dates, meaning january 1 of the current year-'next year' january 1 of next year-'this month' the 1st of the current month-'this week' the most recent monday-'last week' the monday of the week before this one-'lastweek' spaces are optional-'today', 'yesterday', 'tomorrow'+'2004/10/1', '2004-01-01', '2004.9.1' exact date, several separators allowed. Year is 4+ digits, month is 1-12, day is 1-31+'2004' start of year+'2004/10' start of month+'10/1' month and day in current year+'21' day in current month+'october, oct' start of month in current year+'yesterday, today, tomorrow' -1, 0, 1 days from today+'last/this/next -1, 0, 1 periods from the current period+day/week/month/quarter/year'+'20181201' 8 digit YYYYMMDD with valid year month and day+'201812' 6 digit YYYYMM with valid year and month + Counterexamples - malformed digit sequences might give surprising+results:++'201813' 6 digits with an invalid month is parsed as start of 6-digit year+'20181301' 8 digits with an invalid month is parsed as start of 8-digit year+'20181232' 8 digits with an invalid day gives an error+'201801012' 9+ digits beginning with a valid YYYYMMDD gives an error+ File: hledger.info, Node: Report start & end date, Next: Report intervals, Prev: Smart dates, Up: OPTIONS @@ -635,7 +645,8 @@ ================= The '-V/--value' flag converts reported amounts to their current market-value. Specifically, when there is a market price (P directive) for the+value.+Specifically, when there is a market price (P directive) for the amount's commodity, dated on or before today's date (or the report end date if specified), the amount will be converted to the price's commodity.@@ -658,23 +669,27 @@ How many euros do I have ? -$ hledger -f t.j bal euros+$ hledger -f t.j bal -N euros €100 assets:euros - What are they worth on nov 3 ? (no report end date specified,-defaults to the last date in the journal)+ What are they worth at end of nov 3 ? -$ hledger -f t.j bal euros -V+$ hledger -f t.j bal -N euros -V -e 2016/11/4 $110.00 assets:euros - What are they worth on dec 21 ?+ What are they worth after 2016/12/21 ? (no report end date+specified, defaults to today) -$ hledger -f t.j bal euros -V -e 2016/12/21+$ hledger -f t.j bal -N euros -V $103.00 assets:euros Currently, hledger's -V only uses market prices recorded with P directives, not transaction prices (unlike Ledger). + Currently, -V has a limitation in multicolumn balance reports: it+uses the market prices on the report end date for all columns. (Instead+of the prices on each column's end date.)+ File: hledger.info, Node: Combining -B and -V, Next: Output destination, Prev: Market value, Up: OPTIONS @@ -2418,138 +2433,138 @@ Tag Table: Node: Top68-Node: EXAMPLES1886-Ref: #examples1986-Node: OPTIONS3632-Ref: #options3734-Node: General options4099-Ref: #general-options4224-Node: Command options6823-Ref: #command-options6974-Node: Command arguments7372-Ref: #command-arguments7526-Node: Argument files7647-Ref: #argument-files7798-Node: Special characters8064-Ref: #special-characters8217-Node: Input files9636-Ref: #input-files9772-Node: Smart dates11742-Ref: #smart-dates11883-Node: Report start & end date12862-Ref: #report-start-end-date13032-Node: Report intervals14097-Ref: #report-intervals14260-Node: Period expressions14661-Ref: #period-expressions14821-Node: Depth limiting18778-Ref: #depth-limiting18922-Node: Pivoting19264-Ref: #pivoting19382-Node: Cost21058-Ref: #cost21166-Node: Market value21284-Ref: #market-value21419-Node: Combining -B and -V22602-Ref: #combining--b-and--v22765-Node: Output destination22912-Ref: #output-destination23074-Node: Output format23357-Ref: #output-format23509-Node: Regular expressions23894-Ref: #regular-expressions24031-Node: QUERIES25392-Ref: #queries25494-Node: COMMANDS29456-Ref: #commands29568-Node: accounts30550-Ref: #accounts30648-Node: activity31894-Ref: #activity32004-Node: add32364-Ref: #add32463-Node: balance35124-Ref: #balance35235-Node: Classic balance report38318-Ref: #classic-balance-report38491-Node: Customising the classic balance report39860-Ref: #customising-the-classic-balance-report40088-Node: Colour support42162-Ref: #colour-support42329-Node: Flat mode42502-Ref: #flat-mode42650-Node: Depth limited balance reports43063-Ref: #depth-limited-balance-reports43263-Node: Multicolumn balance report43719-Ref: #multicolumn-balance-report43917-Node: Budget report49097-Ref: #budget-report49240-Ref: #output-format-152274-Node: balancesheet52352-Ref: #balancesheet52488-Node: balancesheetequity54799-Ref: #balancesheetequity54948-Node: cashflow55485-Ref: #cashflow55613-Node: check-dates57736-Ref: #check-dates57863-Node: check-dupes57980-Ref: #check-dupes58104-Node: close58241-Ref: #close58348-Node: help58678-Ref: #help58778-Node: import59852-Ref: #import59966-Node: incomestatement60696-Ref: #incomestatement60830-Node: prices63234-Ref: #prices63349-Node: print63392-Ref: #print63502-Node: print-unique68396-Ref: #print-unique68522-Node: register68590-Ref: #register68717-Node: Custom register output73218-Ref: #custom-register-output73347-Node: register-match74577-Ref: #register-match74711-Node: rewrite74894-Ref: #rewrite75011-Node: stats75080-Ref: #stats75183-Node: tags76053-Ref: #tags76151-Node: test76387-Ref: #test76471-Node: ADD-ON COMMANDS76839-Ref: #add-on-commands76949-Node: Official add-ons78236-Ref: #official-add-ons78376-Node: api78463-Ref: #api78552-Node: ui78604-Ref: #ui78703-Node: web78761-Ref: #web78850-Node: Third party add-ons78896-Ref: #third-party-add-ons79071-Node: diff79206-Ref: #diff79303-Node: iadd79402-Ref: #iadd79516-Node: interest79599-Ref: #interest79720-Node: irr79815-Ref: #irr79913-Node: Experimental add-ons79991-Ref: #experimental-add-ons80143-Node: autosync80423-Ref: #autosync80534-Node: chart80773-Ref: #chart80892-Node: check80963-Ref: #check81065+Node: EXAMPLES1888+Ref: #examples1988+Node: OPTIONS3634+Ref: #options3736+Node: General options4101+Ref: #general-options4226+Node: Command options6825+Ref: #command-options6976+Node: Command arguments7374+Ref: #command-arguments7528+Node: Argument files7649+Ref: #argument-files7800+Node: Special characters8066+Ref: #special-characters8219+Node: Input files9638+Ref: #input-files9774+Node: Smart dates11744+Ref: #smart-dates11885+Node: Report start & end date13291+Ref: #report-start-end-date13461+Node: Report intervals14526+Ref: #report-intervals14689+Node: Period expressions15090+Ref: #period-expressions15250+Node: Depth limiting19207+Ref: #depth-limiting19351+Node: Pivoting19693+Ref: #pivoting19811+Node: Cost21487+Ref: #cost21595+Node: Market value21713+Ref: #market-value21848+Node: Combining -B and -V23214+Ref: #combining--b-and--v23377+Node: Output destination23524+Ref: #output-destination23686+Node: Output format23969+Ref: #output-format24121+Node: Regular expressions24506+Ref: #regular-expressions24643+Node: QUERIES26004+Ref: #queries26106+Node: COMMANDS30068+Ref: #commands30180+Node: accounts31162+Ref: #accounts31260+Node: activity32506+Ref: #activity32616+Node: add32976+Ref: #add33075+Node: balance35736+Ref: #balance35847+Node: Classic balance report38930+Ref: #classic-balance-report39103+Node: Customising the classic balance report40472+Ref: #customising-the-classic-balance-report40700+Node: Colour support42774+Ref: #colour-support42941+Node: Flat mode43114+Ref: #flat-mode43262+Node: Depth limited balance reports43675+Ref: #depth-limited-balance-reports43875+Node: Multicolumn balance report44331+Ref: #multicolumn-balance-report44529+Node: Budget report49709+Ref: #budget-report49852+Ref: #output-format-152886+Node: balancesheet52964+Ref: #balancesheet53100+Node: balancesheetequity55411+Ref: #balancesheetequity55560+Node: cashflow56097+Ref: #cashflow56225+Node: check-dates58348+Ref: #check-dates58475+Node: check-dupes58592+Ref: #check-dupes58716+Node: close58853+Ref: #close58960+Node: help59290+Ref: #help59390+Node: import60464+Ref: #import60578+Node: incomestatement61308+Ref: #incomestatement61442+Node: prices63846+Ref: #prices63961+Node: print64004+Ref: #print64114+Node: print-unique69008+Ref: #print-unique69134+Node: register69202+Ref: #register69329+Node: Custom register output73830+Ref: #custom-register-output73959+Node: register-match75189+Ref: #register-match75323+Node: rewrite75506+Ref: #rewrite75623+Node: stats75692+Ref: #stats75795+Node: tags76665+Ref: #tags76763+Node: test76999+Ref: #test77083+Node: ADD-ON COMMANDS77451+Ref: #add-on-commands77561+Node: Official add-ons78848+Ref: #official-add-ons78988+Node: api79075+Ref: #api79164+Node: ui79216+Ref: #ui79315+Node: web79373+Ref: #web79462+Node: Third party add-ons79508+Ref: #third-party-add-ons79683+Node: diff79818+Ref: #diff79915+Node: iadd80014+Ref: #iadd80128+Node: interest80211+Ref: #interest80332+Node: irr80427+Ref: #irr80525+Node: Experimental add-ons80603+Ref: #experimental-add-ons80755+Node: autosync81035+Ref: #autosync81146+Node: chart81385+Ref: #chart81504+Node: check81575+Ref: #check81677 End Tag Table
hledger.txt view
@@ -332,35 +332,56 @@ Examples: - 2009/1/1, 2009/01/01, simple dates, several sep-- 2009-1-1, 2009.1.1 arators allowed - 2009/1, 2009 same as above - a missing- day or month defaults to 1- 1/1, january, jan, relative dates, meaning- this year january 1 of the current- year- next year january 1 of next year- this month the 1st of the current- month- this week the most recent monday- last week the monday of the week- before this one- lastweek spaces are optional- today, yesterday, tomorrow ++ 2004/10/1, 2004-01-01, exact date, several sepa-+ 2004.9.1 rators allowed. Year is+ 4+ digits, month is 1-12,+ day is 1-31+ 2004 start of year+ 2004/10 start of month+ 10/1 month and day in current+ year+ 21 day in current month+ october, oct start of month in current+ year+ yesterday, today, tomorrow -1, 0, 1 days from today+ last/this/next day/week/month/quar- -1, 0, 1 periods from the+ ter/year current period+ 20181201 8 digit YYYYMMDD with+ valid year month and day+ 201812 6 digit YYYYMM with valid+ year and month++ Counterexamples - malformed digit sequences might give surprising+ results:+++ 201813 6 digits with an invalid+ month is parsed as start+ of 6-digit year+ 20181301 8 digits with an invalid+ month is parsed as start+ of 8-digit year+ 20181232 8 digits with an invalid+ day gives an error+ 201801012 9+ digits beginning with a+ valid YYYYMMDD gives an+ error+ Report start & end date- Most hledger reports show the full span of time represented by the+ Most hledger reports show the full span of time represented by the journal data, by default. So, the effective report start and end dates- will be the earliest and latest transaction or posting dates found in+ will be the earliest and latest transaction or posting dates found in the journal. - Often you will want to see a shorter time span, such as the current- month. You can specify a start and/or end date using -b/--begin,+ Often you will want to see a shorter time span, such as the current+ month. You can specify a start and/or end date using -b/--begin, -e/--end, -p/--period or a date: query (described below). All of these- accept the smart date syntax. One important thing to be aware of when- specifying end dates: as in Ledger, end dates are exclusive, so you+ accept the smart date syntax. One important thing to be aware of when+ specifying end dates: as in Ledger, end dates are exclusive, so you need to write the date after the last day you want to include. Examples:@@ -370,10 +391,10 @@ 2016 -e 12/1 end at the start of decem- ber 1st of the current- year (11/30 will be the+ year (11/30 will be the last date included)- -b thismonth all transactions on or- after the 1st of the cur-+ -b thismonth all transactions on or+ after the 1st of the cur- rent month -p thismonth all transactions in the current month@@ -385,24 +406,24 @@ Report intervals A report interval can be specified so that commands like register, bal-- ance and activity will divide their reports into multiple subperiods.- The basic intervals can be selected with one of -D/--daily,- -W/--weekly, -M/--monthly, -Q/--quarterly, or -Y/--yearly. More com-- plex intervals may be specified with a period expression. Report+ ance and activity will divide their reports into multiple subperiods.+ The basic intervals can be selected with one of -D/--daily,+ -W/--weekly, -M/--monthly, -Q/--quarterly, or -Y/--yearly. More com-+ plex intervals may be specified with a period expression. Report intervals can not be specified with a query, currently. Period expressions- The -p/--period option accepts period expressions, a shorthand way of- expressing a start date, end date, and/or report interval all at once.+ The -p/--period option accepts period expressions, a shorthand way of+ expressing a start date, end date, and/or report interval all at once. - Here's a basic period expression specifying the first quarter of 2009.- Note, hledger always treats start dates as inclusive and end dates as+ Here's a basic period expression specifying the first quarter of 2009.+ Note, hledger always treats start dates as inclusive and end dates as exclusive: -p "from 2009/1/1 to 2009/4/1" - Keywords like "from" and "to" are optional, and so are the spaces, as- long as you don't run two dates together. "to" can also be written as+ Keywords like "from" and "to" are optional, and so are the spaces, as+ long as you don't run two dates together. "to" can also be written as "-". These are equivalent to the above: @@ -410,7 +431,7 @@ -p2009/1/1to2009/4/1 -p2009/1/1-2009/4/1 - Dates are smart dates, so if the current year is 2009, the above can+ Dates are smart dates, so if the current year is 2009, the above can also be written as: @@ -426,25 +447,25 @@ 1, 2009 -p "from 2009/1" the same -p "from 2009" the same- -p "to 2009" everything before january+ -p "to 2009" everything before january 1, 2009 - A single date with no "from" or "to" defines both the start and end+ A single date with no "from" or "to" defines both the start and end date like so: - -p "2009" the year 2009; equivalent+ -p "2009" the year 2009; equivalent to "2009/1/1 to 2010/1/1"- -p "2009/1" the month of jan; equiva-+ -p "2009/1" the month of jan; equiva- lent to "2009/1/1 to 2009/2/1"- -p "2009/1/1" just that day; equivalent+ -p "2009/1/1" just that day; equivalent to "2009/1/1 to 2009/1/2" - The argument of -p can also begin with, or be, a report interval- expression. The basic report intervals are daily, weekly, monthly,+ The argument of -p can also begin with, or be, a report interval+ expression. The basic report intervals are daily, weekly, monthly, quarterly, or yearly, which have the same effect as the -D,-W,-M,-Q, or- -Y flags. Between report interval and start/end dates (if any), the+ -Y flags. Between report interval and start/end dates (if any), the word in is optional. Examples: @@ -452,23 +473,23 @@ -p "monthly in 2008" -p "quarterly" - Note that weekly, monthly, quarterly and yearly intervals will always+ Note that weekly, monthly, quarterly and yearly intervals will always start on the first day on week, month, quarter or year accordingly, and- will end on the last day of same period, even if associated period+ will end on the last day of same period, even if associated period expression specifies different explicit start and end date. For example: -p "weekly from 2009/1/1 to 2009/4/1" -- starts on 2008/12/29, closest preceed-+ starts on 2008/12/29, closest preceed- ing Monday- -p "monthly in 2008/11/25" - starts on+ -p "monthly in 2008/11/25" - starts on 2018/11/01 -p "quar- terly from 2009-05-05 to 2009-06-01" -- starts on 2009/04/01, ends on- 2009/06/30, which are first and last+ starts on 2009/04/01, ends on+ 2009/06/30, which are first and last days of Q2 2009 -p "yearly from 2009-12-29" - starts on 2009/01/01, first day of 2009@@ -477,7 +498,7 @@ biweekly, bimonthly, every day|week|month|quarter|year, every N days|weeks|months|quarters|years. - All of these will start on the first day of the requested period and+ All of these will start on the first day of the requested period and end on the last one, as described above. Examples:@@ -486,13 +507,13 @@ -p "bimonthly from 2008" - periods will have boundaries on 2008/01/01, 2008/03/01, ...- -p "every 2 weeks" - starts on closest+ -p "every 2 weeks" - starts on closest preceeding Monday -p "every 5 month from 2009/03" - peri- ods will have boundaries on 2009/03/01, 2009/08/01, ... - If you want intervals that start on arbitrary day of your choosing and+ If you want intervals that start on arbitrary day of your choosing and span a week, month or year, you need to use any of the following: every Nth day of week, every <weekday>, every Nth day [of month],@@ -502,47 +523,47 @@ Examples: - -p "every 2nd day of week" - periods+ -p "every 2nd day of week" - periods will go from Tue to Tue -p "every Tue" - same -p "every 15th day" - period boundaries will be on 15th of each month- -p "every 2nd Monday" - period bound-- aries will be on second Monday of each+ -p "every 2nd Monday" - period bound-+ aries will be on second Monday of each month- -p "every 11/05" - yearly periods with+ -p "every 11/05" - yearly periods with boundaries on 5th of Nov -p "every 5th Nov" - same -p "every Nov 5th" - same - Show historical balances at end of 15th each month (N is exclusive end+ Show historical balances at end of 15th each month (N is exclusive end date): hledger balance -H -p "every 16th day" - Group postings from start of wednesday to end of next tuesday (N is+ Group postings from start of wednesday to end of next tuesday (N is start date and exclusive end date): hledger register checking -p "every 3rd day of week" Depth limiting With the --depth N option (short form: -N), commands like account, bal-- ance and register will show only the uppermost accounts in the account- tree, down to level N. Use this when you want a summary with less- detail. This flag has the same effect as a depth: query argument (so+ ance and register will show only the uppermost accounts in the account+ tree, down to level N. Use this when you want a summary with less+ detail. This flag has the same effect as a depth: query argument (so -2, --depth=2 or depth:2 are basically equivalent). Pivoting Normally hledger sums amounts, and organizes them in a hierarchy, based- on account name. The --pivot FIELD option causes it to sum and orga-- nize hierarchy based on the value of some other field instead. FIELD+ on account name. The --pivot FIELD option causes it to sum and orga-+ nize hierarchy based on the value of some other field instead. FIELD can be: code, description, payee, note, or the full name (case insensi- tive) of any tag. As with account names, values containing colon:sepa- rated:parts will be displayed hierarchically in reports. - --pivot is a general option affecting all reports; you can think of+ --pivot is a general option affecting all reports; you can think of hledger transforming the journal before any other processing, replacing- every posting's account name with the value of the specified field on+ every posting's account name with the value of the specified field on that posting, inheriting it from the transaction or using a blank value if it's not present. @@ -568,7 +589,7 @@ -------------------- 0 - One way to show only amounts with a member: value (using a query,+ One way to show only amounts with a member: value (using a query, described below): $ hledger balance --pivot member tag:member=.@@ -576,7 +597,7 @@ -------------------- -2 EUR - Another way (the acct: query matches against the pivoted "account+ Another way (the acct: query matches against the pivoted "account name"): $ hledger balance --pivot member acct:.@@ -585,17 +606,18 @@ -2 EUR Cost- The -B/--cost flag converts amounts to their cost at transaction time,+ The -B/--cost flag converts amounts to their cost at transaction time, if they have a transaction price specified. Market value- The -V/--value flag converts reported amounts to their current market- value. Specifically, when there is a market price (P directive) for- the amount's commodity, dated on or before today's date (or the report- end date if specified), the amount will be converted to the price's- commodity.+ The -V/--value flag converts reported amounts to their current market+ value.+ Specifically, when there is a market price (P directive) for the+ amount's commodity, dated on or before today's date (or the report end+ date if specified), the amount will be converted to the price's commod-+ ity. - When there are multiple applicable P directives, -V chooses the most+ When there are multiple applicable P directives, -V chooses the most recent one, or in case of equal dates, the last-parsed one. For example:@@ -613,39 +635,43 @@ How many euros do I have ? - $ hledger -f t.j bal euros+ $ hledger -f t.j bal -N euros 100 assets:euros - What are they worth on nov 3 ? (no report end date specified, defaults- to the last date in the journal)+ What are they worth at end of nov 3 ? - $ hledger -f t.j bal euros -V+ $ hledger -f t.j bal -N euros -V -e 2016/11/4 $110.00 assets:euros - What are they worth on dec 21 ?+ What are they worth after 2016/12/21 ? (no report end date specified,+ defaults to today) - $ hledger -f t.j bal euros -V -e 2016/12/21+ $ hledger -f t.j bal -N euros -V $103.00 assets:euros - Currently, hledger's -V only uses market prices recorded with P direc-+ Currently, hledger's -V only uses market prices recorded with P direc- tives, not transaction prices (unlike Ledger). + Currently, -V has a limitation in multicolumn balance reports: it uses+ the market prices on the report end date for all columns. (Instead of+ the prices on each column's end date.)+ Combining -B and -V- Using -B/-cost and -V/-value together is currently allowed, but the+ Using -B/-cost and -V/-value together is currently allowed, but the results are probably not meaningful. Let us know if you find a use for this. Output destination- Some commands (print, register, stats, the balance commands) can write- their output to a destination other than the console. This is con-+ Some commands (print, register, stats, the balance commands) can write+ their output to a destination other than the console. This is con- trolled by the -o/--output-file option. $ hledger balance -o - # write to stdout (the default) $ hledger balance -o FILE # write to FILE Output format- Some commands can write their output in other formats. Eg print and- register can output CSV, and the balance commands can output CSV or+ Some commands can write their output in other formats. Eg print and+ register can output CSV, and the balance commands can output CSV or HTML. This is controlled by the -O/--output-format option, or by spec- ifying a .csv or .html file extension with -o/--output-file. @@ -655,56 +681,56 @@ Regular expressions hledger uses regular expressions in a number of places: - o query terms, on the command line and in the hledger-web search form:+ o query terms, on the command line and in the hledger-web search form: REGEX, desc:REGEX, cur:REGEX, tag:...=REGEX o CSV rules conditional blocks: if REGEX ... - o account alias directives and options: alias /REGEX/ = REPLACEMENT,+ o account alias directives and options: alias /REGEX/ = REPLACEMENT, --alias /REGEX/=REPLACEMENT - hledger's regular expressions come from the regex-tdfa library. In+ hledger's regular expressions come from the regex-tdfa library. In general they: o are case insensitive - o are infix matching (do not need to match the entire thing being+ o are infix matching (do not need to match the entire thing being matched) o are POSIX extended regular expressions o also support GNU word boundaries (\<, \>, \b, \B) - o and parenthesised capturing groups and numeric backreferences in+ o and parenthesised capturing groups and numeric backreferences in replacement strings o do not support mode modifiers like (?s) Some things to note: - o In the alias directive and --alias option, regular expressions must- be enclosed in forward slashes (/REGEX/). Elsewhere in hledger,+ o In the alias directive and --alias option, regular expressions must+ be enclosed in forward slashes (/REGEX/). Elsewhere in hledger, these are not required. - o In queries, to match a regular expression metacharacter like $ as a- literal character, prepend a backslash. Eg to search for amounts+ o In queries, to match a regular expression metacharacter like $ as a+ literal character, prepend a backslash. Eg to search for amounts with the dollar sign in hledger-web, write cur:\$. - o On the command line, some metacharacters like $ have a special mean-+ o On the command line, some metacharacters like $ have a special mean- ing to the shell and so must be escaped at least once more. See Spe- cial characters. QUERIES- One of hledger's strengths is being able to quickly report on precise- subsets of your data. Most commands accept an optional query expres-- sion, written as arguments after the command name, to filter the data- by date, account name or other criteria. The syntax is similar to a+ One of hledger's strengths is being able to quickly report on precise+ subsets of your data. Most commands accept an optional query expres-+ sion, written as arguments after the command name, to filter the data+ by date, account name or other criteria. The syntax is similar to a web search: one or more space-separated search terms, quotes to enclose- whitespace, prefixes to match specific fields, a not: prefix to negate+ whitespace, prefixes to match specific fields, a not: prefix to negate the match. - We do not yet support arbitrary boolean combinations of search terms;- instead most commands show transactions/postings/accounts which match+ We do not yet support arbitrary boolean combinations of search terms;+ instead most commands show transactions/postings/accounts which match (or negatively match): o any of the description terms AND@@ -725,31 +751,31 @@ o match all the other terms. - The following kinds of search terms can be used. Remember these can+ The following kinds of search terms can be used. Remember these can also be prefixed with not:, eg to exclude a particular subaccount. REGEX, acct:REGEX- match account names by this regular expression. (With no pre-+ match account names by this regular expression. (With no pre- fix, acct: is assumed.) same as above amt:N, amt:<N, amt:<=N, amt:>N, amt:>=N- match postings with a single-commodity amount that is equal to,- less than, or greater than N. (Multi-commodity amounts are not+ match postings with a single-commodity amount that is equal to,+ less than, or greater than N. (Multi-commodity amounts are not tested, and will always match.) The comparison has two modes: if N is preceded by a + or - sign (or is 0), the two signed numbers- are compared. Otherwise, the absolute magnitudes are compared,+ are compared. Otherwise, the absolute magnitudes are compared, ignoring sign. code:REGEX match by transaction code (eg check number) cur:REGEX- match postings or transactions including any amounts whose cur-- rency/commodity symbol is fully matched by REGEX. (For a par-+ match postings or transactions including any amounts whose cur-+ rency/commodity symbol is fully matched by REGEX. (For a par- tial match, use .*REGEX.*). Note, to match characters which are regex-significant, like the dollar sign ($), you need to prepend- \. And when using the command line you need to add one more+ \. And when using the command line you need to add one more level of quoting to hide it from the shell, so eg do: hledger print cur:'\$' or hledger print cur:\\$. @@ -758,20 +784,20 @@ date:PERIODEXPR match dates within the specified period. PERIODEXPR is a period- expression (with no report interval). Examples: date:2016,- date:thismonth, date:2000/2/1-2/15, date:lastweek-. If the- --date2 command line flag is present, this matches secondary+ expression (with no report interval). Examples: date:2016,+ date:thismonth, date:2000/2/1-2/15, date:lastweek-. If the+ --date2 command line flag is present, this matches secondary dates instead. date2:PERIODEXPR match secondary dates within the specified period. depth:N- match (or display, depending on command) accounts at or above+ match (or display, depending on command) accounts at or above this depth note:REGEX- match transaction notes (part of description right of |, or+ match transaction notes (part of description right of |, or whole description when there's no |) payee:REGEX@@ -785,38 +811,38 @@ match unmarked, pending, or cleared transactions respectively tag:REGEX[=REGEX]- match by tag name, and optionally also by tag value. Note a- tag: query is considered to match a transaction if it matches- any of the postings. Also remember that postings inherit the+ match by tag name, and optionally also by tag value. Note a+ tag: query is considered to match a transaction if it matches+ any of the postings. Also remember that postings inherit the tags of their parent transaction. The following special search term is used automatically in hledger-web, only: inacct:ACCTNAME- tells hledger-web to show the transaction register for this+ tells hledger-web to show the transaction register for this account. Can be filtered further with acct etc. Some of these can also be expressed as command-line options (eg depth:2- is equivalent to --depth 2). Generally you can mix options and query- arguments, and the resulting query will be their intersection (perhaps+ is equivalent to --depth 2). Generally you can mix options and query+ arguments, and the resulting query will be their intersection (perhaps excluding the -p/--period option). COMMANDS- hledger provides a number of subcommands; hledger with no arguments+ hledger provides a number of subcommands; hledger with no arguments shows a list. If you install additional hledger-* packages, or if you put programs or- scripts named hledger-NAME in your PATH, these will also be listed as+ scripts named hledger-NAME in your PATH, these will also be listed as subcommands. - Run a subcommand by writing its name as first argument (eg+ Run a subcommand by writing its name as first argument (eg hledger incomestatement). You can also write one of the standard short- aliases displayed in parentheses in the command list (hledger b), or+ aliases displayed in parentheses in the command list (hledger b), or any any unambiguous prefix of a command name (hledger inc). - Here are all the builtin commands in alphabetical order. See also- hledger for a more organised command list, and hledger CMD -h for+ Here are all the builtin commands in alphabetical order. See also+ hledger for a more organised command list, and hledger CMD -h for detailed command help. accounts@@ -834,12 +860,12 @@ --drop=N in flat mode: omit N leading account name parts - This command lists account names, either declared with account direc-- tives (-declared), posted to (-used), or both (default). With query- arguments, only matched account names and account names referenced by- matched postings are shown. It shows a flat list by default. With- --tree, it uses indentation to show the account hierarchy. In flat- mode you can add --drop N to omit the first few account name compo-+ This command lists account names, either declared with account direc-+ tives (-declared), posted to (-used), or both (default). With query+ arguments, only matched account names and account names referenced by+ matched postings are shown. It shows a flat list by default. With+ --tree, it uses indentation to show the account hierarchy. In flat+ mode you can add --drop N to omit the first few account name compo- nents. Account names can be depth-clipped with --depth N or depth:N. Examples:@@ -882,8 +908,8 @@ activity Show an ascii barchart of posting counts per interval. - The activity command displays an ascii histogram showing transaction- counts by day, week, month or other reporting interval (by day is the+ The activity command displays an ascii histogram showing transaction+ counts by day, week, month or other reporting interval (by day is the default). With query arguments, it counts only matched transactions. $ hledger activity --quarterly@@ -896,24 +922,24 @@ Prompt for transactions and add them to the journal. --no-new-accounts- don't allow creating new accounts; helps prevent typos when+ don't allow creating new accounts; helps prevent typos when entering account names - Many hledger users edit their journals directly with a text editor, or- generate them from CSV. For more interactive data entry, there is the- add command, which prompts interactively on the console for new trans-- actions, and appends them to the journal file (if there are multiple+ Many hledger users edit their journals directly with a text editor, or+ generate them from CSV. For more interactive data entry, there is the+ add command, which prompts interactively on the console for new trans-+ actions, and appends them to the journal file (if there are multiple -f FILE options, the first file is used.) Existing transactions are not- changed. This is the only hledger command that writes to the journal+ changed. This is the only hledger command that writes to the journal file. To use it, just run hledger add and follow the prompts. You can add as- many transactions as you like; when you are finished, enter . or press+ many transactions as you like; when you are finished, enter . or press control-d or control-c to exit. Features: - o add tries to provide useful defaults, using the most similar recent+ o add tries to provide useful defaults, using the most similar recent transaction (by description) as a template. o You can also set the initial defaults with command line arguments.@@ -921,20 +947,20 @@ o Readline-style edit keys can be used during data entry. o The tab key will auto-complete whenever possible - accounts, descrip-- tions, dates (yesterday, today, tomorrow). If the input area is+ tions, dates (yesterday, today, tomorrow). If the input area is empty, it will insert the default value. - o If the journal defines a default commodity, it will be added to any+ o If the journal defines a default commodity, it will be added to any bare numbers entered. o A parenthesised transaction code may be entered following a date. o Comments and tags may be entered following a description or amount. - o If you make a mistake, enter < at any prompt to restart the transac-+ o If you make a mistake, enter < at any prompt to restart the transac- tion. - o Input prompts are displayed in a different colour when the terminal+ o Input prompts are displayed in a different colour when the terminal supports it. Example (see the tutorial for a detailed explanation):@@ -971,7 +997,7 @@ show balance change in each period (default) --cumulative- show balance change accumulated across periods (in multicolumn+ show balance change accumulated across periods (in multicolumn reports) -H --historical@@ -1006,14 +1032,14 @@ select the output format. Supported formats: txt, csv, html. -o FILE --output-file=FILE- write output to FILE. A file extension matching one of the+ write output to FILE. A file extension matching one of the above formats selects that format. --pretty-tables use unicode to display prettier tables. --sort-amount- sort by amount instead of account code/name (in flat mode).+ sort by amount instead of account code/name (in flat mode). With multiple columns, sorts by the row total, or by row average if that is displayed. @@ -1021,36 +1047,36 @@ display all amounts with reversed sign --budget- show performance compared to budget goals defined by periodic+ show performance compared to budget goals defined by periodic transactions --show-unbudgeted with -budget, show unbudgeted accounts also The balance command is hledger's most versatile command. Note, despite- the name, it is not always used for showing real-world account bal-- ances; the more accounting-aware balancesheet and incomestatement may+ the name, it is not always used for showing real-world account bal-+ ances; the more accounting-aware balancesheet and incomestatement may be more convenient for that. By default, it displays all accounts, and each account's change in bal- ance during the entire period of the journal. Balance changes are cal-- culated by adding up the postings in each account. You can limit the- postings matched, by a query, to see fewer accounts, changes over a+ culated by adding up the postings in each account. You can limit the+ postings matched, by a query, to see fewer accounts, changes over a different time period, changes from only cleared transactions, etc. If you include an account's complete history of postings in the report,- the balance change is equivalent to the account's current ending bal-- ance. For a real-world account, typically you won't have all transac-+ the balance change is equivalent to the account's current ending bal-+ ance. For a real-world account, typically you won't have all transac- tions in the journal; instead you'll have all transactions after a cer-- tain date, and an "opening balances" transaction setting the correct- starting balance on that date. Then the balance command will show- real-world account balances. In some cases the -H/-historical flag is+ tain date, and an "opening balances" transaction setting the correct+ starting balance on that date. Then the balance command will show+ real-world account balances. In some cases the -H/-historical flag is used to ensure this (more below). The balance command can produce several styles of report: Classic balance report- This is the original balance report, as found in Ledger. It usually+ This is the original balance report, as found in Ledger. It usually looks like this: $ hledger balance@@ -1067,23 +1093,23 @@ -------------------- 0 - By default, accounts are displayed hierarchically, with subaccounts- indented below their parent. At each level of the tree, accounts are- sorted by account code if any, then by account name. Or with+ By default, accounts are displayed hierarchically, with subaccounts+ indented below their parent. At each level of the tree, accounts are+ sorted by account code if any, then by account name. Or with -S/--sort-amount, by their balance amount. "Boring" accounts, which contain a single interesting subaccount and no- balance of their own, are elided into the following line for more com-- pact output. (Eg above, the "liabilities" account.) Use --no-elide to+ balance of their own, are elided into the following line for more com-+ pact output. (Eg above, the "liabilities" account.) Use --no-elide to prevent this. - Account balances are "inclusive" - they include the balances of any+ Account balances are "inclusive" - they include the balances of any subaccounts. - Accounts which have zero balance (and no non-zero subaccounts) are+ Accounts which have zero balance (and no non-zero subaccounts) are omitted. Use -E/--empty to show them. - A final total is displayed by default; use -N/--no-total to suppress+ A final total is displayed by default; use -N/--no-total to suppress it, eg: $ hledger balance -p 2008/6 expenses --no-total@@ -1092,7 +1118,7 @@ $1 supplies Customising the classic balance report- You can customise the layout of classic balance reports with --for-+ You can customise the layout of classic balance reports with --for- mat FMT: $ hledger balance --format "%20(account) %12(total)"@@ -1110,7 +1136,7 @@ 0 The FMT format string (plus a newline) specifies the formatting applied- to each account/balance pair. It may contain any suitable text, with+ to each account/balance pair. It may contain any suitable text, with data fields interpolated like so: %[MIN][.MAX](FIELDNAME)@@ -1121,14 +1147,14 @@ o FIELDNAME must be enclosed in parentheses, and can be one of: - o depth_spacer - a number of spaces equal to the account's depth, or+ o depth_spacer - a number of spaces equal to the account's depth, or if MIN is specified, MIN * depth spaces. o account - the account's name o total - the account's balance/posted total, right justified - Also, FMT can begin with an optional prefix to control how multi-com-+ Also, FMT can begin with an optional prefix to control how multi-com- modity amounts are rendered: o %_ - render on multiple lines, bottom-aligned (the default)@@ -1137,7 +1163,7 @@ o %, - render on one line, comma-separated - There are some quirks. Eg in one-line mode, %(depth_spacer) has no+ There are some quirks. Eg in one-line mode, %(depth_spacer) has no effect, instead %(account) has indentation built in. Experimentation may be needed to get pleasing results. @@ -1145,14 +1171,14 @@ o %(total) - the account's total - o %-20.20(account) - the account's name, left justified, padded to 20+ o %-20.20(account) - the account's name, left justified, padded to 20 characters and clipped at 20 characters - o %,%-50(account) %25(total) - account name padded to 50 characters,- total padded to 20 characters, with multiple commodities rendered on+ o %,%-50(account) %25(total) - account name padded to 50 characters,+ total padded to 20 characters, with multiple commodities rendered on one line - o %20(total) %2(depth_spacer)%-(account) - the default format for the+ o %20(total) %2(depth_spacer)%-(account) - the default format for the single-column balance report Colour support@@ -1163,9 +1189,9 @@ o the output is not being redirected or piped anywhere Flat mode- To see a flat list instead of the default hierarchical display, use- --flat. In this mode, accounts (unless depth-clipped) show their full- names and "exclusive" balance, excluding any subaccount balances. In+ To see a flat list instead of the default hierarchical display, use+ --flat. In this mode, accounts (unless depth-clipped) show their full+ names and "exclusive" balance, excluding any subaccount balances. In this mode, you can also use --drop N to omit the first few account name components. @@ -1174,8 +1200,8 @@ $1 supplies Depth limited balance reports- With --depth N or depth:N or just -N, balance reports show accounts- only to the specified numeric depth. This is very useful to summarise+ With --depth N or depth:N or just -N, balance reports show accounts+ only to the specified numeric depth. This is very useful to summarise a complex set of accounts and get an overview. $ hledger balance -N -1@@ -1188,17 +1214,17 @@ inclusive balances at the depth limit. Multicolumn balance report- Multicolumn or tabular balance reports are a very useful hledger fea-- ture, and usually the preferred style. They share many of the above- features, but they show the report as a table, with columns represent-- ing time periods. This mode is activated by providing a reporting+ Multicolumn or tabular balance reports are a very useful hledger fea-+ ture, and usually the preferred style. They share many of the above+ features, but they show the report as a table, with columns represent-+ ing time periods. This mode is activated by providing a reporting interval. - There are three types of multicolumn balance report, showing different+ There are three types of multicolumn balance report, showing different information: 1. By default: each column shows the sum of postings in that period, ie- the account's change of balance in that period. This is useful eg+ the account's change of balance in that period. This is useful eg for a monthly income statement: $ hledger balance --quarterly income expenses -E@@ -1213,8 +1239,8 @@ -------------------++--------------------------------- || $-1 $1 0 0 - 2. With --cumulative: each column shows the ending balance for that- period, accumulating the changes across periods, starting from 0 at+ 2. With --cumulative: each column shows the ending balance for that+ period, accumulating the changes across periods, starting from 0 at the report start date: $ hledger balance --quarterly income expenses -E --cumulative@@ -1230,8 +1256,8 @@ || $-1 0 0 0 3. With --historical/-H: each column shows the actual historical ending- balance for that period, accumulating the changes across periods,- starting from the actual balance at the report start date. This is+ balance for that period, accumulating the changes across periods,+ starting from the actual balance at the report start date. This is useful eg for a multi-period balance sheet, and when you are showing only the data after a certain start date: @@ -1247,26 +1273,26 @@ ----------------------++------------------------------------- || 0 0 0 - Multicolumn balance reports display accounts in flat mode by default;+ Multicolumn balance reports display accounts in flat mode by default; to see the hierarchy, use --tree. - With a reporting interval (like --quarterly above), the report- start/end dates will be adjusted if necessary so that they encompass+ With a reporting interval (like --quarterly above), the report+ start/end dates will be adjusted if necessary so that they encompass the displayed report periods. This is so that the first and last peri- ods will be "full" and comparable to the others. - The -E/--empty flag does two things in multicolumn balance reports:- first, the report will show all columns within the specified report- period (without -E, leading and trailing columns with all zeroes are- not shown). Second, all accounts which existed at the report start- date will be considered, not just the ones with activity during the+ The -E/--empty flag does two things in multicolumn balance reports:+ first, the report will show all columns within the specified report+ period (without -E, leading and trailing columns with all zeroes are+ not shown). Second, all accounts which existed at the report start+ date will be considered, not just the ones with activity during the report period (use -E to include low-activity accounts which would oth- erwise would be omitted). The -T/--row-total flag adds an additional column showing the total for each row. - The -A/--average flag adds a column showing the average value in each+ The -A/--average flag adds a column showing the average value in each row. Here's an example of all three:@@ -1290,20 +1316,20 @@ Limitations: In multicolumn reports the -V/--value flag uses the market price on the- report end date, for all columns (not the price on each column's end+ report end date, for all columns (not the price on each column's end date). - Eliding of boring parent accounts in tree mode, as in the classic bal-+ Eliding of boring parent accounts in tree mode, as in the classic bal- ance report, is not yet supported in multicolumn reports. Budget report- With --budget, extra columns are displayed showing budget goals for- each account and period, if any. Budget goals are defined by periodic- transactions. This is very useful for comparing planned and actual+ With --budget, extra columns are displayed showing budget goals for+ each account and period, if any. Budget goals are defined by periodic+ transactions. This is very useful for comparing planned and actual income, expenses, time usage, etc. -budget is most often combined with a report interval. - For example, you can take average monthly expenses in the common+ For example, you can take average monthly expenses in the common expense categories to construct a minimal monthly budget: ;; Budget@@ -1346,7 +1372,7 @@ ----------------------++------------------------------------------------- || 0 0 - By default, only accounts with budget goals during the report period+ By default, only accounts with budget goals during the report period are shown. --show-unbudgeted shows unbudgeted accounts as well. Top-level accounts with no budget goals anywhere below them are grouped under <unbudgeted>.@@ -1367,22 +1393,22 @@ ----------------------++------------------------------------------------- || 0 0 - Note, the -S/--sort-amount flag is not yet fully supported with --bud-+ Note, the -S/--sort-amount flag is not yet fully supported with --bud- get. For more examples, see Budgeting and Forecasting. Output format- The balance command supports output destination and output format+ The balance command supports output destination and output format selection. balancesheet This command displays a simple balance sheet, showing historical ending- balances of asset and liability accounts (ignoring any report begin- date). It assumes that these accounts are under a top-level asset or- liability account (case insensitive, plural forms also allowed). Note- this report shows all account balances with normal positive sign (like- conventional financial statements, unlike balance/print/register)+ balances of asset and liability accounts (ignoring any report begin+ date). It assumes that these accounts are under a top-level asset or+ liability account (case insensitive, plural forms also allowed). Note+ this report shows all account balances with normal positive sign (like+ conventional financial statements, unlike balance/print/register) (experimental). (bs) --change@@ -1390,7 +1416,7 @@ balances --cumulative- show balance change accumulated across periods (in multicolumn+ show balance change accumulated across periods (in multicolumn reports), instead of historical ending balances -H --historical@@ -1446,16 +1472,16 @@ 0 With a reporting interval, multiple columns will be shown, one for each- report period. As with multicolumn balance reports, you can alter the- report mode with --change/--cumulative/--historical. Normally bal-- ancesheet shows historical ending balances, which is what you need for+ report period. As with multicolumn balance reports, you can alter the+ report mode with --change/--cumulative/--historical. Normally bal-+ ancesheet shows historical ending balances, which is what you need for a balance sheet; note this means it ignores report begin dates. - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. balancesheetequity- Just like balancesheet, but also reports Equity (which it assumes is+ Just like balancesheet, but also reports Equity (which it assumes is under a top-level equity account). Example:@@ -1485,10 +1511,10 @@ 0 cashflow- This command displays a simple cashflow statement, showing changes in- "cash" accounts. It assumes that these accounts are under a top-level- asset account (case insensitive, plural forms also allowed) and do not- contain receivable or A/R in their name. Note this report shows all+ This command displays a simple cashflow statement, showing changes in+ "cash" accounts. It assumes that these accounts are under a top-level+ asset account (case insensitive, plural forms also allowed) and do not+ contain receivable or A/R in their name. Note this report shows all account balances with normal positive sign (like conventional financial statements, unlike balance/print/register) (experimental). (cf) @@ -1496,7 +1522,7 @@ show balance change in each period (default) --cumulative- show balance change accumulated across periods (in multicolumn+ show balance change accumulated across periods (in multicolumn reports), instead of changes during periods -H --historical@@ -1547,38 +1573,38 @@ $-1 With a reporting interval, multiple columns will be shown, one for each- report period. Normally cashflow shows changes in assets per period,- though as with multicolumn balance reports you can alter the report+ report period. Normally cashflow shows changes in assets per period,+ though as with multicolumn balance reports you can alter the report mode with --change/--cumulative/--historical. - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. check-dates- Check that transactions are sorted by increasing date. With a query,+ Check that transactions are sorted by increasing date. With a query, only matched transactions' dates are checked. check-dupes- Report account names having the same leaf but different prefixes. An+ Report account names having the same leaf but different prefixes. An example: http://stefanorodighiero.net/software/hledger-dupes.html close- Print closing/opening transactions that bring some or all account bal-- ances to zero and back. Can be useful for bringing asset/liability+ Print closing/opening transactions that bring some or all account bal-+ ances to zero and back. Can be useful for bringing asset/liability balances across file boundaries, or for closing out income/expenses for- a period. This was formerly called "equity", as in Ledger, and that+ a period. This was formerly called "equity", as in Ledger, and that alias is also accepted. See close -help for more. help Show any of the hledger manuals. - The help command displays any of the main hledger manuals, in one of- several ways. Run it with no argument to list the manuals, or provide+ The help command displays any of the main hledger manuals, in one of+ several ways. Run it with no argument to list the manuals, or provide a full or partial manual name to select one. - hledger manuals are available in several formats. hledger help will- use the first of these display methods that it finds: info, man,- $PAGER, less, stdout (or when non-interactive, just stdout). You can+ hledger manuals are available in several formats. hledger help will+ use the first of these display methods that it finds: info, man,+ $PAGER, less, stdout (or when non-interactive, just stdout). You can force a particular viewer with the --info, --man, --pager, --cat flags. $ hledger help@@ -1602,7 +1628,7 @@ ... import- Read new transactions added to each FILE since last run, and add them+ Read new transactions added to each FILE since last run, and add them to the main journal file. --dry-run@@ -1612,28 +1638,28 @@ each one. So eg to add new transactions from all CSV files to the main journal, it's just: hledger import *.csv - New transactions are detected in the same way as print -new: by assum-+ New transactions are detected in the same way as print -new: by assum- ing transactions are always added to the input files in increasing date order, and by saving .latest.FILE state files. - The -dry-run output is in journal format, so you can filter it, eg to+ The -dry-run output is in journal format, so you can filter it, eg to see only uncategorised transactions: $ hledger import --dry ... | hledger -f- print unknown --ignore-assertions incomestatement- This command displays a simple income statement, showing revenues and- expenses during a period. It assumes that these accounts are under a- top-level revenue or income or expense account (case insensitive, plu-- ral forms also allowed). Note this report shows all account balances- with normal positive sign (like conventional financial statements,+ This command displays a simple income statement, showing revenues and+ expenses during a period. It assumes that these accounts are under a+ top-level revenue or income or expense account (case insensitive, plu-+ ral forms also allowed). Note this report shows all account balances+ with normal positive sign (like conventional financial statements, unlike balance/print/register) (experimental). (is) --change show balance change in each period (default) --cumulative- show balance change accumulated across periods (in multicolumn+ show balance change accumulated across periods (in multicolumn reports), instead of changes during periods -H --historical@@ -1667,8 +1693,8 @@ --sort-amount sort by amount instead of account code/name - This command displays a simple income statement. It currently assumes- that you have top-level accounts named income (or revenue) and expense+ This command displays a simple income statement. It currently assumes+ that you have top-level accounts named income (or revenue) and expense (plural forms also allowed.) $ hledger incomestatement@@ -1693,11 +1719,11 @@ 0 With a reporting interval, multiple columns will be shown, one for each- report period. Normally incomestatement shows revenues/expenses per- period, though as with multicolumn balance reports you can alter the+ report period. Normally incomestatement shows revenues/expenses per+ period, though as with multicolumn balance reports you can alter the report mode with --change/--cumulative/--historical. - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. prices@@ -1707,7 +1733,7 @@ Show transactions from the journal. Aliases: p, txns. -m STR --match=STR- show the transaction whose description is most similar to STR,+ show the transaction whose description is most similar to STR, and is most recent --new show only newer-dated transactions added in each file since last@@ -1720,7 +1746,7 @@ select the output format. Supported formats: txt, csv. -o FILE --output-file=FILE- write output to FILE. A file extension matching one of the+ write output to FILE. A file extension matching one of the above formats selects that format. $ hledger print@@ -1751,39 +1777,39 @@ it does not preserve directives or inter-transaction comments Normally, the journal entry's explicit or implicit amount style is pre-- served. Ie when an amount is omitted in the journal, it will be omit-- ted in the output. You can use the -x/--explicit flag to make all+ served. Ie when an amount is omitted in the journal, it will be omit-+ ted in the output. You can use the -x/--explicit flag to make all amounts explicit, which can be useful for troubleshooting or for making your journal more readable and robust against data entry errors. Note,- -x will cause postings with a multi-commodity amount (these can arise- when a multi-commodity transaction has an implicit amount) will be- split into multiple single-commodity postings, for valid journal out-+ -x will cause postings with a multi-commodity amount (these can arise+ when a multi-commodity transaction has an implicit amount) will be+ split into multiple single-commodity postings, for valid journal out- put. - With -B/--cost, amounts with transaction prices are converted to cost+ With -B/--cost, amounts with transaction prices are converted to cost using that price. This can be used for troubleshooting. - With -m/--match and a STR argument, print will show at most one trans-- action: the one one whose description is most similar to STR, and is- most recent. STR should contain at least two characters. If there is+ With -m/--match and a STR argument, print will show at most one trans-+ action: the one one whose description is most similar to STR, and is+ most recent. STR should contain at least two characters. If there is no similar-enough match, no transaction will be shown. With --new, for each FILE being read, hledger reads (and writes) a spe-- cial state file (.latest.FILE in the same directory), containing the- latest transaction date(s) that were seen last time FILE was read.- When this file is found, only transactions with newer dates (and new- transactions on the latest date) are printed. This is useful for- ignoring already-seen entries in import data, such as downloaded CSV+ cial state file (.latest.FILE in the same directory), containing the+ latest transaction date(s) that were seen last time FILE was read.+ When this file is found, only transactions with newer dates (and new+ transactions on the latest date) are printed. This is useful for+ ignoring already-seen entries in import data, such as downloaded CSV files. Eg: $ hledger -f bank1.csv print --new # shows transactions added since last print --new on this file - This assumes that transactions added to FILE always have same or- increasing dates, and that transactions on the same day do not get+ This assumes that transactions added to FILE always have same or+ increasing dates, and that transactions on the same day do not get reordered. See also the import command. - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. Here's an example of print's CSV output: $ hledger print -Ocsv@@ -1800,20 +1826,20 @@ "5","2008/12/31","","*","","pay off","","liabilities:debts","1","$","","1","","" "5","2008/12/31","","*","","pay off","","assets:bank:checking","-1","$","1","","","" - o There is one CSV record per posting, with the parent transaction's+ o There is one CSV record per posting, with the parent transaction's fields repeated. o The "txnidx" (transaction index) field shows which postings belong to- the same transaction. (This number might change if transactions are- reordered within the file, files are parsed/included in a different+ the same transaction. (This number might change if transactions are+ reordered within the file, files are parsed/included in a different order, etc.) - o The amount is separated into "commodity" (the symbol) and "amount"+ o The amount is separated into "commodity" (the symbol) and "amount" (numeric quantity) fields. o The numeric amount is repeated in either the "credit" or "debit" col-- umn, for convenience. (Those names are not accurate in the account-- ing sense; it just puts negative amounts under credit and zero or+ umn, for convenience. (Those names are not accurate in the account-+ ing sense; it just puts negative amounts under credit and zero or greater amounts under debit.) print-unique@@ -1826,7 +1852,7 @@ show running total from report start date (default) -H --historical- show historical running total/balance (includes postings before+ show historical running total/balance (includes postings before report start date) -A --average@@ -1837,18 +1863,18 @@ show postings' siblings instead -w N --width=N- set output width (default: terminal width or COLUMNS. -wN,M+ set output width (default: terminal width or COLUMNS. -wN,M sets description width as well) -O FMT --output-format=FMT select the output format. Supported formats: txt, csv. -o FILE --output-file=FILE- write output to FILE. A file extension matching one of the+ write output to FILE. A file extension matching one of the above formats selects that format. The register command displays postings, one per line, and their running- total. This is typically used with a query selecting a particular+ total. This is typically used with a query selecting a particular account, to see that account's activity: $ hledger register checking@@ -1857,8 +1883,8 @@ 2008/06/02 save assets:bank:checking $-1 $1 2008/12/31 pay off assets:bank:checking $-1 0 - The --historical/-H flag adds the balance from any undisplayed prior- postings to the running total. This is useful when you want to see+ The --historical/-H flag adds the balance from any undisplayed prior+ postings to the running total. This is useful when you want to see only recent activity, with a historically accurate running balance: $ hledger register checking -b 2008/6 --historical@@ -1868,23 +1894,23 @@ The --depth option limits the amount of sub-account detail displayed. - The --average/-A flag shows the running average posting amount instead+ The --average/-A flag shows the running average posting amount instead of the running total (so, the final number displayed is the average for- the whole report period). This flag implies --empty (see below). It- is affected by --historical. It works best when showing just one+ the whole report period). This flag implies --empty (see below). It+ is affected by --historical. It works best when showing just one account and one commodity. - The --related/-r flag shows the other postings in the transactions of+ The --related/-r flag shows the other postings in the transactions of the postings which would normally be shown. - With a reporting interval, register shows summary postings, one per+ With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account: $ hledger register --monthly income 2008/01 income:salary $-1 $-1 2008/06 income:gifts $-1 $-2 - Periods with no activity, and summary postings with a zero amount, are+ Periods with no activity, and summary postings with a zero amount, are not shown by default; use the --empty/-E flag to see them: $ hledger register --monthly income -E@@ -1901,7 +1927,7 @@ 2008/11 0 $-2 2008/12 0 $-2 - Often, you'll want to see just one line per interval. The --depth+ Often, you'll want to see just one line per interval. The --depth option helps with this, causing subaccounts to be aggregated: $ hledger register --monthly assets --depth 1h@@ -1909,18 +1935,18 @@ 2008/06 assets $-1 0 2008/12 assets $-1 $-1 - Note when using report intervals, if you specify start/end dates these- will be adjusted outward if necessary to contain a whole number of- intervals. This ensures that the first and last intervals are full+ Note when using report intervals, if you specify start/end dates these+ will be adjusted outward if necessary to contain a whole number of+ intervals. This ensures that the first and last intervals are full length and comparable to the others in the report. Custom register output- register uses the full terminal width by default, except on windows.- You can override this by setting the COLUMNS environment variable (not+ register uses the full terminal width by default, except on windows.+ You can override this by setting the COLUMNS environment variable (not a bash shell variable) or by using the --width/-w option. - The description and account columns normally share the space equally- (about half of (width - 40) each). You can adjust this by adding a+ The description and account columns normally share the space equally+ (about half of (width - 40) each). You can adjust this by adding a description width as part of -width's argument, comma-separated: --width W,D . Here's a diagram: @@ -1937,12 +1963,12 @@ $ hledger reg -w 100,40 # set overall width 100, description width 40 $ hledger reg -w $COLUMNS,40 # use terminal width, and set description width - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. register-match Print the one posting whose transaction description is closest to DESC,- in the style of the register command. Helps ledger-autosync detect+ in the style of the register command. Helps ledger-autosync detect already-seen transactions when importing. rewrite@@ -1952,7 +1978,7 @@ Show some journal statistics. -o FILE --output-file=FILE- write output to FILE. A file extension matching one of the+ write output to FILE. A file extension matching one of the above formats selects that format. $ hledger stats@@ -1967,16 +1993,16 @@ Accounts : 8 (depth 3) Commodities : 1 ($) - The stats command displays summary information for the whole journal,- or a matched part of it. With a reporting interval, it shows a report+ The stats command displays summary information for the whole journal,+ or a matched part of it. With a reporting interval, it shows a report for each report period. - This command also supports output destination and output format selec-+ This command also supports output destination and output format selec- tion. tags- List all the tag names used in the journal. With a TAGREGEX argument,- only tag names matching the regular expression (case insensitive) are+ List all the tag names used in the journal. With a TAGREGEX argument,+ only tag names matching the regular expression (case insensitive) are shown. With additional QUERY arguments, only transactions matching the query are considered. @@ -1986,34 +2012,34 @@ $ hledger test Cases: 74 Tried: 74 Errors: 0 Failures: 0 - This command runs hledger's built-in unit tests and displays a quick+ This command runs hledger's built-in unit tests and displays a quick report. With a regular expression argument, it selects only tests with matching names. It's mainly used in development, but it's also nice to be able to check your hledger executable for smoke at any time. ADD-ON COMMANDS- hledger also searches for external add-on commands, and will include+ hledger also searches for external add-on commands, and will include these in the commands list. These are programs or scripts in your PATH- whose name starts with hledger- and ends with a recognised file exten-+ whose name starts with hledger- and ends with a recognised file exten- sion (currently: no extension, bat,com,exe, hs,lhs,pl,py,rb,rkt,sh). - Add-ons can be invoked like any hledger command, but there are a few+ Add-ons can be invoked like any hledger command, but there are a few things to be aware of. Eg if the hledger-web add-on is installed, o hledger -h web shows hledger's help, while hledger web -h shows hledger-web's help. - o Flags specific to the add-on must have a preceding -- to hide them- from hledger. So hledger web --serve --port 9000 will be rejected;+ o Flags specific to the add-on must have a preceding -- to hide them+ from hledger. So hledger web --serve --port 9000 will be rejected; you must use hledger web -- --serve --port 9000. - o You can always run add-ons directly if preferred:+ o You can always run add-ons directly if preferred: hledger-web --serve --port 9000. - Add-ons are a relatively easy way to add local features or experiment- with new ideas. They can be written in any language, but haskell- scripts have a big advantage: they can use the same hledger (and- haskell) library functions that built-in commands do, for command-line+ Add-ons are a relatively easy way to add local features or experiment+ with new ideas. They can be written in any language, but haskell+ scripts have a big advantage: they can use the same hledger (and+ haskell) library functions that built-in commands do, for command-line options, journal parsing, reporting, etc. Here are some hledger add-ons available:@@ -2031,7 +2057,7 @@ hledger-web provides a simple web interface. Third party add-ons- These are maintained separately, and usually updated shortly after a+ These are maintained separately, and usually updated shortly after a hledger release. diff@@ -2039,7 +2065,7 @@ journal file and another. iadd- hledger-iadd is a curses-style, more interactive replacement for the+ hledger-iadd is a curses-style, more interactive replacement for the add command. interest@@ -2047,19 +2073,19 @@ ing to various schemes. irr- hledger-irr calculates the internal rate of return of an investment+ hledger-irr calculates the internal rate of return of an investment account. Experimental add-ons- These are available in source form in the hledger repo's bin/ direc-+ These are available in source form in the hledger repo's bin/ direc- tory; installing them is pretty easy. They may be less mature and doc-- umented than built-in commands. Reading and tweaking these is a good+ umented than built-in commands. Reading and tweaking these is a good way to start making your own! autosync hledger-autosync is a symbolic link for easily running ledger-autosync,- if installed. ledger-autosync does deduplicating conversion of OFX- data and some CSV formats, and can also download the data if your bank+ if installed. ledger-autosync does deduplicating conversion of OFX+ data and some CSV formats, and can also download the data if your bank offers OFX Direct Connect. chart@@ -2069,21 +2095,21 @@ hledger-check.hs checks more powerful account balance assertions. ENVIRONMENT- COLUMNS The screen width used by the register command. Default: the+ COLUMNS The screen width used by the register command. Default: the full terminal width. LEDGER_FILE The journal file path when not specified with -f. Default:- ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-+ ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- nal). FILES- Reads data from one or more files in hledger journal, timeclock, time-- dot, or CSV format specified with -f, or $LEDGER_FILE, or- $HOME/.hledger.journal (on windows, perhaps+ Reads data from one or more files in hledger journal, timeclock, time-+ dot, or CSV format specified with -f, or $LEDGER_FILE, or+ $HOME/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.journal). BUGS- The need to precede addon command options with -- when invoked from+ The need to precede addon command options with -- when invoked from hledger is awkward. When input data contains non-ascii characters, a suitable system locale@@ -2096,33 +2122,33 @@ In a Cygwin/MSYS/Mintty window, the tab key is not supported in hledger add. - Not all of Ledger's journal file syntax is supported. See file format+ Not all of Ledger's journal file syntax is supported. See file format differences. - On large data files, hledger is slower and uses more memory than+ On large data files, hledger is slower and uses more memory than Ledger. TROUBLESHOOTING- Here are some issues you might encounter when you run hledger (and- remember you can also seek help from the IRC channel, mail list or bug+ Here are some issues you might encounter when you run hledger (and+ remember you can also seek help from the IRC channel, mail list or bug tracker): Successfully installed, but "No command `hledger' found" stack and cabal install binaries into a special directory, which should- be added to your PATH environment variable. Eg on unix-like systems,+ be added to your PATH environment variable. Eg on unix-like systems, that is ~/.local/bin and ~/.cabal/bin respectively. I set a custom LEDGER_FILE, but hledger is still using the default file- LEDGER_FILE should be a real environment variable, not just a shell- variable. The command env | grep LEDGER_FILE should show it. You may+ LEDGER_FILE should be a real environment variable, not just a shell+ variable. The command env | grep LEDGER_FILE should show it. You may need to use export. Here's an explanation. - "Illegal byte sequence" or "Invalid or incomplete multibyte or wide+ "Illegal byte sequence" or "Invalid or incomplete multibyte or wide character" errors In order to handle non-ascii letters and symbols (like ), hledger needs an appropriate locale. This is usually configured system-wide; you can also configure it temporarily. The locale may need to be one that sup-- ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always,+ ports UTF-8, if you built hledger with GHC < 7.2 (or possibly always, I'm not sure yet). Here's an example of setting the locale temporarily, on ubuntu@@ -2141,7 +2167,7 @@ $ echo "export LANG=en_US.UTF-8" >>~/.bash_profile $ bash --login - If we preferred to use eg fr_FR.utf8, we might have to install that+ If we preferred to use eg fr_FR.utf8, we might have to install that first: $ apt-get install language-pack-fr@@ -2162,7 +2188,7 @@ REPORTING BUGS- Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel+ Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel or hledger mail list) @@ -2176,7 +2202,7 @@ SEE ALSO- hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1),+ hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_time- dot(5), ledger(1) @@ -2184,4 +2210,4 @@ -hledger 1.9.1 April 2018 hledger(1)+hledger 1.9.99 June 2018 hledger(1)