mirror of
https://github.com/grocy/grocy.git
synced 2025-04-30 10:05:45 +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();
|
$logOldRowForStockUpdate->save();
|
||||||
|
|
||||||
$openDate = $stockRow->opened_date;
|
$openedDate = $stockRow->opened_date;
|
||||||
if ($open && $openDate == null) {
|
if ($open && $openDate == null)
|
||||||
$openDate = date('Y-m-d');
|
{
|
||||||
} else if (!$open) {
|
$openedDate = date('Y-m-d');
|
||||||
$openDate = null;
|
}
|
||||||
|
else if (!$open)
|
||||||
|
{
|
||||||
|
$openedDate = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$stockRow->update(array(
|
$stockRow->update(array(
|
||||||
@ -603,7 +606,7 @@ class StockService extends BaseService
|
|||||||
'price' => $price,
|
'price' => $price,
|
||||||
'best_before_date' => $bestBeforeDate,
|
'best_before_date' => $bestBeforeDate,
|
||||||
'location_id' => $locationId,
|
'location_id' => $locationId,
|
||||||
'opened_date' => $openDate,
|
'opened_date' => $openedDate,
|
||||||
'open' => $open
|
'open' => $open
|
||||||
));
|
));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user