mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Coerce default_task_rate to float
This commit is contained in:
parent
bf03ba3780
commit
485fea03c7
@ -503,6 +503,7 @@ class CompanySettings extends BaseSettings
|
||||
'language_id' => 'string',
|
||||
'show_currency_code' => 'bool',
|
||||
'website' => 'string',
|
||||
'default_task_rate' => 'float',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -95,6 +95,10 @@ class StoreClientRequest extends Request
|
||||
|
||||
if (array_key_exists('settings', $input) && ! empty($input['settings'])) {
|
||||
foreach ($input['settings'] as $key => $value) {
|
||||
|
||||
if($key == 'default_task_rate')
|
||||
$value = floatval($value);
|
||||
|
||||
$settings->{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
@ -157,6 +157,10 @@ class UpdateClientRequest extends Request
|
||||
if (! array_key_exists($key, $saveable_casts)) {
|
||||
unset($settings->{$key});
|
||||
}
|
||||
|
||||
if($key == 'default_task_rate'){
|
||||
$settings->default_task_rate = floatval($value);
|
||||
}
|
||||
}
|
||||
|
||||
return $settings;
|
||||
|
Loading…
x
Reference in New Issue
Block a user