fava icon indicating copy to clipboard operation
fava copied to clipboard

Income statement total and conversion at cost

Open shishkin opened this issue 3 years ago • 3 comments

I'm new to beancount and fava and I'm trying to represent a ledger. Assume someone works in Switzerland but gets paid in Euro and stores Euro in a bank. In the end of the year, that person needs to file tax statement with total income in Swiss Francs where each conversion is done at transaction date rate. I understand that I need to use position cost ({}) but I don't understand how to do it with both accounts in Euro.

Here is the ledger:

2000-01-01 open Assets:TestAccount EUR
2000-01-01 open Income:TestSource EUR

2000-01-01 price EUR      1.50 CHF

2000-01-01 * ""
  Income:TestSource   -1000.00 EUR
  Assets:TestAccount

2000-02-01 price EUR      1.25 CHF

2000-02-01 * ""
  Income:TestSource   -1000.00 EUR
  Assets:TestAccount

2000-03-01 price EUR      1.10 CHF

2000-03-01 * ""
  Income:TestSource      -1000 EUR
  Assets:TestAccount

Income statement shows total of 2200 CHF when using "convert to CHF" option. All other options show EUR amounts.

Running a query with conversion at date gives me what I need, but I'd like the income statement be more tax-compatible:

select sum(position), sum(convert(position, "CHF")), sum(convert(position, "CHF", date))
where account ~ "Income"
sum_position sum_convert_position_c_ sum_convert_position_c__date
-3000.00 EUR -3300.00 CHF -3850.00 CHF <-- this is what tax authorities consider income statement total

Maybe I'm missing something, but I could not get the cost syntax work when both accounts are EUR.

shishkin avatar Jul 01 '22 15:07 shishkin

So with the cost syntax you can track a position in some (unit) currency A that has a book value in some other (cost) currency B (so for example A could be a stock or ETF and B could be Euro). This implies that the position will balance with another balance in currency B.

Applying this to your situation, you income positions should balance with another position in a EUR account, so the cost currency needs to be EUR. And to attach the static exchange rate to franks, your unit currency should be CHF. That way, when viewing Fava with "at cost", all amounts will be in euros and when viewing with "units", you'll see the tax-relevant CHF amounts. Of course, this has some weird results (like when converting Income to EUR), since all your transactions (and your actual income) are all in EUR but we've now made it look like your income is actually in CHF - but I guess that's also correct in some way, namely the way that the tax authorities look at it.

Applied to your example, this would look like:

2000-01-01 open Assets:TestAccount EUR
2000-01-01 open Income:TestSource

2000-01-01 price EUR      1.50 CHF

2000-01-01 * ""
  Income:TestSource    -1500 CHF {}
  Assets:TestAccount    1000.00 EUR

2000-02-01 price EUR      1.25 CHF

2000-02-01 * ""
  Income:TestSource    -1250.00 CHF {}
  Assets:TestAccount    1000.00 EUR

2000-03-01 price EUR      1.10 CHF

2000-03-01 * ""
  Income:TestSource     -1100.00 CHF {}
  Assets:TestAccount       1000 EUR

yagebu avatar Jul 03 '22 18:07 yagebu

Hi @yagebu, thanks for your reply. Not sure I understood your explanation. In any case your proposal seems confusing.

I'd like the ledger to reflect reality, meaning record both income and assets accounts in EUR as they are. I've noticed that your proposal you had to alleviate EUR constraint on the assets account.

I see tax view of the world as a reporting concern. For that reason I opened the issue in fava and not in the beancount repo.

Also, please note that I was able to get the correct tax numbers with a custom query. So I wonder if you could consider including that query logic to fava's income statement view (maybe as "Converted to CHF as cost"?). Or maybe this could be a config option to change the behavior of "Converted to CHF"?

I'd be happy to contribute but am completely new to beancount and python.

shishkin avatar Jul 04 '22 12:07 shishkin

Sorry if it is confusing. From your issue it sounded like you wanted to use the cost syntax, so I tried to show you how you could get the reports you want with it. Maybe reading up on how inventories work in Beancount might help to understand it: https://beancount.github.io/docs/how_inventories_work.html

I'd like the ledger to reflect reality, meaning record both income and assets accounts in EUR as they are.

The Income, when reported at cost, is still in EUR (it's just inferred in the posting). I don't quite understand the opposition to including the CHF amount. In my experience, including fixed conversions has helped me avoid errors.

yagebu avatar Jul 26 '22 15:07 yagebu