mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Always ensure the client has a currency set
This commit is contained in:
parent
47f42b804d
commit
65afd70b38
@ -108,7 +108,7 @@ class PaymentController extends Controller
|
||||
|
||||
$settings = auth()->user()->client->getMergedSettings();
|
||||
|
||||
//nlog($settings);
|
||||
nlog($settings);
|
||||
|
||||
/* This loop checks for under / over payments and returns the user if a check fails */
|
||||
|
||||
|
@ -90,6 +90,11 @@ class UpdateClientRequest extends Request
|
||||
$input['group_settings_id'] = $this->decodePrimaryKey($input['group_settings_id']);
|
||||
}
|
||||
|
||||
/* If the user removes the currency we must always set the default */
|
||||
if (array_key_exists('settings', $input) && ! array_key_exists('currency_id', $input['settings'])) {
|
||||
$input['settings']['currency_id'] = (string) auth()->user()->company()->settings->currency_id;
|
||||
}
|
||||
|
||||
$input = $this->decodePrimaryKeys($input);
|
||||
|
||||
if (array_key_exists('settings', $input)) {
|
||||
|
@ -57,7 +57,7 @@ class UpdateCompanyRequest extends Request
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
// nlog($input);
|
||||
if (array_key_exists('settings', $input)) {
|
||||
$input['settings'] = $this->filterSaveableSettings($input['settings']);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user