Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve costs during tax adjustment (#83)
* Preserve costs during tax adjustment Previously, tax adjustment discarded the cost of positions, causing beancount.core.convert.convert_position to miss some conversion paths via the cost currency. This necessitated a fallback to operating currencies for finding viable transitive conversions. With this patch, tax adjustment preserves the cost of positions. Therefore, the cost currency is still available for automatic detection of transitive conversions when computing the asset allocation. One important assumption is that tax adjustment only ever encounters costs after realization, as having a cost spec for the total cost would change the cost per unit. This assumption is checked via assert and has been manually tested without error on the multicurrency example. The patch leaves the fallback logic for conversion via operating currencies in place as an alternative when conversion via cost currency fails. * Fix lint warnings
- Loading branch information