mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-05 05:14:37 -04:00
Fixes for client display_name (#3137)
* Minor fixes for OpenAPI docs for clients * Add fields to company transformer * Padding email templates, system level and custom * Set Unique value on client_contact_id & invoice_id on invitations table * Fix for client display_name
This commit is contained in:
parent
259a28099f
commit
90eeb59754
@ -112,7 +112,7 @@ class TemplateController extends BaseController
|
|||||||
$body = request()->input('body');
|
$body = request()->input('body');
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'subject' => Parsedown::instance()->text(request()->input('subject')),
|
'subject' => request()->input('subject'),
|
||||||
'body' => Parsedown::instance()->text(request()->input('body')),
|
'body' => Parsedown::instance()->text(request()->input('body')),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -84,6 +84,7 @@ class ClientContact extends Authenticatable implements HasLocalePreference
|
|||||||
'custom_value3',
|
'custom_value3',
|
||||||
'custom_value4',
|
'custom_value4',
|
||||||
'email',
|
'email',
|
||||||
|
'is_primary',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function getHashedIdAttribute()
|
public function getHashedIdAttribute()
|
||||||
|
@ -34,14 +34,12 @@ class ClientContactRepository extends BaseRepository
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this->is_primary = true;
|
||||||
/* Set first record to primary - always */
|
/* Set first record to primary - always */
|
||||||
$contacts = $contacts->sortBy('is_primary');
|
$contacts = $contacts->sortBy('is_primary')->map(function ($contact){
|
||||||
|
$contact['is_primary'] = $this->is_primary;
|
||||||
$contacts->first(function($contact){
|
$this->is_primary = false;
|
||||||
|
return $contact;
|
||||||
$contact['is_primary'] = true;
|
|
||||||
// $contact->save();
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//loop and update/create contacts
|
//loop and update/create contacts
|
||||||
@ -66,6 +64,8 @@ class ClientContactRepository extends BaseRepository
|
|||||||
$update_contact->save();
|
$update_contact->save();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//always made sure we have one blank contact to maintain state
|
//always made sure we have one blank contact to maintain state
|
||||||
if($contacts->count() == 0)
|
if($contacts->count() == 0)
|
||||||
{
|
{
|
||||||
|
@ -72,7 +72,6 @@ class ClientRepository extends BaseRepository
|
|||||||
if(isset($data['contacts']))
|
if(isset($data['contacts']))
|
||||||
$contacts = $this->contact_repo->save($data['contacts'], $client);
|
$contacts = $this->contact_repo->save($data['contacts'], $client);
|
||||||
|
|
||||||
|
|
||||||
if(empty($data['name']))
|
if(empty($data['name']))
|
||||||
$data['name'] = $client->present()->name();
|
$data['name'] = $client->present()->name();
|
||||||
|
|
||||||
|
@ -705,6 +705,7 @@ class CreateUsersTable extends Migration
|
|||||||
$t->softDeletes('deleted_at', 6);
|
$t->softDeletes('deleted_at', 6);
|
||||||
|
|
||||||
$t->index(['deleted_at', 'invoice_id']);
|
$t->index(['deleted_at', 'invoice_id']);
|
||||||
|
$t->unique(['client_contact_id', 'invoice_id']);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
1
resources/views/email/template/custom.blade.php
Normal file
1
resources/views/email/template/custom.blade.php
Normal file
@ -0,0 +1 @@
|
|||||||
|
{{ $body }}
|
0
resources/views/email/template/dark.blade.php
Normal file
0
resources/views/email/template/dark.blade.php
Normal file
0
resources/views/email/template/light.blade.php
Normal file
0
resources/views/email/template/light.blade.php
Normal file
0
resources/views/email/template/plain.blade.php
Normal file
0
resources/views/email/template/plain.blade.php
Normal file
Loading…
x
Reference in New Issue
Block a user