* Dokumen ini digenerate otomatis oleh Sistem Batch Decision PT Multi Spunindo Jaya Tbk. Halaman {PAGENO} dari {nbpg}
{{-- Header Perusahaan & Filter --}}
@php $logoPath = public_path('storage/logo_msj_full.png'); $logoSrc = file_exists($logoPath) ? 'data:image/png;base64,' . base64_encode(file_get_contents($logoPath)) : asset('storage/logo_msj_full.png'); @endphp
PT Multi Spunindo Jaya Tbk
BATCH DECISION - DATABASE SELECTION LIST
Mode Tampilan: {{ $view_mode === 'summary' ? 'Order Summary' : 'Only Batch Data' }} @if(!empty($filters['frproduction_date']) || !empty($filters['toproduction_date'])) | Periode: {{ !empty($filters['frproduction_date']) ? date('d/m/Y', strtotime($filters['frproduction_date'])) : '-' }} s/d {{ !empty($filters['toproduction_date']) ? date('d/m/Y', strtotime($filters['toproduction_date'])) : '-' }} @endif @if(!empty($filters['order_no'])) | No. Order: {{ $filters['order_no'] }} @endif @if(!empty($filters['work_center'])) | Work Center: {{ $filters['work_center'] }} @endif @if(!empty($filters['material'])) | Material: {{ $filters['material'] }} @endif @if(!empty($filters['batch_no'])) | Batch: {{ $filters['batch_no'] }} @endif @if(!empty($filters['sold_to'])) | Sold To: {{ $filters['sold_to'] }} @endif
Tanggal Cetak: {{ date('d/m/Y H:i:s') }} WIB
Dicetak Oleh: {{ $username ?? 'Admin' }}
Total Data: {{ count($rows) }} {{ $view_mode === 'summary' ? 'Order' : 'Batch' }}
@if ($view_mode === 'summary') {{-- ========================================================== --}} {{-- MODE 1: ORDER SUMMARY (19 Kolom Sesuai Web Result) --}} {{-- ========================================================== --}} @forelse ($rows as $index => $row) @php $isRejected = strtoupper(trim((string)$row->keputusan)) === 'DITOLAK'; $rowClass = $isRejected ? 'row-defect' : ($index % 2 === 0 ? 'row-even' : 'row-odd'); $prodDate = !empty($row->production_date) ? date('d/m/Y', strtotime($row->production_date)) : '-'; @endphp @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
{{ $index + 1 }} {{ $prodDate }} {{ $row->order_no ?? '-' }} {{ $row->customer_name ?: ($row->sold_to ?: '-') }} {{ $row->material ?? '-' }} {{ $row->order_qty !== null ? number_format((float)$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((float)$row->sampling, 0, ',', '.') : '-' }} {{ $row->accept_qty !== null ? number_format((float)$row->accept_qty, 0, ',', '.') : '-' }} {{ $row->reject_qty !== null ? number_format((float)$row->reject_qty, 0, ',', '.') : '-' }} {{ number_format((float)$row->qty_produksi, 0, ',', '.') }} {{ number_format((float)$row->grade_ab, 0, ',', '.') }} {{ number_format((float)$row->grade_c, 0, ',', '.') }} {{ number_format((float)$row->grade_d, 0, ',', '.') }} {{ number_format((float)$row->cek_ok, 0, ',', '.') }} {{ number_format((float)$row->cek_not_ok, 0, ',', '.') }} {{ number_format((float)$row->actual_cek, 0, ',', '.') }} @if (in_array(strtoupper(trim((string)$row->keputusan)), ['DITERIMA', 'RELEASE / OK', 'RELEASE', 'OK'])) DITERIMA @elseif (in_array(strtoupper(trim((string)$row->keputusan)), ['DITOLAK', 'HOLD / REVIEW', 'HOLD', 'REJECT'])) DITOLAK @else {{ $row->keputusan ?: 'PENDING' }} @endif
Tidak ada data untuk filter yang dipilih.
@else {{-- ========================================================== --}} {{-- MODE 2: ONLY BATCH DATA (28 Kolom Sesuai Web Result) --}} {{-- ========================================================== --}} @php $batchHeaders = [ 'Order', 'Work Center', 'Sold To', 'Name 1', 'Search_term', 'Order_qty', 'Roll_Unit', 'Level_no', 'Sampling', 'Accept_qty', 'Reject_qty', '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', ]; @endphp @foreach ($batchHeaders as $label) @endforeach @foreach ($dynamic_column_names as $columnName) @endforeach @forelse ($rows as $index => $row) @php $details = $row->dynamic_details ?? []; $chk = strtoupper(trim((string)($row->check_result ?? ''))); $isDefect = in_array($chk, ['NOT OK', 'NOK', 'CEK NOT OK', 'CEK_NOT_OK']) || strtoupper(trim((string)$row->validation_grade)) === 'D'; $rowClass = $isDefect ? 'row-defect' : ($index % 2 === 0 ? 'row-even' : 'row-odd'); $ddtextVal = !empty($row->ddtext) ? $row->ddtext : ($details['DDTEXT'] ?? null); $remarkCell = (!empty($ddtextVal) && !in_array(strtoupper(trim($ddtextVal)), ['QC', 'PRD', 'MKT'], true)) ? $ddtextVal : ((!empty($row->validation_remark) && !in_array(strtoupper(trim($row->validation_remark)), ['QC', 'PRD', 'MKT'], true)) ? $row->validation_remark : '-'); $grade = strtoupper(trim((string)($row->validation_grade ?? ''))); @endphp @foreach ($dynamic_column_names as $columnName) @php $dynamicValue = $details[$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
NO{{ $label }}{{ strtoupper($columnName) }}
{{ $index + 1 }} {{ $row->order_no ?? '-' }} {{ $row->work_center ?? '-' }} {{ $row->sold_to ?? '-' }} {{ $row->name_1 ?? '-' }} {{ $row->search_term ?? '-' }} {{ $row->order_qty !== null ? number_format((float)$row->order_qty, 0, ',', '.') : '-' }} {{ $row->roll_unit !== null ? number_format((float)$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((float)$row->sampling, 0, ',', '.') : '-' }} {{ $row->accept_qty !== null ? number_format((float)$row->accept_qty, 0, ',', '.') : '-' }} {{ $row->reject_qty !== null ? number_format((float)$row->reject_qty, 0, ',', '.') : '-' }} {{ $row->gsm !== null ? number_format((float)$row->gsm, 3, ',', '.') : '-' }} {{ $row->width !== null ? number_format((float)$row->width, 3, ',', '.') : '-' }} {{ $row->length !== null ? number_format((float)$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 ?? '-' }} @if (in_array($grade, ['A', 'B'])) {{ $grade }} @elseif ($grade === 'C') {{ $grade }} @elseif ($grade === 'D') {{ $grade }} @else {{ $row->validation_grade ?: '-' }} @endif {{ $row->defect_classify ?? '-' }} {{ $remarkCell }} {{ $row->validation_condition ?? '-' }} {{ $row->source_roll ?? '-' }} {{ $row->jumbo_roll ?? '-' }} @if (in_array($chk, ['OK', 'CEK OK', 'CEK_OK'])) CEK OK @elseif (in_array($chk, ['NOT OK', 'NOK', 'CEK NOT OK', 'CEK_NOT_OK'])) CEK NOT OK @else No Cek @endif {{ $details['KURZTEXT'] ?? ($details['DDTEXT'] ?? ($details['SHORT_TEXT'] ?? '-')) }}{{ $dynamicText }}
Tidak ada data untuk filter yang dipilih.
@endif