@extends('header') @section('head') @parent @stop @section('content')
{!! Former::open('clients/bulk')->autocomplete('off')->addClass('mainForm') !!}
{!! Former::text('action') !!} {!! Former::text('public_id')->value($client->public_id) !!}
@if ($gatewayLink) {!! Button::normal(trans('texts.view_in_gateway', ['gateway'=>$gatewayName])) ->asLinkTo($gatewayLink) ->withAttributes(['target' => '_blank']) !!} @endif @if ( ! $client->is_deleted) @can('edit', $client) {!! DropdownButton::normal(trans('texts.edit_client')) ->withAttributes(['class'=>'normalDropDown']) ->withContents([ ($client->trashed() ? false : ['label' => trans('texts.archive_client'), 'url' => "javascript:onArchiveClick()"]), ['label' => trans('texts.delete_client'), 'url' => "javascript:onDeleteClick()"], auth()->user()->is_admin ? \DropdownButton::DIVIDER : false, auth()->user()->is_admin ? ['label' => trans('texts.purge_client'), 'url' => "javascript:onPurgeClick()"] : false, ] )->split() !!} @endcan @if ( ! $client->trashed()) @can('create', ENTITY_INVOICE) {!! DropdownButton::primary(trans('texts.view_statement')) ->withAttributes(['class'=>'primaryDropDown']) ->withContents($actionLinks)->split() !!} @endcan @endif @endif @if ($client->trashed()) @can('edit', $client) @if (auth()->user()->is_admin && $client->is_deleted) {!! Button::danger(trans('texts.purge_client')) ->appendIcon(Icon::create('warning-sign')) ->withAttributes(['onclick' => 'onPurgeClick()']) !!} @endif {!! Button::primary(trans('texts.restore_client')) ->appendIcon(Icon::create('cloud-download')) ->withAttributes(['onclick' => 'onRestoreClick()']) !!} @endcan @endif {!! Former::close() !!}
@if ($client->last_login > 0)

{{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)) }}

@endif

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

@if ($client->id_number)

{{ trans('texts.id_number').': '.$client->id_number }}

@endif @if ($client->vat_number)

{{ trans('texts.vat_number').': '.$client->vat_number }}

@endif @if ($client->account->customLabel('client1') && $client->custom_value1) {{ $client->account->present()->customLabel('client1') . ': ' }} {!! nl2br(e($client->custom_value1)) !!}
@endif @if ($client->account->customLabel('client2') && $client->custom_value2) {{ $client->account->present()->customLabel('client2') . ': ' }} {!! nl2br(e($client->custom_value2)) !!}
@endif @if ($client->work_phone) {{ $client->work_phone }} @endif @if (floatval($client->task_rate))

{{ trans('texts.task_rate') }}: {{ Utils::roundSignificant($client->task_rate) }}

@endif

@if ($client->public_notes)

{!! nl2br(e($client->public_notes)) !!}

@endif @if ($client->private_notes)

{!! nl2br(e($client->private_notes)) !!}

@endif @if ($client->industry || $client->size) @if ($client->industry) {{ $client->industry->name }} @endif @if ($client->industry && $client->size) | @endif @if ($client->size) {{ $client->size->name }}
@endif @endif @if ($client->website)

{!! Utils::formatWebsite($client->website) !!}

@endif @if ($client->language)

{{ $client->language->name }}

@endif

{{ $client->present()->paymentTerms }}

@if ($client->show_tasks_in_portal) • {{ trans('texts.can_view_tasks') }}
@endif @if ($client->account->hasReminders() && ! $client->send_reminders) • {{ trans('texts.is_not_sent_reminders') }}
@endif

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

@if ($client->addressesMatch()) {!! $client->present()->address(ADDRESS_BILLING) !!} @else {!! $client->present()->address(ADDRESS_BILLING, true) !!}
{!! $client->present()->address(ADDRESS_SHIPPING, true) !!} @endif

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

