@extends('templates.reports') @section('content') @parent @include('global.status')

{{ $company->clients()->createdIn('year', $year)->count() }}

{{ trans('dashboard.counter.clients') }}

{{ $company->policies()->createdIn('year', $year)->count() }}

{{ trans('dashboard.counter.policies') }}

{{ $company->currency_symbol }}{{ $company->policies()->createdIn('year', $year)->sum('premium') + 0 }}

{{ trans('dashboard.counter.sales') }}

{{ $company->currency_symbol }}{{ $company->payments()->madeWithin('year', $year)->sum('amount') + 0 }}

{{ trans('dashboard.counter.conversions') }}

{{ $company->currency_symbol }}{{ $company->payments()->madeWithin('year', $year)->sum('amount') - ($company->brokers->reduce(function($count, $broker) use($year) { return $count + ($broker->inviteePayments()->madeWithin('year', $year)->sum('amount') * $broker->company->commission_rate / 100); }, 0) + $company->staff->reduce(function($count, $staff) use($year) { return $count + ($staff->inviteePayments()->madeWithin('year', $year)->sum('amount') * $staff->company->commission_rate / 100); }, 0)) }}

{{ trans('dashboard.counter.income') }}

{{ $company->policies()->createdIn('year', $year)->expiring('after', 30)->count() }}

{{ trans('dashboard.counter.expiring') }}
{{--
{{ $company->clients()->createdIn('year', $year)->count() }}
{{ trans('dashboard.counter.clients') }}
{{ $company->policies()->createdIn('year', $year)->count() }}
{{ trans('dashboard.counter.policies') }}
{{ $company->currency_symbol }}{{ $company->policies()->createdIn('year', $year)->count() }}
{{ trans('dashboard.counter.sales') }}
{{ $company->currency_symbol }}{{ $company->payments()->madeWithin('year', $year)->sum('amount') + 0 }}
{{ trans('dashboard.counter.conversions') }}
{{ $company->currency_symbol }}{{ $company->payments()->madeWithin('year', $year)->sum('amount') - ($company->brokers->reduce(function($count, $broker) use($year) { return $count + ($broker->inviteePayments()->madeWithin('year', $year)->sum('amount') * $broker->company->commission_rate / 100); }, 0) + $company->staff->reduce(function($count, $staff) use($year) { return $count + ($staff->inviteePayments()->madeWithin('year', $year)->sum('amount') * $staff->company->commission_rate / 100); }, 0)) }}
{{ trans('dashboard.counter.income') }}
{{ $company->policies()->createdIn('year', $year)->expiring('after', 30)->count() }}
{{ trans('dashboard.counter.expiring') }}
--}}

{{ trans('reports.graph.header.clients_vs_policies') }}

{{ trans('reports.graph.header.annual') }}

@endsection @section('extra_scripts') @endsection