@extends('layouts.admin') @php $currencySymbol = App\Models\AppSetting::getValue('currency_symbol', '?'); @endphp @section('title', 'Order Cancellation Limits') @section('content')
@if(session('success')) @endif @if(session('error')) @endif
How Cancellation Limits Work
These limits apply to order cancellations. When a partner exceeds the warning threshold, they will receive a notification. Exceeding the penalty threshold will result in automatic penalties and possible account suspension.
@csrf @method('PUT')
Store Cancellation Limits
Configure limits for store order cancellations
Store will receive warning notification when cancellation rate exceeds this percentage
Penalty will be applied when cancellation rate exceeds this percentage
Stores can reject pending orders only within this many minutes after order placement. Use 0 for no time limit.
Customers can cancel orders only within this many minutes after order placement. Use 0 for no time limit.
auto_disable ?? true) ? 'checked' : '' }}>
Example Calculation

If a store has 100 orders and cancels 25 orders:

  • Cancellation Rate: 25%
  • Warning threshold (20%): ⚠️ Warning sent
  • Penalty threshold (30%): ✓ Not exceeded
  • Store will be {{ ($restaurantLimit->auto_disable ?? true) ? '⚠️ Auto-disabled' : '📧 Notified' }} if penalty exceeded
Delivery Partner Cancellation Limits
Configure limits for delivery partner cancellations
Driver will receive warning notification when cancellation rate exceeds this percentage
Penalty will be applied when cancellation rate exceeds this percentage
auto_disable ?? true) ? 'checked' : '' }}>
Example Calculation

If a driver has 50 orders and cancels 12 orders:

  • Cancellation Rate: 24%
  • Warning threshold (20%): ⚠️ Warning sent
  • Penalty threshold (30%): ✓ Not exceeded
  • Driver will be {{ ($driverLimit->auto_disable ?? true) ? '⚠️ Auto-disabled' : '📧 Notified' }} if penalty exceeded
Current Cancellation Rates
Real-time Data
@php $restaurantsWithRates = App\Models\Restaurant::withCount(['orders', 'orders as cancelled_count' => function($q) { $q->where('status', 'cancelled'); }])->get(); @endphp @forelse($restaurantsWithRates as $restaurant) @php $cancellationRate = $restaurant->orders_count > 0 ? ($restaurant->cancelled_count / $restaurant->orders_count) * 100 : 0; $isWarning = $restaurantLimit && $cancellationRate >= ($restaurantLimit->warning_threshold ?? 20); $isPenalty = $restaurantLimit && $cancellationRate >= ($restaurantLimit->penalty_threshold ?? 30); @endphp
Partner Type Total Orders Cancelled Orders Cancellation Rate Status Actions
{{ $restaurant->name }}
Store {{ number_format($restaurant->orders_count) }} {{ number_format($restaurant->cancelled_count) }}
{{ number_format($cancellationRate, 2) }}% @if($isPenalty) @elseif($isWarning) @endif
{{ $restaurant->is_open ? 'Online' : 'Offline' }}
@php $cancelledOrders = $restaurant->orders()->where('status', 'cancelled')->limit(10)->get(); @endphp @forelse($cancelledOrders as $order) @empty @endforelse
Order # Date Amount Cancellation Reason
#{{ $order->order_number }} {{ $order->cancelled_at?->format('d M Y H:i') }} {{ $currencySymbol }}{{ number_format($order->total, App\Models\AppSetting::currencyDecimals()) }} {{ Str::limit($order->cancellation_reason, 50) ?: 'No reason provided' }}
No cancelled orders found
@empty
No Stores Found

No store data available to display cancellation rates.

@endforelse
@endsection