@foreach ($client->contacts as $contact) @if ($contact->first_name || $contact->last_name) {{ $contact->first_name.' '.$contact->last_name }}
@endif @if ($contact->email) {!! HTML::mailto($contact->email, $contact->email) !!}
@endif @if ($contact->phone) {{ $contact->phone }}
@endif @if ($client->account->customLabel('contact1') && $contact->custom_value1) {{ $client->account->present()->customLabel('contact1') . ': ' . $contact->custom_value1 }}
@endif @if ($client->account->customLabel('contact2') && $contact->custom_value2) {{ $client->account->present()->customLabel('contact2') . ': ' . $contact->custom_value2 }}
@endif @if (Auth::user()->confirmed && $client->account->enable_client_portal) {{ trans('texts.view_in_portal') }} @if (config('services.postmark'))
{{ trans('texts.email_history') }}
@endif
@endif
@endforeach

{{ trans('texts.standing') }} @if ($credit > 0) @endif
{{ trans('texts.paid_to_date') }} {{ Utils::formatMoney($client->paid_to_date, $client->getCurrencyId()) }}
{{ trans('texts.balance') }} {{ Utils::formatMoney($client->balance, $client->getCurrencyId()) }}
{{ trans('texts.credit') }} {{ Utils::formatMoney($credit, $client->getCurrencyId()) }}

@if ($client->showMap()) @endif
{!! Datatable::table() ->addColumn( trans('texts.date'), trans('texts.message'), trans('texts.balance'), trans('texts.adjustment')) ->setUrl(url('api/activities/'. $client->public_id)) ->setCustomValues('entityType', 'activity') ->setCustomValues('clientId', $client->public_id) ->setCustomValues('rightAlign', [2, 3]) ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) ->setOptions('aaSorting', [['0', 'desc']]) ->render('datatable') !!}
@if ($hasTasks)
@include('list', [ 'entityType' => ENTITY_TASK, 'datatable' => new \App\Ninja\Datatables\TaskDatatable(true, true), 'clientId' => $client->public_id, 'url' => url('api/tasks/' . $client->public_id), ])
@endif @if ($hasExpenses)
@include('list', [ 'entityType' => ENTITY_EXPENSE, 'datatable' => new \App\Ninja\Datatables\ExpenseDatatable(true, true), 'clientId' => $client->public_id, 'url' => url('api/client_expenses/' . $client->public_id), ])
@endif @if (Utils::hasFeature(FEATURE_QUOTES) && $hasQuotes)
@include('list', [ 'entityType' => ENTITY_QUOTE, 'datatable' => new \App\Ninja\Datatables\InvoiceDatatable(true, true, ENTITY_QUOTE), 'clientId' => $client->public_id, 'url' => url('api/quotes/' . $client->public_id), ])
@endif @if ($hasRecurringInvoices)
@include('list', [ 'entityType' => ENTITY_RECURRING_INVOICE, 'datatable' => new \App\Ninja\Datatables\RecurringInvoiceDatatable(true, true), 'clientId' => $client->public_id, 'url' => url('api/recurring_invoices/' . $client->public_id), ])
@endif
@include('list', [ 'entityType' => ENTITY_INVOICE, 'datatable' => new \App\Ninja\Datatables\InvoiceDatatable(true, true), 'clientId' => $client->public_id, 'url' => url('api/invoices/' . $client->public_id), ])
@include('list', [ 'entityType' => ENTITY_PAYMENT, 'datatable' => new \App\Ninja\Datatables\PaymentDatatable(true, true), 'clientId' => $client->public_id, 'url' => url('api/payments/' . $client->public_id), ])
@if ($account->isModuleEnabled(ENTITY_CREDIT))
@include('list', [ 'entityType' => ENTITY_CREDIT, 'datatable' => new \App\Ninja\Datatables\CreditDatatable(true, true), 'clientId' => $client->public_id, 'url' => url('api/credits/' . $client->public_id), ])
@endif
@stop