Abo (A1+A2): Liefertag frei waehlbar 1-31, Aenderung nur nach vorn, Sperre erst am Ausfuehrungstag

A1: Jeder Monatstag ist als Liefertag erlaubt (UserAbo::allowedDeliveryDays),
Tage 29-31 liefern in kuerzeren Monaten am letzten Tag. Eine Stelle
AboHelper::dateForDayInMonth klammert; setNextDate, Erstausfuehrung,
Admin-Termin und Pause rechnen darueber, der Folgemonat immer aus dem
Liefertag (31.01 -> 28.02 -> 31.03). Liefertag-Aenderung gilt fuer den
laufenden Zyklus und nur nach vorn: ist der Tag im Referenzmonat vorbei,
wird abgelehnt, der Monat verschiebt sich nie (Rueckfrage R1).
Admin-Filter "naechste Ausfuehrung" als Datumsbereich. Prognose-Kacheln
bekommen die Kachel Monatsende, Team-Abos rechnen bis Monatsende.

A2: Sperrfristen Default 0, Setting 0 ist ausdruecklich 0 (fiel bisher auf
den Default zurueck). Bedingung Kalendertage <= Sperre, zentral in
AboHelper::isWithinLock: am Ausfuehrungstag ab 0:00 Uhr fixiert, Vortag bis
23:59 Uhr frei, fuer Liefertag, Produkte, Pause und Kuendigung (R2). Texte
mit _zero-Varianten ueber AboHelper::lockMessage.

Sprachdateien de/en/es/fr, neuer AboDeliveryDayTest, bestehende Tests
angepasst, Plan-Status mit Deploy-Schritt (Settings auf 0).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Kevin 2026-09-16 11:28:55 +00:00
parent d6efe56cd4
commit cf0311afc1
30 changed files with 638 additions and 185 deletions

View file

@ -43,10 +43,7 @@
</div>
@elseif ($pcLocked && $pcNextDate)
<div class="alert alert-warning mb-0">
{{ __('abo.pause_cancel_locked_hint', [
'date' => $pcNextDate->format(Util::formatDateDB()),
'lock' => App\Repositories\AboRepository::getLockDaysPauseCancel(),
]) }}
{{ App\Services\AboHelper::lockMessage('pause_cancel_locked_hint', $user_abo, App\Repositories\AboRepository::getLockDaysPauseCancel()) }}
</div>
@else
<div class="row">

View file

@ -69,14 +69,12 @@
</select>
</div>
</div>
<div class="col-6 col-md-3 col-lg-2 mb-2">
<label class="form-label" for="filter_next_day">{{ __('tables.next_date') }}</label>
<select class="custom-select" name="filter_next_day" id="filter_next_day">
<option value="">{{ __('tables.all') }}</option>
@foreach ($filter_next_days as $day)
<option value="{{ $day }}" @if((string) get_user_attr('filter_next_day') === (string) $day) selected @endif>{{ \App\Services\HTMLHelper::getAboStrLang($day) }}</option>
@endforeach
</select>
<div class="col-12 col-md-6 col-lg-4 mb-2">
<label class="form-label">{{ __('tables.next_date') }}</label>
<div class="d-flex border rounded p-1" style="gap: 6px;">
<input type="date" class="form-control" name="filter_next_from" id="filter_next_from" value="{{ get_user_attr('filter_next_from') }}" aria-label="{{ __('abo.filter_next_from') }}" placeholder="{{ __('abo.filter_next_from') }}">
<input type="date" class="form-control" name="filter_next_to" id="filter_next_to" value="{{ get_user_attr('filter_next_to') }}" aria-label="{{ __('abo.filter_next_to') }}" placeholder="{{ __('abo.filter_next_to') }}">
</div>
</div>
<div class="col-12 col-sm-6 col-md-3 col-lg-3 mb-2">
<label class="form-label" for="filter_member_id">{{ __('tables.adviser') }}</label>
@ -136,7 +134,8 @@
d.filter_payment = $('select[name=filter_payment]').val();
d.filter_start_month = $('select[name=filter_start_month]').val();
d.filter_start_year = $('select[name=filter_start_year]').val();
d.filter_next_day = $('select[name=filter_next_day]').val();
d.filter_next_from = $('input[name=filter_next_from]').val();
d.filter_next_to = $('input[name=filter_next_to]').val();
}
},
"order": [[0, "desc" ]],
@ -164,7 +163,7 @@
"url": "/js/datatables-{{ \App::getLocale() }}.json"
}
});
$('#filter_start_month, #filter_start_year, #filter_next_day, #filter_status, #filter_state, #filter_active, #filter_is_for, #filter_payment, #filter_member_id').on('change', function(){
$('#filter_start_month, #filter_start_year, #filter_next_from, #filter_next_to, #filter_status, #filter_state, #filter_active, #filter_is_for, #filter_payment, #filter_member_id').on('change', function(){
oTable.draw();
});
});

View file

@ -22,10 +22,7 @@
@if($aboChangeLocked)
<div class="alert alert-warning">
{{ __('abo.error_change_locked', [
'days' => (int) now()->diffInDays(\Carbon\Carbon::parse($user_abo->next_date), false),
'lock' => App\Repositories\AboRepository::getLockDaysChange(),
]) }}
{{ App\Services\AboHelper::lockMessage('error_change_locked', $user_abo, App\Repositories\AboRepository::getLockDaysChange()) }}
</div>
@endif