mirror of
https://github.com/grocy/grocy.git
synced 2025-08-19 20:11:16 +00:00
Restore the original due date when undoing a product opened transaction (fixes #1659)
This commit is contained in:
@@ -1426,7 +1426,8 @@ class StockService extends BaseService
|
||||
$stockRows = $this->getDatabase()->stock()->where('stock_id = :1 AND amount = :2 AND purchased_date = :3', $logRow->stock_id, $logRow->amount, $logRow->purchased_date)->limit(1);
|
||||
$stockRows->update([
|
||||
'open' => 0,
|
||||
'opened_date' => null
|
||||
'opened_date' => null,
|
||||
'best_before_date' => $logRow->best_before_date // Is only relevant when the product has "Default due days after opened", but also doesn't hurt for other products
|
||||
]);
|
||||
|
||||
// Update log entry
|
||||
|
Reference in New Issue
Block a user