@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => 'Wait Approval PR Detail']) @php $bsart = $bsart ?? request('bsart'); $rows = $waitApprovalPrRows ?? []; if (!empty($bsart)) { $rows = collect($rows)->where('BSART', $bsart)->values()->toArray(); } $formatDate = function ($date) { return !empty($date) && $date !== '0000-00-00' ? \Carbon\Carbon::parse($date)->format('d-m-Y') : '-'; }; $dateOrder = function ($date) { return !empty($date) && $date !== '0000-00-00' ? $date : '1900-01-01'; }; $currentBsart = $bsart ?? ''; $bsartList = ['ZR15', 'ZR16', 'ZR17']; @endphp
List Detail Wait Approval PR @if($currentBsart) - {{ $currentBsart }} ({{ getBsartLabel($currentBsart) }}) @endif
{{ $currentBsart ?: 'Pilih Document Type terlebih dahulu' }}
Back
@foreach ($bsartList as $docType) {{ $docType }} @endforeach
@if (empty($currentBsart))
Silakan pilih Document Type terlebih dahulu untuk menampilkan data.
@else
@forelse ($rows as $row) @php $badat = $row['BADAT'] ?? null; $agingDays = (!empty($badat) && $badat !== '0000-00-00') ? abs(\Carbon\Carbon::parse($badat)->startOfDay()->diffInDays(now('Asia/Jakarta')->startOfDay())) : 0; $matnr = trim((string) ($row['MATNR'] ?? '')); @endphp 3) style="background-color:#FFE1E1;" @endif> @empty @endforelse
No Date PR No Item Requestor Remark Code Group Qty Unit Delivery Release Type Aging
{{ $formatDate($row['BADAT'] ?? null) }} {{ $row['BANFN'] ?? '-' }} {{ isset($row['BNFPO']) ? number_format((float) $row['BNFPO'], 0, '', '') : '-' }} {{ $row['AFNAM'] ?? '-' }} {{ $row['TXZ01'] ?? '-' }} {{ $matnr !== '' ? $matnr : '-' }} {{ $row['MATKL'] ?? '-' }} {{ number_format((float) ($row['MENGE'] ?? 0), 2, ',', '.') }} {{ $row['MEINS'] ?? '-' }} {{ $formatDate($row['LFDAT'] ?? null) }} {{ $formatDate($row['FRGDT'] ?? null) }} {{ $row['BSART'] ?? '-' }} {{ number_format($agingDays, 0) }}
- - - - - No data - - - - - - - -
@endif
@endsection @push('js') @endpush