From 63f790b94edef0425dbfb766211a5e08c6441c63 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 4 Aug 2011 08:26:55 +0000 Subject: [PATCH] small reports cleanups --- hledger-web/Handlers.hs | 2 +- hledger/Hledger/Cli/Reports.hs | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/hledger-web/Handlers.hs b/hledger-web/Handlers.hs index e0f9e1cfb..0ca335175 100644 --- a/hledger-web/Handlers.hs +++ b/hledger-web/Handlers.hs @@ -429,7 +429,7 @@ registerChartHtml items = [$hamlet| [ [ $forall i <- items - [#{dayToJsTimestamp $ ariDate i}, #{ariBalance i}], + [#{dayToJsTimestamp $ triDate i}, #{triBalance i}], ] ], { diff --git a/hledger/Hledger/Cli/Reports.hs b/hledger/Hledger/Cli/Reports.hs index 7df0d41ff..7f488ab4f 100644 --- a/hledger/Hledger/Cli/Reports.hs +++ b/hledger/Hledger/Cli/Reports.hs @@ -21,8 +21,8 @@ module Hledger.Cli.Reports ( -- * Transactions report TransactionsReport, TransactionsReportItem, - ariDate, - ariBalance, + triDate, + triBalance, journalTransactionsReport, accountTransactionsReport, -- * Accounts report @@ -53,8 +53,9 @@ import Hledger.Cli.Utils ------------------------------------------------------------------------------- --- | A raw journal report is a list of transactions used to generate a raw journal view. --- Used by eg hledger's print command. +-- | A raw journal report is a list of whole transactions used to generate +-- a raw journal view. Used by eg hledger's print command and +-- hledger-web's raw journal view. type RawJournalReport = [RawJournalReportItem] type RawJournalReportItem = Transaction @@ -228,8 +229,8 @@ type TransactionsReportItem = (Transaction -- the corresponding transaction ,MixedAmount -- the running balance for the current account(s) after this transaction ) -ariDate (t,_,_,_,_,_) = tdate t -ariBalance (_,_,_,_,_,Mixed a) = case a of [] -> "0" +triDate (t,_,_,_,_,_) = tdate t +triBalance (_,_,_,_,_,Mixed a) = case a of [] -> "0" (Amount{quantity=q}):_ -> show q -- | Select transactions from the whole journal for a transactions report, @@ -331,7 +332,7 @@ filterTransactionPostings m t@Transaction{tpostings=ps} = t{tpostings=filter (m -- | An accounts report is a list of account names (full and short -- variants) with their balances, appropriate indentation for rendering as --- a hierarchy tree, and grand total. +-- a hierarchy, and grand total. type AccountsReport = ([AccountsReportItem] -- line items, one per account ,MixedAmount -- total balance of all accounts )