1
0

WIP
Some checks failed
Run Python tests (through Pytest) / Test (push) Failing after 23s
Verify Python project can be installed, loaded and have version checked / Test (push) Failing after 22s

This commit is contained in:
Jon Michael Aanes 2024-12-23 00:08:24 +01:00
parent 1661ab7dd2
commit f53c24098c
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA
3 changed files with 5 additions and 3 deletions

View File

@ -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()

View File

@ -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)

View File

@ -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,