@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) {{-- section content --}} @section('content') @include('layouts.navbars.auth.topnav', ['title' => ''])
Sync Status - {{ $title_menu }}

{{-- Display session messages (success, warning, error) --}} @if(session('message'))
@php $alertClass = session('class', 'info'); $icon = match($alertClass) { 'success' => 'check-circle', 'warning' => 'exclamation-triangle', 'danger' => 'times-circle', default => 'info-circle' }; @endphp
@endif {{-- Sync Progress Card --}}
@php $reportTypeLabels = [ 'ZVBILLING' => 'ZVBILLING - Billing Data', 'ZFFINANCE_YIELD' => 'ZFFINANCE_YIELD_ACCOUNTING', 'Z_GET_NEW_CUST' => 'Z_GET_NEW_CUST - Customer Master', 'Z_GET_PAYMENT' => 'Z_GET_PAYMENT - Payment Data', 'Z_GET_ONHAND' => 'ZFM_RF_GET_ONHAND - Sales On Hand' ]; @endphp {{ $reportTypeLabels[$sync_status->report_type] ?? $sync_status->report_type }}
Tahun: {{ $sync_status->sync_year }}
{{ strtoupper($sync_status->status) }}
{{-- Progress Bar --}} @if($sync_status->status === 'processing' || $sync_status->status === 'completed') @php $progress = $sync_status->total_records > 0 ? round(($sync_status->processed_records / $sync_status->total_records) * 100, 1) : 0; @endphp
Progress {{ $progress }}% ({{ number_format($sync_status->processed_records) }} / {{ number_format($sync_status->total_records) }} records)
{{ $progress }}%
@endif {{-- Stats --}}
Total Records

{{ number_format($sync_status->total_records) }}

{{-- Time Info --}}
Dimulai:

{{ $sync_status->started_at ? date('d-m-Y H:i:s', strtotime($sync_status->started_at)) : '-' }}

Selesai:

{{ $sync_status->completed_at ? date('d-m-Y H:i:s', strtotime($sync_status->completed_at)) : '-' }}

Requested By:

{{ $sync_status->requested_by ?? '-' }}

{{-- Error Message --}} @if($sync_status->error_message)
Error: {{ $sync_status->error_message }}
@endif
{{-- Action Buttons --}}
Kembali ke Filter @if($sync_status->status === 'completed') View Data @endif @if($sync_status->status === 'failed')
@csrf
@endif Lihat Semua Sync
{{-- Data Preview (if completed) --}} @if($sync_status->status === 'completed' && !empty($table_result))
Data Preview ({{ count($table_result) }} records)
@if($sync_status->report_type === 'Z_GET_ONHAND') @foreach (array_slice($table_result, 0, 10) as $index => $row) @endforeach
No Document Number Customer Code Delivery Date Quantity Fiscal Year Fiscal Month
{{ $index + 1 }} {{ $row->DOCUMENTNUMBER }} {{ $row->CUSTOMERCODE }} {{ $row->DELIVERYDATE ? date('d-m-Y', strtotime($row->DELIVERYDATE)) : '-' }} {{ $row->QUANTITY !== null ? number_format($row->QUANTITY, 3) : '-' }} {{ $row->FISCALYEAR }} {{ $row->FISCALMONTH }}
@else @foreach (array_slice($table_result, 0, 10) as $index => $row) @endforeach
No Billing Doc Item Billing Date Material Description Bill Qty Net Value Sold To Status
{{ $index + 1 }} {{ $row->BILLDOC }} {{ $row->ITMNO }} {{ $row->BILLDATE ? date('d-m-Y', strtotime($row->BILLDATE)) : '-' }} {{ $row->MATNR }} {{ $row->ITEMD }} {{ $row->BILLQTY ? number_format($row->BILLQTY, 4) : '-' }} {{ $row->NETVAL ? number_format($row->NETVAL, 2) : '-' }} {{ $row->SOLDTO }} @if ($row->STATUS) {{ $row->STATUS }} @else - @endif
@endif
@if(count($table_result) > 10)

Menampilkan 10 dari {{ count($table_result) }} records. Lihat semua data

@endif
@endif
{{-- Auto-refresh for pending/processing status --}} @if($sync_status->status === 'pending' || $sync_status->status === 'processing') @push('js') @endpush @endif @push('css') @endpush @push('js') @endpush @endsection