Abo (A4): Abschnitt "Abo pausieren oder kuendigen" mit Kuendigungs-Hinweis
Eigener Abschnitt auf der Abo-Seite (CRM me/ot und Kundenportal) mit Fortschritt zur Mindestlaufzeit, Pause und Kuendigung. Die Kuendigung laeuft ueber ein Modal, das die Folgen nennt (Abo endet, Konditionen entfallen, ein neues Abo hat wieder 6 Pflichtlieferungen), die Pause als Alternative anbietet und erst nach Bestaetigungs-Checkbox freigibt. Innerhalb der Sperrfrist vor der Ausfuehrung erscheint statt der Buttons ein Hinweis (AboHelper::isPauseCancelLocked). Das Einstellungs-Modal verweist nur noch auf den Abschnitt. Die Kuendigung im Repository ist jetzt wie die Pause eine eigenstaendige Aktion: Erfolgsmeldung statt Liefertermin-Hinweis, next_date bleibt unangetastet. Sprachdateien de/en/es/fr, Tests in AboPauseCancelSectionTest, Plan-Status. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
74aefa9640
commit
e8057f9f7b
12 changed files with 526 additions and 4 deletions
|
|
@ -212,6 +212,25 @@ class AboHelper
|
|||
return $daysUntil >= 0 && $daysUntil < AboRepository::getLockDaysChange();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prüft, ob Pausieren/Kündigen aktuell durch die Sperrfrist vor der
|
||||
* Ausführung blockiert ist (Setting `abo-lock-days-pause-cancel`). Admins
|
||||
* umgehen die Sperre. Spiegelt die serverseitige Prüfung in
|
||||
* {@see AboRepository::updateStatus()} bzw. `pauseOneMonthLocked()` für die
|
||||
* UI, damit der Abschnitt "Abo pausieren oder kündigen" den Hinweis statt
|
||||
* der Buttons zeigt.
|
||||
*/
|
||||
public static function isPauseCancelLocked(UserAbo $userAbo, string $view = 'user'): bool
|
||||
{
|
||||
if ($view === 'admin' || ! $userAbo->next_date) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$daysUntil = (int) Carbon::now()->diffInDays(Carbon::parse($userAbo->next_date), false);
|
||||
|
||||
return $daysUntil >= 0 && $daysUntil < AboRepository::getLockDaysPauseCancel();
|
||||
}
|
||||
|
||||
public static function canEditAbo($user_abo, $view = 'user')
|
||||
{
|
||||
if ($view === 'portal') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue