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

Add columns to "pay your supplier" report #13037

Conversation

chahmedejaz
Copy link
Collaborator

@chahmedejaz chahmedejaz commented Dec 12, 2024

⚠️ Please use clockify code #12476 Flower Farms

What? Why?

What should we test?

  • As mentioned in the issue

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

@chahmedejaz chahmedejaz marked this pull request as ready for review December 12, 2024 20:25
@chahmedejaz chahmedejaz added the user facing changes Thes pull requests affect the user experience label Dec 12, 2024
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 Note for next time, it's better to add the specs in the same commit as the changes you make. It makes reviewing easier as we can look at the changes and specs on the same page.

lib/reporting/reports/suppliers/helpers/columns_helper.rb Outdated Show resolved Hide resolved
@chahmedejaz
Copy link
Collaborator Author

Note for next time, it's better to add the specs in the same commit as the changes you make. It makes reviewing easier as we can look at the changes and specs on the same page.

Sure, @rioug will take care of it from now onwards. Thanks 🙂

@chahmedejaz
Copy link
Collaborator Author

chahmedejaz commented Dec 16, 2024

I've been interested to try this gem for this sort of thing: https://github.com/RST-J/human_attribute_values
It would allow translators to choose a more specific description, which might be better in some circumstances.

Thanks for introducing this gem, David. Yes, it seems more flexible indeed. Maybe in future we may find a usecase to add this 😬

@filipefurtad0 filipefurtad0 force-pushed the task/13013-add-columns-supplier-report branch from 0c9219e to 4c6ec09 Compare January 16, 2025 22:02
@filipefurtad0 filipefurtad0 self-assigned this Jan 16, 2025
@filipefurtad0 filipefurtad0 added pr-staged-au staging.openfoodnetwork.org.au and removed pr-staged-au staging.openfoodnetwork.org.au labels Jan 16, 2025
@filipefurtad0
Copy link
Contributor

filipefurtad0 commented Jan 16, 2025

Hey @chahmedejaz ,

Thanks for this work and I was able to verify that:

  • the two new columns are now included, when generating the report 🟢
  • these are de-selected, by default 🟢

However, it seems the TOTAL for the Total tax on Product ($) column is not appearing. I'd think this is necessary requirement - following the logic from other columns. I'll move this issue to "In Progress" for now, so the Total can be added, accordingly.

image

@RachL
Copy link
Contributor

RachL commented Jan 17, 2025

@filipefurtad0 thanks! When this is back in testing, FYI Theresa has an error in production I'm not able to reproduce yet. If you have a magical idea what it can be linked to^^ #12879 (comment)

@chahmedejaz chahmedejaz force-pushed the task/13013-add-columns-supplier-report branch from 38727b0 to eab043e Compare January 31, 2025 12:32
@chahmedejaz chahmedejaz force-pushed the task/13013-add-columns-supplier-report branch from eab043e to 5dddf8b Compare January 31, 2025 12:35
@chahmedejaz chahmedejaz requested a review from rioug January 31, 2025 13:38
@chahmedejaz
Copy link
Collaborator Author

Thanks @filipefurtad0 - It's fixed now 😄

@rioug rioug requested a review from dacook February 2, 2025 23:08
Copy link
Collaborator

@rioug rioug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good 👍

@filipefurtad0 filipefurtad0 added pr-staged-au staging.openfoodnetwork.org.au and removed pr-staged-au staging.openfoodnetwork.org.au labels Feb 7, 2025
@filipefurtad0
Copy link
Contributor

Hey @chahmedejaz ,

The issue with the totals is fixed - thanks for that!

But I'm wondering why are the tax on enterprise fees and the enterprise fees not displayed, in this case?

image

The applied tax rate is this one - i.e., not included in the price:
image

I'm looking at the specs, and it does not look like we cover such cases. I would not say this is a blocker, for this PR. I'm happy to add these at unit or system level, following your approach.

Happy for your feedback on the missing fees. Thanks again 🙏

@filipefurtad0 filipefurtad0 added feedback-needed and removed pr-staged-au staging.openfoodnetwork.org.au labels Feb 7, 2025
@chahmedejaz
Copy link
Collaborator Author

Hi @filipefurtad0 - Thanks for raising this. Please review the loom for the following loom for clarification:
https://www.loom.com/share/0943538f611d429ea07fffa34e6a3d29?sid=d49afeeb-bb76-4217-baa3-5e84ad5af6c3

For ref, conv onwards: #12879 (comment)
Please let me know if you have any questions. Thanks.

I'm looking at the specs, and it does not look like we cover such cases. I would not say this is a blocker, for this PR. I'm happy to add these at unit or system level, following your approach.

Thanks for noticing this. It'd be great 😄

@filipefurtad0
Copy link
Contributor

filipefurtad0 commented Feb 7, 2025

Thank you so much @chahmedejaz for posting a Loom on this. This is really helpful.

There are plenty of ways to set up the fees, and I should have been more clear. I'll try to clarify below. I would split this into two cases:

Test case 1)

On the example I've posted before - no enterprise fees appearing on the report - I've set this in the following way:

Enterprise fee on the Hub (left side) of the pic below:

image

The way I've set the enterprise fee, was in the incoming section of the order cycle, at the producer products (I've renamed the fee for clarity, it now includes HUB in the naming, so it is clear where it comes from):

image

Indeed in the order, it is appearing, as you mention, the Hub - but it is indicated as the supplier:

image

As mentioned, these fees are not appearing on the report:

image

Test case 2)

Now, I've cloned the order cycle, and added the enterprise fee, from the producer, (right side) of the pic below:

image

As before, I've added this fee on the incoming section of the order cycle, at the producer products (it includes SUPPLIER in the naming, so it is clear where it comes from):

image

It is displayed in the order, just as before, but indicates the owner of the fee - the Supplier:

image

And now, we can see that the report displays the values for the enterprises fees:

image

Summary

So, it seems, that not all fees added to the incoming section of the order cycle (suppliers section) are being considered. This only happens, if the added fee was created by the supplier.

I would expect, that all fees placed on the incoming section of the order cycle for a given supplier, would appear as fees to be paid for that supplier. I'm not sure this is a real-life use case, though.

I think we're good to merge, but I'll place a comment on the issue.

Many thanks again @chahmedejaz for your awesome work and your quick reply 🙏

@filipefurtad0 filipefurtad0 merged commit d09efec into openfoodfoundation:master Feb 7, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user facing changes Thes pull requests affect the user experience
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add columns to "pay your supplier" report
5 participants