Fixed shopping_location_id was missing for consume / transfer stock transactions and when undoing them (fixes #2896)

This commit is contained in:
Bernd Bestel 2026-03-29 15:27:40 +02:00
parent 736cc8c2f6
commit c0c9a38e39
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 10 additions and 4 deletions

View File

@ -11,6 +11,8 @@
### Stock
- Fixed that changing the location on the purchase page re-initialized the due date based on product defaults (if any)
- Fixed that when undoing a product consume or transfer transaction, the store of the corresponding stock entry wasn't restored
- This will only apply to new consume / transfer transactions, not when undoing transactions made before using this release
### Shopping list

View File

@ -463,7 +463,8 @@ class StockService extends BaseService
'transaction_id' => $transactionId,
'user_id' => GROCY_USER_ID,
'location_id' => $stockEntry->location_id,
'note' => $stockEntry->note
'note' => $stockEntry->note,
'shopping_location_id' => $stockEntry->shopping_location_id
]);
$logRow->save();
@ -498,7 +499,8 @@ class StockService extends BaseService
'transaction_id' => $transactionId,
'user_id' => GROCY_USER_ID,
'location_id' => $stockEntry->location_id,
'note' => $stockEntry->note
'note' => $stockEntry->note,
'shopping_location_id' => $stockEntry->shopping_location_id
]);
$logRow->save();
@ -1532,7 +1534,8 @@ class StockService extends BaseService
'opened_date' => $logRow->opened_date,
'open' => $logRow->opened_date !== null,
'location_id' => $logRow->location_id,
'note' => $logRow->note
'note' => $logRow->note,
'shopping_location_id' => $logRow->shopping_location_id
]);
$stockRow->save();
@ -1583,7 +1586,8 @@ class StockService extends BaseService
'stock_id' => $logRow->stock_id,
'price' => $logRow->price,
'opened_date' => $logRow->opened_date,
'note' => $logRow->note
'note' => $logRow->note,
'shopping_location_id' => $logRow->shopping_location_id
]);
$stockRow->save();
}