heig / GrocyToBring

Copy missing items from grocy to bring
18 stars 3 forks source link

Modifications for Grocy 4.x #6

Closed jacotec closed 11 months ago

jacotec commented 11 months ago

In Grocy 4.0.0 the pruduct property "qu_factor_purchase_to_stock" was removed which led to a division by zero error.

Replacement for correct calculations is "qu_conversion_factor_purchase_to_stock" which is a product field in the store API.

This commit changes the calculation to use the new field, in addition it uses the plural quantity name if the amount to purchase is >1