mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2026-03-03 02:57:01 +00:00
Prevent e_invoice_type being changed if a legal entity id is present.
This commit is contained in:
@@ -130,15 +130,26 @@ class UpdateCompanyRequest extends Request
|
||||
$input['portal_domain'] = rtrim(strtolower($input['portal_domain']), "/");
|
||||
}
|
||||
|
||||
// /** Disabled on the hosted platform */
|
||||
// if (isset($input['expense_mailbox']) && Ninja::isHosted() && !($this->company->account->isPaid() && $this->company->account->plan == 'enterprise')) {
|
||||
// unset($input['expense_mailbox']);
|
||||
// }
|
||||
|
||||
|
||||
if (isset($input['settings'])) {
|
||||
$input['settings'] = (array) $this->filterSaveableSettings($input['settings']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @var \App\Models\User $user
|
||||
*/
|
||||
$user = auth()->user();
|
||||
|
||||
/**
|
||||
* @var \App\Models\Company $company
|
||||
*/
|
||||
$company = $user->company();
|
||||
|
||||
if(isset($company->legal_entity_id) && intval($company->legal_entity_id) > 0){
|
||||
$input['settings']['e_invoice_type'] = 'PEPPOL';
|
||||
}
|
||||
|
||||
if (isset($input['subdomain']) && $this->company->subdomain == $input['subdomain']) {
|
||||
unset($input['subdomain']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user