packages feed

hledger 1.3 → 1.3.1

raw patch · 33 files changed

+570/−532 lines, 33 filesdep ~hledgerdep ~hledger-libdep ~megaparsecPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: hledger, hledger-lib, megaparsec

API changes (from Hackage documentation)

- Hledger.Cli.BalanceView: BalanceView :: String -> [String] -> String -> String -> [(String, Journal -> Query)] -> BalanceType -> BalanceView
- Hledger.Cli.BalanceView: [bvaliases] :: BalanceView -> [String]
- Hledger.Cli.BalanceView: [bvhelp] :: BalanceView -> String
- Hledger.Cli.BalanceView: [bvmode] :: BalanceView -> String
- Hledger.Cli.BalanceView: [bvqueries] :: BalanceView -> [(String, Journal -> Query)]
- Hledger.Cli.BalanceView: [bvtitle] :: BalanceView -> String
- Hledger.Cli.BalanceView: [bvtype] :: BalanceView -> BalanceType
- Hledger.Cli.BalanceView: balanceviewReport :: BalanceView -> CliOpts -> Journal -> IO ()
- Hledger.Cli.BalanceView: balanceviewmode :: BalanceView -> Mode RawOpts
- Hledger.Cli.BalanceView: data BalanceView
+ Hledger.Cli.CompoundBalanceCommand: CompoundBalanceCommandSpec :: String -> [String] -> String -> String -> [(String, Journal -> Query)] -> BalanceType -> CompoundBalanceCommandSpec
+ Hledger.Cli.CompoundBalanceCommand: [cbcaliases] :: CompoundBalanceCommandSpec -> [String]
+ Hledger.Cli.CompoundBalanceCommand: [cbchelp] :: CompoundBalanceCommandSpec -> String
+ Hledger.Cli.CompoundBalanceCommand: [cbcname] :: CompoundBalanceCommandSpec -> String
+ Hledger.Cli.CompoundBalanceCommand: [cbcqueries] :: CompoundBalanceCommandSpec -> [(String, Journal -> Query)]
+ Hledger.Cli.CompoundBalanceCommand: [cbctitle] :: CompoundBalanceCommandSpec -> String
+ Hledger.Cli.CompoundBalanceCommand: [cbctype] :: CompoundBalanceCommandSpec -> BalanceType
+ Hledger.Cli.CompoundBalanceCommand: compoundBalanceCommand :: CompoundBalanceCommandSpec -> (CliOpts -> Journal -> IO ())
+ Hledger.Cli.CompoundBalanceCommand: compoundBalanceCommandMode :: CompoundBalanceCommandSpec -> Mode RawOpts
+ Hledger.Cli.CompoundBalanceCommand: data CompoundBalanceCommandSpec
- Hledger.Cli.CliOptions: defaultOutputFormat :: [Char]
+ Hledger.Cli.CliOptions: defaultOutputFormat :: String
- Hledger.Cli.CliOptions: outputFormats :: [[Char]]
+ Hledger.Cli.CliOptions: outputFormats :: [String]

Files

