Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Reports] Wrong "bulk unit size" in bulk co-op supplier report #9747

Closed
audez opened this issue Oct 6, 2022 · 8 comments
Closed

[Reports] Wrong "bulk unit size" in bulk co-op supplier report #9747

audez opened this issue Oct 6, 2022 · 8 comments
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround.

Comments

@audez
Copy link
Collaborator

audez commented Oct 6, 2022

Description

The "bulk unit size" field in the bulk co-op supplier report is displaying 0 value instead of the bulk unit size.

Steps to Reproduce

  1. Create a product with group by option on "yes" and set bulk unit value to 30 for instance
  2. Pass an order with this product
  3. Go to admin/reports/bulk_coop and see that the bulk unit size column is not displaying the value you previously set

Animated Gif/Screenshot

I chose "bulk unit size = 30" for the "Amandes vrac" product
Capture d’écran 2022-10-06 à 11 29 21

bulk co-op Supplier report

In admin/reports/bulk_coop, Supplier report, 0 value is displayed
Capture d’écran 2022-10-06 à 11 29 43

bulk co-op Allocation report

In admin/reports/bulk_coop, Allocation report, the right value (30) is displayed. But with #9745 it's not possible to rely on this report.
Capture d’écran 2022-10-06 à 11 37 22

Severity

bug-s3: a feature is broken but there is a workaround

@audez audez added good first issue bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround. labels Oct 6, 2022
@krishnasingh001
Copy link

Hello @audez I would like to work on this one. Could you please assign it to me?

@audez audez changed the title [Admin] Wrong "bulk unit size" in bulk co-op supplier report [Reports] Wrong "bulk unit size" in bulk co-op supplier report Oct 14, 2022
@RachL
Copy link
Contributor

RachL commented Nov 16, 2022

hello @krishnasingh001 just checking in: are still working or planning to work on this issue? Don't hesitate if you need help :)

@krishnasingh001
Copy link

Hello @RachL, I wasn't able to reproduce this issue locally. I thought this issue has been fixed. But will check this issue again and update it here. Thanks

@RachL
Copy link
Contributor

RachL commented Dec 28, 2022

@lin-d-hop this one might be a good candidate for the reports update epic?

@rioug
Copy link
Collaborator

rioug commented Jan 9, 2023

Hi @RachL , I am having a look at this.

As krishnasingh001 mentioned above, I wasn't able to reproduce the issue on my first try. I am having a look at the code now to double check if there isn't any edge cases.

@rioug
Copy link
Collaborator

rioug commented Jan 10, 2023

Hi Again,

I went and looked at the code, as far as I can see it's getting the correct data. So unless I missed something, this has been fixed. For context, report where improved by this PR #9032 and the code hasn't changed since.

See below the steps I took to try reproducing the bug. :

  1. Add "group buy option" to a product, set Garlic bulk unit size to 25
    garlic_group_by_option

  2. Place an order with said product, Garlic is showing the bulk icon
    buy_garlic_bulk

  3. Run the Bulk Co-OpSupplier Report, the correct unit size of 25 is shown for Garlic
    bulk_coop_supplier_report

@RachL
Copy link
Contributor

RachL commented Jan 10, 2023

@audez are you still able to reproduce this one? If so, can you provide the step you did?

@audez
Copy link
Collaborator Author

audez commented Dec 7, 2024

hi, sorry for the very late reply.. I understand what happened here:
For my product i chose the product unit = 1kg and bulk unit size = 30. Thinking that it was 30kg, corresponding to the product unit.
But for weights, the "bulk unit size" will always be in g, as seen in the documentation):

If the product is sold by:
Weight: units are in g (so if collective total must equal 5 kg then enter '5000' in this field)
Volume: units are in litres (so if collective total must be 10 l then enter '10' in this field)

In my case, bulk unit = 30 was actually 0.03 kg, and then was rounded to 0.

I also see that when we display decimal number in this field, it's rounded to the lower number (eg bulk unit size = 100.7 will be transformed to 100).

I guess this wasn't a bug then, sorry! To avoid any confusion for other people, and as it's a non-obvious rule, I think it would be great to add it on screen, for instance:
Bulk unit size (only in g or L / decimals not accepted)

Edit: i forgot i wishlisted on the same topic.. 😅
openfoodfoundation/wishlist#300

@RachL RachL closed this as completed Dec 9, 2024
@github-project-automation github-project-automation bot moved this from All the things 💤 to Done in OFN Delivery board Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-s3 The bug is stopping a critical or non-critical feature but there is a usable workaround.
Projects
Status: Done
Development

No branches or pull requests

4 participants