WIP
This commit is contained in:
parent
1661ab7dd2
commit
f53c24098c
|
@ -43,7 +43,7 @@ def compute_tax(transfers: list) -> TaxReport:
|
|||
bought_and_spent_for: list[BoughtAndSold] = []
|
||||
|
||||
prices_bought_for: dict[Asset, deque[BoughtAndNotYetSold]] = {}
|
||||
if False:
|
||||
if True:
|
||||
prices_bought_for[MPC] = deque()
|
||||
prices_bought_for[MPC].append(BoughtAndNotYetSold(AssetAmount(MPC, Decimal(100)), datetime.datetime(2000, 1,1,1,1,1,1)))
|
||||
prices_bought_for[USDT] = deque()
|
||||
|
|
|
@ -32,7 +32,7 @@ def main():
|
|||
logger.setLevel('INFO')
|
||||
|
||||
TRANSFERS = list(KRAKEN_CLIENT._get_double_registers())
|
||||
#TRANSFERS += list(KUCOIN_CLIENT._get_double_registers())
|
||||
TRANSFERS += list(KUCOIN_CLIENT._get_double_registers())
|
||||
tax_report = compute_tax(TRANSFERS)
|
||||
|
||||
logger.info('-'*80)
|
||||
|
|
|
@ -27,6 +27,8 @@ TAX_TYPES: dict[fin_defs.Asset, str] = {
|
|||
NOW = datetime.datetime.now(tz=datetime.UTC)
|
||||
|
||||
def mult_a(a, b):
|
||||
if a == 0 or b == 0:
|
||||
return 0
|
||||
if a is None or b is None:
|
||||
return 'Unknown'
|
||||
return a * b
|
||||
|
@ -38,7 +40,7 @@ def write_current_assets(sheet, tax_report: TaxReport):
|
|||
for asset, positions in tax_report.current_assets.items():
|
||||
total_amount: Decimal = sum((p.amount.amount for p in positions), start=Decimal(0))
|
||||
exchange_rate_asset_to_dkk = tax_report.exchange_rate_at_time(asset, fin_defs.DKK, NOW)
|
||||
assert exchange_rate_asset_to_dkk is not None, asset
|
||||
#assert exchange_rate_asset_to_dkk is not None, asset
|
||||
row = [
|
||||
asset.raw_short_name(),
|
||||
total_amount,
|
||||
|
|
Loading…
Reference in New Issue
Block a user