From a3b3afe8c7413b11fa6163490bbfd1012f429b1a Mon Sep 17 00:00:00 2001 From: Anantha Kumaran Date: Sat, 20 Jan 2024 10:44:04 +0530 Subject: [PATCH] regen fixtures --- tests/fixture/inr-beancount/allocation.json | 560 ++++++++++++------ .../fixture/inr-beancount/assets_balance.json | 59 +- tests/fixture/inr-beancount/budget.json | 4 +- tests/fixture/inr-beancount/cash_flow.json | 12 +- tests/fixture/inr-beancount/config.json | 2 + tests/fixture/inr-beancount/dashboard.json | 340 +++++++---- tests/fixture/inr-beancount/expense.json | 309 +++++++--- tests/fixture/inr-beancount/files.json | 5 +- tests/fixture/inr-beancount/gain.json | 106 ++-- tests/fixture/inr-beancount/income.json | 60 +- .../inr-beancount/income_statement.json | 10 +- tests/fixture/inr-beancount/investment.json | 124 ++-- tests/fixture/inr-beancount/ledger.json | 308 ++++++---- tests/fixture/inr-beancount/networth.json | 310 +++++----- tests/fixture/inr-beancount/transaction.json | 285 ++++++--- tests/fixture/inr-hledger/allocation.json | 310 ++++++++-- tests/fixture/inr-hledger/assets_balance.json | 27 +- tests/fixture/inr-hledger/budget.json | 4 +- tests/fixture/inr-hledger/cash_flow.json | 10 +- tests/fixture/inr-hledger/config.json | 2 + tests/fixture/inr-hledger/dashboard.json | 164 ++++- tests/fixture/inr-hledger/expense.json | 167 +++++- tests/fixture/inr-hledger/files.json | 5 +- tests/fixture/inr-hledger/gain.json | 36 ++ tests/fixture/inr-hledger/income.json | 16 +- .../fixture/inr-hledger/income_statement.json | 3 +- tests/fixture/inr-hledger/investment.json | 48 +- tests/fixture/inr-hledger/ledger.json | 252 +++++--- tests/fixture/inr-hledger/networth.json | 242 ++++---- tests/fixture/inr-hledger/transaction.json | 119 +++- tests/fixture/inr/allocation.json | 310 ++++++++-- tests/fixture/inr/assets_balance.json | 27 +- tests/fixture/inr/budget.json | 4 +- tests/fixture/inr/cash_flow.json | 10 +- tests/fixture/inr/config.json | 2 + tests/fixture/inr/dashboard.json | 164 ++++- tests/fixture/inr/expense.json | 167 +++++- tests/fixture/inr/files.json | 5 +- tests/fixture/inr/gain.json | 36 ++ tests/fixture/inr/income.json | 16 +- tests/fixture/inr/income_statement.json | 3 +- tests/fixture/inr/investment.json | 48 +- tests/fixture/inr/ledger.json | 186 ++++-- tests/fixture/inr/networth.json | 242 ++++---- tests/fixture/inr/transaction.json | 119 +++- 45 files changed, 3674 insertions(+), 1564 deletions(-) diff --git a/tests/fixture/inr-beancount/allocation.json b/tests/fixture/inr-beancount/allocation.json index 9754df34..f7a461b1 100644 --- a/tests/fixture/inr-beancount/allocation.json +++ b/tests/fixture/inr-beancount/allocation.json @@ -9,8 +9,8 @@ "Assets:Checking": { "date": "2022-02-07T23:59:59.999999999Z", "account": "Assets:Checking", - "amount": 13001.94858619763, - "market_amount": 13001.94858619763 + "amount": 12158.816768, + "market_amount": 12097.22810619763 }, "Assets:Coinbase": { "date": "0001-01-01T00:00:00Z", @@ -21,8 +21,14 @@ "Assets:Coinbase:BTC": { "date": "2022-02-07T23:59:59.999999999Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-02-07T23:59:59.999999999Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity": { "date": "0001-01-01T00:00:00Z", @@ -39,8 +45,8 @@ "Assets:Equity:ABNB": { "date": "2022-02-07T23:59:59.999999999Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-02-07T23:59:59.999999999Z", @@ -116,7 +122,7 @@ "Assets:Checking": { "date": "2022-01-08T00:00:00Z", "account": "Assets:Checking", - "amount": 1974.6829928704, + "amount": 2036.237248, "market_amount": 1974.6829928704 }, "Assets:Equity:AAPL": { @@ -128,8 +134,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-08T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-08T00:00:00Z", @@ -142,8 +148,14 @@ "Assets:Checking": { "date": "2022-01-09T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11158.816768, + "market_amount": 11097.2625128704 + }, + "Assets:Dollar": { + "date": "2022-01-09T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-09T00:00:00Z", @@ -154,8 +166,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-09T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-09T00:00:00Z", @@ -168,14 +180,20 @@ "Assets:Checking": { "date": "2022-01-10T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-10T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-10T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-10T00:00:00Z", @@ -186,8 +204,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-10T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-10T00:00:00Z", @@ -200,14 +218,20 @@ "Assets:Checking": { "date": "2022-01-11T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-11T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-11T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-11T00:00:00Z", @@ -218,8 +242,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-11T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-11T00:00:00Z", @@ -232,14 +256,20 @@ "Assets:Checking": { "date": "2022-01-12T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-12T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-12T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-12T00:00:00Z", @@ -250,8 +280,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-12T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-12T00:00:00Z", @@ -264,14 +294,20 @@ "Assets:Checking": { "date": "2022-01-13T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-13T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-13T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-13T00:00:00Z", @@ -282,8 +318,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-13T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-13T00:00:00Z", @@ -296,14 +332,20 @@ "Assets:Checking": { "date": "2022-01-14T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-14T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-14T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-14T00:00:00Z", @@ -314,8 +356,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-14T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-14T00:00:00Z", @@ -328,14 +370,20 @@ "Assets:Checking": { "date": "2022-01-15T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-15T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-15T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-15T00:00:00Z", @@ -346,8 +394,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-15T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-15T00:00:00Z", @@ -360,14 +408,20 @@ "Assets:Checking": { "date": "2022-01-16T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-16T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-16T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-16T00:00:00Z", @@ -378,8 +432,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-16T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-16T00:00:00Z", @@ -392,14 +446,20 @@ "Assets:Checking": { "date": "2022-01-17T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-17T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-17T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-17T00:00:00Z", @@ -410,8 +470,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-17T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-17T00:00:00Z", @@ -424,14 +484,20 @@ "Assets:Checking": { "date": "2022-01-18T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-18T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-18T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-18T00:00:00Z", @@ -442,8 +508,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-18T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-18T00:00:00Z", @@ -456,14 +522,20 @@ "Assets:Checking": { "date": "2022-01-19T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-19T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-19T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-19T00:00:00Z", @@ -474,8 +546,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-19T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-19T00:00:00Z", @@ -488,14 +560,20 @@ "Assets:Checking": { "date": "2022-01-20T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-20T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-20T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-20T00:00:00Z", @@ -506,8 +584,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-20T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-20T00:00:00Z", @@ -520,14 +598,20 @@ "Assets:Checking": { "date": "2022-01-21T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-21T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-21T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-21T00:00:00Z", @@ -538,8 +622,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-21T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-21T00:00:00Z", @@ -552,14 +636,20 @@ "Assets:Checking": { "date": "2022-01-22T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-22T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-22T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-22T00:00:00Z", @@ -570,8 +660,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-22T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-22T00:00:00Z", @@ -584,14 +674,20 @@ "Assets:Checking": { "date": "2022-01-23T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-23T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-23T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-23T00:00:00Z", @@ -602,8 +698,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-23T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-23T00:00:00Z", @@ -616,14 +712,20 @@ "Assets:Checking": { "date": "2022-01-24T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-24T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-24T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-24T00:00:00Z", @@ -634,8 +736,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-24T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-24T00:00:00Z", @@ -648,14 +750,20 @@ "Assets:Checking": { "date": "2022-01-25T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-25T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-25T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-25T00:00:00Z", @@ -666,8 +774,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-25T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-25T00:00:00Z", @@ -680,14 +788,20 @@ "Assets:Checking": { "date": "2022-01-26T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-26T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-26T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-26T00:00:00Z", @@ -698,8 +812,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-26T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-26T00:00:00Z", @@ -712,14 +826,20 @@ "Assets:Checking": { "date": "2022-01-27T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-27T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-27T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-27T00:00:00Z", @@ -730,8 +850,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-27T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-27T00:00:00Z", @@ -744,14 +864,20 @@ "Assets:Checking": { "date": "2022-01-28T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-28T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-28T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-28T00:00:00Z", @@ -762,8 +888,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-28T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-28T00:00:00Z", @@ -776,14 +902,20 @@ "Assets:Checking": { "date": "2022-01-29T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-29T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-29T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-29T00:00:00Z", @@ -794,8 +926,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-29T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-29T00:00:00Z", @@ -808,14 +940,20 @@ "Assets:Checking": { "date": "2022-01-30T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.94858619763, - "market_amount": 12001.94858619763 + "amount": 11158.816768, + "market_amount": 11097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-30T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-30T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-30T00:00:00Z", @@ -826,8 +964,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-30T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-30T00:00:00Z", @@ -840,14 +978,20 @@ "Assets:Checking": { "date": "2022-01-31T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.94858619763, - "market_amount": 13001.94858619763 + "amount": 12158.816768, + "market_amount": 12097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-01-31T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-01-31T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-31T00:00:00Z", @@ -858,8 +1002,8 @@ "Assets:Equity:ABNB": { "date": "2022-01-31T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-01-31T00:00:00Z", @@ -872,14 +1016,20 @@ "Assets:Checking": { "date": "2022-02-01T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.94858619763, - "market_amount": 13001.94858619763 + "amount": 12158.816768, + "market_amount": 12097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-02-01T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-02-01T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-01T00:00:00Z", @@ -890,8 +1040,8 @@ "Assets:Equity:ABNB": { "date": "2022-02-01T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-02-01T00:00:00Z", @@ -904,14 +1054,20 @@ "Assets:Checking": { "date": "2022-02-02T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.94858619763, - "market_amount": 13001.94858619763 + "amount": 12158.816768, + "market_amount": 12097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-02-02T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-02-02T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-02T00:00:00Z", @@ -922,8 +1078,8 @@ "Assets:Equity:ABNB": { "date": "2022-02-02T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-02-02T00:00:00Z", @@ -936,14 +1092,20 @@ "Assets:Checking": { "date": "2022-02-03T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.94858619763, - "market_amount": 13001.94858619763 + "amount": 12158.816768, + "market_amount": 12097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-02-03T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-02-03T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-03T00:00:00Z", @@ -954,8 +1116,8 @@ "Assets:Equity:ABNB": { "date": "2022-02-03T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-02-03T00:00:00Z", @@ -968,14 +1130,20 @@ "Assets:Checking": { "date": "2022-02-04T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.94858619763, - "market_amount": 13001.94858619763 + "amount": 12158.816768, + "market_amount": 12097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-02-04T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-02-04T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-04T00:00:00Z", @@ -986,8 +1154,8 @@ "Assets:Equity:ABNB": { "date": "2022-02-04T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-02-04T00:00:00Z", @@ -1000,14 +1168,20 @@ "Assets:Checking": { "date": "2022-02-05T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.94858619763, - "market_amount": 13001.94858619763 + "amount": 12158.816768, + "market_amount": 12097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-02-05T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-02-05T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-05T00:00:00Z", @@ -1018,8 +1192,8 @@ "Assets:Equity:ABNB": { "date": "2022-02-05T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-02-05T00:00:00Z", @@ -1032,14 +1206,20 @@ "Assets:Checking": { "date": "2022-02-06T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.94858619763, - "market_amount": 13001.94858619763 + "amount": 12158.816768, + "market_amount": 12097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-02-06T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-02-06T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-06T00:00:00Z", @@ -1050,8 +1230,8 @@ "Assets:Equity:ABNB": { "date": "2022-02-06T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-02-06T00:00:00Z", @@ -1064,14 +1244,20 @@ "Assets:Checking": { "date": "2022-02-07T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.94858619763, - "market_amount": 13001.94858619763 + "amount": 12158.816768, + "market_amount": 12097.22810619763 }, "Assets:Coinbase:BTC": { "date": "2022-02-07T00:00:00Z", "account": "Assets:Coinbase:BTC", - "amount": 0.03440667277056, - "market_amount": 0.03440667277056 + "amount": 0, + "market_amount": 0 + }, + "Assets:Dollar": { + "date": "2022-02-07T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-07T00:00:00Z", @@ -1082,8 +1268,8 @@ "Assets:Equity:ABNB": { "date": "2022-02-07T00:00:00Z", "account": "Assets:Equity:ABNB", - "amount": 8025.3170071296, - "market_amount": 8025.3170071296 + "amount": 7963.762752, + "market_amount": 7963.762752 }, "Assets:Equity:NIFTY": { "date": "2022-02-07T00:00:00Z", diff --git a/tests/fixture/inr-beancount/assets_balance.json b/tests/fixture/inr-beancount/assets_balance.json index 3c097608..a483bd43 100644 --- a/tests/fixture/inr-beancount/assets_balance.json +++ b/tests/fixture/inr-beancount/assets_balance.json @@ -2,31 +2,31 @@ "asset_breakdowns": { "Assets": { "group": "Assets", - "investmentAmount": 98025.35141380237, - "withdrawalAmount": 10027.3, - "marketAmount": 101245.7, + "investmentAmount": 98768.183232, + "withdrawalAmount": 10027, + "marketAmount": 101083.81133819763, "balanceUnits": 0, "latestPrice": 0, - "xirr": 12.84, - "gainAmount": 13247.648586197629, - "absoluteReturn": 0.1351451272056578 + "xirr": 12.18, + "gainAmount": 12342.62810619763, + "absoluteReturn": 0.1249656286296732 }, "Assets:Checking": { "group": "Assets:Checking", "investmentAmount": 0, "withdrawalAmount": 0, - "marketAmount": 13001.94858619763, + "marketAmount": 12097.22810619763, "balanceUnits": 0, "latestPrice": 0, - "xirr": 46.91, - "gainAmount": 13001.94858619763, + "xirr": 44.97, + "gainAmount": 12097.22810619763, "absoluteReturn": 0 }, "Assets:Coinbase": { "group": "Assets:Coinbase", - "investmentAmount": 0.03440667277056, + "investmentAmount": 0, "withdrawalAmount": 0, - "marketAmount": 0.03440667277056, + "marketAmount": 0, "balanceUnits": 0, "latestPrice": 0, "xirr": 0, @@ -35,42 +35,53 @@ }, "Assets:Coinbase:BTC": { "group": "Assets:Coinbase:BTC", - "investmentAmount": 0.03440667277056, + "investmentAmount": 0, "withdrawalAmount": 0, - "marketAmount": 0.03440667277056, + "marketAmount": 0, "balanceUnits": 1e-8, "latestPrice": 0, "xirr": 0, "gainAmount": 0, "absoluteReturn": 0 }, + "Assets:Dollar": { + "group": "Assets:Dollar", + "investmentAmount": 804.42048, + "withdrawalAmount": 0, + "marketAmount": 804.42048, + "balanceUnits": 10, + "latestPrice": 0, + "xirr": 0, + "gainAmount": 0, + "absoluteReturn": 0 + }, "Assets:Equity": { "group": "Assets:Equity", - "investmentAmount": 98025.3170071296, - "withdrawalAmount": 10027.3, - "marketAmount": 88243.7170071296, + "investmentAmount": 97963.762752, + "withdrawalAmount": 10027, + "marketAmount": 88182.162752, "balanceUnits": 0, "latestPrice": 0, "xirr": 3.23, - "gainAmount": 245.7, - "absoluteReturn": 0.0025064953371396 + "gainAmount": 245.4, + "absoluteReturn": 0.0025050079040067 }, "Assets:Equity:AAPL": { "group": "Assets:Equity:AAPL", "investmentAmount": 10000, - "withdrawalAmount": 10027.3, + "withdrawalAmount": 10027, "marketAmount": 0, "balanceUnits": -100, "latestPrice": 0, - "xirr": 151.56, - "gainAmount": 27.3, - "absoluteReturn": 0.00273 + "xirr": 149.2, + "gainAmount": 27, + "absoluteReturn": 0.0027 }, "Assets:Equity:ABNB": { "group": "Assets:Equity:ABNB", - "investmentAmount": 8025.3170071296, + "investmentAmount": 7963.762752, "withdrawalAmount": 0, - "marketAmount": 8025.3170071296, + "marketAmount": 7963.762752, "balanceUnits": 0.76, "latestPrice": 0, "xirr": 0, diff --git a/tests/fixture/inr-beancount/budget.json b/tests/fixture/inr-beancount/budget.json index cef8ea35..d20411b6 100644 --- a/tests/fixture/inr-beancount/budget.json +++ b/tests/fixture/inr-beancount/budget.json @@ -1,5 +1,5 @@ { - "availableForBudgeting": 13001.94858619763, + "availableForBudgeting": 12158.816768, "budgetsByMonth": {}, - "checkingBalance": 13001.94858619763 + "checkingBalance": 12158.816768 } \ No newline at end of file diff --git a/tests/fixture/inr-beancount/cash_flow.json b/tests/fixture/inr-beancount/cash_flow.json index ceee8549..3add930f 100644 --- a/tests/fixture/inr-beancount/cash_flow.json +++ b/tests/fixture/inr-beancount/cash_flow.json @@ -2,13 +2,13 @@ "cash_flows": [ { "date": "2022-01-01T00:00:00Z", - "income": 121027.3, - "expenses": 20000, + "income": 121027, + "expenses": 20100, "liabilities": 0, - "investment": 88025.35141380237, + "investment": 88768.183232, "tax": 0, - "checking": 13001.94858619763, - "balance": 13001.94858619763 + "checking": 12158.816768, + "balance": 12158.816768 }, { "date": "2022-02-01T00:00:00Z", @@ -18,7 +18,7 @@ "investment": 0, "tax": 0, "checking": 0, - "balance": 13001.94858619763 + "balance": 12158.816768 } ] } \ No newline at end of file diff --git a/tests/fixture/inr-beancount/config.json b/tests/fixture/inr-beancount/config.json index 70de254d..e8458f1b 100644 --- a/tests/fixture/inr-beancount/config.json +++ b/tests/fixture/inr-beancount/config.json @@ -7,6 +7,8 @@ "Assets:Equity:ABNB", "Assets:Equity:AAPL", "Income:CapitalGains:Equity:AAPL", + "Expenses:Charges", + "Assets:Dollar", "Assets:Coinbase:BTC", "Income:Interest:Checking" ], diff --git a/tests/fixture/inr-beancount/dashboard.json b/tests/fixture/inr-beancount/dashboard.json index 09ef12cf..7244547b 100644 --- a/tests/fixture/inr-beancount/dashboard.json +++ b/tests/fixture/inr-beancount/dashboard.json @@ -1,19 +1,19 @@ { "budget": { - "availableForBudgeting": 13001.94858619763, + "availableForBudgeting": 12158.816768, "budgetsByMonth": {}, - "checkingBalance": 13001.94858619763 + "checkingBalance": 12158.816768 }, "cashFlows": [ { "date": "2022-01-01T00:00:00Z", - "income": 121027.3, - "expenses": 20000, + "income": 121027, + "expenses": 20100, "liabilities": 0, - "investment": 88025.35141380237, + "investment": 88768.183232, "tax": 0, - "checking": 13001.94858619763, - "balance": 13001.94858619763 + "checking": 12158.816768, + "balance": 12158.816768 }, { "date": "2022-02-01T00:00:00Z", @@ -23,7 +23,7 @@ "investment": 0, "tax": 0, "checking": 0, - "balance": 13001.94858619763 + "balance": 12158.816768 } ], "checkingBalances": { @@ -33,7 +33,7 @@ "2022-01": [ { "id": 4, - "transaction_id": "c2160a8525ea6b909079fd22f091968a", + "transaction_id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "account": "Expenses:Rent", @@ -43,8 +43,29 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 25, - "transaction_end_line": 28, + "transaction_begin_line": 27, + "transaction_end_line": 30, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 16, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", @@ -58,25 +79,25 @@ "networth": { "networth": { "date": "2022-02-07T23:59:59.999999999Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 1245.7, - "balanceAmount": 101245.7, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": 1183.8113381976295, + "balanceAmount": 101083.81133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, - "xirr": 12.84 + "xirr": 12.18 }, "transactionSequences": [], "transactions": [ { - "id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "postings": [ { - "id": 19, - "transaction_id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": 23, + "transaction_id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Assets:Checking", @@ -86,8 +107,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 58, - "transaction_end_line": 61, + "transaction_begin_line": 65, + "transaction_end_line": 68, "file_name": "main.beancount", "forecast": false, "note": "", @@ -96,8 +117,8 @@ "balance": 0 }, { - "id": 18, - "transaction_id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": 22, + "transaction_id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -107,8 +128,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 58, - "transaction_end_line": 61, + "transaction_begin_line": 65, + "transaction_end_line": 68, "file_name": "main.beancount", "forecast": false, "note": "", @@ -119,30 +140,30 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 58, - "endLine": 61, + "beginLine": 65, + "endLine": 68, "fileName": "main.beancount", "note": "" }, { - "id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "postings": [ { - "id": 16, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 20, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Coinbase:BTC", "commodity": "BTC", "quantity": 1e-8, - "amount": 0.03440667277056, + "amount": 0, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 59, + "transaction_end_line": 62, "file_name": "main.beancount", "forecast": false, "note": "", @@ -151,19 +172,116 @@ "balance": 0 }, { - "id": 17, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 21, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Checking", "commodity": "USD", "quantity": -0.00042772, - "amount": -0.03440667277056, + "amount": 0, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 59, + "transaction_end_line": 62, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + } + ], + "tag_recurring": "", + "tag_period": "", + "beginLine": 59, + "endLine": 62, + "fileName": "main.beancount", + "note": "" + }, + { + "id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "postings": [ + { + "id": 18, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 16, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 19, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "USD", + "quantity": -10, + "amount": -804.42048, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 17, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "INR", + "quantity": -100, + "amount": -100, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", @@ -174,30 +292,30 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 52, - "endLine": 55, + "beginLine": 54, + "endLine": 58, "fileName": "main.beancount", "note": "" }, { - "id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "postings": [ { "id": 15, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Assets:Checking", "commodity": "INR", "quantity": 10027.3, - "amount": 10027.3, + "amount": 10027, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -207,18 +325,18 @@ }, { "id": 14, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Income:CapitalGains:Equity:AAPL", "commodity": "INR", "quantity": -27.3, - "amount": -27.3, + "amount": -27, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -228,7 +346,7 @@ }, { "id": 13, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Assets:Equity:AAPL", @@ -238,8 +356,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -250,30 +368,30 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 45, - "endLine": 49, + "beginLine": 47, + "endLine": 51, "fileName": "main.beancount", "note": "" }, { - "id": "c1b0e83e369be2f6b1ad089b3b62f337", + "id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "postings": [ { "id": 9, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "account": "Assets:Equity:ABNB", "commodity": "ABNB", "quantity": 0.76, - "amount": 8025.3170071296, + "amount": 7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", @@ -283,18 +401,18 @@ }, { "id": 10, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "account": "Assets:Checking", "commodity": "USD", "quantity": -99.7652, - "amount": -8025.3170071296, + "amount": -7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", @@ -305,19 +423,19 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 37, - "endLine": 40, + "beginLine": 39, + "endLine": 42, "fileName": "main.beancount", "note": "" }, { - "id": "266960fc42ae079e572bd565bddc39b6", + "id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "postings": [ { "id": 11, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "account": "Assets:Equity:AAPL", @@ -327,8 +445,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 43, + "transaction_end_line": 46, "file_name": "main.beancount", "forecast": false, "note": "", @@ -338,7 +456,7 @@ }, { "id": 12, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "account": "Assets:Checking", @@ -348,8 +466,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 43, + "transaction_end_line": 46, "file_name": "main.beancount", "forecast": false, "note": "", @@ -360,19 +478,19 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 41, - "endLine": 44, + "beginLine": 43, + "endLine": 46, "fileName": "main.beancount", "note": "" }, { - "id": "c737b07df53db0880eed87b1cbb8c28c", + "id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "postings": [ { "id": 8, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "account": "Assets:Equity:NIFTY", @@ -382,8 +500,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.beancount", "forecast": false, "note": "", @@ -393,7 +511,7 @@ }, { "id": 7, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "account": "Assets:Checking", @@ -403,8 +521,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.beancount", "forecast": false, "note": "", @@ -415,19 +533,19 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 33, - "endLine": 36, + "beginLine": 35, + "endLine": 38, "fileName": "main.beancount", "note": "" }, { - "id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "postings": [ { "id": 6, - "transaction_id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "transaction_id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "account": "Assets:Checking", @@ -437,8 +555,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 29, - "transaction_end_line": 32, + "transaction_begin_line": 31, + "transaction_end_line": 34, "file_name": "main.beancount", "forecast": false, "note": "", @@ -448,7 +566,7 @@ }, { "id": 5, - "transaction_id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "transaction_id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "account": "Income:Salary:Acme", @@ -458,8 +576,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 29, - "transaction_end_line": 32, + "transaction_begin_line": 31, + "transaction_end_line": 34, "file_name": "main.beancount", "forecast": false, "note": "", @@ -470,19 +588,19 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 29, - "endLine": 32, + "beginLine": 31, + "endLine": 34, "fileName": "main.beancount", "note": "" }, { - "id": "c2160a8525ea6b909079fd22f091968a", + "id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "postings": [ { "id": 4, - "transaction_id": "c2160a8525ea6b909079fd22f091968a", + "transaction_id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "account": "Expenses:Rent", @@ -492,8 +610,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 25, - "transaction_end_line": 28, + "transaction_begin_line": 27, + "transaction_end_line": 30, "file_name": "main.beancount", "forecast": false, "note": "", @@ -503,7 +621,7 @@ }, { "id": 3, - "transaction_id": "c2160a8525ea6b909079fd22f091968a", + "transaction_id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "account": "Assets:Checking", @@ -513,8 +631,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 25, - "transaction_end_line": 28, + "transaction_begin_line": 27, + "transaction_end_line": 30, "file_name": "main.beancount", "forecast": false, "note": "", @@ -525,19 +643,19 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 25, - "endLine": 28, + "beginLine": 27, + "endLine": 30, "fileName": "main.beancount", "note": "" }, { - "id": "58b81f6fdf3f16622e7ef94305792377", + "id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "postings": [ { "id": 2, - "transaction_id": "58b81f6fdf3f16622e7ef94305792377", + "transaction_id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "account": "Assets:Checking", @@ -547,8 +665,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 21, - "transaction_end_line": 24, + "transaction_begin_line": 23, + "transaction_end_line": 26, "file_name": "main.beancount", "forecast": false, "note": "", @@ -558,7 +676,7 @@ }, { "id": 1, - "transaction_id": "58b81f6fdf3f16622e7ef94305792377", + "transaction_id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "account": "Income:Salary:Acme", @@ -568,8 +686,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 21, - "transaction_end_line": 24, + "transaction_begin_line": 23, + "transaction_end_line": 26, "file_name": "main.beancount", "forecast": false, "note": "", @@ -580,8 +698,8 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 21, - "endLine": 24, + "beginLine": 23, + "endLine": 26, "fileName": "main.beancount", "note": "" } diff --git a/tests/fixture/inr-beancount/expense.json b/tests/fixture/inr-beancount/expense.json index 68ccb885..0e50dd40 100644 --- a/tests/fixture/inr-beancount/expense.json +++ b/tests/fixture/inr-beancount/expense.json @@ -2,7 +2,7 @@ "expenses": [ { "id": 4, - "transaction_id": "c2160a8525ea6b909079fd22f091968a", + "transaction_id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "account": "Expenses:Rent", @@ -12,8 +12,29 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 25, - "transaction_end_line": 28, + "transaction_begin_line": 27, + "transaction_end_line": 30, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 16, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", @@ -30,9 +51,13 @@ "name": "Assets:Checking" }, { - "id": 13, + "id": 15, "name": "Assets:Coinbase:BTC" }, + { + "id": 10, + "name": "Assets:Dollar" + }, { "id": 9, "name": "Assets:Equity:AAPL" @@ -49,6 +74,10 @@ "id": 5, "name": "Expenses" }, + { + "id": 11, + "name": "Expenses:Charges" + }, { "id": 6, "name": "Expenses:Rent" @@ -58,23 +87,23 @@ "name": "Income" }, { - "id": 10, + "id": 12, "name": "Income:CapitalGains" }, { - "id": 11, + "id": 13, "name": "Income:CapitalGains:Equity" }, { - "id": 12, + "id": 14, "name": "Income:CapitalGains:Equity:AAPL" }, { - "id": 14, + "id": 16, "name": "Income:Interest" }, { - "id": 15, + "id": 17, "name": "Income:Interest:Checking" }, { @@ -90,7 +119,7 @@ { "source": 1, "target": 5, - "value": 20000 + "value": 20100 }, { "source": 1, @@ -100,17 +129,22 @@ { "source": 1, "target": 8, - "value": 8025.3170071296 + "value": 7963.762752 }, { "source": 1, "target": 9, "value": 10000 }, + { + "source": 1, + "target": 10, + "value": 804.42048 + }, { "source": 2, "target": 1, - "value": 121027.3 + "value": 121027 }, { "source": 3, @@ -127,34 +161,39 @@ "target": 6, "value": 20000 }, + { + "source": 5, + "target": 11, + "value": 100 + }, { "source": 9, "target": 1, "value": 10000 }, { - "source": 10, + "source": 12, "target": 2, - "value": 27.3 + "value": 27 }, { - "source": 11, - "target": 10, - "value": 27.3 + "source": 13, + "target": 12, + "value": 27 }, { - "source": 12, - "target": 11, - "value": 27.3 + "source": 14, + "target": 13, + "value": 27 }, { - "source": 14, + "source": 16, "target": 2, "value": 1000 }, { - "source": 15, - "target": 14, + "source": 17, + "target": 16, "value": 1000 } ] @@ -165,7 +204,7 @@ "2022-01": [ { "id": 4, - "transaction_id": "c2160a8525ea6b909079fd22f091968a", + "transaction_id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "account": "Expenses:Rent", @@ -175,8 +214,29 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 25, - "transaction_end_line": 28, + "transaction_begin_line": 27, + "transaction_end_line": 30, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 16, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", @@ -190,7 +250,7 @@ "2022-01": [ { "id": 1, - "transaction_id": "58b81f6fdf3f16622e7ef94305792377", + "transaction_id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "account": "Income:Salary:Acme", @@ -200,8 +260,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 21, - "transaction_end_line": 24, + "transaction_begin_line": 23, + "transaction_end_line": 26, "file_name": "main.beancount", "forecast": false, "note": "", @@ -211,7 +271,7 @@ }, { "id": 5, - "transaction_id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "transaction_id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "account": "Income:Salary:Acme", @@ -221,8 +281,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 29, - "transaction_end_line": 32, + "transaction_begin_line": 31, + "transaction_end_line": 34, "file_name": "main.beancount", "forecast": false, "note": "", @@ -232,18 +292,18 @@ }, { "id": 14, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Income:CapitalGains:Equity:AAPL", "commodity": "INR", "quantity": -27.3, - "amount": -27.3, + "amount": -27, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -252,8 +312,8 @@ "balance": 0 }, { - "id": 18, - "transaction_id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": 22, + "transaction_id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -263,8 +323,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 58, - "transaction_end_line": 61, + "transaction_begin_line": 65, + "transaction_end_line": 68, "file_name": "main.beancount", "forecast": false, "note": "", @@ -278,7 +338,7 @@ "2022-01": [ { "id": 8, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "account": "Assets:Equity:NIFTY", @@ -288,8 +348,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.beancount", "forecast": false, "note": "", @@ -299,18 +359,18 @@ }, { "id": 9, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "account": "Assets:Equity:ABNB", "commodity": "ABNB", "quantity": 0.76, - "amount": 8025.3170071296, + "amount": 7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", @@ -320,7 +380,7 @@ }, { "id": 11, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "account": "Assets:Equity:AAPL", @@ -330,8 +390,29 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 43, + "transaction_end_line": 46, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 18, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", @@ -341,7 +422,7 @@ }, { "id": 13, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Assets:Equity:AAPL", @@ -351,8 +432,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -361,19 +442,19 @@ "balance": 0 }, { - "id": 16, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 20, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Coinbase:BTC", "commodity": "BTC", "quantity": 1e-8, - "amount": 0.03440667277056, + "amount": 0, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 59, + "transaction_end_line": 62, "file_name": "main.beancount", "forecast": false, "note": "", @@ -390,7 +471,7 @@ "2021 - 22": [ { "id": 4, - "transaction_id": "c2160a8525ea6b909079fd22f091968a", + "transaction_id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "account": "Expenses:Rent", @@ -400,8 +481,29 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 25, - "transaction_end_line": 28, + "transaction_begin_line": 27, + "transaction_end_line": 30, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 16, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", @@ -415,7 +517,7 @@ "2021 - 22": [ { "id": 1, - "transaction_id": "58b81f6fdf3f16622e7ef94305792377", + "transaction_id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "account": "Income:Salary:Acme", @@ -425,8 +527,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 21, - "transaction_end_line": 24, + "transaction_begin_line": 23, + "transaction_end_line": 26, "file_name": "main.beancount", "forecast": false, "note": "", @@ -436,7 +538,7 @@ }, { "id": 5, - "transaction_id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "transaction_id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "account": "Income:Salary:Acme", @@ -446,8 +548,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 29, - "transaction_end_line": 32, + "transaction_begin_line": 31, + "transaction_end_line": 34, "file_name": "main.beancount", "forecast": false, "note": "", @@ -457,18 +559,18 @@ }, { "id": 14, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Income:CapitalGains:Equity:AAPL", "commodity": "INR", "quantity": -27.3, - "amount": -27.3, + "amount": -27, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -477,8 +579,8 @@ "balance": 0 }, { - "id": 18, - "transaction_id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": 22, + "transaction_id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -488,8 +590,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 58, - "transaction_end_line": 61, + "transaction_begin_line": 65, + "transaction_end_line": 68, "file_name": "main.beancount", "forecast": false, "note": "", @@ -503,7 +605,7 @@ "2021 - 22": [ { "id": 8, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "account": "Assets:Equity:NIFTY", @@ -513,8 +615,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.beancount", "forecast": false, "note": "", @@ -524,18 +626,18 @@ }, { "id": 9, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "account": "Assets:Equity:ABNB", "commodity": "ABNB", "quantity": 0.76, - "amount": 8025.3170071296, + "amount": 7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", @@ -545,7 +647,7 @@ }, { "id": 11, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "account": "Assets:Equity:AAPL", @@ -555,8 +657,29 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 43, + "transaction_end_line": 46, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 18, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", @@ -566,7 +689,7 @@ }, { "id": 13, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Assets:Equity:AAPL", @@ -576,8 +699,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -586,19 +709,19 @@ "balance": 0 }, { - "id": 16, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 20, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Coinbase:BTC", "commodity": "BTC", "quantity": 1e-8, - "amount": 0.03440667277056, + "amount": 0, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 59, + "transaction_end_line": 62, "file_name": "main.beancount", "forecast": false, "note": "", diff --git a/tests/fixture/inr-beancount/files.json b/tests/fixture/inr-beancount/files.json index 9b9f5c43..8db7a7fe 100644 --- a/tests/fixture/inr-beancount/files.json +++ b/tests/fixture/inr-beancount/files.json @@ -7,6 +7,8 @@ "Assets:Equity:ABNB", "Assets:Equity:AAPL", "Income:CapitalGains:Equity:AAPL", + "Expenses:Charges", + "Assets:Dollar", "Assets:Coinbase:BTC", "Income:Interest:Checking" ], @@ -21,7 +23,7 @@ "files": [ { "name": "main.beancount", - "content": "1970-01-01 open Assets:Checking\n1970-01-01 open Assets:Equity:AAPL\n1970-01-01 open Assets:Equity:ABNB\n1970-01-01 open Assets:Equity:NIFTY\n1970-01-01 open Expenses:Rent\n1970-01-01 open Income:CapitalGains:Equity:AAPL\n1970-01-01 open Income:Interest:Checking\n1970-01-01 open Income:Salary:Acme\n1970-01-01 open Assets:Coinbase:BTC\n\n1970-01-01 commodity AAPL\n1970-01-01 commodity ABNB\n1970-01-01 commodity INR\n1970-01-01 commodity NIFTY\n1970-01-01 commodity USD\n1970-01-01 commodity BTC\n\n2022-01-07 price NIFTY 100 INR\n2022-02-07 price NIFTY 100.273 INR\n\n2022-01-01 txn \"Salary\"\n Income:Salary:Acme -100,000 INR\n Assets:Checking 100,000 INR\n\n2022-01-03 txn \"Rent\"\n Assets:Checking -20,000 INR\n Expenses:Rent\n\n2022-01-06 txn \"Bonus\"\n Income:Salary:Acme -20,000 INR\n Assets:Checking 20,000 INR\n\n2022-01-07 txn \"Investment\"\n Assets:Checking -80,000 INR\n Assets:Equity:NIFTY 800 NIFTY {100 INR}\n\n2022-01-08 txn \"Buy ABNB\"\n Assets:Equity:ABNB 0.76 ABNB {131.27 USD}\n Assets:Checking\n\n2022-01-08 txn \"Buy Apple\"\n Assets:Equity:AAPL 100 AAPL {100 INR}\n Assets:Checking\n\n2022-01-09 txn \"Sell\"\n Assets:Equity:AAPL -100 AAPL {100 INR} @ 100.273 INR\n Income:CapitalGains:Equity:AAPL -27.3 INR\n Assets:Checking 10027.3 INR\n\n2022-01-08 price USD 80.442048 INR\n\n2022-01-10 txn \"Purchased 0.00000001 BTC\"\n Assets:Coinbase:BTC 0.00000001 BTC {42772 USD}\n Assets:Checking -0.00042772 USD\n\n2022-01-31 txn \"Interest\"\n ; Global note\n ; :interest:\n Income:Interest:Checking -1,000 INR ; Posting note\n Assets:Checking\n\n2022/01/31 balance Assets:Equity:NIFTY 800 NIFTY\n", + "content": "1970-01-01 open Assets:Checking\n1970-01-01 open Assets:Equity:AAPL\n1970-01-01 open Assets:Equity:ABNB\n1970-01-01 open Assets:Equity:NIFTY\n1970-01-01 open Expenses:Rent\n1970-01-01 open Expenses:Charges\n1970-01-01 open Income:CapitalGains:Equity:AAPL\n1970-01-01 open Income:Interest:Checking\n1970-01-01 open Income:Salary:Acme\n1970-01-01 open Assets:Coinbase:BTC\n1970-01-01 open Assets:Dollar\n\n1970-01-01 commodity AAPL\n1970-01-01 commodity ABNB\n1970-01-01 commodity INR\n1970-01-01 commodity NIFTY\n1970-01-01 commodity USD\n1970-01-01 commodity BTC\n\n2022-01-07 price NIFTY 100 INR\n2022-02-07 price NIFTY 100.273 INR\n\n2022-01-01 txn \"Salary\"\n Income:Salary:Acme -100,000 INR\n Assets:Checking 100,000 INR\n\n2022-01-03 txn \"Rent\"\n Assets:Checking -20,000 INR\n Expenses:Rent\n\n2022-01-06 txn \"Bonus\"\n Income:Salary:Acme -20,000 INR\n Assets:Checking 20,000 INR\n\n2022-01-07 txn \"Investment\"\n Assets:Checking -80,000 INR\n Assets:Equity:NIFTY 800 NIFTY {100 INR}\n\n2022-01-08 txn \"Buy ABNB\"\n Assets:Equity:ABNB 0.76 ABNB {131.27 USD}\n Assets:Checking\n\n2022-01-08 txn \"Buy Apple\"\n Assets:Equity:AAPL 100 AAPL {100 INR}\n Assets:Checking\n\n2022-01-09 txn \"Sell\"\n Assets:Equity:AAPL -100 AAPL {100 INR} @ 100.273 INR\n Income:CapitalGains:Equity:AAPL -27.3 INR\n Assets:Checking 10027.3 INR\n\n2022-01-08 price USD 80.442048 INR\n\n2022-01-09 txn \"Multi Currency Debit\"\n Expenses:Charges 100 INR\n Assets:Dollar 10 USD\n Assets:Checking\n\n2022-01-10 txn \"Purchased 0.00000001 BTC\"\n Assets:Coinbase:BTC 0.00000001 BTC {42772 USD}\n Assets:Checking -0.00042772 USD\n\n2022-01-31 txn \"Interest\"\n ; Global note\n ; :interest:\n Income:Interest:Checking -1,000 INR ; Posting note\n Assets:Checking\n\n2022/01/31 balance Assets:Equity:NIFTY 800 NIFTY\n", "versions": [], "operation": "" } @@ -34,6 +36,7 @@ "Buy ABNB", "Buy Apple", "Sell", + "Multi Currency Debit", "Purchased 0.00000001 BTC", "Interest" ] diff --git a/tests/fixture/inr-beancount/gain.json b/tests/fixture/inr-beancount/gain.json index b230b9c3..25c58be6 100644 --- a/tests/fixture/inr-beancount/gain.json +++ b/tests/fixture/inr-beancount/gain.json @@ -4,34 +4,70 @@ "account": "Assets:Coinbase:BTC", "networth": { "date": "2022-02-07T23:59:59.999999999Z", - "investmentAmount": 0.03440667277056, + "investmentAmount": 0, "withdrawalAmount": 0, "gainAmount": 0, - "balanceAmount": 0.03440667277056, + "balanceAmount": 0, "balanceUnits": 0, - "netInvestmentAmount": 0.03440667277056 + "netInvestmentAmount": 0 }, "xirr": 0, "postings": [ { - "id": 16, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 20, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Coinbase:BTC", "commodity": "BTC", "quantity": 1e-8, - "amount": 0.03440667277056, + "amount": 0, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 59, + "transaction_end_line": 62, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + } + ] + }, + { + "account": "Assets:Dollar", + "networth": { + "date": "2022-02-07T23:59:59.999999999Z", + "investmentAmount": 804.42048, + "withdrawalAmount": 0, + "gainAmount": 0, + "balanceAmount": 804.42048, + "balanceUnits": 0, + "netInvestmentAmount": 804.42048 + }, + "xirr": 0, + "postings": [ + { + "id": 18, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": 0.03440667277056, + "market_amount": 804.42048, "balance": 0 } ] @@ -41,17 +77,17 @@ "networth": { "date": "2022-02-07T23:59:59.999999999Z", "investmentAmount": 10000, - "withdrawalAmount": 10027.3, - "gainAmount": 27.3, + "withdrawalAmount": 10027, + "gainAmount": 27, "balanceAmount": 0, "balanceUnits": 0, - "netInvestmentAmount": -27.3 + "netInvestmentAmount": -27 }, - "xirr": 151.56, + "xirr": 149.2, "postings": [ { "id": 11, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "account": "Assets:Equity:AAPL", @@ -61,8 +97,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 43, + "transaction_end_line": 46, "file_name": "main.beancount", "forecast": false, "note": "", @@ -72,28 +108,28 @@ }, { "id": 14, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Income:CapitalGains:Equity:AAPL", "commodity": "INR", "quantity": -27.3, - "amount": -27.3, + "amount": -27, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -27.3, + "market_amount": -27, "balance": 0 }, { "id": 13, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Assets:Equity:AAPL", @@ -103,8 +139,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -118,34 +154,34 @@ "account": "Assets:Equity:ABNB", "networth": { "date": "2022-02-07T23:59:59.999999999Z", - "investmentAmount": 8025.3170071296, + "investmentAmount": 7963.762752, "withdrawalAmount": 0, "gainAmount": 0, - "balanceAmount": 8025.3170071296, + "balanceAmount": 7963.762752, "balanceUnits": 0, - "netInvestmentAmount": 8025.3170071296 + "netInvestmentAmount": 7963.762752 }, "xirr": 0, "postings": [ { "id": 9, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "account": "Assets:Equity:ABNB", "commodity": "ABNB", "quantity": 0.76, - "amount": 8025.3170071296, + "amount": 7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": 8025.3170071296, + "market_amount": 7963.762752, "balance": 0 } ] @@ -165,7 +201,7 @@ "postings": [ { "id": 8, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "account": "Assets:Equity:NIFTY", @@ -175,8 +211,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.beancount", "forecast": false, "note": "", diff --git a/tests/fixture/inr-beancount/income.json b/tests/fixture/inr-beancount/income.json index a9a7ee86..cece53f9 100644 --- a/tests/fixture/inr-beancount/income.json +++ b/tests/fixture/inr-beancount/income.json @@ -5,7 +5,7 @@ "postings": [ { "id": 1, - "transaction_id": "58b81f6fdf3f16622e7ef94305792377", + "transaction_id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "account": "Income:Salary:Acme", @@ -15,8 +15,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 21, - "transaction_end_line": 24, + "transaction_begin_line": 23, + "transaction_end_line": 26, "file_name": "main.beancount", "forecast": false, "note": "", @@ -26,7 +26,7 @@ }, { "id": 5, - "transaction_id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "transaction_id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "account": "Income:Salary:Acme", @@ -36,8 +36,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 29, - "transaction_end_line": 32, + "transaction_begin_line": 31, + "transaction_end_line": 34, "file_name": "main.beancount", "forecast": false, "note": "", @@ -47,18 +47,18 @@ }, { "id": 14, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Income:CapitalGains:Equity:AAPL", "commodity": "INR", "quantity": -27.3, - "amount": -27.3, + "amount": -27, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -67,8 +67,8 @@ "balance": 0 }, { - "id": 18, - "transaction_id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": 22, + "transaction_id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -78,8 +78,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 58, - "transaction_end_line": 61, + "transaction_begin_line": 65, + "transaction_end_line": 68, "file_name": "main.beancount", "forecast": false, "note": "", @@ -102,7 +102,7 @@ "postings": [ { "id": 1, - "transaction_id": "58b81f6fdf3f16622e7ef94305792377", + "transaction_id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "account": "Income:Salary:Acme", @@ -112,8 +112,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 21, - "transaction_end_line": 24, + "transaction_begin_line": 23, + "transaction_end_line": 26, "file_name": "main.beancount", "forecast": false, "note": "", @@ -123,7 +123,7 @@ }, { "id": 5, - "transaction_id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "transaction_id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "account": "Income:Salary:Acme", @@ -133,8 +133,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 29, - "transaction_end_line": 32, + "transaction_begin_line": 31, + "transaction_end_line": 34, "file_name": "main.beancount", "forecast": false, "note": "", @@ -144,18 +144,18 @@ }, { "id": 14, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Income:CapitalGains:Equity:AAPL", "commodity": "INR", "quantity": -27.3, - "amount": -27.3, + "amount": -27, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -164,8 +164,8 @@ "balance": 0 }, { - "id": 18, - "transaction_id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": 22, + "transaction_id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -175,8 +175,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 58, - "transaction_end_line": 61, + "transaction_begin_line": 65, + "transaction_end_line": 68, "file_name": "main.beancount", "forecast": false, "note": "", @@ -185,9 +185,9 @@ "balance": 0 } ], - "gross_income": 121027.3, + "gross_income": 121027, "net_tax": 0, - "net_income": 121027.3 + "net_income": 121027 } ] } \ No newline at end of file diff --git a/tests/fixture/inr-beancount/income_statement.json b/tests/fixture/inr-beancount/income_statement.json index ef3686f4..d66c6de6 100644 --- a/tests/fixture/inr-beancount/income_statement.json +++ b/tests/fixture/inr-beancount/income_statement.json @@ -2,7 +2,7 @@ "yearly": { "2021 - 22": { "startingBalance": 0, - "endingBalance": 93221.10858620763, + "endingBalance": 93121.10858620763, "date": "2021-04-01T00:00:00Z", "income": { "Income:Salary:Acme": -120000 @@ -12,14 +12,16 @@ }, "equity": {}, "pnl": { - "Assets:Coinbase:BTC": -0.03440666277056, - "Assets:Equity:AAPL": 27.3, - "Assets:Equity:ABNB": -8024.5570071296, + "Assets:Checking": -61.28866180237056, + "Assets:Coinbase:BTC": 1e-8, + "Assets:Equity:AAPL": 27, + "Assets:Equity:ABNB": -7963.002752, "Assets:Equity:NIFTY": 218.4 }, "liabilities": {}, "tax": {}, "expenses": { + "Expenses:Charges": 100, "Expenses:Rent": 20000 } } diff --git a/tests/fixture/inr-beancount/investment.json b/tests/fixture/inr-beancount/investment.json index 58f2500c..15bbdc9e 100644 --- a/tests/fixture/inr-beancount/investment.json +++ b/tests/fixture/inr-beancount/investment.json @@ -2,7 +2,7 @@ "assets": [ { "id": 8, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "account": "Assets:Equity:NIFTY", @@ -12,8 +12,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.beancount", "forecast": false, "note": "", @@ -23,18 +23,18 @@ }, { "id": 9, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "account": "Assets:Equity:ABNB", "commodity": "ABNB", "quantity": 0.76, - "amount": 8025.3170071296, + "amount": 7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", @@ -44,7 +44,7 @@ }, { "id": 11, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "account": "Assets:Equity:AAPL", @@ -54,8 +54,29 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 43, + "transaction_end_line": 46, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 18, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", @@ -65,7 +86,7 @@ }, { "id": 13, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Assets:Equity:AAPL", @@ -75,8 +96,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -85,19 +106,19 @@ "balance": 0 }, { - "id": 16, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 20, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Coinbase:BTC", "commodity": "BTC", "quantity": 1e-8, - "amount": 0.03440667277056, + "amount": 0, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 59, + "transaction_end_line": 62, "file_name": "main.beancount", "forecast": false, "note": "", @@ -113,7 +134,7 @@ "postings": [ { "id": 8, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "account": "Assets:Equity:NIFTY", @@ -123,8 +144,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.beancount", "forecast": false, "note": "", @@ -134,18 +155,18 @@ }, { "id": 9, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "account": "Assets:Equity:ABNB", "commodity": "ABNB", "quantity": 0.76, - "amount": 8025.3170071296, + "amount": 7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", @@ -155,7 +176,7 @@ }, { "id": 11, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "account": "Assets:Equity:AAPL", @@ -165,8 +186,29 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 43, + "transaction_end_line": 46, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 18, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", @@ -176,7 +218,7 @@ }, { "id": 13, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Assets:Equity:AAPL", @@ -186,8 +228,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -196,19 +238,19 @@ "balance": 0 }, { - "id": 16, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 20, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Coinbase:BTC", "commodity": "BTC", "quantity": 1e-8, - "amount": 0.03440667277056, + "amount": 0, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 59, + "transaction_end_line": 62, "file_name": "main.beancount", "forecast": false, "note": "", @@ -218,12 +260,12 @@ } ], "gross_salary_income": 120000, - "gross_other_income": 1027.3, + "gross_other_income": 1027, "net_tax": 0, - "net_income": 121027.3, - "net_investment": 88025.35141380237, - "net_expense": 20000, - "savings_rate": 72.73181456894632 + "net_income": 121027, + "net_investment": 88768.183232, + "net_expense": 20100, + "savings_rate": 73.34576849132839 } ] } \ No newline at end of file diff --git a/tests/fixture/inr-beancount/ledger.json b/tests/fixture/inr-beancount/ledger.json index f7a65266..015aa98a 100644 --- a/tests/fixture/inr-beancount/ledger.json +++ b/tests/fixture/inr-beancount/ledger.json @@ -1,8 +1,8 @@ { "postings": [ { - "id": 18, - "transaction_id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": 22, + "transaction_id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -12,8 +12,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 58, - "transaction_end_line": 61, + "transaction_begin_line": 65, + "transaction_end_line": 68, "file_name": "main.beancount", "forecast": false, "note": "", @@ -22,8 +22,8 @@ "balance": -1000 }, { - "id": 19, - "transaction_id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": 23, + "transaction_id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Assets:Checking", @@ -33,228 +33,291 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 58, - "transaction_end_line": 61, + "transaction_begin_line": 65, + "transaction_end_line": 68, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", "market_amount": 1000, - "balance": 20927.53437228 + "balance": 20817.53437228 }, { - "id": 16, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 20, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Coinbase:BTC", "commodity": "BTC", "quantity": 1e-8, - "amount": 0.03440667277056, + "amount": 0, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 59, + "transaction_end_line": 62, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": 0.03440667277056, + "market_amount": 0, "balance": 1e-8 }, { - "id": 17, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 21, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Checking", "commodity": "USD", "quantity": -0.00042772, - "amount": -0.03440667277056, + "amount": 0, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 59, + "transaction_end_line": 62, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", "market_amount": -0.03440667277056, - "balance": 19927.53437228 + "balance": 19817.53437228 }, { - "id": 13, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "id": 15, + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", - "account": "Assets:Equity:AAPL", - "commodity": "AAPL", - "quantity": -100, - "amount": -10000, + "account": "Assets:Checking", + "commodity": "INR", + "quantity": 10027.3, + "amount": 10027, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -10000, - "balance": 0 + "market_amount": 10027, + "balance": 19927.5348 }, { - "id": 15, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "id": 18, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", "date": "2022-01-09T00:00:00Z", - "payee": "Sell", - "account": "Assets:Checking", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 804.42048, + "balance": 10 + }, + { + "id": 16, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", "commodity": "INR", - "quantity": 10027.3, - "amount": 10027.3, + "quantity": 100, + "amount": 100, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": 10027.3, - "balance": 19927.5348 + "market_amount": 100, + "balance": 100 + }, + { + "id": 19, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "USD", + "quantity": -10, + "amount": -804.42048, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": -804.42048, + "balance": 19817.5348 }, { "id": 14, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Income:CapitalGains:Equity:AAPL", "commodity": "INR", "quantity": -27.3, - "amount": -27.3, + "amount": -27, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -27.3, + "market_amount": -27, "balance": -27.3 }, { - "id": 11, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", - "date": "2022-01-08T00:00:00Z", - "payee": "Buy Apple", + "id": 13, + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", + "date": "2022-01-09T00:00:00Z", + "payee": "Sell", "account": "Assets:Equity:AAPL", "commodity": "AAPL", - "quantity": 100, - "amount": 10000, + "quantity": -100, + "amount": -10000, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": 10000, - "balance": 100 + "market_amount": -10000, + "balance": 0 }, { - "id": 10, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", - "date": "2022-01-08T00:00:00Z", - "payee": "Buy ABNB", + "id": 17, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", "account": "Assets:Checking", - "commodity": "USD", - "quantity": -99.7652, - "amount": -8025.3170071296, + "commodity": "INR", + "quantity": -100, + "amount": -100, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -8025.3170071296, - "balance": 19900.2348 + "market_amount": -100, + "balance": 19827.5348 }, { - "id": 12, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", + "id": 10, + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", - "payee": "Buy Apple", + "payee": "Buy ABNB", "account": "Assets:Checking", - "commodity": "INR", - "quantity": -10000, - "amount": -10000, + "commodity": "USD", + "quantity": -99.7652, + "amount": -7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -10000, + "market_amount": -8025.3170071296, "balance": 9900.2348 }, { "id": 9, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "account": "Assets:Equity:ABNB", "commodity": "ABNB", "quantity": 0.76, - "amount": 8025.3170071296, + "amount": 7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": 8025.3170071296, + "market_amount": 7963.762752, "balance": 0.76 }, { - "id": 7, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", - "date": "2022-01-07T00:00:00Z", - "payee": "Investment", + "id": 12, + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", + "date": "2022-01-08T00:00:00Z", + "payee": "Buy Apple", "account": "Assets:Checking", "commodity": "INR", - "quantity": -80000, - "amount": -80000, + "quantity": -10000, + "amount": -10000, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 43, + "transaction_end_line": 46, "file_name": "main.beancount", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -80000, - "balance": 20000 + "market_amount": -10000, + "balance": 10000 + }, + { + "id": 11, + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", + "date": "2022-01-08T00:00:00Z", + "payee": "Buy Apple", + "account": "Assets:Equity:AAPL", + "commodity": "AAPL", + "quantity": 100, + "amount": 10000, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 43, + "transaction_end_line": 46, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 10000, + "balance": 100 }, { "id": 8, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "account": "Assets:Equity:NIFTY", @@ -264,8 +327,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.beancount", "forecast": false, "note": "", @@ -273,9 +336,30 @@ "market_amount": 80218.4, "balance": 800 }, + { + "id": 7, + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", + "date": "2022-01-07T00:00:00Z", + "payee": "Investment", + "account": "Assets:Checking", + "commodity": "INR", + "quantity": -80000, + "amount": -80000, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": -80000, + "balance": 20000 + }, { "id": 6, - "transaction_id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "transaction_id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "account": "Assets:Checking", @@ -285,8 +369,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 29, - "transaction_end_line": 32, + "transaction_begin_line": 31, + "transaction_end_line": 34, "file_name": "main.beancount", "forecast": false, "note": "", @@ -296,7 +380,7 @@ }, { "id": 5, - "transaction_id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "transaction_id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "account": "Income:Salary:Acme", @@ -306,8 +390,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 29, - "transaction_end_line": 32, + "transaction_begin_line": 31, + "transaction_end_line": 34, "file_name": "main.beancount", "forecast": false, "note": "", @@ -317,7 +401,7 @@ }, { "id": 4, - "transaction_id": "c2160a8525ea6b909079fd22f091968a", + "transaction_id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "account": "Expenses:Rent", @@ -327,8 +411,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 25, - "transaction_end_line": 28, + "transaction_begin_line": 27, + "transaction_end_line": 30, "file_name": "main.beancount", "forecast": false, "note": "", @@ -338,7 +422,7 @@ }, { "id": 3, - "transaction_id": "c2160a8525ea6b909079fd22f091968a", + "transaction_id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "account": "Assets:Checking", @@ -348,8 +432,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 25, - "transaction_end_line": 28, + "transaction_begin_line": 27, + "transaction_end_line": 30, "file_name": "main.beancount", "forecast": false, "note": "", @@ -359,7 +443,7 @@ }, { "id": 1, - "transaction_id": "58b81f6fdf3f16622e7ef94305792377", + "transaction_id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "account": "Income:Salary:Acme", @@ -369,8 +453,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 21, - "transaction_end_line": 24, + "transaction_begin_line": 23, + "transaction_end_line": 26, "file_name": "main.beancount", "forecast": false, "note": "", @@ -380,7 +464,7 @@ }, { "id": 2, - "transaction_id": "58b81f6fdf3f16622e7ef94305792377", + "transaction_id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "account": "Assets:Checking", @@ -390,8 +474,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 21, - "transaction_end_line": 24, + "transaction_begin_line": 23, + "transaction_end_line": 26, "file_name": "main.beancount", "forecast": false, "note": "", diff --git a/tests/fixture/inr-beancount/networth.json b/tests/fixture/inr-beancount/networth.json index d14cc7b0..b1066b05 100644 --- a/tests/fixture/inr-beancount/networth.json +++ b/tests/fixture/inr-beancount/networth.json @@ -65,283 +65,283 @@ }, { "date": "2022-01-08T00:00:00Z", - "investmentAmount": 218025.3170071296, - "withdrawalAmount": 118025.3170071296, - "gainAmount": 0, - "balanceAmount": 100000, + "investmentAmount": 217963.762752, + "withdrawalAmount": 117963.762752, + "gainAmount": -61.5542551296, + "balanceAmount": 99938.4457448704, "balanceUnits": 0, "netInvestmentAmount": 100000 }, { "date": "2022-01-09T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.5542551296, + "balanceAmount": 99865.4457448704, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-10T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-11T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-12T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-13T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-14T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-15T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-16T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-17T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-18T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-19T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-20T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-21T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-22T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-23T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-24T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-25T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-26T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-27T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-28T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-29T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-30T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 27.3, - "balanceAmount": 100027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": -34.58866180237056, + "balanceAmount": 99865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-31T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": 965.4113381976294, + "balanceAmount": 100865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-01T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": 965.4113381976294, + "balanceAmount": 100865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-02T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": 965.4113381976294, + "balanceAmount": 100865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-03T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": 965.4113381976294, + "balanceAmount": 100865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-04T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": 965.4113381976294, + "balanceAmount": 100865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-05T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": 965.4113381976294, + "balanceAmount": 100865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-06T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": 965.4113381976294, + "balanceAmount": 100865.41133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-07T00:00:00Z", - "investmentAmount": 228052.65141380238, - "withdrawalAmount": 128052.65141380238, - "gainAmount": 1245.7, - "balanceAmount": 101245.7, + "investmentAmount": 228795.183232, + "withdrawalAmount": 128895.183232, + "gainAmount": 1183.8113381976295, + "balanceAmount": 101083.81133819763, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 } ], - "xirr": 12.84 + "xirr": 12.18 } \ No newline at end of file diff --git a/tests/fixture/inr-beancount/transaction.json b/tests/fixture/inr-beancount/transaction.json index f3dc98f9..d99b256b 100644 --- a/tests/fixture/inr-beancount/transaction.json +++ b/tests/fixture/inr-beancount/transaction.json @@ -1,13 +1,13 @@ { "transactions": [ { - "id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "postings": [ { - "id": 19, - "transaction_id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": 23, + "transaction_id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Assets:Checking", @@ -17,8 +17,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 58, - "transaction_end_line": 61, + "transaction_begin_line": 65, + "transaction_end_line": 68, "file_name": "main.beancount", "forecast": false, "note": "", @@ -27,8 +27,8 @@ "balance": 0 }, { - "id": 18, - "transaction_id": "a68e8db74c26e1543ba2b2f52af681d1", + "id": 22, + "transaction_id": "f928b4a8eec8c55346755b616a232f13", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -38,8 +38,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 58, - "transaction_end_line": 61, + "transaction_begin_line": 65, + "transaction_end_line": 68, "file_name": "main.beancount", "forecast": false, "note": "", @@ -50,30 +50,30 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 58, - "endLine": 61, + "beginLine": 65, + "endLine": 68, "fileName": "main.beancount", "note": "" }, { - "id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "postings": [ { - "id": 16, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 20, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Coinbase:BTC", "commodity": "BTC", "quantity": 1e-8, - "amount": 0.03440667277056, + "amount": 0, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 59, + "transaction_end_line": 62, "file_name": "main.beancount", "forecast": false, "note": "", @@ -82,19 +82,116 @@ "balance": 0 }, { - "id": 17, - "transaction_id": "04bcc4e3077a15d78cf9e39b7acf7365", + "id": 21, + "transaction_id": "f206938e60d684dd02770127f2dfc424", "date": "2022-01-10T00:00:00Z", "payee": "Purchased 0.00000001 BTC", "account": "Assets:Checking", "commodity": "USD", "quantity": -0.00042772, - "amount": -0.03440667277056, + "amount": 0, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 59, + "transaction_end_line": 62, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + } + ], + "tag_recurring": "", + "tag_period": "", + "beginLine": 59, + "endLine": 62, + "fileName": "main.beancount", + "note": "" + }, + { + "id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "postings": [ + { + "id": 18, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 16, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 19, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "USD", + "quantity": -10, + "amount": -804.42048, + "status": "cleared", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 54, + "transaction_end_line": 58, + "file_name": "main.beancount", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 17, + "transaction_id": "ca0abf28144bacf55feee4f01b15164e", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "INR", + "quantity": -100, + "amount": -100, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 52, - "transaction_end_line": 55, + "transaction_begin_line": 54, + "transaction_end_line": 58, "file_name": "main.beancount", "forecast": false, "note": "", @@ -105,30 +202,30 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 52, - "endLine": 55, + "beginLine": 54, + "endLine": 58, "fileName": "main.beancount", "note": "" }, { - "id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "postings": [ { "id": 15, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Assets:Checking", "commodity": "INR", "quantity": 10027.3, - "amount": 10027.3, + "amount": 10027, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -138,18 +235,18 @@ }, { "id": 14, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Income:CapitalGains:Equity:AAPL", "commodity": "INR", "quantity": -27.3, - "amount": -27.3, + "amount": -27, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -159,7 +256,7 @@ }, { "id": 13, - "transaction_id": "f94666a5e00e6fb7fde74aa1c3990f7f", + "transaction_id": "918670fa710ecf6ae9ccc8e6eee56def", "date": "2022-01-09T00:00:00Z", "payee": "Sell", "account": "Assets:Equity:AAPL", @@ -169,8 +266,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 45, - "transaction_end_line": 49, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.beancount", "forecast": false, "note": "", @@ -181,30 +278,30 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 45, - "endLine": 49, + "beginLine": 47, + "endLine": 51, "fileName": "main.beancount", "note": "" }, { - "id": "c1b0e83e369be2f6b1ad089b3b62f337", + "id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "postings": [ { "id": 9, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "account": "Assets:Equity:ABNB", "commodity": "ABNB", "quantity": 0.76, - "amount": 8025.3170071296, + "amount": 7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", @@ -214,18 +311,18 @@ }, { "id": 10, - "transaction_id": "c1b0e83e369be2f6b1ad089b3b62f337", + "transaction_id": "45de345242de44d435470249ade015b0", "date": "2022-01-08T00:00:00Z", "payee": "Buy ABNB", "account": "Assets:Checking", "commodity": "USD", "quantity": -99.7652, - "amount": -8025.3170071296, + "amount": -7963.762752, "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 40, + "transaction_begin_line": 39, + "transaction_end_line": 42, "file_name": "main.beancount", "forecast": false, "note": "", @@ -236,19 +333,19 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 37, - "endLine": 40, + "beginLine": 39, + "endLine": 42, "fileName": "main.beancount", "note": "" }, { - "id": "266960fc42ae079e572bd565bddc39b6", + "id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "postings": [ { "id": 11, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "account": "Assets:Equity:AAPL", @@ -258,8 +355,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 43, + "transaction_end_line": 46, "file_name": "main.beancount", "forecast": false, "note": "", @@ -269,7 +366,7 @@ }, { "id": 12, - "transaction_id": "266960fc42ae079e572bd565bddc39b6", + "transaction_id": "190f6e27b6cd79f8c02583980e33d850", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", "account": "Assets:Checking", @@ -279,8 +376,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 41, - "transaction_end_line": 44, + "transaction_begin_line": 43, + "transaction_end_line": 46, "file_name": "main.beancount", "forecast": false, "note": "", @@ -291,19 +388,19 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 41, - "endLine": 44, + "beginLine": 43, + "endLine": 46, "fileName": "main.beancount", "note": "" }, { - "id": "c737b07df53db0880eed87b1cbb8c28c", + "id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "postings": [ { "id": 8, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "account": "Assets:Equity:NIFTY", @@ -313,8 +410,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.beancount", "forecast": false, "note": "", @@ -324,7 +421,7 @@ }, { "id": 7, - "transaction_id": "c737b07df53db0880eed87b1cbb8c28c", + "transaction_id": "baecffd15f1d49f81b1a38465edd6981", "date": "2022-01-07T00:00:00Z", "payee": "Investment", "account": "Assets:Checking", @@ -334,8 +431,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 33, - "transaction_end_line": 36, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.beancount", "forecast": false, "note": "", @@ -346,19 +443,19 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 33, - "endLine": 36, + "beginLine": 35, + "endLine": 38, "fileName": "main.beancount", "note": "" }, { - "id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "postings": [ { "id": 6, - "transaction_id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "transaction_id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "account": "Assets:Checking", @@ -368,8 +465,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 29, - "transaction_end_line": 32, + "transaction_begin_line": 31, + "transaction_end_line": 34, "file_name": "main.beancount", "forecast": false, "note": "", @@ -379,7 +476,7 @@ }, { "id": 5, - "transaction_id": "ad18f7219d2dfae9b6eccaca4a50ae8a", + "transaction_id": "ad1e86e51a1580c3d5f7ef104adea932", "date": "2022-01-06T00:00:00Z", "payee": "Bonus", "account": "Income:Salary:Acme", @@ -389,8 +486,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 29, - "transaction_end_line": 32, + "transaction_begin_line": 31, + "transaction_end_line": 34, "file_name": "main.beancount", "forecast": false, "note": "", @@ -401,19 +498,19 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 29, - "endLine": 32, + "beginLine": 31, + "endLine": 34, "fileName": "main.beancount", "note": "" }, { - "id": "c2160a8525ea6b909079fd22f091968a", + "id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "postings": [ { "id": 4, - "transaction_id": "c2160a8525ea6b909079fd22f091968a", + "transaction_id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "account": "Expenses:Rent", @@ -423,8 +520,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 25, - "transaction_end_line": 28, + "transaction_begin_line": 27, + "transaction_end_line": 30, "file_name": "main.beancount", "forecast": false, "note": "", @@ -434,7 +531,7 @@ }, { "id": 3, - "transaction_id": "c2160a8525ea6b909079fd22f091968a", + "transaction_id": "1f8cde847fd28fa32bdec426b998ad40", "date": "2022-01-03T00:00:00Z", "payee": "Rent", "account": "Assets:Checking", @@ -444,8 +541,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 25, - "transaction_end_line": 28, + "transaction_begin_line": 27, + "transaction_end_line": 30, "file_name": "main.beancount", "forecast": false, "note": "", @@ -456,19 +553,19 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 25, - "endLine": 28, + "beginLine": 27, + "endLine": 30, "fileName": "main.beancount", "note": "" }, { - "id": "58b81f6fdf3f16622e7ef94305792377", + "id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "postings": [ { "id": 2, - "transaction_id": "58b81f6fdf3f16622e7ef94305792377", + "transaction_id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "account": "Assets:Checking", @@ -478,8 +575,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 21, - "transaction_end_line": 24, + "transaction_begin_line": 23, + "transaction_end_line": 26, "file_name": "main.beancount", "forecast": false, "note": "", @@ -489,7 +586,7 @@ }, { "id": 1, - "transaction_id": "58b81f6fdf3f16622e7ef94305792377", + "transaction_id": "2c4c2c0e801a4f2e5225b7292e6ac216", "date": "2022-01-01T00:00:00Z", "payee": "Salary", "account": "Income:Salary:Acme", @@ -499,8 +596,8 @@ "status": "cleared", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 21, - "transaction_end_line": 24, + "transaction_begin_line": 23, + "transaction_end_line": 26, "file_name": "main.beancount", "forecast": false, "note": "", @@ -511,8 +608,8 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 21, - "endLine": 24, + "beginLine": 23, + "endLine": 26, "fileName": "main.beancount", "note": "" } diff --git a/tests/fixture/inr-hledger/allocation.json b/tests/fixture/inr-hledger/allocation.json index adbaf773..c0c269e6 100644 --- a/tests/fixture/inr-hledger/allocation.json +++ b/tests/fixture/inr-hledger/allocation.json @@ -9,8 +9,14 @@ "Assets:Checking": { "date": "2022-02-07T23:59:59.999999999Z", "account": "Assets:Checking", - "amount": 4976.6659857408, - "market_amount": 4976.6659857408 + "amount": 4072.2455057408, + "market_amount": 4072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-02-07T23:59:59.999999999Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity": { "date": "0001-01-01T00:00:00Z", @@ -130,8 +136,14 @@ "Assets:Checking": { "date": "2022-01-09T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-09T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-09T00:00:00Z", @@ -156,8 +168,14 @@ "Assets:Checking": { "date": "2022-01-10T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-10T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-10T00:00:00Z", @@ -182,8 +200,14 @@ "Assets:Checking": { "date": "2022-01-11T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-11T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-11T00:00:00Z", @@ -208,8 +232,14 @@ "Assets:Checking": { "date": "2022-01-12T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-12T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-12T00:00:00Z", @@ -234,8 +264,14 @@ "Assets:Checking": { "date": "2022-01-13T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-13T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-13T00:00:00Z", @@ -260,8 +296,14 @@ "Assets:Checking": { "date": "2022-01-14T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-14T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-14T00:00:00Z", @@ -286,8 +328,14 @@ "Assets:Checking": { "date": "2022-01-15T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-15T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-15T00:00:00Z", @@ -312,8 +360,14 @@ "Assets:Checking": { "date": "2022-01-16T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-16T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-16T00:00:00Z", @@ -338,8 +392,14 @@ "Assets:Checking": { "date": "2022-01-17T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-17T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-17T00:00:00Z", @@ -364,8 +424,14 @@ "Assets:Checking": { "date": "2022-01-18T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-18T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-18T00:00:00Z", @@ -390,8 +456,14 @@ "Assets:Checking": { "date": "2022-01-19T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-19T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-19T00:00:00Z", @@ -416,8 +488,14 @@ "Assets:Checking": { "date": "2022-01-20T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-20T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-20T00:00:00Z", @@ -442,8 +520,14 @@ "Assets:Checking": { "date": "2022-01-21T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-21T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-21T00:00:00Z", @@ -468,8 +552,14 @@ "Assets:Checking": { "date": "2022-01-22T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-22T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-22T00:00:00Z", @@ -494,8 +584,14 @@ "Assets:Checking": { "date": "2022-01-23T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-23T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-23T00:00:00Z", @@ -520,8 +616,14 @@ "Assets:Checking": { "date": "2022-01-24T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-24T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-24T00:00:00Z", @@ -546,8 +648,14 @@ "Assets:Checking": { "date": "2022-01-25T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-25T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-25T00:00:00Z", @@ -572,8 +680,14 @@ "Assets:Checking": { "date": "2022-01-26T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-26T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-26T00:00:00Z", @@ -598,8 +712,14 @@ "Assets:Checking": { "date": "2022-01-27T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-27T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-27T00:00:00Z", @@ -624,8 +744,14 @@ "Assets:Checking": { "date": "2022-01-28T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-28T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-28T00:00:00Z", @@ -650,8 +776,14 @@ "Assets:Checking": { "date": "2022-01-29T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-29T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-29T00:00:00Z", @@ -676,8 +808,14 @@ "Assets:Checking": { "date": "2022-01-30T00:00:00Z", "account": "Assets:Checking", - "amount": 3976.6659857408, - "market_amount": 3976.6659857408 + "amount": 3072.2455057408, + "market_amount": 3072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-30T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-30T00:00:00Z", @@ -702,8 +840,14 @@ "Assets:Checking": { "date": "2022-01-31T00:00:00Z", "account": "Assets:Checking", - "amount": 4976.6659857408, - "market_amount": 4976.6659857408 + "amount": 4072.2455057408, + "market_amount": 4072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-01-31T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-31T00:00:00Z", @@ -728,8 +872,14 @@ "Assets:Checking": { "date": "2022-02-01T00:00:00Z", "account": "Assets:Checking", - "amount": 4976.6659857408, - "market_amount": 4976.6659857408 + "amount": 4072.2455057408, + "market_amount": 4072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-02-01T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-01T00:00:00Z", @@ -754,8 +904,14 @@ "Assets:Checking": { "date": "2022-02-02T00:00:00Z", "account": "Assets:Checking", - "amount": 4976.6659857408, - "market_amount": 4976.6659857408 + "amount": 4072.2455057408, + "market_amount": 4072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-02-02T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-02T00:00:00Z", @@ -780,8 +936,14 @@ "Assets:Checking": { "date": "2022-02-03T00:00:00Z", "account": "Assets:Checking", - "amount": 4976.6659857408, - "market_amount": 4976.6659857408 + "amount": 4072.2455057408, + "market_amount": 4072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-02-03T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-03T00:00:00Z", @@ -806,8 +968,14 @@ "Assets:Checking": { "date": "2022-02-04T00:00:00Z", "account": "Assets:Checking", - "amount": 4976.6659857408, - "market_amount": 4976.6659857408 + "amount": 4072.2455057408, + "market_amount": 4072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-02-04T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-04T00:00:00Z", @@ -832,8 +1000,14 @@ "Assets:Checking": { "date": "2022-02-05T00:00:00Z", "account": "Assets:Checking", - "amount": 4976.6659857408, - "market_amount": 4976.6659857408 + "amount": 4072.2455057408, + "market_amount": 4072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-02-05T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-05T00:00:00Z", @@ -858,8 +1032,14 @@ "Assets:Checking": { "date": "2022-02-06T00:00:00Z", "account": "Assets:Checking", - "amount": 4976.6659857408, - "market_amount": 4976.6659857408 + "amount": 4072.2455057408, + "market_amount": 4072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-02-06T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-06T00:00:00Z", @@ -884,8 +1064,14 @@ "Assets:Checking": { "date": "2022-02-07T00:00:00Z", "account": "Assets:Checking", - "amount": 4976.6659857408, - "market_amount": 4976.6659857408 + "amount": 4072.2455057408, + "market_amount": 4072.2455057408 + }, + "Assets:Dollar": { + "date": "2022-02-07T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-07T00:00:00Z", diff --git a/tests/fixture/inr-hledger/assets_balance.json b/tests/fixture/inr-hledger/assets_balance.json index f26a0d38..c55baa7b 100644 --- a/tests/fixture/inr-hledger/assets_balance.json +++ b/tests/fixture/inr-hledger/assets_balance.json @@ -2,24 +2,35 @@ "asset_breakdowns": { "Assets": { "group": "Assets", - "investmentAmount": 106050.6340142592, + "investmentAmount": 106855.0544942592, "withdrawalAmount": 10027.3, - "marketAmount": 101245.7, + "marketAmount": 101145.7, "balanceUnits": 0, "latestPrice": 0, - "xirr": 12.84, - "gainAmount": 5222.3659857408, - "absoluteReturn": 0.0492440807571091 + "xirr": 12.85, + "gainAmount": 4317.9455057408, + "absoluteReturn": 0.0404093706767309 }, "Assets:Checking": { "group": "Assets:Checking", "investmentAmount": 0, "withdrawalAmount": 0, - "marketAmount": 4976.6659857408, + "marketAmount": 4072.2455057408, "balanceUnits": 0, "latestPrice": 0, - "xirr": 62.47, - "gainAmount": 4976.6659857408, + "xirr": 65.38, + "gainAmount": 4072.2455057408, + "absoluteReturn": 0 + }, + "Assets:Dollar": { + "group": "Assets:Dollar", + "investmentAmount": 804.42048, + "withdrawalAmount": 0, + "marketAmount": 804.42048, + "balanceUnits": 10, + "latestPrice": 0, + "xirr": 0, + "gainAmount": 0, "absoluteReturn": 0 }, "Assets:Equity": { diff --git a/tests/fixture/inr-hledger/budget.json b/tests/fixture/inr-hledger/budget.json index 2a220ccf..28dee89b 100644 --- a/tests/fixture/inr-hledger/budget.json +++ b/tests/fixture/inr-hledger/budget.json @@ -1,5 +1,5 @@ { - "availableForBudgeting": 4976.6659857408, + "availableForBudgeting": 4072.2455057408, "budgetsByMonth": {}, - "checkingBalance": 4976.6659857408 + "checkingBalance": 4072.2455057408 } \ No newline at end of file diff --git a/tests/fixture/inr-hledger/cash_flow.json b/tests/fixture/inr-hledger/cash_flow.json index 7e656de5..2e25d05f 100644 --- a/tests/fixture/inr-hledger/cash_flow.json +++ b/tests/fixture/inr-hledger/cash_flow.json @@ -3,12 +3,12 @@ { "date": "2022-01-01T00:00:00Z", "income": 121027.3, - "expenses": 20000, + "expenses": 20100, "liabilities": 0, - "investment": 96050.6340142592, + "investment": 96855.0544942592, "tax": 0, - "checking": 4976.6659857408, - "balance": 4976.6659857408 + "checking": 4072.2455057408, + "balance": 4072.2455057408 }, { "date": "2022-02-01T00:00:00Z", @@ -18,7 +18,7 @@ "investment": 0, "tax": 0, "checking": 0, - "balance": 4976.6659857408 + "balance": 4072.2455057408 } ] } \ No newline at end of file diff --git a/tests/fixture/inr-hledger/config.json b/tests/fixture/inr-hledger/config.json index e88c0e91..e1d89749 100644 --- a/tests/fixture/inr-hledger/config.json +++ b/tests/fixture/inr-hledger/config.json @@ -7,6 +7,8 @@ "Assets:Equity:ABNB", "Assets:Equity:AAPL", "Income:CapitalGains:Equity:AAPL", + "Expenses:Charges", + "Assets:Dollar", "Income:Interest:Checking" ], "config": { diff --git a/tests/fixture/inr-hledger/dashboard.json b/tests/fixture/inr-hledger/dashboard.json index 7a78722a..ac782d65 100644 --- a/tests/fixture/inr-hledger/dashboard.json +++ b/tests/fixture/inr-hledger/dashboard.json @@ -1,19 +1,19 @@ { "budget": { - "availableForBudgeting": 4976.6659857408, + "availableForBudgeting": 4072.2455057408, "budgetsByMonth": {}, - "checkingBalance": 4976.6659857408 + "checkingBalance": 4072.2455057408 }, "cashFlows": [ { "date": "2022-01-01T00:00:00Z", "income": 121027.3, - "expenses": 20000, + "expenses": 20100, "liabilities": 0, - "investment": 96050.6340142592, + "investment": 96855.0544942592, "tax": 0, - "checking": 4976.6659857408, - "balance": 4976.6659857408 + "checking": 4072.2455057408, + "balance": 4072.2455057408 }, { "date": "2022-02-01T00:00:00Z", @@ -23,7 +23,7 @@ "investment": 0, "tax": 0, "checking": 0, - "balance": 4976.6659857408 + "balance": 4072.2455057408 } ], "checkingBalances": { @@ -51,6 +51,27 @@ "transaction_note": "", "market_amount": 0, "balance": 0 + }, + { + "id": 22, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 } ] }, @@ -58,25 +79,25 @@ "networth": { "networth": { "date": "2022-02-07T23:59:59.999999999Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 1245.7, - "balanceAmount": 101245.7, + "balanceAmount": 101145.7, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, - "xirr": 12.84 + "xirr": 12.85 }, "transactionSequences": [], "transactions": [ { - "id": "11", + "id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "postings": [ { - "id": 23, - "transaction_id": "11", + "id": 27, + "transaction_id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Assets:Checking", @@ -86,8 +107,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 49, - "transaction_end_line": 54, + "transaction_begin_line": 54, + "transaction_end_line": 59, "file_name": "main.ledger", "forecast": false, "note": "", @@ -96,8 +117,8 @@ "balance": 0 }, { - "id": 22, - "transaction_id": "11", + "id": 26, + "transaction_id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -107,8 +128,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 49, - "transaction_end_line": 54, + "transaction_begin_line": 54, + "transaction_end_line": 59, "file_name": "main.ledger", "forecast": false, "note": "Posting note\n", @@ -119,8 +140,8 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 49, - "endLine": 54, + "beginLine": 54, + "endLine": 59, "fileName": "main.ledger", "note": "\nGlobal note\n:interest:\n" }, @@ -179,6 +200,103 @@ "fileName": "main.ledger", "note": "" }, + { + "id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "postings": [ + { + "id": 23, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 22, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 25, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "USD", + "quantity": -10, + "amount": -804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 24, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "INR", + "quantity": -100, + "amount": -100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + } + ], + "tag_recurring": "", + "tag_period": "", + "beginLine": 47, + "endLine": 51, + "fileName": "main.ledger", + "note": "" + }, { "id": "10", "date": "2022-01-09T00:00:00Z", diff --git a/tests/fixture/inr-hledger/expense.json b/tests/fixture/inr-hledger/expense.json index 3df90bb3..5115d8a2 100644 --- a/tests/fixture/inr-hledger/expense.json +++ b/tests/fixture/inr-hledger/expense.json @@ -20,6 +20,27 @@ "transaction_note": "", "market_amount": 0, "balance": 0 + }, + { + "id": 22, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 } ], "graph": { @@ -29,6 +50,10 @@ "id": 1, "name": "Assets:Checking" }, + { + "id": 10, + "name": "Assets:Dollar" + }, { "id": 9, "name": "Assets:Equity:AAPL" @@ -45,6 +70,10 @@ "id": 5, "name": "Expenses" }, + { + "id": 11, + "name": "Expenses:Charges" + }, { "id": 6, "name": "Expenses:Rent" @@ -54,23 +83,23 @@ "name": "Income" }, { - "id": 10, + "id": 12, "name": "Income:CapitalGains" }, { - "id": 11, + "id": 13, "name": "Income:CapitalGains:Equity" }, { - "id": 12, + "id": 14, "name": "Income:CapitalGains:Equity:AAPL" }, { - "id": 13, + "id": 15, "name": "Income:Interest" }, { - "id": 14, + "id": 16, "name": "Income:Interest:Checking" }, { @@ -86,7 +115,7 @@ { "source": 1, "target": 5, - "value": 20000 + "value": 20100 }, { "source": 1, @@ -103,6 +132,11 @@ "target": 9, "value": 10000 }, + { + "source": 1, + "target": 10, + "value": 804.42048 + }, { "source": 2, "target": 1, @@ -123,34 +157,39 @@ "target": 6, "value": 20000 }, + { + "source": 5, + "target": 11, + "value": 100 + }, { "source": 9, "target": 1, "value": 10000 }, { - "source": 10, + "source": 12, "target": 2, "value": 27.3 }, { - "source": 11, - "target": 10, + "source": 13, + "target": 12, "value": 27.3 }, { - "source": 12, - "target": 11, + "source": 14, + "target": 13, "value": 27.3 }, { - "source": 13, + "source": 15, "target": 2, "value": 1000 }, { - "source": 14, - "target": 13, + "source": 16, + "target": 15, "value": 1000 } ] @@ -179,6 +218,27 @@ "transaction_note": "", "market_amount": 0, "balance": 0 + }, + { + "id": 22, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 } ] }, @@ -248,8 +308,8 @@ "balance": 0 }, { - "id": 22, - "transaction_id": "11", + "id": 26, + "transaction_id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -259,8 +319,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 49, - "transaction_end_line": 54, + "transaction_begin_line": 54, + "transaction_end_line": 59, "file_name": "main.ledger", "forecast": false, "note": "Posting note\n", @@ -377,6 +437,27 @@ "market_amount": 0, "balance": 0 }, + { + "id": 23, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, { "id": 17, "transaction_id": "8", @@ -446,6 +527,27 @@ "transaction_note": "", "market_amount": 0, "balance": 0 + }, + { + "id": 22, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 } ] }, @@ -515,8 +617,8 @@ "balance": 0 }, { - "id": 22, - "transaction_id": "11", + "id": 26, + "transaction_id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -526,8 +628,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 49, - "transaction_end_line": 54, + "transaction_begin_line": 54, + "transaction_end_line": 59, "file_name": "main.ledger", "forecast": false, "note": "Posting note\n", @@ -644,6 +746,27 @@ "market_amount": 0, "balance": 0 }, + { + "id": 23, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, { "id": 17, "transaction_id": "8", diff --git a/tests/fixture/inr-hledger/files.json b/tests/fixture/inr-hledger/files.json index 7a0d7cc3..4f215351 100644 --- a/tests/fixture/inr-hledger/files.json +++ b/tests/fixture/inr-hledger/files.json @@ -7,6 +7,8 @@ "Assets:Equity:ABNB", "Assets:Equity:AAPL", "Income:CapitalGains:Equity:AAPL", + "Expenses:Charges", + "Assets:Dollar", "Income:Interest:Checking" ], "commodities": [ @@ -19,7 +21,7 @@ "files": [ { "name": "main.ledger", - "content": "commodity INR 9,99,99,999.00\n\nP 2022/01/07 00:00:00 NIFTY 100 INR\nP 2022/02/07 00:00:00 NIFTY 100.273 INR\n\n2022/01/01 Salary\n Income:Salary:Acme -100,000 INR\n Assets:Checking 100,000 INR\n\n2022/01/03 Rent\n Assets:Checking -20,000 INR\n Expenses:Rent\n\n2022/01/06 Bonus\n Income:Salary:Acme -20,000 INR\n Assets:Checking 20,000 INR\n\n2022/01/07 Investment\n Assets:Checking -40,000 INR\n Assets:Equity:NIFTY 400 NIFTY @ 100 INR\n\n2022/01/08 Investment 2\n Assets:Checking -30,000 INR\n Assets:Equity:NIFTY 300 NIFTY @@ 30,000 INR\n\n2022/01/08 Investment 3\n Assets:Checking -10,000 INR\n Assets:Equity:NIFTY 100 NIFTY\n\n2022/01/08 Buy ABNB\n Assets:Equity:ABNB 0.76 ABNB @ 131.27 USD\n Assets:Checking\n\n2022/01/09 Buy ABNB total price\n Assets:Equity:ABNB 0.76 ABNB @@ 99.7652 USD\n Assets:Checking\n\n2022/01/08 Buy Apple\n Assets:Equity:AAPL 100 AAPL @ 100 INR\n Assets:Checking\n\n2022/01/09 Sell\n Assets:Equity:AAPL -100 AAPL @ 100 INR\n Income:CapitalGains:Equity:AAPL -27.3 INR\n Assets:Checking 10027.3 INR\n\nP 2022/01/08 00:00:00 USD 80.442048 INR\n\n2022/01/31 Interest\n ; Global note\n ; :interest:\n Income:Interest:Checking -1,000 INR ; Posting note\n Assets:Checking\n\n2022/01/31 * Asset balance\n Assets:Equity:NIFTY =800 NIFTY\n", + "content": "commodity INR 9,99,99,999.00\n\nP 2022/01/07 00:00:00 NIFTY 100 INR\nP 2022/02/07 00:00:00 NIFTY 100.273 INR\n\n2022/01/01 Salary\n Income:Salary:Acme -100,000 INR\n Assets:Checking 100,000 INR\n\n2022/01/03 Rent\n Assets:Checking -20,000 INR\n Expenses:Rent\n\n2022/01/06 Bonus\n Income:Salary:Acme -20,000 INR\n Assets:Checking 20,000 INR\n\n2022/01/07 Investment\n Assets:Checking -40,000 INR\n Assets:Equity:NIFTY 400 NIFTY @ 100 INR\n\n2022/01/08 Investment 2\n Assets:Checking -30,000 INR\n Assets:Equity:NIFTY 300 NIFTY @@ 30,000 INR\n\n2022/01/08 Investment 3\n Assets:Checking -10,000 INR\n Assets:Equity:NIFTY 100 NIFTY\n\n2022/01/08 Buy ABNB\n Assets:Equity:ABNB 0.76 ABNB @ 131.27 USD\n Assets:Checking\n\n2022/01/09 Buy ABNB total price\n Assets:Equity:ABNB 0.76 ABNB @@ 99.7652 USD\n Assets:Checking\n\n2022/01/08 Buy Apple\n Assets:Equity:AAPL 100 AAPL @ 100 INR\n Assets:Checking\n\n2022/01/09 Sell\n Assets:Equity:AAPL -100 AAPL @ 100 INR\n Income:CapitalGains:Equity:AAPL -27.3 INR\n Assets:Checking 10027.3 INR\n\n2022/01/09 Multi Currency Debit\n Expenses:Charges 100 INR\n Assets:Dollar 10 USD\n Assets:Checking\n\nP 2022/01/08 00:00:00 USD 80.442048 INR\n\n2022/01/31 Interest\n ; Global note\n ; :interest:\n Income:Interest:Checking -1,000 INR ; Posting note\n Assets:Checking\n\n2022/01/31 * Asset balance\n Assets:Equity:NIFTY =800 NIFTY\n", "versions": [], "operation": "" } @@ -35,6 +37,7 @@ "Buy Apple", "Buy ABNB total price", "Sell", + "Multi Currency Debit", "Interest" ] } \ No newline at end of file diff --git a/tests/fixture/inr-hledger/gain.json b/tests/fixture/inr-hledger/gain.json index 3b8c29fd..137cc643 100644 --- a/tests/fixture/inr-hledger/gain.json +++ b/tests/fixture/inr-hledger/gain.json @@ -1,5 +1,41 @@ { "gain_breakdown": [ + { + "account": "Assets:Dollar", + "networth": { + "date": "2022-02-07T23:59:59.999999999Z", + "investmentAmount": 804.42048, + "withdrawalAmount": 0, + "gainAmount": 0, + "balanceAmount": 804.42048, + "balanceUnits": 0, + "netInvestmentAmount": 804.42048 + }, + "xirr": 0, + "postings": [ + { + "id": 23, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 804.42048, + "balance": 0 + } + ] + }, { "account": "Assets:Equity:AAPL", "networth": { diff --git a/tests/fixture/inr-hledger/income.json b/tests/fixture/inr-hledger/income.json index 826bcdf6..cb36f25f 100644 --- a/tests/fixture/inr-hledger/income.json +++ b/tests/fixture/inr-hledger/income.json @@ -67,8 +67,8 @@ "balance": 0 }, { - "id": 22, - "transaction_id": "11", + "id": 26, + "transaction_id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -78,8 +78,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 49, - "transaction_end_line": 54, + "transaction_begin_line": 54, + "transaction_end_line": 59, "file_name": "main.ledger", "forecast": false, "note": "Posting note\n", @@ -164,8 +164,8 @@ "balance": 0 }, { - "id": 22, - "transaction_id": "11", + "id": 26, + "transaction_id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -175,8 +175,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 49, - "transaction_end_line": 54, + "transaction_begin_line": 54, + "transaction_end_line": 59, "file_name": "main.ledger", "forecast": false, "note": "Posting note\n", diff --git a/tests/fixture/inr-hledger/income_statement.json b/tests/fixture/inr-hledger/income_statement.json index f9d3145c..a3bd10ae 100644 --- a/tests/fixture/inr-hledger/income_statement.json +++ b/tests/fixture/inr-hledger/income_statement.json @@ -2,7 +2,7 @@ "yearly": { "2021 - 22": { "startingBalance": 0, - "endingBalance": 85196.5859857408, + "endingBalance": 85096.5859857408, "date": "2021-04-01T00:00:00Z", "income": { "Income:Salary:Acme": -120000 @@ -19,6 +19,7 @@ "liabilities": {}, "tax": {}, "expenses": { + "Expenses:Charges": 100, "Expenses:Rent": 20000 } } diff --git a/tests/fixture/inr-hledger/investment.json b/tests/fixture/inr-hledger/investment.json index 9b3b881d..9b00c621 100644 --- a/tests/fixture/inr-hledger/investment.json +++ b/tests/fixture/inr-hledger/investment.json @@ -105,6 +105,27 @@ "market_amount": 0, "balance": 0 }, + { + "id": 23, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, { "id": 17, "transaction_id": "8", @@ -258,6 +279,27 @@ "market_amount": 0, "balance": 0 }, + { + "id": 23, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, { "id": 17, "transaction_id": "8", @@ -305,9 +347,9 @@ "gross_other_income": 1027.3, "net_tax": 0, "net_income": 121027.3, - "net_investment": 96050.6340142592, - "net_expense": 20000, - "savings_rate": 79.36278344989866 + "net_investment": 96855.0544942592, + "net_expense": 20100, + "savings_rate": 80.02744380338915 } ] } \ No newline at end of file diff --git a/tests/fixture/inr-hledger/ledger.json b/tests/fixture/inr-hledger/ledger.json index 16adc9ea..ef8fdfc6 100644 --- a/tests/fixture/inr-hledger/ledger.json +++ b/tests/fixture/inr-hledger/ledger.json @@ -1,8 +1,8 @@ { "postings": [ { - "id": 22, - "transaction_id": "11", + "id": 26, + "transaction_id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -12,8 +12,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 49, - "transaction_end_line": 54, + "transaction_begin_line": 54, + "transaction_end_line": 59, "file_name": "main.ledger", "forecast": false, "note": "Posting note\n", @@ -22,8 +22,8 @@ "balance": -1000 }, { - "id": 23, - "transaction_id": "11", + "id": 27, + "transaction_id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Assets:Checking", @@ -33,35 +33,56 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 49, - "transaction_end_line": 54, + "transaction_begin_line": 54, + "transaction_end_line": 59, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "\nGlobal note\n:interest:\n", "market_amount": 1000, - "balance": 20827.7696 + "balance": 20717.7696 }, { - "id": 19, - "transaction_id": "10", + "id": 24, + "transaction_id": "11", "date": "2022-01-09T00:00:00Z", - "payee": "Sell", - "account": "Assets:Equity:AAPL", - "commodity": "AAPL", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "INR", "quantity": -100, - "amount": -10000, + "amount": -100, "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 42, - "transaction_end_line": 46, + "transaction_begin_line": 47, + "transaction_end_line": 51, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -10000, - "balance": 0 + "market_amount": -100, + "balance": 9800.2348 + }, + { + "id": 23, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 804.42048, + "balance": 10 }, { "id": 17, @@ -103,7 +124,49 @@ "note": "", "transaction_note": "", "market_amount": 10027.3, - "balance": 19827.7696 + "balance": 19717.7696 + }, + { + "id": 22, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 100, + "balance": 100 + }, + { + "id": 25, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "USD", + "quantity": -10, + "amount": -804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": -804.42048, + "balance": 9690.4696 }, { "id": 18, @@ -124,7 +187,7 @@ "note": "", "transaction_note": "", "market_amount": -8025.3170071296, - "balance": 9800.4696 + "balance": 9700.4696 }, { "id": 20, @@ -148,31 +211,52 @@ "balance": -27.3 }, { - "id": 12, - "transaction_id": "6", + "id": 19, + "transaction_id": "10", + "date": "2022-01-09T00:00:00Z", + "payee": "Sell", + "account": "Assets:Equity:AAPL", + "commodity": "AAPL", + "quantity": -100, + "amount": -10000, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 42, + "transaction_end_line": 46, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": -10000, + "balance": 0 + }, + { + "id": 10, + "transaction_id": "5", "date": "2022-01-08T00:00:00Z", - "payee": "Investment 3", + "payee": "Investment 2", "account": "Assets:Equity:NIFTY", "commodity": "NIFTY", - "quantity": 100, - "amount": 10000, + "quantity": 300, + "amount": 30000, "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 26, - "transaction_end_line": 29, + "transaction_begin_line": 22, + "transaction_end_line": 25, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "", - "market_amount": 10027.3, - "balance": 800 + "market_amount": 30081.9, + "balance": 700 }, { - "id": 16, - "transaction_id": "9", + "id": 11, + "transaction_id": "6", "date": "2022-01-08T00:00:00Z", - "payee": "Buy Apple", + "payee": "Investment 3", "account": "Assets:Checking", "commodity": "INR", "quantity": -10000, @@ -180,56 +264,56 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 38, - "transaction_end_line": 41, + "transaction_begin_line": 26, + "transaction_end_line": 29, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "", "market_amount": -10000, - "balance": 9900.2348 + "balance": 40000 }, { - "id": 10, - "transaction_id": "5", + "id": 12, + "transaction_id": "6", "date": "2022-01-08T00:00:00Z", - "payee": "Investment 2", + "payee": "Investment 3", "account": "Assets:Equity:NIFTY", "commodity": "NIFTY", - "quantity": 300, - "amount": 30000, + "quantity": 100, + "amount": 10000, "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 22, - "transaction_end_line": 25, + "transaction_begin_line": 26, + "transaction_end_line": 29, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "", - "market_amount": 30081.9, - "balance": 700 + "market_amount": 10027.3, + "balance": 800 }, { - "id": 13, - "transaction_id": "7", + "id": 15, + "transaction_id": "9", "date": "2022-01-08T00:00:00Z", - "payee": "Buy ABNB", - "account": "Assets:Equity:ABNB", - "commodity": "ABNB", - "quantity": 0.76, - "amount": 8025.3170071296, + "payee": "Buy Apple", + "account": "Assets:Equity:AAPL", + "commodity": "AAPL", + "quantity": 100, + "amount": 10000, "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 30, - "transaction_end_line": 33, + "transaction_begin_line": 38, + "transaction_end_line": 41, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "", - "market_amount": 8025.3170071296, - "balance": 0.76 + "market_amount": 10000, + "balance": 100 }, { "id": 14, @@ -250,59 +334,59 @@ "note": "", "transaction_note": "", "market_amount": -8025.3170071296, - "balance": 59900.2348 + "balance": 9900.2348 }, { - "id": 9, - "transaction_id": "5", + "id": 13, + "transaction_id": "7", "date": "2022-01-08T00:00:00Z", - "payee": "Investment 2", - "account": "Assets:Checking", - "commodity": "INR", - "quantity": -30000, - "amount": -30000, + "payee": "Buy ABNB", + "account": "Assets:Equity:ABNB", + "commodity": "ABNB", + "quantity": 0.76, + "amount": 8025.3170071296, "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 22, - "transaction_end_line": 25, + "transaction_begin_line": 30, + "transaction_end_line": 33, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -30000, - "balance": 29900.2348 + "market_amount": 8025.3170071296, + "balance": 0.76 }, { - "id": 11, - "transaction_id": "6", + "id": 9, + "transaction_id": "5", "date": "2022-01-08T00:00:00Z", - "payee": "Investment 3", + "payee": "Investment 2", "account": "Assets:Checking", "commodity": "INR", - "quantity": -10000, - "amount": -10000, + "quantity": -30000, + "amount": -30000, "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 26, - "transaction_end_line": 29, + "transaction_begin_line": 22, + "transaction_end_line": 25, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -10000, - "balance": 19900.2348 + "market_amount": -30000, + "balance": 10000 }, { - "id": 15, + "id": 16, "transaction_id": "9", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", - "account": "Assets:Equity:AAPL", - "commodity": "AAPL", - "quantity": 100, - "amount": 10000, + "account": "Assets:Checking", + "commodity": "INR", + "quantity": -10000, + "amount": -10000, "status": "unmarked", "tag_recurring": "", "tag_period": "", @@ -312,8 +396,8 @@ "forecast": false, "note": "", "transaction_note": "", - "market_amount": 10000, - "balance": 100 + "market_amount": -10000, + "balance": 50000 }, { "id": 7, diff --git a/tests/fixture/inr-hledger/networth.json b/tests/fixture/inr-hledger/networth.json index 25bb5d83..dbb1b6b8 100644 --- a/tests/fixture/inr-hledger/networth.json +++ b/tests/fixture/inr-hledger/networth.json @@ -74,274 +74,274 @@ }, { "date": "2022-01-09T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-10T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-11T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-12T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-13T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-14T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-15T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-16T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-17T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-18T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-19T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-20T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-21T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-22T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-23T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-24T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-25T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-26T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-27T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-28T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-29T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-30T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-31T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-01T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-02T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-03T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-04T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-05T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-06T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-07T00:00:00Z", - "investmentAmount": 236077.9340142592, - "withdrawalAmount": 136077.9340142592, + "investmentAmount": 236882.3544942592, + "withdrawalAmount": 136982.3544942592, "gainAmount": 1245.7, - "balanceAmount": 101245.7, + "balanceAmount": 101145.7, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 } ], - "xirr": 12.84 + "xirr": 12.85 } \ No newline at end of file diff --git a/tests/fixture/inr-hledger/transaction.json b/tests/fixture/inr-hledger/transaction.json index a14df2bd..0add1193 100644 --- a/tests/fixture/inr-hledger/transaction.json +++ b/tests/fixture/inr-hledger/transaction.json @@ -1,13 +1,13 @@ { "transactions": [ { - "id": "11", + "id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "postings": [ { - "id": 23, - "transaction_id": "11", + "id": 27, + "transaction_id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Assets:Checking", @@ -17,8 +17,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 49, - "transaction_end_line": 54, + "transaction_begin_line": 54, + "transaction_end_line": 59, "file_name": "main.ledger", "forecast": false, "note": "", @@ -27,8 +27,8 @@ "balance": 0 }, { - "id": 22, - "transaction_id": "11", + "id": 26, + "transaction_id": "12", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -38,8 +38,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 49, - "transaction_end_line": 54, + "transaction_begin_line": 54, + "transaction_end_line": 59, "file_name": "main.ledger", "forecast": false, "note": "Posting note\n", @@ -50,8 +50,8 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 49, - "endLine": 54, + "beginLine": 54, + "endLine": 59, "fileName": "main.ledger", "note": "\nGlobal note\n:interest:\n" }, @@ -110,6 +110,103 @@ "fileName": "main.ledger", "note": "" }, + { + "id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "postings": [ + { + "id": 23, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 22, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 25, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "USD", + "quantity": -10, + "amount": -804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 24, + "transaction_id": "11", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "INR", + "quantity": -100, + "amount": -100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 47, + "transaction_end_line": 51, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + } + ], + "tag_recurring": "", + "tag_period": "", + "beginLine": 47, + "endLine": 51, + "fileName": "main.ledger", + "note": "" + }, { "id": "10", "date": "2022-01-09T00:00:00Z", diff --git a/tests/fixture/inr/allocation.json b/tests/fixture/inr/allocation.json index 8b610ee6..a6b045fe 100644 --- a/tests/fixture/inr/allocation.json +++ b/tests/fixture/inr/allocation.json @@ -9,8 +9,14 @@ "Assets:Checking": { "date": "2022-02-07T23:59:59.999999999Z", "account": "Assets:Checking", - "amount": 13001.9829928704, - "market_amount": 13001.9829928704 + "amount": 12097.5625128704, + "market_amount": 12097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-02-07T23:59:59.999999999Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity": { "date": "0001-01-01T00:00:00Z", @@ -130,8 +136,14 @@ "Assets:Checking": { "date": "2022-01-09T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-09T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-09T00:00:00Z", @@ -156,8 +168,14 @@ "Assets:Checking": { "date": "2022-01-10T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-10T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-10T00:00:00Z", @@ -182,8 +200,14 @@ "Assets:Checking": { "date": "2022-01-11T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-11T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-11T00:00:00Z", @@ -208,8 +232,14 @@ "Assets:Checking": { "date": "2022-01-12T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-12T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-12T00:00:00Z", @@ -234,8 +264,14 @@ "Assets:Checking": { "date": "2022-01-13T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-13T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-13T00:00:00Z", @@ -260,8 +296,14 @@ "Assets:Checking": { "date": "2022-01-14T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-14T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-14T00:00:00Z", @@ -286,8 +328,14 @@ "Assets:Checking": { "date": "2022-01-15T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-15T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-15T00:00:00Z", @@ -312,8 +360,14 @@ "Assets:Checking": { "date": "2022-01-16T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-16T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-16T00:00:00Z", @@ -338,8 +392,14 @@ "Assets:Checking": { "date": "2022-01-17T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-17T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-17T00:00:00Z", @@ -364,8 +424,14 @@ "Assets:Checking": { "date": "2022-01-18T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-18T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-18T00:00:00Z", @@ -390,8 +456,14 @@ "Assets:Checking": { "date": "2022-01-19T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-19T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-19T00:00:00Z", @@ -416,8 +488,14 @@ "Assets:Checking": { "date": "2022-01-20T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-20T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-20T00:00:00Z", @@ -442,8 +520,14 @@ "Assets:Checking": { "date": "2022-01-21T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-21T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-21T00:00:00Z", @@ -468,8 +552,14 @@ "Assets:Checking": { "date": "2022-01-22T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-22T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-22T00:00:00Z", @@ -494,8 +584,14 @@ "Assets:Checking": { "date": "2022-01-23T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-23T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-23T00:00:00Z", @@ -520,8 +616,14 @@ "Assets:Checking": { "date": "2022-01-24T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-24T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-24T00:00:00Z", @@ -546,8 +648,14 @@ "Assets:Checking": { "date": "2022-01-25T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-25T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-25T00:00:00Z", @@ -572,8 +680,14 @@ "Assets:Checking": { "date": "2022-01-26T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-26T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-26T00:00:00Z", @@ -598,8 +712,14 @@ "Assets:Checking": { "date": "2022-01-27T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-27T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-27T00:00:00Z", @@ -624,8 +744,14 @@ "Assets:Checking": { "date": "2022-01-28T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-28T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-28T00:00:00Z", @@ -650,8 +776,14 @@ "Assets:Checking": { "date": "2022-01-29T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-29T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-29T00:00:00Z", @@ -676,8 +808,14 @@ "Assets:Checking": { "date": "2022-01-30T00:00:00Z", "account": "Assets:Checking", - "amount": 12001.9829928704, - "market_amount": 12001.9829928704 + "amount": 11097.5625128704, + "market_amount": 11097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-30T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-30T00:00:00Z", @@ -702,8 +840,14 @@ "Assets:Checking": { "date": "2022-01-31T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.9829928704, - "market_amount": 13001.9829928704 + "amount": 12097.5625128704, + "market_amount": 12097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-01-31T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-01-31T00:00:00Z", @@ -728,8 +872,14 @@ "Assets:Checking": { "date": "2022-02-01T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.9829928704, - "market_amount": 13001.9829928704 + "amount": 12097.5625128704, + "market_amount": 12097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-02-01T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-01T00:00:00Z", @@ -754,8 +904,14 @@ "Assets:Checking": { "date": "2022-02-02T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.9829928704, - "market_amount": 13001.9829928704 + "amount": 12097.5625128704, + "market_amount": 12097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-02-02T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-02T00:00:00Z", @@ -780,8 +936,14 @@ "Assets:Checking": { "date": "2022-02-03T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.9829928704, - "market_amount": 13001.9829928704 + "amount": 12097.5625128704, + "market_amount": 12097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-02-03T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-03T00:00:00Z", @@ -806,8 +968,14 @@ "Assets:Checking": { "date": "2022-02-04T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.9829928704, - "market_amount": 13001.9829928704 + "amount": 12097.5625128704, + "market_amount": 12097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-02-04T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-04T00:00:00Z", @@ -832,8 +1000,14 @@ "Assets:Checking": { "date": "2022-02-05T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.9829928704, - "market_amount": 13001.9829928704 + "amount": 12097.5625128704, + "market_amount": 12097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-02-05T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-05T00:00:00Z", @@ -858,8 +1032,14 @@ "Assets:Checking": { "date": "2022-02-06T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.9829928704, - "market_amount": 13001.9829928704 + "amount": 12097.5625128704, + "market_amount": 12097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-02-06T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-06T00:00:00Z", @@ -884,8 +1064,14 @@ "Assets:Checking": { "date": "2022-02-07T00:00:00Z", "account": "Assets:Checking", - "amount": 13001.9829928704, - "market_amount": 13001.9829928704 + "amount": 12097.5625128704, + "market_amount": 12097.5625128704 + }, + "Assets:Dollar": { + "date": "2022-02-07T00:00:00Z", + "account": "Assets:Dollar", + "amount": 804.42048, + "market_amount": 804.42048 }, "Assets:Equity:AAPL": { "date": "2022-02-07T00:00:00Z", diff --git a/tests/fixture/inr/assets_balance.json b/tests/fixture/inr/assets_balance.json index 4d3b7086..b9dc20fb 100644 --- a/tests/fixture/inr/assets_balance.json +++ b/tests/fixture/inr/assets_balance.json @@ -2,24 +2,35 @@ "asset_breakdowns": { "Assets": { "group": "Assets", - "investmentAmount": 98025.3170071296, + "investmentAmount": 98829.7374871296, "withdrawalAmount": 10027.3, - "marketAmount": 101245.7, + "marketAmount": 101145.7, "balanceUnits": 0, "latestPrice": 0, - "xirr": 12.84, - "gainAmount": 13247.6829928704, - "absoluteReturn": 0.1351455256391251 + "xirr": 12.85, + "gainAmount": 12343.2625128704, + "absoluteReturn": 0.124894215311235 }, "Assets:Checking": { "group": "Assets:Checking", "investmentAmount": 0, "withdrawalAmount": 0, - "marketAmount": 13001.9829928704, + "marketAmount": 12097.5625128704, "balanceUnits": 0, "latestPrice": 0, - "xirr": 46.91, - "gainAmount": 13001.9829928704, + "xirr": 48.56, + "gainAmount": 12097.5625128704, + "absoluteReturn": 0 + }, + "Assets:Dollar": { + "group": "Assets:Dollar", + "investmentAmount": 804.42048, + "withdrawalAmount": 0, + "marketAmount": 804.42048, + "balanceUnits": 10, + "latestPrice": 0, + "xirr": 0, + "gainAmount": 0, "absoluteReturn": 0 }, "Assets:Equity": { diff --git a/tests/fixture/inr/budget.json b/tests/fixture/inr/budget.json index 89c87f2d..dc94ef33 100644 --- a/tests/fixture/inr/budget.json +++ b/tests/fixture/inr/budget.json @@ -1,5 +1,5 @@ { - "availableForBudgeting": 13001.9829928704, + "availableForBudgeting": 12097.5625128704, "budgetsByMonth": {}, - "checkingBalance": 13001.9829928704 + "checkingBalance": 12097.5625128704 } \ No newline at end of file diff --git a/tests/fixture/inr/cash_flow.json b/tests/fixture/inr/cash_flow.json index 17fe557f..4573aaff 100644 --- a/tests/fixture/inr/cash_flow.json +++ b/tests/fixture/inr/cash_flow.json @@ -3,12 +3,12 @@ { "date": "2022-01-01T00:00:00Z", "income": 121027.3, - "expenses": 20000, + "expenses": 20100, "liabilities": 0, - "investment": 88025.3170071296, + "investment": 88829.7374871296, "tax": 0, - "checking": 13001.9829928704, - "balance": 13001.9829928704 + "checking": 12097.5625128704, + "balance": 12097.5625128704 }, { "date": "2022-02-01T00:00:00Z", @@ -18,7 +18,7 @@ "investment": 0, "tax": 0, "checking": 0, - "balance": 13001.9829928704 + "balance": 12097.5625128704 } ] } \ No newline at end of file diff --git a/tests/fixture/inr/config.json b/tests/fixture/inr/config.json index 2e9365fd..fec4dab6 100644 --- a/tests/fixture/inr/config.json +++ b/tests/fixture/inr/config.json @@ -7,6 +7,8 @@ "Assets:Equity:ABNB", "Assets:Equity:AAPL", "Income:CapitalGains:Equity:AAPL", + "Expenses:Charges", + "Assets:Dollar", "Income:Interest:Checking" ], "config": { diff --git a/tests/fixture/inr/dashboard.json b/tests/fixture/inr/dashboard.json index 73a7e6c9..f63b5a1c 100644 --- a/tests/fixture/inr/dashboard.json +++ b/tests/fixture/inr/dashboard.json @@ -1,19 +1,19 @@ { "budget": { - "availableForBudgeting": 13001.9829928704, + "availableForBudgeting": 12097.5625128704, "budgetsByMonth": {}, - "checkingBalance": 13001.9829928704 + "checkingBalance": 12097.5625128704 }, "cashFlows": [ { "date": "2022-01-01T00:00:00Z", "income": 121027.3, - "expenses": 20000, + "expenses": 20100, "liabilities": 0, - "investment": 88025.3170071296, + "investment": 88829.7374871296, "tax": 0, - "checking": 13001.9829928704, - "balance": 13001.9829928704 + "checking": 12097.5625128704, + "balance": 12097.5625128704 }, { "date": "2022-02-01T00:00:00Z", @@ -23,7 +23,7 @@ "investment": 0, "tax": 0, "checking": 0, - "balance": 13001.9829928704 + "balance": 12097.5625128704 } ], "checkingBalances": { @@ -51,6 +51,27 @@ "transaction_note": "", "market_amount": 0, "balance": 0 + }, + { + "id": 16, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 } ] }, @@ -58,25 +79,25 @@ "networth": { "networth": { "date": "2022-02-07T23:59:59.999999999Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 1245.7, - "balanceAmount": 101245.7, + "balanceAmount": 101145.7, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, - "xirr": 12.84 + "xirr": 12.85 }, "transactionSequences": [], "transactions": [ { - "id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "postings": [ { - "id": 17, - "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": 21, + "transaction_id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Assets:Checking", @@ -86,8 +107,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 41, + "transaction_begin_line": 42, + "transaction_end_line": 46, "file_name": "main.ledger", "forecast": false, "note": "", @@ -96,8 +117,8 @@ "balance": 0 }, { - "id": 16, - "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": 20, + "transaction_id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -107,8 +128,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 41, + "transaction_begin_line": 42, + "transaction_end_line": 46, "file_name": "main.ledger", "forecast": false, "note": " Posting note", @@ -119,8 +140,8 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 37, - "endLine": 41, + "beginLine": 42, + "endLine": 46, "fileName": "main.ledger", "note": " Global note\n :interest:" }, @@ -200,6 +221,103 @@ "fileName": "main.ledger", "note": "" }, + { + "id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "postings": [ + { + "id": 17, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 16, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 19, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "USD", + "quantity": -10, + "amount": -804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 18, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "INR", + "quantity": -100, + "amount": -100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + } + ], + "tag_recurring": "", + "tag_period": "", + "beginLine": 35, + "endLine": 38, + "fileName": "main.ledger", + "note": "" + }, { "id": "c4ee69cc-e6bc-56a4-b573-e5519afb2a45", "date": "2022-01-08T00:00:00Z", diff --git a/tests/fixture/inr/expense.json b/tests/fixture/inr/expense.json index 943286c9..2eadf00f 100644 --- a/tests/fixture/inr/expense.json +++ b/tests/fixture/inr/expense.json @@ -20,6 +20,27 @@ "transaction_note": "", "market_amount": 0, "balance": 0 + }, + { + "id": 16, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 } ], "graph": { @@ -29,6 +50,10 @@ "id": 1, "name": "Assets:Checking" }, + { + "id": 10, + "name": "Assets:Dollar" + }, { "id": 9, "name": "Assets:Equity:AAPL" @@ -45,6 +70,10 @@ "id": 5, "name": "Expenses" }, + { + "id": 11, + "name": "Expenses:Charges" + }, { "id": 6, "name": "Expenses:Rent" @@ -54,23 +83,23 @@ "name": "Income" }, { - "id": 10, + "id": 12, "name": "Income:CapitalGains" }, { - "id": 11, + "id": 13, "name": "Income:CapitalGains:Equity" }, { - "id": 12, + "id": 14, "name": "Income:CapitalGains:Equity:AAPL" }, { - "id": 13, + "id": 15, "name": "Income:Interest" }, { - "id": 14, + "id": 16, "name": "Income:Interest:Checking" }, { @@ -86,7 +115,7 @@ { "source": 1, "target": 5, - "value": 20000 + "value": 20100 }, { "source": 1, @@ -103,6 +132,11 @@ "target": 9, "value": 10000 }, + { + "source": 1, + "target": 10, + "value": 804.42048 + }, { "source": 2, "target": 1, @@ -123,34 +157,39 @@ "target": 6, "value": 20000 }, + { + "source": 5, + "target": 11, + "value": 100 + }, { "source": 9, "target": 1, "value": 10000 }, { - "source": 10, + "source": 12, "target": 2, "value": 27.3 }, { - "source": 11, - "target": 10, + "source": 13, + "target": 12, "value": 27.3 }, { - "source": 12, - "target": 11, + "source": 14, + "target": 13, "value": 27.3 }, { - "source": 13, + "source": 15, "target": 2, "value": 1000 }, { - "source": 14, - "target": 13, + "source": 16, + "target": 15, "value": 1000 } ] @@ -179,6 +218,27 @@ "transaction_note": "", "market_amount": 0, "balance": 0 + }, + { + "id": 16, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 } ] }, @@ -248,8 +308,8 @@ "balance": 0 }, { - "id": 16, - "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": 20, + "transaction_id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -259,8 +319,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 41, + "transaction_begin_line": 42, + "transaction_end_line": 46, "file_name": "main.ledger", "forecast": false, "note": " Posting note", @@ -335,6 +395,27 @@ "market_amount": 0, "balance": 0 }, + { + "id": 17, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, { "id": 13, "transaction_id": "b2e50492-9dc7-5845-8ed9-9f4590b301a8", @@ -383,6 +464,27 @@ "transaction_note": "", "market_amount": 0, "balance": 0 + }, + { + "id": 16, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 } ] }, @@ -452,8 +554,8 @@ "balance": 0 }, { - "id": 16, - "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": 20, + "transaction_id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -463,8 +565,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 41, + "transaction_begin_line": 42, + "transaction_end_line": 46, "file_name": "main.ledger", "forecast": false, "note": " Posting note", @@ -539,6 +641,27 @@ "market_amount": 0, "balance": 0 }, + { + "id": 17, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, { "id": 13, "transaction_id": "b2e50492-9dc7-5845-8ed9-9f4590b301a8", diff --git a/tests/fixture/inr/files.json b/tests/fixture/inr/files.json index 490c114e..352f1679 100644 --- a/tests/fixture/inr/files.json +++ b/tests/fixture/inr/files.json @@ -7,6 +7,8 @@ "Assets:Equity:ABNB", "Assets:Equity:AAPL", "Income:CapitalGains:Equity:AAPL", + "Expenses:Charges", + "Assets:Dollar", "Income:Interest:Checking" ], "commodities": [ @@ -19,7 +21,7 @@ "files": [ { "name": "main.ledger", - "content": "commodity INR 9,99,99,999.00\n\nP 2022/01/07 00:00:00 NIFTY 100 INR\nP 2022/02/07 00:00:00 NIFTY 100.273 INR\n\n2022/01/01 Salary\n Income:Salary:Acme -100,000 INR\n Assets:Checking 100,000 INR\n\n2022/01/03 Rent\n Assets:Checking -20,000 INR\n Expenses:Rent\n\n2022/01/06 Bonus\n Income:Salary:Acme -20,000 INR\n Assets:Checking 20,000 INR\n\n2022/01/07 Investment\n Assets:Checking -80,000 INR\n Assets:Equity:NIFTY 800 NIFTY @ 100 INR\n\n2022/01/08 Buy ABNB\n Assets:Equity:ABNB 0.76 ABNB @ 131.27 USD\n Assets:Checking\n\n2022/01/08 Buy Apple\n Assets:Equity:AAPL 100 AAPL @ 100 INR\n Assets:Checking\n\n2022/01/09 Sell\n Assets:Equity:AAPL -100 AAPL {100 INR} @ 100.273 INR\n Income:CapitalGains:Equity:AAPL -27.3 INR\n Assets:Checking 10027.3 INR\n\nP 2022/01/08 00:00:00 USD 80.442048 INR\n\n2022/01/31 Interest\n ; Global note\n ; :interest:\n Income:Interest:Checking -1,000 INR ; Posting note\n Assets:Checking\n\n2022/01/31 * Asset balance\n Assets:Equity:NIFTY =800 NIFTY", + "content": "commodity INR 9,99,99,999.00\n\nP 2022/01/07 00:00:00 NIFTY 100 INR\nP 2022/02/07 00:00:00 NIFTY 100.273 INR\n\n2022/01/01 Salary\n Income:Salary:Acme -100,000 INR\n Assets:Checking 100,000 INR\n\n2022/01/03 Rent\n Assets:Checking -20,000 INR\n Expenses:Rent\n\n2022/01/06 Bonus\n Income:Salary:Acme -20,000 INR\n Assets:Checking 20,000 INR\n\n2022/01/07 Investment\n Assets:Checking -80,000 INR\n Assets:Equity:NIFTY 800 NIFTY @ 100 INR\n\n2022/01/08 Buy ABNB\n Assets:Equity:ABNB 0.76 ABNB @ 131.27 USD\n Assets:Checking\n\n2022/01/08 Buy Apple\n Assets:Equity:AAPL 100 AAPL @ 100 INR\n Assets:Checking\n\n2022/01/09 Sell\n Assets:Equity:AAPL -100 AAPL {100 INR} @ 100.273 INR\n Income:CapitalGains:Equity:AAPL -27.3 INR\n Assets:Checking 10027.3 INR\n\n2022/01/09 Multi Currency Debit\n Expenses:Charges 100 INR\n Assets:Dollar 10 USD\n Assets:Checking\n\nP 2022/01/08 00:00:00 USD 80.442048 INR\n\n2022/01/31 Interest\n ; Global note\n ; :interest:\n Income:Interest:Checking -1,000 INR ; Posting note\n Assets:Checking\n\n2022/01/31 * Asset balance\n Assets:Equity:NIFTY =800 NIFTY\n", "versions": [], "operation": "" } @@ -32,6 +34,7 @@ "Buy ABNB", "Buy Apple", "Sell", + "Multi Currency Debit", "Interest" ] } \ No newline at end of file diff --git a/tests/fixture/inr/gain.json b/tests/fixture/inr/gain.json index 05a42942..0516ee8d 100644 --- a/tests/fixture/inr/gain.json +++ b/tests/fixture/inr/gain.json @@ -1,5 +1,41 @@ { "gain_breakdown": [ + { + "account": "Assets:Dollar", + "networth": { + "date": "2022-02-07T23:59:59.999999999Z", + "investmentAmount": 804.42048, + "withdrawalAmount": 0, + "gainAmount": 0, + "balanceAmount": 804.42048, + "balanceUnits": 0, + "netInvestmentAmount": 804.42048 + }, + "xirr": 0, + "postings": [ + { + "id": 17, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 804.42048, + "balance": 0 + } + ] + }, { "account": "Assets:Equity:AAPL", "networth": { diff --git a/tests/fixture/inr/income.json b/tests/fixture/inr/income.json index 42943873..5c78de33 100644 --- a/tests/fixture/inr/income.json +++ b/tests/fixture/inr/income.json @@ -67,8 +67,8 @@ "balance": 0 }, { - "id": 16, - "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": 20, + "transaction_id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -78,8 +78,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 41, + "transaction_begin_line": 42, + "transaction_end_line": 46, "file_name": "main.ledger", "forecast": false, "note": " Posting note", @@ -164,8 +164,8 @@ "balance": 0 }, { - "id": 16, - "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": 20, + "transaction_id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -175,8 +175,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 41, + "transaction_begin_line": 42, + "transaction_end_line": 46, "file_name": "main.ledger", "forecast": false, "note": " Posting note", diff --git a/tests/fixture/inr/income_statement.json b/tests/fixture/inr/income_statement.json index ccebf810..f5b0946f 100644 --- a/tests/fixture/inr/income_statement.json +++ b/tests/fixture/inr/income_statement.json @@ -2,7 +2,7 @@ "yearly": { "2021 - 22": { "startingBalance": 0, - "endingBalance": 93221.1429928704, + "endingBalance": 93121.1429928704, "date": "2021-04-01T00:00:00Z", "income": { "Income:Salary:Acme": -120000 @@ -19,6 +19,7 @@ "liabilities": {}, "tax": {}, "expenses": { + "Expenses:Charges": 100, "Expenses:Rent": 20000 } } diff --git a/tests/fixture/inr/investment.json b/tests/fixture/inr/investment.json index f1e43518..9a492acd 100644 --- a/tests/fixture/inr/investment.json +++ b/tests/fixture/inr/investment.json @@ -63,6 +63,27 @@ "market_amount": 0, "balance": 0 }, + { + "id": 17, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, { "id": 13, "transaction_id": "b2e50492-9dc7-5845-8ed9-9f4590b301a8", @@ -153,6 +174,27 @@ "market_amount": 0, "balance": 0 }, + { + "id": 17, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, { "id": 13, "transaction_id": "b2e50492-9dc7-5845-8ed9-9f4590b301a8", @@ -179,9 +221,9 @@ "gross_other_income": 1027.3, "net_tax": 0, "net_income": 121027.3, - "net_investment": 88025.3170071296, - "net_expense": 20000, - "savings_rate": 72.73178614009367 + "net_investment": 88829.7374871296, + "net_expense": 20100, + "savings_rate": 73.39644649358416 } ] } \ No newline at end of file diff --git a/tests/fixture/inr/ledger.json b/tests/fixture/inr/ledger.json index 88c0850b..0d643859 100644 --- a/tests/fixture/inr/ledger.json +++ b/tests/fixture/inr/ledger.json @@ -1,8 +1,8 @@ { "postings": [ { - "id": 16, - "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": 20, + "transaction_id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -12,8 +12,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 41, + "transaction_begin_line": 42, + "transaction_end_line": 46, "file_name": "main.ledger", "forecast": false, "note": " Posting note", @@ -22,8 +22,8 @@ "balance": -1000 }, { - "id": 17, - "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": 21, + "transaction_id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Assets:Checking", @@ -33,35 +33,56 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 41, + "transaction_begin_line": 42, + "transaction_end_line": 46, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": " Global note\n :interest:", "market_amount": 1000, - "balance": 20927.5348 + "balance": 20817.5348 }, { - "id": 13, - "transaction_id": "b2e50492-9dc7-5845-8ed9-9f4590b301a8", + "id": 18, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", "date": "2022-01-09T00:00:00Z", - "payee": "Sell", - "account": "Assets:Equity:AAPL", - "commodity": "AAPL", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "INR", "quantity": -100, - "amount": -10000, + "amount": -100, "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 30, - "transaction_end_line": 33, + "transaction_begin_line": 35, + "transaction_end_line": 38, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -10027.3, - "balance": 0 + "market_amount": -100, + "balance": 9800.2348 + }, + { + "id": 17, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 804.42048, + "balance": 10 }, { "id": 15, @@ -82,7 +103,49 @@ "note": "", "transaction_note": "", "market_amount": 10027.3, - "balance": 19927.5348 + "balance": 19817.5348 + }, + { + "id": 16, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 100, + "balance": 100 + }, + { + "id": 19, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "USD", + "quantity": -10, + "amount": -804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": -804.42048, + "balance": 9790.2348 }, { "id": 14, @@ -106,25 +169,25 @@ "balance": -27.3 }, { - "id": 12, - "transaction_id": "608fccf0-e80c-570e-87df-63a9a959c59a", - "date": "2022-01-08T00:00:00Z", - "payee": "Buy Apple", - "account": "Assets:Checking", - "commodity": "INR", - "quantity": -10000, + "id": 13, + "transaction_id": "b2e50492-9dc7-5845-8ed9-9f4590b301a8", + "date": "2022-01-09T00:00:00Z", + "payee": "Sell", + "account": "Assets:Equity:AAPL", + "commodity": "AAPL", + "quantity": -100, "amount": -10000, "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 26, - "transaction_end_line": 28, + "transaction_begin_line": 30, + "transaction_end_line": 33, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "", - "market_amount": -10000, - "balance": 10000 + "market_amount": -10027.3, + "balance": 0 }, { "id": 10, @@ -145,17 +208,17 @@ "note": "", "transaction_note": "", "market_amount": -8025.3170071296, - "balance": 9900.2348 + "balance": 19900.2348 }, { - "id": 11, + "id": 12, "transaction_id": "608fccf0-e80c-570e-87df-63a9a959c59a", "date": "2022-01-08T00:00:00Z", "payee": "Buy Apple", - "account": "Assets:Equity:AAPL", - "commodity": "AAPL", - "quantity": 100, - "amount": 10000, + "account": "Assets:Checking", + "commodity": "INR", + "quantity": -10000, + "amount": -10000, "status": "unmarked", "tag_recurring": "", "tag_period": "", @@ -165,8 +228,8 @@ "forecast": false, "note": "", "transaction_note": "", - "market_amount": 10027.3, - "balance": 100 + "market_amount": -10000, + "balance": 9900.2348 }, { "id": 9, @@ -190,25 +253,25 @@ "balance": 0.76 }, { - "id": 8, - "transaction_id": "928a326f-93b5-5967-96e8-fe18ad9bf45f", - "date": "2022-01-07T00:00:00Z", - "payee": "Investment", - "account": "Assets:Equity:NIFTY", - "commodity": "NIFTY", - "quantity": 800, - "amount": 80000, + "id": 11, + "transaction_id": "608fccf0-e80c-570e-87df-63a9a959c59a", + "date": "2022-01-08T00:00:00Z", + "payee": "Buy Apple", + "account": "Assets:Equity:AAPL", + "commodity": "AAPL", + "quantity": 100, + "amount": 10000, "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 18, - "transaction_end_line": 20, + "transaction_begin_line": 26, + "transaction_end_line": 28, "file_name": "main.ledger", "forecast": false, "note": "", "transaction_note": "", - "market_amount": 80218.4, - "balance": 800 + "market_amount": 10027.3, + "balance": 100 }, { "id": 7, @@ -231,6 +294,27 @@ "market_amount": -80000, "balance": 20000 }, + { + "id": 8, + "transaction_id": "928a326f-93b5-5967-96e8-fe18ad9bf45f", + "date": "2022-01-07T00:00:00Z", + "payee": "Investment", + "account": "Assets:Equity:NIFTY", + "commodity": "NIFTY", + "quantity": 800, + "amount": 80000, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 18, + "transaction_end_line": 20, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 80218.4, + "balance": 800 + }, { "id": 6, "transaction_id": "9ac83c1f-ba46-515b-8e19-3ca8ab332eab", diff --git a/tests/fixture/inr/networth.json b/tests/fixture/inr/networth.json index 12a633bb..0eb69362 100644 --- a/tests/fixture/inr/networth.json +++ b/tests/fixture/inr/networth.json @@ -74,274 +74,274 @@ }, { "date": "2022-01-09T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-10T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-11T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-12T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-13T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-14T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-15T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-16T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-17T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-18T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-19T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-20T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-21T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-22T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-23T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-24T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-25T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-26T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-27T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-28T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-29T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-30T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 27.3, - "balanceAmount": 100027.3, + "balanceAmount": 99927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-01-31T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-01T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-02T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-03T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-04T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-05T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-06T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 1027.3, - "balanceAmount": 101027.3, + "balanceAmount": 100927.3, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 }, { "date": "2022-02-07T00:00:00Z", - "investmentAmount": 228052.6170071296, - "withdrawalAmount": 128052.6170071296, + "investmentAmount": 228857.0374871296, + "withdrawalAmount": 128957.0374871296, "gainAmount": 1245.7, - "balanceAmount": 101245.7, + "balanceAmount": 101145.7, "balanceUnits": 0, - "netInvestmentAmount": 100000 + "netInvestmentAmount": 99900 } ], - "xirr": 12.84 + "xirr": 12.85 } \ No newline at end of file diff --git a/tests/fixture/inr/transaction.json b/tests/fixture/inr/transaction.json index 0cf7103d..bc00fb1e 100644 --- a/tests/fixture/inr/transaction.json +++ b/tests/fixture/inr/transaction.json @@ -1,13 +1,13 @@ { "transactions": [ { - "id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "postings": [ { - "id": 17, - "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": 21, + "transaction_id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Assets:Checking", @@ -17,8 +17,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 41, + "transaction_begin_line": 42, + "transaction_end_line": 46, "file_name": "main.ledger", "forecast": false, "note": "", @@ -27,8 +27,8 @@ "balance": 0 }, { - "id": 16, - "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "id": 20, + "transaction_id": "6c08d472-cc1e-5b12-8838-03a21e3d8964", "date": "2022-01-31T00:00:00Z", "payee": "Interest", "account": "Income:Interest:Checking", @@ -38,8 +38,8 @@ "status": "unmarked", "tag_recurring": "", "tag_period": "", - "transaction_begin_line": 37, - "transaction_end_line": 41, + "transaction_begin_line": 42, + "transaction_end_line": 46, "file_name": "main.ledger", "forecast": false, "note": " Posting note", @@ -50,8 +50,8 @@ ], "tag_recurring": "", "tag_period": "", - "beginLine": 37, - "endLine": 41, + "beginLine": 42, + "endLine": 46, "fileName": "main.ledger", "note": " Global note\n :interest:" }, @@ -131,6 +131,103 @@ "fileName": "main.ledger", "note": "" }, + { + "id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "postings": [ + { + "id": 17, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Dollar", + "commodity": "USD", + "quantity": 10, + "amount": 804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 16, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Expenses:Charges", + "commodity": "INR", + "quantity": 100, + "amount": 100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 19, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "USD", + "quantity": -10, + "amount": -804.42048, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + }, + { + "id": 18, + "transaction_id": "13751d3a-ebfe-5de8-aca5-8870bc86ff9d", + "date": "2022-01-09T00:00:00Z", + "payee": "Multi Currency Debit", + "account": "Assets:Checking", + "commodity": "INR", + "quantity": -100, + "amount": -100, + "status": "unmarked", + "tag_recurring": "", + "tag_period": "", + "transaction_begin_line": 35, + "transaction_end_line": 38, + "file_name": "main.ledger", + "forecast": false, + "note": "", + "transaction_note": "", + "market_amount": 0, + "balance": 0 + } + ], + "tag_recurring": "", + "tag_period": "", + "beginLine": 35, + "endLine": 38, + "fileName": "main.ledger", + "note": "" + }, { "id": "c4ee69cc-e6bc-56a4-b573-e5519afb2a45", "date": "2022-01-08T00:00:00Z",