@extends('layouts/layoutMaster') @section('title', 'Edit Invoice - 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/flatpickr/flatpickr.js', 'resources/assets/vendor/libs/cleave-zen/cleave-zen.js', ]) @endsection @section('page-script') @endsection @section('content')
@if($invoice->isOverdue())
⚠ OVERDUE INVOICE

This invoice is past its due date. Please update the due date if equipment handover was delayed.

@endif @if(session('error'))
{{ session('error') }}
@endif @if(session('success'))
{{ session('success') }}
@endif
@csrf @method('PUT')

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

{{ $invoice->rental->shop->address ?? 'Equipment Renting System' }}

Phone: {{ $invoice->rental->shop->phone ?? 'N/A' }}

Invoice
#
Date Issued:
Due Date:
@error('due_date')
{{ $message }}
@enderror @if($invoice->isOverdue()) OVERDUE @endif
Invoice To:

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

{{ $invoice->rental->customer?->address ?? 'N/A' }}

{{ $invoice->rental->customer?->phone ?? 'N/A' }}

@if($invoice->rental->customer?->nic_number)

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

@endif
Bill To:
@if($invoice->rental->actual_return_date) @endif
Total Due: @error('amount')
{{ $message }}
@enderror
Status: {{ ucfirst(str_replace('_', ' ', $invoice->status)) }}
Rental Date: {{ $invoice->rental->rental_date->format('Y-m-d H:i') }}
Returned: {{ $invoice->rental->actual_return_date->format('Y-m-d H:i') }}

@foreach($invoice->rental->rentalItems as $index => $item)
Item
Rate/Day
Qty
Days
Price

{{ number_format($item->subtotal, 2) }} LKR

@endforeach

@if($invoice->rental->remarks)

{{ $invoice->rental->remarks }}

@endif
Subtotal:
{{ number_format($invoice->rental->total_amount, 2) }} LKR
@if($invoice->rental->discount > 0)
Discount:
{{ number_format($invoice->rental->discount, 2) }} LKR
@endif
Total:
{{ number_format($invoice->rental->grand_total, 2) }} LKR
Cancel
@endsection