Closed TurnrDev closed 2 years ago
On the desktop UI, it gets the correct conversion
I can confirm that on purchase this app ignores units defined for bar code. It takes only amount from bar code settings and unit is used from Product settings.
App should convert from bar code's units to product's units on purchase (as web frontend does).
I use app v2.1.0 with Grocy v3.2.0.
Please give me some time for the fix, I have other things in my life which are more important to me currently.
In meantime I was able to overcome this by moving bar codes with different units to sub-products. In that case conversion is done only on backend.
@kapitan-iglu
I can confirm that on purchase this app ignores units defined for bar code.
This should work, I cannot reproduce the behavior that a unit is not applied from a barcode on purchase page... Maybe you can make screenshots so I can reproduce it with your data?
@TurnrDev
I went to manage inventory and add One Litre to my milk product, but the system tried to add just over four litres. Looks like the system is confusing units?
I've spotted the bug in the code and tried to fix it. Now the app displays the same conversion like on the server (with your data). But I cannot guarantee that the thing with "system tried to add just over four litres" is fixed now, maybe you can tell me again whether it works after we've released the new version.
@TurnrDev The new version is released, can you tell me if the issue is still there? :)
I still see the issue in 2.2.1
@incase @TurnrDev I just tried it with the same data like you give me in the example, but for me it works like the web interface.
Can you please give me an easier example for reproducing this issue, and not with 6 conversions at the same time? Also I would like to see the default purchase quantity unit of the product.
And just for clearification, which pages are affected by the issue? Purchase, inventory, consume, transfer, or all together?
See attached photos.
Note: If I keep the "shoppping unit" as "Packungen" with factor 500 to the storage unit of grams (g) but delete the conversion factor (unit conversions) in the article between Packungen and grams, the app works as expected.
But I would like to be able to use Packungen (packages) in recipes - (ok, not necessarily on this product, but in general). It's also weird that the correct conversion in two settings results in the App misbehaving.
I've noticed that the wrong conversion only happens when the conversion is created specifically for the product. It also happens if the conversion is created for the QU but only if the product was created in the app and not on the web page. If everything was added on the webpage the app works (mostly. there is a little bug here: https://github.com/patzly/grocy-android/issues/530) fine that way.
@Mega-Cookie I don't understand what you mean with "conversion specifically for a product" and "conversion for a QU", the only place where you can have conversions is in a product, so I don't get it.
but only if the product was created in the app and not on the web page
If you see the same data for a product in the app and on the web interface, this cannot make a difference. This must either be a wrong observation or the web interface shows other data than the app shows and therefore behaves differently. So please look again if the product details are the same in the app and on the webinterface.
You can set a conversion for a QU on the webpage. These conversion are applied to every product that uses one of the QUs as a stock QU. But they don't show up as conversions for the product in the app. (the do on in the web interface.)
Sorry, I didn't see that... Maybe I have to include them somewhere in the code.
@incase How can you add a QU conversion to a product which have the stock unit (g) and purchase unit (Packung) as units, after you set these units (g and Packung) in your product? For me the web interface throws a constraint violation and I think internally the server creates unit conversions from the units in the product and therefore I can't use them exactly together in a new conversion... So you did you manage to do that? I just wanted to create your example data, but it doesn't let me do it like you have.
@incase @Mega-Cookie Maybe you can try this apk? (you would need to uninstall your current app because the apk has another signature) It has the fix that the default unit conversions are loaded, maybe this has something to do with the issue here...
I'm able to reproduce this bug:
Now go to the webpage, purchase 1 pack. It gives you 72 fluid ounce as expected. But in the app, it gives you 1/6 fluid ounce using the piece to pack conversion instead of the pack to fluid ounce conversion.
Now go to the product and delete the product specific conversion 1 pack = 6 pieces. Both the webpage and app now gives the correct result using the purchase factor!
Judging by my data and the one from others on this thread, it appears as if we always use the last conversion in the list instead of the correct one when product specific conversions are present. (In addition to the built-in conversion from purchase factor.)
So @MrJohnZoidberg, I understand you'd want a simple reproduction without 6 conversions but it might be necessary because we're picking the wrong conversion here. Without enough conversions on the list, we can pick the last one or a random one and it might happen to the right one. So minimum to reproduce is 1 pair of conversions in addition to the purchase unit conversion and probably keep adding more until you see the bug.
BTW, I just purchased an unlock key. Keep up the good work.
Hi, sorry I've been unable to test it due to personal reasons but I'll be setting grocy back up soon and let you know if I have an issues
@0xE1E10 Thanks a lot for your help! I could reproduce this with the current Playstore version. :-) And the APK in this comment should already have the working fix (I just tested it and it works like the web interface).
- Fixed: Product 'purchase to stock' conversion is preferred to additional conversions (#490)
- Fixed: Quantity units from default conversions are now selectable on transaction pages (#530)
So I will close this issue now and you can reopen it, if you find something in the next released version which is still not right with the conversions. :-)
And I will also add standard unit conversions editing, this is currently not possible in our app.
I went to manage inventory and add One Litre to my milk product, but the system tried to add just over four litres. Looks like the system is confusing units?
The web UI doesn't do the same thing.
I've attached screenshots from mobile of the product page and the purchase page. In another comment I'll attach web UI screenshots