@extends('layouts.teamlead')
@section('title', 'Баланси операторів')
@push('head')
@endpush
@section('content')
{{-- Шапка --}}
Баланси операторів
Таблиця всіх балансів операторів з фільтрами по кабінету,
оператору та діапазону дат.
{{-- Flash --}}
@if(session('success'))
{{ session('success') }}
@endif
@if($errors->any())
@foreach($errors->all() as $e)
{{ $e }}
@endforeach
@endif
@php
$normalizeDateForInput = function($v) {
if (!$v) return '';
if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $v)) return $v;
try {
return \Illuminate\Support\Carbon::createFromFormat('d.m.Y', $v)->format('Y-m-d');
} catch (\Throwable $e) {
try {
return \Illuminate\Support\Carbon::parse($v)->format('Y-m-d');
} catch (\Throwable $e2) {
return '';
}
}
};
$fromVal = $normalizeDateForInput($from ?? ($dateFrom ?? null));
$toVal = $normalizeDateForInput($to ?? ($dateTo ?? null));
@endphp
{{-- Фільтри --}}
{{-- Таблиця --}}
| Дата |
Кабінет |
Оператор |
Зміна |
Сума |
Дії |
@forelse($balances as $b)
@php
$dateText = $b->work_date
? \Carbon\Carbon::parse($b->work_date)->format('d.m.Y')
: '—';
$timeText = $b->created_at
? $b->created_at->timezone(config('app.timezone'))->format('H:i')
: null;
@endphp
|
{{ $dateText }}
@if($timeText)
{{ $timeText }}
@endif
|
{{ optional($b->cabinet)->name }}
|
{{ $b->operator_name }} |
{{ $b->shift }}
|
{{ number_format($b->amount,2,'.',' ') }} |
✎
|
@empty
|
Нічого не знайдено
|
@endforelse
@endsection