@extends('layouts/layoutMaster') @section('title', 'Rental Agreement Preview - Equipment Renting System') @section('vendor-style') @vite('resources/assets/vendor/libs/flatpickr/flatpickr.scss') @endsection @section('page-style') @vite('resources/assets/vendor/scss/pages/app-invoice.scss') @endsection @section('vendor-script') @vite(['resources/assets/vendor/libs/moment/moment.js', 'resources/assets/vendor/libs/flatpickr/flatpickr.js']) @endsection @section('page-script') @endsection @section('content')

{{ $agreement->rental->shop->name ?? 'Equipment Renting System' }}

{{ $agreement->rental->shop->address ?? 'N/A' }}

{{ $agreement->rental->shop->phone ?? 'N/A' }}

Rental Agreement #{{ $agreement->agreement_number }}
Date Issued: {{ $agreement->issued_at->format('F d, Y') }}
@if ($agreement->rental->expected_return_date)
Expected Return: {{ $agreement->rental->expected_return_date->format('F d, Y') }}
@endif @if ($agreement->signed_at)
Signed Date: {{ $agreement->signed_at->format('F d, Y H:i') }}
@endif @if ($agreement->equipment_handed_over_at)
Equipment Handed Over: {{ $agreement->equipment_handed_over_at->format('F d, Y H:i') }}
@endif
Customer Details:

{{ $agreement->rental->customer?->name ?? 'Walk-in Customer' }}

@if ($agreement->rental->customer?->address)

{{ $agreement->rental->customer->address }}

@endif @if ($agreement->rental->customer?->phone)

{{ $agreement->rental->customer->phone }}

@endif @if ($agreement->rental->customer?->nic_number)

NIC: {{ $agreement->rental->customer->nic_number }}

@endif
Rental Information:
Status: @php $statusColors = [ 'pending' => 'warning', 'signed' => 'info', 'equipment_handed_over' => 'success', ]; $color = $statusColors[$agreement->status] ?? 'secondary'; @endphp {{ ucfirst(str_replace('_', ' ', $agreement->status)) }}
Rental Date: {{ $agreement->rental->rental_date->format('M d, Y H:i') }}
Total Amount: Rs. {{ number_format($agreement->rental->grand_total, 2) }}
Rental Agreement Terms & Conditions

This Rental Agreement ("Agreement") is entered into on {{ $agreement->issued_at->format('F d, Y') }} between {{ $agreement->rental->shop->name ?? 'Equipment Renting System' }} ("Lessor") and {{ $agreement->rental->customer?->name ?? 'Walk-in Customer' }} ("Lessee").

1. Equipment Details
@foreach ($agreement->rental->rentalItems as $item) @endforeach
Item Rate/Day Qty Days Subtotal
{{ $item->equipment->name }} Rs. {{ number_format($item->daily_rate, 2) }} {{ $item->quantity }} {{ number_format($item->days, 2) }} Rs. {{ number_format($item->subtotal, 2) }}
@if ($agreement->rental->remarks)

Remarks: {{ $agreement->rental->remarks }}

@endif

Subtotal:

@if ($agreement->rental->discount > 0)

Discount:

@endif

Total:

Rs. {{ number_format($agreement->rental->total_amount, 2) }}

@if ($agreement->rental->discount > 0)

Rs. {{ number_format($agreement->rental->discount, 2) }}

@endif

Rs. {{ number_format($agreement->rental->grand_total, 2) }}

2. Terms and Conditions
  1. The Lessee agrees to return all equipment in the same condition as received, normal wear and tear excepted.
  2. The Lessee is responsible for any damage or loss of equipment during the rental period.
  3. Equipment must be returned by {{ $agreement->rental->expected_return_date ? $agreement->rental->expected_return_date->format('F d, Y H:i') : 'the agreed return date' }}.
  4. Late returns may incur additional charges.
  5. The Lessee agrees to pay the total rental amount as specified in this agreement.
Lessor Signature

{{ $agreement->rental->rentedBy->name ?? 'N/A' }}

Authorized Representative

Signature: _____________________

Date: _____________________

Lessee Signature

{{ $agreement->rental->customer?->name ?? 'Walk-in Customer' }}

Customer

Signature: _____________________

Date: _____________________

@if ($agreement->status === 'pending') @endif @if ($agreement->status === 'signed') @endif @if ($agreement->status === 'equipment_handed_over') @php $invoice = $agreement->rental->invoices()->first(); @endphp @if ($invoice) View Invoice @else Generate Invoice @endif @endif {{-- Show invoice option when equipment is returned --}} @if ($agreement->rental->status === 'returned') @php $invoice = $agreement->rental->invoices()->first(); @endphp @if ($invoice) View Invoice @else Generate Invoice @endif @endif
@endsection