@php $form_id = 'contact_add_form'; if(isset($quick_add)){ $form_id = 'quick_add_contact'; } if(isset($store_action)) { $url = $store_action; $type = 'lead'; $customer_groups = []; } else { $url = action('ContactController@store'); $type = isset($selected_type) ? $selected_type : ''; $sources = []; $life_stages = []; } @endphp {!! Form::open(['url' => $url, 'method' => 'post', 'id' => $form_id ]) !!}

@lang('contact.add_contact')

{!! Form::label('type', __('contact.contact_type') . ':*' ) !!}
{!! Form::select('type', $types, $type , ['class' => 'form-control', 'id' => 'contact_type','placeholder' => __('messages.please_select'), 'required']); !!}
{!! Form::label('contact_id', __('lang_v1.contact_id') . ':') !!}
{!! Form::text('contact_id', null, ['class' => 'form-control','placeholder' => __('lang_v1.contact_id')]); !!}

@lang('lang_v1.leave_empty_to_autogenerate')

{!! Form::label('customer_group_id', __('lang_v1.customer_group') . ':') !!}
{!! Form::select('customer_group_id', $customer_groups, '', ['class' => 'form-control']); !!}
{!! Form::label('supplier_business_name', __('business.business_name') . ':') !!}
{!! Form::text('supplier_business_name', null, ['class' => 'form-control', 'placeholder' => __('business.business_name')]); !!}
{!! Form::label('prefix', __( 'business.prefix' ) . ':') !!} {!! Form::text('prefix', null, ['class' => 'form-control', 'placeholder' => __( 'business.prefix_placeholder' ) ]); !!}
{!! Form::label('first_name', __( 'business.first_name' ) . ':*') !!} {!! Form::text('first_name', null, ['class' => 'form-control', 'required', 'placeholder' => __( 'business.first_name' ) ]); !!}
{!! Form::label('middle_name', __( 'lang_v1.middle_name' ) . ':') !!} {!! Form::text('middle_name', null, ['class' => 'form-control', 'placeholder' => __( 'lang_v1.middle_name' ) ]); !!}
{!! Form::label('last_name', __( 'business.last_name' ) . ':') !!} {!! Form::text('last_name', null, ['class' => 'form-control', 'placeholder' => __( 'business.last_name' ) ]); !!}
{!! Form::label('mobile', __('contact.mobile') . ':*') !!}
{!! Form::text('mobile', null, ['class' => 'form-control', 'required', 'placeholder' => __('contact.mobile')]); !!}
{!! Form::label('alternate_number', __('contact.alternate_contact_number') . ':') !!}
{!! Form::text('alternate_number', null, ['class' => 'form-control', 'placeholder' => __('contact.alternate_contact_number')]); !!}
{!! Form::label('landline', __('contact.landline') . ':') !!}
{!! Form::text('landline', null, ['class' => 'form-control', 'placeholder' => __('contact.landline')]); !!}
{!! Form::label('email', __('business.email') . ':') !!}
{!! Form::email('email', null, ['class' => 'form-control','placeholder' => __('business.email')]); !!}
{!! Form::label('dob', __('lang_v1.dob') . ':') !!}
{!! Form::text('dob', null, ['class' => 'form-control dob-date-picker','placeholder' => __('lang_v1.dob'), 'readonly']); !!}
{!! Form::label('crm_source', __('lang_v1.source') . ':' ) !!}
{!! Form::select('crm_source', $sources, null , ['class' => 'form-control', 'id' => 'crm_source','placeholder' => __('messages.please_select')]); !!}
{!! Form::label('crm_life_stage', __('lang_v1.life_stage') . ':' ) !!}
{!! Form::select('crm_life_stage', $life_stages, null , ['class' => 'form-control', 'id' => 'crm_life_stage','placeholder' => __('messages.please_select')]); !!}
{!! Form::label('user_id', __('lang_v1.assigned_to') . ':*' ) !!}
{!! Form::select('user_id[]', $users ?? [], null , ['class' => 'form-control select2', 'id' => 'user_id', 'multiple', 'required', 'style' => 'width: 100%;']); !!}
@if(config('constants.enable_contact_assign') && $type !== 'lead')
{!! Form::label('assigned_to_users', __('lang_v1.assigned_to') . ':' ) !!}
{!! Form::select('assigned_to_users[]', $users ?? [], null , ['class' => 'form-control select2', 'id' => 'assigned_to_users', 'multiple', 'style' => 'width: 100%;']); !!}
@endif
{!! Form::hidden('position', null, ['id' => 'position']); !!}

