mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Fixed qu_id_stock change handling related to product_barcode amounts (fixes #1976)
This commit is contained in:
parent
2fbd559105
commit
52e2c6d480
@ -16,6 +16,7 @@
|
||||
- Fixed that adding Userfields to existing stock entries was not possible (only editing existing Userfield values, e.g. added during purchase or inventory, was possible)
|
||||
- Fixed that it was not possible to change a products stock QU, when the needed unit conversion (old QU => new QU) was only defined globally (means on QU level) or by the products "Factor purchase to stock quantity unit"
|
||||
- Fixed that when changing a products stock QU, the products "Quick consume mount", "Energy (kcal)" and "Tare weight" wasn't updated according to the corresponding unit conversion factor
|
||||
- Fixed that when changing a products stock QU, the product barcode amounts were also changed based on the corresponding unit conversion factor
|
||||
|
||||
### Shopping list
|
||||
|
||||
|
@ -29,11 +29,6 @@ BEGIN
|
||||
WHERE type = 'product'
|
||||
AND product_id = NEW.id;
|
||||
|
||||
UPDATE product_barcodes
|
||||
SET amount = amount * IFNULL((SELECT factor FROM quantity_unit_conversions_resolved WHERE product_id = NEW.id AND from_qu_id = OLD.qu_id_stock AND to_qu_id = NEW.qu_id_stock LIMIT 1), 1.0)
|
||||
WHERE product_id = NEW.id
|
||||
AND amount IS NOT NULL;
|
||||
|
||||
UPDATE recipes_pos
|
||||
SET amount = amount * IFNULL((SELECT factor FROM quantity_unit_conversions_resolved WHERE product_id = NEW.id AND from_qu_id = OLD.qu_id_stock AND to_qu_id = NEW.qu_id_stock LIMIT 1), 1.0)
|
||||
WHERE product_id = NEW.id;
|
||||
|
Loading…
x
Reference in New Issue
Block a user