mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 04:34:34 -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',
|
'language_id' => 'string',
|
||||||
'show_currency_code' => 'bool',
|
'show_currency_code' => 'bool',
|
||||||
'website' => 'string',
|
'website' => 'string',
|
||||||
|
'default_task_rate' => 'float',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -95,6 +95,10 @@ class StoreClientRequest extends Request
|
|||||||
|
|
||||||
if (array_key_exists('settings', $input) && ! empty($input['settings'])) {
|
if (array_key_exists('settings', $input) && ! empty($input['settings'])) {
|
||||||
foreach ($input['settings'] as $key => $value) {
|
foreach ($input['settings'] as $key => $value) {
|
||||||
|
|
||||||
|
if($key == 'default_task_rate')
|
||||||
|
$value = floatval($value);
|
||||||
|
|
||||||
$settings->{$key} = $value;
|
$settings->{$key} = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,6 +157,10 @@ class UpdateClientRequest extends Request
|
|||||||
if (! array_key_exists($key, $saveable_casts)) {
|
if (! array_key_exists($key, $saveable_casts)) {
|
||||||
unset($settings->{$key});
|
unset($settings->{$key});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($key == 'default_task_rate'){
|
||||||
|
$settings->default_task_rate = floatval($value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $settings;
|
return $settings;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user