@extends('admin.layouts.app') @section('title','Create Quotation') @section('content') @php $isEdit = isset($quotation); $selectedLeadId = old('lead_id', $lead?->id); $formItems = collect(); if (old('service_name')) { foreach (old('service_name') as $index => $name) { $formItems->push(['service_name'=>$name,'description'=>old("description.$index"),'quantity'=>old("quantity.$index",1),'unit_price'=>old("unit_price.$index",0)]); } } elseif ($isEdit) { $formItems = $quotation->items->map(fn($item)=>['service_name'=>$item->service_name,'description'=>$item->description,'quantity'=>$item->quantity,'unit_price'=>$item->unit_price]); } else { $formItems->push(['service_name'=>$lead?->enquiry_type ?? '','description'=>'','quantity'=>1,'unit_price'=>0]); } @endphp @if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@endif
@csrf @if($isEdit) @method('PUT') @endif
@if($isEdit)@endif @unless($isEdit) Only converted leads without an existing quotation are listed. @endunless
Lead No {{ $lead?->lead_number ?? '-' }}
Customer {{ $lead?->customer->customer_name ?? '-' }}
Mobile {{ $lead?->customer->mobile ?? '-' }}
Enquiry Type {{ $lead?->enquiry_type ?? '-' }}

Quotation Services

Add service details, quantity and pricing

@foreach($formItems as $item) @endforeach
Service Name * Description Qty * Rate * Total Action

Pricing Summary

Review discounts, tax and final quotation value

Cancel
@endsection