2015-03-16 22:45:25 +01:00
|
|
|
@extends('header')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
|
|
|
|
|
|
|
<div class="pull-right">
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! Former::open('clients/bulk')->addClass('mainForm') !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
<div style="display:none">
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! Former::text('action') !!}
|
|
|
|
{!! Former::text('id')->value($client->public_id) !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
@if ($gatewayLink)
|
2015-04-16 21:57:12 +02:00
|
|
|
{!! Button::normal(trans('texts.view_in_stripe'))->asLinkTo($gatewayLink)->withAttributes(['target' => '_blank']) !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($client->trashed())
|
2015-05-15 10:51:22 +02:00
|
|
|
{!! Button::primary(trans('texts.restore_client'))->withAttributes(['onclick' => 'onRestoreClick()']) !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@else
|
2015-03-31 20:50:58 +02:00
|
|
|
{!! DropdownButton::normal(trans('texts.edit_client'))
|
|
|
|
->withAttributes(['class'=>'normalDropDown'])
|
|
|
|
->withContents([
|
|
|
|
['label' => trans('texts.archive_client'), 'url' => "javascript:onArchiveClick()"],
|
|
|
|
['label' => trans('texts.delete_client'), 'url' => "javascript:onDeleteClick()"],
|
2015-03-16 22:45:25 +01:00
|
|
|
]
|
2015-03-31 20:50:58 +02:00
|
|
|
)->split() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2015-05-31 14:37:29 +02:00
|
|
|
{!! DropdownButton::primary(trans('texts.new_invoice'))
|
2015-04-01 17:44:55 +02:00
|
|
|
->withAttributes(['class'=>'primaryDropDown'])
|
|
|
|
->withContents($actionLinks)->split() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! Former::close() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<h2>{{ $client->getDisplayName() }}</h2>
|
|
|
|
@if ($client->last_login > 0)
|
|
|
|
<h3 style="margin-top:0px"><small>
|
2015-03-26 07:24:02 +01:00
|
|
|
{{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)) }}
|
2015-03-16 22:45:25 +01:00
|
|
|
</small></h3>
|
|
|
|
@endif
|
|
|
|
|
2015-04-21 22:09:45 +02:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-body">
|
2015-03-16 22:45:25 +01:00
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
<h3>{{ trans('texts.details') }}</h3>
|
2015-03-31 20:50:58 +02:00
|
|
|
@if ($client->id_number)
|
2015-04-01 17:44:55 +02:00
|
|
|
<p><i class="fa fa-id-number" style="width: 20px"></i>{{ trans('texts.id_number').': '.$client->id_number }}</p>
|
2015-03-31 20:50:58 +02:00
|
|
|
@endif
|
2015-04-01 17:44:55 +02:00
|
|
|
@if ($client->vat_number)
|
|
|
|
<p><i class="fa fa-vat-number" style="width: 20px"></i>{{ trans('texts.vat_number').': '.$client->vat_number }}</p>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($client->address1)
|
|
|
|
{{ $client->address1 }}<br/>
|
|
|
|
@endif
|
|
|
|
@if ($client->address2)
|
|
|
|
{{ $client->address2 }}<br/>
|
|
|
|
@endif
|
|
|
|
@if ($client->city)
|
|
|
|
{{ $client->city }},
|
|
|
|
@endif
|
|
|
|
@if ($client->state)
|
|
|
|
{{ $client->state }}
|
|
|
|
@endif
|
|
|
|
@if ($client->postal_code)
|
|
|
|
{{ $client->postal_code }}
|
|
|
|
@endif
|
|
|
|
@if ($client->country)
|
|
|
|
<br/>{{ $client->country->name }}
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($client->account->custom_client_label1 && $client->custom_value1)
|
|
|
|
{{ $client->account->custom_client_label1 . ': ' . $client->custom_value1 }}<br/>
|
|
|
|
@endif
|
|
|
|
@if ($client->account->custom_client_label2 && $client->custom_value2)
|
|
|
|
{{ $client->account->custom_client_label2 . ': ' . $client->custom_value2 }}<br/>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($client->work_phone)
|
|
|
|
<i class="fa fa-phone" style="width: 20px"></i>{{ Utils::formatPhoneNumber($client->work_phone) }}
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($client->private_notes)
|
|
|
|
<p><i>{{ $client->private_notes }}</i></p>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($client->client_industry)
|
|
|
|
{{ $client->client_industry->name }}<br/>
|
|
|
|
@endif
|
|
|
|
@if ($client->client_size)
|
|
|
|
{{ $client->client_size->name }}<br/>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if ($client->website)
|
|
|
|
<p>{!! $client->getWebsite() !!}</p>
|
|
|
|
@endif
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
<p>{{ $client->payment_terms ? trans('texts.payment_terms') . ": Net " . $client->payment_terms : '' }}</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
<h3>{{ trans('texts.contacts') }}</h3>
|
|
|
|
@foreach ($client->contacts as $contact)
|
2015-04-01 17:44:55 +02:00
|
|
|
@if ($contact->first_name || $contact->last_name)
|
|
|
|
<b>{{ $contact->first_name.' '.$contact->last_name }}</b><br/>
|
|
|
|
@endif
|
|
|
|
@if ($contact->email)
|
|
|
|
<i class="fa fa-envelope" style="width: 20px"></i>{!! HTML::mailto($contact->email, $contact->email) !!}<br/>
|
|
|
|
@endif
|
|
|
|
@if ($contact->phone)
|
2015-06-24 13:37:51 +02:00
|
|
|
<i class="fa fa-phone" style="width: 20px"></i>{!! Utils::formatPhoneNumber($contact->phone) !!}<br/>
|
2015-04-01 17:44:55 +02:00
|
|
|
@endif
|
2015-03-16 22:45:25 +01:00
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
|
|
|
<h3>{{ trans('texts.standing') }}
|
|
|
|
<table class="table" style="width:300px">
|
|
|
|
<tr>
|
|
|
|
<td><small>{{ trans('texts.paid_to_date') }}</small></td>
|
2015-06-10 10:34:20 +02:00
|
|
|
<td style="text-align: right">{{ Utils::formatMoney($client->paid_to_date, $client->getCurrencyId()) }}</td>
|
2015-03-16 22:45:25 +01:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><small>{{ trans('texts.balance') }}</small></td>
|
2015-06-10 10:34:20 +02:00
|
|
|
<td style="text-align: right">{{ Utils::formatMoney($client->balance, $client->getCurrencyId()) }}</td>
|
2015-03-16 22:45:25 +01:00
|
|
|
</tr>
|
|
|
|
@if ($credit > 0)
|
|
|
|
<tr>
|
|
|
|
<td><small>{{ trans('texts.credit') }}</small></td>
|
2015-06-10 10:34:20 +02:00
|
|
|
<td style="text-align: right">{{ Utils::formatMoney($credit, $client->getCurrencyId()) }}</td>
|
2015-03-16 22:45:25 +01:00
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
</table>
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
2015-04-21 22:09:45 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
<ul class="nav nav-tabs nav-justified">
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! HTML::tab_link('#activity', trans('texts.activity'), true) !!}
|
2015-05-27 18:52:10 +02:00
|
|
|
@if ($hasTasks)
|
|
|
|
{!! HTML::tab_link('#tasks', trans('texts.tasks')) !!}
|
|
|
|
@endif
|
|
|
|
@if ($hasQuotes && Utils::isPro())
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! HTML::tab_link('#quotes', trans('texts.quotes')) !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! HTML::tab_link('#invoices', trans('texts.invoices')) !!}
|
|
|
|
{!! HTML::tab_link('#payments', trans('texts.payments')) !!}
|
|
|
|
{!! HTML::tab_link('#credits', trans('texts.credits')) !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="tab-content">
|
|
|
|
|
|
|
|
<div class="tab-pane active" id="activity">
|
|
|
|
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! Datatable::table()
|
2015-03-16 22:45:25 +01:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.date'),
|
|
|
|
trans('texts.message'),
|
|
|
|
trans('texts.balance'),
|
|
|
|
trans('texts.adjustment'))
|
|
|
|
->setUrl(url('api/activities/'. $client->public_id))
|
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
|
|
|
->setOptions('aaSorting', [['0', 'desc']])
|
2015-03-26 07:24:02 +01:00
|
|
|
->render('datatable') !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2015-05-27 18:52:10 +02:00
|
|
|
@if ($hasTasks)
|
|
|
|
<div class="tab-pane" id="tasks">
|
|
|
|
|
|
|
|
{!! Datatable::table()
|
|
|
|
->addColumn(
|
|
|
|
trans('texts.date'),
|
|
|
|
trans('texts.duration'),
|
|
|
|
trans('texts.description'),
|
|
|
|
trans('texts.status'))
|
|
|
|
->setUrl(url('api/tasks/'. $client->public_id))
|
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
|
|
|
->setOptions('aaSorting', [['0', 'desc']])
|
|
|
|
->render('datatable') !!}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
|
|
|
|
@if (Utils::isPro() && $hasQuotes)
|
2015-03-16 22:45:25 +01:00
|
|
|
<div class="tab-pane" id="quotes">
|
|
|
|
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! Datatable::table()
|
2015-03-16 22:45:25 +01:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.quote_number'),
|
|
|
|
trans('texts.quote_date'),
|
|
|
|
trans('texts.total'),
|
|
|
|
trans('texts.due_date'),
|
|
|
|
trans('texts.status'))
|
|
|
|
->setUrl(url('api/quotes/'. $client->public_id))
|
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
|
|
|
->setOptions('aaSorting', [['0', 'desc']])
|
2015-03-26 07:24:02 +01:00
|
|
|
->render('datatable') !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
<div class="tab-pane" id="invoices">
|
|
|
|
|
|
|
|
@if ($hasRecurringInvoices)
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! Datatable::table()
|
2015-03-16 22:45:25 +01:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.frequency_id'),
|
|
|
|
trans('texts.start_date'),
|
|
|
|
trans('texts.end_date'),
|
|
|
|
trans('texts.invoice_total'))
|
|
|
|
->setUrl(url('api/recurring_invoices/' . $client->public_id))
|
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
|
|
|
->setOptions('aaSorting', [['0', 'asc']])
|
2015-03-26 07:24:02 +01:00
|
|
|
->render('datatable') !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
|
|
|
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! Datatable::table()
|
2015-03-16 22:45:25 +01:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.invoice_number'),
|
|
|
|
trans('texts.invoice_date'),
|
|
|
|
trans('texts.invoice_total'),
|
|
|
|
trans('texts.balance_due'),
|
|
|
|
trans('texts.due_date'),
|
|
|
|
trans('texts.status'))
|
|
|
|
->setUrl(url('api/invoices/' . $client->public_id))
|
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
2015-05-10 10:45:03 +02:00
|
|
|
->setOptions('aaSorting', [['0', 'desc']])
|
2015-03-26 07:24:02 +01:00
|
|
|
->render('datatable') !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane" id="payments">
|
|
|
|
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! Datatable::table()
|
2015-03-16 22:45:25 +01:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.invoice'),
|
|
|
|
trans('texts.transaction_reference'),
|
|
|
|
trans('texts.method'),
|
|
|
|
trans('texts.payment_amount'),
|
|
|
|
trans('texts.payment_date'))
|
|
|
|
->setUrl(url('api/payments/' . $client->public_id))
|
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
2015-05-10 10:45:03 +02:00
|
|
|
->setOptions('aaSorting', [['0', 'desc']])
|
2015-03-26 07:24:02 +01:00
|
|
|
->render('datatable') !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane" id="credits">
|
|
|
|
|
2015-03-26 07:24:02 +01:00
|
|
|
{!! Datatable::table()
|
2015-03-16 22:45:25 +01:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.credit_amount'),
|
|
|
|
trans('texts.credit_balance'),
|
|
|
|
trans('texts.credit_date'),
|
|
|
|
trans('texts.private_notes'))
|
|
|
|
->setUrl(url('api/credits/' . $client->public_id))
|
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
|
|
|
->setOptions('aaSorting', [['0', 'asc']])
|
2015-03-26 07:24:02 +01:00
|
|
|
->render('datatable') !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
$(function() {
|
2015-04-01 17:44:55 +02:00
|
|
|
$('.normalDropDown:not(.dropdown-toggle)').click(function() {
|
2015-03-16 22:45:25 +01:00
|
|
|
window.location = '{{ URL::to('clients/' . $client->public_id . '/edit') }}';
|
|
|
|
});
|
2015-04-01 17:44:55 +02:00
|
|
|
$('.primaryDropDown:not(.dropdown-toggle)').click(function() {
|
2015-03-16 22:45:25 +01:00
|
|
|
window.location = '{{ URL::to('invoices/create/' . $client->public_id ) }}';
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
function onArchiveClick() {
|
|
|
|
$('#action').val('archive');
|
|
|
|
$('.mainForm').submit();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onRestoreClick() {
|
|
|
|
$('#action').val('restore');
|
|
|
|
$('.mainForm').submit();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onDeleteClick() {
|
2015-06-03 19:55:48 +02:00
|
|
|
if (confirm("{!! trans('texts.are_you_sure') !!}")) {
|
2015-03-16 22:45:25 +01:00
|
|
|
$('#action').val('delete');
|
|
|
|
$('.mainForm').submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
2015-06-24 13:37:51 +02:00
|
|
|
@stop
|