@extends('super_admin.layouts.master') @section('title', 'Edit ' . $planPricing->plan_name) @section('page_title', 'Edit Subscription Plan') @section('content')

Edit {{ $planPricing->plan_name }}

Plan Key: {{ $planPricing->plan_key }}

@csrf @method('PUT')

Basic Information

@error('plan_name')

{{ $message }}

@enderror

Plan Status

Inactive plans won't be available for new schools to subscribe

Pricing Details

₹

Current: ₹{{ number_format($planPricing->monthly_price) }}

@error('monthly_price')

{{ $message }}

@enderror
₹
@php $yearlySavings = ($planPricing->monthly_price * 12) - ($planPricing->yearly_price ?? 0); @endphp @if($yearlySavings > 0)

Current savings: ₹{{ number_format($yearlySavings) }}/year

@endif

Price Change Information

When should this new pricing take effect?

ERP Modules

Select which modules are included in this plan

@php $groupedModules = $modules->groupBy('category'); @endphp @forelse($groupedModules as $category => $categoryModules)

{{ ucfirst($category) }} ({{ $categoryModules->count() }})

@foreach($categoryModules as $module) @endforeach
@empty

No modules available.

@endforelse
|

Plan Statistics

Plan Key {{ $planPricing->plan_key }}
Created {{ $planPricing->created_at->format('M d, Y') }}
Last Updated {{ $planPricing->updated_at->diffForHumans() }}
Price Changes {{ $planPricing->histories->count() }}
@php $schoolsUsingPlan = \App\Models\School::where('plan', $planPricing->plan_key)->count(); @endphp
Schools Using {{ $schoolsUsingPlan }}

Recent Price Changes

@if($planPricing->histories->count() > 0)
@foreach($planPricing->histories->take(5) as $history)
₹{{ number_format($history->old_monthly_price) }} → ₹{{ number_format($history->new_monthly_price) }} {{ $history->created_at->format('M d') }}

{{ Str::limit($history->change_reason, 40) }}

by {{ $history->changedBy->name ?? 'Unknown' }}

@endforeach
@if($planPricing->histories->count() > 5) View all {{ $planPricing->histories->count() }} changes → @endif @else

No price changes yet

@endif
@if($schoolsUsingPlan === 0)

Danger Zone

Delete this plan permanently. This action cannot be undone.

@csrf @method('DELETE')
@else

Cannot Delete

{{ $schoolsUsingPlan }} school(s) are currently subscribed to this plan. Deactivate it instead if needed.

@endif
@endsection @push('scripts') @endpush