{{-- Profit rows per clinic or per doctor. Params: $rows, $kind (clinic|doctor), $totals. --}} @php($money = fn ($amount) => number_format((float) $amount, 2)) @if (collect($rows)->isEmpty())
{{ trans('clinic.reports_center.no_data') }}
@else
@foreach ($rows as $row) @php($share = $totals['center_share'] > 0 ? round($row['center_share'] * 100 / $totals['center_share']) : 0) @endforeach
{{ $kind === 'clinic' ? trans('clinic.reports_center.clinic') : trans('clinic.doctors.title') }} {{ trans('clinic.doctors.earning_bookings') }} {{ trans('clinic.doctors.total_price') }} {{ trans('clinic.reports_center.doctors_shares') }} {{ trans('clinic.reports_center.profit') }} {{ trans('clinic.reports_center.share_of_profit') }}
@if ($kind === 'clinic')
{{ $row['model']?->name ?? '—' }}
{{ $row['model']?->branch?->name }}
@else @if ($row['model']) {{ $row['model']->name }}
{{ $row['model']->specialty?->name }}
@else — @endif @endif
{{ $row['bookings'] }} {{ $money($row['revenue']) }} {{ $money($row['doctor_share']) }} {{ $money($row['center_share']) }}
{{ $share }}%
@endif