@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
@csrf @method('PUT') {{-- Card Ext Memo --}}

Edit {{ $title_menu }}


@php $dateValue = old('date', $list->date ?? ''); // Convert Y-m-d to d-m-Y for display if ($dateValue) { $dateValueFormatted = date('d-m-Y', strtotime($dateValue)); } else { $dateValueFormatted = date('d-m-Y'); } @endphp @error('date')

{{ $message }}

@enderror
@error('memo_no')

{{ $message }}

@enderror
@php $supplierNameValue = old('supplier_name', ''); if (empty($supplierNameValue) && isset($list) && $list->id_supplier) { $selectedSupplier = $suppliers->firstWhere( 'id', $list->id_supplier, ); if ($selectedSupplier) { $supplierNameValue = $selectedSupplier->to; } } @endphp
@error('id_supplier')

{{ $message }}

@enderror
@error('subject')

{{ $message }}

@enderror
@error('from')

{{ $message }}

@enderror
@php $actionOptions = [ 'Urgent', 'For Review', 'Please Comment', 'Please Reply', 'Please Recycle', ]; $selectedActions = old('actions'); if (!$selectedActions && $list->actions) { $selectedActions = is_string($list->actions) ? json_decode($list->actions, true) : $list->actions; if (!is_array($selectedActions)) { $selectedActions = []; } } else { $selectedActions = $selectedActions ?: []; } @endphp
@foreach ($actionOptions as $action)
@endforeach
@error('actions')

{{ $message }}

@enderror @error('actions.*')

{{ $message }}

@enderror
{{-- Card External Memo Details --}}

External Memo Details


@php $existingDetails = old('details'); if (!$existingDetails && $details) { if (is_object($details) && method_exists($details, 'map')) { $existingDetails = $details ->map(function ($item) { return [ 'request_no' => $item->request_no ?? ($item['request_no'] ?? ''), ]; }) ->toArray(); } elseif (is_array($details)) { $existingDetails = array_map(function ($item) { return [ 'request_no' => is_object($item) ? $item->request_no : $item['request_no'] ?? '', ]; }, $details); } } @endphp @if ($existingDetails && count($existingDetails) > 0) @foreach ($existingDetails as $index => $detail) @php $selectedRequestNo = $detail['request_no'] ?? ''; $selectedRequestInq = $request_inqs->firstWhere( 'request_no', $selectedRequestNo, ); @endphp @endforeach @endif
No Request No * Action
{{ $index + 1 }}
@endsection @push('js') @endpush