hledger 1.13.2 → 1.14
raw patch · 59 files changed
+1553/−1219 lines, 59 filesdep ~hledger-lib
Dependency ranges changed: hledger-lib
Files
- CHANGES.md +9/−0
- Hledger/Cli/Commands.hs +5/−1
- Hledger/Cli/Commands/Accounts.hs +4/−4
- Hledger/Cli/Commands/Activity.hs +1/−2
- Hledger/Cli/Commands/Add.hs +6/−6
- Hledger/Cli/Commands/Balance.hs +31/−30
- Hledger/Cli/Commands/Balance.txt +22/−10
- Hledger/Cli/Commands/Balancesheet.hs +1/−1
- Hledger/Cli/Commands/Balancesheetequity.hs +1/−1
- Hledger/Cli/Commands/Cashflow.hs +1/−1
- Hledger/Cli/Commands/Checkdates.hs +5/−6
- Hledger/Cli/Commands/Checkdupes.hs +2/−2
- Hledger/Cli/Commands/Close.hs +2/−2
- Hledger/Cli/Commands/Commodities.hs +36/−0
- Hledger/Cli/Commands/Files.hs +2/−2
- Hledger/Cli/Commands/Help.hs +2/−2
- Hledger/Cli/Commands/Import.hs +4/−5
- Hledger/Cli/Commands/Incomestatement.hs +1/−1
- Hledger/Cli/Commands/Prices.hs +1/−1
- Hledger/Cli/Commands/Print.hs +3/−6
- Hledger/Cli/Commands/Printunique.hs +2/−3
- Hledger/Cli/Commands/Register.hs +17/−16
- Hledger/Cli/Commands/Register.txt +7/−0
- Hledger/Cli/Commands/Registermatch.hs +6/−6
- Hledger/Cli/Commands/Rewrite.hs +1/−1
- Hledger/Cli/Commands/Roi.hs +17/−18
- Hledger/Cli/Commands/Stats.hs +4/−4
- Hledger/Cli/Commands/Tags.hs +2/−2
- Hledger/Cli/CompoundBalanceCommand.hs +11/−11
- Hledger/Cli/Main.hs +2/−2
- Hledger/Cli/Utils.hs +5/−5
- embeddedfiles/hledger-api.1 +1/−1
- embeddedfiles/hledger-api.info +1/−1
- embeddedfiles/hledger-api.txt +1/−1
- embeddedfiles/hledger-ui.1 +1/−1
- embeddedfiles/hledger-ui.info +1/−1
- embeddedfiles/hledger-ui.txt +1/−1
- embeddedfiles/hledger-web.1 +121/−44
- embeddedfiles/hledger-web.info +141/−44
- embeddedfiles/hledger-web.txt +124/−56
- embeddedfiles/hledger.1 +37/−13
- embeddedfiles/hledger.info +112/−93
- embeddedfiles/hledger.txt +150/−132
- embeddedfiles/hledger_csv.5 +1/−1
- embeddedfiles/hledger_csv.info +1/−1
- embeddedfiles/hledger_csv.txt +1/−1
- embeddedfiles/hledger_journal.5 +26/−78
- embeddedfiles/hledger_journal.info +101/−121
- embeddedfiles/hledger_journal.txt +203/−224
- embeddedfiles/hledger_timeclock.5 +1/−1
- embeddedfiles/hledger_timeclock.info +1/−1
- embeddedfiles/hledger_timeclock.txt +1/−1
- embeddedfiles/hledger_timedot.5 +1/−1
- embeddedfiles/hledger_timedot.info +1/−1
- embeddedfiles/hledger_timedot.txt +1/−1
- hledger.1 +37/−13
- hledger.cabal +11/−10
- hledger.info +112/−93
- hledger.txt +150/−132
CHANGES.md view
@@ -1,6 +1,15 @@ User-visible changes in the hledger command line tool and library. +# 1.14 2019-03-01++- journal: subaccount-including balance assertions have been+ added, with syntax =* and ==* (experimental) (#290)++- new commodities command lists commodity symbols++- new --invert option flips sign of amounts in reports+ # 1.13.2 (2019/02/04) - print, register: restore the accidentally dropped -o, -O flags (#967)
Hledger/Cli/Commands.hs view
@@ -27,6 +27,7 @@ ,module Hledger.Cli.Commands.Checkdates ,module Hledger.Cli.Commands.Checkdupes ,module Hledger.Cli.Commands.Close+ ,module Hledger.Cli.Commands.Commodities ,module Hledger.Cli.Commands.Help ,module Hledger.Cli.Commands.Import ,module Hledger.Cli.Commands.Incomestatement@@ -67,6 +68,7 @@ import Hledger.Cli.Commands.Checkdates import Hledger.Cli.Commands.Checkdupes import Hledger.Cli.Commands.Close+import Hledger.Cli.Commands.Commodities import Hledger.Cli.Commands.Files import Hledger.Cli.Commands.Help import Hledger.Cli.Commands.Import@@ -96,6 +98,7 @@ ,(checkdatesmode , checkdates) ,(checkdupesmode , checkdupes) ,(closemode , close)+ ,(commoditiesmode , commodities) ,(helpmode , help') ,(importmode , importcmd) ,(filesmode , files)@@ -164,6 +167,7 @@ ," accounts (a) show account names" ," activity show postings-per-interval bar charts" ," balance (b, bal) show balance changes/end balances/budgets in accounts"+ ," commodities show commodity/currency symbols" ," files show input file paths" ," prices show market price records" ," print (p, txns) show transactions (journal entries)"@@ -226,7 +230,7 @@ unknownCommandsFound = addonsFound \\ knownCommands adjustline l | " hledger " `isPrefixOf` l = [l]- adjustline l@('+':_) | not $ cmd `elem` commandsFound = []+ adjustline l@('+':_) | cmd `notElem` commandsFound = [] where cmd = takeWhile (not . isSpace) l adjustline l = [l]
Hledger/Cli/Commands/Accounts.hs view
@@ -36,10 +36,10 @@ -- | Command line options for this command. accountsmode = hledgerCommandMode $(embedFileRelative "Hledger/Cli/Commands/Accounts.txt")- [flagNone ["declared"] (\opts -> setboolopt "declared" opts) "show account names declared with account directives"- ,flagNone ["used"] (\opts -> setboolopt "used" opts) "show account names referenced by transactions"- ,flagNone ["tree"] (\opts -> setboolopt "tree" opts) "show short account names, as a tree"- ,flagNone ["flat"] (\opts -> setboolopt "flat" opts) "show full account names, as a list (default)"+ [flagNone ["declared"] (setboolopt "declared") "show account names declared with account directives"+ ,flagNone ["used"] (setboolopt "used") "show account names referenced by transactions"+ ,flagNone ["tree"] (setboolopt "tree") "show short account names, as a tree"+ ,flagNone ["flat"] (setboolopt "flat") "show full account names, as a list (default)" ,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts" ] [generalflagsgroup1]
Hledger/Cli/Commands/Activity.hs view
@@ -11,7 +11,6 @@ import Data.List import Data.Maybe-import Data.Ord import Text.Printf import Hledger@@ -47,7 +46,7 @@ -- same as Register -- should count transactions, not postings ? -- ps = sortBy (comparing postingDate) $ filterempties $ filter matchapats $ filterdepth $ journalPostings j- ps = sortBy (comparing postingDate) $ filter (q `matchesPosting`) $ journalPostings j+ ps = sortOn postingDate $ filter (q `matchesPosting`) $ journalPostings j printDayWith f (DateSpan b _, ps) = printf "%s %s\n" (show $ fromJust b) (f ps)
Hledger/Cli/Commands/Add.hs view
@@ -49,7 +49,7 @@ addmode = hledgerCommandMode $(embedFileRelative "Hledger/Cli/Commands/Add.txt")- [flagNone ["no-new-accounts"] (\opts -> setboolopt "no-new-accounts" opts) "don't allow creating new accounts"]+ [flagNone ["no-new-accounts"] (setboolopt "no-new-accounts") "don't allow creating new accounts"] [generalflagsgroup2] [] ([], Just $ argsFlag "[QUERY]")@@ -235,7 +235,7 @@ accountWizard EntryState{..} = do let pnum = length esPostings + 1- historicalp = maybe Nothing (Just . (!! (pnum-1)) . (++ (repeat nullposting)) . tpostings) esSimilarTransaction+ historicalp = fmap ((!! (pnum - 1)) . (++ (repeat nullposting)) . tpostings) esSimilarTransaction historicalacct = case historicalp of Just p -> showAccountName Nothing (ptype p) (paccount p) Nothing -> "" def = headDef historicalacct esArgs@@ -259,7 +259,7 @@ flip evalState esJournal $ runParserT (accountnamep <* eof) "" (T.pack s) -- otherwise, try to parse the input as an accountname where validateAccount :: Text -> Maybe Text- validateAccount t | no_new_accounts_ esOpts && not (t `elem` journalAccountNamesDeclaredOrImplied esJournal) = Nothing+ validateAccount t | no_new_accounts_ esOpts && notElem t (journalAccountNamesDeclaredOrImplied esJournal) = Nothing | otherwise = Just t dbg1 = id -- strace @@ -436,9 +436,9 @@ -- Todo: check out http://nlp.fi.muni.cz/raslan/2008/raslan08.pdf#page=14 . compareStrings :: String -> String -> Double compareStrings "" "" = 1-compareStrings (_:[]) "" = 0-compareStrings "" (_:[]) = 0-compareStrings (a:[]) (b:[]) = if toUpper a == toUpper b then 1 else 0+compareStrings [_] "" = 0+compareStrings "" [_] = 0+compareStrings [a] [b] = if toUpper a == toUpper b then 1 else 0 compareStrings s1 s2 = 2 * commonpairs / totalpairs where pairs1 = S.fromList $ wordLetterPairs $ uppercase s1
Hledger/Cli/Commands/Balance.hs view
@@ -236,6 +236,7 @@ {-# LANGUAGE ExtendedDefaultRules #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE NamedFieldPuns #-} module Hledger.Cli.Commands.Balance ( balancemode@@ -271,22 +272,22 @@ -- | Command line options for this command. balancemode = hledgerCommandMode $(embedFileRelative "Hledger/Cli/Commands/Balance.txt")- ([flagNone ["change"] (\opts -> setboolopt "change" opts)+ ([flagNone ["change"] (setboolopt "change") "show balance change in each period (default)"- ,flagNone ["cumulative"] (\opts -> setboolopt "cumulative" opts)+ ,flagNone ["cumulative"] (setboolopt "cumulative") "show balance change accumulated across periods (in multicolumn reports)"- ,flagNone ["historical","H"] (\opts -> setboolopt "historical" opts)+ ,flagNone ["historical","H"] (setboolopt "historical") "show historical ending balance in each period (includes postings before report start date)\n "- ,flagNone ["tree"] (\opts -> setboolopt "tree" opts) "show accounts as a tree; amounts include subaccounts (default in simple reports)"- ,flagNone ["flat"] (\opts -> setboolopt "flat" opts) "show accounts as a list; amounts exclude subaccounts except when account is depth-clipped (default in multicolumn reports)\n "- ,flagNone ["average","A"] (\opts -> setboolopt "average" opts) "show a row average column (in multicolumn reports)"- ,flagNone ["row-total","T"] (\opts -> setboolopt "row-total" opts) "show a row total column (in multicolumn reports)"- ,flagNone ["no-total","N"] (\opts -> setboolopt "no-total" opts) "omit the final total row"+ ,flagNone ["tree"] (setboolopt "tree") "show accounts as a tree; amounts include subaccounts (default in simple reports)"+ ,flagNone ["flat"] (setboolopt "flat") "show accounts as a list; amounts exclude subaccounts except when account is depth-clipped (default in multicolumn reports)\n "+ ,flagNone ["average","A"] (setboolopt "average") "show a row average column (in multicolumn reports)"+ ,flagNone ["row-total","T"] (setboolopt "row-total") "show a row total column (in multicolumn reports)"+ ,flagNone ["no-total","N"] (setboolopt "no-total") "omit the final total row" ,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "omit N leading account name parts (in flat mode)"- ,flagNone ["no-elide"] (\opts -> setboolopt "no-elide" opts) "don't squash boring parent accounts (in tree mode)"+ ,flagNone ["no-elide"] (setboolopt "no-elide") "don't squash boring parent accounts (in tree mode)" ,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)"- ,flagNone ["pretty-tables"] (\opts -> setboolopt "pretty-tables" opts) "use unicode to display prettier tables"- ,flagNone ["sort-amount","S"] (\opts -> setboolopt "sort-amount" opts) "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."+ ,flagNone ["pretty-tables"] (setboolopt "pretty-tables") "use unicode to display prettier tables"+ ,flagNone ["sort-amount","S"] (setboolopt "sort-amount") "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." ,flagNone ["budget"] (setboolopt "budget") "show performance compared to budget goals defined by periodic transactions" ,flagNone ["invert"] (setboolopt "invert") "display all amounts with reversed sign" ,flagNone ["transpose"] (setboolopt "transpose") "transpose rows and columns"@@ -465,27 +466,27 @@ -- The CSV will always include the initial headings row, -- and will include the final totals row unless --no-total is set. multiBalanceReportAsCsv :: ReportOpts -> MultiBalanceReport -> CSV-multiBalanceReportAsCsv opts (MultiBalanceReport (colspans, items, (coltotals,tot,avg))) =+multiBalanceReportAsCsv opts@ReportOpts{average_, row_total_} (MultiBalanceReport (colspans, items, (coltotals,tot,avg))) = maybetranspose $ ("Account" : map showDateSpan colspans- ++ (if row_total_ opts then ["Total"] else [])- ++ (if average_ opts then ["Average"] else [])+ ++ ["Total" | row_total_]+ ++ ["Average" | average_] ) : [T.unpack (maybeAccountNameDrop opts a) : map showMixedAmountOneLineWithoutPrice (amts- ++ (if row_total_ opts then [rowtot] else [])- ++ (if average_ opts then [rowavg] else []))+ ++ [rowtot | row_total_]+ ++ [rowavg | average_]) | (a, _, _, amts, rowtot, rowavg) <- items] ++ if no_total_ opts then []- else [["Total:"]- ++ map showMixedAmountOneLineWithoutPrice (- coltotals- ++ (if row_total_ opts then [tot] else [])- ++ (if average_ opts then [avg] else [])- )]+ else ["Total:" :+ map showMixedAmountOneLineWithoutPrice (+ coltotals+ ++ [tot | row_total_]+ ++ [avg | average_]+ )] where maybetranspose | transpose_ opts = transpose | otherwise = id@@ -499,7 +500,7 @@ table_ $ mconcat $ [headingsrow] ++ bodyrows- ++ maybe [] (:[]) mtotalsrow+ ++ maybeToList mtotalsrow -- | Render the HTML table rows for a MultiBalanceReport. -- Returns the heading row, 0 or more body rows, and the totals row if enabled.@@ -593,7 +594,7 @@ -- | Build a 'Table' from a multi-column balance report. balanceReportAsTable :: ReportOpts -> MultiBalanceReport -> Table String String MixedAmount-balanceReportAsTable opts (MultiBalanceReport (colspans, items, (coltotals,tot,avg))) =+balanceReportAsTable opts@ReportOpts{average_, row_total_} (MultiBalanceReport (colspans, items, (coltotals,tot,avg))) = maybetranspose $ addtotalrow $ Table@@ -605,20 +606,20 @@ PeriodChange -> showDateSpanMonthAbbrev _ -> maybe "" (showDate . prevday) . spanEnd colheadings = map mkDate colspans- ++ (if row_total_ opts then [" Total"] else [])- ++ (if average_ opts then ["Average"] else [])+ ++ [" Total" | row_total_]+ ++ ["Average" | average_] accts = map renderacct items renderacct (a,a',i,_,_,_) | tree_ opts = replicate ((i-1)*2) ' ' ++ T.unpack a' | otherwise = T.unpack $ maybeAccountNameDrop opts a rowvals (_,_,_,as,rowtot,rowavg) = as- ++ (if row_total_ opts then [rowtot] else [])- ++ (if average_ opts then [rowavg] else [])+ ++ [rowtot | row_total_]+ ++ [rowavg | average_] addtotalrow | no_total_ opts = id | otherwise = (+----+ (row "" $ coltotals- ++ (if row_total_ opts && not (null coltotals) then [tot] else [])- ++ (if average_ opts && not (null coltotals) then [avg] else [])+ ++ [tot | row_total_ && not (null coltotals)]+ ++ [avg | average_ && not (null coltotals)] )) maybetranspose | transpose_ opts = \(Table rh ch vals) -> Table ch rh (transpose vals) | otherwise = id
Hledger/Cli/Commands/Balance.txt view
@@ -232,7 +232,7 @@ 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 otherwise would be-omitted). With --budget, --empty also shows unbudgeted accounts.+omitted). The -T/--row-total flag adds an additional column showing the total for each row.@@ -320,14 +320,29 @@ ----------------------++---------------------------------------------------- || 0 [ 0] 0 [ 0] -By default, only accounts with budget goals during the report period are-shown. In the example above, transactions in expenses:gifts and-expenses:supplies are counted towards expenses budget, but accounts-expenses:gifts and expenses:supplies are not shown, as they don't have-any budgets.+Note this is different from a normal balance report in several ways: -You can use --empty shows unbudgeted accounts as well:+- Only accounts with budget goals during the report period are shown,+ by default. +- In each column, in square brackets after the actual amount, budgeted+ amounts are shown, along with the percentage of budget used.++- All parent accounts are always shown, even in flat mode. Eg assets,+ assets:bank, and expenses above.++- Amounts always include all subaccounts, budgeted or unbudgeted, even+ in flat mode.++This means that the numbers displayed will not always add up! Eg above,+the expenses actual amount includes the gifts and supplies transactions,+but the expenses:gifts and expenses:supplies accounts are not shown, as+they have no budget amounts declared.++This can be confusing. When you need to make things clearer, use the+-E/--empty flag, which will reveal all accounts including unbudgeted+ones, giving the full picture. Eg:+ $ hledger balance -M --budget --empty Budget performance in 2017/11/01-2017/12/31: @@ -363,9 +378,6 @@ income || $1950 [ 98% of $2000] $4050 [ 101% of $4000] ----------------------++---------------------------------------------------- || 0 [ 0] 0 [ 0] --Note, the -S/--sort-amount flag is not yet fully supported with---budget. For more examples, see Budgeting and Forecasting.
Hledger/Cli/Commands/Balancesheet.hs view
@@ -18,7 +18,7 @@ import Hledger.Cli.CompoundBalanceCommand balancesheetSpec = CompoundBalanceCommandSpec {- cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Balancesheet.txt")),+ cbcdoc = $(embedFileRelative "Hledger/Cli/Commands/Balancesheet.txt"), cbctitle = "Balance Sheet", cbcqueries = [ CBCSubreportSpec{
Hledger/Cli/Commands/Balancesheetequity.hs view
@@ -18,7 +18,7 @@ import Hledger.Cli.CompoundBalanceCommand balancesheetequitySpec = CompoundBalanceCommandSpec {- cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Balancesheetequity.txt")),+ cbcdoc = $(embedFileRelative "Hledger/Cli/Commands/Balancesheetequity.txt"), cbctitle = "Balance Sheet With Equity", cbcqueries = [ CBCSubreportSpec{
Hledger/Cli/Commands/Cashflow.hs view
@@ -21,7 +21,7 @@ import Hledger.Cli.CompoundBalanceCommand cashflowSpec = CompoundBalanceCommandSpec {- cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Cashflow.txt")),+ cbcdoc = $(embedFileRelative "Hledger/Cli/Commands/Cashflow.txt"), cbctitle = "Cashflow Statement", cbcqueries = [ CBCSubreportSpec{
Hledger/Cli/Commands/Checkdates.hs view
@@ -13,8 +13,8 @@ checkdatesmode :: Mode RawOpts checkdatesmode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Checkdates.txt"))- [flagNone ["strict"] (\opts -> setboolopt "strict" opts) "makes date comparing strict"]+ $(embedFileRelative "Hledger/Cli/Commands/Checkdates.txt")+ [flagNone ["strict"] (setboolopt "strict") "makes date comparing strict"] [generalflagsgroup1] [] ([], Just $ argsFlag "[QUERY]")@@ -61,11 +61,10 @@ checkTransactions :: (Transaction -> Transaction -> Bool) -> [Transaction] -> FoldAcc Transaction Transaction-checkTransactions compare ts =- foldWhile fold FoldAcc{fa_error=Nothing, fa_previous=Nothing} ts+checkTransactions compare = foldWhile f FoldAcc{fa_error=Nothing, fa_previous=Nothing} where- fold current acc@FoldAcc{fa_previous=Nothing} = acc{fa_previous=Just current}- fold current acc@FoldAcc{fa_previous=Just previous} =+ f current acc@FoldAcc{fa_previous=Nothing} = acc{fa_previous=Just current}+ f current acc@FoldAcc{fa_previous=Just previous} = if compare previous current then acc{fa_previous=Just current} else acc{fa_error=Just current}
Hledger/Cli/Commands/Checkdupes.hs view
@@ -16,7 +16,7 @@ checkdupesmode :: Mode RawOpts checkdupesmode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Checkdupes.txt"))+ $(embedFileRelative "Hledger/Cli/Commands/Checkdupes.txt") [] [generalflagsgroup1] []@@ -40,4 +40,4 @@ . sortBy (compare `on` fst) render :: (String, [AccountName]) -> IO ()-render (leafName, accountNameL) = printf "%s as %s\n" leafName (concat $ intersperse ", " (map T.unpack accountNameL))+render (leafName, accountNameL) = printf "%s as %s\n" leafName (intercalate ", " (map T.unpack accountNameL))
Hledger/Cli/Commands/Close.hs view
@@ -17,8 +17,8 @@ closemode = hledgerCommandMode $(embedFileRelative "Hledger/Cli/Commands/Close.txt")- [flagNone ["opening"] (\opts -> setboolopt "opening" opts) "show just opening transaction"- ,flagNone ["closing"] (\opts -> setboolopt "closing" opts) "show just closing transaction"+ [flagNone ["opening"] (setboolopt "opening") "show just opening transaction"+ ,flagNone ["closing"] (setboolopt "closing") "show just closing transaction" ] [generalflagsgroup1] []
+ Hledger/Cli/Commands/Commodities.hs view
@@ -0,0 +1,36 @@+{-|++The @commodities@ command lists commodity/currency symbols.++-}++{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TemplateHaskell #-}++module Hledger.Cli.Commands.Commodities (+ commoditiesmode+ ,commodities+) where++import Control.Monad+import Data.List+import qualified Data.Map as M+import qualified Data.Text.IO as T++import Hledger+import Hledger.Cli.CliOptions+++-- | Command line options for this command.+commoditiesmode = hledgerCommandMode+ $(embedFileRelative "Hledger/Cli/Commands/Commodities.txt")+ []+ [generalflagsgroup2]+ []+ ([], Nothing)++commodities :: CliOpts -> Journal -> IO ()+commodities _copts j = do+ let cs = filter (/= "AUTO") $+ nub $ sort $ M.keys (jcommodities j) ++ M.keys (jinferredcommodities j)+ forM_ cs T.putStrLn
Hledger/Cli/Commands/Files.hs view
@@ -23,7 +23,7 @@ -- | Command line options for this command. filesmode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Files.txt"))+ $(embedFileRelative "Hledger/Cli/Commands/Files.txt") [] [generalflagsgroup2] []@@ -34,7 +34,7 @@ files CliOpts{rawopts_=rawopts} j = do let args = listofstringopt "args" rawopts regex = headMay args- files = (maybe id (filter . regexMatches) regex) + files = maybe id (filter . regexMatches) regex $ map fst $ jfiles j mapM_ putStrLn files
Hledger/Cli/Commands/Help.hs view
@@ -35,7 +35,7 @@ --import Hledger.Utils.Debug helpmode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Help.txt"))+ $(embedFileRelative "Hledger/Cli/Commands/Help.txt") [flagNone ["info"] (setboolopt "info") "show the manual with info" ,flagNone ["man"] (setboolopt "man") "show the manual with man" ,flagNone ["pager"] (setboolopt "pager") "show the manual with $PAGER or less"@@ -78,5 +78,5 @@ ,"A viewer (info, man, a pager, or stdout) will be auto-selected," ,"or type \"hledger help -h\" to see options. Manuals available:" ]- ++ "\n " ++ intercalate " " docTopics+ ++ "\n " ++ unwords docTopics Just t -> viewer t
Hledger/Cli/Commands/Import.hs view
@@ -9,7 +9,6 @@ import Control.Monad import Data.List-import Data.Ord import Hledger import Hledger.Cli.CliOptions import Hledger.Cli.Commands.Add (journalAddTransaction)@@ -18,8 +17,8 @@ import Text.Printf importmode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Import.txt"))- [flagNone ["dry-run"] (\opts -> setboolopt "dry-run" opts) "just show the transactions to be imported"] + $(embedFileRelative "Hledger/Cli/Commands/Import.txt")+ [flagNone ["dry-run"] (setboolopt "dry-run") "just show the transactions to be imported"] [generalflagsgroup1] [] ([], Just $ argsFlag "FILE [...]")@@ -36,7 +35,7 @@ case enewj of Left e -> error' e Right newj ->- case sortBy (comparing tdate) $ jtxns newj of+ case sortOn tdate $ jtxns newj of [] -> return () newts | dryrun -> do printf "; would import %d new transactions:\n\n" (length newts)@@ -44,5 +43,5 @@ -- length (jtxns newj) `seq` print' opts{rawopts_=("explicit",""):rawopts} newj mapM_ (putStr . showTransactionUnelided) newts newts -> do- foldM (flip journalAddTransaction opts) j newts -- gets forced somehow.. (how ?)+ foldM_ (`journalAddTransaction` opts) j newts -- gets forced somehow.. (how ?) printf "imported %d new transactions\n" (length newts)
Hledger/Cli/Commands/Incomestatement.hs view
@@ -17,7 +17,7 @@ import Hledger.Cli.CompoundBalanceCommand incomestatementSpec = CompoundBalanceCommandSpec {- cbcdoc = ($(embedFileRelative "Hledger/Cli/Commands/Incomestatement.txt")),+ cbcdoc = $(embedFileRelative "Hledger/Cli/Commands/Incomestatement.txt"), cbctitle = "Income Statement", cbcqueries = [ CBCSubreportSpec{
Hledger/Cli/Commands/Prices.hs view
@@ -15,7 +15,7 @@ import System.Console.CmdArgs.Explicit pricesmode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Prices.txt"))+ $(embedFileRelative "Hledger/Cli/Commands/Prices.txt") [flagNone ["costs"] (setboolopt "costs") "print transaction prices from postings" ,flagNone ["inverted-costs"] (setboolopt "inverted-costs") "print transaction inverted prices from postings also"] [generalflagsgroup1]
Hledger/Cli/Commands/Print.hs view
@@ -27,7 +27,7 @@ printmode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Print.txt"))+ $(embedFileRelative "Hledger/Cli/Commands/Print.txt") ([let arg = "STR" in flagReq ["match","m"] (\s opts -> Right $ setopt "match" s opts) arg ("show the transaction whose description is most similar to "++arg++", and is most recent")@@ -66,10 +66,7 @@ -- Original vs inferred transactions/postings were causing problems here, disabling -B (#551). -- Use the explicit one if -B or -x are active. -- This passes tests; does it also mean -B sometimes shows missing amounts unnecessarily ? - useexplicittxn = or- [ boolopt "explicit" $ rawopts_ opts- , cost_ $ reportopts_ opts- ]+ useexplicittxn = boolopt "explicit" (rawopts_ opts) || cost_ (reportopts_ opts) -- Replace this transaction's postings with the original postings if any, but keep the -- current possibly rewritten account names.@@ -147,7 +144,7 @@ let commodity = T.unpack c in let credit = if q < 0 then showAmount $ negate a_ else "" in let debit = if q >= 0 then showAmount a_ else "" in- account:amount:commodity:credit:debit:status:comment:[])+ [account, amount, commodity, credit, debit, status, comment]) amounts where Mixed amounts = pamount p
Hledger/Cli/Commands/Printunique.hs view
@@ -7,13 +7,12 @@ where import Data.List-import Data.Ord import Hledger import Hledger.Cli.CliOptions import Hledger.Cli.Commands.Print printuniquemode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Printunique.txt"))+ $(embedFileRelative "Hledger/Cli/Commands/Printunique.txt") [] [generalflagsgroup1] []@@ -22,6 +21,6 @@ printunique opts j@Journal{jtxns=ts} = do print' opts j{jtxns=uniquify ts} where- uniquify = nubBy (\t1 t2 -> thingToCompare t1 == thingToCompare t2) . sortBy (comparing thingToCompare)+ uniquify = nubBy (\t1 t2 -> thingToCompare t1 == thingToCompare t2) . sortOn thingToCompare thingToCompare = tdescription -- thingToCompare = tdate
Hledger/Cli/Commands/Register.hs view
@@ -28,14 +28,15 @@ import Hledger.Cli.Utils registermode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Register.txt"))- ([flagNone ["cumulative"] (\opts -> setboolopt "change" opts)+ $(embedFileRelative "Hledger/Cli/Commands/Register.txt")+ ([flagNone ["cumulative"] (setboolopt "change") "show running total from report start date (default)"- ,flagNone ["historical","H"] (\opts -> setboolopt "historical" opts)+ ,flagNone ["historical","H"] (setboolopt "historical") "show historical running total/balance (includes postings before report start date)\n "- ,flagNone ["average","A"] (\opts -> setboolopt "average" opts)+ ,flagNone ["average","A"] (setboolopt "average") "show running average of posting amounts instead of total (implies --empty)"- ,flagNone ["related","r"] (\opts -> setboolopt "related" opts) "show postings' siblings instead"+ ,flagNone ["related","r"] (setboolopt "related") "show postings' siblings instead"+ ,flagNone ["invert"] (setboolopt "invert") "display all amounts with reversed sign" ,flagReq ["width","w"] (\s opts -> Right $ setopt "width" s opts) "N" ("set output width (default: " ++ #ifdef mingw32_HOST_OS@@ -118,17 +119,17 @@ -- use elide*Width to be wide-char-aware -- trace (show (totalwidth, datewidth, descwidth, acctwidth, amtwidth, balwidth)) $ intercalate "\n" $- [concat [fitString (Just datewidth) (Just datewidth) True True date- ," "- ,fitString (Just descwidth) (Just descwidth) True True desc- ," "- ,fitString (Just acctwidth) (Just acctwidth) True True acct- ," "- ,fitString (Just amtwidth) (Just amtwidth) True False amtfirstline- ," "- ,fitString (Just balwidth) (Just balwidth) True False balfirstline- ]]- +++ concat [fitString (Just datewidth) (Just datewidth) True True date+ ," "+ ,fitString (Just descwidth) (Just descwidth) True True desc+ ," "+ ,fitString (Just acctwidth) (Just acctwidth) True True acct+ ," "+ ,fitString (Just amtwidth) (Just amtwidth) True False amtfirstline+ ," "+ ,fitString (Just balwidth) (Just balwidth) True False balfirstline+ ]+ : [concat [spacer ,fitString (Just amtwidth) (Just amtwidth) True False a ," "
Hledger/Cli/Commands/Register.txt view
@@ -35,6 +35,13 @@ The --related/-r flag shows the _other_ postings in the transactions of the postings which would normally be shown. +The --invert flag negates all amounts. For example, it can be used on an+income account where amounts are normally displayed as negative numbers.+It's also useful to show postings on the checking account together with+the related account:++$ hledger register --related --invert assets:checking+ With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account:
Hledger/Cli/Commands/Registermatch.hs view
@@ -15,11 +15,11 @@ import Hledger.Cli.Commands.Register registermatchmode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Registermatch.txt"))+ $(embedFileRelative "Hledger/Cli/Commands/Registermatch.txt") [] [generalflagsgroup1] []- ([], Just $ argsFlag "[QUERY]")+ ([], Just $ argsFlag "DESC") registermatch :: CliOpts -> Journal -> IO () registermatch opts@CliOpts{rawopts_=rawopts,reportopts_=ropts} j = do@@ -60,7 +60,7 @@ -- ((,t):_) = Just t -- [] = Nothing -compareDescriptions :: [Char] -> [Char] -> Double+compareDescriptions :: String -> String -> Double compareDescriptions s t = compareStrings s' t' where s' = simplify s t' = simplify t@@ -72,9 +72,9 @@ -- with a modification for short strings. compareStrings :: String -> String -> Double compareStrings "" "" = 1-compareStrings (_:[]) "" = 0-compareStrings "" (_:[]) = 0-compareStrings (a:[]) (b:[]) = if toUpper a == toUpper b then 1 else 0+compareStrings [_] "" = 0+compareStrings "" [_] = 0+compareStrings [a] [b] = if toUpper a == toUpper b then 1 else 0 compareStrings s1 s2 = 2.0 * fromIntegral i / fromIntegral u where i = length $ intersect pairs1 pairs2
Hledger/Cli/Commands/Rewrite.hs view
@@ -23,7 +23,7 @@ import qualified Data.Algorithm.Diff as D rewritemode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Rewrite.txt"))+ $(embedFileRelative "Hledger/Cli/Commands/Rewrite.txt") [flagReq ["add-posting"] (\s opts -> Right $ setopt "add-posting" s opts) "'ACCT AMTEXPR'" "add a posting to ACCT, which may be parenthesised. AMTEXPR is either a literal amount, or *N which means the transaction's first matched amount multiplied by N (a decimal number). Two spaces separate ACCT and AMTEXPR." ,flagNone ["diff"] (setboolopt "diff") "generate diff suitable as an input for patch tool"
Hledger/Cli/Commands/Roi.hs view
@@ -17,7 +17,6 @@ import Text.Printf import Data.Function (on) import Data.List-import Data.Ord import Numeric.RootFinding import Data.Decimal import System.Console.CmdArgs.Explicit as CmdArgs@@ -30,7 +29,7 @@ roimode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Roi.txt"))+ $(embedFileRelative "Hledger/Cli/Commands/Roi.txt") [flagNone ["cashflow"] (setboolopt "cashflow") "show all amounts that were used to compute returns" ,flagReq ["investment"] (\s opts -> Right $ setopt "investment" s opts) "QUERY" "query to select your investment transactions"@@ -81,7 +80,7 @@ splitSpan interval $ spanIntersect journalSpan wholeSpan - tableBody <- (flip mapM) spans $ \(DateSpan (Just spanBegin) (Just spanEnd)) -> do+ tableBody <- forM spans $ \(DateSpan (Just spanBegin) (Just spanEnd)) -> do -- Spans are [spanBegin,spanEnd), and spanEnd is 1 day after then actual end date we are interested in let valueBefore =@@ -130,28 +129,28 @@ -- Aggregate all entries for a single day, assuming that intraday interest is negligible map (\date_cash -> let (dates, cash) = unzip date_cash in (head dates, sum cash)) $ groupBy ((==) `on` fst)- $ sortBy (comparing fst) + $ sortOn fst $ map (\(d,a) -> (d, negate a)) $ filter ((/=0).snd) cashFlow let units = tail $- (flip scanl) - (0,0,0,initialUnits)- (\(_,_,_,unitBalance) (date, amt) -> - let valueOnDate = - total trans (And [investmentsQuery, Date (DateSpan Nothing (Just date))])- unitPrice = if unitBalance == 0.0 then initialUnitPrice else valueOnDate / unitBalance- unitsBoughtOrSold = amt / unitPrice- in- (valueOnDate, unitsBoughtOrSold, unitPrice, unitBalance + unitsBoughtOrSold)- ) - cashflow+ scanl+ (\(_, _, _, unitBalance) (date, amt) ->+ let valueOnDate = total trans (And [investmentsQuery, Date (DateSpan Nothing (Just date))])+ unitPrice =+ if unitBalance == 0.0+ then initialUnitPrice+ else valueOnDate / unitBalance+ unitsBoughtOrSold = amt / unitPrice+ in (valueOnDate, unitsBoughtOrSold, unitPrice, unitBalance + unitsBoughtOrSold))+ (0, 0, 0, initialUnits)+ cashflow let finalUnitBalance = if null units then initialUnits else let (_,_,_,u) = last units in u finalUnitPrice = valueAfter / finalUnitBalance totalTWR = roundTo 2 $ (finalUnitPrice - initialUnitPrice)- years = (fromIntegral $ diffDays spanEnd spanBegin)/365 :: Double+ years = fromIntegral (diffDays spanEnd spanBegin) / 365 :: Double annualizedTWR = 100*((1+(realToFrac totalTWR/100))**(1/years)-1) :: Double let s d = show $ roundTo 2 d @@ -191,7 +190,7 @@ postfix = (spanEnd, valueAfter) - totalCF = filter ((/=0) . snd) $ prefix : (sortBy (comparing fst) cashFlow) ++ [postfix]+ totalCF = filter ((/=0) . snd) $ prefix : (sortOn fst cashFlow) ++ [postfix] when showCashFlow $ do printf "\nIRR cash flow for %s - %s\n" (showDate spanBegin) (showDate (addDays (-1) spanEnd)) @@ -218,7 +217,7 @@ interestSum :: Day -> CashFlow -> Double -> Double interestSum referenceDay cf rate = sum $ map go cf- where go (t,m) = (fromRational $ toRational m) * (rate ** (fromIntegral (referenceDay `diffDays` t) / 365))+ where go (t,m) = fromRational (toRational m) * (rate ** (fromIntegral (referenceDay `diffDays` t) / 365)) calculateCashFlow :: [Transaction] -> Query -> CashFlow
Hledger/Cli/Commands/Stats.hs view
@@ -31,7 +31,7 @@ statsmode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Stats.txt"))+ $(embedFileRelative "Hledger/Cli/Commands/Stats.txt") [flagReq ["output-file","o"] (\s opts -> Right $ setopt "output-file" s opts) "FILE" "write output to FILE." ] [generalflagsgroup1]@@ -78,12 +78,12 @@ where j = ljournal l path = journalFilePath j- ts = sortBy (comparing tdate) $ filter (spanContainsDate span . tdate) $ jtxns j+ ts = sortOn tdate $ filter (spanContainsDate span . tdate) $ jtxns j as = nub $ map paccount $ concatMap tpostings ts- cs = Map.keys $ commodityStylesFromAmounts $ concatMap amounts $ map pamount $ concatMap tpostings ts+ cs = Map.keys $ commodityStylesFromAmounts $ concatMap (amounts . pamount) $ concatMap tpostings ts lastdate | null ts = Nothing | otherwise = Just $ tdate $ last ts- lastelapsed = maybe Nothing (Just . diffDays today) lastdate+ lastelapsed = fmap (diffDays today) lastdate showelapsed Nothing = "" showelapsed (Just days) = printf " (%d %s)" days' direction where days' = abs days
Hledger/Cli/Commands/Tags.hs view
@@ -14,8 +14,8 @@ import Hledger.Cli.CliOptions tagsmode = hledgerCommandMode- ($(embedFileRelative "Hledger/Cli/Commands/Tags.txt"))- [] -- [flagNone ["strict"] (\opts -> setboolopt "strict" opts) "makes date comparing strict"] -- + $(embedFileRelative "Hledger/Cli/Commands/Tags.txt")+ [] -- [flagNone ["strict"] (setboolopt "strict") "makes date comparing strict"] -- [generalflagsgroup1] [] ([], Just $ argsFlag "[TAGREGEX [QUERY...]]")
Hledger/Cli/CompoundBalanceCommand.hs view
@@ -84,26 +84,26 @@ compoundBalanceCommandMode CompoundBalanceCommandSpec{..} = hledgerCommandMode cbcdoc- [flagNone ["change"] (\opts -> setboolopt "change" opts)+ [flagNone ["change"] (setboolopt "change") ("show balance change in each period" ++ defType PeriodChange)- ,flagNone ["cumulative"] (\opts -> setboolopt "cumulative" opts)+ ,flagNone ["cumulative"] (setboolopt "cumulative") ("show balance change accumulated across periods (in multicolumn reports)" ++ defType CumulativeChange )- ,flagNone ["historical","H"] (\opts -> setboolopt "historical" opts)+ ,flagNone ["historical","H"] (setboolopt "historical") ("show historical ending balance in each period (includes postings before report start date)" ++ defType HistoricalBalance )- ,flagNone ["flat"] (\opts -> setboolopt "flat" opts) "show accounts as a list"+ ,flagNone ["flat"] (setboolopt "flat") "show accounts as a list" ,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"- ,flagNone ["no-total","N"] (\opts -> setboolopt "no-total" opts) "omit the final total row"- ,flagNone ["tree"] (\opts -> setboolopt "tree" opts) "show accounts as a tree; amounts include subaccounts (default in simple reports)"- ,flagNone ["average","A"] (\opts -> setboolopt "average" opts) "show a row average column (in multicolumn reports)"- ,flagNone ["row-total","T"] (\opts -> setboolopt "row-total" opts) "show a row total column (in multicolumn reports)"- ,flagNone ["no-elide"] (\opts -> setboolopt "no-elide" opts) "don't squash boring parent accounts (in tree mode)"+ ,flagNone ["no-total","N"] (setboolopt "no-total") "omit the final total row"+ ,flagNone ["tree"] (setboolopt "tree") "show accounts as a tree; amounts include subaccounts (default in simple reports)"+ ,flagNone ["average","A"] (setboolopt "average") "show a row average column (in multicolumn reports)"+ ,flagNone ["row-total","T"] (setboolopt "row-total") "show a row total column (in multicolumn reports)"+ ,flagNone ["no-elide"] (setboolopt "no-elide") "don't squash boring parent accounts (in tree mode)" ,flagReq ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)"- ,flagNone ["pretty-tables"] (\opts -> setboolopt "pretty-tables" opts) "use unicode when displaying tables"- ,flagNone ["sort-amount","S"] (\opts -> setboolopt "sort-amount" opts) "sort by amount instead of account code/name"+ ,flagNone ["pretty-tables"] (setboolopt "pretty-tables") "use unicode when displaying tables"+ ,flagNone ["sort-amount","S"] (setboolopt "sort-amount") "sort by amount instead of account code/name" ,outputFormatFlag ,outputFileFlag ]
Hledger/Cli/Main.hs view
@@ -175,9 +175,9 @@ cmdaction opts (error "journal-less command tried to use the journal") "add" -> -- should create the journal if missing (ensureJournalFileExists =<< (head <$> journalFilePathFromOpts opts)) >>- withJournalDo opts cmdaction+ withJournalDo opts (cmdaction opts) _ -> -- all other commands: read the journal or fail if missing- withJournalDo opts cmdaction+ withJournalDo opts (cmdaction opts) ) `orShowHelp` cmdmode
Hledger/Cli/Utils.hs view
@@ -61,19 +61,19 @@ -- | 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 :: CliOpts -> (Journal -> IO a) -> IO a 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- readJournalFiles (inputopts_ opts) journalpaths + readJournalFiles (inputopts_ opts) journalpaths >>= mapM (journalTransform opts)- >>= either error' (cmd opts)+ >>= either error' cmd -- | 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)@@ -106,7 +106,7 @@ pAnons p = p { paccount = T.intercalate (T.pack ":") . map anon . T.splitOn (T.pack ":") . paccount $ p , pcomment = T.empty , ptransaction = fmap tAnons . ptransaction $ p- , porigin = pAnons <$> porigin p+ , poriginal = pAnons <$> poriginal p } tAnons txn = txn { tpostings = map pAnons . tpostings $ txn , tdescription = anon . tdescription $ txn
embeddedfiles/hledger-api.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-api" "1" "February 2019" "hledger\-api 1.13" "hledger User Manuals"+.TH "hledger\-api" "1" "March 2019" "hledger\-api 1.14" "hledger User Manuals"
embeddedfiles/hledger-api.info view
@@ -3,7 +3,7 @@ File: hledger-api.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-api(1) hledger-api 1.13+hledger-api(1) hledger-api 1.14 ******************************* hledger-api is a simple web API server, intended to support client-side
embeddedfiles/hledger-api.txt view
@@ -117,4 +117,4 @@ -hledger-api 1.13 February 2019 hledger-api(1)+hledger-api 1.14 March 2019 hledger-api(1)
embeddedfiles/hledger-ui.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-ui" "1" "February 2019" "hledger\-ui 1.13" "hledger User Manuals"+.TH "hledger\-ui" "1" "March 2019" "hledger\-ui 1.14" "hledger User Manuals"
embeddedfiles/hledger-ui.info view
@@ -3,7 +3,7 @@ File: hledger-ui.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-ui(1) hledger-ui 1.13+hledger-ui(1) hledger-ui 1.14 ***************************** hledger-ui is hledger's curses-style interface, providing an efficient
embeddedfiles/hledger-ui.txt view
@@ -406,4 +406,4 @@ -hledger-ui 1.13 February 2019 hledger-ui(1)+hledger-ui 1.14 March 2019 hledger-ui(1)
embeddedfiles/hledger-web.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-web" "1" "February 2019" "hledger\-web 1.13" "hledger User Manuals"+.TH "hledger\-web" "1" "March 2019" "hledger\-web 1.14" "hledger User Manuals" @@ -41,54 +41,15 @@ \f[C]$LEDGER_FILE\f[], or \f[C]$HOME/.hledger.journal\f[] (on windows, perhaps \f[C]C:/Users/USER/.hledger.journal\f[]). For more about this see hledger(1), hledger_journal(5) etc.-.PP-By default, hledger\-web starts the web app in "transient mode" and also-opens it in your default web browser if possible.-In this mode the web app will keep running for as long as you have it-open in a browser window, and will exit after two minutes of inactivity-(no requests and no browser windows viewing it).-With \f[C]\-\-serve\f[], it just runs the web app without exiting, and-logs requests to the console.-.PP-By default the server listens on IP address 127.0.0.1, accessible only-to local requests.-You can use \f[C]\-\-host\f[] to change this, eg-\f[C]\-\-host\ 0.0.0.0\f[] to listen on all configured addresses.-.PP-Similarly, use \f[C]\-\-port\f[] to set a TCP port other than 5000, eg-if you are running multiple hledger\-web instances.-.PP-You can use \f[C]\-\-base\-url\f[] to change the protocol, hostname,-port and path that appear in hyperlinks, useful eg for integrating-hledger\-web within a larger website.-The default is \f[C]http://HOST:PORT/\f[] using the server\[aq]s-configured host address and TCP port (or \f[C]http://HOST\f[] if PORT is-80).-.PP-With \f[C]\-\-file\-url\f[] you can set a different base url for static-files, eg for better caching or cookie\-less serving on high performance-websites.-.PP-Note there is no built\-in access control (aside from listening on-127.0.0.1 by default).-So you will need to hide hledger\-web behind an authenticating proxy-(such as apache or nginx) if you want to restrict who can see and add-entries to your journal.+.SH OPTIONS .PP Command\-line options and arguments may be used to set an initial filter on the data.-This is not shown in the web UI, but it will be applied in addition to-any search query entered there.-.PP-With journal and timeclock files (but not CSV files, currently) the web-app detects changes made by other means and will show the new data on-the next request.-If a change makes the file unparseable, hledger\-web will show an error-until the file has been fixed.-.SH OPTIONS+These filter options are not shown in the web UI, but it will be applied+in addition to any search query entered there. .PP Note: if invoking hledger\-web as a hledger subcommand, write-\f[C]\-\-\f[] before options as shown above.+\f[C]\-\-\f[] before options, as shown in the synopsis above. .TP .B \f[C]\-\-serve\f[] serve and log requests, don\[aq]t browse or auto\-exit@@ -119,6 +80,17 @@ with this. .RS .RE+.TP+.B \f[C]\-\-capabilities=CAP[,CAP..]\f[]+enable the view, add, and/or manage capabilities (default: view,add)+.RS+.RE+.TP+.B \f[C]\-\-capabilities\-header=HTTPHEADER\f[]+read capabilities to enable from a HTTP header, like+X\-Sandstorm\-Permissions (default: disabled)+.RS+.RE .PP hledger input options: .TP@@ -286,6 +258,111 @@ A \@FILE argument will be expanded to the contents of FILE, which should contain one command line option/argument per line. (To prevent this, insert a \f[C]\-\-\f[] argument before.)+.PP+By default, hledger\-web starts the web app in "transient mode" and also+opens it in your default web browser if possible.+In this mode the web app will keep running for as long as you have it+open in a browser window, and will exit after two minutes of inactivity+(no requests and no browser windows viewing it).+With \f[C]\-\-serve\f[], it just runs the web app without exiting, and+logs requests to the console.+.PP+By default the server listens on IP address 127.0.0.1, accessible only+to local requests.+You can use \f[C]\-\-host\f[] to change this, eg+\f[C]\-\-host\ 0.0.0.0\f[] to listen on all configured addresses.+.PP+Similarly, use \f[C]\-\-port\f[] to set a TCP port other than 5000, eg+if you are running multiple hledger\-web instances.+.PP+You can use \f[C]\-\-base\-url\f[] to change the protocol, hostname,+port and path that appear in hyperlinks, useful eg for integrating+hledger\-web within a larger website.+The default is \f[C]http://HOST:PORT/\f[] using the server\[aq]s+configured host address and TCP port (or \f[C]http://HOST\f[] if PORT is+80).+.PP+With \f[C]\-\-file\-url\f[] you can set a different base url for static+files, eg for better caching or cookie\-less serving on high performance+websites.+.SH PERMISSIONS+.PP+By default, hledger\-web allows anyone who can reach it to view the+journal and to add new transactions, but not to change existing data.+.PP+You can restrict who can reach it by+.IP \[bu] 2+setting the IP address it listens on (see \f[C]\-\-host\f[] above).+By default it listens on 127.0.0.1, accessible to all users on the local+machine.+.IP \[bu] 2+putting it behind an authenticating proxy, using eg apache or nginx+.IP \[bu] 2+custom firewall rules+.PP+You can restrict what the users who reach it can do, by+.IP \[bu] 2+using the \f[C]\-\-capabilities=CAP[,CAP..]\f[] flag when you start it,+enabling one or more of the following capabilities.+The default value is \f[C]view,add\f[]:+.RS 2+.IP \[bu] 2+\f[C]view\f[] \- allows viewing the journal file and all included files+.IP \[bu] 2+\f[C]add\f[] \- allows adding new transactions to the main journal file+.IP \[bu] 2+\f[C]manage\f[] \- allows editing, uploading or downloading the main or+included files+.RE+.IP \[bu] 2+using the \f[C]\-\-capabilities\-header=HTTPHEADER\f[] flag to specify a+HTTP header from which it will read capabilities to enable.+hledger\-web on Sandstorm uses the X\-Sandstorm\-Permissions header to+integrate with Sandstorm\[aq]s permissions.+This is disabled by default.+.SH EDITING, UPLOADING, DOWNLOADING+.PP+If you enable the \f[C]manage\f[] capability mentioned above, you\[aq]ll+see a new "spanner" button to the right of the search form.+Clicking this will let you edit, upload, or download the journal file or+any files it includes.+.PP+Note, unlike any other hledger command, in this mode you (or any+visitor) can alter or wipe the data files.+.PP+Normally whenever a file is changed in this way, hledger\-web saves a+numbered backup (assuming file permissions allow it, the disk is not+full, etc.) hledger\-web is not aware of version control systems,+currently; if you use one, you\[aq]ll have to arrange to commit the+changes yourself (eg with a cron job or a file watcher like entr).+.PP+Changes which would leave the journal file(s) unparseable or non\-valid+(eg with failing balance assertions) are prevented.+(Probably.+This needs re\-testing.)+.SH RELOADING+.PP+hledger\-web detects changes made to the files by other means (eg if you+edit it directly, outside of hledger\-web), and it will show the new+data when you reload the page or navigate to a new page.+If a change makes a file unparseable, hledger\-web will display an error+message until the file has been fixed.+.SH JSON API+.PP+In addition to the web UI, hledger\-web provides some JSON API routes.+These are similar to the API provided by the hledger\-api tool, but it+may be convenient to have them in hledger\-web also.+.IP+.nf+\f[C]+/accountnames+/transactions+/prices+/commodities+/accounts+/accounttransactions/#AccountName+\f[]+.fi .SH ENVIRONMENT .PP \f[B]LEDGER_FILE\f[] The journal file path when not specified with
embeddedfiles/hledger-web.info view
@@ -3,7 +3,7 @@ File: hledger-web.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-web(1) hledger-web 1.13+hledger-web(1) hledger-web 1.14 ******************************* hledger-web is hledger's web interface. It starts a simple web@@ -25,57 +25,27 @@ '$LEDGER_FILE', or '$HOME/.hledger.journal' (on windows, perhaps 'C:/Users/USER/.hledger.journal'). For more about this see hledger(1), hledger_journal(5) etc.-- By default, hledger-web starts the web app in "transient mode" and-also opens it in your default web browser if possible. In this mode the-web app will keep running for as long as you have it open in a browser-window, and will exit after two minutes of inactivity (no requests and-no browser windows viewing it). With '--serve', it just runs the web-app without exiting, and logs requests to the console.-- By default the server listens on IP address 127.0.0.1, accessible-only to local requests. You can use '--host' to change this, eg '--host-0.0.0.0' to listen on all configured addresses.-- Similarly, use '--port' to set a TCP port other than 5000, eg if you-are running multiple hledger-web instances.-- You can use '--base-url' to change the protocol, hostname, port and-path that appear in hyperlinks, useful eg for integrating hledger-web-within a larger website. The default is 'http://HOST:PORT/' using the-server's configured host address and TCP port (or 'http://HOST' if PORT-is 80).-- With '--file-url' you can set a different base url for static files,-eg for better caching or cookie-less serving on high performance-websites.-- Note there is no built-in access control (aside from listening on-127.0.0.1 by default). So you will need to hide hledger-web behind an-authenticating proxy (such as apache or nginx) if you want to restrict-who can see and add entries to your journal.-- Command-line options and arguments may be used to set an initial-filter on the data. This is not shown in the web UI, but it will be-applied in addition to any search query entered there.-- With journal and timeclock files (but not CSV files, currently) the-web app detects changes made by other means and will show the new data-on the next request. If a change makes the file unparseable,-hledger-web will show an error until the file has been fixed. * Menu: * OPTIONS::+* PERMISSIONS::+* EDITING UPLOADING DOWNLOADING::+* RELOADING::+* JSON API:: -File: hledger-web.info, Node: OPTIONS, Prev: Top, Up: Top+File: hledger-web.info, Node: OPTIONS, Next: PERMISSIONS, Prev: Top, Up: Top 1 OPTIONS ********* -Note: if invoking hledger-web as a hledger subcommand, write '--' before-options as shown above.+Command-line options and arguments may be used to set an initial filter+on the data. These filter options are not shown in the web UI, but it+will be applied in addition to any search query entered there. + Note: if invoking hledger-web as a hledger subcommand, write '--'+before options, as shown in the synopsis above.+ '--serve' serve and log requests, don't browse or auto-exit@@ -96,7 +66,15 @@ normally serves static files itself, but if you wanted to serve them from another server for efficiency, you would set the url with this.+'--capabilities=CAP[,CAP..]' + enable the view, add, and/or manage capabilities (default:+ view,add)+'--capabilities-header=HTTPHEADER'++ read capabilities to enable from a HTTP header, like+ X-Sandstorm-Permissions (default: disabled)+ hledger input options: '-f FILE --file=FILE'@@ -209,10 +187,129 @@ should contain one command line option/argument per line. (To prevent this, insert a '--' argument before.) + By default, hledger-web starts the web app in "transient mode" and+also opens it in your default web browser if possible. In this mode the+web app will keep running for as long as you have it open in a browser+window, and will exit after two minutes of inactivity (no requests and+no browser windows viewing it). With '--serve', it just runs the web+app without exiting, and logs requests to the console.++ By default the server listens on IP address 127.0.0.1, accessible+only to local requests. You can use '--host' to change this, eg '--host+0.0.0.0' to listen on all configured addresses.++ Similarly, use '--port' to set a TCP port other than 5000, eg if you+are running multiple hledger-web instances.++ You can use '--base-url' to change the protocol, hostname, port and+path that appear in hyperlinks, useful eg for integrating hledger-web+within a larger website. The default is 'http://HOST:PORT/' using the+server's configured host address and TCP port (or 'http://HOST' if PORT+is 80).++ With '--file-url' you can set a different base url for static files,+eg for better caching or cookie-less serving on high performance+websites.+ +File: hledger-web.info, Node: PERMISSIONS, Next: EDITING UPLOADING DOWNLOADING, Prev: OPTIONS, Up: Top++2 PERMISSIONS+*************++By default, hledger-web allows anyone who can reach it to view the+journal and to add new transactions, but not to change existing data.++ You can restrict who can reach it by++ * setting the IP address it listens on (see '--host' above). By+ default it listens on 127.0.0.1, accessible to all users on the+ local machine.+ * putting it behind an authenticating proxy, using eg apache or nginx+ * custom firewall rules++ You can restrict what the users who reach it can do, by++ * using the '--capabilities=CAP[,CAP..]' flag when you start it,+ enabling one or more of the following capabilities. The default+ value is 'view,add':+ * 'view' - allows viewing the journal file and all included+ files+ * 'add' - allows adding new transactions to the main journal+ file+ * 'manage' - allows editing, uploading or downloading the main+ or included files++ * using the '--capabilities-header=HTTPHEADER' flag to specify a HTTP+ header from which it will read capabilities to enable. hledger-web+ on Sandstorm uses the X-Sandstorm-Permissions header to integrate+ with Sandstorm's permissions. This is disabled by default.+++File: hledger-web.info, Node: EDITING UPLOADING DOWNLOADING, Next: RELOADING, Prev: PERMISSIONS, Up: Top++3 EDITING, UPLOADING, DOWNLOADING+*********************************++If you enable the 'manage' capability mentioned above, you'll see a new+"spanner" button to the right of the search form. Clicking this will+let you edit, upload, or download the journal file or any files it+includes.++ Note, unlike any other hledger command, in this mode you (or any+visitor) can alter or wipe the data files.++ Normally whenever a file is changed in this way, hledger-web saves a+numbered backup (assuming file permissions allow it, the disk is not+full, etc.) hledger-web is not aware of version control systems,+currently; if you use one, you'll have to arrange to commit the changes+yourself (eg with a cron job or a file watcher like entr).++ Changes which would leave the journal file(s) unparseable or+non-valid (eg with failing balance assertions) are prevented.+(Probably. This needs re-testing.)+++File: hledger-web.info, Node: RELOADING, Next: JSON API, Prev: EDITING UPLOADING DOWNLOADING, Up: Top++4 RELOADING+***********++hledger-web detects changes made to the files by other means (eg if you+edit it directly, outside of hledger-web), and it will show the new data+when you reload the page or navigate to a new page. If a change makes a+file unparseable, hledger-web will display an error message until the+file has been fixed.+++File: hledger-web.info, Node: JSON API, Prev: RELOADING, Up: Top++5 JSON API+**********++In addition to the web UI, hledger-web provides some JSON API routes.+These are similar to the API provided by the hledger-api tool, but it+may be convenient to have them in hledger-web also.++/accountnames+/transactions+/prices+/commodities+/accounts+/accounttransactions/#AccountName++ Tag Table: Node: Top72-Node: OPTIONS3154-Ref: #options3239+Node: OPTIONS1354+Ref: #options1459+Node: PERMISSIONS6549+Ref: #permissions6688+Node: EDITING UPLOADING DOWNLOADING7900+Ref: #editing-uploading-downloading8081+Node: RELOADING8915+Ref: #reloading9049+Node: JSON API9359+Ref: #json-api9453 End Tag Table
embeddedfiles/hledger-web.txt view
@@ -35,45 +35,13 @@ C:/Users/USER/.hledger.journal). For more about this see hledger(1), hledger_journal(5) etc. - By default, hledger-web starts the web app in "transient mode" and also- opens it in your default web browser if possible. In this mode the web- app will keep running for as long as you have it open in a browser win-- dow, and will exit after two minutes of inactivity (no requests and no- browser windows viewing it). With --serve, it just runs the web app- without exiting, and logs requests to the console.-- By default the server listens on IP address 127.0.0.1, accessible only- to local requests. You can use --host to change this, eg- --host 0.0.0.0 to listen on all configured addresses.-- Similarly, use --port to set a TCP port other than 5000, eg if you are- running multiple hledger-web instances.-- You can use --base-url to change the protocol, hostname, port and path- that appear in hyperlinks, useful eg for integrating hledger-web within- a larger website. The default is http://HOST:PORT/ using the server's- configured host address and TCP port (or http://HOST if PORT is 80).-- With --file-url you can set a different base url for static files, eg- for better caching or cookie-less serving on high performance websites.-- Note there is no built-in access control (aside from listening on- 127.0.0.1 by default). So you will need to hide hledger-web behind an- authenticating proxy (such as apache or nginx) if you want to restrict- who can see and add entries to your journal.-+OPTIONS Command-line options and arguments may be used to set an initial filter- on the data. This is not shown in the web UI, but it will be applied- in addition to any search query entered there.-- With journal and timeclock files (but not CSV files, currently) the web- app detects changes made by other means and will show the new data on- the next request. If a change makes the file unparseable, hledger-web- will show an error until the file has been fixed.+ on the data. These filter options are not shown in the web UI, but it+ will be applied in addition to any search query entered there. -OPTIONS- Note: if invoking hledger-web as a hledger subcommand, write -- before- options as shown above.+ Note: if invoking hledger-web as a hledger subcommand, write -- before+ options, as shown in the synopsis above. --serve serve and log requests, don't browse or auto-exit@@ -85,16 +53,24 @@ listen on this TCP port (default: 5000) --base-url=URL- set the base url (default: http://IPADDR:PORT). You would+ set the base url (default: http://IPADDR:PORT). You would change this when sharing over the network, or integrating within a larger website. --file-url=URL set the static files url (default: BASEURL/static). hledger-web- normally serves static files itself, but if you wanted to serve- them from another server for efficiency, you would set the url+ normally serves static files itself, but if you wanted to serve+ them from another server for efficiency, you would set the url with this. + --capabilities=CAP[,CAP..]+ enable the view, add, and/or manage capabilities (default:+ view,add)++ --capabilities-header=HTTPHEADER+ read capabilities to enable from a HTTP header, like X-Sand-+ storm-Permissions (default: disabled)+ hledger input options: -f FILE --file=FILE@@ -102,7 +78,7 @@ $LEDGER_FILE or $HOME/.hledger.journal) --rules-file=RULESFILE- Conversion rules file to use when reading CSV (default:+ Conversion rules file to use when reading CSV (default: FILE.rules) --separator=CHAR@@ -143,11 +119,11 @@ multiperiod/multicolumn report by year -p --period=PERIODEXP- set start date, end date, and/or reporting interval all at once+ set start date, end date, and/or reporting interval all at once using period expressions syntax (overrides the flags above) --date2- match the secondary date instead (see command help for other+ match the secondary date instead (see command help for other effects) -U --unmarked@@ -166,21 +142,21 @@ hide/aggregate accounts or postings more than NUM levels deep -E --empty- show items with zero amount, normally hidden (and vice-versa in+ show items with zero amount, normally hidden (and vice-versa in hledger-ui/hledger-web) -B --cost- convert amounts to their cost at transaction time (using the+ convert amounts to their cost at transaction time (using the transaction price, if any) -V --value- convert amounts to their market value on the report end date+ convert amounts to their market value on the report end date (using the most recent applicable market price, if any) --auto apply automated posting rules to modify transactions. --forecast- apply periodic transaction rules to generate future transac-+ apply periodic transaction rules to generate future transac- tions, to 6 months from now or report end date. When a reporting option appears more than once in the command line, the@@ -200,22 +176,114 @@ show debug output (levels 1-9, default: 1) A @FILE argument will be expanded to the contents of FILE, which should- contain one command line option/argument per line. (To prevent this,+ contain one command line option/argument per line. (To prevent this, insert a -- argument before.) + By default, hledger-web starts the web app in "transient mode" and also+ opens it in your default web browser if possible. In this mode the web+ app will keep running for as long as you have it open in a browser win-+ dow, and will exit after two minutes of inactivity (no requests and no+ browser windows viewing it). With --serve, it just runs the web app+ without exiting, and logs requests to the console.++ By default the server listens on IP address 127.0.0.1, accessible only+ to local requests. You can use --host to change this, eg+ --host 0.0.0.0 to listen on all configured addresses.++ Similarly, use --port to set a TCP port other than 5000, eg if you are+ running multiple hledger-web instances.++ You can use --base-url to change the protocol, hostname, port and path+ that appear in hyperlinks, useful eg for integrating hledger-web within+ a larger website. The default is http://HOST:PORT/ using the server's+ configured host address and TCP port (or http://HOST if PORT is 80).++ With --file-url you can set a different base url for static files, eg+ for better caching or cookie-less serving on high performance websites.++PERMISSIONS+ By default, hledger-web allows anyone who can reach it to view the+ journal and to add new transactions, but not to change existing data.++ You can restrict who can reach it by++ o setting the IP address it listens on (see --host above). By default+ it listens on 127.0.0.1, accessible to all users on the local+ machine.++ o putting it behind an authenticating proxy, using eg apache or nginx++ o custom firewall rules++ You can restrict what the users who reach it can do, by++ o using the --capabilities=CAP[,CAP..] flag when you start it, enabling+ one or more of the following capabilities. The default value is+ view,add:++ o view - allows viewing the journal file and all included files++ o add - allows adding new transactions to the main journal file++ o manage - allows editing, uploading or downloading the main or+ included files++ o using the --capabilities-header=HTTPHEADER flag to specify a HTTP+ header from which it will read capabilities to enable. hledger-web+ on Sandstorm uses the X-Sandstorm-Permissions header to integrate+ with Sandstorm's permissions. This is disabled by default.++EDITING, UPLOADING, DOWNLOADING+ If you enable the manage capability mentioned above, you'll see a new+ "spanner" button to the right of the search form. Clicking this will+ let you edit, upload, or download the journal file or any files it+ includes.++ Note, unlike any other hledger command, in this mode you (or any visi-+ tor) can alter or wipe the data files.++ Normally whenever a file is changed in this way, hledger-web saves a+ numbered backup (assuming file permissions allow it, the disk is not+ full, etc.) hledger-web is not aware of version control systems, cur-+ rently; if you use one, you'll have to arrange to commit the changes+ yourself (eg with a cron job or a file watcher like entr).++ Changes which would leave the journal file(s) unparseable or non-valid+ (eg with failing balance assertions) are prevented. (Probably. This+ needs re-testing.)++RELOADING+ hledger-web detects changes made to the files by other means (eg if you+ edit it directly, outside of hledger-web), and it will show the new+ data when you reload the page or navigate to a new page. If a change+ makes a file unparseable, hledger-web will display an error message+ until the file has been fixed.++JSON API+ In addition to the web UI, hledger-web provides some JSON API routes.+ These are similar to the API provided by the hledger-api tool, but it+ may be convenient to have them in hledger-web also.++ /accountnames+ /transactions+ /prices+ /commodities+ /accounts+ /accounttransactions/#AccountName+ ENVIRONMENT 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 options with -- when invoked from hledger is awk-+ The need to precede options with -- when invoked from hledger is awk- ward. -f- doesn't work (hledger-web can't read from stdin).@@ -229,7 +297,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) @@ -243,7 +311,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) @@ -251,4 +319,4 @@ -hledger-web 1.13 February 2019 hledger-web(1)+hledger-web 1.14 March 2019 hledger-web(1)
embeddedfiles/hledger.1 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "February 2019" "hledger 1.13" "hledger User Manuals"+.TH "hledger" "1" "March 2019" "hledger 1.14" "hledger User Manuals" @@ -1783,8 +1783,6 @@ considered, not just the ones with activity during the report period (use \-E to include low\-activity accounts which would otherwise would be omitted).-With \f[C]\-\-budget\f[], \f[C]\-\-empty\f[] also shows unbudgeted-accounts. .PP The \f[C]\-T/\-\-row\-total\f[] flag adds an additional column showing the total for each row.@@ -1884,14 +1882,31 @@ \f[] .fi .PP-By default, only accounts with budget goals during the report period are-shown.-In the example above, transactions in \f[C]expenses:gifts\f[] and-\f[C]expenses:supplies\f[] are counted towards \f[C]expenses\f[] budget,-but accounts \f[C]expenses:gifts\f[] and \f[C]expenses:supplies\f[] are-not shown, as they don\[aq]t have any budgets.+Note this is different from a normal balance report in several ways:+.IP \[bu] 2+Only accounts with budget goals during the report period are shown, by+default.+.IP \[bu] 2+In each column, in square brackets after the actual amount, budgeted+amounts are shown, along with the percentage of budget used.+.IP \[bu] 2+All parent accounts are always shown, even in flat mode.+Eg assets, assets:bank, and expenses above.+.IP \[bu] 2+Amounts always include all subaccounts, budgeted or unbudgeted, even in+flat mode. .PP-You can use \f[C]\-\-empty\f[] shows unbudgeted accounts as well:+This means that the numbers displayed will not always add up! Eg above,+the \f[C]expenses\f[] actual amount includes the gifts and supplies+transactions, but the \f[C]expenses:gifts\f[] and+\f[C]expenses:supplies\f[] accounts are not shown, as they have no+budget amounts declared.+.PP+This can be confusing.+When you need to make things clearer, use the \f[C]\-E/\-\-empty\f[]+flag, which will reveal all accounts including unbudgeted ones, giving+the full picture.+Eg: .IP .nf \f[C]@@ -1938,9 +1953,6 @@ \f[] .fi .PP-Note, the \f[C]\-S/\-\-sort\-amount\f[] flag is not yet fully supported-with \f[C]\-\-budget\f[].-.PP For more examples, see Budgeting and Forecasting. .SS Nested budgets .PP@@ -2658,6 +2670,18 @@ The \f[C]\-\-related\f[]/\f[C]\-r\f[] flag shows the \f[I]other\f[] postings in the transactions of the postings which would normally be shown.+.PP+The \f[C]\-\-invert\f[] flag negates all amounts.+For example, it can be used on an income account where amounts are+normally displayed as negative numbers.+It\[aq]s also useful to show postings on the checking account together+with the related account:+.IP+.nf+\f[C]+$\ hledger\ register\ \-\-related\ \-\-invert\ assets:checking+\f[]+.fi .PP With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account:
embeddedfiles/hledger.info view
@@ -3,7 +3,7 @@ File: hledger.info, Node: Top, Next: EXAMPLES, Up: (dir) -hledger(1) hledger 1.13+hledger(1) hledger 1.14 *********************** This is hledger's command-line interface (there are also curses and web@@ -1404,8 +1404,7 @@ 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 otherwise-would be omitted). With '--budget', '--empty' also shows unbudgeted-accounts.+would be omitted). The '-T/--row-total' flag adds an additional column showing the total for each row.@@ -1497,14 +1496,30 @@ ----------------------++---------------------------------------------------- || 0 [ 0] 0 [ 0] - By default, only accounts with budget goals during the report period-are shown. In the example above, transactions in 'expenses:gifts' and-'expenses:supplies' are counted towards 'expenses' budget, but accounts-'expenses:gifts' and 'expenses:supplies' are not shown, as they don't-have any budgets.+ Note this is different from a normal balance report in several ways: - You can use '--empty' shows unbudgeted accounts as well:+ * Only accounts with budget goals during the report period are shown,+ by default. + * In each column, in square brackets after the actual amount,+ budgeted amounts are shown, along with the percentage of budget+ used.++ * All parent accounts are always shown, even in flat mode. Eg+ assets, assets:bank, and expenses above.++ * Amounts always include all subaccounts, budgeted or unbudgeted,+ even in flat mode.++ This means that the numbers displayed will not always add up! Eg+above, the 'expenses' actual amount includes the gifts and supplies+transactions, but the 'expenses:gifts' and 'expenses:supplies' accounts+are not shown, as they have no budget amounts declared.++ This can be confusing. When you need to make things clearer, use the+'-E/--empty' flag, which will reveal all accounts including unbudgeted+ones, giving the full picture. Eg:+ $ hledger balance -M --budget --empty Budget performance in 2017/11/01-2017/12/31: @@ -1541,9 +1556,6 @@ ----------------------++---------------------------------------------------- || 0 [ 0] 0 [ 0] - Note, the '-S/--sort-amount' flag is not yet fully supported with-'--budget'.- For more examples, see Budgeting and Forecasting. * Menu: @@ -2170,6 +2182,13 @@ The '--related'/'-r' flag shows the _other_ postings in the transactions of the postings which would normally be shown. + The '--invert' flag negates all amounts. For example, it can be used+on an income account where amounts are normally displayed as negative+numbers. It's also useful to show postings on the checking account+together with the related account:++$ hledger register --related --invert assets:checking+ With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account: @@ -2752,86 +2771,86 @@ Ref: #depth-limited-balance-reports44118 Node: Multicolumn balance report44574 Ref: #multicolumn-balance-report44772-Node: Budget report50012-Ref: #budget-report50155-Node: Nested budgets54839-Ref: #nested-budgets54951-Ref: #output-format-158431-Node: balancesheet58509-Ref: #balancesheet58645-Node: balancesheetequity59879-Ref: #balancesheetequity60028-Node: cashflow60589-Ref: #cashflow60717-Node: check-dates61745-Ref: #check-dates61872-Node: check-dupes62151-Ref: #check-dupes62275-Node: close62568-Ref: #close62676-Node: files66089-Ref: #files66190-Node: help66337-Ref: #help66437-Node: import67530-Ref: #import67644-Node: incomestatement68388-Ref: #incomestatement68522-Node: prices69858-Ref: #prices69973-Node: print70252-Ref: #print70362-Node: print-unique74855-Ref: #print-unique74981-Node: register75266-Ref: #register75393-Node: Custom register output79262-Ref: #custom-register-output79391-Node: register-match80653-Ref: #register-match80787-Node: rewrite81138-Ref: #rewrite81253-Node: Re-write rules in a file83102-Ref: #re-write-rules-in-a-file83236-Node: Diff output format84446-Ref: #diff-output-format84615-Node: rewrite vs print --auto85707-Ref: #rewrite-vs.-print---auto85886-Node: roi86442-Ref: #roi86540-Node: stats87552-Ref: #stats87651-Node: tags88405-Ref: #tags88503-Node: test88733-Ref: #test88817-Node: ADD-ON COMMANDS89578-Ref: #add-on-commands89688-Node: Official add-ons90975-Ref: #official-add-ons91115-Node: api91202-Ref: #api91291-Node: ui91343-Ref: #ui91442-Node: web91500-Ref: #web91589-Node: Third party add-ons91635-Ref: #third-party-add-ons91810-Node: diff91945-Ref: #diff92042-Node: iadd92141-Ref: #iadd92255-Node: interest92338-Ref: #interest92459-Node: irr92554-Ref: #irr92652-Node: Experimental add-ons92783-Ref: #experimental-add-ons92935-Node: autosync93215-Ref: #autosync93326-Node: chart93565-Ref: #chart93684-Node: check93755-Ref: #check93857+Node: Budget report49952+Ref: #budget-report50095+Node: Nested budgets55296+Ref: #nested-budgets55408+Ref: #output-format-158888+Node: balancesheet58966+Ref: #balancesheet59102+Node: balancesheetequity60336+Ref: #balancesheetequity60485+Node: cashflow61046+Ref: #cashflow61174+Node: check-dates62202+Ref: #check-dates62329+Node: check-dupes62608+Ref: #check-dupes62732+Node: close63025+Ref: #close63133+Node: files66546+Ref: #files66647+Node: help66794+Ref: #help66894+Node: import67987+Ref: #import68101+Node: incomestatement68845+Ref: #incomestatement68979+Node: prices70315+Ref: #prices70430+Node: print70709+Ref: #print70819+Node: print-unique75312+Ref: #print-unique75438+Node: register75723+Ref: #register75850+Node: Custom register output80021+Ref: #custom-register-output80150+Node: register-match81412+Ref: #register-match81546+Node: rewrite81897+Ref: #rewrite82012+Node: Re-write rules in a file83861+Ref: #re-write-rules-in-a-file83995+Node: Diff output format85205+Ref: #diff-output-format85374+Node: rewrite vs print --auto86466+Ref: #rewrite-vs.-print---auto86645+Node: roi87201+Ref: #roi87299+Node: stats88311+Ref: #stats88410+Node: tags89164+Ref: #tags89262+Node: test89492+Ref: #test89576+Node: ADD-ON COMMANDS90337+Ref: #add-on-commands90447+Node: Official add-ons91734+Ref: #official-add-ons91874+Node: api91961+Ref: #api92050+Node: ui92102+Ref: #ui92201+Node: web92259+Ref: #web92348+Node: Third party add-ons92394+Ref: #third-party-add-ons92569+Node: diff92704+Ref: #diff92801+Node: iadd92900+Ref: #iadd93014+Node: interest93097+Ref: #interest93218+Node: irr93313+Ref: #irr93411+Node: Experimental add-ons93542+Ref: #experimental-add-ons93694+Node: autosync93974+Ref: #autosync94085+Node: chart94324+Ref: #chart94443+Node: check94514+Ref: #check94616 End Tag Table
embeddedfiles/hledger.txt view
@@ -1251,13 +1251,12 @@ 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). With --budget, --empty also shows unbudgeted- accounts.+ 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:@@ -1281,20 +1280,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- income, expenses, time usage, etc. --budget is most often combined+ 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@@ -1339,14 +1338,29 @@ ----------------------++---------------------------------------------------- || 0 [ 0] 0 [ 0] - By default, only accounts with budget goals during the report period- are shown. In the example above, transactions in expenses:gifts and- expenses:supplies are counted towards expenses budget, but accounts- expenses:gifts and expenses:supplies are not shown, as they don't have- any budgets.+ Note this is different from a normal balance report in several ways: - You can use --empty shows unbudgeted accounts as well:+ o Only accounts with budget goals during the report period are shown,+ by default. + o In each column, in square brackets after the actual amount, budgeted+ amounts are shown, along with the percentage of budget used.++ o All parent accounts are always shown, even in flat mode. Eg assets,+ assets:bank, and expenses above.++ o Amounts always include all subaccounts, budgeted or unbudgeted, even+ in flat mode.++ This means that the numbers displayed will not always add up! Eg above,+ the expenses actual amount includes the gifts and supplies transac-+ tions, but the expenses:gifts and expenses:supplies accounts are not+ shown, as they have no budget amounts declared.++ This can be confusing. When you need to make things clearer, use the+ -E/--empty flag, which will reveal all accounts including unbudgeted+ ones, giving the full picture. Eg:+ $ hledger balance -M --budget --empty Budget performance in 2017/11/01-2017/12/31: @@ -1383,18 +1397,15 @@ ----------------------++---------------------------------------------------- || 0 [ 0] 0 [ 0] - Note, the -S/--sort-amount flag is not yet fully supported with --bud-- get.- For more examples, see Budgeting and Forecasting. Nested budgets- You can add budgets to any account in your account hierarchy. If you+ You can add budgets to any account in your account hierarchy. If you have budgets on both parent account and some of its children, then bud-- get(s) of the child account(s) would be added to the budget of their+ get(s) of the child account(s) would be added to the budget of their parent, much like account balances behave. - In the most simple case this means that once you add a budget to any+ In the most simple case this means that once you add a budget to any account, all its parents would have budget as well. To illustrate this, consider the following budget:@@ -1404,13 +1415,13 @@ expenses:personal:electronics $100.00 liabilities - With this, monthly budget for electronics is defined to be $100 and- budget for personal expenses is an additional $1000, which implicity+ With this, monthly budget for electronics is defined to be $100 and+ budget for personal expenses is an additional $1000, which implicity means that budget for both expenses:personal and expenses is $1100. - Transactions in expenses:personal:electronics will be counted both- towards its $100 budget and $1100 of expenses:personal , and transac-- tions in any other subaccount of expenses:personal would be counted+ Transactions in expenses:personal:electronics will be counted both+ towards its $100 budget and $1100 of expenses:personal , and transac-+ tions in any other subaccount of expenses:personal would be counted towards only towards the budget of expenses:personal. For example, let's consider these transactions:@@ -1436,9 +1447,9 @@ expenses:personal $30.00 liabilities - As you can see, we have transactions in expenses:personal:electron-- ics:upgrades and expenses:personal:train tickets, and since both of- these accounts are without explicitly defined budget, these transac-+ As you can see, we have transactions in expenses:personal:electron-+ ics:upgrades and expenses:personal:train tickets, and since both of+ these accounts are without explicitly defined budget, these transac- tions would be counted towards budgets of expenses:personal:electronics and expenses:personal accordingly: @@ -1454,7 +1465,7 @@ -------------------------------++------------------------------- || 0 [ 0] - And with --empty, we can get a better picture of budget allocation and+ And with --empty, we can get a better picture of budget allocation and consumption: $ hledger balance --budget -M --empty@@ -1472,17 +1483,17 @@ || 0 [ 0] Output format- The balance command supports output destination and output format+ The balance command supports output destination and output format selection. balancesheet balancesheet, bs 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+ 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+ Note this report shows all account balances with normal positive sign (like conventional financial statements, unlike balance/print/register) (experimental). @@ -1508,17 +1519,17 @@ 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 balancesheetequity, bse- 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:@@ -1549,10 +1560,10 @@ cashflow cashflow, cf- 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). @@ -1573,77 +1584,77 @@ $-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-dates- Check that transactions are sorted by increasing date. With --date2,- checks secondary dates instead. With --strict, dates must also be- unique. With a query, only matched transactions' dates are checked.+ Check that transactions are sorted by increasing date. With --date2,+ checks secondary dates instead. With --strict, dates must also be+ unique. With a query, only matched transactions' dates are checked. Reads the default journal file, or another specified with -f. check-dupes check-dupes- Reports account names having the same leaf but different prefixes. In- other words, two or more leaves that are categorized differently.+ Reports account names having the same leaf but different prefixes. In+ other words, two or more leaves that are categorized differently. Reads the default journal file, or another specified as an argument. An example: http://stefanorodighiero.net/software/hledger-dupes.html close close, equity- Prints a "closing balances" transaction and an "opening balances"+ Prints a "closing balances" transaction and an "opening balances" transaction that bring account balances to and from zero, respectively. Useful for bringing asset/liability balances forward into a new journal- file, or for closing out revenues/expenses to retained earnings at the+ file, or for closing out revenues/expenses to retained earnings at the end of a period. - The closing transaction transfers balances to "equity:closing bal-- ances". The opening transaction transfers balances from "equity:open-- ing balances". You can chose to print just one of the transactions by+ The closing transaction transfers balances to "equity:closing bal-+ ances". The opening transaction transfers balances from "equity:open-+ ing balances". You can chose to print just one of the transactions by using the --opening or --closing flag. If you split your journal files by time (eg yearly), you will typically- run this command at the end of the year, and save the closing transac-- tion as last entry of the old file, and the opening transaction as the- first entry of the new file. This makes the files self contained, so- that correct balances are reported no matter which of them are loaded.- Ie, if you load just one file, the balances are initialised correctly;- or if you load several files, the redundant closing/opening transac-- tions cancel each other out. (They will show up in print or register- reports; you can exclude them with a query like not:desc:'(open-+ run this command at the end of the year, and save the closing transac-+ tion as last entry of the old file, and the opening transaction as the+ first entry of the new file. This makes the files self contained, so+ that correct balances are reported no matter which of them are loaded.+ Ie, if you load just one file, the balances are initialised correctly;+ or if you load several files, the redundant closing/opening transac-+ tions cancel each other out. (They will show up in print or register+ reports; you can exclude them with a query like not:desc:'(open- ing|closing) balances'.) If you're running a business, you might also use this command to "close- the books" at the end of an accounting period, transferring income- statement account balances to retained earnings. (You may want to+ the books" at the end of an accounting period, transferring income+ statement account balances to retained earnings. (You may want to change the equity account name to something like "equity:retained earn- ings".) - By default, the closing transaction is dated yesterday, the balances- are calculated as of end of yesterday, and the opening transaction is- dated today. To close on some other date, use: hledger close -e OPEN-- INGDATE. Eg, to close/open on the 2018/2019 boundary, use -e 2019.+ By default, the closing transaction is dated yesterday, the balances+ are calculated as of end of yesterday, and the opening transaction is+ dated today. To close on some other date, use: hledger close -e OPEN-+ INGDATE. Eg, to close/open on the 2018/2019 boundary, use -e 2019. You can also use -p or date:PERIOD (any starting date is ignored). Both transactions will include balance assertions for the- closed/reopened accounts. You probably shouldn't use status or real-- ness filters (like -C or -R or status:) with this command, or the gen-+ closed/reopened accounts. You probably shouldn't use status or real-+ ness filters (like -C or -R or status:) with this command, or the gen- erated balance assertions will depend on these flags. Likewise, if you- run this command with --auto, the balance assertions will probably+ run this command with --auto, the balance assertions will probably always require --auto. Examples: - Carrying asset/liability balances into a new file for 2019, all from+ Carrying asset/liability balances into a new file for 2019, all from command line: - Warning: we use >> here to append; be careful not to type a single >+ Warning: we use >> here to append; be careful not to type a single > which would wipe your journal! $ hledger close -f 2018.journal -e 2019 assets liabilities --opening >>2019.journal@@ -1676,20 +1687,20 @@ files files- List all files included in the journal. With a REGEX argument, only- file names matching the regular expression (case sensitive) are shown.+ List all files included in the journal. With a REGEX argument, only+ file names matching the regular expression (case sensitive) are shown. help 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. Examples:@@ -1716,8 +1727,8 @@ import import- Read new transactions added to each FILE since last run, and add them- to the main journal file. Or with --dry-run, just print the transac-+ Read new transactions added to each FILE since last run, and add them+ to the main journal file. Or with --dry-run, just print the transac- tions that would be added. The input files are specified as arguments - no need to write -f before@@ -1728,22 +1739,22 @@ 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 incomestatement, is- 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). - 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@@ -1768,19 +1779,19 @@ 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 prices- Print market price directives from the journal. With --costs, also- print synthetic market prices based on transaction prices. With+ Print market price directives from the journal. With --costs, also+ print synthetic market prices based on transaction prices. With --inverted-costs, also print inverse prices based on transaction- prices. Prices (and postings providing prices) can be filtered by a+ prices. Prices (and postings providing prices) can be filtered by a query. print@@ -1788,11 +1799,11 @@ Show transaction journal entries, sorted by date. The print command displays full journal entries (transactions) from the- journal file in date order, tidily formatted. With --date2, transac-+ journal file in date order, tidily formatted. With --date2, transac- tions are sorted by secondary date instead. print's output is always a valid hledger journal.- It preserves all transaction information, but it does not preserve+ It preserves all transaction information, but it does not preserve directives or inter-transaction comments $ hledger print@@ -1818,39 +1829,39 @@ assets:bank:checking $-1 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@@ -1867,20 +1878,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@@ -1904,7 +1915,7 @@ Show postings and their running total. The register command displays postings in date order, one per line, and- their running total. This is typically used with a query selecting a+ their running total. This is typically used with a query selecting a particular account, to see that account's activity: $ hledger register checking@@ -1915,8 +1926,8 @@ With --date2, it shows and sorts by secondary date instead. - 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@@ -1926,15 +1937,22 @@ 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. + The --invert flag negates all amounts. For example, it can be used on+ an income account where amounts are normally displayed as negative num-+ bers. It's also useful to show postings on the checking account+ together with the related account:++ $ hledger register --related --invert assets:checking+ With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account: @@ -2400,4 +2418,4 @@ -hledger 1.13 February 2019 hledger(1)+hledger 1.14 March 2019 hledger(1)
embeddedfiles/hledger_csv.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_csv" "5" "February 2019" "hledger 1.13" "hledger User Manuals"+.TH "hledger_csv" "5" "March 2019" "hledger 1.14" "hledger User Manuals"
embeddedfiles/hledger_csv.info view
@@ -3,7 +3,7 @@ File: hledger_csv.info, Node: Top, Next: CSV RULES, Up: (dir) -hledger_csv(5) hledger 1.13+hledger_csv(5) hledger 1.14 *************************** hledger can read CSV (comma-separated value) files as if they were
embeddedfiles/hledger_csv.txt view
@@ -249,4 +249,4 @@ -hledger 1.13 February 2019 hledger_csv(5)+hledger 1.14 March 2019 hledger_csv(5)
embeddedfiles/hledger_journal.5 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger_journal" "5" "February 2019" "hledger 1.13" "hledger User Manuals"+.TH "hledger_journal" "5" "March 2019" "hledger 1.14" "hledger User Manuals" @@ -491,10 +491,10 @@ .SS Balance Assertions .PP hledger supports Ledger\-style balance assertions in journal files.-These look like \f[C]=EXPECTEDBALANCE\f[] following a posting\[aq]s-amount.-Eg in this example we assert the expected dollar balance in accounts a-and b after each posting:+These look like, for example, \f[C]=\ EXPECTEDBALANCE\f[] following a+posting\[aq]s amount.+Eg here we assert the expected dollar balance in accounts a and b after+each posting: .IP .nf \f[C]@@ -513,7 +513,7 @@ Balance assertions can protect you from, eg, inadvertently disrupting reconciled balances while cleaning up old entries. You can disable them temporarily with the-\f[C]\-\-ignore\-assertions\f[] flag, which can be useful for+\f[C]\-I/\-\-ignore\-assertions\f[] flag, which can be useful for troubleshooting or for reading Ledger files. .SS Assertions and ordering .PP@@ -558,11 +558,10 @@ To assert the balance of more than one commodity in an account, you can write multiple postings, each asserting one commodity\[aq]s balance. .PP-You can make a stronger kind of balance assertion, by writing a double-equals sign (\f[C]==EXPECTEDBALANCE\f[]).-This "complete" balance assertion asserts the absence of other-commodities (or, that their balance is 0, which to hledger is-equivalent.)+You can make a stronger "total" balance assertion by writing a double+equals sign (\f[C]==\ EXPECTEDBALANCE\f[]).+This asserts that there are no other unasserted commodities in the+account (or, that their balance is 0). .IP .nf \f[C]@@ -619,29 +618,19 @@ \f[I]assignments\f[] do use them (see below). .SS Assertions and subaccounts .PP-Balance assertions do not count the balance from subaccounts; they check-the posted account\[aq]s exclusive balance.-For example:-.IP-.nf-\f[C]-1/1-\ \ checking:fund\ \ \ 1\ =\ 1\ \ ;\ post\ to\ this\ subaccount,\ its\ balance\ is\ now\ 1-\ \ checking\ \ \ \ \ \ \ \ 1\ =\ 1\ \ ;\ post\ to\ the\ parent\ account,\ its\ exclusive\ balance\ is\ now\ 1-\ \ equity-\f[]-.fi-.PP-The balance report\[aq]s flat mode shows these exclusive balances more-clearly:+The balance assertions above (\f[C]=\f[] and \f[C]==\f[]) do not count+the balance from subaccounts; they check the account\[aq]s exclusive+balance only.+You can assert the balance including subaccounts by writing \f[C]=*\f[]+or \f[C]==*\f[], eg: .IP .nf \f[C]-$\ hledger\ bal\ checking\ \-\-flat-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1\ \ checking-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1\ \ checking:fund-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2+2019/1/1+\ \ equity:opening\ balances+\ \ checking:a\ \ \ \ \ \ \ 5+\ \ checking:b\ \ \ \ \ \ \ 5+\ \ checking\ \ \ \ \ \ \ \ \ 1\ \ ==*\ 11 \f[] .fi .SS Assertions and virtual postings@@ -1753,54 +1742,13 @@ This changed in hledger 1.12+; see #893 for background. .SH EDITOR SUPPORT .PP-Add\-on modes exist for various text editors, to make working with+Helper modes exist for popular text editors, which make working with journal files easier.-They add colour, navigation aids and helpful commands.-For hledger users who edit the journal file directly (the majority),-using one of these modes is quite recommended.-.PP-These were written with Ledger in mind, but also work with hledger-files:-.PP-.TS-tab(@);-lw(12.2n) lw(57.8n).-T{-Editor-T}@T{-T}-_-T{-Emacs-T}@T{-http://www.ledger\-cli.org/3.0/doc/ledger\-mode.html-T}-T{-Vim-T}@T{-https://github.com/ledger/vim\-ledger-T}-T{-Sublime Text-T}@T{-https://github.com/ledger/ledger/wiki/Editing\-Ledger\-files\-with\-Sublime\-Text\-or\-RubyMine-T}-T{-Textmate-T}@T{-https://github.com/ledger/ledger/wiki/Using\-TextMate\-2-T}-T{-Text Wrangler \ -T}@T{-https://github.com/ledger/ledger/wiki/Editing\-Ledger\-files\-with\-TextWrangler-T}-T{-Visual Studio Code-T}@T{-https://marketplace.visualstudio.com/items?itemName=mark\-hansen.hledger\-vscode-T}-.TE+They add colour, formatting, tab completion, and helpful commands, and+are quite recommended if you edit your journal with a text editor.+They include ledger\-mode or hledger\-mode for Emacs, vim\-ledger for+Vim, hledger\-vscode for Visual Studio Code, and others.+See the [[Cookbook]] at hledger.org for the latest information. .SH "REPORTING BUGS"
embeddedfiles/hledger_journal.info view
@@ -4,7 +4,7 @@ File: hledger_journal.info, Node: Top, Next: FILE FORMAT, Up: (dir) -hledger_journal(5) hledger 1.13+hledger_journal(5) hledger 1.14 ******************************* hledger's usual data source is a plain text file containing journal@@ -449,9 +449,9 @@ ====================== hledger supports Ledger-style balance assertions in journal files.-These look like '=EXPECTEDBALANCE' following a posting's amount. Eg in-this example we assert the expected dollar balance in accounts a and b-after each posting:+These look like, for example, '= EXPECTEDBALANCE' following a posting's+amount. Eg here we assert the expected dollar balance in accounts a and+b after each posting: 2013/1/1 a $1 =$1@@ -465,8 +465,8 @@ assertions and report an error if any of them fail. Balance assertions can protect you from, eg, inadvertently disrupting reconciled balances while cleaning up old entries. You can disable them temporarily with-the '--ignore-assertions' flag, which can be useful for troubleshooting-or for reading Ledger files.+the '-I/--ignore-assertions' flag, which can be useful for+troubleshooting or for reading Ledger files. * Menu: * Assertions and ordering::@@ -533,10 +533,10 @@ To assert the balance of more than one commodity in an account, you can write multiple postings, each asserting one commodity's balance. - You can make a stronger kind of balance assertion, by writing a-double equals sign ('==EXPECTEDBALANCE'). This "complete" balance-assertion asserts the absence of other commodities (or, that their-balance is 0, which to hledger is equivalent.)+ You can make a stronger "total" balance assertion by writing a double+equals sign ('== EXPECTEDBALANCE'). This asserts that there are no+other unasserted commodities in the account (or, that their balance is+0). 2013/1/1 a $1@@ -591,22 +591,16 @@ 1.9.6 Assertions and subaccounts -------------------------------- -Balance assertions do not count the balance from subaccounts; they check-the posted account's exclusive balance. For example:--1/1- checking:fund 1 = 1 ; post to this subaccount, its balance is now 1- checking 1 = 1 ; post to the parent account, its exclusive balance is now 1- equity-- The balance report's flat mode shows these exclusive balances more-clearly:+The balance assertions above ('=' and '==') do not count the balance+from subaccounts; they check the account's exclusive balance only. You+can assert the balance including subaccounts by writing '=*' or '==*',+eg: -$ hledger bal checking --flat- 1 checking- 1 checking:fund---------------------- 2+2019/1/1+ equity:opening balances+ checking:a 5+ checking:b 5+ checking 1 ==* 11 File: hledger_journal.info, Node: Assertions and virtual postings, Next: Assertions and precision, Prev: Assertions and subaccounts, Up: Balance Assertions@@ -1581,26 +1575,12 @@ 2 EDITOR SUPPORT **************** -Add-on modes exist for various text editors, to make working with-journal files easier. They add colour, navigation aids and helpful-commands. For hledger users who edit the journal file directly (the-majority), using one of these modes is quite recommended.-- These were written with Ledger in mind, but also work with hledger-files:--Editor----------------------------------------------------------------------------Emacs http://www.ledger-cli.org/3.0/doc/ledger-mode.html-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-Text https://github.com/ledger/ledger/wiki/Editing-Ledger-files-with-TextWrangler-Wrangler -Visual https://marketplace.visualstudio.com/items?itemName=mark-hansen.hledger-vscode-Studio-Code+Helper modes exist for popular text editors, which make working with+journal files easier. They add colour, formatting, tab completion, and+helpful commands, and are quite recommended if you edit your journal+with a text editor. They include ledger-mode or hledger-mode for Emacs,+vim-ledger for Vim, hledger-vscode for Visual Studio Code, and others.+See the [[Cookbook]] at hledger.org for the latest information. Tag Table:@@ -1633,81 +1613,81 @@ Ref: #virtual-postings15185 Node: Balance Assertions16405 Ref: #balance-assertions16580-Node: Assertions and ordering17531-Ref: #assertions-and-ordering17717-Node: Assertions and included files18417-Ref: #assertions-and-included-files18658-Node: Assertions and multiple -f options18991-Ref: #assertions-and-multiple--f-options19245-Node: Assertions and commodities19377-Ref: #assertions-and-commodities19607-Node: Assertions and prices20795-Ref: #assertions-and-prices21007-Node: Assertions and subaccounts21447-Ref: #assertions-and-subaccounts21674-Node: Assertions and virtual postings22195-Ref: #assertions-and-virtual-postings22435-Node: Assertions and precision22577-Ref: #assertions-and-precision22768-Node: Balance Assignments23035-Ref: #balance-assignments23216-Node: Balance assignments and prices24380-Ref: #balance-assignments-and-prices24552-Node: Transaction prices24776-Ref: #transaction-prices24945-Node: Comments27213-Ref: #comments27347-Node: Tags28517-Ref: #tags28635-Node: Directives30037-Ref: #directives30180-Node: Comment blocks35787-Ref: #comment-blocks35932-Node: Including other files36108-Ref: #including-other-files36288-Node: Default year36696-Ref: #default-year36865-Node: Declaring commodities37288-Ref: #declaring-commodities37471-Node: Default commodity38698-Ref: #default-commodity38874-Node: Market prices39510-Ref: #market-prices39675-Node: Declaring accounts40516-Ref: #declaring-accounts40692-Node: Account comments41617-Ref: #account-comments41780-Node: Account subdirectives42175-Ref: #account-subdirectives42370-Node: Account types42683-Ref: #account-types42867-Node: Account display order44511-Ref: #account-display-order44681-Node: Rewriting accounts45810-Ref: #rewriting-accounts45995-Node: Basic aliases46729-Ref: #basic-aliases46875-Node: Regex aliases47579-Ref: #regex-aliases47750-Node: Multiple aliases48468-Ref: #multiple-aliases48643-Node: end aliases49141-Ref: #end-aliases49288-Node: Default parent account49389-Ref: #default-parent-account49555-Node: Periodic transactions50439-Ref: #periodic-transactions50621-Node: Two spaces after the period expression51746-Ref: #two-spaces-after-the-period-expression51991-Node: Forecasting with periodic transactions52476-Ref: #forecasting-with-periodic-transactions52766-Node: Budgeting with periodic transactions54453-Ref: #budgeting-with-periodic-transactions54692-Node: Transaction modifiers55151-Ref: #transaction-modifiers55314-Node: Auto postings and transaction balancing / inferred amounts / balance assertions57298-Ref: #auto-postings-and-transaction-balancing-inferred-amounts-balance-assertions57599-Node: EDITOR SUPPORT57977-Ref: #editor-support58095+Node: Assertions and ordering17538+Ref: #assertions-and-ordering17724+Node: Assertions and included files18424+Ref: #assertions-and-included-files18665+Node: Assertions and multiple -f options18998+Ref: #assertions-and-multiple--f-options19252+Node: Assertions and commodities19384+Ref: #assertions-and-commodities19614+Node: Assertions and prices20770+Ref: #assertions-and-prices20982+Node: Assertions and subaccounts21422+Ref: #assertions-and-subaccounts21649+Node: Assertions and virtual postings21973+Ref: #assertions-and-virtual-postings22213+Node: Assertions and precision22355+Ref: #assertions-and-precision22546+Node: Balance Assignments22813+Ref: #balance-assignments22994+Node: Balance assignments and prices24158+Ref: #balance-assignments-and-prices24330+Node: Transaction prices24554+Ref: #transaction-prices24723+Node: Comments26991+Ref: #comments27125+Node: Tags28295+Ref: #tags28413+Node: Directives29815+Ref: #directives29958+Node: Comment blocks35565+Ref: #comment-blocks35710+Node: Including other files35886+Ref: #including-other-files36066+Node: Default year36474+Ref: #default-year36643+Node: Declaring commodities37066+Ref: #declaring-commodities37249+Node: Default commodity38476+Ref: #default-commodity38652+Node: Market prices39288+Ref: #market-prices39453+Node: Declaring accounts40294+Ref: #declaring-accounts40470+Node: Account comments41395+Ref: #account-comments41558+Node: Account subdirectives41953+Ref: #account-subdirectives42148+Node: Account types42461+Ref: #account-types42645+Node: Account display order44289+Ref: #account-display-order44459+Node: Rewriting accounts45588+Ref: #rewriting-accounts45773+Node: Basic aliases46507+Ref: #basic-aliases46653+Node: Regex aliases47357+Ref: #regex-aliases47528+Node: Multiple aliases48246+Ref: #multiple-aliases48421+Node: end aliases48919+Ref: #end-aliases49066+Node: Default parent account49167+Ref: #default-parent-account49333+Node: Periodic transactions50217+Ref: #periodic-transactions50399+Node: Two spaces after the period expression51524+Ref: #two-spaces-after-the-period-expression51769+Node: Forecasting with periodic transactions52254+Ref: #forecasting-with-periodic-transactions52544+Node: Budgeting with periodic transactions54231+Ref: #budgeting-with-periodic-transactions54470+Node: Transaction modifiers54929+Ref: #transaction-modifiers55092+Node: Auto postings and transaction balancing / inferred amounts / balance assertions57076+Ref: #auto-postings-and-transaction-balancing-inferred-amounts-balance-assertions57377+Node: EDITOR SUPPORT57755+Ref: #editor-support57873 End Tag Table
embeddedfiles/hledger_journal.txt view
@@ -358,9 +358,9 @@ Balance Assertions hledger supports Ledger-style balance assertions in journal files.- These look like =EXPECTEDBALANCE following a posting's amount. Eg in- this example we assert the expected dollar balance in accounts a and b- after each posting:+ These look like, for example, = EXPECTEDBALANCE following a posting's+ amount. Eg here we assert the expected dollar balance in accounts a+ and b after each posting: 2013/1/1 a $1 =$1@@ -374,7 +374,7 @@ and report an error if any of them fail. Balance assertions can pro- tect you from, eg, inadvertently disrupting reconciled balances while cleaning up old entries. You can disable them temporarily with the- --ignore-assertions flag, which can be useful for troubleshooting or+ -I/--ignore-assertions flag, which can be useful for troubleshooting or for reading Ledger files. Assertions and ordering@@ -412,10 +412,9 @@ To assert the balance of more than one commodity in an account, you can write multiple postings, each asserting one commodity's balance. - You can make a stronger kind of balance assertion, by writing a double- equals sign (==EXPECTEDBALANCE). This "complete" balance assertion- asserts the absence of other commodities (or, that their balance is 0,- which to hledger is equivalent.)+ You can make a stronger "total" balance assertion by writing a double+ equals sign (== EXPECTEDBALANCE). This asserts that there are no other+ unasserted commodities in the account (or, that their balance is 0). 2013/1/1 a $1@@ -433,7 +432,7 @@ a 0 == $1 It's not yet possible to make a complete assertion about a balance that- has multiple commodities. One workaround is to isolate each commodity+ has multiple commodities. One workaround is to isolate each commodity into its own subaccount: 2013/1/1@@ -447,51 +446,44 @@ a:euro 0 == 1 Assertions and prices- Balance assertions ignore transaction prices, and should normally be+ Balance assertions ignore transaction prices, and should normally be written without one: 2019/1/1 (a) $1 @ 1 = $1 - We do allow prices to be written there, however, and print shows them,- even though they don't affect whether the assertion passes or fails.- This is for backward compatibility (hledger's close command used to- generate balance assertions with prices), and because balance assign-+ We do allow prices to be written there, however, and print shows them,+ even though they don't affect whether the assertion passes or fails.+ This is for backward compatibility (hledger's close command used to+ generate balance assertions with prices), and because balance assign- ments do use them (see below). Assertions and subaccounts- Balance assertions do not count the balance from subaccounts; they- check the posted account's exclusive balance. For example:-- 1/1- checking:fund 1 = 1 ; post to this subaccount, its balance is now 1- checking 1 = 1 ; post to the parent account, its exclusive balance is now 1- equity-- The balance report's flat mode shows these exclusive balances more- clearly:+ The balance assertions above (= and ==) do not count the balance from+ subaccounts; they check the account's exclusive balance only. You can+ assert the balance including subaccounts by writing =* or ==*, eg: - $ hledger bal checking --flat- 1 checking- 1 checking:fund- --------------------- 2+ 2019/1/1+ equity:opening balances+ checking:a 5+ checking:b 5+ checking 1 ==* 11 Assertions and virtual postings Balance assertions are checked against all postings, both real and vir- tual. They are not affected by the --real/-R flag or real: query. Assertions and precision- Balance assertions compare the exactly calculated amounts, which are- not always what is shown by reports. Eg a commodity directive may- limit the display precision, but this will not affect balance asser-+ Balance assertions compare the exactly calculated amounts, which are+ not always what is shown by reports. Eg a commodity directive may+ limit the display precision, but this will not affect balance asser- tions. Balance assertion failure messages show exact amounts. Balance Assignments- Ledger-style balance assignments are also supported. These are like- balance assertions, but with no posting amount on the left side of the- equals sign; instead it is calculated automatically so as to satisfy- the assertion. This can be a convenience during data entry, eg when+ Ledger-style balance assignments are also supported. These are like+ balance assertions, but with no posting amount on the left side of the+ equals sign; instead it is calculated automatically so as to satisfy+ the assertion. This can be a convenience during data entry, eg when setting opening balances: ; starting a new journal, set asset account balances@@ -509,14 +501,14 @@ expenses:misc The calculated amount depends on the account's balance in the commodity- at that point (which depends on the previously-dated postings of the- commodity to that account since the last balance assertion or assign-+ at that point (which depends on the previously-dated postings of the+ commodity to that account since the last balance assertion or assign- ment). 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. Balance assignments and prices- A transaction price in a balance assignment will cause the calculated+ A transaction price in a balance assignment will cause the calculated amount to have that price attached: 2019/1/1@@ -528,9 +520,9 @@ 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. Note transaction prices are+ 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. 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.@@ -559,7 +551,7 @@ (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+ 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: @@ -570,8 +562,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: @@ -585,14 +577,14 @@ 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:@@ -616,24 +608,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: @@ -647,69 +639,70 @@ 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,+ 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+ here is a table summarising the directives and their effects, with links to more detailed docs. ---- direc- end subdi- purpose can affect (as of+ direc- end subdi- purpose can affect (as of tive directive rec- 2018/06) tives -------------------------------------------------------------------------------------------------- account any document account names, all entries in all- text declare account types & dis- files, before or+ account any document account names, all entries in all+ text declare account types & dis- files, before or play order after++++ alias end aliases rewrite account names following inline/included entries until end- of current file or+ of current file or end directive- apply account end apply account prepend a common parent to following+ apply account end apply account prepend a common parent to following account names inline/included entries until end- of current file or+ of current file or end directive comment end comment ignore part of journal following inline/included entries until end- of current file or+ of current file or end directive- commodity format declare a commodity and its number notation:+ commodity format declare a commodity and its number notation: number notation & display following entries style in that commodity- in all files; dis-+ in all files; dis- play style: amounts of that commodity in reports- D declare a commodity, number commodity: all com-+ D declare a commodity, number commodity: all com- notation & display style for modityless entries- commodityless amounts in all files; num-- ber notation: fol-+ commodityless amounts in all files; num-+ ber notation: fol- lowing commodity-- less entries and+ less entries and entries in that- commodity in all+ commodity in all files; display style: amounts of that commodity in@@ -720,7 +713,7 @@ commodity commodity in reports, when -V is used- Y declare a year for yearless following+ Y declare a year for yearless following dates inline/included entries until end of current file@@ -730,9 +723,9 @@ subdirec- optional indented directive line immediately following a par- tive ent directive- 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+ 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)@@ -740,37 +733,37 @@ 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+ 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-+ 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+ 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- file. The include file path may contain common glob patterns (e.g.+ If the path does not begin with a slash, it is relative to the current+ file. The include file path may contain common glob patterns (e.g. *). - 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@@ -790,8 +783,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@@ -801,8 +794,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@@ -814,19 +807,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@@ -841,9 +834,9 @@ a decimal point. Market prices- The P directive declares a market price, which is an exchange rate+ 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,+ "historical prices".) These are often obtained from a stock exchange, cryptocurrency exchange, or the foreign exchange market. Here is the format:@@ -854,39 +847,39 @@ o COMMODITYA is the symbol of the commodity being priced - o COMMODITYBAMOUNT is an amount (symbol and quantity) in a second com-+ 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+ 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+ The -V/--value flag can be used to convert reported amounts to another commodity using these prices. Declaring accounts- account directives can be used to pre-declare accounts. Though not+ account directives can be used to pre-declare accounts. Though not required, they can provide several benefits: o They can document your intended chart of accounts, providing a refer- ence. - o They can store extra information about accounts (account numbers,+ o They can store extra information about accounts (account numbers, notes, etc.) - o They can help hledger know your accounts' types (asset, liability,- equity, revenue, expense), useful for reports like balancesheet and+ o They can help hledger know your accounts' types (asset, liability,+ equity, revenue, expense), useful for reports like balancesheet and incomestatement. - o They control account display order in reports, allowing non-alpha-+ o They control account display order in reports, allowing non-alpha- betic sorting (eg Revenues to appear above Expenses). - o They help with account name completion in the add command,+ o They help with account name completion in the add command, hledger-iadd, hledger-web, ledger-mode etc. - The simplest form is just the word account followed by a hledger-style+ The simplest form is just the word account followed by a hledger-style account name, eg: account assets:bank:checking@@ -904,7 +897,7 @@ the next line instead. Account subdirectives- We also allow (and ignore) Ledger-style indented subdirectives, just+ We also allow (and ignore) Ledger-style indented subdirectives, just for compatibility.: account assets:bank:checking@@ -917,18 +910,18 @@ [LEDGER-STYLE SUBDIRECTIVES, IGNORED] Account types- hledger recognises five types (or classes) of account: Asset, Liabil-- ity, Equity, Revenue, Expense. This is used by a few accounting-aware+ hledger recognises five types (or classes) of account: Asset, Liabil-+ ity, Equity, Revenue, Expense. This is used by a few accounting-aware reports such as balancesheet, incomestatement and cashflow. Auto-detected account types If you name your top-level accounts with some variation of assets, lia-- bilities/debts, equity, revenues/income, or expenses, their types are+ bilities/debts, equity, revenues/income, or expenses, their types are detected automatically. Account types declared with tags- More generally, you can declare an account's type with an account- directive, by writing a type: tag in a comment, followed by one of the+ More generally, you can declare an account's type with an account+ directive, by writing a type: tag in a comment, followed by one of the words Asset, Liability, Equity, Revenue, Expense, or one of the letters ALERX (case insensitive): @@ -939,8 +932,8 @@ account expenses ; type:Expenses Account types declared with account type codes- Or, you can write one of those letters separated from the account name- by two or more spaces, but this should probably be considered depre-+ Or, you can write one of those letters separated from the account name+ by two or more spaces, but this should probably be considered depre- cated as of hledger 1.13: account assets A@@ -950,7 +943,7 @@ account expenses X Overriding auto-detected types- If you ever override the types of those auto-detected english account+ If you ever override the types of those auto-detected english account names mentioned above, you might need to help the reports a bit. Eg: ; make "liabilities" not have the liability type - who knows why@@ -961,8 +954,8 @@ account - ; type:L Account display order- Account directives also set the order in which accounts are displayed,- eg in reports, the hledger-ui accounts screen, and the hledger-web+ Account directives also set the order in which accounts are displayed,+ eg in reports, the hledger-ui accounts screen, and the hledger-web sidebar. By default accounts are listed in alphabetical order. But if you have these account directives in the journal: @@ -984,16 +977,16 @@ Undeclared accounts, if any, are displayed last, in alphabetical order. - Note that sorting is done at each level of the account tree (within- each group of sibling accounts under the same parent). And currently,+ Note that sorting is done at each level of the account tree (within+ each group of sibling accounts under the same parent). And currently, this directive: account other:zoo - would influence the position of zoo among other's subaccounts, but not- the position of other among the top-level accounts. This means: - you- will sometimes declare parent accounts (eg account other above) that- you don't intend to post to, just to customize their display order -+ would influence the position of zoo among other's subaccounts, but not+ the position of other among the top-level accounts. This means: - you+ will sometimes declare parent accounts (eg account other above) that+ you don't intend to post to, just to customize their display order - sibling accounts stay together (you couldn't display x:y in between a:b and a:c). @@ -1012,14 +1005,14 @@ o customising reports Account aliases also rewrite account names in account directives. They- do not affect account names being entered via hledger add or+ do not affect account names being entered via hledger add or hledger-web. See also Cookbook: Rewrite account names. Basic aliases- To set an account alias, use the alias directive in your journal file.- This affects all subsequent journal entries in the current file or its+ To set an account alias, use the alias directive in your journal file.+ This affects all subsequent journal entries in the current file or its included files. The spaces around the = are optional: alias OLD = NEW@@ -1027,54 +1020,54 @@ 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 case sensitive full account names. hledger will- replace any occurrence of the old account name with the new one. Sub-+ 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" Regex aliases- There is also a more powerful variant that uses a regular expression,+ There is also a more powerful variant that uses a regular expression, indicated by the forward slashes: alias /REGEX/ = REPLACEMENT or --alias '/REGEX/=REPLACEMENT'. - REGEX is a case-insensitive regular expression. Anywhere it matches- inside an account name, the matched part will be replaced by REPLACE-- MENT. If REGEX contains parenthesised match groups, these can be ref-+ REGEX is a case-insensitive regular expression. Anywhere it matches+ inside an account name, the matched part will be replaced by REPLACE-+ MENT. If REGEX contains parenthesised match groups, these can be ref- erenced by the usual numeric backreferences in REPLACEMENT. Eg: alias /^(.+):bank:([^:]+)(.*)/ = \1:\2 \3 # rewrites "assets:bank:wells fargo:checking" to "assets:wells fargo checking" - Also note that REPLACEMENT continues to the end of line (or on command- line, to end of option argument), so it can contain trailing white-+ Also note that REPLACEMENT continues to the end of line (or on command+ line, to end of option argument), so it can contain trailing white- space. Multiple aliases- You can define as many aliases as you like using directives or com-- mand-line options. Aliases are recursive - each alias sees the result- of applying previous ones. (This is different from Ledger, where+ You can define as many aliases as you like using directives or com-+ mand-line options. Aliases are recursive - each alias sees the result+ of applying previous ones. (This is different from Ledger, where aliases are non-recursive by default). Aliases are applied in the fol- lowing order: - 1. alias directives, most recently seen first (recent directives take+ 1. alias directives, most recently seen first (recent directives take precedence over earlier ones; directives not yet seen are ignored) 2. alias options, in the order they appear on the command line end aliases- You can clear (forget) all currently defined aliases with the+ You can clear (forget) all currently defined aliases with the end aliases directive: end aliases Default parent account- You can specify a parent account which will be prepended to all- accounts within a section of the journal. Use the apply account and+ You can specify a parent account which will be prepended to all+ accounts within a section of the journal. Use the apply account and end apply account directives like so: apply account home@@ -1091,7 +1084,7 @@ home:food $10 home:cash $-10 - If end apply account is omitted, the effect lasts to the end of the+ If end apply account is omitted, the effect lasts to the end of the file. Included files are also affected, eg: apply account business@@ -1100,18 +1093,18 @@ apply account personal include personal.journal - Prior to hledger 1.0, legacy account and end spellings were also sup-+ 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+ 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 describe transactions that recur. They+ 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).+ ing to write them out explicitly in the journal (with --forecast). Secondly, they also can be used to define budget goals (with --budget). A periodic transaction rule looks like a normal journal entry, with the@@ -1122,17 +1115,17 @@ expenses:rent $2000 assets:bank:checking - There is an additional constraint on the period expression: the start- date must fall on a natural boundary of the interval. Eg+ 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. - Partial or relative dates (M/D, D, tomorrow, last week) in the period- expression can work (useful or not). They will be relative to today's- date, unless a Y default year directive is in effect, in which case+ Partial or relative dates (M/D, D, tomorrow, last week) in the period+ expression can work (useful or not). They will be relative to today's+ date, unless a Y default year directive is in effect, in which case they will be relative to Y/1/1. Two spaces after the period expression- If the period expression is followed by a transaction description,+ If the period expression is followed by a transaction description, these must be separated by two or more spaces. This helps hledger know where the period expression ends, so that descriptions can not acciden- tally alter their meaning, as in this example:@@ -1145,66 +1138,66 @@ income:acme inc Forecasting with periodic transactions- With the --forecast flag, each periodic transaction rule generates+ 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+ 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 start on the first occurrence, and end on the- last occurrence, of their interval within the forecast period. The+ Forecast transactions start on the first occurrence, and end on the+ last occurrence, of their interval within the forecast period. The forecast period: o begins on the later of o the report start date if specified with -b/-p/date: - o the day after the latest normal (non-periodic) transaction in the+ o the day after the latest normal (non-periodic) transaction in the journal, or today if there are no normal transactions. - o ends on the report end date if specified with -e/-p/date:, or 180+ o ends on the report end date if specified with -e/-p/date:, or 180 days from today. - where "today" means the current date at report time. The "later of"- rule ensures that forecast transactions do not overlap normal transac-+ where "today" means the current date at report time. The "later of"+ rule ensures that forecast transactions do not overlap normal transac- tions in time; they will begin only after normal transactions end. - Forecasting can be useful for estimating balances into the future, and- experimenting with different scenarios. Note the start date logic+ 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+ 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+ 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-+ 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+ For more details, see: balance: Budget report and Cookbook: Budgeting and Forecasting. Transaction modifiers- Transaction modifier rules describe changes that should be applied- automatically to certain transactions. They can be enabled by using- the --auto flag. Currently, just one kind of change is possible:- adding extra postings. These rule-generated postings are known as+ Transaction modifier rules describe changes that should be applied+ automatically to certain transactions. They can be enabled by using+ the --auto flag. Currently, just one kind of change is possible:+ adding extra postings. These rule-generated postings are known as "automated postings" or "auto postings". - A transaction modifier rule looks quite like a normal transaction,- except the first line is an equals sign followed by a query that- matches certain postings (mnemonic: = suggests matching). And each+ A transaction modifier rule looks quite like a normal transaction,+ except the first line is an equals sign followed by a query that+ matches certain postings (mnemonic: = suggests matching). And each "posting" is actually a posting-generating rule: = QUERY@@ -1212,20 +1205,20 @@ ACCT [AMT] ... - These posting rules look like normal postings, except the amount can+ These posting rules look like normal postings, except the amount can be: - o a normal amount with a commodity symbol, eg $2. This will be used+ o a normal amount with a commodity symbol, eg $2. This will be used as-is. o a number, eg 2. The commodity symbol (if any) from the matched post- ing will be added to this. - o a numeric multiplier, eg *2 (a star followed by a number N). The+ o a numeric multiplier, eg *2 (a star followed by a number N). The matched posting's amount (and total price, if any) will be multiplied by N. - o a multiplier with a commodity symbol, eg *$2 (a star, number N, and+ o a multiplier with a commodity symbol, eg *$2 (a star, number N, and symbol S). The matched posting's amount will be multiplied by N, and its commodity symbol will be replaced with S. @@ -1265,42 +1258,28 @@ Currently, transaction modifiers are applied / auto postings are added: - o after missing amounts are inferred, and transactions are checked for+ o after missing amounts are inferred, and transactions are checked for balancedness, o but before balance assertions are checked. - Note this means that journal entries must be balanced both before and+ Note this means that journal entries must be balanced both before and after auto postings are added. This changed in hledger 1.12+; see #893 for background. EDITOR SUPPORT- Add-on modes exist for various text editors, to make working with jour-- nal files easier. They add colour, navigation aids and helpful com-- mands. For hledger users who edit the journal file directly (the- majority), using one of these modes is quite recommended.-- These were written with Ledger in mind, but also work with hledger- files:--- Editor- --------------------------------------------------------------------------- Emacs http://www.ledger-cli.org/3.0/doc/ledger-mode.html- 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+ Helper modes exist for popular text editors, which make working with+ journal files easier. They add colour, formatting, tab completion, and+ helpful commands, and are quite recommended if you edit your journal+ with a text editor. They include ledger-mode or hledger-mode for+ Emacs, vim-ledger for Vim, hledger-vscode for Visual Studio Code, and+ others. See the [[Cookbook]] at hledger.org for the latest informa-+ tion. 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) @@ -1314,7 +1293,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) @@ -1322,4 +1301,4 @@ -hledger 1.13 February 2019 hledger_journal(5)+hledger 1.14 March 2019 hledger_journal(5)
embeddedfiles/hledger_timeclock.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timeclock" "5" "February 2019" "hledger 1.13" "hledger User Manuals"+.TH "hledger_timeclock" "5" "March 2019" "hledger 1.14" "hledger User Manuals"
embeddedfiles/hledger_timeclock.info view
@@ -4,7 +4,7 @@ File: hledger_timeclock.info, Node: Top, Up: (dir) -hledger_timeclock(5) hledger 1.13+hledger_timeclock(5) hledger 1.14 ********************************* hledger can read timeclock files. As with Ledger, these are (a subset
embeddedfiles/hledger_timeclock.txt view
@@ -77,4 +77,4 @@ -hledger 1.13 February 2019 hledger_timeclock(5)+hledger 1.14 March 2019 hledger_timeclock(5)
embeddedfiles/hledger_timedot.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timedot" "5" "February 2019" "hledger 1.13" "hledger User Manuals"+.TH "hledger_timedot" "5" "March 2019" "hledger 1.14" "hledger User Manuals"
embeddedfiles/hledger_timedot.info view
@@ -4,7 +4,7 @@ File: hledger_timedot.info, Node: Top, Next: FILE FORMAT, Up: (dir) -hledger_timedot(5) hledger 1.13+hledger_timedot(5) hledger 1.14 ******************************* Timedot is a plain text format for logging dated, categorised quantities
embeddedfiles/hledger_timedot.txt view
@@ -124,4 +124,4 @@ -hledger 1.13 February 2019 hledger_timedot(5)+hledger 1.14 March 2019 hledger_timedot(5)
hledger.1 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "February 2019" "hledger 1.13" "hledger User Manuals"+.TH "hledger" "1" "March 2019" "hledger 1.14" "hledger User Manuals" @@ -1783,8 +1783,6 @@ considered, not just the ones with activity during the report period (use \-E to include low\-activity accounts which would otherwise would be omitted).-With \f[C]\-\-budget\f[], \f[C]\-\-empty\f[] also shows unbudgeted-accounts. .PP The \f[C]\-T/\-\-row\-total\f[] flag adds an additional column showing the total for each row.@@ -1884,14 +1882,31 @@ \f[] .fi .PP-By default, only accounts with budget goals during the report period are-shown.-In the example above, transactions in \f[C]expenses:gifts\f[] and-\f[C]expenses:supplies\f[] are counted towards \f[C]expenses\f[] budget,-but accounts \f[C]expenses:gifts\f[] and \f[C]expenses:supplies\f[] are-not shown, as they don\[aq]t have any budgets.+Note this is different from a normal balance report in several ways:+.IP \[bu] 2+Only accounts with budget goals during the report period are shown, by+default.+.IP \[bu] 2+In each column, in square brackets after the actual amount, budgeted+amounts are shown, along with the percentage of budget used.+.IP \[bu] 2+All parent accounts are always shown, even in flat mode.+Eg assets, assets:bank, and expenses above.+.IP \[bu] 2+Amounts always include all subaccounts, budgeted or unbudgeted, even in+flat mode. .PP-You can use \f[C]\-\-empty\f[] shows unbudgeted accounts as well:+This means that the numbers displayed will not always add up! Eg above,+the \f[C]expenses\f[] actual amount includes the gifts and supplies+transactions, but the \f[C]expenses:gifts\f[] and+\f[C]expenses:supplies\f[] accounts are not shown, as they have no+budget amounts declared.+.PP+This can be confusing.+When you need to make things clearer, use the \f[C]\-E/\-\-empty\f[]+flag, which will reveal all accounts including unbudgeted ones, giving+the full picture.+Eg: .IP .nf \f[C]@@ -1938,9 +1953,6 @@ \f[] .fi .PP-Note, the \f[C]\-S/\-\-sort\-amount\f[] flag is not yet fully supported-with \f[C]\-\-budget\f[].-.PP For more examples, see Budgeting and Forecasting. .SS Nested budgets .PP@@ -2658,6 +2670,18 @@ The \f[C]\-\-related\f[]/\f[C]\-r\f[] flag shows the \f[I]other\f[] postings in the transactions of the postings which would normally be shown.+.PP+The \f[C]\-\-invert\f[] flag negates all amounts.+For example, it can be used on an income account where amounts are+normally displayed as negative numbers.+It\[aq]s also useful to show postings on the checking account together+with the related account:+.IP+.nf+\f[C]+$\ hledger\ register\ \-\-related\ \-\-invert\ assets:checking+\f[]+.fi .PP With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account:
hledger.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 52b4fcd3436c3de6dd5b2e31fb2fac6b747cfb66b069bb84b318ce086ff7cdf5+-- hash: f7ffe28b8f28021a283c05a1647b2f533f4476d763c411d681914ca141f07fb0 name: hledger-version: 1.13.2+version: 1.14 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@@ -27,7 +27,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.2, GHC==8.4.3+tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.3 build-type: Simple extra-source-files: CHANGES.md@@ -119,6 +119,7 @@ Hledger.Cli.Commands.Checkdates Hledger.Cli.Commands.Checkdupes Hledger.Cli.Commands.Close+ Hledger.Cli.Commands.Commodities Hledger.Cli.Commands.Help Hledger.Cli.Commands.Files Hledger.Cli.Commands.Import@@ -136,7 +137,7 @@ 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.13.2"+ cpp-options: -DVERSION="1.14" build-depends: Decimal , Diff@@ -152,7 +153,7 @@ , filepath , hashable >=1.2.4 , haskeline >=0.6- , hledger-lib >=1.13.1 && <1.14+ , hledger-lib >=1.14 && <1.15 , lucid , math-functions >=0.2.0.0 , megaparsec >=7.0.0 && <8@@ -187,7 +188,7 @@ 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.13.2"+ cpp-options: -DVERSION="1.14" build-depends: Decimal , ansi-terminal >=0.6.2.3@@ -202,7 +203,7 @@ , filepath , haskeline >=0.6 , hledger- , hledger-lib >=1.13.1 && <1.14+ , hledger-lib >=1.14 && <1.15 , math-functions >=0.2.0.0 , megaparsec >=7.0.0 && <8 , mtl@@ -239,7 +240,7 @@ 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.13.2"+ cpp-options: -DVERSION="1.14" build-depends: Decimal , ansi-terminal >=0.6.2.3@@ -254,7 +255,7 @@ , filepath , haskeline >=0.6 , hledger- , hledger-lib >=1.13.1 && <1.14+ , hledger-lib >=1.14 && <1.15 , math-functions >=0.2.0.0 , megaparsec >=7.0.0 && <8 , mtl@@ -306,7 +307,7 @@ , filepath , haskeline >=0.6 , hledger- , hledger-lib >=1.13.1 && <1.14+ , hledger-lib >=1.14 && <1.15 , html , math-functions >=0.2.0.0 , megaparsec >=7.0.0 && <8
hledger.info view
@@ -3,7 +3,7 @@ File: hledger.info, Node: Top, Next: EXAMPLES, Up: (dir) -hledger(1) hledger 1.13+hledger(1) hledger 1.14 *********************** This is hledger's command-line interface (there are also curses and web@@ -1404,8 +1404,7 @@ 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 otherwise-would be omitted). With '--budget', '--empty' also shows unbudgeted-accounts.+would be omitted). The '-T/--row-total' flag adds an additional column showing the total for each row.@@ -1497,14 +1496,30 @@ ----------------------++---------------------------------------------------- || 0 [ 0] 0 [ 0] - By default, only accounts with budget goals during the report period-are shown. In the example above, transactions in 'expenses:gifts' and-'expenses:supplies' are counted towards 'expenses' budget, but accounts-'expenses:gifts' and 'expenses:supplies' are not shown, as they don't-have any budgets.+ Note this is different from a normal balance report in several ways: - You can use '--empty' shows unbudgeted accounts as well:+ * Only accounts with budget goals during the report period are shown,+ by default. + * In each column, in square brackets after the actual amount,+ budgeted amounts are shown, along with the percentage of budget+ used.++ * All parent accounts are always shown, even in flat mode. Eg+ assets, assets:bank, and expenses above.++ * Amounts always include all subaccounts, budgeted or unbudgeted,+ even in flat mode.++ This means that the numbers displayed will not always add up! Eg+above, the 'expenses' actual amount includes the gifts and supplies+transactions, but the 'expenses:gifts' and 'expenses:supplies' accounts+are not shown, as they have no budget amounts declared.++ This can be confusing. When you need to make things clearer, use the+'-E/--empty' flag, which will reveal all accounts including unbudgeted+ones, giving the full picture. Eg:+ $ hledger balance -M --budget --empty Budget performance in 2017/11/01-2017/12/31: @@ -1541,9 +1556,6 @@ ----------------------++---------------------------------------------------- || 0 [ 0] 0 [ 0] - Note, the '-S/--sort-amount' flag is not yet fully supported with-'--budget'.- For more examples, see Budgeting and Forecasting. * Menu: @@ -2170,6 +2182,13 @@ The '--related'/'-r' flag shows the _other_ postings in the transactions of the postings which would normally be shown. + The '--invert' flag negates all amounts. For example, it can be used+on an income account where amounts are normally displayed as negative+numbers. It's also useful to show postings on the checking account+together with the related account:++$ hledger register --related --invert assets:checking+ With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account: @@ -2752,86 +2771,86 @@ Ref: #depth-limited-balance-reports44118 Node: Multicolumn balance report44574 Ref: #multicolumn-balance-report44772-Node: Budget report50012-Ref: #budget-report50155-Node: Nested budgets54839-Ref: #nested-budgets54951-Ref: #output-format-158431-Node: balancesheet58509-Ref: #balancesheet58645-Node: balancesheetequity59879-Ref: #balancesheetequity60028-Node: cashflow60589-Ref: #cashflow60717-Node: check-dates61745-Ref: #check-dates61872-Node: check-dupes62151-Ref: #check-dupes62275-Node: close62568-Ref: #close62676-Node: files66089-Ref: #files66190-Node: help66337-Ref: #help66437-Node: import67530-Ref: #import67644-Node: incomestatement68388-Ref: #incomestatement68522-Node: prices69858-Ref: #prices69973-Node: print70252-Ref: #print70362-Node: print-unique74855-Ref: #print-unique74981-Node: register75266-Ref: #register75393-Node: Custom register output79262-Ref: #custom-register-output79391-Node: register-match80653-Ref: #register-match80787-Node: rewrite81138-Ref: #rewrite81253-Node: Re-write rules in a file83102-Ref: #re-write-rules-in-a-file83236-Node: Diff output format84446-Ref: #diff-output-format84615-Node: rewrite vs print --auto85707-Ref: #rewrite-vs.-print---auto85886-Node: roi86442-Ref: #roi86540-Node: stats87552-Ref: #stats87651-Node: tags88405-Ref: #tags88503-Node: test88733-Ref: #test88817-Node: ADD-ON COMMANDS89578-Ref: #add-on-commands89688-Node: Official add-ons90975-Ref: #official-add-ons91115-Node: api91202-Ref: #api91291-Node: ui91343-Ref: #ui91442-Node: web91500-Ref: #web91589-Node: Third party add-ons91635-Ref: #third-party-add-ons91810-Node: diff91945-Ref: #diff92042-Node: iadd92141-Ref: #iadd92255-Node: interest92338-Ref: #interest92459-Node: irr92554-Ref: #irr92652-Node: Experimental add-ons92783-Ref: #experimental-add-ons92935-Node: autosync93215-Ref: #autosync93326-Node: chart93565-Ref: #chart93684-Node: check93755-Ref: #check93857+Node: Budget report49952+Ref: #budget-report50095+Node: Nested budgets55296+Ref: #nested-budgets55408+Ref: #output-format-158888+Node: balancesheet58966+Ref: #balancesheet59102+Node: balancesheetequity60336+Ref: #balancesheetequity60485+Node: cashflow61046+Ref: #cashflow61174+Node: check-dates62202+Ref: #check-dates62329+Node: check-dupes62608+Ref: #check-dupes62732+Node: close63025+Ref: #close63133+Node: files66546+Ref: #files66647+Node: help66794+Ref: #help66894+Node: import67987+Ref: #import68101+Node: incomestatement68845+Ref: #incomestatement68979+Node: prices70315+Ref: #prices70430+Node: print70709+Ref: #print70819+Node: print-unique75312+Ref: #print-unique75438+Node: register75723+Ref: #register75850+Node: Custom register output80021+Ref: #custom-register-output80150+Node: register-match81412+Ref: #register-match81546+Node: rewrite81897+Ref: #rewrite82012+Node: Re-write rules in a file83861+Ref: #re-write-rules-in-a-file83995+Node: Diff output format85205+Ref: #diff-output-format85374+Node: rewrite vs print --auto86466+Ref: #rewrite-vs.-print---auto86645+Node: roi87201+Ref: #roi87299+Node: stats88311+Ref: #stats88410+Node: tags89164+Ref: #tags89262+Node: test89492+Ref: #test89576+Node: ADD-ON COMMANDS90337+Ref: #add-on-commands90447+Node: Official add-ons91734+Ref: #official-add-ons91874+Node: api91961+Ref: #api92050+Node: ui92102+Ref: #ui92201+Node: web92259+Ref: #web92348+Node: Third party add-ons92394+Ref: #third-party-add-ons92569+Node: diff92704+Ref: #diff92801+Node: iadd92900+Ref: #iadd93014+Node: interest93097+Ref: #interest93218+Node: irr93313+Ref: #irr93411+Node: Experimental add-ons93542+Ref: #experimental-add-ons93694+Node: autosync93974+Ref: #autosync94085+Node: chart94324+Ref: #chart94443+Node: check94514+Ref: #check94616 End Tag Table
hledger.txt view
@@ -1251,13 +1251,12 @@ 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). With --budget, --empty also shows unbudgeted- accounts.+ 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:@@ -1281,20 +1280,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- income, expenses, time usage, etc. --budget is most often combined+ 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@@ -1339,14 +1338,29 @@ ----------------------++---------------------------------------------------- || 0 [ 0] 0 [ 0] - By default, only accounts with budget goals during the report period- are shown. In the example above, transactions in expenses:gifts and- expenses:supplies are counted towards expenses budget, but accounts- expenses:gifts and expenses:supplies are not shown, as they don't have- any budgets.+ Note this is different from a normal balance report in several ways: - You can use --empty shows unbudgeted accounts as well:+ o Only accounts with budget goals during the report period are shown,+ by default. + o In each column, in square brackets after the actual amount, budgeted+ amounts are shown, along with the percentage of budget used.++ o All parent accounts are always shown, even in flat mode. Eg assets,+ assets:bank, and expenses above.++ o Amounts always include all subaccounts, budgeted or unbudgeted, even+ in flat mode.++ This means that the numbers displayed will not always add up! Eg above,+ the expenses actual amount includes the gifts and supplies transac-+ tions, but the expenses:gifts and expenses:supplies accounts are not+ shown, as they have no budget amounts declared.++ This can be confusing. When you need to make things clearer, use the+ -E/--empty flag, which will reveal all accounts including unbudgeted+ ones, giving the full picture. Eg:+ $ hledger balance -M --budget --empty Budget performance in 2017/11/01-2017/12/31: @@ -1383,18 +1397,15 @@ ----------------------++---------------------------------------------------- || 0 [ 0] 0 [ 0] - Note, the -S/--sort-amount flag is not yet fully supported with --bud-- get.- For more examples, see Budgeting and Forecasting. Nested budgets- You can add budgets to any account in your account hierarchy. If you+ You can add budgets to any account in your account hierarchy. If you have budgets on both parent account and some of its children, then bud-- get(s) of the child account(s) would be added to the budget of their+ get(s) of the child account(s) would be added to the budget of their parent, much like account balances behave. - In the most simple case this means that once you add a budget to any+ In the most simple case this means that once you add a budget to any account, all its parents would have budget as well. To illustrate this, consider the following budget:@@ -1404,13 +1415,13 @@ expenses:personal:electronics $100.00 liabilities - With this, monthly budget for electronics is defined to be $100 and- budget for personal expenses is an additional $1000, which implicity+ With this, monthly budget for electronics is defined to be $100 and+ budget for personal expenses is an additional $1000, which implicity means that budget for both expenses:personal and expenses is $1100. - Transactions in expenses:personal:electronics will be counted both- towards its $100 budget and $1100 of expenses:personal , and transac-- tions in any other subaccount of expenses:personal would be counted+ Transactions in expenses:personal:electronics will be counted both+ towards its $100 budget and $1100 of expenses:personal , and transac-+ tions in any other subaccount of expenses:personal would be counted towards only towards the budget of expenses:personal. For example, let's consider these transactions:@@ -1436,9 +1447,9 @@ expenses:personal $30.00 liabilities - As you can see, we have transactions in expenses:personal:electron-- ics:upgrades and expenses:personal:train tickets, and since both of- these accounts are without explicitly defined budget, these transac-+ As you can see, we have transactions in expenses:personal:electron-+ ics:upgrades and expenses:personal:train tickets, and since both of+ these accounts are without explicitly defined budget, these transac- tions would be counted towards budgets of expenses:personal:electronics and expenses:personal accordingly: @@ -1454,7 +1465,7 @@ -------------------------------++------------------------------- || 0 [ 0] - And with --empty, we can get a better picture of budget allocation and+ And with --empty, we can get a better picture of budget allocation and consumption: $ hledger balance --budget -M --empty@@ -1472,17 +1483,17 @@ || 0 [ 0] Output format- The balance command supports output destination and output format+ The balance command supports output destination and output format selection. balancesheet balancesheet, bs 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+ 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+ Note this report shows all account balances with normal positive sign (like conventional financial statements, unlike balance/print/register) (experimental). @@ -1508,17 +1519,17 @@ 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 balancesheetequity, bse- 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:@@ -1549,10 +1560,10 @@ cashflow cashflow, cf- 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). @@ -1573,77 +1584,77 @@ $-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-dates- Check that transactions are sorted by increasing date. With --date2,- checks secondary dates instead. With --strict, dates must also be- unique. With a query, only matched transactions' dates are checked.+ Check that transactions are sorted by increasing date. With --date2,+ checks secondary dates instead. With --strict, dates must also be+ unique. With a query, only matched transactions' dates are checked. Reads the default journal file, or another specified with -f. check-dupes check-dupes- Reports account names having the same leaf but different prefixes. In- other words, two or more leaves that are categorized differently.+ Reports account names having the same leaf but different prefixes. In+ other words, two or more leaves that are categorized differently. Reads the default journal file, or another specified as an argument. An example: http://stefanorodighiero.net/software/hledger-dupes.html close close, equity- Prints a "closing balances" transaction and an "opening balances"+ Prints a "closing balances" transaction and an "opening balances" transaction that bring account balances to and from zero, respectively. Useful for bringing asset/liability balances forward into a new journal- file, or for closing out revenues/expenses to retained earnings at the+ file, or for closing out revenues/expenses to retained earnings at the end of a period. - The closing transaction transfers balances to "equity:closing bal-- ances". The opening transaction transfers balances from "equity:open-- ing balances". You can chose to print just one of the transactions by+ The closing transaction transfers balances to "equity:closing bal-+ ances". The opening transaction transfers balances from "equity:open-+ ing balances". You can chose to print just one of the transactions by using the --opening or --closing flag. If you split your journal files by time (eg yearly), you will typically- run this command at the end of the year, and save the closing transac-- tion as last entry of the old file, and the opening transaction as the- first entry of the new file. This makes the files self contained, so- that correct balances are reported no matter which of them are loaded.- Ie, if you load just one file, the balances are initialised correctly;- or if you load several files, the redundant closing/opening transac-- tions cancel each other out. (They will show up in print or register- reports; you can exclude them with a query like not:desc:'(open-+ run this command at the end of the year, and save the closing transac-+ tion as last entry of the old file, and the opening transaction as the+ first entry of the new file. This makes the files self contained, so+ that correct balances are reported no matter which of them are loaded.+ Ie, if you load just one file, the balances are initialised correctly;+ or if you load several files, the redundant closing/opening transac-+ tions cancel each other out. (They will show up in print or register+ reports; you can exclude them with a query like not:desc:'(open- ing|closing) balances'.) If you're running a business, you might also use this command to "close- the books" at the end of an accounting period, transferring income- statement account balances to retained earnings. (You may want to+ the books" at the end of an accounting period, transferring income+ statement account balances to retained earnings. (You may want to change the equity account name to something like "equity:retained earn- ings".) - By default, the closing transaction is dated yesterday, the balances- are calculated as of end of yesterday, and the opening transaction is- dated today. To close on some other date, use: hledger close -e OPEN-- INGDATE. Eg, to close/open on the 2018/2019 boundary, use -e 2019.+ By default, the closing transaction is dated yesterday, the balances+ are calculated as of end of yesterday, and the opening transaction is+ dated today. To close on some other date, use: hledger close -e OPEN-+ INGDATE. Eg, to close/open on the 2018/2019 boundary, use -e 2019. You can also use -p or date:PERIOD (any starting date is ignored). Both transactions will include balance assertions for the- closed/reopened accounts. You probably shouldn't use status or real-- ness filters (like -C or -R or status:) with this command, or the gen-+ closed/reopened accounts. You probably shouldn't use status or real-+ ness filters (like -C or -R or status:) with this command, or the gen- erated balance assertions will depend on these flags. Likewise, if you- run this command with --auto, the balance assertions will probably+ run this command with --auto, the balance assertions will probably always require --auto. Examples: - Carrying asset/liability balances into a new file for 2019, all from+ Carrying asset/liability balances into a new file for 2019, all from command line: - Warning: we use >> here to append; be careful not to type a single >+ Warning: we use >> here to append; be careful not to type a single > which would wipe your journal! $ hledger close -f 2018.journal -e 2019 assets liabilities --opening >>2019.journal@@ -1676,20 +1687,20 @@ files files- List all files included in the journal. With a REGEX argument, only- file names matching the regular expression (case sensitive) are shown.+ List all files included in the journal. With a REGEX argument, only+ file names matching the regular expression (case sensitive) are shown. help 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. Examples:@@ -1716,8 +1727,8 @@ import import- Read new transactions added to each FILE since last run, and add them- to the main journal file. Or with --dry-run, just print the transac-+ Read new transactions added to each FILE since last run, and add them+ to the main journal file. Or with --dry-run, just print the transac- tions that would be added. The input files are specified as arguments - no need to write -f before@@ -1728,22 +1739,22 @@ 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 incomestatement, is- 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). - 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@@ -1768,19 +1779,19 @@ 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 prices- Print market price directives from the journal. With --costs, also- print synthetic market prices based on transaction prices. With+ Print market price directives from the journal. With --costs, also+ print synthetic market prices based on transaction prices. With --inverted-costs, also print inverse prices based on transaction- prices. Prices (and postings providing prices) can be filtered by a+ prices. Prices (and postings providing prices) can be filtered by a query. print@@ -1788,11 +1799,11 @@ Show transaction journal entries, sorted by date. The print command displays full journal entries (transactions) from the- journal file in date order, tidily formatted. With --date2, transac-+ journal file in date order, tidily formatted. With --date2, transac- tions are sorted by secondary date instead. print's output is always a valid hledger journal.- It preserves all transaction information, but it does not preserve+ It preserves all transaction information, but it does not preserve directives or inter-transaction comments $ hledger print@@ -1818,39 +1829,39 @@ assets:bank:checking $-1 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@@ -1867,20 +1878,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@@ -1904,7 +1915,7 @@ Show postings and their running total. The register command displays postings in date order, one per line, and- their running total. This is typically used with a query selecting a+ their running total. This is typically used with a query selecting a particular account, to see that account's activity: $ hledger register checking@@ -1915,8 +1926,8 @@ With --date2, it shows and sorts by secondary date instead. - 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@@ -1926,15 +1937,22 @@ 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. + The --invert flag negates all amounts. For example, it can be used on+ an income account where amounts are normally displayed as negative num-+ bers. It's also useful to show postings on the checking account+ together with the related account:++ $ hledger register --related --invert assets:checking+ With a reporting interval, register shows summary postings, one per interval, aggregating the postings to each account: @@ -2400,4 +2418,4 @@ -hledger 1.13 February 2019 hledger(1)+hledger 1.14 March 2019 hledger(1)