@extends('layouts.adminlte') @section('title', 'LEGACY PAYROLL SYNC') @section('page_title', 'LEGACY PAYROLL SYNC') @php $feedback = $feedback ?? session('legacy_sync_feedback'); $selectedBatch = $selectedBatch ?? null; $selectedRows = $selectedRows ?? collect(); $componentMaps = $componentMaps ?? collect(); $reviewResult = $reviewResult ?? null; $reviewRows = collect(($reviewResult['rows'] ?? [])); $reviewStats = is_array($reviewResult['stats'] ?? null) ? $reviewResult['stats'] : []; @endphp @push('styles') @endpush @section('content')
@if ($errors->any())
Input belum valid.
@endif @if (is_array($feedback))
{{ $feedback['message'] ?? 'Proses selesai.' }}
@if (!empty($feedback['stats']) && is_array($feedback['stats']))
@foreach ($feedback['stats'] as $key => $value) {{ str_replace('_', ' ', ucfirst((string) $key)) }}: {{ $value }} @endforeach
@endif @if (!empty($feedback['errors']) && is_array($feedback['errors']))
Contoh error:
    @foreach (collect($feedback['errors'])->take(5) as $errorRow)
  • {{ is_array($errorRow) ? ($errorRow['message'] ?? json_encode($errorRow)) : $errorRow }}
  • @endforeach
@endif
@endif
Source
{{ $sourceSystem }}
Batch Tersimpan
{{ $batches->count() }}
Mapping Aktif
{{ $componentMaps->count() }}
Batch Terpilih
{{ $selectedBatch?->id ?? '-' }}

Import Payroll Legacy

@csrf
Kalau file diisi, kolom JSON boleh dikosongkan.

Default Mapping

@csrf
[ { "employee_code": "10022", "period_start": "2026-05-01", "period_end": "2026-05-31", "pay_date": "2026-06-05", "gaji_pokok": 5000000, "upah_lembur_rate": 35000, "insentif": 250000, "gross": 5600000, "bpjs": 150000, "pph21": 50000, "net": 5400000 } ]
Seed ini menghubungkan kode legacy bawaan seperti GAPOK, UPAH_LEMBUR, dan INSENTIF ke master komponen aktif yang paling mirip.

Batch Payroll Legacy Terbaru

@forelse ($batches as $batch) @empty @endforelse
ID Periode Status Rows Source Creator Actions
#{{ $batch->id }}
{{ $batch->period_key ?: '-' }}
{{ optional($batch->period_start)->format('d M Y') ?: '-' }} s/d {{ optional($batch->period_end)->format('d M Y') ?: '-' }}
@php $status = (string) ($batch->status ?? 'draft'); $statusClass = str_contains($status, 'error') || str_contains($status, 'failed') ? 'is-bad' : (str_contains($status, 'validated') || str_contains($status, 'imported') ? 'is-good' : 'is-neutral'); @endphp {{ strtoupper($status) }}
Total: {{ $batch->total_rows }}
Valid: {{ $batch->validated_rows }} | Sukses: {{ $batch->success_rows }} | Gagal: {{ $batch->failed_rows }}
{{ $batch->source_system }}
{{ $batch->file_name ?: ($batch->source_ref ?: '-') }}
{{ $batch->creator->name ?? '-' }}
Lihat
@csrf
@csrf
@csrf
@csrf
Belum ada batch legacy payroll.

Preview Row Batch {{ $selectedBatch?->id ? '#' . $selectedBatch->id : '' }}

@forelse ($selectedRows as $row) @empty @endforelse
Employee Period Status Nominal Message
{{ $row->employee_name ?: '-' }}
{{ $row->employee_code ?: '-' }} / {{ $row->finger_id ?: '-' }}
{{ optional($row->period_start)->format('d M Y') ?: '-' }}
{{ optional($row->period_end)->format('d M Y') ?: '-' }}
@php $rowStatus = (string) ($row->sync_status ?? 'draft'); $rowClass = str_contains($rowStatus, 'failed') ? 'is-bad' : ($rowStatus === 'validated' || $rowStatus === 'applied' ? 'is-good' : 'is-neutral'); @endphp {{ strtoupper($rowStatus) }}
Gross: {{ number_format((float) ($row->gross_nominal ?? 0), 2, ',', '.') }}
Net: {{ number_format((float) ($row->net_nominal ?? 0), 2, ',', '.') }}
{{ $row->sync_message ?: '-' }} @if ($row->components->isNotEmpty())
@foreach ($row->components->take(3) as $component)
{{ $component->legacy_code }}: {{ $component->mapping_status ?: 'draft' }} @if ($component->target_payment_field) -> {{ $component->target_payment_field }} @endif
@endforeach
@endif
Pilih batch untuk melihat preview row.

Mapping Komponen Aktif

@forelse ($componentMaps as $map) @empty @endforelse
Legacy Group Target
{{ $map->legacy_code }}
{{ $map->legacy_name ?: '-' }}
{{ $map->component_group }} @if ($map->target_component_id) {{ $map->target_payment_field ?: 'mapped' }} @else belum ditemukan @endif
{{ $map->notes ?: '-' }}
Belum ada mapping. Jalankan seed default maps.
@if ($selectedBatch)

Review Sinkron Profil Bulan Batch #{{ $selectedBatch->id }}

Menampilkan komponen legacy yang berbeda dengan assignment + override dinamis di profil bulan.
Row beda: {{ $reviewStats['different_rows'] ?? 0 }} Komponen beda: {{ $reviewStats['different_components'] ?? 0 }} Override baru: {{ $reviewStats['new_components'] ?? 0 }}
@forelse ($reviewRows as $review) @empty @endforelse
Employee Assignment Status Selisih Komponen Aksi
{{ $review['employee_name'] ?: '-' }}
{{ $review['employee_code'] ?: '-' }}
@if (!empty($review['profil_bulan_karyawan_id'])) Assignment #{{ $review['profil_bulan_karyawan_id'] }} @else Belum ada assignment @endif @if (!empty($review['missing_assignment'])) Missing Assignment @elseif (!empty($review['has_diff'])) Perlu Sync @else Sudah Sama @endif @if (!empty($review['diff_items']) && is_array($review['diff_items'])) @foreach (collect($review['diff_items'])->take(6) as $item)
{{ $item['legacy_code'] ?: '-' }} -> {{ $item['target_code'] ?: ('ID ' . ($item['target_component_id'] ?? '-')) }}
Legacy {{ number_format((float) ($item['legacy_amount'] ?? 0), 2, ',', '.') }} | Existing {{ $item['current_amount'] !== null ? number_format((float) $item['current_amount'], 2, ',', '.') : '-' }} @if (!empty($item['missing_in_assignment'])) | assignment belum punya @endif @if (!empty($item['missing_override'])) | override belum ada @endif
@endforeach @else Tidak ada selisih komponen. @endif
@if (!empty($review['has_diff']) && empty($review['missing_assignment']))
@csrf
@else - @endif
Belum ada hasil review untuk batch ini.
@endif
@endsection