mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for default country
This commit is contained in:
parent
dd2f9cf545
commit
ed75514646
@ -238,7 +238,8 @@ class BillingPortalPurchase extends Component
|
||||
{
|
||||
$company = $this->subscription->company;
|
||||
$user = $this->subscription->user;
|
||||
|
||||
$user->setCompany($company);
|
||||
|
||||
$client_repo = new ClientRepository(new ClientContactRepository());
|
||||
|
||||
$data = [
|
||||
|
@ -13,6 +13,7 @@ namespace App\Repositories;
|
||||
|
||||
use App\Factory\ClientFactory;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Utils\Traits\GeneratesCounter;
|
||||
use App\Utils\Traits\SavesDocuments;
|
||||
|
||||
@ -59,10 +60,10 @@ class ClientRepository extends BaseRepository
|
||||
}
|
||||
|
||||
$client->fill($data);
|
||||
|
||||
|
||||
if(auth()->user() && !$client->country_id){
|
||||
$client->country_id = auth()->user()->company()->settings->country_id;
|
||||
if(!$client->country_id){
|
||||
$company = Company::find($client->company_id);
|
||||
$client->country_id = $company->settings->country_id;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user