Fixed PHP warning (fixes #1267)

This commit is contained in:
Bernd Bestel
2021-01-12 10:40:14 +01:00
parent 27169e1428
commit e42f4b405d

View File

@@ -157,18 +157,18 @@ class BaseController
if (GROCY_AUTHENTICATED) if (GROCY_AUTHENTICATED)
{ {
$this->View->set('permissions', User::PermissionList()); $this->View->set('permissions', User::PermissionList());
}
$decimalPlacesAmounts = intval($this->getUsersService()->GetUserSetting(GROCY_USER_ID, 'stock_decimal_places_amounts')); $decimalPlacesAmounts = intval($this->getUsersService()->GetUserSetting(GROCY_USER_ID, 'stock_decimal_places_amounts'));
if ($decimalPlacesAmounts <= 0) if ($decimalPlacesAmounts <= 0)
{ {
$defaultMinAmount = 1; $defaultMinAmount = 1;
}
else
{
$defaultMinAmount = '0.' . str_repeat('0', $decimalPlacesAmounts - 1) . '1';
}
$this->View->set('DEFAULT_MIN_AMOUNT', $defaultMinAmount);
} }
else
{
$defaultMinAmount = '0.' . str_repeat('0', $decimalPlacesAmounts - 1) . '1';
}
$this->View->set('DEFAULT_MIN_AMOUNT', $defaultMinAmount);
return $this->View->render($response, $page, $data); return $this->View->render($response, $page, $data);
} }