whitespace
This commit is contained in:
parent
b52f08603b
commit
592d997438
@ -94,31 +94,31 @@ entriesReportAsCsv items =
|
|||||||
|
|
||||||
transactionToCSV :: Integer -> Transaction -> CSV
|
transactionToCSV :: Integer -> Transaction -> CSV
|
||||||
transactionToCSV n t =
|
transactionToCSV n t =
|
||||||
map (\p -> show n:date:date2:status:code:description:comment:p)
|
map (\p -> show n:date:date2:status:code:description:comment:p)
|
||||||
(concatMap postingToCSV $ tpostings t)
|
(concatMap postingToCSV $ tpostings t)
|
||||||
where
|
where
|
||||||
description = tdescription t
|
description = tdescription t
|
||||||
date = showDate (tdate t)
|
date = showDate (tdate t)
|
||||||
date2 = maybe "" showDate (tdate2 t)
|
date2 = maybe "" showDate (tdate2 t)
|
||||||
status = if tstatus t then "*" else ""
|
status = if tstatus t then "*" else ""
|
||||||
code = tcode t
|
code = tcode t
|
||||||
comment = chomp $ strip $ tcomment t
|
comment = chomp $ strip $ tcomment t
|
||||||
|
|
||||||
postingToCSV :: Posting -> CSV
|
postingToCSV :: Posting -> CSV
|
||||||
postingToCSV p =
|
postingToCSV p =
|
||||||
map (\(a@(Amount {aquantity=q,acommodity=c})) ->
|
map (\(a@(Amount {aquantity=q,acommodity=c})) ->
|
||||||
let a_ = a{acommodity=""} in
|
let a_ = a{acommodity=""} in
|
||||||
let amount = showAmount a_ in
|
let amount = showAmount a_ in
|
||||||
let commodity = c in
|
let commodity = c in
|
||||||
let credit = if q < 0 then showAmount $ negate a_ else "" in
|
let credit = if q < 0 then showAmount $ negate a_ else "" in
|
||||||
let debit = if q > 0 then showAmount a_ else "" in
|
let debit = if q > 0 then showAmount a_ else "" in
|
||||||
account:amount:commodity:credit:debit:status:comment:[])
|
account:amount:commodity:credit:debit:status:comment:[])
|
||||||
amounts
|
amounts
|
||||||
where
|
where
|
||||||
Mixed amounts = pamount p
|
Mixed amounts = pamount p
|
||||||
status = if pstatus p then "*" else ""
|
status = if pstatus p then "*" else ""
|
||||||
account = showAccountName Nothing (ptype p) (paccount p)
|
account = showAccountName Nothing (ptype p) (paccount p)
|
||||||
comment = chomp $ strip $ pcomment p
|
comment = chomp $ strip $ pcomment p
|
||||||
|
|
||||||
tests_Hledger_Cli_Print = TestList []
|
tests_Hledger_Cli_Print = TestList []
|
||||||
-- tests_showTransactions
|
-- tests_showTransactions
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user