@extends('layouts.app') @section('title', 'Riwayat Sewa - Admin INUFA') @section('header', 'Manajemen Riwayat Sewa') @section('content')
@if(count($sewas) > 0)
@foreach($sewas as $index => $sewa) @php $user = optional($sewa->user); $paket = optional($sewa->paket); $sisaPembayaran = $sewa->total_harga - ($sewa->nominal_pembayaran ?? 0); @endphp @endforeach
No Tanggal Customer Paket Total Harga Nominal Pembayaran Sisa Pembayaran Status Aksi
{{ $index + 1 }} {{ $sewa->created_at->format('d/m/Y') }}

{{ $user->name ?? '-' }}

{{ $user->email ?? '-' }}

{{ $paket->nama_paket ?? '-' }} Rp {{ number_format($sewa->total_harga, 0, ',', '.') }} Rp {{ number_format($sewa->nominal_pembayaran ?? 0, 0, ',', '.') }} @if($sisaPembayaran > 0) Rp {{ number_format($sisaPembayaran, 0, ',', '.') }} @else Lunas @endif {{ ucfirst($sewa->status) }}
Detail Chat @if($sewa->status === 'confirmed')
@csrf @method('PUT')
@endif @if(!in_array($sewa->status, ['completed', 'dibatalkan']))
@csrf @method('PUT')
@endif
@else

Belum ada riwayat pemesanan

@endif
@endsection