Merge pull request #8530 from turbo124/v5-develop

Minor fixes
This commit is contained in:
David Bomba 2023-05-28 17:28:03 +10:00 committed by GitHub
commit cde58fdb4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 12 deletions

View File

@ -152,12 +152,14 @@ class CreateCompany
$company->save();
$user = $this->account->users()->orderBy('id','asc')->first();
//user does not exist yet.
// MultiDB::setDb($company->db);
// $user = \App\Models\User::where('account_id', $company->account_id)->first();
$tax_rate = TaxRateFactory::create($company->id, $user->id);
$tax_rate->name = $company->tax_data->regions->EU->subregions->ES->tax_name;
$tax_rate->rate = $company->tax_data->regions->EU->subregions->ES->tax_rate;
$tax_rate->save();
// $tax_rate = TaxRateFactory::create($company->id, $user->id);
// $tax_rate->name = $company->tax_data->regions->EU->subregions->ES->tax_name;
// $tax_rate->rate = $company->tax_data->regions->EU->subregions->ES->tax_rate;
// $tax_rate->save();
return $company;
@ -191,18 +193,23 @@ class CreateCompany
$company->save();
$user = $company->account->users()->first();
//$user = $company->account->users()->first();
//user does not exist yet.
// MultiDB::setDb($company->db);
// $user = \App\Models\User::where('account_id', $company->account_id)->first();
$tax_rate = TaxRateFactory::create($company->id, $user->id);
$tax_rate->name = $company->tax_data->regions->AU->subregions->AU->tax_name;
$tax_rate->rate = $company->tax_data->regions->AU->subregions->AU->tax_rate;
$tax_rate->save();
// $tax_rate = TaxRateFactory::create($company->id, $user->id);
// $tax_rate->name = $company->tax_data->regions->AU->subregions->AU->tax_name;
// $tax_rate->rate = $company->tax_data->regions->AU->subregions->AU->tax_rate;
// $tax_rate->save();
return $company;
}
catch(\Exception $e){
nlog("SETUP: could not complete setup for Spanish Locale");
nlog($e->getMessage());
nlog("SETUP: could not complete setup for Australian Locale");
}
$company->save();

View File

@ -178,7 +178,7 @@ class User extends Authenticatable implements MustVerifyEmail
protected $dateFormat = 'Y-m-d H:i:s.u';
public Company $company;
public ?Company $company = null;
protected $appends = [
'hashed_id',