mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
421 (#507)
* refactor to be stock/entry/{entryId} * Allow recipeform add productworkflow * on document ready stockdetail filter based on ProductPicker * openDate fixes for undo * RefreshStockDetailRow refresh location-id
This commit is contained in:
@@ -591,11 +591,19 @@ class StockService extends BaseService
|
||||
));
|
||||
$logOldRowForStockUpdate->save();
|
||||
|
||||
$openDate = $stockRow->opened_date;
|
||||
if ($open && $openDate == null) {
|
||||
$openDate = date('Y-m-d');
|
||||
} else if (!$open) {
|
||||
$openDate = null;
|
||||
}
|
||||
|
||||
$stockRow->update(array(
|
||||
'amount' => $amount,
|
||||
'price' => $price,
|
||||
'best_before_date' => $bestBeforeDate,
|
||||
'location_id' => $locationId,
|
||||
'opened_date' => $openDate,
|
||||
'open' => $open
|
||||
));
|
||||
|
||||
@@ -1071,12 +1079,20 @@ class StockService extends BaseService
|
||||
throw new \Exception('Booking does not exist or was already undone');
|
||||
}
|
||||
|
||||
$openDate = $logRow->opened_date;
|
||||
$open = true;
|
||||
if ($openDate == null) {
|
||||
$open = false;
|
||||
}
|
||||
|
||||
$stockRow->update(array(
|
||||
'amount' => $logRow->amount,
|
||||
'best_before_date' => $logRow->best_before_date,
|
||||
'purchased_date' => $logRow->purchased_date,
|
||||
'price' => $logRow->price,
|
||||
'location_id' => $logRow->location_id
|
||||
'location_id' => $logRow->location_id,
|
||||
'open' => $open,
|
||||
'opened_date' => $openDate
|
||||
));
|
||||
|
||||
// Update log entry
|
||||
|
Reference in New Issue
Block a user