This project is part for SwiftBeanCount, please check out the main documentation here.
What
This is a library to help you during tax season. Right now it can generate expected tax slips based on your beancount file. This allows you to easily verify your received tax slips to check for errors on either the providers side or your tracking.
Beancount meta data
The library relies on meta data and custom directives in your Beancount file for configuration.
Basic Configuration
You first must configure the names of the slips you want to generate, and set a currency for each one
Afterwards, add meta data to the account in the form of tax slip name: Box name + number
Optionally, you can add a tax slip issuer, e.g. if you receive the same slip from multiple institutions - if no issuer is set, all amounts for the same slip and box will be added together
Some tax slips are split up by individual stock / ETF. To configure this, either the last or second last part of the account name must match a configured commodity or you add tax-symbol meta-data to the account.
Aditionally to the symbol, you can add a description. For a commodity add name or on an account the tax-description meta data.
Example:
2020-01-01 commodity ETFABC
name: "ETF ABC @ Exchange"
2020-01-01 open Income:Dividend:Taxable:ETFABC:ForeignNonBusinessIncome CAD
t3: "Foreign Non-Business Income (Box 25)"
2020-01-01 open Income:Dividend:Taxable:Portfolio:Other CAD
t3: "Other Income (Box 26)"
tax-symbol: "StockTicker"
tax-description: "Stock @ Exchange"
If your account has the name matching to a commodity, but you don’t want to treat it as one, add tax-symbol: "" to it.
Split accounts
Sometimes, if you split up your slip by stock, you don’t want to create a separate account for everything. E.g. you track the dividends via different income accounts, but don’t want to create separate expense accounts per stock for tax paid. To do this:
Configure the tax slip and box via a customs directive instead of account meta data, as shown below
Make sure the transaction with the posting to this account has another posting from an account configured via meta data for the same tax slip
Make sure the other account has a symbol configured
Sometimes income is earned in one year, but only paid in another. You can change the year a transaction should count towards via the tax-year meta data on a transaction, e.g. tax-year: "2022".
If multiple custom directives for the same setting exist, the latest one up until the end of the tax year is used. E.g. when generating tax slips for 2021, the latest directive up until 2021-12-31 is used.
SwiftBeanCountTax
This project is part for SwiftBeanCount, please check out the main documentation here.
What
This is a library to help you during tax season. Right now it can generate expected tax slips based on your beancount file. This allows you to easily verify your received tax slips to check for errors on either the providers side or your tracking.
Beancount meta data
The library relies on meta data and custom directives in your Beancount file for configuration.
Basic Configuration
Example:
Split Slips by Symbol
Some tax slips are split up by individual stock / ETF. To configure this, either the last or second last part of the account name must match a configured commodity or you add
tax-symbol
meta-data to the account.Aditionally to the symbol, you can add a description. For a commodity add
name
or on an account thetax-description
meta data.Example:
If your account has the name matching to a commodity, but you don’t want to treat it as one, add
tax-symbol: ""
to it.Split accounts
Sometimes, if you split up your slip by stock, you don’t want to create a separate account for everything. E.g. you track the dividends via different income accounts, but don’t want to create separate expense accounts per stock for tax paid. To do this:
Example:
Dates
Sometimes income is earned in one year, but only paid in another. You can change the year a transaction should count towards via the
tax-year
meta data on a transaction, e.g.tax-year: "2022"
.If multiple custom directives for the same setting exist, the latest one up until the end of the tax year is used. E.g. when generating tax slips for 2021, the latest directive up until 2021-12-31 is used.
How
TaxCalculator.generateTaxSlips(from ledger: Ledger, for year: Int)
Please also check out the complete documentation here.
Usage
The library supports the Swift Package Manger, so simply add a dependency in your
Package.swift
:Note: as per semantic versioning all versions changes < 1.0.0 can be breaking, so please use
.exact
for now