changes toi the downgrading
This commit is contained in:
+9
-1
@@ -2313,6 +2313,9 @@ def _get_downgrade_options(instance: dict | None) -> list[dict]:
|
||||
|
||||
|
||||
def _booking_restriction(instance: dict | None, package_list: list[str], booking_action: str) -> str | None:
|
||||
if booking_action == "downgrade" and (not instance or instance.get("is_trial")):
|
||||
return "Eine Herabstufung ist nur für eine bestehende, regulär gebuchte Instanz möglich."
|
||||
|
||||
if not instance or instance.get("is_trial"):
|
||||
return None
|
||||
|
||||
@@ -3059,6 +3062,9 @@ def booking_payment():
|
||||
form_data["existing_subdomain"] = existing_subdomain
|
||||
if not form_data["tenant_slug"] and existing_subdomain:
|
||||
form_data["tenant_slug"] = existing_subdomain
|
||||
if booking_action == "downgrade":
|
||||
form_data["tenant_slug"] = _sanitize_text((owned_instance or {}).get("subdomain") or "", 63)
|
||||
form_data["confirm_subdomain_change"] = True
|
||||
|
||||
if request.method == "GET" and not form_data["contact_person"]:
|
||||
form_data["contact_person"] = session.get("display_name") or session.get("username") or ""
|
||||
@@ -3211,7 +3217,9 @@ def booking_payment():
|
||||
subdomain = effective_subdomain[:63]
|
||||
|
||||
reuse_instance = None
|
||||
if active_trial and active_trial.get("subdomain") == requested_subdomain:
|
||||
if booking_action == "downgrade":
|
||||
reuse_instance = owned_instance
|
||||
elif active_trial and active_trial.get("subdomain") == requested_subdomain:
|
||||
reuse_instance = active_trial
|
||||
elif owned_instance and owned_instance.get("subdomain") == requested_subdomain:
|
||||
reuse_instance = owned_instance
|
||||
|
||||
@@ -80,6 +80,12 @@
|
||||
|
||||
.notice { padding: 1.3rem 1.35rem; border-radius: 20px; background: #ffffff; border: 1px solid #dfe7ea; color: #304f5a; box-shadow: 0 12px 24px rgba(23, 44, 57, 0.04); }
|
||||
.notice strong { color: #15444c; }
|
||||
.booking-guide {
|
||||
margin-bottom: 1.8rem;
|
||||
background: #f7fbfb;
|
||||
border-color: #c7dde3;
|
||||
}
|
||||
.booking-guide p { margin: 0.45rem 0 0; }
|
||||
|
||||
/* Modals */
|
||||
.custom-modal {
|
||||
@@ -158,6 +164,10 @@
|
||||
<strong>Ihre gebuchte Version bleibt bestehen.</strong>
|
||||
<span> Bereits enthalten: {{ paid_instance.package or 'aktueller Paketumfang' }}. Sie können nur zusätzliche Module buchen.</span>
|
||||
</div>
|
||||
<div class="notice booking-guide">
|
||||
<strong>Was Sie jetzt buchen können</strong>
|
||||
<p>Bereits enthaltene Module werden hier nicht erneut angeboten. Die verbleibenden Module können Sie einzeln in den Warenkorb legen. Für mehrere Schulen oder besondere Anforderungen können Sie ein individuelles Angebot anfragen; passende Barcodes führen wir direkt zu unserem Anbieter weiter.</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<section class="packages-grid" aria-label="Buchungspakete">
|
||||
@@ -192,6 +202,7 @@
|
||||
</article>
|
||||
{% endif %}
|
||||
<!-- INVENTARSYSTEM -->
|
||||
{% if 'inventory' not in current_module_keys %}
|
||||
<article class="package-card">
|
||||
<div class="package-card__header">
|
||||
<div>
|
||||
@@ -219,8 +230,10 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% endif %}
|
||||
|
||||
<!-- BIBLIOTHEKSSYSTEM -->
|
||||
{% if 'library' not in current_module_keys %}
|
||||
<article class="package-card">
|
||||
<div class="package-card__header">
|
||||
<div>
|
||||
@@ -247,8 +260,10 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% endif %}
|
||||
|
||||
<!-- TERMINPLANER -->
|
||||
{% if 'terminplan' not in current_module_keys %}
|
||||
<article class="package-card">
|
||||
<div class="package-card__header">
|
||||
<div>
|
||||
@@ -276,6 +291,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% endif %}
|
||||
|
||||
<!-- SCHULTRÄGER -->
|
||||
<article class="package-card">
|
||||
|
||||
Reference in New Issue
Block a user