mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed that editing stock entries was not possible (fixes #1268)
This commit is contained in:
parent
e42f4b405d
commit
bfa3347a20
@ -1 +1,2 @@
|
||||
- Fixed that tracking chores with "Done by" a different user was not possible
|
||||
- Fixed that editing stock entries was not possible
|
||||
|
@ -156,6 +156,11 @@ function BoolToString(bool $bool)
|
||||
return $bool ? 'true' : 'false';
|
||||
}
|
||||
|
||||
function BoolToInt(bool $bool)
|
||||
{
|
||||
return $bool ? 1 : 0;
|
||||
}
|
||||
|
||||
function ExternalSettingValue(string $value)
|
||||
{
|
||||
$tvalue = rtrim($value, "\r\n");
|
||||
|
@ -402,11 +402,11 @@ class StockService extends BaseService
|
||||
|
||||
$openedDate = $stockRow->opened_date;
|
||||
|
||||
if ($open && $openedDate == null)
|
||||
if (boolval($open) && $openedDate == null)
|
||||
{
|
||||
$openedDate = date('Y-m-d');
|
||||
}
|
||||
elseif (!$open)
|
||||
elseif (!boolval($open))
|
||||
{
|
||||
$openedDate = null;
|
||||
}
|
||||
@ -418,7 +418,7 @@ class StockService extends BaseService
|
||||
'location_id' => $locationId,
|
||||
'shopping_location_id' => $shoppingLocationId,
|
||||
'opened_date' => $openedDate,
|
||||
'open' => $open,
|
||||
'open' => BoolToInt($open),
|
||||
'purchased_date' => $purchasedDate
|
||||
]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user