@extends('header') @section('head') @parent @if ($client->showMap()) @endif @stop @section('content')
{!! Former::open('clients/bulk')->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()"], ] )->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) {!! 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->address1) {{ $client->address1 }}
@endif @if ($client->address2) {{ $client->address2 }}
@endif @if ($client->getCityState()) {{ $client->getCityState() }}
@endif @if ($client->country) {{ $client->country->name }}
@endif @if ($client->account->custom_client_label1 && $client->custom_value1) {{ $client->account->custom_client_label1 . ': ' . $client->custom_value1 }}
@endif @if ($client->account->custom_client_label2 && $client->custom_value2) {{ $client->account->custom_client_label2 . ': ' . $client->custom_value2 }}
@endif @if ($client->work_phone) {{ $client->work_phone }} @endif @if ($client->public_notes)

{{ $client->public_notes }}

@endif @if ($client->private_notes)

{{ $client->private_notes }}

@endif @if ($client->client_industry) {{ $client->client_industry->name }}
@endif @if ($client->client_size) {{ $client->client_size->name }}
@endif @if ($client->website)

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

@endif @if ($client->language)

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

@endif

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

{{ 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->custom_contact_label1 && $contact->custom_value1) {{ $client->account->custom_contact_label1 . ': ' . $contact->custom_value1 }}
@endif @if ($client->account->custom_contact_label2 && $contact->custom_value2) {{ $client->account->custom_contact_label2 . ': ' . $contact->custom_value2 }}
@endif @if (Auth::user()->confirmed && $client->account->enable_client_portal) {{ trans('texts.view_client_portal') }}
@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, ])
@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, ])
@endif @if ($hasRecurringInvoices)
@include('list', [ 'entityType' => ENTITY_RECURRING_INVOICE, 'datatable' => new \App\Ninja\Datatables\RecurringInvoiceDatatable(true, true), 'clientId' => $client->public_id, ])
@endif
@include('list', [ 'entityType' => ENTITY_INVOICE, 'datatable' => new \App\Ninja\Datatables\InvoiceDatatable(true, true), 'clientId' => $client->public_id, ])
@include('list', [ 'entityType' => ENTITY_PAYMENT, 'datatable' => new \App\Ninja\Datatables\PaymentDatatable(true, true), 'clientId' => $client->public_id, ])
@include('list', [ 'entityType' => ENTITY_CREDIT, 'datatable' => new \App\Ninja\Datatables\CreditDatatable(true, true), 'clientId' => $client->public_id, ])
@stop