@extends('layouts.app')
@section('title', __('repair::lang.edit_estimate'))
@section('content')
@include('repair::layouts.nav')
{!! 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('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('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)
@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...']); !!}
@endcomponent
{!! Form::close() !!}
@include('contact.create', ['quick_add' => true])
@stop
@section('javascript')
@endsection