From a7b3e0d38d5950542aa107c7eb50802ac2e73ad5 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 8 Nov 2008 20:25:51 +0000 Subject: [PATCH] define nullentry, nullrawtxn --- Ledger/Entry.hs | 10 ++++++++++ Ledger/RawTransaction.hs | 2 ++ 2 files changed, 12 insertions(+) diff --git a/Ledger/Entry.hs b/Ledger/Entry.hs index cdd8efab0..39324d9a6 100644 --- a/Ledger/Entry.hs +++ b/Ledger/Entry.hs @@ -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: diff --git a/Ledger/RawTransaction.hs b/Ledger/RawTransaction.hs index bf7d7e7a5..c797d525d 100644 --- a/Ledger/RawTransaction.hs +++ b/Ledger/RawTransaction.hs @@ -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)