@extends('dashboard.admin.layouts.master') @php $money = fn ($amount) => number_format((float) $amount, 2); $typeColors = ['visit' => 'primary', 'online' => 'info', 'followup' => 'warning']; $chart = [ 'labels' => $report['chart']['labels'], 'series' => collect($report['chart']['series'])->map(fn ($s) => ['name' => trans('clinic.bookings.' . $s['key']), 'data' => $s['data'], 'color' => $typeColors[$s['key']]])->all(), ]; @endphp @section('toolbar') @include('dashboard.admin.clinic.reports.partials.header', ['title' => trans('clinic.reports_center.revenue')]) @endsection @section('content')
@include('dashboard.admin.clinic.reports.partials.filters', ['fields' => ['branch', 'clinic', 'doctor'], 'csv' => true])
{{ trans('clinic.reports_center.total_revenue') }}
{{ $money($report['totals']['revenue']) }}
{{ trans('clinic.reports_center.bookings_count', ['count' => $report['totals']['bookings']]) }}
@foreach ($report['types'] as $type => $row)
{{ trans('clinic.bookings.' . $type) }}
{{ $money($row['revenue']) }}
{{ trans('clinic.reports_center.bookings_count', ['count' => $row['bookings']]) }} ยท {{ trans('clinic.reports_center.profit') }} {{ $money($row['center_share']) }}
@endforeach

{{ trans($report['monthly'] ? 'clinic.reports_center.revenue_by_month' : 'clinic.reports_center.revenue_by_day') }}

{{ trans('clinic.reports_center.payments') }}
{{ trans('clinic.reports_center.online_paid') }}{{ $money($report['online_paid']) }}
{{ trans('clinic.reports_center.unpaid', ['count' => $report['pending']['count']]) }}{{ $money($report['pending']['amount']) }}
{{ trans('sidebar.offer_subscriptions') }}
@foreach (['new' => 'dash_site.offer_sub_new', 'contacted' => 'dash_site.offer_sub_contacted'] as $status => $label)
{{ trans($label) }}{{ $report['subscriptions'][$status] ?? 0 }}
@endforeach
{{ trans('clinic.reports_center.subscriptions_paid', ['count' => (int) $report['subscriptions_paid']->orders]) }}{{ number_format((float) $report['subscriptions_paid']->total, 2) }}
{{ trans('sidebar.medicine_orders') }}
{{ trans('clinic.reports_center.orders') }}{{ (int) $report['medicine']->orders }}
{{ trans('clinic.medicine_orders.total') }}{{ $money($report['medicine']->total) }}
{{ trans('clinic.medicine_orders.center_amount') }}{{ $money($report['medicine']->center) }}
@endsection @section('js') @endsection