@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
| @endif {{-- Action Column First --}} | Action | No | @if($showSapColumn)SAP Code Vendor | @endif {{-- Vendor Information --}}Corporation | Vendor Name | {{-- Note --}}Note | Address 1 | City | {{-- Contact Persons --}}Contact Persons | {{-- Directors --}} {{-- Bank Accounts --}} {{-- Quality Environment --}} {{-- Agreement Document --}} {{-- 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||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @endif {{-- Action Dropdown Column First --}} |
@endif
{{-- check authorize delete and data primary key not "msjit" --}}
@if ($authorize->delete == '1' && $primary != 'msjit')
{{-- ===== TAMBAHAN: Cek status untuk disable delete button ===== --}}
@php
$canDelete = !(
in_array($detail->status, ['Proposed', 'Approved']) &&
in_array($detail->sap_status, ['Belum Upload', 'Proses', 'Update PPN', 'Update'])
);
@endphp
@if($canDelete)
@else
|
{{ $table_detail->firstItem() + $loop->index }} | @if($showSapColumn){{ $detail->sap_code_vendor ?? '-' }} | @endif {{-- Vendor Information --}}{{ $detail->corp }} | {{ $detail->name }} | {{-- Note --}}{{ $detail->note }} | {{ $detail->office_address1 }} | {{ $detail->city_name ?? '-' }} | {{-- Contact Persons --}}
@if($contacts->count() > 0)
|
{{-- Directors --}}
{{-- Bank Accounts --}}
{{-- Quality Environment --}}
{{-- Agreement Document --}}
{{-- 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 $pengajuFirstname = !empty($detail->proposed_by) ? DB::table('users')->where('username', $detail->proposed_by)->value('firstname') : null; $waktuPengajuan = !empty($detail->approved_at) ? \Carbon\Carbon::parse($detail->approved_at)->format('d/m/Y H:i') : '-'; @endphp{{ $pengajuFirstname ?: ($detail->proposed_by ?: '-') }} | {{ $waktuPengajuan }} | @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