@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @push('css') @endpush @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
{{-- Card Header Standar MSJ --}}
Result {{ $title_menu ?? 'Batch Decision' }}
Mode: {{ $view_mode === 'summary' ? 'Order Summary' : 'Only Batch Data' }}
Last Update: {{ date('d F Y, H:i') }}

{{-- Action Buttons (Kembali) --}}
@if ($view_mode !== 'summary')
@endif
{{-- Table Container --}}
@if ($view_mode === 'summary') {{-- ========================================================== --}} {{-- MODE 2: ORDER SUMMARY --}} {{-- ========================================================== --}} @forelse ($summary_data as $index => $row) @empty @endforelse
NO TANGGAL NO. ORDER CUSTOMER MATERIAL QTY ORDER INSP. LEVEL QTY SAMPLING ACCEPT NUMB REJECT NUMB TOTAL PRODUKSI GRADE A/B GRADE C GRADE D CEK OK CEK NOT OK ACTUAL CEK KEPUTUSAN
{{ $summary_data->firstItem() + $loop->index }} {{ $row->production_date ?? '-' }} {{ $row->order_no }} {{ \Illuminate\Support\Str::limit($row->customer_name ?? ($row->sold_to ?? '-'), 22) }} {{ \Illuminate\Support\Str::limit($row->material, 24) ?? '-' }} {{ $row->order_qty !== null ? number_format($row->order_qty, 0, ',', '.') : '-' }} {{ $row->level_no !== null ? (is_numeric($row->level_no) ? (int)$row->level_no : $row->level_no) : '-' }} {{ $row->sampling !== null ? number_format($row->sampling, 0, ',', '.') : '-' }} {{ $row->accept_qty !== null ? number_format($row->accept_qty, 0, ',', '.') : '-' }} {{ $row->reject_qty !== null ? number_format($row->reject_qty, 0, ',', '.') : '-' }} {{ $row->qty_produksi }} {{ $row->grade_ab }} {{ $row->grade_c }} {{ $row->grade_d }} {{ $row->cek_ok }} {{ $row->cek_not_ok }} {{ $row->actual_cek }} @if (in_array(strtoupper($row->keputusan), ['DITERIMA', 'RELEASE / OK', 'RELEASE', 'OK'])) DITERIMA @elseif (in_array(strtoupper($row->keputusan), ['DITOLAK', 'HOLD / REVIEW', 'HOLD', 'REJECT'])) DITOLAK @else {{ $row->keputusan }} @endif
Tidak ada data order summary untuk filter yang dipilih.
@else {{-- ========================================================== --}} {{-- MODE 1: BATCH DATA (Only Batch Data - Sesuai SAP GUI) --}} {{-- ========================================================== --}} @php $dynamicColumnNames = $batch_dynamic_columns ?? []; $batchTableColspan = 28 + count($dynamicColumnNames); @endphp @foreach ($dynamicColumnNames as $columnName) @endforeach @if (false) @forelse ($batch_data as $index => $row) @php $rowCheckResult = $row->check_result ?? null; $is_defect = ($row->isactive == '0' || in_array(strtoupper(trim($rowCheckResult ?? '')), ['NOT OK', 'NOK', 'CEK NOT OK', 'CEK_NOT_OK'])); $checkStatusFilter = in_array(strtoupper(trim($rowCheckResult ?? '')), ['OK', 'CEK OK', 'CEK_OK']) ? 'cek-ok' : (in_array(strtoupper(trim($rowCheckResult ?? '')), ['NOT OK', 'NOK', 'CEK NOT OK', 'CEK_NOT_OK']) ? 'cek-not-ok' : 'no-cek'); $det = $row->dynamic_details ?? []; @endphp {{-- NO --}} {{-- 1. Order --}} {{-- 2. work center --}} {{-- 3. sold to --}} {{-- 4. Name 1 --}} {{-- 5. search_tem --}} {{-- 6. order_qty --}} {{-- 7. roll_unit --}} {{-- 8. Level_no --}} {{-- 9. Sampling --}} {{-- 10. accept_qty --}} {{-- 11. reject_qty --}} {{-- 12. gsm --}} {{-- 13. width --}} {{-- 14. length --}} {{-- 15. weight --}} {{-- 16. Unit --}} {{-- 17. Batch_no --}} {{-- 18. Joint_qty --}} {{-- 18. Material --}} {{-- 19. Validation_grade --}} {{-- 20. Defect_classify --}} {{-- 21. Validation_remark --}} @php $remarkCell = (!empty($row->ddtext) && !in_array(strtoupper(trim($row->ddtext)), ['QC', 'PRD', 'MKT'], true)) ? $row->ddtext : ((!empty($row->validation_remark) && !in_array(strtoupper(trim($row->validation_remark)), ['QC', 'PRD', 'MKT'], true)) ? $row->validation_remark : '-'); @endphp {{-- 22. Validation_condition --}} {{-- 23. Source roll --}} {{-- 24. jumbo roll --}} {{-- 25. CEK_RESULT --}} @foreach ($dynamicColumnNames as $columnName) @php $dynamicValue = $det[$columnName] ?? null; if ($dynamicValue === null || $dynamicValue === '') { $dynamicText = '-'; } elseif (is_array($dynamicValue)) { $dynamicText = json_encode($dynamicValue); } elseif (is_bool($dynamicValue)) { $dynamicText = $dynamicValue ? 'TRUE' : 'FALSE'; } elseif (is_numeric($dynamicValue)) { $dynamicText = number_format((float) $dynamicValue, 3, ',', '.'); } else { $dynamicText = (string) $dynamicValue; } @endphp @endforeach @empty @endforelse @endif
NO Order Work Center Sold To Name 1 Search_term QTY ORDER Roll_Unit INSP. LEVEL QTY SAMPLING ACCEPT NUMB REJECT NUMB Gsm Width Length Weight Unit Batch_no Joint_qty Material Validation_grade Defect_classify Validation_remark Validation_condition Source_roll Jumbo_roll Check_result Short Text{{ strtoupper($columnName) }}
{{ $batch_data->firstItem() + $loop->index }}{{ $row->order_no }}{{ $row->work_center ?? '-' }}{{ $row->sold_to ?? '-' }} {{ \Illuminate\Support\Str::limit($row->name_1 ?? '-', 24) }} {{ $row->search_term ?? '-' }}{{ $row->order_qty !== null ? number_format($row->order_qty, 0, ',', '.') : '-' }}{{ $row->roll_unit !== null ? number_format($row->roll_unit, 3, ',', '.') : '-' }}{{ $row->level_no !== null ? (is_numeric($row->level_no) ? (int)$row->level_no : $row->level_no) : '-' }}{{ $row->sampling !== null ? number_format($row->sampling, 0, ',', '.') : '-' }}{{ $row->accept_qty !== null ? number_format($row->accept_qty, 0, ',', '.') : '-' }}{{ $row->reject_qty !== null ? number_format($row->reject_qty, 0, ',', '.') : '-' }}{{ $row->gsm !== null ? number_format($row->gsm, 3, ',', '.') : '-' }}{{ $row->width !== null ? number_format($row->width, 3, ',', '.') : '-' }}{{ $row->length !== null ? number_format($row->length, 3, ',', '.') : '-' }}{{ ($row->weight ?? $row->quantity) !== null ? number_format((float) ($row->weight ?? $row->quantity), 3, ',', '.') : '-' }}{{ $row->unit ?? 'KG' }}{{ $row->batch_no ?? '-' }}{{ $row->joint_qty ?? 0 }} {{ $row->material ?? '-' }} {{ $row->validation_grade ?? '-' }} {{ $row->defect_classify ?? '-' }} {{ $remarkCell }} {{ $row->validation_condition ?? ($row->validation_condition ?? '-') }} {{ $row->source_roll ?? ($row->source_roll ?? '-') }} {{ $row->jumbo_roll ?? ($row->jumbo_roll ?? '-') }} @if (in_array(strtoupper(trim($rowCheckResult ?? '')), ['OK', 'CEK OK', 'CEK_OK'])) CEK OK @elseif (in_array(strtoupper(trim($rowCheckResult ?? '')), ['NOT OK', 'NOK', 'CEK NOT OK', 'CEK_NOT_OK'])) CEK NOT OK @else No Cek @endif {{ $det['KURZTEXT'] ?? ($det['DDTEXT'] ?? ($det['SHORT_TEXT'] ?? '-')) }} {{ $dynamicText }}
Tidak ada data batch yang sesuai dengan kriteria filter.
@endif
{{-- Footer Note & Pagination Standar MSJ --}}
Note : ( Data not active / Defect )
@if ($view_mode === 'summary') {{ $summary_data->appends(request()->except('page'))->links('pagination::bootstrap-5') }} @else {{-- Pagination and search are handled by DataTables server-side. --}} @endif
@php $dataTableFilters = collect($filter_params ?? [])->except(['_token', 'page', 'check_filter', 'batch_search', 'draw', 'start', 'length', 'search', 'order', 'columns'])->all(); $dataTableDynamicColumns = $batch_dynamic_columns ?? []; @endphp @endsection