@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
| {{-- Action Column First --}} | Action | No | SAP Code Vendor | {{-- Vendor Information --}}Corporation | Vendor Name | Address 1 | Address 2 | Address 3 | City | {{-- Contact Persons --}}Contact Persons | {{-- Directors --}} {{-- Bank Accounts --}} {{-- Quality Environment --}} {{-- Agreement Document --}} {{-- Note --}}Note | {{-- Status & Approver --}}Status | Status Upload | @if(auth()->user()->idroles == 'msjits')User Pengaju | Waktu Pengajuan | @endif @elseNo | {{-- For other menus, use default header --}} @foreach ($table_header as $header){{ $header->alias }} | @endforeach @endif||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @php $isCheckable = in_array($detail->id, $sapCheckVendorIds ?? []); @endphp | {{-- Action Dropdown Column First --}}@php $isProcessed = in_array($detail->id, $processedVendorIds ?? []) || (!empty($detail->sap_code_vendor) && in_array($detail->sap_code_vendor, $processedVendorCodes ?? [])); @endphp @if($isProcessed) @else @endif | {{ $table_detail->firstItem() + $loop->index }} | {{ $detail->sap_code_vendor ?? '-' }} | {{-- Vendor Information --}}{{ $detail->corp }} | {{ $detail->name }} | {{ $detail->office_address1 }} | {{ $detail->office_address2 ?? '-' }} | {{ $detail->office_address3 ?? '-' }} | {{ $detail->city_name ?? '-' }} | {{-- Contact Persons --}}
@if($contacts->count() > 0)
|
{{-- Directors --}}
{{-- Bank Accounts --}}
{{-- Quality Environment --}}
{{-- Agreement Document --}}
{{-- Note --}}
{{ $detail->note }} | {{-- Status --}}@if($detail->status == 'Pending') Pending @elseif($detail->status == 'Proposed') Proposed @elseif($detail->status == 'Approved') Approved @elseif($detail->status == 'Rejected') Rejected @elseif($detail->status == 'Finish') Finish @endif | {{-- SAP Status --}}@if($detail->sap_status == 'Belum Upload') Belum Upload @elseif($detail->sap_status == 'Proses') Proses @elseif($detail->sap_status == 'Sudah Upload') Sudah Upload @elseif($detail->sap_status == 'Update PPN') Update PPN @elseif($detail->sap_status == 'Update') Update @endif | {{-- User Pengaju & Waktu Pengajuan (role msjits) --}} @if(auth()->user()->idroles == 'msjits') @php $matchedLog = $recentUpdateLogs->first(function($log) use ($detail) { if (!empty($detail->old_code_vendor) && $log->old_code_vendor === $detail->old_code_vendor) return true; if (!empty($detail->sap_code_vendor) && $log->sap_code_vendor === $detail->sap_code_vendor) return true; if (!empty($detail->name) && $log->name === $detail->name) return true; return false; }); $pengajuUpdate = $matchedLog ? ($matchedLog->firstname ?: $matchedLog->username) : '-'; $waktuUpdate = ($matchedLog && !empty($matchedLog->created_at)) ? \Carbon\Carbon::parse($matchedLog->created_at)->format('d/m/Y H:i') : '-'; @endphp{{ $pengajuUpdate }} | {{ $waktuUpdate }} | @endif @else{{ $table_detail->firstItem() + $loop->index }} | {{-- For other menus, use default foreach --}} @foreach ($table_header as $field) @php $string = $field->field; @endphp {{-- Keep existing logic for other menus --}} @if ($field->type == 'enum'){{-- Existing enum logic --}} | @elseif ($field->type == 'file'){{-- Existing file logic --}} | @else{{ $detail->$string }} | @endif @endforeach @endif