@foreach($config['columns'] as $label => $column)
@php $value = property_exists($record, $column) ? $record->{$column} : '—'; @endphp
@if($column === 'status' && $value !== '—')
{{ str_replace('_', ' ', $value) }}
@elseif(is_numeric($value) && str_contains(strtolower($label), 'total') || str_contains(strtolower($label), 'amount') || str_contains(strtolower($label), 'balance') || str_contains(strtolower($label), 'price') || str_contains(strtolower($label), 'tax'))
{{ is_numeric($value) ? number_format((float) $value, 2) : $value }}
@else
{{ $value ?? '—' }}
@endif
@if(! empty($config['subNav']) && \Illuminate\Support\Facades\Route::has('chart-of-accounts.main-accounts.sub-accounts.index'))
Sub Accounts →
@endif
@if(! empty($config['documentActions']) && property_exists($record, 'id'))
@if(\Illuminate\Support\Facades\Route::has('documents.pdf') && ($config['table'] ?? '') === 'document_headers')
View
@elseif(\Illuminate\Support\Facades\Route::has('supplier.documents.pdf') && ($config['table'] ?? '') === 'supplier_document_headers')
View
@else
View
@endif
@if(($record->status ?? null) === 'draft' && \Illuminate\Support\Facades\Route::has('documents.process') && ($config['table'] ?? '') === 'document_headers')
Process
@endif
@if(\Illuminate\Support\Facades\Route::has('documents.download-pdf') && ($config['table'] ?? '') === 'document_headers')
PDF
@endif
@if(($config['key'] ?? '') === 'quotations' && ($record->status ?? '') !== 'cancelled' && ($record->status ?? '') !== 'converted')
→ Invoice
→ Sales Order
@endif
@if(($config['key'] ?? '') === 'sales-orders' && ($record->status ?? '') !== 'cancelled' && ($record->status ?? '') !== 'converted')
→ Invoice
@endif
@if(($config['key'] ?? '') === 'credit-notes' && ($record->status ?? '') !== 'cancelled' && empty($record->parent_document_id))
Apply Credit
@endif
@if(($config['key'] ?? '') === 'purchase-orders' && ($record->status ?? '') !== 'cancelled' && ($record->status ?? '') !== 'converted')
→ GRV
→ Invoice
@endif
@if(($config['key'] ?? '') === 'grvs' && ($record->status ?? '') !== 'cancelled' && ($record->status ?? '') !== 'converted')
→ Invoice
@endif
@if(($config['key'] ?? '') === 'supplier-credit-notes' && ($record->status ?? '') !== 'cancelled' && empty($record->parent_document_id))
Apply Credit
@endif
@else
View
@if($config['createUrl'])
Edit
@endif
@if(($config['key'] ?? '') === 'receipts' && ($record->status ?? '') !== 'cancelled' && empty($record->invoice_id))
Link Invoice
@endif
@if(property_exists($record, 'id'))
@endif
@endif