@extends('layouts/layoutMaster') @section('title', 'Rentals - Equipment Renting System') @section('vendor-style') @vite(['resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-buttons-bs5/buttons.bootstrap5.scss', 'resources/assets/vendor/libs/flatpickr/flatpickr.scss', 'resources/assets/vendor/libs/@form-validation/form-validation.scss', 'resources/assets/vendor/libs/select2/select2.scss']) @endsection @section('vendor-script') @vite(['resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js', 'resources/assets/vendor/libs/moment/moment.js', 'resources/assets/vendor/libs/flatpickr/flatpickr.js', 'resources/assets/vendor/libs/@form-validation/popular.js', 'resources/assets/vendor/libs/@form-validation/bootstrap5.js', 'resources/assets/vendor/libs/@form-validation/auto-focus.js', 'resources/assets/vendor/libs/select2/select2.js']) @endsection @section('page-style') @endsection @section('content')
@foreach ($rentals as $rental) @endforeach
ID Customer Shop Rental Date Expected Return Status Total Amount Action
{{ $loop->iteration + ($rentals->currentPage() - 1) * $rentals->perPage() }}
{{ strtoupper(substr($rental->customer?->name ?? 'N/A', 0, 2)) }}
{{ $rental->customer?->name ?? 'N/A' }} {{ $rental->customer?->phone ?? '' }}
{{ $rental->shop->name ?? 'N/A' }} {{ $rental->invoices->first()->invoice_number ?? '' }} {{ $rental->agreement->agreement_number ?? '' }}
{{ $rental->rental_date->format('Y-m-d H:i') }} {{ $rental->expected_return_date ? $rental->expected_return_date->format('Y-m-d H:i') : 'N/A' }} @php $statusColors = [ 'draft' => 'bg-label-secondary', 'active' => 'bg-label-success', 'returned' => 'bg-label-info', 'cancelled' => 'bg-label-danger', ]; $color = $statusColors[$rental->status] ?? 'bg-label-secondary'; @endphp {{ ucfirst($rental->status) }} {{ number_format($rental->grand_total, 2) }}
New Rental
@csrf
@php $user = auth()->user(); $isAdmin = $user && $user->isAdmin(); $userShopId = $user && !$isAdmin ? $user->shop_id : null; @endphp
@endsection @section('page-script') @endsection