Forceu / barcodebuddy

Barcode system for Grocy
GNU Affero General Public License v3.0
433 stars 58 forks source link

Wrong unit used for purchase for the first time #209

Open rguilloteau opened 1 year ago

rguilloteau commented 1 year ago

Hi! I tried to add pasta with BarcodeBuddy but I got an issue. When I try to purchase a "Paquet" (my purchase unit), it buys 1g and 500g.

Just below, you can see the different units used image

And there is the log from BarcodeBuddy: 2023-02-26 12:59:54: Product found. Adding 1 Gramme of Penne No default best before date set! [8076802085738]

When I purchase from the grocy interface, 500g are added to the stock. I would like to know if someone else got this issue.

EDIT: I found the parameter to activate

rguilloteau commented 1 year ago

Just found out, the conversion is not taking into account when a item is bought for the first time

2023-02-26 14:37:17: Product found. Adding 500 Gramme of Penne 500g [8076802085738]. In Stock: 501
2023-02-26 14:36:51: Adding 1 Gramme of Penne 500g
2023-02-26 14:36:51: Associated barcode 8076802085738 with Penne 500g
2023-02-26 14:36:17: Unknown barcode looked up, found name: Penne [8076802085738]
Forceu commented 1 year ago

Thanks, that is indeed a bug and will be fixed with the next release.

Royal2000H commented 9 months ago

It's slightly different with the current version of Grocy but still needs to be fixed.

If in Grocy: you have a "pack" and a pack = 6 pieces, and quantity unit (QU) Stock = "piece" and QU Purchase = "pack"

Barcode Buddy is not respecting QU purchase at all.

@Forceu Are you still planning to fix this?