@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('contacts'))
{{ trans($errors->first('contacts')) }}
@endif
{!! Former::open($url) ->autocomplete('off') ->rules( ['email' => 'email'] )->addClass('col-md-12 warn-on-exit') ->method($method) !!} @include('partials.autocomplete_fix') @if ($client) {!! Former::populate($client) !!} {!! Former::populateField('task_rate', floatval($client->task_rate) ? Utils::roundSignificant($client->task_rate) : '') !!} {!! Former::populateField('show_tasks_in_portal', intval($client->show_tasks_in_portal)) !!} {!! Former::populateField('send_reminders', intval($client->send_reminders)) !!} {!! Former::hidden('public_id') !!} @else {!! Former::populateField('invoice_number_counter', 1) !!} {!! Former::populateField('quote_number_counter', 1) !!} {!! Former::populateField('send_reminders', 1) !!} @if ($account->client_number_counter) {!! Former::populateField('id_number', $account->getNextNumber()) !!} @endif @endif

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

{!! Former::text('name')->data_bind("attr { placeholder: placeholderName }") !!} {!! Former::text('id_number')->placeholder($account->clientNumbersEnabled() ? $account->getNextNumber() : ' ') !!} {!! Former::text('vat_number') !!} {!! Former::text('website') !!} {!! Former::text('work_phone') !!} @include('partials/custom_fields', ['entityType' => ENTITY_CLIENT]) @if ($account->usesClientInvoiceCounter()) {!! Former::text('invoice_number_counter')->label('invoice_counter') !!} @if (! $account->share_counter) {!! Former::text('quote_number_counter')->label('quote_counter') !!} @endif @endif

