mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Search by client number (3.X) #1328
This commit is contained in:
parent
631a401e8c
commit
7ffbda80c5
@ -249,6 +249,6 @@ trait GeneratesNumbers
|
||||
|
||||
public function clientNumbersEnabled()
|
||||
{
|
||||
return $this->hasFeature(FEATURE_INVOICE_SETTINGS) && $this->client_number_counter;
|
||||
return $this->hasFeature(FEATURE_INVOICE_SETTINGS) && $this->client_number_counter > 0;
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,13 @@ class ClientDatatable extends EntityDatatable
|
||||
return link_to("clients/{$model->public_id}", $model->email ?: '')->toHtml();
|
||||
},
|
||||
],
|
||||
[
|
||||
'id_number',
|
||||
function ($model) {
|
||||
return $model->id_number;
|
||||
},
|
||||
Auth::user()->account->clientNumbersEnabled()
|
||||
],
|
||||
[
|
||||
'client_created_at',
|
||||
function ($model) {
|
||||
|
@ -126,7 +126,7 @@ class AccountRepository
|
||||
foreach ($clients as $client) {
|
||||
if ($client->name) {
|
||||
$data['clients'][] = [
|
||||
'value' => $client->name,
|
||||
'value' => ($account->clientNumbersEnabled() && $client->id_number ? $client->id_number . ': ' : '') . $client->name,
|
||||
'tokens' => implode(',', [$client->name, $client->id_number, $client->vat_number, $client->work_phone]),
|
||||
'url' => $client->present()->url,
|
||||
];
|
||||
|
@ -51,7 +51,8 @@ class ClientRepository extends BaseRepository
|
||||
'contacts.email',
|
||||
'clients.deleted_at',
|
||||
'clients.is_deleted',
|
||||
'clients.user_id'
|
||||
'clients.user_id',
|
||||
'clients.id_number'
|
||||
);
|
||||
|
||||
$this->applyFilters($query, ENTITY_CLIENT);
|
||||
|
Loading…
Reference in New Issue
Block a user