@if($this->getViewData()['tenant']) @php $data = $this->getViewData(); $tenant = $data['tenant']; $currentRentals = $data['currentRentals']; $recentInvoices = $data['recentInvoices']; $totalPaid = $data['totalPaid']; $pendingAmount = $data['pendingAmount']; @endphp

Thông tin cá nhân

Họ tên: {{ Auth::user()->name }}
Email: {{ Auth::user()->email }}
Số điện thoại: {{ $tenant->phone ?? 'Chưa cập nhật' }}
CMND/CCCD: {{ $tenant->id_card ?? 'Chưa cập nhật' }}
@if($currentRentals->count() > 0)
Trạng thái: Đang thuê {{ $currentRentals->count() }} phòng
@endif
Địa chỉ: {{ $tenant->address ?? 'Chưa cập nhật' }}
@if($tenant->emergency_contact)
Liên hệ khẩn cấp: {{ $tenant->emergency_contact }}
@endif
@if($currentRentals->count() > 0)

Thông tin thuê phòng ({{ $currentRentals->count() }} phòng)

@foreach($currentRentals as $currentRental)
Nhà trọ
{{ $currentRental->room->motel->name }}
Phòng
{{ $currentRental->room->room_number }}
Tiền cọc
{{ number_format($currentRental->deposit, 0, ',', '.') }} VNĐ
Ngày bắt đầu: {{ $currentRental->start_date->format('d/m/Y') }}
Diện tích: {{ $currentRental->room->area }}m²
@endforeach
@endif

Tổng đã thanh toán

{{ number_format($totalPaid, 0, ',', '.') }} VNĐ

Chưa thanh toán

{{ number_format($pendingAmount, 0, ',', '.') }} VNĐ

@if($recentInvoices->count() > 0)

Hóa đơn gần đây

@foreach($recentInvoices as $invoice)
@if($invoice->status === 'paid') @else @endif
Tháng {{ \Carbon\Carbon::parse($invoice->month)->format('m/Y') }}
@if($invoice->room?->motel) {{ $invoice->room->motel->name }} - Phòng {{ $invoice->room->room_number }} @endif
{{ number_format($invoice->total_amount, 0, ',', '.') }} VNĐ
@if($invoice->status === 'paid') Đã thanh toán @else Chưa thanh toán @endif
@endforeach
@endif @else

Chưa có thông tin người thuê

Vui lòng liên hệ quản trị viên để được cập nhật thông tin.

@endif