@extends('header') @section('onReady') $('input#name').focus(); @stop @section('head') @if (config('ninja.google_maps_api_key')) @include('partials.google_geocode') @endif @stop @section('content') @if ($errors->first('vendor_contacts'))
{{ trans($errors->first('vendor_contacts')) }}
@endif
{!! Former::open($url) ->autocomplete('off') ->rules([ 'namey' => 'required', 'email' => 'email' ])->addClass('col-md-12 warn-on-exit') ->method($method) !!} @include('partials.autocomplete_fix') @if ($vendor) {!! Former::populate($vendor) !!} {!! Former::hidden('public_id') !!} @endif

{!! trans('texts.organization') !!}

{!! Former::text('name')->data_bind("attr { placeholder: placeholderName }") !!} {!! Former::text('id_number') !!} {!! Former::text('vat_number') !!} {!! Former::text('website') !!} {!! Former::text('work_phone') !!} @include('partials/custom_fields', ['entityType' => ENTITY_VENDOR])

{!! trans('texts.address') !!}

{!! Former::text('address1') !!} {!! Former::text('address2') !!} {!! Former::text('city') !!} {!! Former::text('state') !!} {!! Former::text('postal_code') ->oninput(config('ninja.google_maps_api_key') ? 'lookupPostalCode()' : '') !!} {!! Former::select('country_id')->addOption('','') ->autocomplete('off') ->fromQuery($countries, 'name', 'id') !!}

{!! trans('texts.contacts') !!}

{!! Former::hidden('public_id')->data_bind("value: public_id, valueUpdate: 'afterkeydown', attr: {name: 'vendor_contacts[' + \$index() + '][public_id]'}") !!} {!! Former::text('first_name')->data_bind("value: first_name, valueUpdate: 'afterkeydown', attr: {name: 'vendor_contacts[' + \$index() + '][first_name]'}") !!} {!! Former::text('last_name')->data_bind("value: last_name, valueUpdate: 'afterkeydown', attr: {name: 'vendor_contacts[' + \$index() + '][last_name]'}") !!} {!! Former::text('email')->data_bind("value: email, valueUpdate: 'afterkeydown', attr: {name: 'vendor_contacts[' + \$index() + '][email]', id:'email'+\$index()}") !!} {!! Former::text('phone')->data_bind("value: phone, valueUpdate: 'afterkeydown', attr: {name: 'vendor_contacts[' + \$index() + '][phone]'}") !!}
{!! link_to('#', trans('texts.remove_contact').' -', array('data-bind'=>'click: $parent.removeContact')) !!} {!! link_to('#', trans('texts.add_contact').' +', array('onclick'=>'return addContact()')) !!}

{!! trans('texts.additional_info') !!}

{!! Former::select('currency_id')->addOption('','') ->placeholder($account->currency ? $account->currency->getTranslatedName() : '') ->fromQuery($currencies, 'name', 'id') !!} {!! Former::textarea('private_notes')->rows(6) !!}
{!! Former::hidden('data')->data_bind("value: ko.toJSON(model)") !!} @if(Auth::user()->canCreateOrEdit(ENTITY_VENDOR))
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/vendors/' . ($vendor ? $vendor->public_id : '')))->appendIcon(Icon::create('remove-circle')) !!} {!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!}
@endif {!! Former::close() !!}
@stop