hledger 1.11.1 → 1.12
raw patch · 39 files changed
+2274/−1161 lines, 39 filesdep ~basedep ~hledger-libdep ~megaparsecPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, hledger-lib, megaparsec, statistics
API changes (from Hackage documentation)
- Hledger.Cli.Commands.Add: instance GHC.Exception.Exception Hledger.Cli.Commands.Add.RestartTransactionException
+ Hledger.Cli.Commands.Add: instance GHC.Exception.Type.Exception Hledger.Cli.Commands.Add.RestartTransactionException
- Hledger.Cli: Mode :: Group Mode a -> [Name] -> a -> a -> Either String a -> a -> Maybe [String] -> Bool -> Help -> [String] -> ([Arg a], Maybe Arg a) -> Group Flag a -> Mode a
+ Hledger.Cli: Mode :: Group (Mode a) -> [Name] -> a -> (a -> Either String a) -> (a -> Maybe [String]) -> Bool -> Help -> [String] -> ([Arg a], Maybe (Arg a)) -> Group (Flag a) -> Mode a
- Hledger.Cli: [modeArgs] :: Mode a -> ([Arg a], Maybe Arg a)
+ Hledger.Cli: [modeArgs] :: Mode a -> ([Arg a], Maybe (Arg a))
- Hledger.Cli: [modeGroupFlags] :: Mode a -> Group Flag a
+ Hledger.Cli: [modeGroupFlags] :: Mode a -> Group (Flag a)
- Hledger.Cli: [modeGroupModes] :: Mode a -> Group Mode a
+ Hledger.Cli: [modeGroupModes] :: Mode a -> Group (Mode a)
- Hledger.Cli: class Remap (m :: * -> *)
+ Hledger.Cli: class Remap (m :: Type -> Type)
- Hledger.Cli: flagBool :: () => [Name] -> Bool -> a -> a -> Help -> Flag a
+ Hledger.Cli: flagBool :: () => [Name] -> (Bool -> a -> a) -> Help -> Flag a
- Hledger.Cli: flagHelpFormat :: () => HelpFormat -> TextFormat -> a -> a -> Flag a
+ Hledger.Cli: flagHelpFormat :: () => (HelpFormat -> TextFormat -> a -> a) -> Flag a
- Hledger.Cli: flagHelpSimple :: () => a -> a -> Flag a
+ Hledger.Cli: flagHelpSimple :: () => (a -> a) -> Flag a
- Hledger.Cli: flagNone :: () => [Name] -> a -> a -> Help -> Flag a
+ Hledger.Cli: flagNone :: () => [Name] -> (a -> a) -> Help -> Flag a
- Hledger.Cli: flagNumericVersion :: () => a -> a -> Flag a
+ Hledger.Cli: flagNumericVersion :: () => (a -> a) -> Flag a
- Hledger.Cli: flagVersion :: () => a -> a -> Flag a
+ Hledger.Cli: flagVersion :: () => (a -> a) -> Flag a
- Hledger.Cli: flagsVerbosity :: () => Verbosity -> a -> a -> [Flag a]
+ Hledger.Cli: flagsVerbosity :: () => (Verbosity -> a -> a) -> [Flag a]
- Hledger.Cli: remap :: Remap m => a -> b -> b -> (a, a -> b) -> m a -> m b
+ Hledger.Cli: remap :: Remap m => (a -> b) -> (b -> (a, a -> b)) -> m a -> m b
- Hledger.Cli: remap2 :: Remap m => a -> b -> b -> a -> m a -> m b
+ Hledger.Cli: remap2 :: Remap m => (a -> b) -> (b -> a) -> m a -> m b
- Hledger.Cli: remapUpdate :: () => a -> b -> b -> (a, a -> b) -> Update a -> Update b
+ Hledger.Cli: remapUpdate :: () => (a -> b) -> (b -> (a, a -> b)) -> Update a -> Update b
- Hledger.Cli.Commands.Activity: printDayWith :: (PrintfArg t1, PrintfType t2) => t3 -> t1 -> (DateSpan, t3) -> t2
+ Hledger.Cli.Commands.Activity: printDayWith :: (PrintfArg t1, PrintfType t2) => (t3 -> t1) -> (DateSpan, t3) -> t2
- Hledger.Cli.CompoundBalanceCommand: CBCSubreportSpec :: String -> Journal -> Query -> NormalSign -> Bool -> CBCSubreportSpec
+ Hledger.Cli.CompoundBalanceCommand: CBCSubreportSpec :: String -> (Journal -> Query) -> NormalSign -> Bool -> CBCSubreportSpec
- Hledger.Cli.CompoundBalanceCommand: compoundBalanceCommand :: CompoundBalanceCommandSpec -> (CliOpts -> Journal -> IO ())
+ Hledger.Cli.CompoundBalanceCommand: compoundBalanceCommand :: CompoundBalanceCommandSpec -> CliOpts -> Journal -> IO ()
Files
- CHANGES +210/−3
- Hledger/Cli/Commands.hs +5/−0
- Hledger/Cli/Commands/Accounts.hs +5/−4
- Hledger/Cli/Commands/Add.hs +1/−1
- Hledger/Cli/Commands/Close.hs +2/−2
- Hledger/Cli/Commands/Incomestatement.hs +1/−1
- Hledger/Cli/Commands/Prices.hs +6/−6
- Hledger/Cli/Commands/Print.hs +2/−2
- Hledger/Cli/Commands/Rewrite.hs +2/−2
- Hledger/Cli/CompoundBalanceCommand.hs +10/−4
- Hledger/Cli/Utils.hs +1/−0
- embeddedfiles/hledger-api.1 +1/−1
- embeddedfiles/hledger-api.info +4/−4
- embeddedfiles/hledger-api.txt +1/−1
- embeddedfiles/hledger-ui.1 +48/−21
- embeddedfiles/hledger-ui.info +51/−35
- embeddedfiles/hledger-ui.txt +126/−109
- embeddedfiles/hledger-web.1 +1/−1
- embeddedfiles/hledger-web.info +4/−4
- embeddedfiles/hledger-web.txt +1/−1
- embeddedfiles/hledger.1 +102/−23
- embeddedfiles/hledger.info +280/−183
- embeddedfiles/hledger.txt +80/−24
- embeddedfiles/hledger_csv.5 +1/−1
- embeddedfiles/hledger_csv.info +30/−30
- embeddedfiles/hledger_csv.txt +1/−1
- embeddedfiles/hledger_journal.5 +213/−86
- embeddedfiles/hledger_journal.info +304/−182
- embeddedfiles/hledger_journal.txt +267/−148
- embeddedfiles/hledger_timeclock.5 +1/−1
- embeddedfiles/hledger_timeclock.info +2/−2
- embeddedfiles/hledger_timeclock.txt +1/−1
- embeddedfiles/hledger_timedot.5 +1/−1
- embeddedfiles/hledger_timedot.info +4/−4
- embeddedfiles/hledger_timedot.txt +1/−1
- hledger.1 +102/−23
- hledger.cabal +42/−41
- hledger.info +280/−183
- hledger.txt +80/−24
CHANGES view
@@ -1,6 +1,103 @@-User-visible changes in the hledger command line tool.+User-visible changes in the hledger command line tool (and hledger-lib). +# 1.12 (2018/12/02)++* install script: ensure a new-enough version of stack; more informative output++* build with GHC 8.6/base-4.12 (Peter Simons)++* add required upper bound for statistics (Samuel May)++* --anon anonymises more thoroughly (including linked original postings) (Moritz Kiefer)++* unbalanced transaction errors now include location info (Mykola Orliuk)++* accounts command: --drop also affects the default flat output, without needing an explicit --flat flag++* accounts command: the --codes flag has been dropped++* accounts command: filtering by non-account-name queries now works++* add command: fix transaction rendering regression during data entry and in journal file++* balance command: fix wrongful eliding of zero-balance parent accounts in tree mode (Dmitry Astapov)++* journal format, bs/bse/cf/is commands: account directives can declare account types (#877)+ Previously you had to use one of the standard english account names+ (assets, liabilities..) for top-level accounts, if you wanted them to+ appear in the right place in the balancesheet, balancesheetequity,+ cashflow or incomestatement reports.++ Now you can use your preferred account names, and use account directives+ to declare which accounting class (Asset, Liability, Equity, Revenue or+ eXpense) an account (and its subaccounts) belongs to, by writing one of+ the letters A, L, E, R, X after the account name, after two or more+ spaces. This syntax may change (see issue). Experimental.++ Currently we allow unlimited account type declarations anywhere in the+ account tree. So you could declare a liability account somewhere under+ assets, and maybe a revenue account under that, and another asset account+ even further down. In such cases you start to see oddities like accounts+ appearing in multiple places in a tree-mode report. I have left it this+ way for now in case it helps with, eg, modelling contra accounts, or+ combining multiple files each with their own account type+ declarations. (In that scenario, if we only allowed type declarations on+ top-level accounts, or only allowed a single account of each type,+ complications seem likely.)++* journal format: periodic transaction rules now require a double space separator.+ In periodic transaction rules which specify a transaction description or+ same-line transaction comment, this must be separated from the period+ expression by two or more spaces, to prevent ambiguous parsing. Eg+ this will parse correctly as "monthly" thanks to the double space:++ ~ monthly In 2020 we'll end this monthly transaction.++* journal format: exact/complete balance assertions (Samuel May).+ A stronger kind of balance assertion, written with a double equals sign,+ asserts an account's complete account balance, not just the balance in+ one commodity. (But only if it is a single-commodity balance, for now.)+ Eg:++ 1/1+ (a) A 1+ (a) B 1+ (a) 0 = A 1 ; commodity A balance assertion, succeeds+ (a) 0 == A 1 ; complete balance assertion, fails++* journal format: account directives now allow whitespace or a comment after the account name++* journal format: using ~ for home directory in include directives now works (#896) (Mykola Orliuk)++* journal format: prevent misleading parse error messages with cyclic include directives (#853) (Alex Chen)++* journal format: transaction modifier multipliers handle total-priced amounts correctly (#928).+ Multipliers (*N) in transaction modifier rules did not multiply+ total-priced amounts properly. Now the total prices are also multiplied,+ keeping the transaction balanced.++* journal format: do amount inference/balance assignments/assertions before transaction modifiers (#893, #908) (Jesse Rosenthal)+ Previously, transaction modifier (auto postings) rules were applied+ before missing amounts were inferred. This meant amount multipliers could+ generate too many missing-amount postings, making the transaction+ unbalanceable (#893).++ Now, missing amount inference (and balance assignments, and balance+ assertions, which are interdependent) are done earlier, before+ transaction modifier rules are applied (#900, #903).++ Also, we now disallow the combination of balance assignments and+ transaction modifier rules which both affect the same account, which+ could otherwise cause confusing balance assertion failures (#912).+ (Because assignments now generate amounts to satisfy balance assertions+ before transaction modifier rules are applied (#908).)++* journal format: periodic transaction rules are now aware of Y default year directives. (#892)+ Ie when a default year Y is in effect, they resolve partial or relative+ dates using Y/1/1 as the reference date, rather than today's date.++ # 1.11.1 (2018/10/06) * fix wrong transaction rendering in balance assertion errors and when@@ -590,9 +687,86 @@ - stack-ify extra/hledger-rewrite.hs +## misc +- added GHC 8 support, dropped GHC 7.6 and 7.8 support. + GHC 7.8 support could be restored with small code changes and a maintainer. +- a cabal.project file has been added (Moritz Kiefer)++- use hpack for maintaining cabal files (#371).++ Instead of editing cabal files directly, we now edit the less+ verbose and less redundant package.yaml files and let stack (or+ hpack) update the cabal files. We commit both the .yaml and+ .cabal files.++- clean up some old cabal flags++- tools/simplebench has been spun off as the quickbench package.++- add Appveyor CI builds, provide up-to-date binaries for Windows++- extra: add a bunch of CSV rules examples++## docs++- the website is simpler, clearer, and more mobile-friendly.++ Docs are now collected on a single page and organised by type: getting started, reference, more.++- reference docs have been split into one manual for each executable and file format.++ This helps with maintenance and packaging and also should make it+ easier to see what's available and to read just what you need.++- manuals are now provided in html, plain text, man and info formats++ generated from the same source by a new Shake-based docs build system. (#292)++- versioned manuals are provided on the website, covering recent releases and the latest dev version (#385, #387)++- manuals are built in to the hledger executables, allowing easy offline reading on all platforms.++ PROG -h shows PROG's command-line usage+ PROG --help shows PROG's manual (fixed width)+ PROG --man shows PROG's manual with man (formatted/paged)+ PROG --info shows PROG's manual with info (hypertext)+ hledger help [TOPIC] shows any manual+ hledger man [TOPIC] shows any manual with man+ hledger info [TOPIC] shows any manual with info++- the general and reporting options are now listed in all executable manuals.++ We assume any of them which are unsupported are harmlessly ignored.++- demo.hledger.org is using beancount's example journal.++ This is the somewhat realistic example journal from the beancount+ project, tweaked for hledger.++- minor copyedits (jungle-boogie)++## cli++- parsing multiple input files is now robust.++ When multiple -f options are provided, we now parse each file+ individually rather than just concatenating them, so they can+ have different formats (#320). Note this also means that+ directives (like \`Y\` or \`alias\`) no longer carry over from one+ file to the next.++- -I has been added as the short flag for --ignore-assertions++ (this is different from Ledger's CLI, but useful for hledger-ui).++- parsing an argument-less --debug option is more robust++++ 0.27 (2015/10/30) Account aliases:@@ -604,9 +778,42 @@ Documentation: -- The hledger packages now have man pages, based on the current user- manual, thanks to the mighty pandoc (#282).+- Each hledger package now includes one or more man pages, generated+ from markdown by the mighty pandoc. Currently there are six: one+ for each main executable and each input file format. Currently these+ somewhat duplicate the manual on the website; this will be resolved+ somehow. (#282). +- The site is now built with hakyll-std, a generic hakyll script.++- hledger once again has a HCAR entry.++Tools:++- The hledger cabal files are now generated from package.yaml files by+ hpack, in principle, removing a lot of error-prone duplication and+ boilerplate. (In practice, both files are being updated manually+ for the moment, until hpack supports flags and conditional blocks.)++- Time/allocation and heap profiling is working again, and easier:++ - `make quickprof-CMD` generates a profile for CMD, which runs+ against one of the sample journals. (CMD must be one word,+ enclosing in double quotes isn't working here for some reason).++ - `make quickheap-CMD` generates a heap profile for CMD, in+ hledgerprof.ps, and tries to open it in a viewer (currently the+ mac-friendly "open" executable, so you may need to adjust this in+ the makefile). As with quickprof, CMD must be one word and runs+ against one of the sample journals.++ - `make hledgerprof` builds the hledgerprof executable used for+ time/allocation profiling. `make hledgercov` builds the hledgercov+ executable used for coverage reports.++- Travis CI now tests the build on each github push and announces+ status changes by email and on #hledger.+ Journal format: - Dates must now begin with a digit (not /, eg).
Hledger/Cli/Commands.hs view
@@ -176,6 +176,7 @@ irr calculate internal rate of return of an investment print-unique show only transactions with unique descriptions register-match show best matching transaction for a description+ roi calculate return on investments test run self tests OTHER Help:@@ -244,6 +245,10 @@ testcmd :: CliOpts -> Journal -> IO () testcmd opts _undefined = do let args = words' $ query_ $ reportopts_ opts+ -- workaround for https://github.com/joelburget/easytest/issues/11 +-- import System.IO (hSetEncoding, stdout, stderr, utf8)+-- hSetEncoding stdout utf8+-- hSetEncoding stderr utf8 e <- runEasytests args $ EasyTest.tests [tests_Hledger, tests_Commands] if e then exitFailure else exitSuccess
Hledger/Cli/Commands/Accounts.hs view
@@ -49,7 +49,6 @@ groupUnnamed = [ 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 ["codes"] (\opts -> setboolopt "codes" opts) "also show numeric account codes" ,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)" ,flagReq ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"@@ -70,8 +69,10 @@ declared = boolopt "declared" rawopts used = boolopt "used" rawopts q = queryFromOpts d ropts- -- a depth limit will clip and exclude account names later, but should not exclude accounts at this stage+ -- a depth limit will clip and exclude account names later, but we don't want to exclude accounts at this stage nodepthq = dbg1 "nodepthq" $ filterQuery (not . queryIsDepth) q+ -- just the acct: part of the query will be reapplied later, after clipping+ acctq = dbg1 "acctq" $ filterQuery queryIsAcct q depth = dbg1 "depth" $ queryDepth $ filterQuery queryIsDepth q matcheddeclaredaccts = dbg1 "matcheddeclaredaccts" $ filter (matchesAccount nodepthq) $ jdeclaredaccounts j matchedusedaccts = dbg5 "matchedusedaccts" $ map paccount $ journalPostings $ filterJournalPostings nodepthq j@@ -86,7 +87,7 @@ -- 3. if there's a depth limit, depth-clip and remove any no longer useful items clippedaccts = dbg1 "clippedaccts" $- filter (matchesAccount q) $ -- clipping can leave accounts that no longer visibly match the query+ filter (matchesAccount acctq) $ -- clipping can leave accounts that no longer match the query, remove such nub $ -- clipping can leave duplicates (adjacent, hopefully) filter (not . T.null) $ -- depth:0 can leave nulls map (clipAccountName depth) $ -- clip at depth if specified @@ -97,5 +98,5 @@ where render a | tree_ ropts = T.replicate (2 * (accountNameLevel a - 1)) " " <> accountLeafName a- | otherwise = maybeAccountNameDrop ropts a+ | otherwise = accountNameDrop (drop_ ropts) a
Hledger/Cli/Commands/Add.hs view
@@ -296,7 +296,7 @@ amountandcommentp = do a <- amountp lift (skipMany spacenonewline)- c <- T.pack <$> fromMaybe "" `fmap` optional (char ';' >> many anyChar)+ c <- T.pack <$> fromMaybe "" `fmap` optional (char ';' >> many anySingle) -- eof return (a,c) balancingamt = negate $ sum $ map pamount realps where realps = filter isReal esPostings
Hledger/Cli/Commands/Close.hs view
@@ -85,7 +85,7 @@ balancingamt = negate $ sum $ map (\(_,_,_,b) -> normaliseMixedAmountSquashPricesForDisplay b) acctbals ps = [posting{paccount=a ,pamount=mixed [b]- ,pbalanceassertion=Just (b,nullsourcepos)+ ,pbalanceassertion=Just assertion{ baamount=b } } |(a,_,_,mb) <- acctbals ,b <- amounts $ normaliseMixedAmountSquashPricesForDisplay mb@@ -93,7 +93,7 @@ ++ [posting{paccount="equity:opening balances", pamount=balancingamt}] nps = [posting{paccount=a ,pamount=mixed [negate b]- ,pbalanceassertion=Just (b{aquantity=0}, nullsourcepos)+ ,pbalanceassertion=Just assertion{ baamount=b{aquantity=0} } } |(a,_,_,mb) <- acctbals ,b <- amounts $ normaliseMixedAmountSquashPricesForDisplay mb
Hledger/Cli/Commands/Incomestatement.hs view
@@ -34,7 +34,7 @@ cbcqueries = [ CBCSubreportSpec{ cbcsubreporttitle="Revenues"- ,cbcsubreportquery=journalIncomeAccountQuery+ ,cbcsubreportquery=journalRevenueAccountQuery ,cbcsubreportnormalsign=NormallyNegative ,cbcsubreportincreasestotal=True }
Hledger/Cli/Commands/Prices.hs view
@@ -49,11 +49,11 @@ showPrice :: MarketPrice -> String showPrice mp = unwords ["P", show $ mpdate mp, T.unpack . quoteCommoditySymbolIfNeeded $ mpcommodity mp, showAmountWithZeroCommodity $ mpamount mp] -divideAmount' :: Amount -> Quantity -> Amount-divideAmount' a d = a' where- a' = (a `divideAmount` d) { astyle = style' }+divideAmount' :: Quantity -> Amount -> Amount+divideAmount' n a = a' where+ a' = (n `divideAmount` a) { astyle = style' } style' = (astyle a) { asprecision = precision' }- extPrecision = (1+) . floor . logBase 10 $ (realToFrac d :: Double)+ extPrecision = (1+) . floor . logBase 10 $ (realToFrac n :: Double) precision' = extPrecision + asprecision (astyle a) invertPrice :: Amount -> Amount@@ -63,7 +63,7 @@ UnitPrice pa -> invertPrice -- normalize to TotalPrice a { aprice = TotalPrice pa' } where- pa' = (pa `divideAmount` (1 / aquantity a)) { aprice = NoPrice }+ pa' = ((1 / aquantity a) `divideAmount` pa) { aprice = NoPrice } TotalPrice pa -> a { aquantity = aquantity pa * signum (aquantity a), acommodity = acommodity pa, aprice = TotalPrice pa' } where pa' = pa { aquantity = abs $ aquantity a, acommodity = acommodity a, aprice = NoPrice, astyle = astyle a }@@ -75,7 +75,7 @@ UnitPrice pa -> Just MarketPrice { mpdate = d, mpcommodity = acommodity a, mpamount = pa } TotalPrice pa -> Just- MarketPrice { mpdate = d, mpcommodity = acommodity a, mpamount = pa `divideAmount'` abs (aquantity a) }+ MarketPrice { mpdate = d, mpcommodity = acommodity a, mpamount = abs (aquantity a) `divideAmount'` pa } postingCosts :: Posting -> [MarketPrice] postingCosts p = mapMaybe (amountCost date) . amounts $ pamount p where
Hledger/Cli/Commands/Print.hs view
@@ -65,8 +65,8 @@ entriesReportAsText :: CliOpts -> EntriesReport -> String entriesReportAsText opts = concatMap (showTransactionUnelided . gettxn) where- gettxn | useexplicittxn = id -- use the fully inferred/explicit txn- | otherwise = originalTransaction -- use the original as-written txn, more or less+ gettxn | useexplicittxn = id -- use fully inferred amounts & txn prices + | otherwise = originalTransaction -- use original as-written amounts/txn prices -- 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 ?
Hledger/Cli/Commands/Rewrite.hs view
@@ -189,11 +189,11 @@ -- provided on the command line, or throw a parse error. transactionModifierFromOpts :: CliOpts -> TransactionModifier transactionModifierFromOpts CliOpts{rawopts_=rawopts,reportopts_=ropts} = - TransactionModifier{tmquerytxt=q, tmpostings=ps}+ TransactionModifier{tmquerytxt=q, tmpostingrules=ps} where q = T.pack $ query_ ropts ps = map (parseposting . stripquotes . T.pack) $ listofstringopt "add-posting" rawopts- parseposting t = either (error' . parseErrorPretty' t') id ep + parseposting t = either (error' . errorBundlePretty) id ep where ep = runIdentity (runJournalParser (postingp Nothing <* eof) t') t' = " " <> t <> "\n" -- inject space and newline for proper parsing
Hledger/Cli/CompoundBalanceCommand.hs view
@@ -14,7 +14,7 @@ ) where import Data.List (foldl')-import Data.Maybe (fromMaybe)+import Data.Maybe (fromMaybe,catMaybes) import qualified Data.Text as TS import qualified Data.Text.Lazy as TL import System.Console.CmdArgs.Explicit as C@@ -187,7 +187,7 @@ where zeros = replicate numcols nullmixedamt grandtotal = sum coltotals grandavg | null coltotals = nullmixedamt- | otherwise = grandtotal `divideMixedAmount` fromIntegral (length coltotals)+ | otherwise = fromIntegral (length coltotals) `divideMixedAmount` grandtotal in (coltotals, grandtotal, grandavg) colspans =@@ -218,13 +218,19 @@ -- run the report q = And [subreportqfn j, userq] r@(MultiBalanceReport (dates, rows, totals)) = multiBalanceReport ropts' q j- -- if user didn't specify --empty, now remove the all-zero rows+ -- if user didn't specify --empty, now remove the all-zero rows, unless they have non-zero subaccounts+ -- in this report r' | empty_ ropts = r | otherwise = MultiBalanceReport (dates, rows', totals) where+ nonzeroaccounts =+ dbg1 "nonzeroaccounts" $+ catMaybes $ map (\(act,_,_,amts,_,_) ->+ if not (all isZeroMixedAmount amts) then Just act else Nothing) rows rows' = filter (not . emptyRow) rows where- emptyRow (_,_,_,amts,_,_) = all isZeroMixedAmount amts+ emptyRow (act,_,_,amts,_,_) =+ all isZeroMixedAmount amts && all (not . (act `isAccountNamePrefixOf`)) nonzeroaccounts -- | Render a compound balance report as plain text suitable for console output. {- Eg:
Hledger/Cli/Utils.hs view
@@ -106,6 +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 } 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" "September 2018" "hledger\-api 1.11.1" "hledger User Manuals"+.TH "hledger\-api" "1" "December 2018" "hledger\-api 1.12" "hledger User Manuals"
embeddedfiles/hledger-api.info view
@@ -3,8 +3,8 @@ File: hledger-api.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-api(1) hledger-api 1.11.1-*********************************+hledger-api(1) hledger-api 1.12+******************************* hledger-api is a simple web API server, intended to support client-side web apps operating on hledger data. It comes with a series of simple@@ -80,7 +80,7 @@ Tag Table: Node: Top72-Node: OPTIONS1664-Ref: #options1749+Node: OPTIONS1660+Ref: #options1745 End Tag Table
embeddedfiles/hledger-api.txt view
@@ -117,4 +117,4 @@ -hledger-api 1.11.1 September 2018 hledger-api(1)+hledger-api 1.12 December 2018 hledger-api(1)
embeddedfiles/hledger-ui.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-ui" "1" "September 2018" "hledger\-ui 1.11.1" "hledger User Manuals"+.TH "hledger\-ui" "1" "December 2018" "hledger\-ui 1.12" "hledger User Manuals" @@ -26,6 +26,13 @@ It is easier than hledger's command\-line interface, and sometimes quicker and more convenient than the web interface. .PP+Note hledger\-ui has some different defaults: \- it generates+rule\-based transactions and postings by default (\[en]forecast and+\[en]auto are always on).+\- it hides transactions dated in the future by default (change this+with \[en]future or the F key).+Experimental.+.PP Like hledger, it reads data from one or more files in hledger journal, timeclock, timedot, or CSV format specified with \f[C]\-f\f[], or \f[C]$LEDGER_FILE\f[], or \f[C]$HOME/.hledger.journal\f[] (on windows,@@ -59,10 +66,20 @@ .RS .RE .TP-.B \f[C]\-\-flat\f[]-show full account names, unindented+.B \f[C]\-F\ \-\-flat\f[]+show accounts as a list (default) .RS .RE+.TP+.B \f[C]\-T\ \-\-tree\f[]+show accounts as a tree+.RS+.RE+.TP+.B \f[C]\-\-future\f[]+show transactions dated later than today (normally hidden)+.RS+.RE .PP hledger input options: .TP@@ -270,6 +287,14 @@ \f[C]BACKSPACE\f[] or \f[C]DELETE\f[] removes all filters, showing all transactions. .PP+As mentioned above, hledger\-ui shows auto\-generated periodic+transactions, and hides future transactions (auto\-generated or not) by+default.+\f[C]F\f[] toggles showing and hiding these future transactions.+This is similar to using a query like \f[C]date:\-tomorrow\f[], but more+convenient.+(experimental)+.PP \f[C]ESCAPE\f[] removes all filters and jumps back to the top screen. Or, it cancels a minibuffer edit or help dialog in progress. .PP@@ -314,21 +339,21 @@ if you specify a query on the command line, it shows just the matched accounts and the balances from matched transactions. .PP-Account names are normally indented to show the hierarchy (tree mode).-To see less detail, set a depth limit by pressing a number key,-\f[C]1\f[] to \f[C]9\f[].+Account names are shown as a flat list by default.+Press \f[C]T\f[] to toggle tree mode.+In flat mode, account balances are exclusive of subaccounts, except+where subaccounts are hidden by a depth limit (see below).+In tree mode, all account balances are inclusive of subaccounts.+.PP+To see less detail, press a number key, \f[C]1\f[] to \f[C]9\f[], to set+a depth limit.+Or use \f[C]\-\f[] to decrease and \f[C]+\f[]/\f[C]=\f[] to increase the+depth limit. \f[C]0\f[] shows even less detail, collapsing all accounts to a single total.-\f[C]\-\f[] and \f[C]+\f[] (or \f[C]=\f[]) decrease and increase the-depth limit. To remove the depth limit, set it higher than the maximum account depth, or press \f[C]ESCAPE\f[]. .PP-\f[C]F\f[] toggles flat mode, in which accounts are shown as a flat-list, with their full names.-In this mode, account balances exclude subaccounts, except for accounts-at the depth limit (as with hledger's balance command).-.PP \f[C]H\f[] toggles between showing historical balances or period balances. Historical balances (the default) are ending balances at the end of the@@ -380,14 +405,16 @@ the running historical balance you would see on a bank register for the current account. .PP-If the accounts screen was in tree mode, the register screen will-include transactions from both the current account and its subaccounts.-If the accounts screen was in flat mode, and a non\-depth\-clipped-account was selected, the register screen will exclude transactions from-subaccounts.-In other words, the register always shows the transactions responsible-for the period balance shown on the accounts screen.-As on the accounts screen, this can be toggled with \f[C]F\f[].+Transactions affecting this account's subaccounts will be included in+the register if the accounts screen is in tree mode, or if it's in flat+mode but this account has subaccounts which are not shown due to a depth+limit.+In other words, the register always shows the transactions contributing+to the balance shown on the accounts screen.+.PD 0+.P+.PD+Tree mode/flat mode can be toggled with \f[C]T\f[] here also. .PP \f[C]U\f[] toggles filtering by unmarked status, showing or hiding unmarked transactions.
embeddedfiles/hledger-ui.info view
@@ -3,8 +3,8 @@ File: hledger-ui.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-ui(1) hledger-ui 1.11.1-*******************************+hledger-ui(1) hledger-ui 1.12+***************************** hledger-ui is hledger's curses-style interface, providing an efficient full-window text UI for viewing accounts and transactions, and some@@ -12,6 +12,11 @@ interface, and sometimes quicker and more convenient than the web interface. + Note hledger-ui has some different defaults: - it generates+rule-based transactions and postings by default (-forecast and -auto are+always on). - it hides transactions dated in the future by default+(change this with -future or the F key). Experimental.+ Like hledger, it reads data from one or more files in hledger journal, timeclock, timedot, or CSV format specified with '-f', or '$LEDGER_FILE', or '$HOME/.hledger.journal' (on windows, perhaps@@ -48,10 +53,16 @@ show period balances (changes) at startup instead of historical balances-'--flat'+'-F --flat' - show full account names, unindented+ show accounts as a list (default)+'-T --tree' + show accounts as a tree+'--future'++ show transactions dated later than today (normally hidden)+ hledger input options: '-f FILE --file=FILE'@@ -201,6 +212,12 @@ below). 'BACKSPACE' or 'DELETE' removes all filters, showing all transactions. + As mentioned above, hledger-ui shows auto-generated periodic+transactions, and hides future transactions (auto-generated or not) by+default. 'F' toggles showing and hiding these future transactions.+This is similar to using a query like 'date:-tomorrow', but more+convenient. (experimental)+ 'ESCAPE' removes all filters and jumps back to the top screen. Or, it cancels a minibuffer edit or help dialog in progress. @@ -257,17 +274,17 @@ subaccounts). if you specify a query on the command line, it shows just the matched accounts and the balances from matched transactions. - Account names are normally indented to show the hierarchy (tree-mode). To see less detail, set a depth limit by pressing a number key,-'1' to '9'. '0' shows even less detail, collapsing all accounts to a-single total. '-' and '+' (or '=') decrease and increase the depth-limit. To remove the depth limit, set it higher than the maximum-account depth, or press 'ESCAPE'.+ Account names are shown as a flat list by default. Press 'T' to+toggle tree mode. In flat mode, account balances are exclusive of+subaccounts, except where subaccounts are hidden by a depth limit (see+below). In tree mode, all account balances are inclusive of+subaccounts. - 'F' toggles flat mode, in which accounts are shown as a flat list,-with their full names. In this mode, account balances exclude-subaccounts, except for accounts at the depth limit (as with hledger's-balance command).+ To see less detail, press a number key, '1' to '9', to set a depth+limit. Or use '-' to decrease and '+'/'=' to increase the depth limit.+'0' shows even less detail, collapsing all accounts to a single total.+To remove the depth limit, set it higher than the maximum account depth,+or press 'ESCAPE'. 'H' toggles between showing historical balances or period balances. Historical balances (the default) are ending balances at the end of the@@ -318,13 +335,12 @@ not disturbed by a filter query, it will be the running historical balance you would see on a bank register for the current account. - If the accounts screen was in tree mode, the register screen will-include transactions from both the current account and its subaccounts.-If the accounts screen was in flat mode, and a non-depth-clipped account-was selected, the register screen will exclude transactions from-subaccounts. In other words, the register always shows the transactions-responsible for the period balance shown on the accounts screen. As on-the accounts screen, this can be toggled with 'F'.+ Transactions affecting this account's subaccounts will be included in+the register if the accounts screen is in tree mode, or if it's in flat+mode but this account has subaccounts which are not shown due to a depth+limit. In other words, the register always shows the transactions+contributing to the balance shown on the accounts screen.+Tree mode/flat mode can be toggled with 'T' here also. 'U' toggles filtering by unmarked status, showing or hiding unmarked transactions. Similarly, 'P' toggles pending transactions, and 'C'@@ -380,19 +396,19 @@ Tag Table: Node: Top71-Node: OPTIONS827-Ref: #options924-Node: KEYS4224-Ref: #keys4319-Node: SCREENS7278-Ref: #screens7363-Node: Accounts screen7453-Ref: #accounts-screen7581-Node: Register screen9811-Ref: #register-screen9966-Node: Transaction screen12040-Ref: #transaction-screen12198-Node: Error screen13068-Ref: #error-screen13190+Node: OPTIONS1084+Ref: #options1181+Node: KEYS4600+Ref: #keys4695+Node: SCREENS7951+Ref: #screens8036+Node: Accounts screen8126+Ref: #accounts-screen8254+Node: Register screen10470+Ref: #register-screen10625+Node: Transaction screen12622+Ref: #transaction-screen12780+Node: Error screen13650+Ref: #error-screen13772 End Tag Table
embeddedfiles/hledger-ui.txt view
@@ -22,17 +22,22 @@ mand-line interface, and sometimes quicker and more convenient than the web interface. - Like hledger, it reads data from one or more files in hledger journal,- timeclock, timedot, or CSV format specified with -f, or $LEDGER_FILE,- or $HOME/.hledger.journal (on windows, perhaps- C:/Users/USER/.hledger.journal). For more about this see hledger(1),+ Note hledger-ui has some different defaults: - it generates rule-based+ transactions and postings by default (-forecast and -auto are always+ on). - it hides transactions dated in the future by default (change+ this with -future or the F key). Experimental.++ Like hledger, it reads data from one or more files in hledger journal,+ timeclock, timedot, or CSV format specified with -f, or $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. OPTIONS- Note: if invoking hledger-ui as a hledger subcommand, write -- before+ Note: if invoking hledger-ui as a hledger subcommand, write -- before options as shown above. - Any QUERYARGS are interpreted as a hledger search query which filters+ Any QUERYARGS are interpreted as a hledger search query which filters the data. --watch@@ -45,11 +50,18 @@ start in the (first) matched account's register screen --change- show period balances (changes) at startup instead of historical+ show period balances (changes) at startup instead of historical balances - --flat show full account names, unindented+ -F --flat+ show accounts as a list (default) + -T --tree+ show accounts as a tree++ --future+ show transactions dated later than today (normally hidden)+ hledger input options: -f FILE --file=FILE@@ -57,7 +69,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@@ -98,11 +110,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@@ -121,21 +133,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@@ -155,64 +167,70 @@ 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.) KEYS- ? shows a help dialog listing all keys. (Some of these also appear in+ ? shows a help dialog listing all keys. (Some of these also appear in the quick help at the bottom of each screen.) Press ? again (or ESCAPE, or LEFT) to close it. The following keys work on most screens: The cursor keys navigate: right (or enter) goes deeper, left returns to- the previous screen, up/down/page up/page down/home/end move up and- down through lists. Vi-style (h/j/k/l) and Emacs-style+ the previous screen, up/down/page up/page down/home/end move up and+ down through lists. Vi-style (h/j/k/l) and Emacs-style (CTRL-p/CTRL-n/CTRL-f/CTRL-b) movement keys are also supported. A tip:- movement speed is limited by your keyboard repeat rate, to move faster- you may want to adjust it. (If you're on a mac, the Karabiner app is+ movement speed is limited by your keyboard repeat rate, to move faster+ you may want to adjust it. (If you're on a mac, the Karabiner app is one way to do that.) - With shift pressed, the cursor keys adjust the report period, limiting- the transactions to be shown (by default, all are shown).- shift-down/up steps downward and upward through these standard report+ With shift pressed, the cursor keys adjust the report period, limiting+ the transactions to be shown (by default, all are shown).+ shift-down/up steps downward and upward through these standard report period durations: year, quarter, month, week, day. Then,- shift-left/right moves to the previous/next period. t sets the report- period to today. With the --watch option, when viewing a "current"- period (the current day, week, month, quarter, or year), the period- will move automatically to track the current date. To set a non-stan-+ shift-left/right moves to the previous/next period. t sets the report+ period to today. With the --watch option, when viewing a "current"+ period (the current day, week, month, quarter, or year), the period+ will move automatically to track the current date. To set a non-stan- dard period, you can use / and a date: query. - / lets you set a general filter query limiting the data shown, using- the same query terms as in hledger and hledger-web. While editing the- query, you can use CTRL-a/e/d/k, BS, cursor keys; press ENTER to set+ / lets you set a general filter query limiting the data shown, using+ the same query terms as in hledger and hledger-web. While editing the+ query, you can use CTRL-a/e/d/k, BS, cursor keys; press ENTER to set it, or ESCAPEto cancel. There are also keys for quickly adjusting some- common filters like account depth and transaction status (see below).+ common filters like account depth and transaction status (see below). BACKSPACE or DELETE removes all filters, showing all transactions. - ESCAPE removes all filters and jumps back to the top screen. Or, it+ As mentioned above, hledger-ui shows auto-generated periodic transac-+ tions, and hides future transactions (auto-generated or not) by+ default. F toggles showing and hiding these future transactions. This+ is similar to using a query like date:-tomorrow, but more convenient.+ (experimental)++ ESCAPE removes all filters and jumps back to the top screen. Or, it cancels a minibuffer edit or help dialog in progress. CTRL-l redraws the screen and centers the selection if possible (selec-- tions near the top won't be centered, since we don't scroll above the+ tions near the top won't be centered, since we don't scroll above the top). - g reloads from the data file(s) and updates the current screen and any- previous screens. (With large files, this could cause a noticeable+ g reloads from the data file(s) and updates the current screen and any+ previous screens. (With large files, this could cause a noticeable pause.) - I toggles balance assertion checking. Disabling balance assertions+ I toggles balance assertion checking. Disabling balance assertions temporarily can be useful for troubleshooting. - a runs command-line hledger's add command, and reloads the updated+ a runs command-line hledger's add command, and reloads the updated file. This allows some basic data entry. - A is like a, but runs the hledger-iadd tool, which provides a- curses-style interface. This key will be available if hledger-iadd is+ A is like a, but runs the hledger-iadd tool, which provides a+ curses-style interface. This key will be available if hledger-iadd is installed in $PATH. - E runs $HLEDGER_UI_EDITOR, or $EDITOR, or a default (emac-+ E runs $HLEDGER_UI_EDITOR, or $EDITOR, or a default (emac- sclient -a "" -nw) on the journal file. With some editors (emacs, vi),- the cursor will be positioned at the current transaction when invoked- from the register and transaction screens, and at the error location+ the cursor will be positioned at the current transaction when invoked+ from the register and transaction screens, and at the error location (if possible) when invoked from the error screen. q quits the application.@@ -221,44 +239,44 @@ SCREENS Accounts screen- This is normally the first screen displayed. It lists accounts and- their balances, like hledger's balance command. By default, it shows- all accounts and their latest ending balances (including the balances- of subaccounts). if you specify a query on the command line, it shows+ This is normally the first screen displayed. It lists accounts and+ their balances, like hledger's balance command. By default, it shows+ all accounts and their latest ending balances (including the balances+ of subaccounts). if you specify a query on the command line, it shows just the matched accounts and the balances from matched transactions. - Account names are normally indented to show the hierarchy (tree mode).- To see less detail, set a depth limit by pressing a number key, 1 to 9.- 0 shows even less detail, collapsing all accounts to a single total. -- and + (or =) decrease and increase the depth limit. To remove the+ Account names are shown as a flat list by default. Press T to toggle+ tree mode. In flat mode, account balances are exclusive of subac-+ counts, except where subaccounts are hidden by a depth limit (see+ below). In tree mode, all account balances are inclusive of subac-+ counts.++ To see less detail, press a number key, 1 to 9, to set a depth limit.+ Or use - to decrease and +/= to increase the depth limit. 0 shows even+ less detail, collapsing all accounts to a single total. To remove the depth limit, set it higher than the maximum account depth, or press ESCAPE. - F toggles flat mode, in which accounts are shown as a flat list, with- their full names. In this mode, account balances exclude subaccounts,- except for accounts at the depth limit (as with hledger's balance com-- mand).- H toggles between showing historical balances or period balances. His-- torical balances (the default) are ending balances at the end of the- report period, taking into account all transactions before that date- (filtered by the filter query if any), including transactions before- the start of the report period. In other words, historical balances- are what you would see on a bank statement for that account (unless- disturbed by a filter query). Period balances ignore transactions+ torical balances (the default) are ending balances at the end of the+ report period, taking into account all transactions before that date+ (filtered by the filter query if any), including transactions before+ the start of the report period. In other words, historical balances+ are what you would see on a bank statement for that account (unless+ disturbed by a filter query). Period balances ignore transactions before the report start date, so they show the change in balance during the report period. They are more useful eg when viewing a time log. U toggles filtering by unmarked status, including or excluding unmarked postings in the balances. Similarly, P toggles pending postings, and C- toggles cleared postings. (By default, balances include all postings;- if you activate one or two status filters, only those postings are+ toggles cleared postings. (By default, balances include all postings;+ if you activate one or two status filters, only those postings are included; and if you activate all three, the filter is removed.) R toggles real mode, in which virtual postings are ignored. - Z toggles nonzero mode, in which only accounts with nonzero balances- are shown (hledger-ui shows zero items by default, unlike command-line+ Z toggles nonzero mode, in which only accounts with nonzero balances+ are shown (hledger-ui shows zero items by default, unlike command-line hledger). Press right or enter to view an account's transactions register.@@ -267,65 +285,64 @@ This screen shows the transactions affecting a particular account, like a check register. Each line represents one transaction and shows: - o the other account(s) involved, in abbreviated form. (If there are- both real and virtual postings, it shows only the accounts affected+ o the other account(s) involved, in abbreviated form. (If there are+ both real and virtual postings, it shows only the accounts affected by real postings.) - o the overall change to the current account's balance; positive for an+ o the overall change to the current account's balance; positive for an inflow to this account, negative for an outflow. o the running historical total or period total for the current account,- after the transaction. This can be toggled with H. Similar to the- accounts screen, the historical total is affected by transactions- (filtered by the filter query) before the report start date, while+ after the transaction. This can be toggled with H. Similar to the+ accounts screen, the historical total is affected by transactions+ (filtered by the filter query) before the report start date, while the period total is not. If the historical total is not disturbed by- a filter query, it will be the running historical balance you would+ a filter query, it will be the running historical balance you would see on a bank register for the current account. - If the accounts screen was in tree mode, the register screen will- include transactions from both the current account and its subaccounts.- If the accounts screen was in flat mode, and a non-depth-clipped- account was selected, the register screen will exclude transactions- from subaccounts. In other words, the register always shows the trans-- actions responsible for the period balance shown on the accounts- screen. As on the accounts screen, this can be toggled with F.+ Transactions affecting this account's subaccounts will be included in+ the register if the accounts screen is in tree mode, or if it's in flat+ mode but this account has subaccounts which are not shown due to a+ depth limit. In other words, the register always shows the transac-+ tions contributing to the balance shown on the accounts screen.+ Tree mode/flat mode can be toggled with T here also. - U toggles filtering by unmarked status, showing or hiding unmarked+ U toggles filtering by unmarked status, showing or hiding unmarked transactions. Similarly, P toggles pending transactions, and C toggles- cleared transactions. (By default, transactions with all statuses are- shown; if you activate one or two status filters, only those transac-- tions are shown; and if you activate all three, the filter is+ cleared transactions. (By default, transactions with all statuses are+ shown; if you activate one or two status filters, only those transac-+ tions are shown; and if you activate all three, the filter is removed.)q R toggles real mode, in which virtual postings are ignored. - Z toggles nonzero mode, in which only transactions posting a nonzero- change are shown (hledger-ui shows zero items by default, unlike com-+ Z toggles nonzero mode, in which only transactions posting a nonzero+ change are shown (hledger-ui shows zero items by default, unlike com- mand-line hledger). Press right (or enter) to view the selected transaction in detail. Transaction screen- This screen shows a single transaction, as a general journal entry,- similar to hledger's print command and journal format (hledger_jour-+ This screen shows a single transaction, as a general journal entry,+ similar to hledger's print command and journal format (hledger_jour- nal(5)). - The transaction's date(s) and any cleared flag, transaction code,- description, comments, along with all of its account postings are- shown. Simple transactions have two postings, but there can be more+ The transaction's date(s) and any cleared flag, transaction code,+ description, comments, along with all of its account postings are+ shown. Simple transactions have two postings, but there can be more (or in certain cases, fewer). - up and down will step through all transactions listed in the previous- account register screen. In the title bar, the numbers in parentheses- show your position within that account register. They will vary+ up and down will step through all transactions listed in the previous+ account register screen. In the title bar, the numbers in parentheses+ show your position within that account register. They will vary depending on which account register you came from (remember most trans- actions appear in multiple account registers). The #N number preceding them is the transaction's position within the complete unfiltered jour- nal, which is a more stable id (at least until the next reload). Error screen- This screen will appear if there is a problem, such as a parse error,- when you press g to reload. Once you have fixed the problem, press g+ This screen will appear if there is a problem, such as a parse error,+ when you press g to reload. Once you have fixed the problem, press g again to reload and resume normal operation. (Or, you can press escape to cancel the reload attempt.) @@ -333,17 +350,17 @@ COLUMNS The screen width to use. Default: the full terminal width. LEDGER_FILE The journal file path when not specified with -f. Default:- ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-+ ~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour- nal). FILES- Reads data from one or more files in hledger journal, timeclock, time-- dot, or CSV format specified with -f, or $LEDGER_FILE, or- $HOME/.hledger.journal (on windows, perhaps+ Reads data from one or more files in hledger journal, timeclock, time-+ dot, or CSV format specified with -f, or $LEDGER_FILE, or+ $HOME/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.journal). BUGS- The need to precede 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-ui can't read from stdin).@@ -351,13 +368,13 @@ -V affects only the accounts screen. When you press g, the current and all previous screens are regenerated,- which may cause a noticeable pause with large files. Also there is no+ which may cause a noticeable pause with large files. Also there is no visual indication that this is in progress. - --watch is not yet fully robust. It works well for normal usage, but- many file changes in a short time (eg saving the file thousands of- times with an editor macro) can cause problems at least on OSX. Symp-- toms include: unresponsive UI, periodic resetting of the cursor posi-+ --watch is not yet fully robust. It works well for normal usage, but+ many file changes in a short time (eg saving the file thousands of+ times with an editor macro) can cause problems at least on OSX. Symp-+ toms include: unresponsive UI, periodic resetting of the cursor posi- tion, momentary display of parse errors, high CPU usage eventually sub- siding, and possibly a small but persistent build-up of CPU usage until the program is restarted.@@ -365,7 +382,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) @@ -379,7 +396,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) @@ -387,4 +404,4 @@ -hledger-ui 1.11.1 September 2018 hledger-ui(1)+hledger-ui 1.12 December 2018 hledger-ui(1)
embeddedfiles/hledger-web.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-web" "1" "September 2018" "hledger\-web 1.11.1" "hledger User Manuals"+.TH "hledger\-web" "1" "December 2018" "hledger\-web 1.12" "hledger User Manuals"
embeddedfiles/hledger-web.info view
@@ -3,8 +3,8 @@ File: hledger-web.info, Node: Top, Next: OPTIONS, Up: (dir) -hledger-web(1) hledger-web 1.11.1-*********************************+hledger-web(1) hledger-web 1.12+******************************* hledger-web is hledger's web interface. It starts a simple web application for browsing and adding transactions, and optionally opens@@ -212,7 +212,7 @@ Tag Table: Node: Top72-Node: OPTIONS3158-Ref: #options3243+Node: OPTIONS3154+Ref: #options3239 End Tag Table
embeddedfiles/hledger-web.txt view
@@ -251,4 +251,4 @@ -hledger-web 1.11.1 September 2018 hledger-web(1)+hledger-web 1.12 December 2018 hledger-web(1)
embeddedfiles/hledger.1 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "September 2018" "hledger 1.11.1" "hledger User Manuals"+.TH "hledger" "1" "December 2018" "hledger 1.12" "hledger User Manuals" @@ -344,46 +344,125 @@ To prevent this expansion of \f[C]\@\f[]\-arguments, precede them with a \f[C]\-\-\f[] argument. For more, see Save frequently used options.-.SS Special characters+.SS Special characters in arguments and queries .PP-Option and argument values which contain problematic characters should-be escaped with double quotes, backslashes, or (best) single quotes.-Problematic characters means spaces, and also characters which are-significant to your command shell, such as less\-than/greater\-than.+In shell command lines, option and argument values which contain+\[lq]problematic\[rq] characters, ie spaces, and also characters+significant to your shell such as \f[C]<\f[], \f[C]>\f[], \f[C](\f[],+\f[C])\f[], \f[C]|\f[] and \f[C]$\f[], should be escaped by enclosing+them in quotes or by writing backslashes before the characters. Eg:+.PP \f[C]hledger\ register\ \-p\ \[aq]last\ year\[aq]\ "accounts\ receivable\ (receivable|payable)"\ amt:\\>100\f[].+.SS More escaping .PP-Characters which are significant both to the shell and in regular-expressions sometimes need to be double\-escaped.+Characters significant both to the shell and in regular expressions may+need one extra level of escaping. These include parentheses, the pipe symbol and the dollar sign. Eg, to match the dollar symbol, bash users should do:-\f[C]hledger\ balance\ cur:\[aq]\\$\[aq]\f[] or-\f[C]hledger\ balance\ cur:\\\\$\f[]. .PP-When hledger is invoking an addon executable (like hledger\-ui), options-and arguments get de\-escaped once more, so you might need-\f[I]triple\f[]\-escaping.-Eg: \f[C]hledger\ ui\ cur:\[aq]\\\\$\[aq]\f[] or-\f[C]hledger\ ui\ cur:\\\\\\\\$\f[] in bash.+\f[C]hledger\ balance\ cur:\[aq]\\$\[aq]\f[]+.PP+or:+.PP+\f[C]hledger\ balance\ cur:\\\\$\f[]+.SS Even more escaping+.PP+When hledger runs an addon executable (eg you type \f[C]hledger\ ui\f[],+hledger runs \f[C]hledger\-ui\f[]), it de\-escapes command\-line options+and arguments once, so you might need to \f[I]triple\f[]\-escape.+Eg in bash, running the ui command and matching the dollar sign, it's:+.PP+\f[C]hledger\ ui\ cur:\[aq]\\\\$\[aq]\f[]+.PP+or:+.PP+\f[C]hledger\ ui\ cur:\\\\\\\\$\f[]+.PP+If you asked why \f[I]four\f[] slashes above, this may help:+.PP+.TS+tab(@);+l l.+T{+unescaped:+T}@T{+\f[C]$\f[]+T}+T{+escaped:+T}@T{+\f[C]\\$\f[]+T}+T{+double\-escaped:+T}@T{+\f[C]\\\\$\f[]+T}+T{+triple\-escaped:+T}@T{+\f[C]\\\\\\\\$\f[]+T}+.TE+.PP (The number of backslashes in fish shell is left as an exercise for the reader.) .PP-Inside a file used for argument expansion, one less level of escaping is-enough.-(And in this case, backslashes seem to work better than quotes.-Eg: \f[C]cur:\\$\f[]).+You can always avoid the extra escaping for addons by running the addon+directly: .PP+\f[C]hledger\-ui\ cur:\\\\$\f[]+.SS Less escaping+.PP+Inside an argument file, or in the search field of hledger\-ui or+hledger\-web, or at a GHCI prompt, you need one less level of escaping+than at the command line.+And backslashes may work better than quotes.+Eg:+.PP+\f[C]ghci>\ :main\ balance\ cur:\\$\f[]+.SS Command line tips+.PP If in doubt, keep things simple: .IP \[bu] 2-run add\-on executables directly+write options after the command (\f[C]hledger\ CMD\ \-OPTIONS\ ARGS\f[]) .IP \[bu] 2-write options after the command+run add\-on executables directly (\f[C]hledger\-ui\ \-OPTIONS\ ARGS\f[]) .IP \[bu] 2 enclose problematic args in single quotes .IP \[bu] 2 if needed, also add a backslash to escape regexp metacharacters .PP-If you're really stumped, add \f[C]\-\-debug=2\f[] to troubleshoot.+To find out exactly how a command line is being parsed, add+\f[C]\-\-debug=2\f[] to troubleshoot.+.SS Unicode characters+.PP+hledger is expected to handle unicode (non\-ascii) characters, but this+requires a well\-configured environment.+.PP+To handle unicode characters in the command line or input data, a system+locale that can decode them must be configured (POSIX's default+\f[C]C\f[] locale will not work).+Eg in bash, you could do:+.IP+.nf+\f[C]+export\ LANG=en_US.UTF\-8+\f[]+.fi+.PP+See Troubleshooting for more about this.+.PP+Unicode characters should appear correctly in hledger's output.+For the hledger and hledger\-ui tools, this requires that+.IP \[bu] 2+your terminal supports unicode+.IP \[bu] 2+the terminal's font includes the required unicode glyphs+.IP \[bu] 2+the terminal is configured to display \[lq]wide\[rq] characters as+double width (otherwise report alignment will be off) .SS Input files .PP hledger reads transactions from a data file (and the add command writes@@ -2900,7 +2979,7 @@ .SS irr .PP hledger\-irr calculates the internal rate of return of an investment-account.+account, but it's superseded now by the built\-in roi command. .SS Experimental add\-ons .PP These are available in source form in the hledger repo's bin/ directory;
embeddedfiles/hledger.info view
@@ -3,8 +3,8 @@ File: hledger.info, Node: Top, Next: EXAMPLES, Up: (dir) -hledger(1) hledger 1.11.1-*************************+hledger(1) hledger 1.12+*********************** This is hledger's command-line interface (there are also curses and web interfaces). Its basic function is to read a plain text file describing@@ -119,7 +119,9 @@ * Command options:: * Command arguments:: * Argument files::-* Special characters::+* Special characters in arguments and queries::+* Command line tips::+* Unicode characters:: * Input files:: * Smart dates:: * Report start & end date::@@ -277,7 +279,7 @@ often a query, filtering the data in some way. -File: hledger.info, Node: Argument files, Next: Special characters, Prev: Command arguments, Up: OPTIONS+File: hledger.info, Node: Argument files, Next: Special characters in arguments and queries, Prev: Command arguments, Up: OPTIONS 2.4 Argument files ==================@@ -288,47 +290,132 @@ argument. For more, see Save frequently used options. -File: hledger.info, Node: Special characters, Next: Input files, Prev: Argument files, Up: OPTIONS+File: hledger.info, Node: Special characters in arguments and queries, Next: Command line tips, Prev: Argument files, Up: OPTIONS -2.5 Special characters-======================+2.5 Special characters in arguments and queries+=============================================== -Option and argument values which contain problematic characters should-be escaped with double quotes, backslashes, or (best) single quotes.-Problematic characters means spaces, and also characters which are-significant to your command shell, such as less-than/greater-than. Eg:-'hledger register -p 'last year' "accounts receivable+In shell command lines, option and argument values which contain+"problematic" characters, ie spaces, and also characters significant to+your shell such as '<', '>', '(', ')', '|' and '$', should be escaped by+enclosing them in quotes or by writing backslashes before the+characters. Eg:++ 'hledger register -p 'last year' "accounts receivable (receivable|payable)" amt:\>100'.+* Menu: - Characters which are significant both to the shell and in regular-expressions sometimes need to be double-escaped. These include-parentheses, the pipe symbol and the dollar sign. Eg, to match the-dollar symbol, bash users should do: 'hledger balance cur:'\$'' or-'hledger balance cur:\\$'.+* More escaping::+* Even more escaping::+* Less escaping:: - When hledger is invoking an addon executable (like hledger-ui),-options and arguments get de-escaped once more, so you might need-_triple_-escaping. Eg: 'hledger ui cur:'\\$'' or 'hledger ui cur:\\\\$'-in bash. (The number of backslashes in fish shell is left as an-exercise for the reader.)++File: hledger.info, Node: More escaping, Next: Even more escaping, Up: Special characters in arguments and queries - Inside a file used for argument expansion, one less level of escaping-is enough. (And in this case, backslashes seem to work better than-quotes. Eg: 'cur:\$').+2.5.1 More escaping+------------------- - If in doubt, keep things simple:+Characters significant both to the shell and in regular expressions may+need one extra level of escaping. These include parentheses, the pipe+symbol and the dollar sign. Eg, to match the dollar symbol, bash users+should do: - * run add-on executables directly- * write options after the command+ 'hledger balance cur:'\$''++ or:++ 'hledger balance cur:\\$'+++File: hledger.info, Node: Even more escaping, Next: Less escaping, Prev: More escaping, Up: Special characters in arguments and queries++2.5.2 Even more escaping+------------------------++When hledger runs an addon executable (eg you type 'hledger ui', hledger+runs 'hledger-ui'), it de-escapes command-line options and arguments+once, so you might need to _triple_-escape. Eg in bash, running the ui+command and matching the dollar sign, it's:++ 'hledger ui cur:'\\$''++ or:++ 'hledger ui cur:\\\\$'++ If you asked why _four_ slashes above, this may help:++unescaped: '$'+escaped: '\$'+double-escaped: '\\$'+triple-escaped: '\\\\$'++ (The number of backslashes in fish shell is left as an exercise for+the reader.)++ You can always avoid the extra escaping for addons by running the+addon directly:++ 'hledger-ui cur:\\$'+++File: hledger.info, Node: Less escaping, Prev: Even more escaping, Up: Special characters in arguments and queries++2.5.3 Less escaping+-------------------++Inside an argument file, or in the search field of hledger-ui or+hledger-web, or at a GHCI prompt, you need one less level of escaping+than at the command line. And backslashes may work better than quotes.+Eg:++ 'ghci> :main balance cur:\$'+++File: hledger.info, Node: Command line tips, Next: Unicode characters, Prev: Special characters in arguments and queries, Up: OPTIONS++2.6 Command line tips+=====================++If in doubt, keep things simple:++ * write options after the command ('hledger CMD -OPTIONS ARGS')+ * run add-on executables directly ('hledger-ui -OPTIONS ARGS') * enclose problematic args in single quotes * if needed, also add a backslash to escape regexp metacharacters - If you're really stumped, add '--debug=2' to troubleshoot.+ To find out exactly how a command line is being parsed, add+'--debug=2' to troubleshoot. -File: hledger.info, Node: Input files, Next: Smart dates, Prev: Special characters, Up: OPTIONS+File: hledger.info, Node: Unicode characters, Next: Input files, Prev: Command line tips, Up: OPTIONS -2.6 Input files+2.7 Unicode characters+======================++hledger is expected to handle unicode (non-ascii) characters, but this+requires a well-configured environment.++ To handle unicode characters in the command line or input data, a+system locale that can decode them must be configured (POSIX's default+'C' locale will not work). Eg in bash, you could do:++export LANG=en_US.UTF-8++ See Troubleshooting for more about this.++ Unicode characters should appear correctly in hledger's output. For+the hledger and hledger-ui tools, this requires that++ * your terminal supports unicode+ * the terminal's font includes the required unicode glyphs+ * the terminal is configured to display "wide" characters as double+ width (otherwise report alignment will be off)+++File: hledger.info, Node: Input files, Next: Smart dates, Prev: Unicode characters, Up: OPTIONS++2.8 Input files =============== hledger reads transactions from a data file (and the add command writes@@ -383,7 +470,7 @@ File: hledger.info, Node: Smart dates, Next: Report start & end date, Prev: Input files, Up: OPTIONS -2.7 Smart dates+2.9 Smart dates =============== hledger's user interfaces accept a flexible "smart date" syntax (unlike@@ -416,8 +503,8 @@ File: hledger.info, Node: Report start & end date, Next: Report intervals, Prev: Smart dates, Up: OPTIONS -2.8 Report start & end date-===========================+2.10 Report start & end date+============================ Most hledger reports show the full span of time represented by the journal data, by default. So, the effective report start and end dates@@ -445,8 +532,8 @@ File: hledger.info, Node: Report intervals, Next: Period expressions, Prev: Report start & end date, Up: OPTIONS -2.9 Report intervals-====================+2.11 Report intervals+===================== A report interval can be specified so that commands like register, balance and activity will divide their reports into multiple subperiods.@@ -458,7 +545,7 @@ File: hledger.info, Node: Period expressions, Next: Depth limiting, Prev: Report intervals, Up: OPTIONS -2.10 Period expressions+2.12 Period expressions ======================= The '-p/--period' option accepts period expressions, a shorthand way of@@ -566,7 +653,7 @@ File: hledger.info, Node: Depth limiting, Next: Pivoting, Prev: Period expressions, Up: OPTIONS -2.11 Depth limiting+2.13 Depth limiting =================== With the '--depth N' option (short form: '-N'), commands like account,@@ -578,7 +665,7 @@ File: hledger.info, Node: Pivoting, Next: Cost, Prev: Depth limiting, Up: OPTIONS -2.12 Pivoting+2.14 Pivoting ============= Normally hledger sums amounts, and organizes them in a hierarchy, based@@ -635,7 +722,7 @@ File: hledger.info, Node: Cost, Next: Market value, Prev: Pivoting, Up: OPTIONS -2.13 Cost+2.15 Cost ========= The '-B/--cost' flag converts amounts to their cost at transaction time,@@ -644,7 +731,7 @@ File: hledger.info, Node: Market value, Next: Combining -B and -V, Prev: Cost, Up: OPTIONS -2.14 Market value+2.16 Market value ================= The '-V/--value' flag converts reported amounts to their current market@@ -696,7 +783,7 @@ File: hledger.info, Node: Combining -B and -V, Next: Output destination, Prev: Market value, Up: OPTIONS -2.15 Combining -B and -V+2.17 Combining -B and -V ======================== Using -B/-cost and -V/-value together is currently allowed, but the@@ -706,7 +793,7 @@ File: hledger.info, Node: Output destination, Next: Output format, Prev: Combining -B and -V, Up: OPTIONS -2.16 Output destination+2.18 Output destination ======================= Some commands (print, register, stats, the balance commands) can write@@ -719,7 +806,7 @@ File: hledger.info, Node: Output format, Next: Regular expressions, Prev: Output destination, Up: OPTIONS -2.17 Output format+2.19 Output format ================== Some commands can write their output in other formats. Eg print and@@ -733,7 +820,7 @@ File: hledger.info, Node: Regular expressions, Prev: Output format, Up: OPTIONS -2.18 Regular expressions+2.20 Regular expressions ======================== hledger uses regular expressions in a number of places:@@ -2419,7 +2506,7 @@ --------- hledger-irr calculates the internal rate of return of an investment-account.+account, but it's superseded now by the built-in roi command. File: hledger.info, Node: Experimental add-ons, Prev: Third party add-ons, Up: ADD-ON COMMANDS@@ -2467,142 +2554,152 @@ Tag Table: Node: Top68-Node: EXAMPLES1888-Ref: #examples1988-Node: OPTIONS3634-Ref: #options3736-Node: General options4101-Ref: #general-options4226-Node: Command options6908-Ref: #command-options7059-Node: Command arguments7457-Ref: #command-arguments7611-Node: Argument files7732-Ref: #argument-files7883-Node: Special characters8149-Ref: #special-characters8302-Node: Input files9721-Ref: #input-files9857-Node: Smart dates11827-Ref: #smart-dates11968-Node: Report start & end date13374-Ref: #report-start-end-date13544-Node: Report intervals14609-Ref: #report-intervals14772-Node: Period expressions15173-Ref: #period-expressions15333-Node: Depth limiting19290-Ref: #depth-limiting19434-Node: Pivoting19776-Ref: #pivoting19894-Node: Cost21570-Ref: #cost21678-Node: Market value21796-Ref: #market-value21931-Node: Combining -B and -V23297-Ref: #combining--b-and--v23460-Node: Output destination23607-Ref: #output-destination23769-Node: Output format24052-Ref: #output-format24204-Node: Regular expressions24589-Ref: #regular-expressions24726-Node: QUERIES26087-Ref: #queries26189-Node: COMMANDS30151-Ref: #commands30263-Node: accounts31263-Ref: #accounts31361-Node: activity32607-Ref: #activity32717-Node: add33077-Ref: #add33176-Node: balance35837-Ref: #balance35948-Node: Classic balance report39031-Ref: #classic-balance-report39204-Node: Customising the classic balance report40573-Ref: #customising-the-classic-balance-report40801-Node: Colour support42875-Ref: #colour-support43042-Node: Flat mode43215-Ref: #flat-mode43363-Node: Depth limited balance reports43776-Ref: #depth-limited-balance-reports43976-Node: Multicolumn balance report44432-Ref: #multicolumn-balance-report44630-Node: Budget report49810-Ref: #budget-report49953-Ref: #output-format-152987-Node: balancesheet53065-Ref: #balancesheet53201-Node: balancesheetequity55512-Ref: #balancesheetequity55661-Node: cashflow56198-Ref: #cashflow56326-Node: check-dates58449-Ref: #check-dates58576-Node: check-dupes58693-Ref: #check-dupes58817-Node: close58954-Ref: #close59062-Node: files59392-Ref: #files59493-Node: help59634-Ref: #help59734-Node: import60808-Ref: #import60922-Node: incomestatement61652-Ref: #incomestatement61786-Node: prices64190-Ref: #prices64305-Node: print64577-Ref: #print64687-Node: print-unique69581-Ref: #print-unique69707-Node: register69775-Ref: #register69902-Node: Custom register output74403-Ref: #custom-register-output74532-Node: register-match75762-Ref: #register-match75896-Node: rewrite76079-Ref: #rewrite76194-Node: roi76263-Ref: #roi76361-Node: stats76477-Ref: #stats76576-Node: tags77446-Ref: #tags77544-Node: test77780-Ref: #test77864-Node: ADD-ON COMMANDS78572-Ref: #add-on-commands78682-Node: Official add-ons79969-Ref: #official-add-ons80109-Node: api80196-Ref: #api80285-Node: ui80337-Ref: #ui80436-Node: web80494-Ref: #web80583-Node: Third party add-ons80629-Ref: #third-party-add-ons80804-Node: diff80939-Ref: #diff81036-Node: iadd81135-Ref: #iadd81249-Node: interest81332-Ref: #interest81453-Node: irr81548-Ref: #irr81646-Node: Experimental add-ons81724-Ref: #experimental-add-ons81876-Node: autosync82156-Ref: #autosync82267-Node: chart82506-Ref: #chart82625-Node: check82696-Ref: #check82798+Node: EXAMPLES1884+Ref: #examples1984+Node: OPTIONS3630+Ref: #options3732+Node: General options4167+Ref: #general-options4292+Node: Command options6974+Ref: #command-options7125+Node: Command arguments7523+Ref: #command-arguments7677+Node: Argument files7798+Ref: #argument-files7974+Node: Special characters in arguments and queries8240+Ref: #special-characters-in-arguments-and-queries8474+Node: More escaping8924+Ref: #more-escaping9086+Node: Even more escaping9382+Ref: #even-more-escaping9576+Node: Less escaping10247+Ref: #less-escaping10409+Node: Command line tips10654+Ref: #command-line-tips10840+Node: Unicode characters11217+Ref: #unicode-characters11373+Node: Input files12098+Ref: #input-files12234+Node: Smart dates14204+Ref: #smart-dates14345+Node: Report start & end date15751+Ref: #report-start-end-date15923+Node: Report intervals16988+Ref: #report-intervals17153+Node: Period expressions17554+Ref: #period-expressions17714+Node: Depth limiting21671+Ref: #depth-limiting21815+Node: Pivoting22157+Ref: #pivoting22275+Node: Cost23951+Ref: #cost24059+Node: Market value24177+Ref: #market-value24312+Node: Combining -B and -V25678+Ref: #combining--b-and--v25841+Node: Output destination25988+Ref: #output-destination26150+Node: Output format26433+Ref: #output-format26585+Node: Regular expressions26970+Ref: #regular-expressions27107+Node: QUERIES28468+Ref: #queries28570+Node: COMMANDS32532+Ref: #commands32644+Node: accounts33644+Ref: #accounts33742+Node: activity34988+Ref: #activity35098+Node: add35458+Ref: #add35557+Node: balance38218+Ref: #balance38329+Node: Classic balance report41412+Ref: #classic-balance-report41585+Node: Customising the classic balance report42954+Ref: #customising-the-classic-balance-report43182+Node: Colour support45256+Ref: #colour-support45423+Node: Flat mode45596+Ref: #flat-mode45744+Node: Depth limited balance reports46157+Ref: #depth-limited-balance-reports46357+Node: Multicolumn balance report46813+Ref: #multicolumn-balance-report47011+Node: Budget report52191+Ref: #budget-report52334+Ref: #output-format-155368+Node: balancesheet55446+Ref: #balancesheet55582+Node: balancesheetequity57893+Ref: #balancesheetequity58042+Node: cashflow58579+Ref: #cashflow58707+Node: check-dates60830+Ref: #check-dates60957+Node: check-dupes61074+Ref: #check-dupes61198+Node: close61335+Ref: #close61443+Node: files61773+Ref: #files61874+Node: help62015+Ref: #help62115+Node: import63189+Ref: #import63303+Node: incomestatement64033+Ref: #incomestatement64167+Node: prices66571+Ref: #prices66686+Node: print66958+Ref: #print67068+Node: print-unique71962+Ref: #print-unique72088+Node: register72156+Ref: #register72283+Node: Custom register output76784+Ref: #custom-register-output76913+Node: register-match78143+Ref: #register-match78277+Node: rewrite78460+Ref: #rewrite78575+Node: roi78644+Ref: #roi78742+Node: stats78858+Ref: #stats78957+Node: tags79827+Ref: #tags79925+Node: test80161+Ref: #test80245+Node: ADD-ON COMMANDS80953+Ref: #add-on-commands81063+Node: Official add-ons82350+Ref: #official-add-ons82490+Node: api82577+Ref: #api82666+Node: ui82718+Ref: #ui82817+Node: web82875+Ref: #web82964+Node: Third party add-ons83010+Ref: #third-party-add-ons83185+Node: diff83320+Ref: #diff83417+Node: iadd83516+Ref: #iadd83630+Node: interest83713+Ref: #interest83834+Node: irr83929+Ref: #irr84027+Node: Experimental add-ons84158+Ref: #experimental-add-ons84310+Node: autosync84590+Ref: #autosync84701+Node: chart84940+Ref: #chart85059+Node: check85130+Ref: #check85232 End Tag Table
embeddedfiles/hledger.txt view
@@ -238,42 +238,99 @@ prevent this expansion of @-arguments, precede them with a -- argument. For more, see Save frequently used options. - Special characters- Option and argument values which contain problematic characters should- be escaped with double quotes, backslashes, or (best) single quotes.- Problematic characters means spaces, and also characters which are sig-- nificant to your command shell, such as less-than/greater-than. Eg:+ Special characters in arguments and queries+ In shell command lines, option and argument values which contain "prob-+ lematic" characters, ie spaces, and also characters significant to your+ shell such as <, >, (, ), | and $, should be escaped by enclosing them+ in quotes or by writing backslashes before the characters. Eg:+ hledger register -p 'last year' "accounts receivable (receiv- able|payable)" amt:\>100. - Characters which are significant both to the shell and in regular- expressions sometimes need to be double-escaped. These include paren-- theses, the pipe symbol and the dollar sign. Eg, to match the dollar- symbol, bash users should do: hledger balance cur:'\$' or hledger bal-- ance cur:\\$.+ More escaping+ Characters significant both to the shell and in regular expressions may+ need one extra level of escaping. These include parentheses, the pipe+ symbol and the dollar sign. Eg, to match the dollar symbol, bash users+ should do: - When hledger is invoking an addon executable (like hledger-ui), options- and arguments get de-escaped once more, so you might need triple-escap-- ing. Eg: hledger ui cur:'\\$' or hledger ui cur:\\\\$ in bash. (The- number of backslashes in fish shell is left as an exercise for the+ hledger balance cur:'\$'++ or:++ hledger balance cur:\\$++ Even more escaping+ When hledger runs an addon executable (eg you type hledger ui, hledger+ runs hledger-ui), it de-escapes command-line options and arguments+ once, so you might need to triple-escape. Eg in bash, running the ui+ command and matching the dollar sign, it's:++ hledger ui cur:'\\$'++ or:++ hledger ui cur:\\\\$++ If you asked why four slashes above, this may help:+++ unescaped: $+ escaped: \$+ double-escaped: \\$+ triple-escaped: \\\\$++ (The number of backslashes in fish shell is left as an exercise for the reader.) - Inside a file used for argument expansion, one less level of escaping- is enough. (And in this case, backslashes seem to work better than- quotes. Eg: cur:\$).+ You can always avoid the extra escaping for addons by running the addon+ directly: + hledger-ui cur:\\$++ Less escaping+ Inside an argument file, or in the search field of hledger-ui or+ hledger-web, or at a GHCI prompt, you need one less level of escaping+ than at the command line. And backslashes may work better than quotes.+ Eg:++ ghci> :main balance cur:\$++ Command line tips If in doubt, keep things simple: - o run add-on executables directly+ o write options after the command (hledger CMD -OPTIONS ARGS) - o write options after the command+ o run add-on executables directly (hledger-ui -OPTIONS ARGS) o enclose problematic args in single quotes o if needed, also add a backslash to escape regexp metacharacters - If you're really stumped, add --debug=2 to troubleshoot.+ To find out exactly how a command line is being parsed, add --debug=2+ to troubleshoot. + Unicode characters+ hledger is expected to handle unicode (non-ascii) characters, but this+ requires a well-configured environment.++ To handle unicode characters in the command line or input data, a sys-+ tem locale that can decode them must be configured (POSIX's default C+ locale will not work). Eg in bash, you could do:++ export LANG=en_US.UTF-8++ See Troubleshooting for more about this.++ Unicode characters should appear correctly in hledger's output. For+ the hledger and hledger-ui tools, this requires that++ o your terminal supports unicode++ o the terminal's font includes the required unicode glyphs++ o the terminal is configured to display "wide" characters as double+ width (otherwise report alignment will be off)+ Input files hledger reads transactions from a data file (and the add command writes to it). By default this file is $HOME/.hledger.journal (or on Windows,@@ -340,6 +397,7 @@ 4+ digits, month is 1-12, day is 1-31 2004 start of year+ 2004/10 start of month 10/1 month and day in current year@@ -397,7 +455,6 @@ rent month -p thismonth all transactions in the current month- date:2016/3/17- the above written as queries instead date:-12/1@@ -531,7 +588,6 @@ -p "every 2nd Monday" - period bound- aries will be on second Monday of each month- -p "every 11/05" - yearly periods with boundaries on 5th of Nov -p "every 5th Nov" - same@@ -2094,7 +2150,7 @@ irr hledger-irr calculates the internal rate of return of an investment- account.+ account, but it's superseded now by the built-in roi command. Experimental add-ons These are available in source form in the hledger repo's bin/ direc-@@ -2230,4 +2286,4 @@ -hledger 1.11.1 September 2018 hledger(1)+hledger 1.12 December 2018 hledger(1)
embeddedfiles/hledger_csv.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_csv" "5" "September 2018" "hledger 1.11.1" "hledger User Manuals"+.TH "hledger_csv" "5" "December 2018" "hledger 1.12" "hledger User Manuals"
embeddedfiles/hledger_csv.info view
@@ -3,8 +3,8 @@ File: hledger_csv.info, Node: Top, Next: CSV RULES, Up: (dir) -hledger_csv(5) hledger 1.11.1-*****************************+hledger_csv(5) hledger 1.12+*************************** hledger can read CSV (comma-separated value) files as if they were journal files, automatically converting each CSV record into a@@ -317,33 +317,33 @@ Tag Table: Node: Top72-Node: CSV RULES2167-Ref: #csv-rules2275-Node: skip2537-Ref: #skip2631-Node: date-format2803-Ref: #date-format2930-Node: field list3436-Ref: #field-list3573-Node: field assignment4278-Ref: #field-assignment4433-Node: conditional block4937-Ref: #conditional-block5091-Node: include5987-Ref: #include6117-Node: newest-first6348-Ref: #newest-first6462-Node: CSV TIPS6873-Ref: #csv-tips6967-Node: CSV ordering7085-Ref: #csv-ordering7203-Node: CSV accounts7384-Ref: #csv-accounts7522-Node: CSV amounts7776-Ref: #csv-amounts7922-Node: CSV balance assertions8697-Ref: #csv-balance-assertions8879-Node: Reading multiple CSV files9084-Ref: #reading-multiple-csv-files9254+Node: CSV RULES2163+Ref: #csv-rules2271+Node: skip2533+Ref: #skip2627+Node: date-format2799+Ref: #date-format2926+Node: field list3432+Ref: #field-list3569+Node: field assignment4274+Ref: #field-assignment4429+Node: conditional block4933+Ref: #conditional-block5087+Node: include5983+Ref: #include6113+Node: newest-first6344+Ref: #newest-first6458+Node: CSV TIPS6869+Ref: #csv-tips6963+Node: CSV ordering7081+Ref: #csv-ordering7199+Node: CSV accounts7380+Ref: #csv-accounts7518+Node: CSV amounts7772+Ref: #csv-amounts7918+Node: CSV balance assertions8693+Ref: #csv-balance-assertions8875+Node: Reading multiple CSV files9080+Ref: #reading-multiple-csv-files9250 End Tag Table
embeddedfiles/hledger_csv.txt view
@@ -249,4 +249,4 @@ -hledger 1.11.1 September 2018 hledger_csv(5)+hledger 1.12 December 2018 hledger_csv(5)
embeddedfiles/hledger_journal.5 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger_journal" "5" "September 2018" "hledger 1.11.1" "hledger User Manuals"+.TH "hledger_journal" "5" "December 2018" "hledger 1.12" "hledger User Manuals" @@ -547,16 +547,57 @@ The asserted balance must be a simple single\-commodity amount, and in fact the assertion checks only this commodity's balance within the (possibly multi\-commodity) account balance.-We could call this a partial balance assertion.-This is compatible with Ledger, and makes it possible to make assertions-about accounts containing multiple commodities.+.PD 0+.P+.PD+This is how assertions work in Ledger also.+We could call this a \[lq]partial\[rq] balance assertion. .PP-To assert each commodity's balance in such a multi\-commodity account,-you can add multiple postings (with amount 0 if necessary).-But note that no matter how many assertions you add, you can't be sure-the account does not contain some unexpected commodity.-(We'll add support for this kind of total balance assertion if there's-demand.)+To assert the balance of more than one commodity in an account, you can+write multiple postings, each asserting one commodity's balance.+.PP+You can make a stronger kind of balance assertion, by writing a double+equals sign (\f[C]==EXPECTEDBALANCE\f[]).+This \[lq]complete\[rq] balance assertion asserts the absence of other+commodities (or, that their balance is 0, which to hledger is+equivalent.)+.IP+.nf+\f[C]+2013/1/1+\ \ a\ \ \ $1+\ \ a\ \ \ \ 1€+\ \ b\ \ $\-1+\ \ c\ \ \ \-1€++2013/1/2\ \ ;\ These\ assertions\ succeed+\ \ a\ \ \ \ 0\ \ =\ \ $1+\ \ a\ \ \ \ 0\ \ =\ \ \ 1€+\ \ b\ \ \ \ 0\ ==\ $\-1+\ \ c\ \ \ \ 0\ ==\ \ \-1€++2013/1/3\ \ ;\ This\ assertion\ fails\ as\ \[aq]a\[aq]\ also\ contains\ 1€+\ \ a\ \ \ \ 0\ ==\ \ $1+\f[]+.fi+.PP+It's not yet possible to make a complete assertion about a balance that+has multiple commodities.+One workaround is to isolate each commodity into its own subaccount:+.IP+.nf+\f[C]+2013/1/1+\ \ a:usd\ \ \ $1+\ \ a:euro\ \ \ 1€+\ \ b++2013/1/2+\ \ a\ \ \ \ \ \ \ \ 0\ ==\ \ 0+\ \ a:usd\ \ \ \ 0\ ==\ $1+\ \ a:euro\ \ \ 0\ ==\ \ 1€+\f[]+.fi .SS Assertions and subaccounts .PP Balance assertions do not count the balance from subaccounts; they check@@ -853,10 +894,9 @@ T}@T{ any text T}@T{-declare an account name & optional account code+document account names, declare account types & display order T}@T{-account code: balance reports (except \f[C]balance\f[] single\-column-mode)+all entries in all files, before or after T} T{ \f[C]alias\f[]@@ -951,13 +991,8 @@ T{ subdirective T}@T{-optional indented directive or unparsed text lines immediately following-a parent directive-T}-T{-account code-T}@T{-numeric code influencing account display order in most balance reports+optional indented directive line immediately following a parent+directive T} T{ number notation@@ -1143,58 +1178,108 @@ to another commodity using these prices. .SS Declaring accounts .PP-The \f[C]account\f[] directive predeclares account names.-The simplest form is \f[C]account\ ACCTNAME\f[], eg:+\f[C]account\f[] directives can be used to pre\-declare some or all+accounts.+Though not required, they can provide several benefits:+.IP \[bu] 2+They can document your intended chart of accounts, providing a+reference.+.IP \[bu] 2+They can store extra information about accounts (account numbers, notes,+etc.)+.IP \[bu] 2+They can help hledger know your accounts' types (asset, liability,+equity, revenue, expense), useful for reports like balancesheet and+incomestatement.+.IP \[bu] 2+They control account display order in reports, allowing non\-alphabetic+sorting (eg Revenues to appear above Expenses).+.IP \[bu] 2+They help with account name completion in the add command,+hledger\-iadd, hledger\-web, ledger\-mode etc.+.PP+Here is the full syntax: .IP .nf \f[C]+account\ ACCTNAME\ \ [ACCTTYPE]+\ \ [COMMENTS]+\f[]+.fi+.PP+The simplest form just declares a hledger\-style account name, eg:+.IP+.nf+\f[C] account\ assets:bank:checking \f[] .fi+.SS Account types .PP-Currently this mainly helps with account name autocompletion in eg-hledger add, hledger\-iadd, hledger\-web, and ledger\-mode.-.PD 0-.P-.PD-In future it will also help detect misspelled accounts.+hledger recognises five types of account: asset, liability, equity,+revenue, expense.+This is useful for certain accounting\-aware reports, in particular+balancesheet, incomestatement and cashflow. .PP-An account directive can also have indented subdirectives following it,-which are currently ignored.-Here is the full syntax:+If you name your top\-level accounts with some variation of+\f[C]assets\f[], \f[C]liabilities\f[]/\f[C]debts\f[], \f[C]equity\f[],+\f[C]revenues\f[]/\f[C]income\f[], or \f[C]expenses\f[], their types are+detected automatically.+.PP+More generally, you can declare an account's type by adding one of the+letters \f[C]ALERX\f[] to its account directive, separated from the+account name by two or more spaces.+Eg: .IP .nf \f[C]-;\ account\ ACCTNAME-;\ \ \ [OPTIONALSUBDIRECTIVES]+account\ assets\ \ \ \ \ \ \ A+account\ liabilities\ \ L+account\ equity\ \ \ \ \ \ \ E+account\ revenues\ \ \ \ \ R+account\ expenses\ \ \ \ \ X+\f[]+.fi+.PP+Note: if you ever override the types of those auto\-detected english+account names mentioned above, you might need to help the reports a bit:+.IP+.nf+\f[C]+;\ make\ "liabilities"\ not\ have\ the\ liability\ type,\ who\ knows\ why+account\ liabilities\ \ \ E -account\ assets:bank:checking-\ \ a\ comment-\ \ some\-tag:12345+;\ better\ ensure\ some\ other\ account\ has\ the\ liability\ type,\ +;\ otherwise\ balancesheet\ would\ still\ show\ "liabilities"\ under\ Liabilities\ +account\ \-\ \ \ \ \ \ \ \ \ \ \ \ \ L \f[] .fi-.SS Account display order .PP-Account directives have another purpose: they set the order in which-accounts are displayed, in hledger reports, hledger\-ui accounts screen,-hledger\-web sidebar etc.-For example, say you have these top\-level accounts:+)+.SS Account comments+.PP+An account directive can also have indented comments on following lines,+eg: .IP .nf \f[C]-$\ accounts\ \-1-assets-equity-expenses-liabilities-misc-other-revenues+account\ assets:bank:checking+\ \ ;\ acctno:12345+\ \ ;\ a\ comment \f[] .fi .PP-By default, they are displayed in alphabetical order.-But if you add the following account directives to the journal:+We also allow (and ignore) Ledger\-style subdirectives, with no leading+semicolon, for compatibility.+.PP+Tags in account comments, like \f[C]acctno\f[] above, currently have no+effect.+.SS Account display order+.PP+Account directives also set the order in which accounts are displayed in+reports, the hledger\-ui accounts screen, the hledger\-web sidebar, etc.+Normally accounts are listed in alphabetical order, but if you have eg+these account directives in the journal: .IP .nf \f[C]@@ -1206,27 +1291,25 @@ \f[] .fi .PP-the display order changes to:+you'll see those accounts listed in declaration order, not+alphabetically: .IP .nf \f[C]-$\ accounts\ \-1+$\ hledger\ accounts\ \-1 assets liabilities equity revenues expenses-misc-other \f[] .fi .PP-Ie, declared accounts first, in the order they were declared, followed-by any undeclared accounts in alphabetic order.+Undeclared accounts, if any, are displayed last, in alphabetical order. .PP Note that sorting is done at each level of the account tree (within each group of sibling accounts under the same parent).-This directive:+And currently, this directive: .IP .nf \f[C]@@ -1237,6 +1320,10 @@ would influence the position of \f[C]zoo\f[] among \f[C]other\f[]'s subaccounts, but not the position of \f[C]other\f[] among the top\-level accounts.+This means: \- you will sometimes declare parent accounts (eg+\f[C]account\ other\f[] above) that you don't intend to post to, just to+customize their display order \- sibling accounts stay together (you+couldn't display \f[C]x:y\f[] in between \f[C]a:b\f[] and \f[C]a:c\f[]). .SS Rewriting accounts .PP You can define account alias rules which rewrite your account names, or@@ -1419,16 +1506,25 @@ Eg \f[C]monthly\ from\ 2018/1/1\f[] is valid, but \f[C]monthly\ from\ 2018/1/15\f[] is not. .PP-If you write a transaction description or same\-line comment, it must be-separated from the period expression by \f[B]two or more spaces\f[].-Eg:+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.+.PP+Period expressions must be terminated by \f[B]two or more spaces\f[] if+followed by additional fields.+For example, the periodic transaction given below includes a transaction+description \[lq]paycheck\[rq], which is separated from the period+expression by a double space.+If not for the second space, hledger would attempt (and fail) to parse+\[lq]paycheck\[rq] as a part of the period expression. .IP .nf \f[C]-;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\ or\ more\ spaces-;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ||-;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ vv-~\ every\ 2\ weeks\ from\ 2018/6\ to\ 2018/9\ \ paycheck+;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2\ or\ more\ spaces+;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ||+;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ vv+~\ every\ 2\ weeks\ from\ 2018/6/4\ to\ 2018/9\ \ paycheck \ \ \ \ assets:bank:checking\ \ \ $1500 \ \ \ \ income:acme\ inc \f[]@@ -1495,50 +1591,81 @@ \[lq]automated postings\[rq]). Transaction modifiers are enabled by the \f[C]\-\-auto\f[] flag. .PP-A transaction modifier rule looks a bit like a normal journal entry,-except the first line is an equal sign (\f[C]=\f[]) followed by a query-(mnemonic: \f[C]=\f[] suggests matching something.):+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: \f[C]=\f[] suggests matching).+And each \[lq]posting\[rq] is actually a posting\-generating rule: .IP .nf \f[C]-=\ expenses:gifts-\ \ \ \ budget:gifts\ \ *\-1-\ \ \ \ assets:budget\ \ *1+=\ QUERY+\ \ \ \ ACCT\ \ AMT+\ \ \ \ ACCT\ \ [AMT]+\ \ \ \ ... \f[] .fi .PP-The posting amounts can be of the form \f[C]*N\f[], which means \[lq]the-amount of the matched transaction's first posting, multiplied by N\[rq].-They can also be ordinary fixed amounts.-Fixed amounts with no commodity symbol will be given the same commodity-as the matched transaction's first posting.+The posting rules look just like normal postings, except the amount can+be:+.IP \[bu] 2+a normal amount with a commodity symbol, eg \f[C]$2\f[].+This will be used as\-is.+.IP \[bu] 2+a number, eg \f[C]2\f[].+The commodity symbol (if any) from the matched posting will be added to+this.+.IP \[bu] 2+a numeric multiplier, eg \f[C]*2\f[] (a star followed by a number N).+The matched posting's amount (and total price, if any) will be+multiplied by N.+.IP \[bu] 2+a multiplier with a commodity symbol, eg \f[C]*$2\f[] (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. .PP-This example adds a corresponding (unbalanced) budget posting to every-transaction involving the \f[C]expenses:gifts\f[] account:+Some examples: .IP .nf \f[C]+;\ every\ time\ I\ buy\ food,\ schedule\ a\ dollar\ donation+=\ expenses:food+\ \ \ \ (liabilities:charity)\ \ \ $\-1++;\ when\ I\ buy\ a\ gift,\ also\ deduct\ that\ amount\ from\ a\ budget\ envelope\ subaccount =\ expenses:gifts-\ \ \ \ (budget:gifts)\ \ *\-1+\ \ \ \ assets:checking:gifts\ \ *\-1+\ \ \ \ assets:checking\ \ \ \ \ \ \ \ \ *1 -2017\-12\-14-\ \ expenses:gifts\ \ $20-\ \ assets+2017/12/1+\ \ expenses:food\ \ \ \ $10+\ \ assets:checking++2017/12/14+\ \ expenses:gifts\ \ \ $20+\ \ assets:checking \f[] .fi .IP .nf \f[C] $\ hledger\ print\ \-\-auto+2017/12/01+\ \ \ \ expenses:food\ \ \ \ \ \ \ \ \ \ \ \ \ \ $10+\ \ \ \ assets:checking+\ \ \ \ (liabilities:charity)\ \ \ \ \ \ $\-1+ 2017/12/14 \ \ \ \ expenses:gifts\ \ \ \ \ \ \ \ \ \ \ \ \ $20-\ \ \ \ (budget:gifts)\ \ \ \ \ \ \ \ \ \ \ \ $\-20-\ \ \ \ assets+\ \ \ \ assets:checking+\ \ \ \ assets:checking:gifts\ \ \ \ \ \-$20+\ \ \ \ assets:checking\ \ \ \ \ \ \ \ \ \ \ \ $20 \f[] .fi .PP-Like postings recorded by hand, automated postings participate in-transaction balancing, missing amount inference and balance assertions.+Postings added by transaction modifiers participate in transaction+balancing, missing amount inference and balance assertions, like regular+postings. .SH EDITOR SUPPORT .PP Add\-on modes exist for various text editors, to make working with
embeddedfiles/hledger_journal.info view
@@ -4,8 +4,8 @@ File: hledger_journal.info, Node: Top, Next: FILE FORMAT, Up: (dir) -hledger_journal(5) hledger 1.11.1-*********************************+hledger_journal(5) hledger 1.12+******************************* hledger's usual data source is a plain text file containing journal entries in hledger journal format. This file represents a standard@@ -524,17 +524,47 @@ The asserted balance must be a simple single-commodity amount, and in fact the assertion checks only this commodity's balance within the-(possibly multi-commodity) account balance. We could call this a-partial balance assertion. This is compatible with Ledger, and makes it-possible to make assertions about accounts containing multiple-commodities.+(possibly multi-commodity) account balance.+This is how assertions work in Ledger also. We could call this a+"partial" balance assertion. - To assert each commodity's balance in such a multi-commodity account,-you can add multiple postings (with amount 0 if necessary). But note-that no matter how many assertions you add, you can't be sure the-account does not contain some unexpected commodity. (We'll add support-for this kind of total balance assertion if there's demand.)+ 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.)++2013/1/1+ a $1+ a 1€+ b $-1+ c -1€++2013/1/2 ; These assertions succeed+ a 0 = $1+ a 0 = 1€+ b 0 == $-1+ c 0 == -1€++2013/1/3 ; This assertion fails as 'a' also contains 1€+ 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 into its own subaccount:++2013/1/1+ a:usd $1+ a:euro 1€+ b++2013/1/2+ a 0 == 0+ a:usd 0 == $1+ a:euro 0 == 1€+ File: hledger_journal.info, Node: Assertions and subaccounts, Next: Assertions and virtual postings, Prev: Assertions and commodities, Up: Balance Assertions @@ -766,11 +796,9 @@ directiveend subdirectivespurpose can affect (as of directive 2018/06) ------------------------------------------------------------------------------'account' any declare an account name & account code:- text optional account code balance reports- (except 'balance'- single-column- mode)+'account' any document account names, all entries in+ text declare account types & all files, before+ display order or after 'alias' 'end rewrite account names following aliases' inline/included entries until end@@ -821,10 +849,8 @@ And some definitions: -subdirectiveoptional indented directive or unparsed text lines- immediately following a parent directive-account numeric code influencing account display order in most-code balance reports+subdirectiveoptional indented directive line immediately following a+ parent 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@@ -853,7 +879,6 @@ * Default commodity:: * Market prices:: * Declaring accounts::-* Account display order:: * Rewriting accounts:: * Default parent account:: @@ -1003,85 +1028,143 @@ another commodity using these prices. -File: hledger_journal.info, Node: Declaring accounts, Next: Account display order, Prev: Market prices, Up: Directives+File: hledger_journal.info, Node: Declaring accounts, Next: Rewriting accounts, Prev: Market prices, Up: Directives 1.14.7 Declaring accounts ------------------------- -The 'account' directive predeclares account names. The simplest form is-'account ACCTNAME', eg:+'account' directives can be used to pre-declare some or all accounts.+Though not required, they can provide several benefits: -account assets:bank:checking+ * They can document your intended chart of accounts, providing a+ reference.+ * They can store extra information about accounts (account numbers,+ notes, etc.)+ * They can help hledger know your accounts' types (asset, liability,+ equity, revenue, expense), useful for reports like balancesheet and+ incomestatement.+ * They control account display order in reports, allowing+ non-alphabetic sorting (eg Revenues to appear above Expenses).+ * They help with account name completion in the add command,+ hledger-iadd, hledger-web, ledger-mode etc. - Currently this mainly helps with account name autocompletion in eg-hledger add, hledger-iadd, hledger-web, and ledger-mode.-In future it will also help detect misspelled accounts.+ Here is the full syntax: - An account directive can also have indented subdirectives following-it, which are currently ignored. Here is the full syntax:+account ACCTNAME [ACCTTYPE]+ [COMMENTS] -; account ACCTNAME-; [OPTIONALSUBDIRECTIVES]+ The simplest form just declares a hledger-style account name, eg: account assets:bank:checking- a comment- some-tag:12345 +* Menu:++* Account types::+* Account comments::+* Account display order::+ -File: hledger_journal.info, Node: Account display order, Next: Rewriting accounts, Prev: Declaring accounts, Up: Directives+File: hledger_journal.info, Node: Account types, Next: Account comments, Up: Declaring accounts -1.14.8 Account display order-----------------------------+1.14.7.1 Account types+...................... -Account directives have another purpose: they set the order in which-accounts are displayed, in hledger reports, hledger-ui accounts screen,-hledger-web sidebar etc. For example, say you have these top-level-accounts:+hledger recognises five types of account: asset, liability, equity,+revenue, expense. This is useful for certain accounting-aware reports,+in particular balancesheet, incomestatement and cashflow. -$ accounts -1-assets-equity-expenses-liabilities-misc-other-revenues+ If you name your top-level accounts with some variation of 'assets',+'liabilities'/'debts', 'equity', 'revenues'/'income', or 'expenses',+their types are detected automatically. - By default, they are displayed in alphabetical order. But if you add-the following account directives to the journal:+ More generally, you can declare an account's type by adding one of+the letters 'ALERX' to its account directive, separated from the account+name by two or more spaces. Eg: +account assets A+account liabilities L+account equity E+account revenues R+account expenses X++ Note: if you ever override the types of those auto-detected english+account names mentioned above, you might need to help the reports a bit:++; make "liabilities" not have the liability type, who knows why+account liabilities E++; better ensure some other account has the liability type, +; otherwise balancesheet would still show "liabilities" under Liabilities +account - L++ )+++File: hledger_journal.info, Node: Account comments, Next: Account display order, Prev: Account types, Up: Declaring accounts++1.14.7.2 Account comments+.........................++An account directive can also have indented comments on following lines,+eg:++account assets:bank:checking+ ; acctno:12345+ ; a comment++ We also allow (and ignore) Ledger-style subdirectives, with no+leading semicolon, for compatibility.++ Tags in account comments, like 'acctno' above, currently have no+effect.+++File: hledger_journal.info, Node: Account display order, Prev: Account comments, Up: Declaring accounts++1.14.7.3 Account display order+..............................++Account directives also set the order in which accounts are displayed in+reports, the hledger-ui accounts screen, the hledger-web sidebar, etc.+Normally accounts are listed in alphabetical order, but if you have eg+these account directives in the journal:+ account assets account liabilities account equity account revenues account expenses - the display order changes to:+ you'll see those accounts listed in declaration order, not+alphabetically: -$ accounts -1+$ hledger accounts -1 assets liabilities equity revenues expenses-misc-other - Ie, declared accounts first, in the order they were declared,-followed by any undeclared accounts in alphabetic order.+ 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). This directive:+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.+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'). -File: hledger_journal.info, Node: Rewriting accounts, Next: Default parent account, Prev: Account display order, Up: Directives+File: hledger_journal.info, Node: Rewriting accounts, Next: Default parent account, Prev: Declaring accounts, Up: Directives -1.14.9 Rewriting accounts+1.14.8 Rewriting accounts ------------------------- You can define account alias rules which rewrite your account names, or@@ -1109,7 +1192,7 @@ File: hledger_journal.info, Node: Basic aliases, Next: Regex aliases, Up: Rewriting accounts -1.14.9.1 Basic aliases+1.14.8.1 Basic aliases ...................... To set an account alias, use the 'alias' directive in your journal file.@@ -1132,7 +1215,7 @@ File: hledger_journal.info, Node: Regex aliases, Next: Multiple aliases, Prev: Basic aliases, Up: Rewriting accounts -1.14.9.2 Regex aliases+1.14.8.2 Regex aliases ...................... There is also a more powerful variant that uses a regular expression,@@ -1157,7 +1240,7 @@ File: hledger_journal.info, Node: Multiple aliases, Next: end aliases, Prev: Regex aliases, Up: Rewriting accounts -1.14.9.3 Multiple aliases+1.14.8.3 Multiple aliases ......................... You can define as many aliases as you like using directives or@@ -1173,7 +1256,7 @@ File: hledger_journal.info, Node: end aliases, Prev: Multiple aliases, Up: Rewriting accounts -1.14.9.4 'end aliases'+1.14.8.4 'end aliases' ...................... You can clear (forget) all currently defined aliases with the 'end@@ -1184,8 +1267,8 @@ File: hledger_journal.info, Node: Default parent account, Prev: Rewriting accounts, Up: Directives -1.14.10 Default parent account-------------------------------+1.14.9 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 'end apply@@ -1245,13 +1328,22 @@ 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. - If you write a transaction description or same-line comment, it must-be separated from the period expression by *two or more spaces*. Eg:+ 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. -; 2 or more spaces-; ||-; vv-~ every 2 weeks from 2018/6 to 2018/9 paycheck+ Period expressions must be terminated by *two or more spaces* if+followed by additional fields. For example, the periodic transaction+given below includes a transaction description "paycheck", which is+separated from the period expression by a double space. If not for the+second space, hledger would attempt (and fail) to parse "paycheck" as a+part of the period expression.++; 2 or more spaces+; ||+; vv+~ every 2 weeks from 2018/6/4 to 2018/9 paycheck assets:bank:checking $1500 income:acme inc @@ -1330,38 +1422,64 @@ extra postings (also known as "automated postings"). Transaction modifiers are enabled by the '--auto' flag. - A transaction modifier rule looks a bit like a normal journal entry,-except the first line is an equal sign ('=') followed by a query-(mnemonic: '=' suggests matching something.):+ 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: -= expenses:gifts- budget:gifts *-1- assets:budget *1+= QUERY+ ACCT AMT+ ACCT [AMT]+ ... - The posting amounts can be of the form '*N', which means "the amount-of the matched transaction's first posting, multiplied by N". They can-also be ordinary fixed amounts. Fixed amounts with no commodity symbol-will be given the same commodity as the matched transaction's first-posting.+ The posting rules look just like normal postings, except the amount+can be: - This example adds a corresponding (unbalanced) budget posting to-every transaction involving the 'expenses:gifts' account:+ * a normal amount with a commodity symbol, eg '$2'. This will be+ used as-is.+ * a number, eg '2'. The commodity symbol (if any) from the matched+ posting will be added to this.+ * 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.+ * 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. + Some examples:++; every time I buy food, schedule a dollar donation+= expenses:food+ (liabilities:charity) $-1++; when I buy a gift, also deduct that amount from a budget envelope subaccount = expenses:gifts- (budget:gifts) *-1+ assets:checking:gifts *-1+ assets:checking *1 -2017-12-14- expenses:gifts $20- assets+2017/12/1+ expenses:food $10+ assets:checking +2017/12/14+ expenses:gifts $20+ assets:checking+ $ hledger print --auto+2017/12/01+ expenses:food $10+ assets:checking+ (liabilities:charity) $-1+ 2017/12/14 expenses:gifts $20- (budget:gifts) $-20- assets+ assets:checking+ assets:checking:gifts -$20+ assets:checking $20 - Like postings recorded by hand, automated postings participate in-transaction balancing, missing amount inference and balance assertions.+ Postings added by transaction modifiers participate in transaction+balancing, missing amount inference and balance assertions, like regular+postings. File: hledger_journal.info, Node: EDITOR SUPPORT, Prev: FILE FORMAT, Up: Top@@ -1393,93 +1511,97 @@ Tag Table: Node: Top76-Node: FILE FORMAT2376-Ref: #file-format2500-Node: Transactions2787-Ref: #transactions2908-Node: Postings3592-Ref: #postings3719-Node: Dates4714-Ref: #dates4829-Node: Simple dates4894-Ref: #simple-dates5020-Node: Secondary dates5386-Ref: #secondary-dates5540-Node: Posting dates7103-Ref: #posting-dates7232-Node: Status8606-Ref: #status8726-Node: Description10434-Ref: #description10572-Node: Payee and note10891-Ref: #payee-and-note11005-Node: Account names11247-Ref: #account-names11390-Node: Amounts11877-Ref: #amounts12013-Node: Virtual Postings15030-Ref: #virtual-postings15189-Node: Balance Assertions16409-Ref: #balance-assertions16584-Node: Assertions and ordering17480-Ref: #assertions-and-ordering17666-Node: Assertions and included files18366-Ref: #assertions-and-included-files18607-Node: Assertions and multiple -f options18940-Ref: #assertions-and-multiple--f-options19194-Node: Assertions and commodities19326-Ref: #assertions-and-commodities19561-Node: Assertions and subaccounts20257-Ref: #assertions-and-subaccounts20489-Node: Assertions and virtual postings21010-Ref: #assertions-and-virtual-postings21217-Node: Balance Assignments21359-Ref: #balance-assignments21540-Node: Transaction prices22660-Ref: #transaction-prices22829-Node: Comments25097-Ref: #comments25231-Node: Tags26401-Ref: #tags26519-Node: Directives27921-Ref: #directives28064-Node: Comment blocks33946-Ref: #comment-blocks34091-Node: Including other files34267-Ref: #including-other-files34447-Node: Default year34855-Ref: #default-year35024-Node: Declaring commodities35447-Ref: #declaring-commodities35630-Node: Default commodity36857-Ref: #default-commodity37033-Node: Market prices37669-Ref: #market-prices37834-Node: Declaring accounts38675-Ref: #declaring-accounts38854-Node: Account display order39404-Ref: #account-display-order39594-Node: Rewriting accounts40615-Ref: #rewriting-accounts40803-Node: Basic aliases41537-Ref: #basic-aliases41683-Node: Regex aliases42387-Ref: #regex-aliases42558-Node: Multiple aliases43276-Ref: #multiple-aliases43451-Node: end aliases43949-Ref: #end-aliases44096-Node: Default parent account44197-Ref: #default-parent-account44365-Node: Periodic transactions45249-Ref: #periodic-transactions45431-Node: Forecasting with periodic transactions46642-Ref: #forecasting-with-periodic-transactions46885-Node: Budgeting with periodic transactions48572-Ref: #budgeting-with-periodic-transactions48811-Node: Transaction Modifiers49270-Ref: #transaction-modifiers49433-Node: EDITOR SUPPORT50689-Ref: #editor-support50807+Node: FILE FORMAT2372+Ref: #file-format2496+Node: Transactions2783+Ref: #transactions2904+Node: Postings3588+Ref: #postings3715+Node: Dates4710+Ref: #dates4825+Node: Simple dates4890+Ref: #simple-dates5016+Node: Secondary dates5382+Ref: #secondary-dates5536+Node: Posting dates7099+Ref: #posting-dates7228+Node: Status8602+Ref: #status8722+Node: Description10430+Ref: #description10568+Node: Payee and note10887+Ref: #payee-and-note11001+Node: Account names11243+Ref: #account-names11386+Node: Amounts11873+Ref: #amounts12009+Node: Virtual Postings15026+Ref: #virtual-postings15185+Node: Balance Assertions16405+Ref: #balance-assertions16580+Node: Assertions and ordering17476+Ref: #assertions-and-ordering17662+Node: Assertions and included files18362+Ref: #assertions-and-included-files18603+Node: Assertions and multiple -f options18936+Ref: #assertions-and-multiple--f-options19190+Node: Assertions and commodities19322+Ref: #assertions-and-commodities19557+Node: Assertions and subaccounts20745+Ref: #assertions-and-subaccounts20977+Node: Assertions and virtual postings21498+Ref: #assertions-and-virtual-postings21705+Node: Balance Assignments21847+Ref: #balance-assignments22028+Node: Transaction prices23148+Ref: #transaction-prices23317+Node: Comments25585+Ref: #comments25719+Node: Tags26889+Ref: #tags27007+Node: Directives28409+Ref: #directives28552+Node: Comment blocks34159+Ref: #comment-blocks34304+Node: Including other files34480+Ref: #including-other-files34660+Node: Default year35068+Ref: #default-year35237+Node: Declaring commodities35660+Ref: #declaring-commodities35843+Node: Default commodity37070+Ref: #default-commodity37246+Node: Market prices37882+Ref: #market-prices38047+Node: Declaring accounts38888+Ref: #declaring-accounts39064+Node: Account types40021+Ref: #account-types40170+Node: Account comments41244+Ref: #account-comments41429+Node: Account display order41750+Ref: #account-display-order41923+Node: Rewriting accounts43045+Ref: #rewriting-accounts43230+Node: Basic aliases43964+Ref: #basic-aliases44110+Node: Regex aliases44814+Ref: #regex-aliases44985+Node: Multiple aliases45703+Ref: #multiple-aliases45878+Node: end aliases46376+Ref: #end-aliases46523+Node: Default parent account46624+Ref: #default-parent-account46790+Node: Periodic transactions47674+Ref: #periodic-transactions47856+Node: Forecasting with periodic transactions49559+Ref: #forecasting-with-periodic-transactions49802+Node: Budgeting with periodic transactions51489+Ref: #budgeting-with-periodic-transactions51728+Node: Transaction Modifiers52187+Ref: #transaction-modifiers52350+Node: EDITOR SUPPORT54331+Ref: #editor-support54449 End Tag Table
embeddedfiles/hledger_journal.txt view
@@ -405,17 +405,47 @@ Assertions and commodities The asserted balance must be a simple single-commodity amount, and in fact the assertion checks only this commodity's balance within the- (possibly multi-commodity) account balance. We could call this a par-- tial balance assertion. This is compatible with Ledger, and makes it- possible to make assertions about accounts containing multiple commodi-- ties.+ (possibly multi-commodity) account balance.+ This is how assertions work in Ledger also. We could call this a "par-+ tial" balance assertion. - To assert each commodity's balance in such a multi-commodity account,- you can add multiple postings (with amount 0 if necessary). But note- that no matter how many assertions you add, you can't be sure the- account does not contain some unexpected commodity. (We'll add support- for this kind of total balance assertion if there's demand.)+ 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.)++ 2013/1/1+ a $1+ a 1+ b $-1+ c -1++ 2013/1/2 ; These assertions succeed+ a 0 = $1+ a 0 = 1+ b 0 == $-1+ c 0 == -1++ 2013/1/3 ; This assertion fails as 'a' also contains 1+ 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+ into its own subaccount:++ 2013/1/1+ a:usd $1+ a:euro 1+ b++ 2013/1/2+ a 0 == 0+ a:usd 0 == $1+ a:euro 0 == 1+ Assertions and subaccounts Balance assertions do not count the balance from subaccounts; they check the posted account's exclusive balance. For example:@@ -614,40 +644,51 @@ tive directive rec- 2018/06) tives -------------------------------------------------------------------------------------------------- account any declare an account name & account code: bal-- text optional account code ance reports- (except balance- single-column mode)+ 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@@ -658,7 +699,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@@ -666,16 +707,11 @@ And some definitions: - subdirec- optional indented directive or unparsed text lines immedi-- tive ately following a parent directive- account numeric code influencing account display order in most bal-- code ance reports---- number how to interpret numbers when parsing journal entries (the- notation identity of the decimal separator character). (Currently- each commodity can have its own notation, even in the same+ 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 file.) display how to display amounts of a commodity in reports (symbol side style and spacing, digit groups, decimal separator, decimal places)@@ -683,37 +719,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@@ -733,8 +769,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@@ -744,8 +780,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@@ -757,19 +793,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@@ -784,9 +820,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:@@ -797,55 +833,97 @@ 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- The account directive predeclares account names. The simplest form is- account ACCTNAME, eg:+ account directives can be used to pre-declare some or all 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,+ notes, etc.)++ 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-+ betic sorting (eg Revenues to appear above Expenses).++ o They help with account name completion in the add command,+ hledger-iadd, hledger-web, ledger-mode etc.++ Here is the full syntax:++ account ACCTNAME [ACCTTYPE]+ [COMMENTS]++ The simplest form just declares a hledger-style account name, eg:+ account assets:bank:checking - Currently this mainly helps with account name autocompletion in eg- hledger add, hledger-iadd, hledger-web, and ledger-mode.- In future it will also help detect misspelled accounts.+ Account types+ hledger recognises five types of account: asset, liability, equity,+ revenue, expense. This is useful for certain accounting-aware reports,+ in particular balancesheet, incomestatement and cashflow. - An account directive can also have indented subdirectives following it,- which are currently ignored. Here is the full syntax:+ If you name your top-level accounts with some variation of assets, lia-+ bilities/debts, equity, revenues/income, or expenses, their types are+ detected automatically. - ; account ACCTNAME- ; [OPTIONALSUBDIRECTIVES]+ More generally, you can declare an account's type by adding one of the+ letters ALERX to its account directive, separated from the account name+ by two or more spaces. Eg: + account assets A+ account liabilities L+ account equity E+ account revenues R+ account expenses X++ Note: if you ever override the types of those auto-detected english+ account names mentioned above, you might need to help the reports a+ bit:++ ; make "liabilities" not have the liability type, who knows why+ account liabilities E++ ; better ensure some other account has the liability type,+ ; otherwise balancesheet would still show "liabilities" under Liabilities+ account - L++ )++ Account comments+ An account directive can also have indented comments on following+ lines, eg:+ account assets:bank:checking- a comment- some-tag:12345+ ; acctno:12345+ ; a comment - Account display order- Account directives have another purpose: they set the order in which- accounts are displayed, in hledger reports, hledger-ui accounts screen,- hledger-web sidebar etc. For example, say you have these top-level- accounts:+ We also allow (and ignore) Ledger-style subdirectives, with no leading+ semicolon, for compatibility. - $ accounts -1- assets- equity- expenses- liabilities- misc- other- revenues+ Tags in account comments, like acctno above, currently have no effect. - By default, they are displayed in alphabetical order. But if you add- the following account directives to the journal:+ Account display order+ Account directives also set the order in which accounts are displayed+ in reports, the hledger-ui accounts screen, the hledger-web sidebar,+ etc. Normally accounts are listed in alphabetical order, but if you+ have eg these account directives in the journal: account assets account liabilities@@ -853,27 +931,30 @@ account revenues account expenses - the display order changes to:+ you'll see those accounts listed in declaration order, not alphabeti-+ cally: - $ accounts -1+ $ hledger accounts -1 assets liabilities equity revenues expenses- misc- other - Ie, declared accounts first, in the order they were declared, followed- by any undeclared accounts in alphabetic order.+ 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). This directive:+ 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.+ 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). Rewriting accounts You can define account alias rules which rewrite your account names, or@@ -1004,105 +1085,143 @@ 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. - If you write a transaction description or same-line comment, it must be- separated from the period expression by two or more spaces. Eg:+ 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. - ; 2 or more spaces- ; ||- ; vv- ~ every 2 weeks from 2018/6 to 2018/9 paycheck+ Period expressions must be terminated by two or more spaces if followed+ by additional fields. For example, the periodic transaction given+ below includes a transaction description "paycheck", which is separated+ from the period expression by a double space. If not for the second+ space, hledger would attempt (and fail) to parse "paycheck" as a part+ of the period expression.++ ; 2 or more spaces+ ; ||+ ; vv+ ~ every 2 weeks from 2018/6/4 to 2018/9 paycheck assets:bank:checking $1500 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. Currently, this means adding+ Transaction modifier rules describe changes that should be applied+ automatically to certain transactions. Currently, this means adding extra postings (also known as "automated postings"). Transaction modi- fiers are enabled by the --auto flag. - A transaction modifier rule looks a bit like a normal journal entry,- except the first line is an equal sign (=) followed by a query- (mnemonic: = suggests matching something.):+ 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: - = expenses:gifts- budget:gifts *-1- assets:budget *1+ = QUERY+ ACCT AMT+ ACCT [AMT]+ ... - The posting amounts can be of the form *N, which means "the amount of- the matched transaction's first posting, multiplied by N". They can- also be ordinary fixed amounts. Fixed amounts with no commodity symbol- will be given the same commodity as the matched transaction's first- posting.+ The posting rules look just like normal postings, except the amount can+ be: - This example adds a corresponding (unbalanced) budget posting to every- transaction involving the expenses:gifts account:+ 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+ 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+ symbol S). The matched posting's amount will be multiplied by N, and+ its commodity symbol will be replaced with S.++ Some examples:++ ; every time I buy food, schedule a dollar donation+ = expenses:food+ (liabilities:charity) $-1++ ; when I buy a gift, also deduct that amount from a budget envelope subaccount = expenses:gifts- (budget:gifts) *-1+ assets:checking:gifts *-1+ assets:checking *1 - 2017-12-14- expenses:gifts $20- assets+ 2017/12/1+ expenses:food $10+ assets:checking + 2017/12/14+ expenses:gifts $20+ assets:checking+ $ hledger print --auto+ 2017/12/01+ expenses:food $10+ assets:checking+ (liabilities:charity) $-1+ 2017/12/14 expenses:gifts $20- (budget:gifts) $-20- assets+ assets:checking+ assets:checking:gifts -$20+ assets:checking $20 - Like postings recorded by hand, automated postings participate in- transaction balancing, missing amount inference and balance assertions.+ Postings added by transaction modifiers participate in transaction bal-+ ancing, missing amount inference and balance assertions, like regular+ postings. EDITOR SUPPORT Add-on modes exist for various text editors, to make working with jour-@@ -1151,4 +1270,4 @@ -hledger 1.11.1 September 2018 hledger_journal(5)+hledger 1.12 December 2018 hledger_journal(5)
embeddedfiles/hledger_timeclock.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timeclock" "5" "September 2018" "hledger 1.11.1" "hledger User Manuals"+.TH "hledger_timeclock" "5" "December 2018" "hledger 1.12" "hledger User Manuals"
embeddedfiles/hledger_timeclock.info view
@@ -4,8 +4,8 @@ File: hledger_timeclock.info, Node: Top, Up: (dir) -hledger_timeclock(5) hledger 1.11.1-***********************************+hledger_timeclock(5) hledger 1.12+********************************* hledger can read timeclock files. As with Ledger, these are (a subset of) timeclock.el's format, containing clock-in and clock-out entries as
embeddedfiles/hledger_timeclock.txt view
@@ -77,4 +77,4 @@ -hledger 1.11.1 September 2018 hledger_timeclock(5)+hledger 1.12 December 2018 hledger_timeclock(5)
embeddedfiles/hledger_timedot.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timedot" "5" "September 2018" "hledger 1.11.1" "hledger User Manuals"+.TH "hledger_timedot" "5" "December 2018" "hledger 1.12" "hledger User Manuals"
embeddedfiles/hledger_timedot.info view
@@ -4,8 +4,8 @@ File: hledger_timedot.info, Node: Top, Next: FILE FORMAT, Up: (dir) -hledger_timedot(5) hledger 1.11.1-*********************************+hledger_timedot(5) hledger 1.12+******************************* Timedot is a plain text format for logging dated, categorised quantities (of time, usually), supported by hledger. It is convenient for@@ -110,7 +110,7 @@ Tag Table: Node: Top76-Node: FILE FORMAT811-Ref: #file-format912+Node: FILE FORMAT807+Ref: #file-format908 End Tag Table
embeddedfiles/hledger_timedot.txt view
@@ -124,4 +124,4 @@ -hledger 1.11.1 September 2018 hledger_timedot(5)+hledger 1.12 December 2018 hledger_timedot(5)
hledger.1 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "September 2018" "hledger 1.11.1" "hledger User Manuals"+.TH "hledger" "1" "December 2018" "hledger 1.12" "hledger User Manuals" @@ -344,46 +344,125 @@ To prevent this expansion of \f[C]\@\f[]\-arguments, precede them with a \f[C]\-\-\f[] argument. For more, see Save frequently used options.-.SS Special characters+.SS Special characters in arguments and queries .PP-Option and argument values which contain problematic characters should-be escaped with double quotes, backslashes, or (best) single quotes.-Problematic characters means spaces, and also characters which are-significant to your command shell, such as less\-than/greater\-than.+In shell command lines, option and argument values which contain+\[lq]problematic\[rq] characters, ie spaces, and also characters+significant to your shell such as \f[C]<\f[], \f[C]>\f[], \f[C](\f[],+\f[C])\f[], \f[C]|\f[] and \f[C]$\f[], should be escaped by enclosing+them in quotes or by writing backslashes before the characters. Eg:+.PP \f[C]hledger\ register\ \-p\ \[aq]last\ year\[aq]\ "accounts\ receivable\ (receivable|payable)"\ amt:\\>100\f[].+.SS More escaping .PP-Characters which are significant both to the shell and in regular-expressions sometimes need to be double\-escaped.+Characters significant both to the shell and in regular expressions may+need one extra level of escaping. These include parentheses, the pipe symbol and the dollar sign. Eg, to match the dollar symbol, bash users should do:-\f[C]hledger\ balance\ cur:\[aq]\\$\[aq]\f[] or-\f[C]hledger\ balance\ cur:\\\\$\f[]. .PP-When hledger is invoking an addon executable (like hledger\-ui), options-and arguments get de\-escaped once more, so you might need-\f[I]triple\f[]\-escaping.-Eg: \f[C]hledger\ ui\ cur:\[aq]\\\\$\[aq]\f[] or-\f[C]hledger\ ui\ cur:\\\\\\\\$\f[] in bash.+\f[C]hledger\ balance\ cur:\[aq]\\$\[aq]\f[]+.PP+or:+.PP+\f[C]hledger\ balance\ cur:\\\\$\f[]+.SS Even more escaping+.PP+When hledger runs an addon executable (eg you type \f[C]hledger\ ui\f[],+hledger runs \f[C]hledger\-ui\f[]), it de\-escapes command\-line options+and arguments once, so you might need to \f[I]triple\f[]\-escape.+Eg in bash, running the ui command and matching the dollar sign, it's:+.PP+\f[C]hledger\ ui\ cur:\[aq]\\\\$\[aq]\f[]+.PP+or:+.PP+\f[C]hledger\ ui\ cur:\\\\\\\\$\f[]+.PP+If you asked why \f[I]four\f[] slashes above, this may help:+.PP+.TS+tab(@);+l l.+T{+unescaped:+T}@T{+\f[C]$\f[]+T}+T{+escaped:+T}@T{+\f[C]\\$\f[]+T}+T{+double\-escaped:+T}@T{+\f[C]\\\\$\f[]+T}+T{+triple\-escaped:+T}@T{+\f[C]\\\\\\\\$\f[]+T}+.TE+.PP (The number of backslashes in fish shell is left as an exercise for the reader.) .PP-Inside a file used for argument expansion, one less level of escaping is-enough.-(And in this case, backslashes seem to work better than quotes.-Eg: \f[C]cur:\\$\f[]).+You can always avoid the extra escaping for addons by running the addon+directly: .PP+\f[C]hledger\-ui\ cur:\\\\$\f[]+.SS Less escaping+.PP+Inside an argument file, or in the search field of hledger\-ui or+hledger\-web, or at a GHCI prompt, you need one less level of escaping+than at the command line.+And backslashes may work better than quotes.+Eg:+.PP+\f[C]ghci>\ :main\ balance\ cur:\\$\f[]+.SS Command line tips+.PP If in doubt, keep things simple: .IP \[bu] 2-run add\-on executables directly+write options after the command (\f[C]hledger\ CMD\ \-OPTIONS\ ARGS\f[]) .IP \[bu] 2-write options after the command+run add\-on executables directly (\f[C]hledger\-ui\ \-OPTIONS\ ARGS\f[]) .IP \[bu] 2 enclose problematic args in single quotes .IP \[bu] 2 if needed, also add a backslash to escape regexp metacharacters .PP-If you're really stumped, add \f[C]\-\-debug=2\f[] to troubleshoot.+To find out exactly how a command line is being parsed, add+\f[C]\-\-debug=2\f[] to troubleshoot.+.SS Unicode characters+.PP+hledger is expected to handle unicode (non\-ascii) characters, but this+requires a well\-configured environment.+.PP+To handle unicode characters in the command line or input data, a system+locale that can decode them must be configured (POSIX's default+\f[C]C\f[] locale will not work).+Eg in bash, you could do:+.IP+.nf+\f[C]+export\ LANG=en_US.UTF\-8+\f[]+.fi+.PP+See Troubleshooting for more about this.+.PP+Unicode characters should appear correctly in hledger's output.+For the hledger and hledger\-ui tools, this requires that+.IP \[bu] 2+your terminal supports unicode+.IP \[bu] 2+the terminal's font includes the required unicode glyphs+.IP \[bu] 2+the terminal is configured to display \[lq]wide\[rq] characters as+double width (otherwise report alignment will be off) .SS Input files .PP hledger reads transactions from a data file (and the add command writes@@ -2900,7 +2979,7 @@ .SS irr .PP hledger\-irr calculates the internal rate of return of an investment-account.+account, but it's superseded now by the built\-in roi command. .SS Experimental add\-ons .PP These are available in source form in the hledger repo's bin/ directory;
hledger.cabal view
@@ -1,11 +1,13 @@--- This file has been generated from package.yaml by hpack version 0.28.2.+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.31.0. -- -- see: https://github.com/sol/hpack ----- hash: 1da5c664b1043cb4783947a5c5ae448812f4098aec23fb3123031982aa353ba4+-- hash: 459ec44c2ae4fd1a0f7e0f8001c3efae2a39ff8b1ef53baa0a510b0674e98c2c name: hledger-version: 1.11.1+version: 1.12 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,39 +29,38 @@ license-file: LICENSE tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3 build-type: Simple-cabal-version: >= 1.10 extra-source-files:- bench/10000x1000x10.journal CHANGES+ README.md+ test/test.hs+ bench/10000x1000x10.journal+ hledger.1+ hledger.txt+ hledger.info+ embeddedfiles/hledger.1+ embeddedfiles/hledger.txt+ embeddedfiles/hledger.info embeddedfiles/hledger-api.1- embeddedfiles/hledger-api.info embeddedfiles/hledger-api.txt+ embeddedfiles/hledger-api.info embeddedfiles/hledger-ui.1- embeddedfiles/hledger-ui.info embeddedfiles/hledger-ui.txt+ embeddedfiles/hledger-ui.info embeddedfiles/hledger-web.1- embeddedfiles/hledger-web.info embeddedfiles/hledger-web.txt- embeddedfiles/hledger.1- embeddedfiles/hledger.info- embeddedfiles/hledger.txt- embeddedfiles/hledger_csv.5- embeddedfiles/hledger_csv.info- embeddedfiles/hledger_csv.txt+ embeddedfiles/hledger-web.info embeddedfiles/hledger_journal.5- embeddedfiles/hledger_journal.info embeddedfiles/hledger_journal.txt+ embeddedfiles/hledger_journal.info+ embeddedfiles/hledger_csv.5+ embeddedfiles/hledger_csv.txt+ embeddedfiles/hledger_csv.info embeddedfiles/hledger_timeclock.5- embeddedfiles/hledger_timeclock.info embeddedfiles/hledger_timeclock.txt+ embeddedfiles/hledger_timeclock.info embeddedfiles/hledger_timedot.5- embeddedfiles/hledger_timedot.info embeddedfiles/hledger_timedot.txt- hledger.1- hledger.info- hledger.txt- README.md- test/test.hs+ embeddedfiles/hledger_timedot.info source-repository head type: git@@ -111,12 +112,12 @@ 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.11.1"+ cpp-options: -DVERSION="1.12" build-depends: Decimal , Diff , ansi-terminal >=0.6.2.3- , base >=4.8 && <4.12+ , base >=4.8 && <4.13 , base-compat-batteries >=0.10.1 && <0.11 , bytestring , cmdargs >=0.10@@ -129,9 +130,9 @@ , hashable >=1.2.4 , haskeline >=0.6 , here- , hledger-lib >=1.11.1 && <1.12+ , hledger-lib >=1.12 && <1.13 , lucid- , megaparsec >=6.4.1 && <7+ , megaparsec >=7.0.0 && <8 , mtl , mtl-compat , old-time@@ -142,7 +143,7 @@ , safe >=0.2 , shakespeare >=2.0.2.2 , split >=0.1- , statistics+ , statistics <=0.15 , tabular >=0.2 , temporary , text >=0.11@@ -164,11 +165,11 @@ 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.11.1"+ cpp-options: -DVERSION="1.12" build-depends: Decimal , ansi-terminal >=0.6.2.3- , base >=4.8 && <4.12+ , base >=4.8 && <4.13 , base-compat-batteries >=0.10.1 && <0.11 , bytestring , cmdargs >=0.10@@ -181,8 +182,8 @@ , haskeline >=0.6 , here , hledger- , hledger-lib >=1.11.1 && <1.12- , megaparsec >=6.4.1 && <7+ , hledger-lib >=1.12 && <1.13+ , megaparsec >=7.0.0 && <8 , mtl , mtl-compat , old-time@@ -193,7 +194,7 @@ , safe >=0.2 , shakespeare >=2.0.2.2 , split >=0.1- , statistics+ , statistics <=0.15 , tabular >=0.2 , temporary , text >=0.11@@ -218,11 +219,11 @@ 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.11.1"+ cpp-options: -DVERSION="1.12" build-depends: Decimal , ansi-terminal >=0.6.2.3- , base >=4.8 && <4.12+ , base >=4.8 && <4.13 , base-compat-batteries >=0.10.1 && <0.11 , bytestring , cmdargs >=0.10@@ -235,8 +236,8 @@ , haskeline >=0.6 , here , hledger- , hledger-lib >=1.11.1 && <1.12- , megaparsec >=6.4.1 && <7+ , hledger-lib >=1.12 && <1.13+ , megaparsec >=7.0.0 && <8 , mtl , mtl-compat , old-time@@ -247,7 +248,7 @@ , safe >=0.2 , shakespeare >=2.0.2.2 , split >=0.1- , statistics+ , statistics <=0.15 , tabular >=0.2 , temporary , test-framework@@ -275,7 +276,7 @@ build-depends: Decimal , ansi-terminal >=0.6.2.3- , base >=4.8 && <4.12+ , base >=4.8 && <4.13 , base-compat-batteries >=0.10.1 && <0.11 , bytestring , cmdargs >=0.10@@ -289,9 +290,9 @@ , haskeline >=0.6 , here , hledger- , hledger-lib >=1.11.1 && <1.12+ , hledger-lib >=1.12 && <1.13 , html- , megaparsec >=6.4.1 && <7+ , megaparsec >=7.0.0 && <8 , mtl , mtl-compat , old-time@@ -302,7 +303,7 @@ , safe >=0.2 , shakespeare >=2.0.2.2 , split >=0.1- , statistics+ , statistics <=0.15 , tabular >=0.2 , temporary , text >=0.11
hledger.info view
@@ -3,8 +3,8 @@ File: hledger.info, Node: Top, Next: EXAMPLES, Up: (dir) -hledger(1) hledger 1.11.1-*************************+hledger(1) hledger 1.12+*********************** This is hledger's command-line interface (there are also curses and web interfaces). Its basic function is to read a plain text file describing@@ -119,7 +119,9 @@ * Command options:: * Command arguments:: * Argument files::-* Special characters::+* Special characters in arguments and queries::+* Command line tips::+* Unicode characters:: * Input files:: * Smart dates:: * Report start & end date::@@ -277,7 +279,7 @@ often a query, filtering the data in some way. -File: hledger.info, Node: Argument files, Next: Special characters, Prev: Command arguments, Up: OPTIONS+File: hledger.info, Node: Argument files, Next: Special characters in arguments and queries, Prev: Command arguments, Up: OPTIONS 2.4 Argument files ==================@@ -288,47 +290,132 @@ argument. For more, see Save frequently used options. -File: hledger.info, Node: Special characters, Next: Input files, Prev: Argument files, Up: OPTIONS+File: hledger.info, Node: Special characters in arguments and queries, Next: Command line tips, Prev: Argument files, Up: OPTIONS -2.5 Special characters-======================+2.5 Special characters in arguments and queries+=============================================== -Option and argument values which contain problematic characters should-be escaped with double quotes, backslashes, or (best) single quotes.-Problematic characters means spaces, and also characters which are-significant to your command shell, such as less-than/greater-than. Eg:-'hledger register -p 'last year' "accounts receivable+In shell command lines, option and argument values which contain+"problematic" characters, ie spaces, and also characters significant to+your shell such as '<', '>', '(', ')', '|' and '$', should be escaped by+enclosing them in quotes or by writing backslashes before the+characters. Eg:++ 'hledger register -p 'last year' "accounts receivable (receivable|payable)" amt:\>100'.+* Menu: - Characters which are significant both to the shell and in regular-expressions sometimes need to be double-escaped. These include-parentheses, the pipe symbol and the dollar sign. Eg, to match the-dollar symbol, bash users should do: 'hledger balance cur:'\$'' or-'hledger balance cur:\\$'.+* More escaping::+* Even more escaping::+* Less escaping:: - When hledger is invoking an addon executable (like hledger-ui),-options and arguments get de-escaped once more, so you might need-_triple_-escaping. Eg: 'hledger ui cur:'\\$'' or 'hledger ui cur:\\\\$'-in bash. (The number of backslashes in fish shell is left as an-exercise for the reader.)++File: hledger.info, Node: More escaping, Next: Even more escaping, Up: Special characters in arguments and queries - Inside a file used for argument expansion, one less level of escaping-is enough. (And in this case, backslashes seem to work better than-quotes. Eg: 'cur:\$').+2.5.1 More escaping+------------------- - If in doubt, keep things simple:+Characters significant both to the shell and in regular expressions may+need one extra level of escaping. These include parentheses, the pipe+symbol and the dollar sign. Eg, to match the dollar symbol, bash users+should do: - * run add-on executables directly- * write options after the command+ 'hledger balance cur:'\$''++ or:++ 'hledger balance cur:\\$'+++File: hledger.info, Node: Even more escaping, Next: Less escaping, Prev: More escaping, Up: Special characters in arguments and queries++2.5.2 Even more escaping+------------------------++When hledger runs an addon executable (eg you type 'hledger ui', hledger+runs 'hledger-ui'), it de-escapes command-line options and arguments+once, so you might need to _triple_-escape. Eg in bash, running the ui+command and matching the dollar sign, it's:++ 'hledger ui cur:'\\$''++ or:++ 'hledger ui cur:\\\\$'++ If you asked why _four_ slashes above, this may help:++unescaped: '$'+escaped: '\$'+double-escaped: '\\$'+triple-escaped: '\\\\$'++ (The number of backslashes in fish shell is left as an exercise for+the reader.)++ You can always avoid the extra escaping for addons by running the+addon directly:++ 'hledger-ui cur:\\$'+++File: hledger.info, Node: Less escaping, Prev: Even more escaping, Up: Special characters in arguments and queries++2.5.3 Less escaping+-------------------++Inside an argument file, or in the search field of hledger-ui or+hledger-web, or at a GHCI prompt, you need one less level of escaping+than at the command line. And backslashes may work better than quotes.+Eg:++ 'ghci> :main balance cur:\$'+++File: hledger.info, Node: Command line tips, Next: Unicode characters, Prev: Special characters in arguments and queries, Up: OPTIONS++2.6 Command line tips+=====================++If in doubt, keep things simple:++ * write options after the command ('hledger CMD -OPTIONS ARGS')+ * run add-on executables directly ('hledger-ui -OPTIONS ARGS') * enclose problematic args in single quotes * if needed, also add a backslash to escape regexp metacharacters - If you're really stumped, add '--debug=2' to troubleshoot.+ To find out exactly how a command line is being parsed, add+'--debug=2' to troubleshoot. -File: hledger.info, Node: Input files, Next: Smart dates, Prev: Special characters, Up: OPTIONS+File: hledger.info, Node: Unicode characters, Next: Input files, Prev: Command line tips, Up: OPTIONS -2.6 Input files+2.7 Unicode characters+======================++hledger is expected to handle unicode (non-ascii) characters, but this+requires a well-configured environment.++ To handle unicode characters in the command line or input data, a+system locale that can decode them must be configured (POSIX's default+'C' locale will not work). Eg in bash, you could do:++export LANG=en_US.UTF-8++ See Troubleshooting for more about this.++ Unicode characters should appear correctly in hledger's output. For+the hledger and hledger-ui tools, this requires that++ * your terminal supports unicode+ * the terminal's font includes the required unicode glyphs+ * the terminal is configured to display "wide" characters as double+ width (otherwise report alignment will be off)+++File: hledger.info, Node: Input files, Next: Smart dates, Prev: Unicode characters, Up: OPTIONS++2.8 Input files =============== hledger reads transactions from a data file (and the add command writes@@ -383,7 +470,7 @@ File: hledger.info, Node: Smart dates, Next: Report start & end date, Prev: Input files, Up: OPTIONS -2.7 Smart dates+2.9 Smart dates =============== hledger's user interfaces accept a flexible "smart date" syntax (unlike@@ -416,8 +503,8 @@ File: hledger.info, Node: Report start & end date, Next: Report intervals, Prev: Smart dates, Up: OPTIONS -2.8 Report start & end date-===========================+2.10 Report start & end date+============================ Most hledger reports show the full span of time represented by the journal data, by default. So, the effective report start and end dates@@ -445,8 +532,8 @@ File: hledger.info, Node: Report intervals, Next: Period expressions, Prev: Report start & end date, Up: OPTIONS -2.9 Report intervals-====================+2.11 Report intervals+===================== A report interval can be specified so that commands like register, balance and activity will divide their reports into multiple subperiods.@@ -458,7 +545,7 @@ File: hledger.info, Node: Period expressions, Next: Depth limiting, Prev: Report intervals, Up: OPTIONS -2.10 Period expressions+2.12 Period expressions ======================= The '-p/--period' option accepts period expressions, a shorthand way of@@ -566,7 +653,7 @@ File: hledger.info, Node: Depth limiting, Next: Pivoting, Prev: Period expressions, Up: OPTIONS -2.11 Depth limiting+2.13 Depth limiting =================== With the '--depth N' option (short form: '-N'), commands like account,@@ -578,7 +665,7 @@ File: hledger.info, Node: Pivoting, Next: Cost, Prev: Depth limiting, Up: OPTIONS -2.12 Pivoting+2.14 Pivoting ============= Normally hledger sums amounts, and organizes them in a hierarchy, based@@ -635,7 +722,7 @@ File: hledger.info, Node: Cost, Next: Market value, Prev: Pivoting, Up: OPTIONS -2.13 Cost+2.15 Cost ========= The '-B/--cost' flag converts amounts to their cost at transaction time,@@ -644,7 +731,7 @@ File: hledger.info, Node: Market value, Next: Combining -B and -V, Prev: Cost, Up: OPTIONS -2.14 Market value+2.16 Market value ================= The '-V/--value' flag converts reported amounts to their current market@@ -696,7 +783,7 @@ File: hledger.info, Node: Combining -B and -V, Next: Output destination, Prev: Market value, Up: OPTIONS -2.15 Combining -B and -V+2.17 Combining -B and -V ======================== Using -B/-cost and -V/-value together is currently allowed, but the@@ -706,7 +793,7 @@ File: hledger.info, Node: Output destination, Next: Output format, Prev: Combining -B and -V, Up: OPTIONS -2.16 Output destination+2.18 Output destination ======================= Some commands (print, register, stats, the balance commands) can write@@ -719,7 +806,7 @@ File: hledger.info, Node: Output format, Next: Regular expressions, Prev: Output destination, Up: OPTIONS -2.17 Output format+2.19 Output format ================== Some commands can write their output in other formats. Eg print and@@ -733,7 +820,7 @@ File: hledger.info, Node: Regular expressions, Prev: Output format, Up: OPTIONS -2.18 Regular expressions+2.20 Regular expressions ======================== hledger uses regular expressions in a number of places:@@ -2419,7 +2506,7 @@ --------- hledger-irr calculates the internal rate of return of an investment-account.+account, but it's superseded now by the built-in roi command. File: hledger.info, Node: Experimental add-ons, Prev: Third party add-ons, Up: ADD-ON COMMANDS@@ -2467,142 +2554,152 @@ Tag Table: Node: Top68-Node: EXAMPLES1888-Ref: #examples1988-Node: OPTIONS3634-Ref: #options3736-Node: General options4101-Ref: #general-options4226-Node: Command options6908-Ref: #command-options7059-Node: Command arguments7457-Ref: #command-arguments7611-Node: Argument files7732-Ref: #argument-files7883-Node: Special characters8149-Ref: #special-characters8302-Node: Input files9721-Ref: #input-files9857-Node: Smart dates11827-Ref: #smart-dates11968-Node: Report start & end date13374-Ref: #report-start-end-date13544-Node: Report intervals14609-Ref: #report-intervals14772-Node: Period expressions15173-Ref: #period-expressions15333-Node: Depth limiting19290-Ref: #depth-limiting19434-Node: Pivoting19776-Ref: #pivoting19894-Node: Cost21570-Ref: #cost21678-Node: Market value21796-Ref: #market-value21931-Node: Combining -B and -V23297-Ref: #combining--b-and--v23460-Node: Output destination23607-Ref: #output-destination23769-Node: Output format24052-Ref: #output-format24204-Node: Regular expressions24589-Ref: #regular-expressions24726-Node: QUERIES26087-Ref: #queries26189-Node: COMMANDS30151-Ref: #commands30263-Node: accounts31263-Ref: #accounts31361-Node: activity32607-Ref: #activity32717-Node: add33077-Ref: #add33176-Node: balance35837-Ref: #balance35948-Node: Classic balance report39031-Ref: #classic-balance-report39204-Node: Customising the classic balance report40573-Ref: #customising-the-classic-balance-report40801-Node: Colour support42875-Ref: #colour-support43042-Node: Flat mode43215-Ref: #flat-mode43363-Node: Depth limited balance reports43776-Ref: #depth-limited-balance-reports43976-Node: Multicolumn balance report44432-Ref: #multicolumn-balance-report44630-Node: Budget report49810-Ref: #budget-report49953-Ref: #output-format-152987-Node: balancesheet53065-Ref: #balancesheet53201-Node: balancesheetequity55512-Ref: #balancesheetequity55661-Node: cashflow56198-Ref: #cashflow56326-Node: check-dates58449-Ref: #check-dates58576-Node: check-dupes58693-Ref: #check-dupes58817-Node: close58954-Ref: #close59062-Node: files59392-Ref: #files59493-Node: help59634-Ref: #help59734-Node: import60808-Ref: #import60922-Node: incomestatement61652-Ref: #incomestatement61786-Node: prices64190-Ref: #prices64305-Node: print64577-Ref: #print64687-Node: print-unique69581-Ref: #print-unique69707-Node: register69775-Ref: #register69902-Node: Custom register output74403-Ref: #custom-register-output74532-Node: register-match75762-Ref: #register-match75896-Node: rewrite76079-Ref: #rewrite76194-Node: roi76263-Ref: #roi76361-Node: stats76477-Ref: #stats76576-Node: tags77446-Ref: #tags77544-Node: test77780-Ref: #test77864-Node: ADD-ON COMMANDS78572-Ref: #add-on-commands78682-Node: Official add-ons79969-Ref: #official-add-ons80109-Node: api80196-Ref: #api80285-Node: ui80337-Ref: #ui80436-Node: web80494-Ref: #web80583-Node: Third party add-ons80629-Ref: #third-party-add-ons80804-Node: diff80939-Ref: #diff81036-Node: iadd81135-Ref: #iadd81249-Node: interest81332-Ref: #interest81453-Node: irr81548-Ref: #irr81646-Node: Experimental add-ons81724-Ref: #experimental-add-ons81876-Node: autosync82156-Ref: #autosync82267-Node: chart82506-Ref: #chart82625-Node: check82696-Ref: #check82798+Node: EXAMPLES1884+Ref: #examples1984+Node: OPTIONS3630+Ref: #options3732+Node: General options4167+Ref: #general-options4292+Node: Command options6974+Ref: #command-options7125+Node: Command arguments7523+Ref: #command-arguments7677+Node: Argument files7798+Ref: #argument-files7974+Node: Special characters in arguments and queries8240+Ref: #special-characters-in-arguments-and-queries8474+Node: More escaping8924+Ref: #more-escaping9086+Node: Even more escaping9382+Ref: #even-more-escaping9576+Node: Less escaping10247+Ref: #less-escaping10409+Node: Command line tips10654+Ref: #command-line-tips10840+Node: Unicode characters11217+Ref: #unicode-characters11373+Node: Input files12098+Ref: #input-files12234+Node: Smart dates14204+Ref: #smart-dates14345+Node: Report start & end date15751+Ref: #report-start-end-date15923+Node: Report intervals16988+Ref: #report-intervals17153+Node: Period expressions17554+Ref: #period-expressions17714+Node: Depth limiting21671+Ref: #depth-limiting21815+Node: Pivoting22157+Ref: #pivoting22275+Node: Cost23951+Ref: #cost24059+Node: Market value24177+Ref: #market-value24312+Node: Combining -B and -V25678+Ref: #combining--b-and--v25841+Node: Output destination25988+Ref: #output-destination26150+Node: Output format26433+Ref: #output-format26585+Node: Regular expressions26970+Ref: #regular-expressions27107+Node: QUERIES28468+Ref: #queries28570+Node: COMMANDS32532+Ref: #commands32644+Node: accounts33644+Ref: #accounts33742+Node: activity34988+Ref: #activity35098+Node: add35458+Ref: #add35557+Node: balance38218+Ref: #balance38329+Node: Classic balance report41412+Ref: #classic-balance-report41585+Node: Customising the classic balance report42954+Ref: #customising-the-classic-balance-report43182+Node: Colour support45256+Ref: #colour-support45423+Node: Flat mode45596+Ref: #flat-mode45744+Node: Depth limited balance reports46157+Ref: #depth-limited-balance-reports46357+Node: Multicolumn balance report46813+Ref: #multicolumn-balance-report47011+Node: Budget report52191+Ref: #budget-report52334+Ref: #output-format-155368+Node: balancesheet55446+Ref: #balancesheet55582+Node: balancesheetequity57893+Ref: #balancesheetequity58042+Node: cashflow58579+Ref: #cashflow58707+Node: check-dates60830+Ref: #check-dates60957+Node: check-dupes61074+Ref: #check-dupes61198+Node: close61335+Ref: #close61443+Node: files61773+Ref: #files61874+Node: help62015+Ref: #help62115+Node: import63189+Ref: #import63303+Node: incomestatement64033+Ref: #incomestatement64167+Node: prices66571+Ref: #prices66686+Node: print66958+Ref: #print67068+Node: print-unique71962+Ref: #print-unique72088+Node: register72156+Ref: #register72283+Node: Custom register output76784+Ref: #custom-register-output76913+Node: register-match78143+Ref: #register-match78277+Node: rewrite78460+Ref: #rewrite78575+Node: roi78644+Ref: #roi78742+Node: stats78858+Ref: #stats78957+Node: tags79827+Ref: #tags79925+Node: test80161+Ref: #test80245+Node: ADD-ON COMMANDS80953+Ref: #add-on-commands81063+Node: Official add-ons82350+Ref: #official-add-ons82490+Node: api82577+Ref: #api82666+Node: ui82718+Ref: #ui82817+Node: web82875+Ref: #web82964+Node: Third party add-ons83010+Ref: #third-party-add-ons83185+Node: diff83320+Ref: #diff83417+Node: iadd83516+Ref: #iadd83630+Node: interest83713+Ref: #interest83834+Node: irr83929+Ref: #irr84027+Node: Experimental add-ons84158+Ref: #experimental-add-ons84310+Node: autosync84590+Ref: #autosync84701+Node: chart84940+Ref: #chart85059+Node: check85130+Ref: #check85232 End Tag Table
hledger.txt view
@@ -238,42 +238,99 @@ prevent this expansion of @-arguments, precede them with a -- argument. For more, see Save frequently used options. - Special characters- Option and argument values which contain problematic characters should- be escaped with double quotes, backslashes, or (best) single quotes.- Problematic characters means spaces, and also characters which are sig-- nificant to your command shell, such as less-than/greater-than. Eg:+ Special characters in arguments and queries+ In shell command lines, option and argument values which contain "prob-+ lematic" characters, ie spaces, and also characters significant to your+ shell such as <, >, (, ), | and $, should be escaped by enclosing them+ in quotes or by writing backslashes before the characters. Eg:+ hledger register -p 'last year' "accounts receivable (receiv- able|payable)" amt:\>100. - Characters which are significant both to the shell and in regular- expressions sometimes need to be double-escaped. These include paren-- theses, the pipe symbol and the dollar sign. Eg, to match the dollar- symbol, bash users should do: hledger balance cur:'\$' or hledger bal-- ance cur:\\$.+ More escaping+ Characters significant both to the shell and in regular expressions may+ need one extra level of escaping. These include parentheses, the pipe+ symbol and the dollar sign. Eg, to match the dollar symbol, bash users+ should do: - When hledger is invoking an addon executable (like hledger-ui), options- and arguments get de-escaped once more, so you might need triple-escap-- ing. Eg: hledger ui cur:'\\$' or hledger ui cur:\\\\$ in bash. (The- number of backslashes in fish shell is left as an exercise for the+ hledger balance cur:'\$'++ or:++ hledger balance cur:\\$++ Even more escaping+ When hledger runs an addon executable (eg you type hledger ui, hledger+ runs hledger-ui), it de-escapes command-line options and arguments+ once, so you might need to triple-escape. Eg in bash, running the ui+ command and matching the dollar sign, it's:++ hledger ui cur:'\\$'++ or:++ hledger ui cur:\\\\$++ If you asked why four slashes above, this may help:+++ unescaped: $+ escaped: \$+ double-escaped: \\$+ triple-escaped: \\\\$++ (The number of backslashes in fish shell is left as an exercise for the reader.) - Inside a file used for argument expansion, one less level of escaping- is enough. (And in this case, backslashes seem to work better than- quotes. Eg: cur:\$).+ You can always avoid the extra escaping for addons by running the addon+ directly: + hledger-ui cur:\\$++ Less escaping+ Inside an argument file, or in the search field of hledger-ui or+ hledger-web, or at a GHCI prompt, you need one less level of escaping+ than at the command line. And backslashes may work better than quotes.+ Eg:++ ghci> :main balance cur:\$++ Command line tips If in doubt, keep things simple: - o run add-on executables directly+ o write options after the command (hledger CMD -OPTIONS ARGS) - o write options after the command+ o run add-on executables directly (hledger-ui -OPTIONS ARGS) o enclose problematic args in single quotes o if needed, also add a backslash to escape regexp metacharacters - If you're really stumped, add --debug=2 to troubleshoot.+ To find out exactly how a command line is being parsed, add --debug=2+ to troubleshoot. + Unicode characters+ hledger is expected to handle unicode (non-ascii) characters, but this+ requires a well-configured environment.++ To handle unicode characters in the command line or input data, a sys-+ tem locale that can decode them must be configured (POSIX's default C+ locale will not work). Eg in bash, you could do:++ export LANG=en_US.UTF-8++ See Troubleshooting for more about this.++ Unicode characters should appear correctly in hledger's output. For+ the hledger and hledger-ui tools, this requires that++ o your terminal supports unicode++ o the terminal's font includes the required unicode glyphs++ o the terminal is configured to display "wide" characters as double+ width (otherwise report alignment will be off)+ Input files hledger reads transactions from a data file (and the add command writes to it). By default this file is $HOME/.hledger.journal (or on Windows,@@ -340,6 +397,7 @@ 4+ digits, month is 1-12, day is 1-31 2004 start of year+ 2004/10 start of month 10/1 month and day in current year@@ -397,7 +455,6 @@ rent month -p thismonth all transactions in the current month- date:2016/3/17- the above written as queries instead date:-12/1@@ -531,7 +588,6 @@ -p "every 2nd Monday" - period bound- aries will be on second Monday of each month- -p "every 11/05" - yearly periods with boundaries on 5th of Nov -p "every 5th Nov" - same@@ -2094,7 +2150,7 @@ irr hledger-irr calculates the internal rate of return of an investment- account.+ account, but it's superseded now by the built-in roi command. Experimental add-ons These are available in source form in the hledger repo's bin/ direc-@@ -2230,4 +2286,4 @@ -hledger 1.11.1 September 2018 hledger(1)+hledger 1.12 December 2018 hledger(1)