1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

minor fixes for client country in repo

This commit is contained in:
David Bomba 2022-03-25 14:49:51 +11:00
parent ea30be3a51
commit 4faa58ec8c

View File

@ -59,11 +59,15 @@ class ClientRepository extends BaseRepository
}
$client->fill($data);
if(!$client->country_id)
if(auth()->user() && !$client->country_id){
$client->country_id = auth()->user()->company()->settings->country_id;
}
$client->save();
if (!isset($client->number) || empty($client->number) || strlen($client->number) == 0) {
$client->number = $this->getNextClientNumber($client);