mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Force client country if none set
This commit is contained in:
parent
3b34553007
commit
769ab49458
@ -379,6 +379,15 @@ class ClientController extends BaseController
|
||||
|
||||
$client->load('contacts', 'primary_contact');
|
||||
|
||||
/* Set the client country to the company if none is set */
|
||||
if(!$client->country_id && strlen($client->company->settings->country_id) > 1){
|
||||
|
||||
$client->country_id = $client->company->settings->country_id;
|
||||
|
||||
$client->save();
|
||||
|
||||
}
|
||||
|
||||
$this->uploadLogo($request->file('company_logo'), $client->company, $client);
|
||||
|
||||
event(new ClientWasCreated($client, $client->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||
|
@ -67,7 +67,7 @@ class ClientRepository extends BaseRepository
|
||||
if (empty($data['name'])) {
|
||||
$data['name'] = $client->present()->name();
|
||||
}
|
||||
|
||||
|
||||
$client->save();
|
||||
|
||||
$this->contact_repo->save($data, $client);
|
||||
|
Loading…
x
Reference in New Issue
Block a user