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
842 stars 80 forks source link

Incorrect Prices in Shopping List if other QU than Stock is used. #742

Closed alkuzman closed 7 months ago

alkuzman commented 11 months ago

If I enter the shopping list item with for example PurchaseQU the prices are incorrect. See for example Mayo is 0 Eur for 1l and 4.02 for 1000ml (the factor is correctly set to 1000). image

I believe the following code in ShoppingListItemAdapter.java takes the amountInQuUnit and multiplies it with the price in stock Qu unit. image

I guess an easy solution would be to use item.getAmountDouble() instead of amountInQuUnit.

alkuzman commented 11 months ago

Just noticed the same issue is present in the Total price of the Shopping List.

dominiczedler commented 7 months ago

Fixed with your contribution (e3673dfdad474b46ee58313bc747cb93afc349e8). :)