From 02845ccf3dccae6c017e6a30ee0cb6d9b39ba645 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 8 Aug 2016 07:10:36 -0700 Subject: [PATCH] whitespace clarifying this large module's structure, comments --- hledger-lib/Hledger/Reports/BalanceReport.hs | 26 +++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/hledger-lib/Hledger/Reports/BalanceReport.hs b/hledger-lib/Hledger/Reports/BalanceReport.hs index 05cec8cd7..d3b2ce87a 100644 --- a/hledger-lib/Hledger/Reports/BalanceReport.hs +++ b/hledger-lib/Hledger/Reports/BalanceReport.hs @@ -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