mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 10:14:39 +00:00
Fixed zero decimals handling (fixes #1213)
This commit is contained in:
@@ -159,6 +159,17 @@ class BaseController
|
||||
$this->View->set('permissions', User::PermissionList());
|
||||
}
|
||||
|
||||
$decimalPlacesAmounts = intval($this->getUsersService()->GetUserSetting(GROCY_USER_ID, 'stock_decimal_places_amounts'));
|
||||
if ($decimalPlacesAmounts <= 0)
|
||||
{
|
||||
$defaultMinAmount = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$defaultMinAmount = '0.' . str_repeat('0', $decimalPlacesAmounts - 1) . '1';
|
||||
}
|
||||
$this->View->set('DEFAULT_MIN_AMOUNT', $defaultMinAmount);
|
||||
|
||||
return $this->View->render($response, $page, $data);
|
||||
}
|
||||
|
||||
@@ -168,7 +179,6 @@ class BaseController
|
||||
try
|
||||
{
|
||||
$usersService = $this->getUsersService();
|
||||
|
||||
if (defined('GROCY_USER_ID'))
|
||||
{
|
||||
$this->View->set('userSettings', $usersService->GetUserSettings(GROCY_USER_ID));
|
||||
|
Reference in New Issue
Block a user