diff --git a/tests/books/fund.beancount b/tests/books/fund.beancount index d452cf5..24dc807 100644 --- a/tests/books/fund.beancount +++ b/tests/books/fund.beancount @@ -1,11 +1,19 @@ +; This input is used to test both the fund report +; and the opening balances tool. + option "inferred_tolerance_default" "USD:0.01" +2018-01-01 open Assets:Checking +2018-01-01 open Assets:EUR +2018-01-01 open Assets:Prepaid:Expenses +2018-01-01 open Assets:Receivable:Accounts 2018-01-01 open Equity:Funds:Restricted 2018-01-01 open Equity:Funds:Unrestricted 2018-01-01 open Equity:Realized:CurrencyConversion -2018-01-01 open Assets:Checking 2018-01-01 open Expenses:Other 2018-01-01 open Income:Other +2018-01-01 open Liabilities:Payable:Accounts +2018-01-01 open Liabilities:UnearnedIncome 2018-02-28 * "Opening balances" Equity:Funds:Unrestricted -4,000 USD @@ -18,49 +26,75 @@ option "inferred_tolerance_default" "USD:0.01" project: "Charlie" Assets:Checking 10,000 USD -2018-03-03 * "Conservancy income 2018" +2018-03-03 * "Conservancy receivable 2018" project: "Conservancy" - Income:Other -40 USD - Assets:Checking 40 USD + Income:Other -32 EUR {1.25 USD} + Assets:Receivable:Accounts 32 EUR {1.25 USD} -2018-03-06 * "Conservancy expense 2018" +2018-03-06 * "Conservancy payable 2018" project: "Conservancy" - Expenses:Other 4 USD - Assets:Checking -4 USD + Expenses:Other 4 USD + Liabilities:Payable:Accounts -4 USD -2018-06-03 * "Alpha income 2018A" +2018-06-03 * "Alpha income 2018" project: "Alpha" - Income:Other -30 USD - Assets:Checking 30 USD + Income:Other -60 USD + Assets:Checking 60 USD -2018-06-06 * "Alpha income 2018B" +2018-06-06 * "Alpha unearned income" project: "Alpha" - Income:Other -30 USD - Assets:Checking 30 USD + Liabilities:UnearnedIncome -30 USD + Assets:Checking 30 USD + +2018-06-09 * "Alpha prepaid expense" + project: "Alpha" + Assets:Prepaid:Expenses 20 USD + Assets:Checking -20 USD 2018-09-03 * "Bravo expense" project: "Bravo" Expenses:Other 20 USD Assets:Checking -20 USD -2019-03-03 * "Conservancy income 2019" +2019-03-03 * "Conservancy receivable paid" project: "Conservancy" - Income:Other -44 EUR {1.0 USD} + Assets:Receivable:Accounts -32 EUR {1.25 USD} @ 1.5 USD + Assets:EUR 32 EUR {1.5 USD} + Equity:Realized:CurrencyConversion + +2019-03-06 * "Conservancy payable paid" + project: "Conservancy" + Liabilities:Payable:Accounts 4 USD + Assets:Checking -4 USD + +2019-03-12 * "Conservancy income 2019" + project: "Conservancy" + Income:Other -28 EUR {1.5 USD} Assets:Checking 40 USD Equity:Realized:CurrencyConversion -2019-03-06 * "Conservancy expense 2019" +2019-03-15 * "Conservancy expense 2019" project: "Conservancy" - Expenses:Other 4.40 EUR {1.0 USD} + Expenses:Other 2.80 EUR {1.5 USD} Assets:Checking -4.00 USD Equity:Realized:CurrencyConversion -2019-06-03 * "Alpha expense 2019A" +2019-06-06 * "Alpha unearned income converted" + project: "Alpha" + Liabilities:UnearnedIncome 30 USD + Income:Other -30 USD + +2019-06-09 * "Alpha prepaid expense converted" + project: "Alpha" + Assets:Prepaid:Expenses -20 USD + Expenses:Other 20 USD + +2019-06-12 * "Alpha expense 2019A" project: "Alpha" Expenses:Other 3 USD Assets:Checking -3 USD -2019-06-06 * "Alpha expense 2019B" +2019-06-15 * "Alpha expense 2019B" project: "Alpha" Expenses:Other 3 USD Assets:Checking -3 USD diff --git a/tests/test_reports_fund.py b/tests/test_reports_fund.py index a57318d..da2ac89 100644 --- a/tests/test_reports_fund.py +++ b/tests/test_reports_fund.py @@ -53,15 +53,16 @@ BALANCES_BY_YEAR = { ('Expenses:Other', -4), ], ('Conservancy', 2019): [ - ('Income:Other', 44), - ('Expenses:Other', Decimal('-4.40')), - ('Equity:Realized:CurrencyConversion', Decimal('-3.60')), + ('Income:Other', 42), + ('Expenses:Other', Decimal('-4.20')), + ('Equity:Realized:CurrencyConversion', Decimal('6.20')), ], ('Alpha', 2018): [ ('Income:Other', 60), ], ('Alpha', 2019): [ - ('Expenses:Other', -6), + ('Income:Other', 30), + ('Expenses:Other', -26), ], ('Bravo', 2018): [ ('Expenses:Other', -20),