@extends('layout.main') @section('title', 'Laporan Pemeliharaan Kendaraan') @section('prev-page') Home @endsection @section('content') @php $isSuperadmin = session('user')->level->id == 4; @endphp @foreach ($groups as $group)
{{ $group->name }}
@if ($isSuperadmin) @endif @forelse ($group->categories as $category) @php $period = $category->monitoring_period; $hasPeriod = !is_null($period) && $period > 0; $showWarning = false; $warningText = ''; if ($hasPeriod) { if (!empty($category->last_transaction_date)) { $isOverdue = \Carbon\Carbon::parse($category->last_transaction_date) ->startOfDay() ->lt(\Carbon\Carbon::today()->subDays($period)); if ($isOverdue) { $showWarning = true; $warningText = 'Pemeliharaan kendaraan sudah melebihi waktu standar ' . $period . ' hari'; } } else { $showWarning = true; $warningText = 'Record pemeliharaan ini sudah melebihi waktu standar ' . $period . ' hari'; } } @endphp @if ($isSuperadmin) @endif @empty @endforelse
Kategori Transaksi Terakhir Periode NilaiBlokir
{{ $category->category_name }} {{ !empty($category->last_transaction_date) ? \Carbon\Carbon::parse($category->last_transaction_date)->format('d M Y') : '-' }} @if ($showWarning) @endif {{ $hasPeriod ? $period : '' }} {{ !empty($category->last_transaction_date) ? 'Rp' . number_format($category->last_transaction_amount, 0, ',', '.') : '-' }} @if (!empty($category->banned_other_category)) banned_category_status)) {{ 'checked' }} @endif /> @else - @endif
Belum ada kategori.
@endforeach @endsection @section('other-scripts') @endsection