mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
update auto creation logic
This commit is contained in:
parent
4b3c9df885
commit
9a080ab90e
@ -152,12 +152,14 @@ class CreateCompany
|
|||||||
|
|
||||||
$company->save();
|
$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 = TaxRateFactory::create($company->id, $user->id);
|
||||||
$tax_rate->name = $company->tax_data->regions->EU->subregions->ES->tax_name;
|
// $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->rate = $company->tax_data->regions->EU->subregions->ES->tax_rate;
|
||||||
$tax_rate->save();
|
// $tax_rate->save();
|
||||||
|
|
||||||
return $company;
|
return $company;
|
||||||
|
|
||||||
@ -191,17 +193,22 @@ class CreateCompany
|
|||||||
|
|
||||||
$company->save();
|
$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 = TaxRateFactory::create($company->id, $user->id);
|
||||||
$tax_rate->rate = $company->tax_data->regions->AU->subregions->AU->tax_rate;
|
// $tax_rate->name = $company->tax_data->regions->AU->subregions->AU->tax_name;
|
||||||
$tax_rate->save();
|
// $tax_rate->rate = $company->tax_data->regions->AU->subregions->AU->tax_rate;
|
||||||
|
// $tax_rate->save();
|
||||||
|
|
||||||
return $company;
|
return $company;
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(\Exception $e){
|
catch(\Exception $e){
|
||||||
|
nlog($e->getMessage());
|
||||||
nlog("SETUP: could not complete setup for Australian Locale");
|
nlog("SETUP: could not complete setup for Australian Locale");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user