fix(abrechnung): Warnschwelle 0 schaltet die Budget-Warnung aus

Bisher fiel eine 0 durch das or-80-Muster still auf die Voreinstellung
zurück, ein Abschalten der Warnung war unmöglich. Jetzt gilt, 0 = aus,
NULL = Voreinstellung 80, alles andere wie gehabt. Das Verwaltungsportal
bietet die 0 in seinen Formularen an.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Dieser Commit ist enthalten in:
claude-dev
2026-07-25 15:51:45 +00:00
Ursprung d367c60b26
Commit 17b1886f25

Datei anzeigen

@@ -468,7 +468,12 @@ async def _check_budget_warning(
if available <= 0 or lic.get("budget_warning_sent"): if available <= 0 or lic.get("budget_warning_sent"):
return return
threshold = lic.get("budget_warning_percent") or 80 # 0 schaltet die Warnung bewusst aus, NULL faellt auf die Voreinstellung 80.
threshold = lic.get("budget_warning_percent")
if threshold is None:
threshold = 80
if threshold <= 0:
return
percent = (used / available) * 100 percent = (used / available) * 100
if percent < threshold: if percent < threshold:
return return