@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
| No | No PRA PR | Pemohon | Departemen | Tgl Pengajuan | @if ($isSpvView || in_array('admins', $users_rules))Status | @endifAction |
|---|---|---|---|---|---|---|
| {{ $rowNum++ }} | {{ $header->no_prapr }} | {{ $header->user?->full_name ?? '-' }} | {{ $header->nama_departemen ?? '-' }} | {{ date('d M y', strtotime($header->tanggal_pengajuan)) }} | @if ($isSpvView || in_array('admins', $users_rules)){{ strtoupper($headerDisplayStatus) }} | @endif
@if ($canEditSpv)
@endif
@php
$postingDetails = $detailCollection
->filter(fn($d) => ($d->isactive ?? '1') === '1')
->map(function ($d) {
$status = (string) ($d->status ?? '');
$normalizedStatus = strtolower(trim($status));
$isDraftLike = in_array(
$normalizedStatus,
['draft', 'entry', '-', ''],
true,
);
$isHeadRejected =
$status === 'reject' &&
!empty($d->appr_head_by) &&
empty($d->appr_ppic_by);
return [
'id' => (int) $d->id,
'nama_barang' => $d->nama_barang,
'qty' => $d->qty,
'satuan' => $d->satuan_nama,
'status' => $status,
'revisable' => $isDraftLike || $isHeadRejected,
];
})
->values();
@endphp
@php
$canShowPostingButton = $postingDetails->contains(
fn($d) => !empty($d['revisable']),
);
@endphp
@if ($isSpvView && $postingDetails->count() > 0 && $canShowPostingButton)
@endif
@if (!$isSpvView && $canHeaderApprove && $canShowApprovalButtons)
@if (($header->pending_count ?? 0) > 0)
@endif
@endif
|