{!! Form::label('tax_number', __('contact.tax_no') . ':') !!}
{!! Form::text('tax_number', null, ['class' => 'form-control', 'placeholder' => __('contact.tax_no')]); !!}
{!! Form::label('opening_balance', __('lang_v1.opening_balance') . ':') !!}
{!! Form::text('opening_balance', 0, ['class' => 'form-control input_number']); !!}
{!! Form::label('pay_term_number', __('contact.pay_term') . ':') !!} @show_tooltip(__('tooltip.pay_term'))
{!! Form::number('pay_term_number', null, ['class' => 'form-control width-40 pull-left', 'placeholder' => __('contact.pay_term')]); !!} {!! Form::select('pay_term_type', ['months' => __('lang_v1.months'), 'days' => __('lang_v1.days')], '', ['class' => 'form-control width-60 pull-left','placeholder' => __('messages.please_select')]); !!}
@php $common_settings = session()->get('business.common_settings'); $default_credit_limit = !empty($common_settings['default_credit_limit']) ? $common_settings['default_credit_limit'] : null; @endphp
{!! Form::label('credit_limit', __('lang_v1.credit_limit') . ':') !!}
{!! Form::text('credit_limit', $default_credit_limit ?? null, ['class' => 'form-control input_number']); !!}

@lang('lang_v1.credit_limit_help')


