@extends('layouts.dashboard.superadminapp') @section('title', 'Machine Report') @section('styles') @endsection @section('content')

UEPL | Machine Report

day, 00 month 0000
@if(session('success')) @endif @if(session('error')) @endif
Filter Options
@csrf
Reset
@php $totalMachines = $machines->count(); $machinesWithProcess = $machines->filter(fn($m) => $m->routeProcesses->count() > 0)->count(); $totalProcesses = $machines->sum(fn($m) => $m->routeProcesses->count()); $totalCycleHours = 0; $totalCycleMinutes = 0; foreach($machines as $machine) { foreach($machine->routeProcesses as $proc) { $totalCycleHours += (int)($proc->cycle_hours ?? 0); $totalCycleMinutes += (int)($proc->cycle_minutes ?? 0); } } // Convert excess minutes to hours $totalCycleHours += floor($totalCycleMinutes / 60); $totalCycleMinutes = $totalCycleMinutes % 60; @endphp
{{ $totalMachines }}
Total Machines
{{ $machinesWithProcess }}
Active Machines
{{ $totalProcesses }}
Total Processes
{{ $totalCycleHours }}:{{ str_pad($totalCycleMinutes, 2, '0', STR_PAD_LEFT) }}
Total Cycle Time
Machine Production Report
@forelse($machines as $machine) @if($machine->routeProcesses->count()) @foreach($machine->routeProcesses as $proc) @endforeach @else @endif @empty @endforelse
Machine Name Serial No Make Model Diameter Length Weight Route Card No Route Date Order No Process Operator Cycle Time Start Date End Date Status
{{ $machine->machine_name }} {{ $machine->machine_sl_no ?? '-' }} {{ $machine->make ?? '-' }} {{ $machine->model_type ?? '-' }} {{ $machine->diameter ?? '-' }} {{ $machine->length ?? '-' }} {{ $machine->weight ?? '-' }} @if($proc->routeCard) {{ $proc->routeCard->route_no }} @else - @endif {{ $proc->routeCard->route_date ? \Carbon\Carbon::parse($proc->routeCard->route_date)->format('d-m-Y') : '-' }} {{ $proc->routeCard->order_no ?? '-' }} {{ $proc->process ?? '-' }} {{ $proc->operatorUser->name ?? '-' }} @if($proc->cycle_hours || $proc->cycle_minutes) {{ $proc->cycle_hours ?? 0 }}h {{ $proc->cycle_minutes ?? 0 }}m @else - @endif {{ $proc->start_date ? \Carbon\Carbon::parse($proc->start_date)->format('d-m-Y') : '-' }} {{ $proc->end_date ? \Carbon\Carbon::parse($proc->end_date)->format('d-m-Y') : '-' }} @if($proc->end_date) Completed @elseif($proc->start_date) In Progress @else Pending @endif
{{ $machine->machine_name }} {{ $machine->machine_sl_no ?? '-' }} {{ $machine->make ?? '-' }} {{ $machine->model_type ?? '-' }} {{ $machine->diameter ?? '-' }} {{ $machine->length ?? '-' }} {{ $machine->weight ?? '-' }} - - - No process - - - - Idle
No machine records found.
Machines with Active Processes
@php $activeMachines = $machines->filter(fn($m) => $m->routeProcesses->count() > 0)->take(5); @endphp @forelse($activeMachines as $machine) @php $machineHours = 0; $machineMinutes = 0; foreach($machine->routeProcesses as $proc) { $machineHours += (int)($proc->cycle_hours ?? 0); $machineMinutes += (int)($proc->cycle_minutes ?? 0); } $machineHours += floor($machineMinutes / 60); $machineMinutes = $machineMinutes % 60; @endphp @empty @endforelse
Machine Processes Total Cycle Time
{{ $machine->machine_name }} {{ $machine->routeProcesses->count() }} {{ $machineHours }}h {{ $machineMinutes }}m
No active machines
Idle Machines (No Process)
@php $idleMachines = $machines->filter(fn($m) => $m->routeProcesses->count() == 0)->take(5); @endphp @forelse($idleMachines as $machine) @empty @endforelse
Machine Serial No Make/Model
{{ $machine->machine_name }} {{ $machine->machine_sl_no ?? '-' }} {{ $machine->make ?? '-' }} / {{ $machine->model_type ?? '-' }}
All machines are active
@endsection @section('scripts') @endsection