@extends(getTemplate() .'.panel.layouts.panel_layout') @push('styles_top') @endpush @section('content')

{{ trans('financial.sales_statistics') }}

{{ $studentCount }} {{ trans('quiz.students') }}
{{ $webinarCount }} {{ trans('panel.content_sales') }}
{{ $meetingCount }} {{ trans('panel.appointment_sales') }}
{{ handlePrice($totalSales) }} {{ trans('financial.total_sales') }}

{{ trans('financial.sales_report') }}

@if(!empty($sales) and !$sales->isEmpty())

{{ trans('financial.sales_history') }}

@foreach($sales as $sale) @endforeach
{{ trans('quiz.student') }} {{ trans('product.content') }} {{ trans('public.price') }} {{ trans('public.discount') }} {{ trans('financial.total_amount') }} {{ trans('financial.income') }} {{ trans('public.type') }} {{ trans('public.date') }}
@if(!empty($sale->buyer))
{{ $sale->buyer->full_name }} {{ $sale->buyer->email }}
@else {{ trans('update.deleted_user') }} @endif
@php $content = trans('update.deleted_item'); $contentId = null; if(!empty($sale->webinar)) { $content = $sale->webinar->title; $contentId =$sale->webinar->id; } elseif(!empty($sale->bundle)) { $content = $sale->bundle->title; $contentId =$sale->bundle->id; } elseif(!empty($sale->productOrder) and !empty($sale->productOrder->product)) { $content = $sale->productOrder->product->title; $contentId =$sale->productOrder->product->id; } elseif(!empty($sale->registrationPackage)) { $content = $sale->registrationPackage->title; $contentId =$sale->registrationPackage->id; } elseif(!empty($sale->subscribe)) { $content = $sale->subscribe->title; $contentId =$sale->subscribe->id; } elseif(!empty($sale->promotion)) { $content = $sale->promotion->title; $contentId =$sale->promotion->id; } elseif (!empty($sale->meeting_id)) { $content = trans('meeting.reservation_appointment'); } @endphp {{ $content }} @if(!empty($contentId)) Id: {{ $contentId }} @endif
@if($sale->payment_method == \App\Models\Sale::$subscribe) {{ trans('financial.subscribe') }} @else {{ !empty($sale->amount) ? handlePrice($sale->amount) : '-' }} @endif {{ !empty($sale->discount) ? handlePrice($sale->discount) : '-' }} @if($sale->payment_method == \App\Models\Sale::$subscribe) {{ trans('financial.subscribe') }} @else {{ !empty($sale->total_amount) ? handlePrice($sale->total_amount) : '-' }} @endif {{ !empty($sale->getIncomeItem()) ? handlePrice($sale->getIncomeItem()) : '-' }} @switch($sale->type) @case(\App\Models\Sale::$webinar) @if(!empty($sale->webinar)) {{ trans('webinars.'.$sale->webinar->type) }} @else {{ trans('update.class') }} @endif @break; @case(\App\Models\Sale::$meeting) {{ trans('meeting.appointment') }} @break; @case(\App\Models\Sale::$subscribe) {{ trans('financial.subscribe') }} @break; @case(\App\Models\Sale::$promotion) {{ trans('panel.promotion') }} @break; @case(\App\Models\Sale::$registrationPackage) {{ trans('update.registration_package') }} @break; @case(\App\Models\Sale::$bundle) {{ trans('update.bundle') }} @break; @case(\App\Models\Sale::$product) {{ trans('update.product') }} @break; @endswitch {{ dateTimeFormat($sale->created_at, 'j M Y H:i') }}
{{ $sales->appends(request()->input())->links('vendor.pagination.panel') }}
@else @include(getTemplate() . '.includes.no-result',[ 'file_name' => 'sales.png', 'title' => trans('financial.sales_no_result'), 'hint' => nl2br(trans('financial.sales_no_result_hint')), ]) @endif @endsection @push('scripts_bottom') @endpush