@extends('layouts.app') @section('content')
{{-- Toolbar --}}

Agency Markups

{{-- Agency Header --}}
@include('admin.agency.agency_header')
{{-- Toast: Success --}} @if(session('success'))
{{ session('success') }}
@endif {{-- Toast: Errors --}} @if($errors->any() && old('supplier'))
Please fix the following:
    @foreach($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif {{-- DEFAULT MARKUP CARD --}}
{{ $agency->agency_name }} — Default Markup
@if($agency->hasDefaultMarkup()) {{ ucfirst($agency->markup_type) }}: {{ $agency->defaultMarkupLabel() }} @else Not Configured @endif {{-- Edit Default Markup Button --}}
@if($agency->hasDefaultMarkup())
Agency-level fallback active: {{ $agency->defaultMarkupLabel() }} ({{ ucfirst($agency->markup_type) }})

Bookings that do not match any slab-specific rule below will automatically use this default markup.

@else
No default markup configured for this agency.

If a booking does not match any slab rule below, no markup will be applied and the base price will be used.

@endif
{{-- COVERAGE STATUS CARD --}}
@if($noMarkupWarning) Add a markup rule to get started. @elseif(!empty($missingSlabs)) Incomplete Coverage @else Full Coverage All price slabs have an active markup rule. @endif
@if(!$noMarkupWarning && !empty($missingSlabs)) @endif
{{-- MARKUP TABLES --}} @forelse($markups as $groupKey => $groupMarkups) @php [$supplierName, $serviceTypeName] = explode('||', $groupKey); @endphp
{{ $supplierName }} {{ $serviceTypeName }}
{{ $groupMarkups->count() }} Rule(s)
@foreach($groupMarkups as $markup) @endforeach
# Price Slab Markup Type Value Status Action
{{ $loop->iteration }} @php $sd = is_array($markup->slab_data) ? $markup->slab_data : null; @endphp @if($sd && !empty($sd['label'])) {{ $sd['label'] }} {{ number_format($sd['min_price'], 3) }} – {{ number_format($sd['max_price'], 3) }} @elseif($sd && isset($sd['min_price'])) {{ number_format($sd['min_price'], 0) }} – {{ number_format($sd['max_price'], 0) }} {{ number_format($sd['min_price'], 3) }} – {{ number_format($sd['max_price'], 3) }} @else — (slab not assigned) @endif {{ ucfirst($markup->markup_type) }} @if($markup->markup_type === 'percentage') {{ number_format($markup->markup_value, 2) }}% @else {{ number_format($markup->markup_value, 3) }} @endif @if($markup->status === 'active') Active @else Inactive @endif
{{-- Edit Button --}} {{-- Delete Button --}}
@csrf @method('DELETE')
@empty

No markup rules added yet.

@endforelse
{{-- ══════════════════════════════════ EDIT DEFAULT MARKUP MODAL ══════════════════════════════════ --}} {{-- ══════════════════════════════════ COVERAGE DETAILS MODAL ══════════════════════════════════ --}} @if(!$noMarkupWarning && !empty($missingSlabs)) @endif {{-- ══════════════════════════════════ ADD MARKUP RULE MODAL ══════════════════════════════════ --}} {{-- ══════════════════════════════════ EDIT MARKUP RULE MODAL ══════════════════════════════════ --}} @endsection @section('scripts') @endsection