@extends('header') @section('head') @parent @if ($vendor->hasAddress()) @endif @stop @section('content')
{!! Former::open('vendors/bulk')->addClass('mainForm') !!}
{!! Former::text('action') !!} {!! Former::text('public_id')->value($vendor->public_id) !!}
@if ($gatewayLink) {!! Button::normal(trans('texts.view_in_stripe'))->asLinkTo($gatewayLink)->withAttributes(['target' => '_blank']) !!} @endif @if ($vendor->trashed()) {!! Button::primary(trans('texts.restore_vendor'))->withAttributes(['onclick' => 'onRestoreClick()']) !!} @else {!! DropdownButton::normal(trans('texts.edit_vendor')) ->withAttributes(['class'=>'normalDropDown']) ->withContents([ ['label' => trans('texts.archive_vendor'), 'url' => "javascript:onArchiveClick()"], ['label' => trans('texts.delete_vendor'), 'url' => "javascript:onDeleteClick()"], ] )->split() !!} {!! DropdownButton::primary(trans('texts.new_expense')) ->withAttributes(['class'=>'primaryDropDown']) ->withContents($actionLinks)->split() !!} @endif {!! Former::close() !!}

{{ $vendor->getDisplayName() }}

{{-- @if ($vendor->last_login > 0)

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

@endif --}}

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

@if ($vendor->id_number)

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

@endif @if ($vendor->vat_number)

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

@endif @if ($vendor->address1) {{ $vendor->address1 }}
@endif @if ($vendor->address2) {{ $vendor->address2 }}
@endif @if ($vendor->getCityState()) {{ $vendor->getCityState() }}
@endif @if ($vendor->country) {{ $vendor->country->name }}
@endif @if ($vendor->account->custom_vendor_label1 && $vendor->custom_value1) {{ $vendor->account->custom_vendor_label1 . ': ' . $vendor->custom_value1 }}
@endif @if ($vendor->account->custom_vendor_label2 && $vendor->custom_value2) {{ $vendor->account->custom_vendor_label2 . ': ' . $vendor->custom_value2 }}
@endif @if ($vendor->work_phone) {{ $vendor->work_phone }} @endif @if ($vendor->private_notes)

{{ $vendor->private_notes }}

@endif @if ($vendor->vendor_industry) {{ $vendor->vendor_industry->name }}
@endif @if ($vendor->vendor_size) {{ $vendor->vendor_size->name }}
@endif @if ($vendor->website)

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

@endif @if ($vendor->language)

{{ $vendor->language->name }}

@endif

{{ $vendor->payment_terms ? trans('texts.payment_terms') . ": " . trans('texts.payment_terms_net') . " " . $vendor->payment_terms : '' }}

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

@foreach ($vendor->vendorcontacts 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 @endforeach

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

@if ($vendor->hasAddress())

@endif
{!! Datatable::table() ->addColumn( trans('texts.date'), trans('texts.message'), trans('texts.balance'), trans('texts.adjustment')) ->setUrl(url('api/vendoractivities/'. $vendor->public_id)) ->setCustomValues('entityType', 'activity') ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) ->setOptions('aaSorting', [['0', 'desc']]) ->render('datatable') !!}
{!! Datatable::table() ->addColumn( trans('texts.credit_amount'), trans('texts.credit_balance'), trans('texts.credit_date'), trans('texts.private_notes')) ->setUrl(url('api/expenses/' . $vendor->public_id)) ->setCustomValues('entityType', 'credits') ->setOptions('sPaginationType', 'bootstrap') ->setOptions('bFilter', false) ->setOptions('aaSorting', [['0', 'asc']]) ->render('datatable') !!}
@stop