define nullentry, nullrawtxn

This commit is contained in:
Simon Michael 2008-11-08 20:25:51 +00:00
parent 3a35847aa1
commit a7b3e0d38d
2 changed files with 12 additions and 0 deletions

View File

@ -21,6 +21,16 @@ instance Show ModifierEntry where
instance Show PeriodicEntry where
show e = "~ " ++ (periodexpr e) ++ "\n" ++ unlines (map show (p_transactions e))
nullentry = Entry {
edate="",
estatus=False,
ecode="",
edescription="",
ecomment="",
etransactions=[],
epreceding_comment_lines=""
}
{-|
Show a ledger entry, formatted for the print command. ledger 2.x's
standard format looks like this:

View File

@ -15,6 +15,8 @@ import Ledger.AccountName
instance Show RawTransaction where show = showRawTransaction
nullrawtxn = RawTransaction "" nullamt "" RegularTransaction
showRawTransaction :: RawTransaction -> String
showRawTransaction (RawTransaction a amt _ ttype) =
showaccountname a ++ " " ++ (showamount amt)