{!! Form::label('address_line_1', __('lang_v1.address_line_1') . ':') !!} {!! Form::text('address_line_1', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.address_line_1'), 'rows' => 3]); !!}
{!! Form::label('address_line_2', __('lang_v1.address_line_2') . ':') !!} {!! Form::text('address_line_2', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.address_line_2'), 'rows' => 3]); !!}
{!! Form::label('city', __('business.city') . ':') !!}
{!! Form::text('city', null, ['class' => 'form-control', 'placeholder' => __('business.city')]); !!}
{!! Form::label('state', __('business.state') . ':') !!}
{!! Form::text('state', null, ['class' => 'form-control', 'placeholder' => __('business.state')]); !!}
{!! Form::label('country', __('business.country') . ':') !!}
{!! Form::text('country', null, ['class' => 'form-control', 'placeholder' => __('business.country')]); !!}
{!! Form::label('zip_code', __('business.zip_code') . ':') !!}
{!! Form::text('zip_code', null, ['class' => 'form-control', 'placeholder' => __('business.zip_code_placeholder')]); !!}

@php $custom_labels = json_decode(session('business.custom_labels'), true); $contact_custom_field1 = !empty($custom_labels['contact']['custom_field_1']) ? $custom_labels['contact']['custom_field_1'] : __('lang_v1.contact_custom_field1'); $is_custom_field_1_required = !empty($custom_labels['contact']['is_custom_field_1_required']) && $custom_labels['contact']['is_custom_field_1_required'] == 1 ? true : false; $contact_custom_field2 = !empty($custom_labels['contact']['custom_field_2']) ? $custom_labels['contact']['custom_field_2'] : __('lang_v1.contact_custom_field2'); $contact_custom_field3 = !empty($custom_labels['contact']['custom_field_3']) ? $custom_labels['contact']['custom_field_3'] : __('lang_v1.contact_custom_field3'); $contact_custom_field4 = !empty($custom_labels['contact']['custom_field_4']) ? $custom_labels['contact']['custom_field_4'] : __('lang_v1.contact_custom_field4'); $contact_custom_field5 = !empty($custom_labels['contact']['custom_field_5']) ? $custom_labels['contact']['custom_field_5'] : __('lang_v1.custom_field', ['number' => 5]); $contact_custom_field6 = !empty($custom_labels['contact']['custom_field_6']) ? $custom_labels['contact']['custom_field_6'] : __('lang_v1.custom_field', ['number' => 6]); $contact_custom_field7 = !empty($custom_labels['contact']['custom_field_7']) ? $custom_labels['contact']['custom_field_7'] : __('lang_v1.custom_field', ['number' => 7]); $contact_custom_field8 = !empty($custom_labels['contact']['custom_field_8']) ? $custom_labels['contact']['custom_field_8'] : __('lang_v1.custom_field', ['number' => 8]); $contact_custom_field9 = !empty($custom_labels['contact']['custom_field_9']) ? $custom_labels['contact']['custom_field_9'] : __('lang_v1.custom_field', ['number' => 9]); $contact_custom_field10 = !empty($custom_labels['contact']['custom_field_10']) ? $custom_labels['contact']['custom_field_10'] : __('lang_v1.custom_field', ['number' => 10]); $contact_custom_field11 = !empty($custom_labels['contact']['custom_field_11']) ? $custom_labels['contact']['custom_field_11'] : __('lang_v1.custom_field', ['number' => 11]); $contact_custom_field12 = !empty($custom_labels['contact']['custom_field_12']) ? $custom_labels['contact']['custom_field_12'] : __('lang_v1.custom_field', ['number' => 12]); $contact_custom_field13 = !empty($custom_labels['contact']['custom_field_13']) ? $custom_labels['contact']['custom_field_13'] : __('lang_v1.custom_field', ['number' => 13]); $contact_custom_field14 = !empty($custom_labels['contact']['custom_field_14']) ? $custom_labels['contact']['custom_field_14'] : __('lang_v1.custom_field', ['number' => 14]); $contact_custom_field15 = !empty($custom_labels['contact']['custom_field_15']) ? $custom_labels['contact']['custom_field_15'] : __('lang_v1.custom_field', ['number' => 15]); $contact_custom_field16 = !empty($custom_labels['contact']['custom_field_16']) ? $custom_labels['contact']['custom_field_16'] : __('lang_v1.custom_field', ['number' => 16]); $contact_custom_field17 = !empty($custom_labels['contact']['custom_field_17']) ? $custom_labels['contact']['custom_field_17'] : __('lang_v1.custom_field', ['number' => 17]); $contact_custom_field18 = !empty($custom_labels['contact']['custom_field_18']) ? $custom_labels['contact']['custom_field_18'] : __('lang_v1.custom_field', ['number' => 18]); $contact_custom_field19 = !empty($custom_labels['contact']['custom_field_19']) ? $custom_labels['contact']['custom_field_19'] : __('lang_v1.custom_field', ['number' => 19]); $contact_custom_field20 = !empty($custom_labels['contact']['custom_field_20']) ? $custom_labels['contact']['custom_field_20'] : __('lang_v1.custom_field', ['number' => 20]); $is_custom_field_2_required = !empty($custom_labels['contact']['is_custom_field_2_required']) && $custom_labels['contact']['is_custom_field_2_required'] == 1 ? true : false; $is_custom_field_3_required = !empty($custom_labels['contact']['is_custom_field_3_required']) && $custom_labels['contact']['is_custom_field_3_required'] == 1 ? true : false; $is_custom_field_4_required = !empty($custom_labels['contact']['is_custom_field_4_required']) && $custom_labels['contact']['is_custom_field_4_required'] == 1 ? true : false; $is_custom_field_5_required = !empty($custom_labels['contact']['is_custom_field_5_required']) && $custom_labels['contact']['is_custom_field_5_required'] == 1 ? true : false; $is_custom_field_6_required = !empty($custom_labels['contact']['is_custom_field_6_required']) && $custom_labels['contact']['is_custom_field_6_required'] == 1 ? true : false; $is_custom_field_7_required = !empty($custom_labels['contact']['is_custom_field_7_required']) && $custom_labels['contact']['is_custom_field_7_required'] == 1 ? true : false; $is_custom_field_8_required = !empty($custom_labels['contact']['is_custom_field_8_required']) && $custom_labels['contact']['is_custom_field_8_required'] == 1 ? true : false; $is_custom_field_9_required = !empty($custom_labels['contact']['is_custom_field_9_required']) && $custom_labels['contact']['is_custom_field_9_required'] == 1 ? true : false; $is_custom_field_10_required = !empty($custom_labels['contact']['is_custom_field_10_required']) && $custom_labels['contact']['is_custom_field_10_required'] == 1 ? true : false; $is_custom_field_11_required = !empty($custom_labels['contact']['is_custom_field_11_required']) && $custom_labels['contact']['is_custom_field_11_required'] == 1 ? true : false; $is_custom_field_12_required = !empty($custom_labels['contact']['is_custom_field_12_required']) && $custom_labels['contact']['is_custom_field_12_required'] == 1 ? true : false; $is_custom_field_13_required = !empty($custom_labels['contact']['is_custom_field_13_required']) && $custom_labels['contact']['is_custom_field_13_required'] == 1 ? true : false; $is_custom_field_14_required = !empty($custom_labels['contact']['is_custom_field_14_required']) && $custom_labels['contact']['is_custom_field_14_required'] == 1 ? true : false; $is_custom_field_15_required = !empty($custom_labels['contact']['is_custom_field_15_required']) && $custom_labels['contact']['is_custom_field_15_required'] == 1 ? true : false; $is_custom_field_16_required = !empty($custom_labels['contact']['is_custom_field_16_required']) && $custom_labels['contact']['is_custom_field_16_required'] == 1 ? true : false; $is_custom_field_17_required = !empty($custom_labels['contact']['is_custom_field_17_required']) && $custom_labels['contact']['is_custom_field_17_required'] == 1 ? true : false; $is_custom_field_18_required = !empty($custom_labels['contact']['is_custom_field_18_required']) && $custom_labels['contact']['is_custom_field_18_required'] == 1 ? true : false; $is_custom_field_19_required = !empty($custom_labels['contact']['is_custom_field_19_required']) && $custom_labels['contact']['is_custom_field_19_required'] == 1 ? true : false; $is_custom_field_20_required = !empty($custom_labels['contact']['is_custom_field_20_required']) && $custom_labels['contact']['is_custom_field_20_required'] == 1 ? true : false; @endphp {{-- @dd($is_custom_field_2_required) --}}
{!! Form::label('custom_field_1', $contact_custom_field1 . ': ' . ($is_custom_field_1_required ? '*' : '')) !!} {!! Form::text('custom_field1', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field1, 'required' => $is_custom_field_1_required ? 'required' : null]) !!}
{!! Form::label('custom_field_2', $contact_custom_field2 . ': ' . ($is_custom_field_2_required ? '*' : '')) !!} {!! Form::text('custom_field2', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field2, 'required' => $is_custom_field_2_required ? 'required' : null]) !!}
{!! Form::label('custom_field_3', $contact_custom_field3 . ': ' . ($is_custom_field_3_required ? '*' : '')) !!} {!! Form::text('custom_field3', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field3, 'required' => $is_custom_field_3_required ? 'required' : null]) !!}
{!! Form::label('custom_field_4', $contact_custom_field4 . ': ' . ($is_custom_field_4_required ? '*' : '')) !!} {!! Form::text('custom_field4', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field4, 'required' => $is_custom_field_4_required ? 'required' : null]) !!}
{!! Form::label('custom_field5', $contact_custom_field5 . ': ' . ($is_custom_field_5_required ? '*' : '')) !!} {!! Form::text('custom_field5', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field5, 'required' => $is_custom_field_5_required ? 'required' : null]) !!}
{!! Form::label('custom_field6', $contact_custom_field6 . ': ' . ($is_custom_field_6_required ? '*' : '')) !!} {!! Form::text('custom_field6', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field6, 'required' => $is_custom_field_6_required ? 'required' : null]) !!}
{!! Form::label('custom_field7', $contact_custom_field7 . ': ' . ($is_custom_field_7_required ? '*' : '')) !!} {!! Form::text('custom_field7', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field7, 'required' => $is_custom_field_7_required ? 'required' : null]) !!}
{!! Form::label('custom_field8', $contact_custom_field8 . ': ' . ($is_custom_field_8_required ? '*' : '')) !!} {!! Form::text('custom_field8', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field8, 'required' => $is_custom_field_8_required ? 'required' : null]) !!}
{!! Form::label('custom_field9', $contact_custom_field9 . ': ' . ($is_custom_field_9_required ? '*' : '')) !!} {!! Form::text('custom_field9', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field9, 'required' => $is_custom_field_9_required ? 'required' : null]) !!}
{!! Form::label('custom_field10', $contact_custom_field10 . ': ' . ($is_custom_field_10_required ? '*' : '')) !!} {!! Form::text('custom_field10', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field10, 'required' => $is_custom_field_10_required ? 'required' : null]) !!}
{!! Form::label('custom_field11', $contact_custom_field11 . ': ' . ($is_custom_field_11_required ? '*' : '')) !!} {!! Form::text('custom_field11', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field11, 'required' => $is_custom_field_11_required ? 'required' : null]) !!}
{!! Form::label('custom_field12', $contact_custom_field12 . ': ' . ($is_custom_field_12_required ? '*' : '')) !!} {!! Form::text('custom_field12', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field12, 'required' => $is_custom_field_12_required ? 'required' : null]) !!}
{!! Form::label('custom_field13', $contact_custom_field13 . ': ' . ($is_custom_field_13_required ? '*' : '')) !!} {!! Form::text('custom_field13', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field13, 'required' => $is_custom_field_13_required ? 'required' : null]) !!}
{!! Form::label('custom_field14', $contact_custom_field14 . ': ' . ($is_custom_field_14_required ? '*' : '')) !!} {!! Form::text('custom_field14', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field14, 'required' => $is_custom_field_14_required ? 'required' : null]) !!}
{!! Form::label('custom_field15', $contact_custom_field15 . ': ' . ($is_custom_field_15_required ? '*' : '')) !!} {!! Form::text('custom_field15', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field15, 'required' => $is_custom_field_15_required ? 'required' : null]) !!}
{!! Form::label('custom_field16', $contact_custom_field16 . ': ' . ($is_custom_field_16_required ? '*' : '')) !!} {!! Form::text('custom_field16', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field16, 'required' => $is_custom_field_16_required ? 'required' : null]) !!}
{!! Form::label('custom_field17', $contact_custom_field17 . ': ' . ($is_custom_field_17_required ? '*' : '')) !!} {!! Form::text('custom_field17', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field17, 'required' => $is_custom_field_17_required ? 'required' : null]) !!}
{!! Form::label('custom_field18', $contact_custom_field18 . ': ' . ($is_custom_field_18_required ? '*' : '')) !!} {!! Form::text('custom_field18', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field18, 'required' => $is_custom_field_18_required ? 'required' : null]) !!}
{!! Form::label('custom_field19', $contact_custom_field19 . ': ' . ($is_custom_field_19_required ? '*' : '')) !!} {!! Form::text('custom_field19', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field19, 'required' => $is_custom_field_19_required ? 'required' : null]) !!}
{!! Form::label('custom_field20', $contact_custom_field20 . ': ' . ($is_custom_field_20_required ? '*' : '')) !!} {!! Form::text('custom_field20', null, ['class' => 'form-control', 'placeholder' => $contact_custom_field20, 'required' => $is_custom_field_20_required ? 'required' : null]) !!}

