@extends('layouts.app') @section('title', 'Data Penyewaan') @section('page-title', 'Data Penyewaan') @section('sidebar-menu') Dashboard Kelola Mobil Data Penyewaan Profil Saya @endsection @section('content') @if($errors->any())
{{ $errors->first() }}
@endif
@if($penyewaan->isEmpty())

Belum ada data penyewaan.

@else @foreach($penyewaan as $i => $p) @php $mulai = $p->tanggal_sewa; $akhir = $p->tanggal_kembali_aktual ?? $p->tanggal_kembali_rencana; $hari = $mulai && $akhir ? max(1, $mulai->diffInDays($akhir)) : 1; $total = $hari * ($p->jumlah_sewa ?? 1) * ($p->mobil->harga_sewa ?? 0); @endphp @endforeach
# Penyewa Mobil Tanggal Sewa Rencana Kembali Aktual Kembali Qty Sewa Qty Kembali Total Hari Total Biaya Denda Status
{{ $i + 1 }} {{ $p->user->username ?? '-' }} {{ $p->mobil->nama_mobil ?? '-' }} {{ optional($p->tanggal_sewa)->format('d M Y') }} {{ optional($p->tanggal_kembali_rencana)->format('d M Y') }} {{ optional($p->tanggal_kembali_aktual)->format('d M Y') ?? '-' }} {{ $p->jumlah_sewa }} {{ $p->jumlah_kembali ?? 0 }} {{ $hari }} hari Rp {{ number_format($total, 0, ',', '.') }} @if(($p->denda ?? 0) > 0) Rp {{ number_format($p->denda, 0, ',', '.') }} @else - @endif @if($p->status === 'aktif') Aktif @elseif($p->status === 'selesai') Selesai @elseif($p->status === 'terlambat') Terlambat @else {{ ucfirst($p->status) }} @endif
@endif
@endsection @push('scripts') @endpush