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

@lang('repair::lang.estimate') @lang('repair::lang.add_estimate')

{!! Form::open(['action' => '\Modules\Repair\Http\Controllers\RepairEstimateController@store', 'id' => 'estimate_form', 'method' => 'post']) !!} @component('components.widget', ['title' => __('repair::lang.estimate_details')])
@if(count($business_locations) == 1) @php $default_location = current(array_keys($business_locations->toArray())); @endphp @else @php $default_location = null; @endphp @endif
{!! Form::label('location_id', __('business.business_location') . ':*') !!} {!! Form::select('location_id', $business_locations, $default_location, ['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, $job_sheet ? $job_sheet->id : null, ['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_no, ['class' => 'form-control', 'required', 'placeholder' => __('repair::lang.estimate_no')]); !!}
{!! Form::label('estimate_date', __('repair::lang.estimate_date') . ':*') !!}
{!! Form::text('estimate_date', @format_date('now'), ['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', null, ['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', null, ['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', $job_sheet ? $job_sheet->serial_no : null, ['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, $job_sheet ? $job_sheet->brand_id : null, ['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, $job_sheet ? $job_sheet->device_model_id : null, ['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', $job_sheet && $job_sheet->deviceModel ? $job_sheet->deviceModel->name : null, ['class' => 'form-control', 'id' => 'model_frame_no', 'placeholder' => 'e.g. ELF 350/']); !!}
{!! Form::label('title', __('repair::lang.estimate_title') . ':') !!} {!! Form::text('title', $estimate_settings['estimate_title'] ?? 'BODY & PAINT REPAIR ESTIMATE', ['class' => 'form-control font-weight-bold', 'required']); !!}
@endcomponent @component('components.widget', ['title' => __('repair::lang.estimate') . ' Items'])

Add estimate items organized by repair category (e.g. REMOVING & REFITTING, REPAIRING, REPAINTING, REPLACEMENT). Items support numbers (e.g. 15000) or code text (e.g. SH for Second Hand, MR for Minor Repair).

@foreach($default_categories as $catIndex => $categoryName)
• Category:
@php // Provide a couple of initial sample empty rows for convenience $initialRows = ($catIndex == 0) ? 2 : 1; @endphp @for($r = 0; $r < $initialRows; $r++) @endfor
# @lang('repair::lang.item_description') @lang('repair::lang.amount_or_code')
1
@endforeach
Estimated Numeric Total: 0.00
@endcomponent @component('components.widget')
{!! Form::label('notes', __('brand.note') . ' / Remarks:') !!} {!! Form::textarea('notes', null, ['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_settings['terms_and_conditions'] ?? null, ['class' => 'form-control', 'rows' => 3, 'placeholder' => 'Terms and conditions...']); !!}
@lang('messages.cancel')
@endcomponent {!! Form::close() !!}
@stop @section('javascript') @endsection