1 {-| 2 3 An 'Account' stores 4 5 - an 'AccountName', 6 7 - all 'Posting's in the account, excluding subaccounts 8 9 - a 'MixedAmount' representing the account balance, including subaccounts. 10 11 -} 12 13 module Hledger.Data.Account 14 where 15 import Test.HUnit 16 import Text.Printf 17 18 import Hledger.Data.Amount 19 import Hledger.Data.Types 20 21 22 instance Show Account where 23 show (Account a ts b) = printf "Account %s with %d txns and %s balance" a (length ts) (showMixedAmount b) 24 25 instance Eq Account where 26 (==) (Account n1 t1 b1) (Account n2 t2 b2) = n1 == n2 && t1 == t2 && b1 == b2 27 28 nullacct = Account "" [] nullmixedamt 29 30 tests_Hledger_Data_Account = TestList [ 31 ] 32