mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Allow price up to 4 decimals instead of 2 (#1077)
* Allow price to be 4 decimals * remove logging * Finalize custom decimal places by user setting * Typo Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
@@ -862,7 +862,8 @@ class StockService extends BaseService
|
||||
if ($productRow != null && !empty($productRow))
|
||||
{
|
||||
$newAmount = $productRow->amount - $amount;
|
||||
if ($newAmount < 0.01)
|
||||
|
||||
if ($newAmount < floatval('0.' . str_repeat('0', intval($this->getUsersService()->GetUserSetting(GROCY_USER_ID, 'stock_decimal_places_amounts')) - 1) . '1'))
|
||||
{
|
||||
$productRow->delete();
|
||||
}
|
||||
|
Reference in New Issue
Block a user