mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -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');
|
||||
|
||||
$data = [
|
||||
'subject' => Parsedown::instance()->text(request()->input('subject')),
|
||||
'subject' => request()->input('subject'),
|
||||
'body' => Parsedown::instance()->text(request()->input('body')),
|
||||
];
|
||||
|
||||
|
@ -84,6 +84,7 @@ class ClientContact extends Authenticatable implements HasLocalePreference
|
||||
'custom_value3',
|
||||
'custom_value4',
|
||||
'email',
|
||||
'is_primary',
|
||||
];
|
||||
|
||||
public function getHashedIdAttribute()
|
||||
|
@ -34,14 +34,12 @@ class ClientContactRepository extends BaseRepository
|
||||
|
||||
});
|
||||
|
||||
$this->is_primary = true;
|
||||
/* Set first record to primary - always */
|
||||
$contacts = $contacts->sortBy('is_primary');
|
||||
|
||||
$contacts->first(function($contact){
|
||||
|
||||
$contact['is_primary'] = true;
|
||||
// $contact->save();
|
||||
|
||||
$contacts = $contacts->sortBy('is_primary')->map(function ($contact){
|
||||
$contact['is_primary'] = $this->is_primary;
|
||||
$this->is_primary = false;
|
||||
return $contact;
|
||||
});
|
||||
|
||||
//loop and update/create contacts
|
||||
@ -66,6 +64,8 @@ class ClientContactRepository extends BaseRepository
|
||||
$update_contact->save();
|
||||
});
|
||||
|
||||
|
||||
|
||||
//always made sure we have one blank contact to maintain state
|
||||
if($contacts->count() == 0)
|
||||
{
|
||||
|
@ -71,8 +71,7 @@ class ClientRepository extends BaseRepository
|
||||
|
||||
if(isset($data['contacts']))
|
||||
$contacts = $this->contact_repo->save($data['contacts'], $client);
|
||||
|
||||
|
||||
|
||||
if(empty($data['name']))
|
||||
$data['name'] = $client->present()->name();
|
||||
|
||||
|
@ -705,6 +705,7 @@ class CreateUsersTable extends Migration
|
||||
$t->softDeletes('deleted_at', 6);
|
||||
|
||||
$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