patzly / grocy-android

ERP beyond your fridge, now on your phone – An awesome companion app for grocy
https://patrickzedler.com/grocy/
GNU General Public License v3.0
879 stars 85 forks source link

Fix QU Conversion on Purchase #747

Closed jrandiny closed 1 year ago

jrandiny commented 1 year ago
Based on my understanding, this function should return a map to convert from the product "stock QU" to any QU. If that's the case, the code has some issue if we have >1 conversions to the same QU from different QU. Example: from to factor
bottle mL 100.0
mL Bottle 0.01
Bottle Bottle 1.0

The current code will create a map with 0.01 instead of 1.0 as the value for "Bottle" key

I only tested this for purchase and consume flow on my server (v4.0.0). Should be related to #745

ssiegel commented 1 year ago

I can confirm that this fixes #744/#745 with Grocy 4.0.0/4.0.1. I would appreciate if an update with this patch could be released soon.

Coniface commented 1 year ago

I confirm the fix works as well, I came here as I'm experiencing the issue too while setting up Grocy. I think I'll wait for the fix because it's very confusing right now.

dominiczedler commented 1 year ago

Thank you @jrandiny for your fix and thank you guys for testing! Sorry for the delay, much work in office currently.

Coniface commented 1 year ago

Wow @dominiczedler that was fast, many thanks for the fix to everyone 👌