Files
buchhaltung/debug_sonderkredite.py
2026-04-26 07:51:39 +02:00

83 lines
3.3 KiB
Python

import openpyxl
from datetime import datetime
datei = "Kopie von Kostenrechnung der Nächsten jahre (3).xlsx"
wb = openpyxl.load_workbook(datei, data_only=True)
ws = wb["Tilgung bei Gleichbleibenden Be"]
# Prüfe Zeile 2 für Carola, Kerstin, PVCreditplus
print("=== ZEILE 2 (Carola, Kerstin, PVCreditplus) ===")
row2 = list(ws.iter_rows(min_row=2, max_row=2, values_only=True))[0]
for i in range(35, min(len(row2), 50)):
if row2[i]:
print(f" Spalte {i+1}: '{row2[i]}'")
# Prüfe Zeile 3-13 für Carola (Spalte 36)
print("\n=== CAROLA (Spalte 36) - Erste 10 Einträge ===")
for row_idx in range(3, 13):
datum = ws.cell(row=row_idx, column=1).value
carola = ws.cell(row=row_idx, column=36).value
print(f" Zeile {row_idx}: Datum={datum}, Carola={carola}")
# Letzte Einträge Carola
print("\n=== CAROLA (Spalte 36) - Letzte 10 Einträge ===")
for row_idx in range(ws.max_row-10, ws.max_row+1):
datum = ws.cell(row=row_idx, column=1).value
carola = ws.cell(row=row_idx, column=36).value
if carola is not None:
print(f" Zeile {row_idx}: Datum={datum}, Carola={carola}")
# Prüfe Kerstin (Spalte 39)
print("\n=== KERSTIN (Spalte 39) - Erste und letzte Einträge ===")
for row_idx in [3, 4, 5, ws.max_row-5, ws.max_row-4, ws.max_row-3, ws.max_row-2, ws.max_row-1, ws.max_row]:
datum = ws.cell(row=row_idx, column=1).value
kerstin = ws.cell(row=row_idx, column=39).value
print(f" Zeile {row_idx}: Datum={datum}, Kerstin={kerstin}")
# Prüfe PVCreditplus (Spalte 42)
print("\n=== PVCREDITPLUS (Spalte 42) - Erste und letzte Einträge ===")
for row_idx in [3, 4, 5, ws.max_row-5, ws.max_row-4, ws.max_row-3, ws.max_row-2, ws.max_row-1, ws.max_row]:
datum = ws.cell(row=row_idx, column=1).value
pvc = ws.cell(row=row_idx, column=42).value
print(f" Zeile {row_idx}: Datum={datum}, PVCreditplus={pvc}")
# Prüfe Sparkasse - hat "Rate" in Zeile 2, Spalte 21
# Aber wo ist Restschuld? Vielleicht in Spalte 20?
print("\n=== SPARKASSE - Umgebung Spalte 20-23 ===")
for row_idx in [1, 2, 3, 4, 5, 20, 21, 22]:
vals = []
for col in range(19, 24):
val = ws.cell(row=row_idx, column=col).value
vals.append(str(val)[:15] if val else "")
print(f" Zeile {row_idx}: {vals}")
# Aktuelle Werte (2026)
print("\n=== AKTUELLE WERTE (April 2026) ===")
heute = datetime(2026, 4, 1)
for row_idx in range(3, ws.max_row+1):
datum = ws.cell(row=row_idx, column=1).value
if datum and datum.year == 2026 and datum.month == 4:
print(f"Zeile {row_idx} ({datum}):")
# DSL
dsl = ws.cell(row=row_idx, column=9).value
print(f" DSL Bank (9): {dsl}")
# PSD
psd = ws.cell(row=row_idx, column=13).value
print(f" PSD Nord (13): {psd}")
# Zingelstr
zing = ws.cell(row=row_idx, column=20).value
print(f" Zingelstr. 14 (20): {zing}")
# Sparkasse
spark = ws.cell(row=row_idx, column=20).value
print(f" Sparkasse - Spalte 20: {spark}")
# Carola
caro = ws.cell(row=row_idx, column=36).value
print(f" Carola (36): {caro}")
# Kerstin
ker = ws.cell(row=row_idx, column=39).value
print(f" Kerstin (39): {ker}")
# PVCreditplus
pvc = ws.cell(row=row_idx, column=42).value
print(f" PVCreditplus (42): {pvc}")
break