@if($logoBase64)

@endif
{{ $cp?->nama_perusahaan ?? config('app.name') }}
@if($cp?->alamat)
{{ $cp->alamat }}
@endif
@if($cp?->no_telp_1)
Telp: {{ $cp->no_telp_1 }}{{ $cp->no_telp_2 ? ' / '.$cp->no_telp_2 : '' }}
@endif
@if($cp?->email)
Email: {{ $cp->email }}
@endif
Penggunaan Barang
{{ \Carbon\Carbon::parse($penggunaan->tanggal_penggunaan)->translatedFormat('d F Y') }}
{{-- Kop ulang --}}
@if($logoBase64)

@endif
{{ $cp?->nama_perusahaan ?? config('app.name') }}
@if($cp?->alamat)
{{ $cp->alamat }}
@endif
Riwayat Aktivitas
{{ $penggunaan->nomor }}
@php
$statusLabels = ['draft'=>'Draft','selesai'=>'Tervalidasi','batal'=>'Dibatalkan'];
$fieldLabels = ['status'=>'Status','keterangan'=>'Keterangan','alasan_batal'=>'Alasan batal'];
@endphp
| Waktu |
Pengguna |
Aktivitas |
Detail |
@foreach($activities as $act)
@php
$rawDesc = $act->description;
$props = $act->properties;
if ($rawDesc === 'created') $desc = 'Draft dibuat';
elseif ($rawDesc === 'updated') $desc = 'Data diperbarui';
else $desc = $rawDesc;
if (str_contains($rawDesc, 'divalidasi')) $cls = 'lbl-validated';
elseif (str_contains($rawDesc, 'dibatalkan')) $cls = 'lbl-cancelled';
elseif (str_contains($rawDesc, 'direvisi') || $rawDesc === 'updated') $cls = 'lbl-revised';
else $cls = 'lbl-default';
$old = $props->get('old', []);
$new = $props->get('attributes', []);
$keys = array_filter(
array_unique(array_merge(array_keys((array)$old), array_keys((array)$new))),
fn($k) => !in_array($k, ['status']) || !in_array($rawDesc, ['Penggunaan barang divalidasi','Penggunaan barang dibatalkan','Penggunaan barang direvisi ke draft'])
);
@endphp
| {{ $act->created_at->format('d/m/Y H:i') }} |
{{ $act->causer?->nama ?? 'Sistem' }} |
{{ $desc }} |
@if($props->has('alasan'))
Alasan: {{ $props->get('alasan') }}
@endif
@foreach($keys as $key)
@php
$label = $fieldLabels[$key] ?? $key;
$oldVal = isset($old[$key]) ? ($statusLabels[$old[$key]] ?? $old[$key]) : null;
$newVal = isset($new[$key]) ? ($statusLabels[$new[$key]] ?? $new[$key]) : null;
@endphp
@if($oldVal !== null || $newVal !== null)
{{ $label }}: @if($oldVal){{ $oldVal }} @endif @if($newVal){{ $newVal }}@endif
@endif
@endforeach
@if(!$props->has('alasan') && empty($keys))—@endif
|
@endforeach
@endif