@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => 'Outstanding PO Detail']) @php $bsart = $bsart ?? request('bsart'); $type = $type ?? request('type'); $codeRows = $outstandingPoCodeRows ?? []; $nonRows = $outstandingPoNonRows ?? []; $currentBsart = $bsart ?? ''; $bsartList = ['ZR15', 'ZR16', 'ZR17']; $typeQuery = $type ? '&type=' . $type : ''; $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'; }; $renderRows = function ($rows) use ($formatDate, $dateOrder) { $html = ''; foreach ($rows as $i => $row) { $menge = (float) ($row['MENGE'] ?? 0); $qtyGr = (float) ($row['QTY_GR'] ?? 0); $sisa = $menge - $qtyGr; $matnr = !empty($row['MATNR']) ? $row['MATNR'] : '-'; $matnrCell = $matnr !== '-' ? '' . e($matnr) . '' : '-'; $html .= ''; $html .= '' . ($i + 1) . ''; $html .= '' . e($row['BSART'] ?? '-') . ''; $html .= '' . e(!empty($row['LIFNR']) ? substr($row['LIFNR'], 3, 7) : '-') . ''; $html .= '' . e($row['NAME1'] ?? '-') . ''; $html .= '' . e($formatDate($row['BEDAT'] ?? null)) . ''; $html .= '' . e($row['EBELN'] ?? '-') . ''; $html .= '' . (isset($row['EBELP']) ? number_format((float) $row['EBELP'], 0, '', '') : '-') . ''; $html .= '' . e($row['TXZ01'] ?? '-') . ''; $html .= '' . $matnrCell . ''; $html .= '' . number_format($menge, 2, ',', '.') . ''; $html .= '' . number_format($qtyGr, 2, ',', '.') . ''; $html .= '' . number_format($sisa, 2, ',', '.') . ''; $html .= ''; } if (empty($rows)) { $html .= ''; $html .= '-'; $html .= '-'; $html .= '-'; $html .= 'No data'; $html .= '-'; $html .= '-'; $html .= '-'; $html .= '-'; $html .= '-'; $html .= '-'; $html .= '-'; $html .= '-'; $html .= ''; } return $html; }; @endphp
List Detail Outstanding PO @if($currentBsart) - {{ $currentBsart }} ({{ getBsartLabel($currentBsart) }}) @endif
@if($currentBsart) {{ $currentBsart }} @else Pilih Document Type terlebih dahulu @endif
Back
@foreach ($bsartList as $docType) {{ $docType }} @endforeach
@if (empty($currentBsart))
Silakan pilih Document Type terlebih dahulu untuk menampilkan data.
@else @php $tableHead = ' No Type Vendor Code Vendor Name PO Date PO No Item Remark Item Code Qty PO Qty GR Sisa '; @endphp
{!! $tableHead !!} {!! $renderRows($codeRows) !!}
{!! $tableHead !!} {!! $renderRows($nonRows) !!}
@endif
@endsection @push('js') @endpush