mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +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 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';
|
return $bool ? 'true' : 'false';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function BoolToInt(bool $bool)
|
||||||
|
{
|
||||||
|
return $bool ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
function ExternalSettingValue(string $value)
|
function ExternalSettingValue(string $value)
|
||||||
{
|
{
|
||||||
$tvalue = rtrim($value, "\r\n");
|
$tvalue = rtrim($value, "\r\n");
|
||||||
|
@ -402,11 +402,11 @@ class StockService extends BaseService
|
|||||||
|
|
||||||
$openedDate = $stockRow->opened_date;
|
$openedDate = $stockRow->opened_date;
|
||||||
|
|
||||||
if ($open && $openedDate == null)
|
if (boolval($open) && $openedDate == null)
|
||||||
{
|
{
|
||||||
$openedDate = date('Y-m-d');
|
$openedDate = date('Y-m-d');
|
||||||
}
|
}
|
||||||
elseif (!$open)
|
elseif (!boolval($open))
|
||||||
{
|
{
|
||||||
$openedDate = null;
|
$openedDate = null;
|
||||||
}
|
}
|
||||||
@ -418,7 +418,7 @@ class StockService extends BaseService
|
|||||||
'location_id' => $locationId,
|
'location_id' => $locationId,
|
||||||
'shopping_location_id' => $shoppingLocationId,
|
'shopping_location_id' => $shoppingLocationId,
|
||||||
'opened_date' => $openedDate,
|
'opened_date' => $openedDate,
|
||||||
'open' => $open,
|
'open' => BoolToInt($open),
|
||||||
'purchased_date' => $purchasedDate
|
'purchased_date' => $purchasedDate
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user