@extends('layouts.app') @section('title') {{ __('List of Work Diaries') }} @endsection @section('content')

{{ __('Work Diaries') }}

@if(auth()->user()->isOperator()) @else @endif @php $sumVolume = 0; $sumDuration = 0; $sumFuel = 0; @endphp @foreach ($workdiaries as $item) @if(!is_null($item->tool)) @else @endif @if(auth()->user()->isOperator()) @else @endif @php // Count sums under the table $sumVolume += $item->volume; $sumDuration += $item->duration; $sumFuel += ($item->consumption * $item->duration); @endphp @endforeach
{{ __('Date') }} {{ __('Tool') }} {{ __('Demolition material') }} {{ __('Volume') }} [m3] {{ __('Duration') }} [h] {{ __('Consumption') }} [l/h] {{ __('Created by') }} {{ __('Note') }}{{ __('Actions') }}
{{ $item->date() }}{{ $item->tool->name }}unknown{{ $item->material }} {{ $item->volume }} {{ $item->duration }} {{ $item->consumption }} {{ $item->user->name }} {{ $item->note }}
Sum {{ $sumVolume }} m3 {{ $sumDuration }} h @if($workdiaries->count()) {{ round($sumFuel/$sumDuration,2) }} l/h @endif
@endsection