Buchungsseite: Buchungs- und Verlaengerungsdatum des Abos aus Stripe
Cashier spiegelt die Periode nicht lokal; neuer SubscriptionPeriodResolver holt start_date + current_period_end (Item-Ebene) gecacht, Fallback null. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
75d7baab2a
commit
c2ec18be5f
3 changed files with 140 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ use App\Services\Billing\CreditPricingService;
|
|||
use App\Services\Billing\CreditTopupService;
|
||||
use App\Services\Billing\ExtraPmPurchaseService;
|
||||
use App\Services\Billing\StripeCheckoutService;
|
||||
use App\Services\Billing\SubscriptionPeriodResolver;
|
||||
use App\Services\Billing\VatResolver;
|
||||
use Flux\Flux;
|
||||
use Livewire\Attributes\Layout;
|
||||
|
|
@ -257,6 +258,12 @@ new #[Layout('components.layouts.app'), Title('Buchungen & Add-ons')] class exte
|
|||
$currentInterval = $subscription->stripe_price === $currentPlan->stripe_price_id_yearly ? 'yearly' : 'monthly';
|
||||
}
|
||||
|
||||
// Buchungs- und Verlängerungsdatum des laufenden Abos (Stripe spiegelt
|
||||
// die Periode nicht lokal, daher gecachter Abruf; null bei Fehler).
|
||||
$subscriptionPeriod = $subscription
|
||||
? app(SubscriptionPeriodResolver::class)->resolve($subscription)
|
||||
: null;
|
||||
|
||||
// Vorgemerkter Tarifwechsel (Downgrade zum Periodenende): lokale
|
||||
// Spiegelung der Stripe-Schedule-Vormerkung für die Anzeige.
|
||||
$scheduledChangePlan = null;
|
||||
|
|
@ -277,6 +284,7 @@ new #[Layout('components.layouts.app'), Title('Buchungen & Add-ons')] class exte
|
|||
'currentPlan' => $currentPlan,
|
||||
'currentInterval' => $currentInterval,
|
||||
'subscription' => $subscription,
|
||||
'subscriptionPeriod' => $subscriptionPeriod,
|
||||
'scheduledChangePlan' => $scheduledChangePlan,
|
||||
'scheduledChangeAt' => $subscription?->scheduled_change_at
|
||||
? \Illuminate\Support\Carbon::parse($subscription->scheduled_change_at)
|
||||
|
|
@ -531,6 +539,20 @@ new #[Layout('components.layouts.app'), Title('Buchungen & Add-ons')] class exte
|
|||
{{ __('max. :limit Veröffentlichungen pro Tag', ['limit' => $currentPlan->daily_limit]) }}
|
||||
@endif
|
||||
</p>
|
||||
@if ($subscriptionPeriod)
|
||||
<div class="flex flex-wrap gap-x-6 gap-y-1 pt-1 text-[12px] text-[color:var(--color-ink-3)]">
|
||||
<span class="inline-flex items-center gap-1.5">
|
||||
<flux:icon.calendar-days class="size-3.5" />
|
||||
{{ __('Gebucht am :date', ['date' => $subscriptionPeriod['booked_at']->format('d.m.Y')]) }}
|
||||
</span>
|
||||
@unless ($subscription?->onGracePeriod())
|
||||
<span class="inline-flex items-center gap-1.5">
|
||||
<flux:icon.arrow-path class="size-3.5" />
|
||||
{{ __('Verlängerung am :date', ['date' => $subscriptionPeriod['renews_at']->format('d.m.Y')]) }}
|
||||
</span>
|
||||
@endunless
|
||||
</div>
|
||||
@endif
|
||||
@if ($subscription?->onGracePeriod())
|
||||
<p class="text-[12px] text-[color:var(--color-warn,#b45309)] m-0">
|
||||
{{ __('Gekündigt — läuft am :date aus.', ['date' => $subscription->ends_at?->format('d.m.Y')]) }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue