@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
List {{ $title_menu }}
@include('components.alert')

@foreach ($table_detail as $index => $item) @php $actions = $item->actions ? (is_string($item->actions) ? json_decode($item->actions, true) : $item->actions) : []; $actions = is_array($actions) ? $actions : []; $details = DB::table('external_memo_details') ->leftJoin( 'request_inq', 'external_memo_details.request_no', '=', 'request_inq.request_no', ) ->where('external_memo_details.external_memo_id', $item->id) ->select( 'external_memo_details.request_no', 'request_inq.customer_color_code', 'request_inq.basic_weight', ) ->get() ->map(function ($detail) { return [ 'request_no' => $detail->request_no, 'customer_color_code' => $detail->customer_color_code ?? '-', 'basic_weight' => $detail->basic_weight ?? '-', ]; }) ->toArray(); @endphp @endforeach
No Date Memo No Supplier Status Action
{{ $index + 1 }} {{ date('d/m/Y', strtotime($item->date)) }} {{ $item->memo_no }} {{ $item->supplier_name ?? '-' }} @php $status = $item->status ?? 'entry'; $statusLabels = [ 'entry' => 'Entry', 'sent' => 'Sent', 'received' => 'Received', 'completed' => 'Completed', 'underreview' => 'Under Review', ]; $statusColors = [ 'entry' => 'secondary', 'sent' => 'info', 'received' => 'warning', 'completed' => 'success', 'underreview' => 'primary', ]; $label = $statusLabels[$status] ?? ucfirst($status); $color = $statusColors[$status] ?? 'secondary'; @endphp {{ $label }} @php $status = $item->status ?? 'entry'; $isEditDisabled = $status !== 'entry'; $canDelete = $status === 'entry'; @endphp
{{-- Preview --}} {{-- Edit: bentuk selalu sama, hanya disable kalau bukan entry --}} @if ($authorize->edit == '1') @endif {{-- Delete: bentuk selalu sama, submit form hidden kalau boleh delete --}} @if ($authorize->delete == '1') @if ($canDelete) @endif @endif
@endsection @push('js') @endpush