Skip to content
Code-Schnipsel Gruppen Projekte
Commit 94159c07 erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

feat: consider period of notice case in cancel info

Übergeordneter a9d6fde8
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
...@@ -1024,6 +1024,10 @@ ...@@ -1024,6 +1024,10 @@
<de><![CDATA[Sie haben Ihre Mitgliedschaft am [addedDate] abgeschlossen und können diese jederzeit kündigen.]]></de> <de><![CDATA[Sie haben Ihre Mitgliedschaft am [addedDate] abgeschlossen und können diese jederzeit kündigen.]]></de>
<en><![CDATA[You subscribed to your membership at [addedDate] and can cancel it at any time.]]></en> <en><![CDATA[You subscribed to your membership at [addedDate] and can cancel it at any time.]]></en>
</locale> </locale>
<locale name="MembershipUser.cancel.info_text.period_of_notice_expired">
<de><![CDATA[Die Kündigungsfrist für den aktuellen Turnus ([cycleBeginDate] bis [cycleEndDate]) ist am [cancelUntilDate] abgelaufen. Ihre Mitgliedschaft wird daher am [cycleEndDate] automatisch bis zum [nextCycleEndDate] verlängert.]]></de>
<en><![CDATA[The period of notice for the current membership period ([cycleBeginDate] to [cycleEndDate]) expired at [cancelUntilDate]. Thus your membership will be automatically extended to [nextCycleEndDate] at [cycleEndDate].]]></en>
</locale>
<!-- Templates --> <!-- Templates -->
<locale name="templates.mail.startcancel.subject"> <locale name="templates.mail.startcancel.subject">
......
...@@ -936,14 +936,14 @@ public function getFrontendViewData() ...@@ -936,14 +936,14 @@ public function getFrontendViewData()
try { try {
if (!$Contract->isInPeriodOfNotice()) { if (!$Contract->isInPeriodOfNotice()) {
$cancelAllowed = false; $cancelAllowed = false;
} else {
$PeriodOfNoticeInterval = $Contract->getPeriodOfNoticeInterval();
$EndBaseDate = clone $CurrentCancelEndDate;
$EndBaseDate->setTime(0, 0, 0);
$EndBaseDate->sub(\date_interval_create_from_date_string('1 second'));
$CancelUntilDate = $EndBaseDate->sub($PeriodOfNoticeInterval);
} }
$PeriodOfNoticeInterval = $Contract->getPeriodOfNoticeInterval();
$EndBaseDate = clone $CurrentCancelEndDate;
$EndBaseDate->setTime(0, 0, 0);
$EndBaseDate->sub(\date_interval_create_from_date_string('1 second'));
$CancelUntilDate = $EndBaseDate->sub($PeriodOfNoticeInterval);
} catch (\Exception $Exception) { } catch (\Exception $Exception) {
QUI\System\Log::writeException($Exception); QUI\System\Log::writeException($Exception);
} }
...@@ -952,22 +952,37 @@ public function getFrontendViewData() ...@@ -952,22 +952,37 @@ public function getFrontendViewData()
$addedDate = $this->formatDate($this->getAttribute('addedDate')); $addedDate = $this->formatDate($this->getAttribute('addedDate'));
$CycleEndDate = $this->getCycleEndDate(); $CycleEndDate = $this->getCycleEndDate();
$cycleEndDate = $CycleEndDate ? $this->formatDate($CycleEndDate) : '-'; $cycleEndDate = $CycleEndDate ? $this->formatDate($CycleEndDate) : '-';
$cycleBeginDate = $this->formatDate($this->getCycleBeginDate());
$NextCycleEndDate = $this->getNextCycleEndDate(); $NextCycleEndDate = $this->getNextCycleEndDate();
$nextCycleEndDate = $NextCycleEndDate ? $this->formatDate($NextCycleEndDate) : '-'; $nextCycleEndDate = $NextCycleEndDate ? $this->formatDate($NextCycleEndDate) : '-';
// Determine cancel info text // Determine cancel info text
if ($Contract) { if ($Contract) {
if ($CancelUntilDate) { if ($Contract->getPeriodOfNoticeInterval()) {
$cancelInfoText = QUI::getLocale()->get( if ($Contract->isInPeriodOfNotice()) {
'quiqqer/memberships', $cancelInfoText = QUI::getLocale()->get(
'MembershipUser.cancel.info_text.cancel_until_date', 'quiqqer/memberships',
[ 'MembershipUser.cancel.info_text.cancel_until_date',
'addedDate' => $addedDate, [
'cancelUntilDate' => $this->formatDate($CancelUntilDate), 'addedDate' => $addedDate,
'cycleEndDate' => $cycleEndDate, 'cancelUntilDate' => $this->formatDate($CancelUntilDate),
'nextCycleEndDate' => $nextCycleEndDate 'cycleEndDate' => $cycleEndDate,
] 'nextCycleEndDate' => $nextCycleEndDate
); ]
);
} else {
$cancelInfoText = QUI::getLocale()->get(
'quiqqer/memberships',
'MembershipUser.cancel.info_text.period_of_notice_expired',
[
'addedDate' => $addedDate,
'cancelUntilDate' => $this->formatDate($CancelUntilDate),
'cycleBeginDate' => $cycleBeginDate,
'cycleEndDate' => $cycleEndDate,
'nextCycleEndDate' => $nextCycleEndDate
]
);
}
} else { } else {
$cancelInfoText = QUI::getLocale()->get( $cancelInfoText = QUI::getLocale()->get(
'quiqqer/memberships', 'quiqqer/memberships',
...@@ -1006,7 +1021,7 @@ public function getFrontendViewData() ...@@ -1006,7 +1021,7 @@ public function getFrontendViewData()
'username' => $QuiqqerUser->getUsername(), 'username' => $QuiqqerUser->getUsername(),
'fullName' => $QuiqqerUser->getName(), 'fullName' => $QuiqqerUser->getName(),
'addedDate' => $addedDate, 'addedDate' => $addedDate,
'beginDate' => $this->formatDate($this->getCycleBeginDate()), 'beginDate' => $cycleBeginDate,
'endDate' => $cycleEndDate, 'endDate' => $cycleEndDate,
'cancelEndDate' => $this->formatDate($CurrentCancelEndDate), 'cancelEndDate' => $this->formatDate($CurrentCancelEndDate),
'cancelDate' => $this->formatDate($this->getAttribute('cancelDate')), 'cancelDate' => $this->formatDate($this->getAttribute('cancelDate')),
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren