@extends('layouts.app') @section('title', __('repair::lang.edit_estimate')) @section('content') @include('repair::layouts.nav')

@lang('repair::lang.estimate') @lang('repair::lang.edit_estimate') - {{ $estimate->estimate_no }}

{!! Form::open(['action' => ['\Modules\Repair\Http\Controllers\RepairEstimateController@update', $estimate->id], 'id' => 'estimate_edit_form', 'method' => 'put']) !!} @component('components.widget', ['title' => __('repair::lang.estimate_details')])
{!! Form::label('location_id', __('business.business_location') . ':*') !!} {!! Form::select('location_id', $business_locations, $estimate->location_id, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'required', 'style' => 'width: 100%;']); !!}
{!! Form::label('job_sheet_id', __('repair::lang.job_sheet_number') . ' (Optional):') !!} {!! Form::select('job_sheet_id', $job_sheets, $estimate->job_sheet_id, ['class' => 'form-control select2', 'id' => 'job_sheet_id_select', 'placeholder' => __('messages.please_select'), 'style' => 'width: 100%;']); !!}
{!! Form::label('estimate_no', __('repair::lang.estimate_no') . ':*') !!} {!! Form::text('estimate_no', $estimate->estimate_no, ['class' => 'form-control', 'required', 'placeholder' => __('repair::lang.estimate_no')]); !!}
{!! Form::label('estimate_date', __('repair::lang.estimate_date') . ':*') !!}
{!! Form::text('estimate_date', @format_date($estimate->estimate_date), ['class' => 'form-control', 'id' => 'estimate_date', 'readonly', 'required']); !!}
{!! Form::label('contact_id', __('role.customer') . ':') !!}
{!! Form::select('contact_id', [], null, ['class' => 'form-control', 'id' => 'customer_id', 'style' => 'width: 100%;']); !!}
{!! Form::label('insurance_company', __('repair::lang.insurance_company') . ':') !!} {!! Form::text('insurance_company', $estimate->insurance_company, ['class' => 'form-control', 'id' => 'insurance_company', 'placeholder' => 'e.g. SRI LANKA INSURANCE COMPANY']); !!}
{!! Form::label('policy_no', __('repair::lang.policy_no') . ':') !!} {!! Form::text('policy_no', $estimate->policy_no, ['class' => 'form-control', 'placeholder' => 'Policy / Claim Number']); !!}
@endcomponent @component('components.widget', ['title' => __('repair::lang.device_info') . ' / Vehicle Details'])
{!! Form::label('vehicle_reg_no', __('repair::lang.vehicle_reg_no') . ' / Serial No:*') !!} {!! Form::text('vehicle_reg_no', $estimate->vehicle_reg_no, ['class' => 'form-control', 'id' => 'vehicle_reg_no', 'required', 'placeholder' => 'e.g. LN-0635']); !!}
{!! Form::label('brand_id', __('repair::lang.make') . ' (Brand):') !!}
{!! Form::select('brand_id', $brands, $estimate->brand_id, ['class' => 'form-control select2', 'id' => 'brand_id', 'placeholder' => __('messages.please_select'), 'style' => 'width: 100%;']); !!}
{!! Form::label('device_model_id', __('repair::lang.model') . ':') !!}
{!! Form::select('device_model_id', $device_models, $estimate->device_model_id, ['class' => 'form-control select2', 'id' => 'device_model_id', 'placeholder' => __('messages.please_select'), 'style' => 'width: 100%;']); !!}
{!! Form::label('model_frame_no', __('repair::lang.model_frame_no') . ':') !!} {!! Form::text('model_frame_no', $estimate->model_frame_no, ['class' => 'form-control', 'id' => 'model_frame_no', 'placeholder' => 'e.g. ELF 350/']); !!}
{!! Form::label('title', __('repair::lang.estimate_title') . ':') !!} {!! Form::text('title', $estimate->title ?? 'BODY & PAINT REPAIR ESTIMATE', ['class' => 'form-control font-weight-bold', 'required']); !!}
@endcomponent @component('components.widget', ['title' => __('repair::lang.estimate') . ' Items'])

Organize repair items by category. Items support numbers (e.g. 15000) or code text (e.g. SH for Second Hand, MR for Minor Repair).

@php $itemsData = !empty($estimate->items) && is_array($estimate->items) ? $estimate->items : []; if (empty($itemsData)) { $itemsData = [ ['category' => 'REMOVING & REFITTING', 'items' => []], ['category' => 'REPAIRING', 'items' => []], ['category' => 'REPAINTING', 'items' => []], ['category' => 'REPLACEMENT', 'items' => []], ]; } @endphp
@foreach($itemsData as $catIndex => $catGroup)
• Category:
@php $rowList = !empty($catGroup['items']) && is_array($catGroup['items']) ? $catGroup['items'] : [['description' => '', 'amount' => '']]; @endphp @foreach($rowList as $r => $itemRow) @endforeach
# @lang('repair::lang.item_description') @lang('repair::lang.amount_or_code')
1
@endforeach
Estimated Numeric Total: {{ @num_format($estimate->total_amount) }}
@endcomponent @component('components.widget')
{!! Form::label('notes', __('brand.note') . ' / Remarks:') !!} {!! Form::textarea('notes', $estimate->notes, ['class' => 'form-control', 'rows' => 3, 'placeholder' => 'Internal remarks or customer notes...']); !!}
{!! Form::label('terms_and_conditions', __('repair::lang.repair_tc_conditions') . ':') !!} {!! Form::textarea('terms_and_conditions', $estimate->terms_and_conditions, ['class' => 'form-control', 'rows' => 3, 'placeholder' => 'Terms and conditions...']); !!}
@lang('messages.cancel')
@endcomponent {!! Form::close() !!}
@stop @section('javascript') @endsection