@extends('layouts.app') @push('page-styles') @endpush @section('page-content')
{{ __('Welcome') }} {{ !empty(auth()->user()->username) ? auth()->user()->username . ' !' : '' }} @superadmin
@if (!empty($projects))

{{ !empty($projects) ? $projects->count(): 0 }}

{{ __('Projects') }}
@endif

{{ !empty($clients) ? $clients->count() : 0 }}

{{ __('Clients') }}

{{ !empty($tickets) ? $tickets->count(): 0 }}

{{ __('Tickets') }}

{{ !empty($employees) ? $employees->count(): 0 }}

{{ __('Employees') }}

{{ __('Budget') }}

{{ __('Estimates & Invoices Overview') }}

{{ __('Expenses') }}

@if (!empty(module('Sales')))
{{ __('New Employees') }}

{{ $thisMonthTotalEmployees }}

{{ __('Previous Month Employees') }} {{ $prevMonthTotalEmployees }}

{{ __('Expenses') }}

{{ LocaleSettings('currency_symbol').' '.$thisMonthExpenses }}

{{ __('Previous Month') }} {{ LocaleSettings('currency_symbol').' '.$prevMonthExpenses }}

{{ __('Estimates') }}

{{ LocaleSettings('currency_symbol').' '.$thisMonthEstimates }}

{{ __('Previous Month') }} {{ LocaleSettings('currency_symbol').' '.$prevMonthEstimates }}

{{ __('Invoices') }}

{{ LocaleSettings('currency_symbol').' '.$thisMonthInvoices }}

{{ __('Previous Month') }} {{ LocaleSettings('currency_symbol').' '.$thisMonthInvoices }}

@endif
{{ __('Statistics') }}
@if (!empty($invoices) && $invoices->count() > 0)

{{ __('Declined Invoices') }} {{ $invoices->where('status', '4')->count() }} / {{ $invoices->count() }}

{{ __('Partially Paid Invoices') }} {{ $invoices->where('status', '3')->count() }} / {{ $invoices->count() }}

{{ __('Paid Invoices') }} {{ $invoices->where('status', '2')->count() }} / {{ $invoices->count() }}

{{ __('Sent Invoices') }} {{ $invoices->where('status', '1')->count() }} / {{ $invoices->count() }}

@endif @if (!empty($tickets) && $tickets->count() > 0)

{{ __('Open Tickets') }} {{ $tickets->where('status', \App\Enums\TicketStatus::NEW)->count() }} / {{ $tickets->count() }}

{{ __('Closed Tickets') }} {{ $tickets->where('status', \App\Enums\TicketStatus::CLOSED)->count() }} / {{ $tickets->count() }}

@endif
@if (!empty($absentees) && $absentees->count() > 0)

{{ __('Today Absent') }} {{ $absentees->count() }}

@foreach ($absentees as $user)
{{ __('Image') }}
{{ $user->fullname }}
@endforeach @can('view-attendances') @endcan
@endif
@if (!empty(module('Sales')) && module('Sales')->isEnabled())

{{ __('Invoices') }}

@if (!empty($thisMonthInvoiceList)) @foreach ($thisMonthInvoiceList as $invoice) @endforeach @endif
{{ __('Invoice ID') }} {{ __('Client') }} {{ __('Due Date') }} {{ __('Total') }} {{ __('Status') }}
{{ $invoice->inv_id }}

{{ $invoice->client->user->fullname ?? '' }}

{{ format_date($invoice->expiryDate) ?? '' }} {{ LocaleSettings('currency_symbol') }} {{ $invoice->grand_total }} {{ $invoice->statusName['name'] ?? '' }}
@can('view-invoices') @endcan
@endif

{{ __('Clients') }}

@can(['edit-client','delete-client']) @endcan @if (!empty($thisMonthClients) && $thisMonthClients->count() > 0) @foreach ($thisMonthClients as $client) @php $img = !empty($client->avatar) ? asset('storage/users/'.$client->avatar): asset('images/user.jpg'); $link = (auth()->user()->can('show-ClientProfile')) ? route('clients.show', ['client' => Crypt::encrypt($client->id)]): '#'; @endphp @can(['edit-client','delete-client']) @endcan @endforeach @endif
{{ __('Name') }} {{ __('Email') }} {{ __('Status') }}{{ __('Action') }}
{!! \Spatie\Menu\Laravel\Html::userAvatar($client->fullname, $img, $link) !!} {{ $client->email }} {{ $client->status->name ?? '' }}
@can('view-clients') @endcan
@if (module('Project') && module('Project')->isEnabled())

{{ __('Recent Projects') }}

@can(['edit-project', 'delete-project']) @endcan @if (!empty($recentProjects) && $recentProjects->count() > 0) @foreach ($recentProjects as $project) @can(['edit-project','delete-project']) @endcan @endforeach @endif
{{ __('Project Name') }} {{ __('Date') }} {{ __('Priority') }}{{ __('Action') }}
@can('show-project')

{{ $project->name }}

@else

{{ $project->name }}

@endcan {{ $project->tasks->count() ?? 0 }} {{ __('Opened Tasks') }} {{ $project->tasks->count() ?? 0 }} {{ __('Tasks Completed') }}
{{ format_date($project->startDate) }} - {{ format_date($project->endDate) }} {{ $project->priority }}
@can('view-projects') @endcan
@endif
@push('page-scripts') @endpush @endsuperadmin
@endsection