@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
Result {{ $title_menu }}
@if (is_array($table_result) && count($table_result) > 0) {{ count($table_result) }} PS @endif

@if ($authorize->excel == '1') @endif @if ($authorize->pdf == '1') @endif @if ($authorize->print == '1') @endif

@forelse ($collapse_header as $idPs) @php $psRows = $details[$idPs] ?? []; $psChangeCount = 0; foreach ($psRows as $matRows) { $psChangeCount += count($matRows); } $customerName = $ps_customer[$idPs] ?? '-'; $psMatCount = count($psRows); @endphp
NO PS : {{ $idPs }} Customer : {{ $customerName }} {{ $psChangeCount }} perubahan {{ $psMatCount }} material
@foreach ($psRows as $matCode => $matRows)
Material: {{ $matCode }} {{ count($matRows) }} field
@foreach ($matRows as $rowIndex => $row) @php $oldVal = $row->old_value ?? '-'; $newVal = $row->new_value ?? '-'; $isChanged = $oldVal !== $newVal && $oldVal !== null && $newVal !== null && $oldVal !== '-' && $newVal !== '-'; $isNumericOld = is_numeric(str_replace([',', '.', '-', '+'], '', $oldVal)) && $oldVal !== '-'; $isNumericNew = is_numeric(str_replace([',', '.', '-', '+'], '', $newVal)) && $newVal !== '-'; $oldNum = $isNumericOld ? floatval(str_replace([',', '-', '+'], '', $oldVal)) : null; $newNum = $isNumericNew ? floatval(str_replace([',', '-', '+'], '', $newVal)) : null; $compareNum = $oldNum !== null && $newNum !== null; $oldClass = $compareNum ? ($newNum > $oldNum ? '' : 'diff-old') : ($isChanged ? 'diff-old' : ''); $newClass = $compareNum ? ($newNum > $oldNum ? 'diff-new' : '') : ($isChanged ? 'diff-new' : ''); @endphp @endforeach
No Tanggal Perubahan ID Sample Field yang Berubah Nilai Pengajuan Sample (Website) Nilai Actual (SAP) Diubah Oleh
{{ $rowIndex + 1 }} {{ !empty($row->changed_at) ? \Carbon\Carbon::parse($row->changed_at)->format('d-m-Y H:i') : '-' }} {{ $row->id_sample ?? '-' }} {{ $row->field_name }} {{ $oldVal }} @if($isChanged) @if($compareNum) @if($newNum > $oldNum) {{ $newVal }} @elseif($newNum < $oldNum) {{ $newVal }} @else {{ $newVal }} @endif @else {{ $newVal }} @endif @else {{ $newVal }} @endif {{ $row->changed_by ?? 'system' }}
@endforeach
@empty
Tidak ada data history perubahan untuk filter yang dipilih.
@endforelse
@csrf @foreach ($filterParams ?? [] as $k => $v) @endforeach
@if ($table_result instanceof \Illuminate\Pagination\LengthAwarePaginator) Menampilkan {{ $table_result->firstItem() ?? 0 }} - {{ $table_result->lastItem() ?? 0 }} dari {{ $table_result->total() }} PS @endif
@if ($table_result instanceof \Illuminate\Pagination\LengthAwarePaginator) {{ $table_result->links('pagination::bootstrap-5') }} @endif
@if (is_array($table_result) && count($table_result) > 0) @else @endif
@push('js') @endpush @endsection