fix: Preisanzeige korrigieren - Cent zu Euro Konvertierung

Problem: Preise wurden in Cent gespeichert aber fälschlicherweise als Euro angezeigt
Lösung: Alle Backend-APIs konvertieren Preise korrekt von Cent zu Euro (/100)

Betroffene Dateien:
- bookings.ts: E-Mail-Templates und Preisberechnungen
- cancellation.ts: Preisberechnungen für Stornierungen
- email-templates.ts: HTML-E-Mail-Templates
- email.ts: ICS-Kalender-Integration
- caldav.ts: CalDAV-Kalender-Export

Jetzt werden Preise konsistent in Euro angezeigt (z.B. 50.00€ statt 5000.00€)
This commit is contained in:
2025-10-09 15:59:00 +02:00
parent a603232ed8
commit 889e110dd9
5 changed files with 28 additions and 28 deletions

View File

@@ -137,7 +137,7 @@ const getBookingByToken = os
// New bookings with treatments array
treatments = booking.treatments;
totalDuration = treatments.reduce((sum, t) => sum + t.duration, 0);
totalPrice = treatments.reduce((sum, t) => sum + t.price, 0);
totalPrice = treatments.reduce((sum, t) => sum + (t.price / 100), 0);
} else if (booking.treatmentId) {
// Old bookings with single treatmentId (backward compatibility)
const treatmentsKV = createKV<any>("treatments");
@@ -151,7 +151,7 @@ const getBookingByToken = os
price: treatment.price,
}];
totalDuration = treatment.duration;
totalPrice = treatment.price;
totalPrice = treatment.price / 100;
} else {
// Fallback if treatment not found
treatments = [];
@@ -333,7 +333,7 @@ export const router = {
// New bookings with treatments array
treatments = booking.treatments;
totalDuration = treatments.reduce((sum, t) => sum + t.duration, 0);
totalPrice = treatments.reduce((sum, t) => sum + t.price, 0);
totalPrice = treatments.reduce((sum, t) => sum + (t.price / 100), 0);
} else if (booking.treatmentId) {
// Old bookings with single treatmentId (backward compatibility)
const treatmentsKV = createKV<any>("treatments");
@@ -347,7 +347,7 @@ export const router = {
price: treatment.price,
}];
totalDuration = treatment.duration;
totalPrice = treatment.price;
totalPrice = treatment.price / 100;
} else {
// Fallback if treatment not found
treatments = [];