@extends('layouts.app')
@section('title')
{{ __('List of Work Diaries') }}
@endsection
@section('content')
{{ __('Work Diaries') }}
| {{ __('Date') }} |
{{ __('Tool') }} |
{{ __('Demolition material') }} |
{{ __('Volume') }} [m3] |
{{ __('Duration') }} [h] |
{{ __('Consumption') }} [l/h] |
{{ __('Created by') }} |
{{ __('Note') }} |
@if(auth()->user()->isOperator())
|
@else
{{ __('Actions') }} |
@endif
@php
$sumVolume = 0;
$sumDuration = 0;
$sumFuel = 0;
@endphp
@foreach ($workdiaries as $item)
| {{ $item->date() }} |
@if(!is_null($item->tool))
{{ $item->tool->name }} |
@else
unknown |
@endif
{{ $item->material }} |
{{ $item->volume }} |
{{ $item->duration }} |
{{ $item->consumption }} |
{{ $item->user->name }} |
{{ $item->note }} |
@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
| Sum |
|
|
{{ $sumVolume }} m3 |
{{ $sumDuration }} h |
@if($workdiaries->count())
{{ round($sumFuel/$sumDuration,2) }} l/h
@endif
|
|
|
@endsection