{!! 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') !!}
{!! Former::text('shipping_address1')->label('address1') !!} {!! Former::text('shipping_address2')->label('address2') !!} {!! Former::text('shipping_city')->label('city') !!} {!! Former::text('shipping_state')->label('state') !!} {!! Former::text('shipping_postal_code') ->oninput(config('ninja.google_maps_api_key') ? 'lookupPostalCode(true)' : '') ->label('postal_code') !!} {!! Former::select('shipping_country_id')->addOption('','') ->autocomplete('off') ->fromQuery($countries, 'name', 'id')->label('country_id') !!}

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

{!! Former::hidden('public_id')->data_bind("value: public_id, valueUpdate: 'afterkeydown', attr: {name: 'contacts[' + \$index() + '][public_id]'}") !!} {!! Former::text('first_name')->data_bind("value: first_name, valueUpdate: 'afterkeydown', attr: {name: 'contacts[' + \$index() + '][first_name]'}") !!} {!! Former::text('last_name')->data_bind("value: last_name, valueUpdate: 'afterkeydown', attr: {name: 'contacts[' + \$index() + '][last_name]'}") !!} {!! Former::text('email')->data_bind("value: email, valueUpdate: 'afterkeydown', attr: {name: 'contacts[' + \$index() + '][email]', id:'email'+\$index()}") !!} {!! Former::text('phone')->data_bind("value: phone, valueUpdate: 'afterkeydown', attr: {name: 'contacts[' + \$index() + '][phone]'}") !!} @if ($account->hasFeature(FEATURE_CLIENT_PORTAL_PASSWORD) && $account->enable_portal_password) {!! Former::password('password')->data_bind("value: password()?'-%unchanged%-':'', valueUpdate: 'afterkeydown', attr: {name: 'contacts[' + \$index() + '][password]'}")->autocomplete('new-password')->data_lpignore('true') !!} @endif @if (Auth::user()->hasFeature(FEATURE_INVOICE_SETTINGS)) @if ($account->customLabel('contact1')) @include('partials.custom_field', [ 'field' => 'custom_contact1', 'label' => $account->customLabel('contact1'), 'databind' => "value: custom_value1, valueUpdate: 'afterkeydown', attr: {name: 'contacts[' + \$index() + '][custom_value1]'}", ]) @endif @if ($account->customLabel('contact2')) @include('partials.custom_field', [ 'field' => 'custom_contact2', 'label' => $account->customLabel('contact2'), 'databind' => "value: custom_value2, valueUpdate: 'afterkeydown', attr: {name: 'contacts[' + \$index() + '][custom_value2]'}", ]) @endif @endif
{!! 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::select('language_id')->addOption('','') ->placeholder($account->language ? trans('texts.lang_'.$account->language->name) : '') ->fromQuery($languages, 'name', 'id') !!} {!! Former::select('payment_terms')->addOption('','') ->fromQuery(\App\Models\PaymentTerm::getSelectOptions(), 'name', 'num_days') ->placeholder($account->present()->paymentTerms) ->help(trans('texts.payment_terms_help') . ' | ' . link_to('/settings/payment_terms', trans('texts.customize_options'))) !!} @if ($account->isModuleEnabled(ENTITY_TASK)) {!! Former::text('task_rate') ->placeholder($account->present()->taskRate) ->help('task_rate_help') !!} {!! Former::checkbox('show_tasks_in_portal') ->text(trans('texts.show_tasks_in_portal')) ->label('client_portal') ->value(1) !!} @endif @if ($account->hasReminders()) {!! Former::checkbox('send_reminders') ->text('send_client_reminders') ->label('reminders') ->value(1) !!} @endif
{!! Former::textarea('public_notes')->rows(6) !!} {!! Former::textarea('private_notes')->rows(6) !!}
@if (Utils::isPaidPro())
@foreach (App\Models\Account::$customMessageTypes as $type) {!! Former::textarea('custom_messages[' . $type . ']') ->placeholder($account->customMessage($type)) ->label($type) !!} @endforeach
@endif
{!! Former::select('size_id')->addOption('','') ->fromQuery($sizes, 'name', 'id') !!} {!! Former::select('industry_id')->addOption('','') ->fromQuery($industries, 'name', 'id') !!}
@if (Auth::user()->account->isNinjaAccount())

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

@if (isset($planDetails)) {!! Former::populateField('plan', $planDetails['plan']) !!} {!! Former::populateField('plan_term', $planDetails['term']) !!} {!! Former::populateField('plan_price', $planDetails['plan_price']) !!} @if (!empty($planDetails['paid'])) {!! Former::populateField('plan_paid', $planDetails['paid']->format('Y-m-d')) !!} @endif @if (!empty($planDetails['expires'])) {!! Former::populateField('plan_expires', $planDetails['expires']->format('Y-m-d')) !!} @endif @if (!empty($planDetails['started'])) {!! Former::populateField('plan_started', $planDetails['started']->format('Y-m-d')) !!} @endif @endif {!! Former::select('plan') ->addOption(trans('texts.plan_free'), PLAN_FREE) ->addOption(trans('texts.plan_pro'), PLAN_PRO) ->addOption(trans('texts.plan_enterprise'), PLAN_ENTERPRISE)!!} {!! Former::select('plan_term') ->addOption() ->addOption(trans('texts.plan_term_yearly'), PLAN_TERM_YEARLY) ->addOption(trans('texts.plan_term_monthly'), PLAN_TERM_MONTHLY)!!} {!! Former::text('plan_price') !!} {!! Former::text('plan_started') ->data_date_format('yyyy-mm-dd') ->addGroupClass('plan_start_date') ->append('') !!} {!! Former::text('plan_paid') ->data_date_format('yyyy-mm-dd') ->addGroupClass('plan_paid_date') ->append('') !!} {!! Former::text('plan_expires') ->data_date_format('yyyy-mm-dd') ->addGroupClass('plan_expire_date') ->append('') !!}
@endif
{!! Former::hidden('data')->data_bind("value: ko.toJSON(model)") !!} @if(Auth::user()->canCreateOrEdit(ENTITY_CLIENT))
{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/clients/' . ($client ? $client->public_id : '')))->appendIcon(Icon::create('remove-circle')) !!} {!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!}
@endif {!! Former::close() !!}
@stop