whitespace clarifying this large module's structure, comments

This commit is contained in:
Simon Michael 2016-08-08 07:10:36 -07:00
parent b4f3d6e1c5
commit 02845ccf3d

View File

@ -5,6 +5,13 @@ Balance report, used by the balance command.
-}
module Hledger.Reports.BalanceReport (
BalanceReport,
BalanceReportItem,
@ -31,6 +38,12 @@ import Hledger.Utils
import Hledger.Reports.ReportOptions
-- | A simple single-column balance report. It has:
--
-- 1. a list of rows, each containing a renderable account name and a corresponding amount
@ -141,8 +154,8 @@ mixedAmountValue :: Journal -> Day -> MixedAmount -> MixedAmount
mixedAmountValue j d (Mixed as) = Mixed $ map (amountValue j d) as
-- | Find the market value of this amount on the given date, in it's
-- default valuation commodity, based on historical prices. If no
-- default valuation commodity can be found, the amount is left
-- default valuation commodity, based on recorded market prices.
-- If no default valuation commodity can be found, the amount is left
-- unchanged.
amountValue :: Journal -> Day -> Amount -> Amount
amountValue j d a =
@ -155,7 +168,7 @@ amountValue j d a =
-- | Find the market value, if known, of one unit of this commodity on
-- the given date, in the commodity in which it has most recently been
-- market-priced (ie the commodity mentioned in the most recent
-- applicable historical price directive before this date).
-- applicable market price directive before this date).
commodityValue :: Journal -> Day -> CommoditySymbol -> Maybe Amount
commodityValue j d c
| null applicableprices = Nothing
@ -163,6 +176,13 @@ commodityValue j d c
where
applicableprices = [p | p <- sort $ jmarketprices j, mpcommodity p == c, mpdate p <= d]
tests_balanceReport =
let
(opts,journal) `gives` r = do