extra/hledger-equity: print closing balance too.

This commit is contained in:
Julien Moutinho 2014-07-24 02:16:13 +02:00
parent c7a2126896
commit 0b8b246fcd

View File

@ -44,5 +44,7 @@ main = do
ps = [posting{paccount=a, pamount=b} | ((a,_,_),b) <- acctbals] ps = [posting{paccount=a, pamount=b} | ((a,_,_),b) <- acctbals]
++ [posting{paccount="equity:opening balances", pamount=balancingamt}] ++ [posting{paccount="equity:opening balances", pamount=balancingamt}]
enddate = fromMaybe today $ queryEndDate (date2_ ropts_) q enddate = fromMaybe today $ queryEndDate (date2_ ropts_) q
txn = nulltransaction{tdate=enddate, tpostings=ps} nps = [posting{paccount=a, pamount=negate b} | ((a,_,_),b) <- acctbals]
putStr $ showTransactionUnelided txn ++ [posting{paccount="equity:closing balances", pamount=negate balancingamt}]
putStr $ showTransactionUnelided (nulltransaction{tdate=enddate, tpostings=nps})
putStr $ showTransactionUnelided (nulltransaction{tdate=enddate, tpostings=ps})