CHANGES view
@@ -2,6 +2,17 @@ See also the project change log.  +# 1.3.1 (2017/8/25)++* bs/is: don't let an empty subreport disable the grand totals (#588)++* allow megaparsec 6 (#594)++* allow megaparsec-6.1 (Hans-Peter Deifel)++* restore upper bounds on hledger packages++ # 1.3 (2017/6/30)  The "uncleared" transaction/posting status, and associated UI flags@@ -12,7 +23,7 @@ background. (#564)  Also the -P short flag has been added for --pending, and the -U/-P/-C-and flags can be combined. +flags can be combined.   bs/is: fix "Ratio has zero denominator" error (#535) 
Hledger/Cli/Add.hs view
@@ -3,7 +3,7 @@ |-}  {-# OPTIONS_GHC -fno-warn-missing-signatures -fno-warn-unused-do-bind #-}-{-# LANGUAGE CPP, ScopedTypeVariables, DeriveDataTypeable, RecordWildCards, TypeOperators, FlexibleContexts, OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable, RecordWildCards, TypeOperators, FlexibleContexts, OverloadedStrings #-}  module Hledger.Cli.Add where@@ -16,6 +16,7 @@ import Control.Monad.State.Strict (evalState, evalStateT) import Control.Monad.Trans (liftIO) import Data.Char (toUpper, toLower)+import Data.Functor.Identity (Identity(..)) import Data.List.Compat import qualified Data.Set as S import Data.Maybe@@ -30,8 +31,7 @@ import System.Console.Wizard import System.Console.Wizard.Haskeline import System.IO ( stderr, hPutStr, hPutStrLn )-import Text.Megaparsec-import Text.Megaparsec.Text+import Text.Megaparsec.Compat import Text.Printf  import Hledger@@ -187,7 +187,7 @@       parseSmartDateAndCode refdate s = either (const Nothing) (\(d,c) -> return (fixSmartDate refdate d, c)) edc           where             edc = runParser (dateandcodep <* eof) "" $ T.pack $ lowercase s-            dateandcodep :: Parser (SmartDate, Text)+            dateandcodep :: SimpleTextParser (SmartDate, Text)             dateandcodep = do                 d <- smartdate                 c <- optional codep@@ -285,7 +285,7 @@                                   ""                                   (T.pack s)       nodefcommodityj = esJournal{jparsedefaultcommodity=Nothing}-      amountandcommentp :: JournalParser (Amount, Text)+      amountandcommentp :: JournalParser Identity (Amount, Text)       amountandcommentp = do         a <- amountp         lift (many spacenonewline)
− Hledger/Cli/BalanceView.hs
@@ -1,188 +0,0 @@-{-# LANGUAGE OverloadedStrings, RecordWildCards #-}-{-|--This module is used by the 'balancesheet', 'incomestatement', and-'cashflow' commands to print out acocunt balances based on a specific-"view", which consists of a title and multiple named queries that are-aggregated and totaled.---}--module Hledger.Cli.BalanceView (-  BalanceView(..)- ,balanceviewmode- ,balanceviewReport-) where--import Control.Monad (unless)-import Data.List (intercalate, foldl', isPrefixOf)-import Data.Maybe (fromMaybe)-import Data.Monoid (Sum(..), (<>))-import System.Console.CmdArgs.Explicit as C-import Text.Tabular as T--import Hledger-import Hledger.Cli.Balance-import Hledger.Cli.CliOptions---- | Describes a view for the balance, which can consist of multiple--- separate named queries that are aggregated and totaled.-data BalanceView = BalanceView {-      bvmode     :: String,                        -- ^ command line mode of the view-      bvaliases  :: [String],                      -- ^ command line aliases-      bvhelp     :: String,                        -- ^ command line help message-      bvtitle    :: String,                        -- ^ title of the view-      bvqueries  :: [(String, Journal -> Query)],  -- ^ named queries that make up the view-      bvtype     :: BalanceType                    -- ^ the type of balance this view shows.-                                                   --   This overrides user input.-}--balanceviewmode :: BalanceView -> Mode RawOpts-balanceviewmode BalanceView{..} = (defCommandMode $ bvmode : bvaliases) {-  modeHelp = bvhelp `withAliases` bvaliases- ,modeGroupFlags = C.Group {-     groupUnnamed = [-      flagNone ["change"] (\opts -> setboolopt "change" opts)-        ("show balance change in each period" ++ defType PeriodChange)-     ,flagNone ["cumulative"] (\opts -> setboolopt "cumulative" opts)-        ("show balance change accumulated across periods (in multicolumn reports)"-            ++ defType CumulativeChange-        )-     ,flagNone ["historical","H"] (\opts -> setboolopt "historical" opts)-        ("show historical ending balance in each period (includes postings before report start date)"-            ++ defType HistoricalBalance-        )-     ,flagNone ["flat"] (\opts -> setboolopt "flat" opts) "show accounts as a list"-     ,flagReq  ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"-     ,flagNone ["no-total","N"] (\opts -> setboolopt "no-total" opts) "omit the final total row"-     ,flagNone ["tree"] (\opts -> setboolopt "tree" opts) "show accounts as a tree; amounts include subaccounts (default in simple reports)"-     ,flagNone ["average","A"] (\opts -> setboolopt "average" opts) "show a row average column (in multicolumn reports)"-     ,flagNone ["row-total","T"] (\opts -> setboolopt "row-total" opts) "show a row total column (in multicolumn reports)"-     ,flagNone ["no-elide"] (\opts -> setboolopt "no-elide" opts) "don't squash boring parent accounts (in tree mode)"-     ,flagReq  ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)"-     ,flagNone ["pretty-tables"] (\opts -> setboolopt "pretty-tables" opts) "use unicode when displaying tables"-     ]-    ,groupHidden = []-    ,groupNamed = [generalflagsgroup1]-    }- }- where-   defType :: BalanceType -> String-   defType bt | bt == bvtype = " (default)"-              | otherwise    = ""--balanceviewQueryReport-    :: ReportOpts-    -> Query-    -> Journal-    -> String-    -> (Journal -> Query)-    -> ([String], Sum MixedAmount)-balanceviewQueryReport ropts q0 j t q = ([view], Sum amt)-    where-      q' = And [q0, q j]-      rep@(_ , amt)-        -- For --historical/--cumulative, we must use multiBalanceReport.-        -- (This forces --no-elide.)-        -- See Balance.hs's implementation of 'balance' for more information-        | balancetype_ ropts `elem` [HistoricalBalance, CumulativeChange]-            = singleBalanceReport ropts q' j-        | otherwise-            = balanceReport ropts q' j-      view = intercalate "\n" [t <> ":", balanceReportAsText ropts rep]--multiBalanceviewQueryReport-    :: ReportOpts-    -> Query-    -> Journal-    -> String-    -> (Journal -> Query)-    -> ([Table String String MixedAmount], [[MixedAmount]], Sum MixedAmount)-multiBalanceviewQueryReport ropts q0 j t q = ([tabl], [coltotals], Sum tot)-    where-      singlesection = "Cash" `isPrefixOf` t -- TODO temp-      ropts' = ropts { no_total_ = singlesection && no_total_ ropts, empty_ = True }-      q' = And [q0, q j]-      MultiBalanceReport (dates, rows, (coltotals,tot,avg)) =-          multiBalanceReport ropts' q' j-      rows' | empty_ ropts = rows-            | otherwise    = filter (not . emptyRow) rows-        where-          emptyRow (_,_,_,amts,_,_) = all isZeroMixedAmount amts-      r = MultiBalanceReport (dates, rows', (coltotals, tot, avg))-      Table hLeft hTop dat = balanceReportAsTable ropts' r-      tabl = Table (T.Group SingleLine [Header t, hLeft]) hTop ([]:dat)---- | Prints out a balance report according to a given view-balanceviewReport :: BalanceView -> CliOpts -> Journal -> IO ()-balanceviewReport BalanceView{..} CliOpts{command_=cmd, reportopts_=ropts, rawopts_=raw} j = do-    currDay   <- getCurrentDay-    let q0 = queryFromOpts currDay ropts'-    let title = bvtitle ++ maybe "" (' ':) balanceclarification-    case interval_ ropts' of-      NoInterval -> do-        let (views, amt) =-              foldMap (uncurry (balanceviewQueryReport ropts' q0 j))-                 bvqueries-        mapM_ putStrLn (title : "" : views)--        unless (no_total_ ropts' || cmd=="cashflow") . mapM_ putStrLn $ -- TODO temp-          [ "Total:"-          , "--------------------"-          , padLeftWide 20 $ showamt (getSum amt)-          ]-      _ -> do-        let (tabls, amts, Sum totsum)-              = foldMap (uncurry (multiBalanceviewQueryReport ropts' q0 j)) bvqueries-            sumAmts = case amts of-              a1:as -> foldl' (zipWith (+)) a1 as-              []    -> []-            totavg = totsum `divideMixedAmount` fromIntegral (length sumAmts)-            mergedTabl = case tabls of-              t1:ts -> foldl' merging t1 ts-              []    -> T.empty-            totTabl-              | no_total_ ropts' || length bvqueries == 1 =-                  mergedTabl-              | otherwise =-                  mergedTabl-                  +====+-                  row "Total"-                      (sumAmts ++ (if row_total_ ropts' && not (null sumAmts) then [totsum] else [])-                               ++ (if average_ ropts' && not (null sumAmts)   then [totavg] else [])-                      )-        putStrLn title-        putStrLn $ renderBalanceReportTable ropts totTabl-  where-    showamt | color_ ropts = cshowMixedAmountWithoutPrice-            | otherwise    = showMixedAmountWithoutPrice-    overwriteBalanceType =-      case reverse $ filter (`elem` ["change","cumulative","historical"]) $ map fst raw of-        "historical":_ -> Just HistoricalBalance-        "cumulative":_ -> Just CumulativeChange-        "change":_     -> Just PeriodChange-        _              -> Nothing-    balancetype = fromMaybe bvtype overwriteBalanceType-    -- we must clarify that the statements aren't actual income statements,-    -- etc. if the user overrides the balance type-    balanceclarification = flip fmap overwriteBalanceType $ \t ->-      case t of-        PeriodChange      -> "(Balance Changes)"-        CumulativeChange  -> "(Cumulative Ending Balances)"-        HistoricalBalance -> "(Historical Ending Balances)"-    ropts' = treeIfNotPeriod $ ropts { balancetype_ = balancetype }-        -- For --historical/--cumulative, we must use multiBalanceReport.-        -- (This forces --no-elide.)-        -- These settings format the output in a way that we can convert to-        -- a normal balance report using singleBalanceReport.  See-        -- Balance.hs for more information.-    treeIfNotPeriod-      | flat_ ropts = id-      | otherwise   = case (balancetype, interval_ ropts) of-          (HistoricalBalance, NoInterval) -> \o ->-              o { accountlistmode_ = ALTree }-          (CumulativeChange , NoInterval) -> \o ->-              o { accountlistmode_ = ALTree }-          _                               -> id-    merging (Table hLeft hTop dat) (Table hLeft' _ dat') =-        Table (T.Group DoubleLine [hLeft, hLeft']) hTop (dat ++ dat')
Hledger/Cli/Balancesheet.hs view
@@ -17,28 +17,29 @@  import Hledger import Hledger.Cli.CliOptions-import Hledger.Cli.BalanceView+import Hledger.Cli.CompoundBalanceCommand -bsBV = BalanceView {-         bvmode     = "balancesheet",-         bvaliases  = ["bs"],-         bvhelp     = [here|This command displays a simple balance sheet, showing historical ending+balancesheetSpec = CompoundBalanceCommandSpec {+  cbcname     = "balancesheet",+  cbcaliases  = ["bs"],+  cbchelp     = [here|+This command displays a simple balance sheet, showing historical ending balances of asset and liability accounts (ignoring any report begin date).  It assumes that these accounts are under a top-level `asset` or `liability`-account (plural forms also  allowed).-          |],-         bvtitle    = "Balance Sheet",-         bvqueries  = [ ("Assets"     , journalAssetAccountQuery),-                        ("Liabilities", journalLiabilityAccountQuery)-                      ],-         bvtype     = HistoricalBalance-      }+account (case insensitive, plural forms also  allowed).+  |],+  cbctitle    = "Balance Sheet",+  cbcqueries  = [ ("Assets"     , journalAssetAccountQuery),+                 ("Liabilities", journalLiabilityAccountQuery)+               ],+  cbctype     = HistoricalBalance+}  balancesheetmode :: Mode RawOpts-balancesheetmode = balanceviewmode bsBV+balancesheetmode = compoundBalanceCommandMode balancesheetSpec  balancesheet :: CliOpts -> Journal -> IO ()-balancesheet = balanceviewReport bsBV+balancesheet = compoundBalanceCommand balancesheetSpec  tests_Hledger_Cli_Balancesheet :: Test tests_Hledger_Cli_Balancesheet = TestList
Hledger/Cli/Cashflow.hs view
@@ -20,26 +20,27 @@  import Hledger import Hledger.Cli.CliOptions-import Hledger.Cli.BalanceView+import Hledger.Cli.CompoundBalanceCommand -cfBV = BalanceView {-         bvmode     = "cashflow",-         bvaliases  = ["cf"],-         bvhelp     = [here|This command displays a simple cashflow statement, showing changes+cashflowSpec = CompoundBalanceCommandSpec {+  cbcname     = "cashflow",+  cbcaliases  = ["cf"],+  cbchelp     = [here|+This command displays a simple cashflow statement, showing changes in "cash" accounts. It assumes that these accounts are under a top-level -`asset` account and do not contain `receivable` or `A/R` in their name -(plural forms also allowed). -          |],-         bvtitle    = "Cashflow Statement",-         bvqueries  = [("Cash flows", journalCashAccountQuery)],-         bvtype     = PeriodChange-      }+`asset` account (case insensitive, plural forms also allowed) and do not +contain `receivable` or `A/R` in their name. +  |],+  cbctitle    = "Cashflow Statement",+  cbcqueries  = [("Cash flows", journalCashAccountQuery)],+  cbctype     = PeriodChange+}  cashflowmode :: Mode RawOpts-cashflowmode = balanceviewmode cfBV+cashflowmode = compoundBalanceCommandMode cashflowSpec  cashflow :: CliOpts -> Journal -> IO ()-cashflow = balanceviewReport cfBV+cashflow = compoundBalanceCommand cashflowSpec  tests_Hledger_Cli_Cashflow :: Test tests_Hledger_Cli_Cashflow = TestList
Hledger/Cli/CliOptions.hs view
@@ -5,7 +5,7 @@  -} -{-# LANGUAGE CPP, ScopedTypeVariables, DeriveDataTypeable, FlexibleContexts, TypeFamilies #-}+{-# LANGUAGE CPP, ScopedTypeVariables, DeriveDataTypeable, FlexibleContexts, TypeFamilies, OverloadedStrings #-}  module Hledger.Cli.CliOptions ( @@ -90,7 +90,7 @@ import System.Exit (exitSuccess) import System.FilePath import Test.HUnit-import Text.Megaparsec+import Text.Megaparsec.Compat  import Hledger import Hledger.Cli.DocFiles@@ -548,7 +548,7 @@ widthFromOpts :: CliOpts -> Int widthFromOpts CliOpts{width_=Nothing, available_width_=w} = w widthFromOpts CliOpts{width_=Just s}  =-    case runParser (read `fmap` some digitChar <* eof :: ParsecT Dec String Identity Int) "(unknown)" s of+    case runParser (read `fmap` some digitChar <* eof :: ParsecT MPErr String Identity Int) "(unknown)" s of         Left e   -> usageError $ "could not parse width option: "++show e         Right w  -> w @@ -570,7 +570,7 @@         Left e   -> usageError $ "could not parse width option: "++show e         Right ws -> ws     where-        registerwidthp :: (Stream s, Char ~ Token s) => ParsecT Dec s m (Int, Maybe Int)+        registerwidthp :: (Stream s, Char ~ Token s) => ParsecT MPErr s m (Int, Maybe Int)         registerwidthp = do           totalwidth <- read `fmap` some digitChar           descwidth <- optional (char ',' >> read `fmap` some digitChar)@@ -660,10 +660,10 @@ isHledgerExeName = isRight . parsewith hledgerexenamep . T.pack     where       hledgerexenamep = do-        _ <- string progname+        _ <- mptext $ T.pack progname         _ <- char '-'-        _ <- some (noneOf ".")-        optional (string "." >> choice' (map string addonExtensions))+        _ <- some $ noneOf ['.']+        optional (string "." >> choice' (map (mptext . T.pack) addonExtensions))         eof  stripAddonExtension :: String -> String
+ Hledger/Cli/CompoundBalanceCommand.hs view
@@ -0,0 +1,213 @@+{-# LANGUAGE OverloadedStrings, RecordWildCards #-}+{-|++Common helpers for making multi-section balance report commands +like balancesheet, cashflow, and incomestatement.++-}++module Hledger.Cli.CompoundBalanceCommand (+  CompoundBalanceCommandSpec(..)+ ,compoundBalanceCommandMode+ ,compoundBalanceCommand+) where++import Control.Monad (unless)+import Data.List (intercalate, foldl', isPrefixOf)+import Data.Maybe (fromMaybe)+import Data.Monoid (Sum(..), (<>))+import System.Console.CmdArgs.Explicit as C+import Text.Tabular as T++import Hledger+import Hledger.Cli.Balance+import Hledger.Cli.CliOptions++-- | Description of a compound balance report command, +-- from which we generate the command's cmdargs mode and IO action.+-- A compound balance report shows one or more sections/subreports, +-- each with its own title and subtotals row, in a certain order, +-- plus a grand totals row if there's more than one section.+-- Examples are the balancesheet, cashflow and incomestatement commands.+data CompoundBalanceCommandSpec = CompoundBalanceCommandSpec {+  cbcname     :: String,                        -- ^ command name+  cbcaliases  :: [String],                      -- ^ command aliases+  cbchelp     :: String,                        -- ^ command line help+  cbctitle    :: String,                        -- ^ overall report title+  cbcqueries  :: [(String, Journal -> Query)],  -- ^ title and (journal-parameterised) query for each subreport+  cbctype     :: BalanceType                    -- ^ the type of "balance" this report shows (overrides command line flags)+}++-- | Generate a cmdargs option-parsing mode from a compound balance command +-- specification.+compoundBalanceCommandMode :: CompoundBalanceCommandSpec -> Mode RawOpts+compoundBalanceCommandMode CompoundBalanceCommandSpec{..} = (defCommandMode $ cbcname : cbcaliases) {+  modeHelp = cbchelp `withAliases` cbcaliases+ ,modeGroupFlags = C.Group {+     groupUnnamed = [+      flagNone ["change"] (\opts -> setboolopt "change" opts)+        ("show balance change in each period" ++ defType PeriodChange)+     ,flagNone ["cumulative"] (\opts -> setboolopt "cumulative" opts)+        ("show balance change accumulated across periods (in multicolumn reports)"+            ++ defType CumulativeChange+        )+     ,flagNone ["historical","H"] (\opts -> setboolopt "historical" opts)+        ("show historical ending balance in each period (includes postings before report start date)"+            ++ defType HistoricalBalance+        )+     ,flagNone ["flat"] (\opts -> setboolopt "flat" opts) "show accounts as a list"+     ,flagReq  ["drop"] (\s opts -> Right $ setopt "drop" s opts) "N" "flat mode: omit N leading account name parts"+     ,flagNone ["no-total","N"] (\opts -> setboolopt "no-total" opts) "omit the final total row"+     ,flagNone ["tree"] (\opts -> setboolopt "tree" opts) "show accounts as a tree; amounts include subaccounts (default in simple reports)"+     ,flagNone ["average","A"] (\opts -> setboolopt "average" opts) "show a row average column (in multicolumn reports)"+     ,flagNone ["row-total","T"] (\opts -> setboolopt "row-total" opts) "show a row total column (in multicolumn reports)"+     ,flagNone ["no-elide"] (\opts -> setboolopt "no-elide" opts) "don't squash boring parent accounts (in tree mode)"+     ,flagReq  ["format"] (\s opts -> Right $ setopt "format" s opts) "FORMATSTR" "use this custom line format (in simple reports)"+     ,flagNone ["pretty-tables"] (\opts -> setboolopt "pretty-tables" opts) "use unicode when displaying tables"+     ]+    ,groupHidden = []+    ,groupNamed = [generalflagsgroup1]+    }+ }+ where+   defType :: BalanceType -> String+   defType bt | bt == cbctype = " (default)"+              | otherwise    = ""++-- | Generate a runnable command from a compound balance command specification.+compoundBalanceCommand :: CompoundBalanceCommandSpec -> (CliOpts -> Journal -> IO ())+compoundBalanceCommand CompoundBalanceCommandSpec{..} CliOpts{command_=cmd, reportopts_=ropts, rawopts_=rawopts} j = do+    d <- getCurrentDay+    let+      -- use the default balance type for this report, unless the user overrides  +      mBalanceTypeOverride =+        case reverse $ filter (`elem` ["change","cumulative","historical"]) $ map fst rawopts of+          "historical":_ -> Just HistoricalBalance+          "cumulative":_ -> Just CumulativeChange+          "change":_     -> Just PeriodChange+          _              -> Nothing+      balancetype = fromMaybe cbctype mBalanceTypeOverride+      -- when user overrides, add an indication to the report title+      title = cbctitle ++ maybe "" (' ':) mtitleclarification+        where+          mtitleclarification = flip fmap mBalanceTypeOverride $ \t ->+            case t of+              PeriodChange      -> "(Balance Changes)"+              CumulativeChange  -> "(Cumulative Ending Balances)"+              HistoricalBalance -> "(Historical Ending Balances)"+      -- set balance type and possibly tree mode in the report options. Some older notes: +      -- For --historical/--cumulative, we must use multiBalanceReport (this forces --no-elide).+      -- These settings format the output in a way that we can convert to a normal balance report +      -- using singleBalanceReport, see Balance.hs for more information.+      ropts'+        | not (flat_ ropts) && +          interval_ ropts==NoInterval && +          balancetype `elem` [CumulativeChange, HistoricalBalance]+            = ropts{balancetype_=balancetype, accountlistmode_=ALTree}+        | otherwise+            = ropts{balancetype_=balancetype}+      userq = queryFromOpts d ropts'++    case interval_ ropts' of++      -- single-column report+      NoInterval -> do+        let (subreportstr, total) = foldMap (uncurry (compoundBalanceCommandSingleColumnReport ropts' userq j)) cbcqueries+        putStrLn $ title ++ "\n"+        mapM_ putStrLn subreportstr+        unless (no_total_ ropts' || cmd=="cashflow") . mapM_ putStrLn $ -- TODO temp+          [ "Total:"+          , "--------------------"+          , padLeftWide 20 $ showamt (getSum total)+          ]+        where+          showamt | color_ ropts' = cshowMixedAmountWithoutPrice+                  | otherwise    = showMixedAmountWithoutPrice+          +      -- multi-column report+      _ -> do+        let+          (subreporttables, subreporttotals, Sum overalltotal) = foldMap (uncurry (compoundBalanceCommandMultiColumnReports ropts' userq j)) cbcqueries+          overalltable = case subreporttables of+            t1:ts -> foldl' concatTables t1 ts+            []    -> T.empty+          overalltable'+            | no_total_ ropts' || length cbcqueries == 1 =+                overalltable+            | otherwise =+                overalltable+                +====++                row "Total" overalltotals'+              where+                overalltotals = case subreporttotals of+                  [] -> []+                  ts -> foldl' (zipWith (+)) zeros ts'+                    where+                      -- A subreport might be empty and have no subtotals, count those as zeroes (#588).+                      -- Varying-length subtotals rows are handled similarly, though that is not expected to happen.  +                      len = maximum $ map length ts+                      ts' = [take len $ as ++ repeat nullmixedamt | as <- ts]+                      zeros = replicate len nullmixedamt+                overalltotals'+                  | null overalltotals = []+                  | otherwise =  overalltotals+                                 ++ (if row_total_ ropts' then [overalltotal]   else [])+                                 ++ (if average_ ropts'   then [overallaverage] else [])+                    where+                      overallaverage = overalltotal `divideMixedAmount` fromIntegral (length overalltotals)+        putStrLn title+        putStrLn $ renderBalanceReportTable ropts' overalltable'++-- Add the second table below the first, discarding its column headings.+concatTables (Table hLeft hTop dat) (Table hLeft' _ dat') =+    Table (T.Group DoubleLine [hLeft, hLeft']) hTop (dat ++ dat')++-- | Run one subreport for a single-column compound balance command.+-- Currently this returns the plain text rendering of the subreport,+-- and its total.+compoundBalanceCommandSingleColumnReport+    :: ReportOpts+    -> Query+    -> Journal+    -> String+    -> (Journal -> Query)+    -> ([String], Sum MixedAmount)+compoundBalanceCommandSingleColumnReport ropts q0 j t q = ([view], Sum amt)+    where+      q' = And [q0, q j]+      rep@(_ , amt)+        -- For --historical/--cumulative, we must use multiBalanceReport.+        -- (This forces --no-elide.)+        -- See Balance.hs's implementation of 'balance' for more information+        | balancetype_ ropts `elem` [HistoricalBalance, CumulativeChange]+            = singleBalanceReport ropts q' j+        | otherwise+            = balanceReport ropts q' j+      view = intercalate "\n" [t <> ":", balanceReportAsText ropts rep]++-- | Run all the subreports for a multi-column compound balance command.+-- Currently this returns a table of rendered balance amounts for each +-- subreport (including a totals row), the totals row for each subreport +-- (again, as mixedamounts), and the grand total.+compoundBalanceCommandMultiColumnReports+    :: ReportOpts+    -> Query+    -> Journal+    -> String+    -> (Journal -> Query)+    -> ([Table String String MixedAmount], [[MixedAmount]], Sum MixedAmount)+compoundBalanceCommandMultiColumnReports ropts q0 j t q = ([tabl], [coltotals], Sum tot)+    where+      singlesection = "Cash" `isPrefixOf` t -- TODO temp+      ropts' = ropts { no_total_ = singlesection && no_total_ ropts, empty_ = True }+      q' = And [q0, q j]+      MultiBalanceReport (dates, rows, (coltotals,tot,avg)) =+          multiBalanceReport ropts' q' j+      rows' | empty_ ropts = rows+            | otherwise    = filter (not . emptyRow) rows+        where+          emptyRow (_,_,_,amts,_,_) = all isZeroMixedAmount amts+      r = MultiBalanceReport (dates, rows', (coltotals, tot, avg))+      Table hLeft hTop dat = balanceReportAsTable ropts' r+      tabl = Table (T.Group SingleLine [Header t, hLeft]) hTop ([]:dat)+
Hledger/Cli/Incomestatement.hs view
@@ -1,7 +1,7 @@ {-# LANGUAGE QuasiQuotes, TemplateHaskell, OverloadedStrings, NoCPP #-} {-| -The @incomestatement@ command prints a simple income statement (profit & loss) report.+The @incomestatement@ command prints a simple income statement (profit & loss report).  -} @@ -17,29 +17,29 @@  import Hledger import Hledger.Cli.CliOptions-import Hledger.Cli.BalanceView+import Hledger.Cli.CompoundBalanceCommand -isBV = BalanceView {-         bvmode     = "incomestatement",-         bvaliases  = ["is"],-         bvhelp     = [here|This command displays a simple income statement, showing revenues+incomestatementSpec = CompoundBalanceCommandSpec {+  cbcname     = "incomestatement",+  cbcaliases  = ["is"],+  cbchelp     = [here|+This command displays a simple income statement, showing revenues and expenses during a period. It assumes that these accounts are under a -top-level `revenue` or `income` or `expense` account (plural forms -also allowed).--          |],-         bvtitle    = "Income Statement",-         bvqueries  = [ ("Revenues", journalIncomeAccountQuery),-                        ("Expenses", journalExpenseAccountQuery)-                      ],-         bvtype     = PeriodChange-      }+top-level `revenue` or `income` or `expense` account (case insensitive,+plural forms also allowed).+  |],+  cbctitle    = "Income Statement",+  cbcqueries  = [ ("Revenues", journalIncomeAccountQuery),+                 ("Expenses", journalExpenseAccountQuery)+               ],+  cbctype     = PeriodChange+}  incomestatementmode :: Mode RawOpts-incomestatementmode = balanceviewmode isBV+incomestatementmode = compoundBalanceCommandMode incomestatementSpec  incomestatement :: CliOpts -> Journal -> IO ()-incomestatement = balanceviewReport isBV+incomestatement = compoundBalanceCommand incomestatementSpec  tests_Hledger_Cli_Incomestatement :: Test tests_Hledger_Cli_Incomestatement = TestList
doc/hledger.1 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger" "1" "June 2017" "hledger 1.3" "hledger User Manuals"+.TH "hledger" "1" "August 2017" "hledger 1.3.1" "hledger User Manuals"   
doc/hledger.1.info view
@@ -3,8 +3,8 @@  File: hledger.1.info,  Node: Top,  Next: EXAMPLES,  Up: (dir) -hledger(1) hledger 1.3-**********************+hledger(1) hledger 1.3.1+************************  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@@ -2113,129 +2113,129 @@  Tag Table: Node: Top70-Node: EXAMPLES1886-Ref: #examples1988-Node: OPTIONS3634-Ref: #options3738-Node: General options4019-Ref: #general-options4146-Node: Command options6684-Ref: #command-options6837-Node: Command arguments7235-Ref: #command-arguments7395-Node: Special characters7516-Ref: #special-characters7674-Node: Input files8842-Ref: #input-files8980-Node: Smart dates10943-Ref: #smart-dates11086-Node: Report start & end date12065-Ref: #report-start-end-date12237-Node: Report intervals13303-Ref: #report-intervals13468-Node: Period expressions13869-Ref: #period-expressions14029-Node: Depth limiting16369-Ref: #depth-limiting16515-Node: Pivoting16716-Ref: #pivoting16836-Node: Cost18607-Ref: #cost18717-Node: Market value18835-Ref: #market-value18972-Node: Regular expressions20272-Ref: #regular-expressions20410-Node: QUERIES21771-Ref: #queries21875-Node: COMMANDS25540-Ref: #commands25654-Node: accounts26327-Ref: #accounts26427-Node: activity27409-Ref: #activity27521-Node: add27880-Ref: #add27981-Node: balance30639-Ref: #balance30752-Node: Flat mode33767-Ref: #flat-mode33894-Node: Depth limited balance reports34314-Ref: #depth-limited-balance-reports34517-Node: Multicolumn balance reports34937-Ref: #multicolumn-balance-reports35148-Node: Custom balance output39796-Ref: #custom-balance-output39980-Node: Colour support42073-Ref: #colour-support42234-Node: Output destination42407-Ref: #output-destination42565-Node: CSV output42835-Ref: #csv-output42954-Node: balancesheet43351-Ref: #balancesheet43479-Node: cashflow45386-Ref: #cashflow45503-Node: help47371-Ref: #help47483-Node: incomestatement48321-Ref: #incomestatement48451-Node: info50343-Ref: #info50450-Node: man50814-Ref: #man50911-Node: print51316-Ref: #print51421-Node: register55177-Ref: #register55290-Node: Custom register output59786-Ref: #custom-register-output59917-Node: stats61214-Ref: #stats61320-Node: test62201-Ref: #test62288-Node: ADD-ON COMMANDS62656-Ref: #add-on-commands62768-Node: Official add-ons64055-Ref: #official-add-ons64197-Node: api64284-Ref: #api64375-Node: ui64427-Ref: #ui64528-Node: web64586-Ref: #web64677-Node: Third party add-ons64723-Ref: #third-party-add-ons64900-Node: diff65035-Ref: #diff65134-Node: iadd65233-Ref: #iadd65349-Node: interest65432-Ref: #interest65555-Node: irr65650-Ref: #irr65750-Node: Experimental add-ons65828-Ref: #experimental-add-ons65982-Node: autosync66375-Ref: #autosync66489-Node: budget66728-Ref: #budget66852-Node: chart66918-Ref: #chart67037-Node: check67108-Ref: #check67232-Node: check-dates67299-Ref: #check-dates67441-Node: check-dupes67514-Ref: #check-dupes67657-Node: equity67734-Ref: #equity67862-Node: prices67981-Ref: #prices68110-Node: print-unique68165-Ref: #print-unique68314-Node: register-match68407-Ref: #register-match68563-Node: rewrite68661-Ref: #rewrite68782+Node: EXAMPLES1890+Ref: #examples1992+Node: OPTIONS3638+Ref: #options3742+Node: General options4023+Ref: #general-options4150+Node: Command options6688+Ref: #command-options6841+Node: Command arguments7239+Ref: #command-arguments7399+Node: Special characters7520+Ref: #special-characters7678+Node: Input files8846+Ref: #input-files8984+Node: Smart dates10947+Ref: #smart-dates11090+Node: Report start & end date12069+Ref: #report-start-end-date12241+Node: Report intervals13307+Ref: #report-intervals13472+Node: Period expressions13873+Ref: #period-expressions14033+Node: Depth limiting16373+Ref: #depth-limiting16519+Node: Pivoting16720+Ref: #pivoting16840+Node: Cost18611+Ref: #cost18721+Node: Market value18839+Ref: #market-value18976+Node: Regular expressions20276+Ref: #regular-expressions20414+Node: QUERIES21775+Ref: #queries21879+Node: COMMANDS25544+Ref: #commands25658+Node: accounts26331+Ref: #accounts26431+Node: activity27413+Ref: #activity27525+Node: add27884+Ref: #add27985+Node: balance30643+Ref: #balance30756+Node: Flat mode33771+Ref: #flat-mode33898+Node: Depth limited balance reports34318+Ref: #depth-limited-balance-reports34521+Node: Multicolumn balance reports34941+Ref: #multicolumn-balance-reports35152+Node: Custom balance output39800+Ref: #custom-balance-output39984+Node: Colour support42077+Ref: #colour-support42238+Node: Output destination42411+Ref: #output-destination42569+Node: CSV output42839+Ref: #csv-output42958+Node: balancesheet43355+Ref: #balancesheet43483+Node: cashflow45390+Ref: #cashflow45507+Node: help47375+Ref: #help47487+Node: incomestatement48325+Ref: #incomestatement48455+Node: info50347+Ref: #info50454+Node: man50818+Ref: #man50915+Node: print51320+Ref: #print51425+Node: register55181+Ref: #register55294+Node: Custom register output59790+Ref: #custom-register-output59921+Node: stats61218+Ref: #stats61324+Node: test62205+Ref: #test62292+Node: ADD-ON COMMANDS62660+Ref: #add-on-commands62772+Node: Official add-ons64059+Ref: #official-add-ons64201+Node: api64288+Ref: #api64379+Node: ui64431+Ref: #ui64532+Node: web64590+Ref: #web64681+Node: Third party add-ons64727+Ref: #third-party-add-ons64904+Node: diff65039+Ref: #diff65138+Node: iadd65237+Ref: #iadd65353+Node: interest65436+Ref: #interest65559+Node: irr65654+Ref: #irr65754+Node: Experimental add-ons65832+Ref: #experimental-add-ons65986+Node: autosync66379+Ref: #autosync66493+Node: budget66732+Ref: #budget66856+Node: chart66922+Ref: #chart67041+Node: check67112+Ref: #check67236+Node: check-dates67303+Ref: #check-dates67445+Node: check-dupes67518+Ref: #check-dupes67661+Node: equity67738+Ref: #equity67866+Node: prices67985+Ref: #prices68114+Node: print-unique68169+Ref: #print-unique68318+Node: register-match68411+Ref: #register-match68567+Node: rewrite68665+Ref: #rewrite68786  End Tag Table
doc/hledger.1.txt view
@@ -1878,4 +1878,4 @@   -hledger 1.3                        June 2017                        hledger(1)+hledger 1.3.1                     August 2017                       hledger(1)
doc/other/hledger-api.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-api" "1" "June 2017" "hledger\-api 1.3" "hledger User Manuals"+.TH "hledger\-api" "1" "August 2017" "hledger\-api 1.3.1" "hledger User Manuals"   
doc/other/hledger-api.1.info view
@@ -3,8 +3,8 @@  File: hledger-api.1.info,  Node: Top,  Next: OPTIONS,  Up: (dir) -hledger-api(1) hledger-api 1.3-******************************+hledger-api(1) hledger-api 1.3.1+********************************  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@@ -73,7 +73,7 @@  Tag Table: Node: Top74-Node: OPTIONS1220-Ref: #options1307+Node: OPTIONS1224+Ref: #options1311  End Tag Table
doc/other/hledger-api.1.txt view
@@ -107,4 +107,4 @@   -hledger-api 1.3                    June 2017                    hledger-api(1)+hledger-api 1.3.1                 August 2017                   hledger-api(1)
doc/other/hledger-ui.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-ui" "1" "June 2017" "hledger\-ui 1.3" "hledger User Manuals"+.TH "hledger\-ui" "1" "August 2017" "hledger\-ui 1.3.1" "hledger User Manuals"   
doc/other/hledger-ui.1.info view
@@ -3,8 +3,8 @@  File: hledger-ui.1.info,  Node: Top,  Next: OPTIONS,  Up: (dir) -hledger-ui(1) hledger-ui 1.3-****************************+hledger-ui(1) hledger-ui 1.3.1+******************************  hledger-ui is hledger's curses-style interface, providing an efficient full-window text UI for viewing accounts and transactions, and some@@ -365,19 +365,19 @@  Tag Table: Node: Top73-Node: OPTIONS825-Ref: #options924-Node: KEYS3665-Ref: #keys3762-Node: SCREENS6558-Ref: #screens6645-Node: Accounts screen6735-Ref: #accounts-screen6865-Node: Register screen9095-Ref: #register-screen9252-Node: Transaction screen11326-Ref: #transaction-screen11486-Node: Error screen12356-Ref: #error-screen12480+Node: OPTIONS829+Ref: #options928+Node: KEYS3669+Ref: #keys3766+Node: SCREENS6562+Ref: #screens6649+Node: Accounts screen6739+Ref: #accounts-screen6869+Node: Register screen9099+Ref: #register-screen9256+Node: Transaction screen11330+Ref: #transaction-screen11490+Node: Error screen12360+Ref: #error-screen12484  End Tag Table
doc/other/hledger-ui.1.txt view
@@ -369,4 +369,4 @@   -hledger-ui 1.3                     June 2017                     hledger-ui(1)+hledger-ui 1.3.1                  August 2017                    hledger-ui(1)
doc/other/hledger-web.1 view
@@ -1,5 +1,5 @@ -.TH "hledger\-web" "1" "June 2017" "hledger\-web 1.3" "hledger User Manuals"+.TH "hledger\-web" "1" "August 2017" "hledger\-web 1.3.1" "hledger User Manuals"   
doc/other/hledger-web.1.info view
@@ -3,8 +3,8 @@  File: hledger-web.1.info,  Node: Top,  Next: OPTIONS,  Up: (dir) -hledger-web(1) hledger-web 1.3-******************************+hledger-web(1) hledger-web 1.3.1+********************************  hledger-web is hledger's web interface.  It starts a simple web application for browsing and adding transactions, and optionally opens@@ -201,7 +201,7 @@  Tag Table: Node: Top74-Node: OPTIONS3156-Ref: #options3243+Node: OPTIONS3160+Ref: #options3247  End Tag Table
doc/other/hledger-web.1.txt view
@@ -237,4 +237,4 @@   -hledger-web 1.3                    June 2017                    hledger-web(1)+hledger-web 1.3.1                 August 2017                   hledger-web(1)
doc/other/hledger_csv.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_csv" "5" "June 2017" "hledger 1.3" "hledger User Manuals"+.TH "hledger_csv" "5" "August 2017" "hledger 1.3.1" "hledger User Manuals"   
doc/other/hledger_csv.5.info view
@@ -3,8 +3,8 @@  File: hledger_csv.5.info,  Node: Top,  Next: CSV RULES,  Up: (dir) -hledger_csv(5) hledger 1.3-**************************+hledger_csv(5) hledger 1.3.1+****************************  hledger can read CSV files, converting each CSV record into a journal entry (transaction), if you provide some conversion hints in a "rules@@ -201,21 +201,21 @@  Tag Table: Node: Top74-Node: CSV RULES810-Ref: #csv-rules920-Node: skip1163-Ref: #skip1259-Node: date-format1431-Ref: #date-format1560-Node: field list2066-Ref: #field-list2205-Node: field assignment2910-Ref: #field-assignment3067-Node: conditional block3571-Ref: #conditional-block3727-Node: include4623-Ref: #include4734-Node: CSV TIPS4965-Ref: #csv-tips5061+Node: CSV RULES814+Ref: #csv-rules924+Node: skip1167+Ref: #skip1263+Node: date-format1435+Ref: #date-format1564+Node: field list2070+Ref: #field-list2209+Node: field assignment2914+Ref: #field-assignment3071+Node: conditional block3575+Ref: #conditional-block3731+Node: include4627+Ref: #include4738+Node: CSV TIPS4969+Ref: #csv-tips5065  End Tag Table
doc/other/hledger_csv.5.txt view
@@ -171,4 +171,4 @@   -hledger 1.3                        June 2017                    hledger_csv(5)+hledger 1.3.1                     August 2017                   hledger_csv(5)
doc/other/hledger_journal.5 view
@@ -1,6 +1,6 @@ .\"t -.TH "hledger_journal" "5" "June 2017" "hledger 1.3" "hledger User Manuals"+.TH "hledger_journal" "5" "August 2017" "hledger 1.3.1" "hledger User Manuals"   
doc/other/hledger_journal.5.info view
@@ -4,8 +4,8 @@  File: hledger_journal.5.info,  Node: Top,  Next: FILE FORMAT,  Up: (dir) -hledger_journal(5) hledger 1.3-******************************+hledger_journal(5) hledger 1.3.1+********************************  hledger's usual data source is a plain text file containing journal entries in hledger journal format.  This file represents a standard@@ -1047,83 +1047,83 @@  Tag Table: Node: Top78-Node: FILE FORMAT2292-Ref: #file-format2418-Node: Transactions2625-Ref: #transactions2748-Node: Postings3313-Ref: #postings3442-Node: Dates4437-Ref: #dates4554-Node: Simple dates4619-Ref: #simple-dates4747-Node: Secondary dates5113-Ref: #secondary-dates5269-Node: Posting dates6832-Ref: #posting-dates6963-Node: Status8337-Ref: #status8461-Node: Account names10175-Ref: #account-names10315-Node: Amounts10802-Ref: #amounts10940-Node: Virtual Postings13041-Ref: #virtual-postings13202-Node: Balance Assertions14422-Ref: #balance-assertions14599-Node: Assertions and ordering15495-Ref: #assertions-and-ordering15683-Node: Assertions and included files16383-Ref: #assertions-and-included-files16626-Node: Assertions and multiple -f options16959-Ref: #assertions-and-multiple--f-options17215-Node: Assertions and commodities17347-Ref: #assertions-and-commodities17584-Node: Assertions and subaccounts18280-Ref: #assertions-and-subaccounts18514-Node: Assertions and virtual postings19035-Ref: #assertions-and-virtual-postings19244-Node: Balance Assignments19386-Ref: #balance-assignments19555-Node: Prices20674-Ref: #prices20809-Node: Transaction prices20860-Ref: #transaction-prices21007-Node: Market prices23163-Ref: #market-prices23300-Node: Comments24260-Ref: #comments24384-Node: Tags25497-Ref: #tags25617-Node: Implicit tags27046-Ref: #implicit-tags27154-Node: Directives27671-Ref: #directives27786-Node: Account aliases27979-Ref: #account-aliases28125-Node: Basic aliases28729-Ref: #basic-aliases28874-Node: Regex aliases29564-Ref: #regex-aliases29734-Node: Multiple aliases30449-Ref: #multiple-aliases30623-Node: end aliases31121-Ref: #end-aliases31263-Node: account directive31364-Ref: #account-directive31546-Node: apply account directive31842-Ref: #apply-account-directive32040-Node: Multi-line comments32699-Ref: #multi-line-comments32891-Node: commodity directive33019-Ref: #commodity-directive33205-Node: Default commodity34077-Ref: #default-commodity34252-Node: Default year34789-Ref: #default-year34956-Node: Including other files35379-Ref: #including-other-files35538-Node: EDITOR SUPPORT35935-Ref: #editor-support36055+Node: FILE FORMAT2296+Ref: #file-format2422+Node: Transactions2629+Ref: #transactions2752+Node: Postings3317+Ref: #postings3446+Node: Dates4441+Ref: #dates4558+Node: Simple dates4623+Ref: #simple-dates4751+Node: Secondary dates5117+Ref: #secondary-dates5273+Node: Posting dates6836+Ref: #posting-dates6967+Node: Status8341+Ref: #status8465+Node: Account names10179+Ref: #account-names10319+Node: Amounts10806+Ref: #amounts10944+Node: Virtual Postings13045+Ref: #virtual-postings13206+Node: Balance Assertions14426+Ref: #balance-assertions14603+Node: Assertions and ordering15499+Ref: #assertions-and-ordering15687+Node: Assertions and included files16387+Ref: #assertions-and-included-files16630+Node: Assertions and multiple -f options16963+Ref: #assertions-and-multiple--f-options17219+Node: Assertions and commodities17351+Ref: #assertions-and-commodities17588+Node: Assertions and subaccounts18284+Ref: #assertions-and-subaccounts18518+Node: Assertions and virtual postings19039+Ref: #assertions-and-virtual-postings19248+Node: Balance Assignments19390+Ref: #balance-assignments19559+Node: Prices20678+Ref: #prices20813+Node: Transaction prices20864+Ref: #transaction-prices21011+Node: Market prices23167+Ref: #market-prices23304+Node: Comments24264+Ref: #comments24388+Node: Tags25501+Ref: #tags25621+Node: Implicit tags27050+Ref: #implicit-tags27158+Node: Directives27675+Ref: #directives27790+Node: Account aliases27983+Ref: #account-aliases28129+Node: Basic aliases28733+Ref: #basic-aliases28878+Node: Regex aliases29568+Ref: #regex-aliases29738+Node: Multiple aliases30453+Ref: #multiple-aliases30627+Node: end aliases31125+Ref: #end-aliases31267+Node: account directive31368+Ref: #account-directive31550+Node: apply account directive31846+Ref: #apply-account-directive32044+Node: Multi-line comments32703+Ref: #multi-line-comments32895+Node: commodity directive33023+Ref: #commodity-directive33209+Node: Default commodity34081+Ref: #default-commodity34256+Node: Default year34793+Ref: #default-year34960+Node: Including other files35383+Ref: #including-other-files35542+Node: EDITOR SUPPORT35939+Ref: #editor-support36059  End Tag Table
doc/other/hledger_journal.5.txt view
@@ -835,4 +835,4 @@   -hledger 1.3                        June 2017                hledger_journal(5)+hledger 1.3.1                     August 2017               hledger_journal(5)
doc/other/hledger_timeclock.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timeclock" "5" "June 2017" "hledger 1.3" "hledger User Manuals"+.TH "hledger_timeclock" "5" "August 2017" "hledger 1.3.1" "hledger User Manuals"   
doc/other/hledger_timeclock.5.info view
@@ -4,8 +4,8 @@  File: hledger_timeclock.5.info,  Node: Top,  Up: (dir) -hledger_timeclock(5) hledger 1.3-********************************+hledger_timeclock(5) hledger 1.3.1+**********************************  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
doc/other/hledger_timeclock.5.txt view
@@ -79,4 +79,4 @@   -hledger 1.3                        June 2017              hledger_timeclock(5)+hledger 1.3.1                     August 2017             hledger_timeclock(5)
doc/other/hledger_timedot.5 view
@@ -1,5 +1,5 @@ -.TH "hledger_timedot" "5" "June 2017" "hledger 1.3" "hledger User Manuals"+.TH "hledger_timedot" "5" "August 2017" "hledger 1.3.1" "hledger User Manuals"   
doc/other/hledger_timedot.5.info view
@@ -4,8 +4,8 @@  File: hledger_timedot.5.info,  Node: Top,  Next: FILE FORMAT,  Up: (dir) -hledger_timedot(5) hledger 1.3-******************************+hledger_timedot(5) hledger 1.3.1+********************************  Timedot is a plain text format for logging dated, categorised quantities (eg time), supported by hledger.  It is convenient for approximate and@@ -106,7 +106,7 @@  Tag Table: Node: Top78-Node: FILE FORMAT882-Ref: #file-format985+Node: FILE FORMAT886+Ref: #file-format989  End Tag Table
doc/other/hledger_timedot.5.txt view
@@ -120,4 +120,4 @@   -hledger 1.3                        June 2017                hledger_timedot(5)+hledger 1.3.1                     August 2017               hledger_timedot(5)
hledger.cabal view
@@ -1,9 +1,9 @@--- This file has been generated from package.yaml by hpack version 0.17.0.+-- This file has been generated from package.yaml by hpack version 0.17.1. -- -- see: https://github.com/sol/hpack  name:           hledger-version:        1.3+version:        1.3.1 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@@ -80,7 +80,7 @@  library   ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans-  cpp-options: -DVERSION="1.3"+  cpp-options: -DVERSION="1.3.1"   build-depends:       base >=4.8 && <5     , base-compat >=0.8.1@@ -93,7 +93,7 @@     , process     , temporary     , tabular >=0.2 && <0.3-    , hledger-lib >= 1.3+    , hledger-lib >= 1.3.1 && < 1.4     , bytestring     , containers     , unordered-containers@@ -106,7 +106,7 @@     , mtl     , mtl-compat     , old-time-    , megaparsec >=5.0 && < 5.4+    , megaparsec >=5.0 && < 6.2     , regex-tdfa     , safe >=0.2     , split >=0.1 && <0.3@@ -146,7 +146,7 @@       Hledger.Cli.Accounts       Hledger.Cli.Balance       Hledger.Cli.Balancesheet-      Hledger.Cli.BalanceView+      Hledger.Cli.CompoundBalanceCommand       Hledger.Cli.Cashflow       Hledger.Cli.Help       Hledger.Cli.Histogram@@ -166,7 +166,7 @@   hs-source-dirs:       app   ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans-  cpp-options: -DVERSION="1.3"+  cpp-options: -DVERSION="1.3.1"   build-depends:       base >=4.8 && <5     , base-compat >=0.8.1@@ -179,8 +179,8 @@     , process     , temporary     , tabular >=0.2 && <0.3-    , hledger-lib >= 1.3-    , hledger == 1.3+    , hledger-lib >= 1.3.1+    , hledger     , bytestring     , containers     , unordered-containers@@ -229,7 +229,7 @@   hs-source-dirs:       test   ghc-options: -Wall -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -fno-warn-type-defaults -fno-warn-orphans-  cpp-options: -DVERSION="1.3"+  cpp-options: -DVERSION="1.3.1"   build-depends:       base >=4.8 && <5     , base-compat >=0.8.1@@ -242,8 +242,8 @@     , process     , temporary     , tabular >=0.2 && <0.3-    , hledger-lib >= 1.3-    , hledger == 1.3+    , hledger-lib >= 1.3.1+    , hledger     , bytestring     , containers     , unordered-containers@@ -304,8 +304,8 @@     , process     , temporary     , tabular >=0.2 && <0.3-    , hledger-lib >= 1.3-    , hledger == 1.3+    , hledger-lib >= 1.3.1+    , hledger     , criterion     , html     , timeit