{{-- Transaction Info Partial - Optimized with date helpers --}} @php // Keep Carbon instances for calculations and formatted strings for display $registrationCarbon = $invoice->date ? \Carbon\Carbon::parse($invoice->date) : null; $dueCarbon = $invoice->due_date ? \Carbon\Carbon::parse($invoice->due_date) : null; $registrationDate = $registrationCarbon ? $registrationCarbon->format('d/m/Y') : 'N/A'; $dueDate = $dueCarbon ? $dueCarbon->format('d/m/Y') : 'N/A'; $totalAmount = number_format($invoice->total ?? 0, 0, ',', '.'); $isExpired = $invoice->status == 1; // Precompute days remaining (use 'N/A' when dates are missing) $daysRemaining = $dueCarbon && $registrationCarbon ? $dueCarbon->diffInDays($registrationCarbon) : 'N/A'; @endphp

{{ __('Thông tin giao dịch') }}

{{-- Order Number --}}
{{ __('Mã đơn hàng') }} {{ $invoice->order_num }}
{{-- Registration Date --}}
{{ __('Ngày đăng ký') }} {{ $registrationDate }}
{{-- Initial Payment --}}
{{ __('Thanh toán lần đầu') }} {{ $totalAmount }} đ
{{-- Recurring Payment Amount --}}
{{ __('Số tiền thanh toán định kỳ') }} {{ $totalAmount }} đ
{{-- Service Status --}}
{{ __('Hạn sử dụng') }} @if ($isExpired) {{ __('Hết hạn') }} @else {{ __('Hoạt động') }} @endif
{{-- Expiry Date --}}
{{ __('Ngày hết hạn') }} {{ $dueDate }}
{{ __('Số ngày còn lại') }} {{ $daysRemaining }} Ngày
{{-- Auto Renewal Status --}}
{{ __('Trạng thái gia hạn tự động') }} OFF