@extends('layouts.app') @section('content')

Preview TikTok Shop Import

Review the data before importing

@php $summary = $result['summary']; @endphp
Total Transactions
{{ number_format($result['parsed']) }}
{{ $summary['total_orders'] }} orders, {{ $summary['total_refunds'] }} refunds
Gross Revenue
RM {{ number_format($summary['total_revenue'], 2) }}
Avg: RM {{ number_format($summary['avg_order_value'], 2) }}
TikTok Fees
RM {{ number_format(abs($summary['total_fees']), 2) }}
@php $feePercentage = $summary['total_revenue'] > 0 ? (abs($summary['total_fees']) / $summary['total_revenue']) * 100 : 0; @endphp
{{ number_format($feePercentage, 1) }}% of revenue
Net Settlement
RM {{ number_format($summary['total_settlement'], 2) }}
After all fees
Date Range
{{ \Carbon\Carbon::parse($summary['date_range']['from'])->format('M d, Y') }} → {{ \Carbon\Carbon::parse($summary['date_range']['to'])->format('M d, Y') }}
@php $daysDiff = \Carbon\Carbon::parse($summary['date_range']['from'])->diffInDays(\Carbon\Carbon::parse($summary['date_range']['to'])) + 1; @endphp
{{ $daysDiff }} days of data
Ready to Import
{{ number_format($result['parsed']) }} new transactions
@if($result['skipped'] > 0)
{{ $result['skipped'] }} rows skipped (duplicates or errors)
@else
No duplicates found
@endif

Sample Data (First 10 transactions)

@foreach(array_slice($result['transactions'], 0, 10) as $transaction) @endforeach
Date Type Revenue Fees Net
{{ \Carbon\Carbon::parse($transaction['order_date'])->format('Y-m-d') }} @if($transaction['type'] === 'Order') Order @elseif($transaction['type'] === 'Refund') Refund @else {{ $transaction['type'] }} @endif RM {{ number_format($transaction['total_revenue'], 2) }} RM {{ number_format(abs($transaction['total_fees']), 2) }} RM {{ number_format($transaction['net_settlement'], 2) }}
@if(count($result['transactions']) > 10)

Showing 10 of {{ number_format(count($result['transactions'])) }} transactions

@endif
@if(!empty($result['errors']) && count($result['errors']) > 0)

Skipped Rows

@foreach(array_slice($result['errors'], 0, 10) as $error)
• {{ $error }}
@endforeach @if(count($result['errors']) > 10)
... and {{ count($result['errors']) - 10 }} more
@endif
@endif
@csrf
Cancel
Note: Duplicate orders (same Order ID) will be automatically skipped. Your existing data is safe.
@endsection