{{__('lang_v1.shipping_address')}}
{!! Form::text('shipping_address', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.search_address'), 'id' => 'shipping_address']); !!}
@php $shipping_custom_label_1 = !empty($custom_labels['shipping']['custom_field_1']) ? $custom_labels['shipping']['custom_field_1'] : ''; $shipping_custom_label_2 = !empty($custom_labels['shipping']['custom_field_2']) ? $custom_labels['shipping']['custom_field_2'] : ''; $shipping_custom_label_3 = !empty($custom_labels['shipping']['custom_field_3']) ? $custom_labels['shipping']['custom_field_3'] : ''; $shipping_custom_label_4 = !empty($custom_labels['shipping']['custom_field_4']) ? $custom_labels['shipping']['custom_field_4'] : ''; $shipping_custom_label_5 = !empty($custom_labels['shipping']['custom_field_5']) ? $custom_labels['shipping']['custom_field_5'] : ''; @endphp @if(!empty($custom_labels['shipping']['is_custom_field_1_contact_default']) && !empty($shipping_custom_label_1)) @php $label_1 = $shipping_custom_label_1 . ':'; @endphp
{!! Form::label('shipping_custom_field_1', $label_1 ) !!} {!! Form::text('shipping_custom_field_details[shipping_custom_field_1]', null, ['class' => 'form-control','placeholder' => $shipping_custom_label_1]); !!}
@endif @if(!empty($custom_labels['shipping']['is_custom_field_2_contact_default']) && !empty($shipping_custom_label_2)) @php $label_2 = $shipping_custom_label_2 . ':'; @endphp
{!! Form::label('shipping_custom_field_2', $label_2 ) !!} {!! Form::text('shipping_custom_field_details[shipping_custom_field_2]', null, ['class' => 'form-control','placeholder' => $shipping_custom_label_2]); !!}
@endif @if(!empty($custom_labels['shipping']['is_custom_field_3_contact_default']) && !empty($shipping_custom_label_3)) @php $label_3 = $shipping_custom_label_3 . ':'; @endphp
{!! Form::label('shipping_custom_field_3', $label_3 ) !!} {!! Form::text('shipping_custom_field_details[shipping_custom_field_3]', null, ['class' => 'form-control','placeholder' => $shipping_custom_label_3]); !!}
@endif @if(!empty($custom_labels['shipping']['is_custom_field_4_contact_default']) && !empty($shipping_custom_label_4)) @php $label_4 = $shipping_custom_label_4 . ':'; @endphp
{!! Form::label('shipping_custom_field_4', $label_4 ) !!} {!! Form::text('shipping_custom_field_details[shipping_custom_field_4]', null, ['class' => 'form-control','placeholder' => $shipping_custom_label_4]); !!}
@endif @if(!empty($custom_labels['shipping']['is_custom_field_5_contact_default']) && !empty($shipping_custom_label_5)) @php $label_5 = $shipping_custom_label_5 . ':'; @endphp
{!! Form::label('shipping_custom_field_5', $label_5 ) !!} {!! Form::text('shipping_custom_field_details[shipping_custom_field_5]', null, ['class' => 'form-control','placeholder' => $shipping_custom_label_5]); !!}
@endif @if(!empty($common_settings['is_enabled_export']))
@php $i = 1; @endphp @for($i; $i <= 6 ; $i++)
{!! Form::label('export_custom_field_'.$i, __('lang_v1.export_custom_field'.$i).':' ) !!} {!! Form::text('export_custom_field_'.$i, null, ['class' => 'form-control','placeholder' => __('lang_v1.export_custom_field'.$i)]); !!}
@endfor @endif
@include('layouts.partials.module_form_part')
{!! Form::close() !!}