docs: whitespace

This commit is contained in:
Simon Michael 2011-09-23 14:27:26 +00:00
parent 43daa05f97
commit 9a0a0be01c
3 changed files with 30 additions and 34 deletions

View File

@ -1207,7 +1207,7 @@ entries, and the following c++ ledger options and commands:
prices for amounts which have them. (This currently means that
it does not print multi-commodity transactions in valid journal format.)
- hledger's default commodity directive (D) sets the commodity for
- hledger's default commodity directive (D) sets the commodity for
subsequent commodityless amounts, and contributes to that commodity's
display settings. ledger uses D only for commodity display settings
and for the entry command.

View File

@ -59,27 +59,23 @@ pcommentwidth = no limit -- 22
@
-}
showTransaction :: Transaction -> String
showTransaction = showTransaction' True False
showTransaction = showTransaction' True
showTransactionUnelided :: Transaction -> String
showTransactionUnelided = showTransaction' False False
showTransactionUnelided = showTransaction' False
showTransactionForPrint :: Bool -> Transaction -> String
showTransactionForPrint effective = showTransaction' False effective
showTransaction' :: Bool -> Bool -> Transaction -> String
showTransaction' elide effective t =
showTransaction' :: Bool -> Transaction -> String
showTransaction' elide t =
unlines $ [description] ++ showpostings (tpostings t) ++ [""]
where
description = concat [date, status, code, desc, comment]
date | effective = showdate $ fromMaybe (tdate t) $ teffectivedate t
| otherwise = showdate (tdate t) ++ maybe "" showedate (teffectivedate t)
date = showdate (tdate t) ++ maybe "" showedate (teffectivedate t)
showdate = printf "%-10s" . showDate
showedate = printf "=%s" . showdate
status = if tstatus t then " *" else ""
code = if length (tcode t) > 0 then printf " (%s)" $ tcode t else ""
desc = if null d then "" else " " ++ d where d = tdescription t
comment = if null c then "" else " ; " ++ c where c = tcomment t
showdate = printf "%-10s" . showDate
showedate = printf "=%s" . showdate
showpostings ps
| elide && length ps > 1 && isTransactionBalanced Nothing t -- imprecise balanced check
= map showposting (init ps) ++ [showpostingnoamt (last ps)]

View File

@ -25,5 +25,5 @@ showTransactions :: ReportOpts -> FilterSpec -> Journal -> String
showTransactions opts fspec j = entriesReportAsText opts fspec $ entriesReport opts fspec j
entriesReportAsText :: ReportOpts -> FilterSpec -> EntriesReport -> String
entriesReportAsText opts _ items = concatMap (showTransactionForPrint (effective_ opts)) items
entriesReportAsText _ _ items = concatMap showTransactionUnelided items