mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Little refinements for #507
This commit is contained in:
parent
ef9f28d154
commit
ec2551d263
@ -368,3 +368,9 @@ Grocy.Components.RecipePicker.GetPicker().on('change', function (e)
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||
{
|
||||
// Just save the current recipe on every change of the product picker as a workflow could be started which leaves the page...
|
||||
Grocy.Api.Put('objects/recipes/' + Grocy.EditObjectId, $('#recipe-form').serializeJSON(), function () { }, function () { });
|
||||
});
|
||||
|
@ -591,11 +591,14 @@ class StockService extends BaseService
|
||||
));
|
||||
$logOldRowForStockUpdate->save();
|
||||
|
||||
$openDate = $stockRow->opened_date;
|
||||
if ($open && $openDate == null) {
|
||||
$openDate = date('Y-m-d');
|
||||
} else if (!$open) {
|
||||
$openDate = null;
|
||||
$openedDate = $stockRow->opened_date;
|
||||
if ($open && $openDate == null)
|
||||
{
|
||||
$openedDate = date('Y-m-d');
|
||||
}
|
||||
else if (!$open)
|
||||
{
|
||||
$openedDate = null;
|
||||
}
|
||||
|
||||
$stockRow->update(array(
|
||||
@ -603,7 +606,7 @@ class StockService extends BaseService
|
||||
'price' => $price,
|
||||
'best_before_date' => $bestBeforeDate,
|
||||
'location_id' => $locationId,
|
||||
'opened_date' => $openDate,
|
||||
'opened_date' => $openedDate,
|
||||
'open' => $open
|
||||
));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user