@extends('Admin.layouts') @section('content') @php $serviceRows = collect($bill->common_services ?? []) ->map( fn($service) => [ 'description' => $service['name'] ?? 'Service', 'amount' => (float) ($service['amount'] ?? 0), ], ) ->concat( collect($bill->services ?? [])->map( fn($service) => [ 'description' => $service['name'] ?? 'Service', 'amount' => (float) ($service['amount'] ?? 0), ], ), ) ->values(); $productRows = collect($bill->products ?? []) ->map( fn($product) => [ 'description' => $product['name'] ?? 'Product', 'quantity' => (float) ($product['quantity'] ?? 0), 'rate' => (float) ($product['rate'] ?? 0), ], ) ->values(); $discountAmount = round(((float) $bill->subtotal * (float) $bill->discount) / 100, 2); $imagePaths = collect($bill->image_paths ?? []); @endphp {{-- PAGE HEADER --}}
Pending Service Details
{{-- CUSTOMER PROFILE --}}
{{ $bill->customer_name }}
Bill Number
{{ $bill->bill_number }}
{{ $bill->bill_date->format('d M Y') }}
{{-- CUSTOMER INFORMATION --}}
Customer Information
Full Name {{ $bill->customer_name }}
Mobile Number {{ $bill->mobile_number }}
Place {{ $bill->place }}
Status Service {{ $bill->service_status }}
{{-- VEHICLE INFORMATION --}}
Vehicle Information
Vehicle Number {{ $bill->vehicle_number }}
Vehicle Brand {{ $bill->vehicle_brand }}
Vehicle Model {{ $bill->vehicle_model }}
Service Date {{ $bill->bill_date->format('d M Y') }}
Chassis Number {{ $bill->chassis_number ?: '-' }}
Engine Number {{ $bill->engine_number ?: '-' }}
{{-- SERVICES RECEIVED --}}
Services Received
{{ $serviceRows->count() }} Services
@forelse($serviceRows as $service)
{{ $service['description'] }}
@empty
No services were recorded for this bill.
@endforelse

Service Remarks

{{ $bill->remarks ?: '-' }}

{{-- VEHICLE IMAGES --}}
Vehicle Images
@if ($imagePaths->isNotEmpty())
@foreach ($imagePaths as $imagePath) @php $imageDisk = \Illuminate\Support\Facades\Storage::disk('public'); $resolvedImagePath = $imageDisk->exists($imagePath) ? $imagePath : 'product image/' . basename($imagePath); $encodedImagePath = implode( '/', array_map('rawurlencode', explode('/', $resolvedImagePath)), ); $imageUrl = url('storage/' . $encodedImagePath); @endphp
Vehicle image
@endforeach
@else

No vehicle images were uploaded for this bill.

@endif
{{-- SERVICES USED --}}
Services Done
{{-- Page Length --}}
{{-- Search --}}
SNO DESCRIPTION AMOUNT (₹)
Total Amount ₹{{ number_format($serviceRows->sum('amount'), 2) }}
{{-- SPARE PARTS --}}
Spare Parts Used
{{-- Page Length --}}
{{-- Search --}}
DESCRIPTION QUANTITY RATE (₹) AMOUNT (₹)
Total Amount: ₹0.00
{{-- BILLING SUMMARY --}}
Billing Summary
Subtotal ₹{{ number_format((float) $bill->subtotal, 2) }}
Discount ({{ number_format((float) $bill->discount, 2) }}%) − ₹{{ number_format($discountAmount, 2) }}
GST Amount ₹{{ number_format((float) $bill->gst_amount, 2) }}

Grand Total ₹{{ number_format((float) $bill->total_amount, 2) }}
{{-- PAYMENT INFORMATION --}}
Payment Information
Payment Status {{ (float) $bill->balance_amount <= 0 ? 'Paid' : 'Pending' }}
Payment Method {{ $bill->payment_method ?: '-' }}
Amount Received ₹{{ number_format((float) $bill->amount_received, 2) }}

Additional Remarks

{{ $bill->remarks ?: '-' }}

{{-- BOTTOM BUTTONS --}}
Go Back
{{-- jQuery and DataTables --}} @endsection