2013-11-26 13:45:07 +01:00
|
|
|
@extends('header')
|
|
|
|
|
2013-12-07 19:45:00 +01:00
|
|
|
@section('content')
|
2013-11-29 13:09:21 +01:00
|
|
|
|
2013-11-26 13:45:07 +01:00
|
|
|
|
2014-02-18 22:56:18 +01:00
|
|
|
@if (!$client->trashed())
|
2013-11-26 13:45:07 +01:00
|
|
|
<div class="pull-right">
|
2013-12-03 18:32:33 +01:00
|
|
|
{{ Former::open('clients/bulk')->addClass('mainForm') }}
|
|
|
|
<div style="display:none">
|
|
|
|
{{ Former::text('action') }}
|
2013-12-04 17:20:14 +01:00
|
|
|
{{ Former::text('id')->value($client->public_id) }}
|
2013-12-03 18:32:33 +01:00
|
|
|
</div>
|
|
|
|
|
2014-04-01 12:30:43 +02:00
|
|
|
{{ DropdownButton::normal(trans('texts.edit_client'),
|
2013-12-03 18:32:33 +01:00
|
|
|
Navigation::links(
|
2013-12-09 10:38:49 +01:00
|
|
|
[
|
2014-04-01 12:30:43 +02:00
|
|
|
[trans('texts.edit_client'), URL::to('clients/' . $client->public_id . '/edit')],
|
2013-12-09 10:38:49 +01:00
|
|
|
[Navigation::DIVIDER],
|
2014-04-01 12:30:43 +02:00
|
|
|
[trans('texts.archive_client'), "javascript:onArchiveClick()"],
|
|
|
|
[trans('texts.delete_client'), "javascript:onDeleteClick()"],
|
2013-12-09 10:38:49 +01:00
|
|
|
]
|
2013-12-03 18:32:33 +01:00
|
|
|
)
|
2013-12-09 10:38:49 +01:00
|
|
|
, ['id'=>'normalDropDown'])->split(); }}
|
|
|
|
|
|
|
|
{{ DropdownButton::primary('Create Invoice',
|
|
|
|
Navigation::links(
|
|
|
|
[
|
2014-04-01 12:30:43 +02:00
|
|
|
[trans('texts.create_invoice'), URL::to('invoices/create/' . $client->public_id )],
|
|
|
|
[trans('texts.enter_payment'), URL::to('payments/create/' . $client->public_id )],
|
|
|
|
[trans('texts.enter_credit'), URL::to('credits/create/' . $client->public_id )],
|
2013-12-09 10:38:49 +01:00
|
|
|
]
|
|
|
|
)
|
|
|
|
, ['id'=>'primaryDropDown'])->split(); }}
|
|
|
|
|
2014-02-18 22:56:18 +01:00
|
|
|
{{ Former::close() }}
|
2013-11-26 13:45:07 +01:00
|
|
|
</div>
|
2014-02-18 22:56:18 +01:00
|
|
|
@endif
|
2013-11-26 13:45:07 +01:00
|
|
|
|
2013-12-31 10:43:39 +01:00
|
|
|
<h2>{{ $client->getDisplayName() }}</h2>
|
2013-12-03 18:32:33 +01:00
|
|
|
@if ($client->last_login > 0)
|
|
|
|
<h3 style="margin-top:0px"><small>
|
2014-04-01 12:30:43 +02:00
|
|
|
{{ trans('texts.last_logged_in') }} {{ Utils::timestampToDateTimeString(strtotime($client->last_login)); }}
|
2013-12-03 18:32:33 +01:00
|
|
|
</small></h3>
|
|
|
|
@endif
|
2013-11-29 13:09:21 +01:00
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-md-3">
|
2014-04-01 12:30:43 +02:00
|
|
|
<h3>{{ trans('texts.details') }}</h3>
|
2013-11-29 13:09:21 +01:00
|
|
|
<p>{{ $client->getAddress() }}</p>
|
2014-04-18 10:57:31 +02:00
|
|
|
<p>{{ $client->getCustomFields() }}</p>
|
2013-11-29 13:09:21 +01:00
|
|
|
<p>{{ $client->getPhone() }}</p>
|
|
|
|
<p>{{ $client->getNotes() }}</p>
|
2013-12-11 21:33:44 +01:00
|
|
|
<p>{{ $client->getIndustry() }}</p>
|
2013-12-31 10:43:39 +01:00
|
|
|
<p>{{ $client->getWebsite() }}</p>
|
2014-04-01 12:30:43 +02:00
|
|
|
<p>{{ $client->payment_terms ? trans('texts.payment_terms') . ": Net " . $client->payment_terms : '' }}</p>
|
2013-11-29 13:09:21 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-3">
|
2014-04-01 12:30:43 +02:00
|
|
|
<h3>{{ trans('texts.contacts') }}</h3>
|
2013-11-29 13:09:21 +01:00
|
|
|
@foreach ($client->contacts as $contact)
|
|
|
|
{{ $contact->getDetails() }}
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-md-6">
|
2014-04-01 12:30:43 +02:00
|
|
|
<h3>{{ trans('texts.standing') }}
|
2014-01-16 22:12:46 +01:00
|
|
|
<table class="table" style="width:300px">
|
|
|
|
<tr>
|
2014-04-01 12:30:43 +02:00
|
|
|
<td><small>{{ trans('texts.paid_to_date') }}</small></td>
|
2014-01-16 22:12:46 +01:00
|
|
|
<td style="text-align: right">{{ Utils::formatMoney($client->paid_to_date, $client->currency_id); }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2014-04-01 12:30:43 +02:00
|
|
|
<td><small>{{ trans('texts.balance') }}</small></td>
|
2014-01-16 22:12:46 +01:00
|
|
|
<td style="text-align: right">{{ Utils::formatMoney($client->balance, $client->currency_id); }}</td>
|
|
|
|
</tr>
|
|
|
|
@if ($credit > 0)
|
|
|
|
<tr>
|
2014-04-01 12:30:43 +02:00
|
|
|
<td><small>{{ trans('texts.credit') }}</small></td>
|
2014-01-16 22:12:46 +01:00
|
|
|
<td style="text-align: right">{{ Utils::formatMoney($credit, $client->currency_id); }}</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
</table>
|
|
|
|
</h3>
|
|
|
|
|
2013-11-29 13:09:21 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
<ul class="nav nav-tabs nav-justified">
|
2014-04-01 12:30:43 +02:00
|
|
|
{{ HTML::tab_link('#activity', trans('texts.activity'), true) }}
|
|
|
|
{{ HTML::tab_link('#invoices', trans('texts.invoices')) }}
|
|
|
|
{{ HTML::tab_link('#payments', trans('texts.payments')) }}
|
|
|
|
{{ HTML::tab_link('#credits', trans('texts.credits')) }}
|
2013-11-29 13:09:21 +01:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="tab-content">
|
|
|
|
|
|
|
|
<div class="tab-pane active" id="activity">
|
|
|
|
|
|
|
|
{{ Datatable::table()
|
2014-04-01 12:30:43 +02:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.date'),
|
|
|
|
trans('texts.message'),
|
|
|
|
trans('texts.balance'),
|
|
|
|
trans('texts.adjustment'))
|
2013-12-04 17:20:14 +01:00
|
|
|
->setUrl(url('api/activities/'. $client->public_id))
|
2013-11-29 13:09:21 +01:00
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
2014-02-18 22:56:18 +01:00
|
|
|
->setOptions('aaSorting', [['0', 'desc']])
|
2013-12-05 21:25:20 +01:00
|
|
|
->render('datatable') }}
|
2013-11-29 13:09:21 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab-pane" id="invoices">
|
|
|
|
|
2013-12-10 23:10:43 +01:00
|
|
|
@if ($hasRecurringInvoices)
|
|
|
|
{{ Datatable::table()
|
2014-04-01 12:30:43 +02:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.frequency_id'),
|
|
|
|
trans('texts.start_date'),
|
|
|
|
trans('texts.end_date'),
|
|
|
|
trans('texts.invoice_total'))
|
2013-12-10 23:10:43 +01:00
|
|
|
->setUrl(url('api/recurring_invoices/' . $client->public_id))
|
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
2014-02-18 22:56:18 +01:00
|
|
|
->setOptions('aaSorting', [['0', 'asc']])
|
2013-12-10 23:10:43 +01:00
|
|
|
->render('datatable') }}
|
|
|
|
@endif
|
|
|
|
|
2013-11-29 13:09:21 +01:00
|
|
|
{{ Datatable::table()
|
2014-04-01 12:30:43 +02: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'))
|
2013-12-04 17:20:14 +01:00
|
|
|
->setUrl(url('api/invoices/' . $client->public_id))
|
2013-11-29 13:09:21 +01:00
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
2014-02-18 22:56:18 +01:00
|
|
|
->setOptions('aaSorting', [['0', 'asc']])
|
2013-12-05 21:25:20 +01:00
|
|
|
->render('datatable') }}
|
2013-11-29 13:09:21 +01:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="tab-pane" id="payments">
|
|
|
|
|
|
|
|
{{ Datatable::table()
|
2014-04-01 12:30:43 +02:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.invoice'),
|
|
|
|
trans('texts.transaction_reference'),
|
|
|
|
trans('texts.method'),
|
|
|
|
trans('texts.payment_amount'),
|
|
|
|
trans('texts.payment_date'))
|
2013-12-04 17:20:14 +01:00
|
|
|
->setUrl(url('api/payments/' . $client->public_id))
|
2013-11-29 13:09:21 +01:00
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
2014-02-18 22:56:18 +01:00
|
|
|
->setOptions('aaSorting', [['0', 'asc']])
|
2013-12-05 21:25:20 +01:00
|
|
|
->render('datatable') }}
|
2013-11-29 13:09:21 +01:00
|
|
|
|
|
|
|
</div>
|
2013-12-01 21:58:25 +01:00
|
|
|
<div class="tab-pane" id="credits">
|
|
|
|
|
|
|
|
{{ Datatable::table()
|
2014-04-01 12:30:43 +02:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.credit_amount'),
|
|
|
|
trans('texts.credit_balance'),
|
|
|
|
trans('texts.credit_date'),
|
|
|
|
trans('texts.private_notes'))
|
2013-12-04 17:20:14 +01:00
|
|
|
->setUrl(url('api/credits/' . $client->public_id))
|
2013-12-01 21:58:25 +01:00
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
2014-02-18 22:56:18 +01:00
|
|
|
->setOptions('aaSorting', [['0', 'asc']])
|
2013-12-05 21:25:20 +01:00
|
|
|
->render('datatable') }}
|
2013-12-01 21:58:25 +01:00
|
|
|
|
|
|
|
</div>
|
2013-11-29 13:09:21 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
$(function() {
|
2013-12-09 10:38:49 +01:00
|
|
|
$('#normalDropDown > button:first').click(function() {
|
2013-12-04 17:20:14 +01:00
|
|
|
window.location = '{{ URL::to('clients/' . $client->public_id . '/edit') }}';
|
2013-12-03 18:32:33 +01:00
|
|
|
});
|
2013-12-09 10:38:49 +01:00
|
|
|
$('#primaryDropDown > button:first').click(function() {
|
|
|
|
window.location = '{{ URL::to('invoices/create/' . $client->public_id ) }}';
|
|
|
|
});
|
2013-11-29 13:09:21 +01:00
|
|
|
});
|
|
|
|
|
2013-12-03 18:32:33 +01:00
|
|
|
function onArchiveClick() {
|
|
|
|
$('#action').val('archive');
|
|
|
|
$('.mainForm').submit();
|
|
|
|
}
|
|
|
|
|
|
|
|
function onDeleteClick() {
|
2014-04-01 12:30:43 +02:00
|
|
|
if (confirm("{{ trans('texts.are_you_sure') }}")) {
|
2013-12-03 18:32:33 +01:00
|
|
|
$('#action').val('delete');
|
|
|
|
$('.mainForm').submit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-29 13:09:21 +01:00
|
|
|
</script>
|
|
|
|
|
2013-11-26 13:45:07 +01:00
|
|
|
@stop
|