@extends('layouts.master') @section('title', $config['entity'] . ' — Index') @section('content') @include('partials.qi-styles') @php $gridColumns = 'repeat(' . (count($config['columns']) + 1) . ', minmax(120px, 1fr))'; @endphp

{{ $config['entity'] }}

{{ $config['description'] }}

{{ $records->total() }}
Records
@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@foreach($errors->all() as $e)
{{ $e }}
@endforeach
@endif
← Back
@if($config['createUrl']) + Add {{ $config['entity'] }} @endif
@foreach($config['filters'] as $filter)
@if(($filter['type'] ?? 'text') === 'select') @else @endif
@endforeach
Reset
@foreach($config['columns'] as $label => $column)
{{ $label }}
@endforeach
Actions
@forelse($records as $record)
@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
@endforeach
@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'))
@csrf @method('DELETE')
@endif @endif
@empty
No records found.
@endforelse
{{ $records->withQueryString()->links() }}
@endsection