@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100'])
@section('content')
@include('layouts.navbars.auth.topnav', ['title' => 'Wait Approval PO Purchasing Detail'])
@php
$bsart = $bsart ?? request('bsart');
$type = $type ?? request('type');
$codeRows = $waitApprovalPoCodeRows ?? [];
$nonRows = $waitApprovalPoNonRows ?? [];
$currentBsart = $bsart ?? '';
$bsartList = ['ZR15', 'ZR16', 'ZR17'];
$typeQuery = $type ? '&type=' . $type : '';
$renderRows = function ($rows) {
$html = '';
foreach ($rows as $i => $row) {
$matnr = trim((string) ($row['MATNR'] ?? ''));
$matnrClass = $matnr !== '' ? 'item-code-link matnr-cell' : '';
$html .= '
';
$html .= '| ' . ($i + 1) . ' | ';
$html .= '' . e($row['BSART'] ?? '-') . ' | ';
$html .= '' . e(!empty($row['LIFNR']) ? substr($row['LIFNR'], 3, 7) : '-') . ' | ';
$html .= '' . e($row['NAME1'] ?? '-') . ' | ';
$html .= '' . e($row['EBELN'] ?? '-') . ' | ';
$html .= '' . (isset($row['EBELP']) ? number_format((float) $row['EBELP'], 0, '', '') : '-') . ' | ';
$html .= '' . e($row['TXZ01'] ?? '-') . ' | ';
$html .= '' . e($matnr !== '' ? $matnr : '-') . ' | ';
$html .= '' . number_format((float) ($row['MENGE'] ?? 0), 2, ',', '.') . ' | ';
$html .= '' . e($row['MEINS'] ?? '-') . ' | ';
$html .= '' . e($row['BANFN'] ?? '-') . ' | ';
$html .= '' . e($row['AFNAM'] ?? '-') . ' | ';
$html .= '' . e($row['WAERS'] ?? '-') . ' | ';
$html .= '' . number_format((float) ($row['WKURS'] ?? 0), 5, ',', '.') . ' | ';
$html .= '' . number_format((float) ($row['NETPR'] ?? 0), 2, ',', '.') . ' | ';
$html .= '' . e($row['PEINH'] ?? '-') . ' | ';
$html .= '' . number_format((float) ($row['NETWR'] ?? 0), 2, ',', '.') . ' | ';
$html .= '
';
}
if (empty($rows)) {
$html .= '