From 8bd47f31bb497b2f8a39f048d4e8cc8a0123d6f1 Mon Sep 17 00:00:00 2001
From: uvok
Date: Wed, 16 Apr 2025 20:33:35 +0200
Subject: Doubt deposit/withdraw, logging again

---
 bla.py | 40 ++++++++++++++++++++++------------------
 1 file changed, 22 insertions(+), 18 deletions(-)

(limited to 'bla.py')

diff --git a/bla.py b/bla.py
index dc65e55..1ee094e 100644
--- a/bla.py
+++ b/bla.py
@@ -14,7 +14,7 @@ logging.basicConfig(level=logging.INFO)
 
 # Set up a dedicated logger for FIFOQueue
 logger = logging.getLogger(__name__)
-logger.setLevel(logging.INFO)
+logger.setLevel(logging.ERROR)
 
 
 def generate_report(sale_entries, proceeds: float | Decimal, crypto_asset, date_sold):
@@ -106,27 +106,31 @@ def process_ledger(read_actions: List[LedgerAction], output_path: str):
 
         elif action.type == "deposit" and action.asset != "EUR":
             assert len(actions) == 1
-            currency = action.asset
-            fifo_queues.setdefault(currency, FIFOQueue())
-            amount = Decimal(action.amount)
-            price = 0
-            current = fifo_queues[currency]
+            logger.error("Don't know how do handle deposits yet.")
+            # currency = action.asset
+            # fifo_queues.setdefault(currency, FIFOQueue())
+            # amount = Decimal(action.amount)
+            # price = 0
+            # current = fifo_queues[currency]
 
-            # remove transaction fees
-            # (but only if it has a previous withdraw, or rather, if these are coins from a previous purchase...
-            # but I can't check that...)
-            if len(current):
-                current.remove_coins(action.fee)
+            # # remove transaction fees
+            # # (but only if it has a previous withdraw, or rather, if these are coins from a previous purchase...
+            # # but I can't check that...)
+            # if len(current):
+            #     current.remove_coins(action.fee)
 
-            current.add(amount, price, action.date)
+            # current.add(amount, price, action.date)
 
         elif action.type == "withdrawal" and action.asset != "EUR":
             assert len(actions) == 1
-            currency = action.asset
-            fifo_queues.setdefault(currency, FIFOQueue())
-            amount = Decimal(action.amount)
-            price = 0  # Deposits typically have no associated cost basis
-            fifo_queues[currency].add(amount, price, action.date)
+            logger.error("Don't know how do handle withdrawals yet.")
+        #     currency = action.asset
+        #     fifo_queues.setdefault(currency, FIFOQueue())
+        #     amount = Decimal(action.amount)
+        #     price = 0  # Deposits typically have no associated cost basis
+        #     current = fifo_queues[currency]
+
+        #     current.add(amount, price, action.date)
 
     # Write report to CSV
     with open(output_path, "w", newline="") as csvfile:
@@ -148,7 +152,7 @@ def process_ledger(read_actions: List[LedgerAction], output_path: str):
 
 
 # Usage
-ledger_path = "kraken_ledger.csv"  # Replace with your ledger file path
+ledger_path = "ledgers.csv"  # Replace with your ledger file path
 output_path = "tax_report.csv"  # Replace with your desired output file path
 actions = read_ledger(ledger_path)
 process_ledger(actions, output_path)
-- 
cgit v1.2.3