fix: hinweis-Betrag im Vorschlag deutsch formatiert

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 21:28:15 +02:00
parent bf3f56118e
commit 220d1fc802
2 changed files with 3 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ from decimal import Decimal
from sqlalchemy import select
from sqlalchemy.orm import Session
from app.formats import eur
from app.models.tables import RecurringItem, Transaction
# Betrachtungsfenster (Schritt 1): ~15 Monate. Muss mindestens die zwei
@@ -276,7 +277,7 @@ def suggest_recurring(session: Session, today: date | None = None) -> list[dict]
# negativ: gestiegen heisst betragsmaessig groesser, also
# abs(neu) > abs(alt)), nicht auf das Vorzeichen.
if abs(amount) > abs(previous):
hinweis = f"Betrag zuletzt gestiegen (vorher {abs(previous)})"
hinweis = f"Betrag zuletzt gestiegen (vorher {eur(abs(previous))})"
# Schritt 8: Bestandsabgleich.
if _covered_by_existing(name, amount, s.rhythm, due_day, existing):

View File

@@ -209,7 +209,7 @@ def test_suggest_jahr_mit_zwei_belegen(db):
assert len(out) == 1
assert out[0]["rhythm"] == "yearly" and out[0]["amount"] == Decimal("-467.33")
assert out[0]["start_date"] == date(2026, 6, 16)
assert "409.92" in out[0]["hinweis"] # Betrag zuletzt gestiegen
assert "409,92" in out[0]["hinweis"] # Betrag zuletzt gestiegen (deutsches Format)
def test_suggest_tote_serie_kein_vorschlag(db):