diff --git a/changelog/65_UNRELEASED_xxxx-xx-xx.md b/changelog/65_UNRELEASED_xxxx-xx-xx.md index a81072b4..0a741130 100644 --- a/changelog/65_UNRELEASED_xxxx-xx-xx.md +++ b/changelog/65_UNRELEASED_xxxx-xx-xx.md @@ -5,6 +5,7 @@ - Fixed that the labels of context-/more-menu items were not readable in Night Mode (thanks @corbolais) - Fixed that auto night mode over midnight did not always work - Fixed that the "Add as new product" productpicker workflow, started from the shopping list item form, always selected the default shopping list after finishing the flow +- Fixed that when undoing a product opened transaction and when the product has "Default due days after opened", the original due date wasn't restored - Fixed that "Track date only"-chores were shown as overdue on the due day on the chores overview page ### API diff --git a/services/StockService.php b/services/StockService.php index 88e959a7..5b39aadd 100644 --- a/services/StockService.php +++ b/services/StockService.php @@ -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