-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Display fees name instead of type on invoices #9442
Display fees name instead of type on invoices #9442
Conversation
cd13cec
to
7152802
Compare
I'm wondering why (ref: https://github.com/openfoodfoundation/openfoodnetwork/runs/7501482753?check_suite_focus=true) @filipefurtad0 do you have any idea? |
I've pulled this branch to my local system now and cannot reproduce the missing spec. I'm running The only thing I can think of is some order dependent issue, or some leaking of configurations. Maybe it's time I pick this one up again: #8461 🙈 |
Thanks @filipefurtad0 for having a look at it. Will take a look at #8461 🙈 |
7152802
to
f9e739c
Compare
There's some mystery around this: suddenly, I can reproduce it. It is happening because there are two adjustments with label
I'm not sure why this is failing now though... I think if we define
Then it passes - at least locally. |
Thanks a lot @filipefurtad0 . admin_fee_summary = adjustments.reject { |a| a.id == shipping_adjustment.id }.first It should work now! |
config/locales/en.yml
Outdated
@@ -2835,7 +2835,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using | |||
tag_rules: "Tag Rules" | |||
shop_preferences: "Shop Preferences" | |||
enterprise_fee_whole_order: Whole order | |||
enterprise_fee_by: "%{type} fee by %{role} %{enterprise_name}" | |||
enterprise_fee_by: "%{name} fee by %{role} %{enterprise_name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this can cause problems. If other languages are not updated then the old variable is required but won't be set. The solution would be to introduce a new translation key. But let's monitor this in the release and see what Transifex does. Maybe it updates this automatically which would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkllnk so, this cause issue: https://app.bugsnag.com/yaycode/openfoodnetwork-uk/errors/633477967f4d38000830e14e?event_id=6334779600979f7f70b60000&i=sk&m=nw
I'll update the PR by creating a new key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've introduced a new key enterprise_fee_by_name
: 5e1d769
Moving to Test Ready
, I assume this is small enough to not be reviewed.
We got some related spec failures. |
I rebased it onto master. Let see how it goes. |
2132cf6
to
9e4dcfe
Compare
75f67bc
to
090cac0
Compare
@filipefurtad0 My result:
|
Hey @jibees , After pulling and resetting this branch to the latest commit 090cac0, running
|
Ok, it seems you are getting:
I'm getting:
So in your case, this assertion fails: For some reason, your I have no idea why this happens, I've quickly searched for a solution to harmonize our results but could not really find anything. If you comment out this assertion only for the sake of making your test pass locally, would you then get the same error I'm getting? |
Hi @filipefurtad0
No, actually if I comment those lines before the assertion that failed on your side (and on CI), it actually pass... It seems that my pdf is rendered in a very strange way inside specs, with text overlapping some others, or misplaced text... But maybe it is also misplaced in the CI...
When I looked at an invoice (alternative model): I would say that EDIT: and this spec actually fails on master too for me |
PDF is rendered like this:
We can clearly see that this seems to be a overlapping issue. Let's try to increase the size of the PDF? |
Fully agree.
This would be ideal. Maybe this is a setting from |
One option could be to set After doing this, the text is not clipped and the spec is green with the correct assertion, i.e.:
instead of:
Edit: PR #9674 tries to achieve this as simply as possible. The setting works (the pdf page size changes indeed). I hope this passes on your system as well 🤞 |
7d4efff
to
1dcfb56
Compare
Ok, thanks @drummer83 : I've found this issue, and this was well related to this PR. Now moving to |
5e1d769
to
76dcf30
Compare
Thanks @jibees, this looks much better now. I can populate and view the cart with all fees enabled now. It seems we still need to update the /cart page. Here we can see both: the separate fees AND the combined Admin & Handling: Just a note (but I think this is ok): We do see the fee names instead of the fee type also for all existing (old) orders. Moving to In Dev. We're close! 💪 |
c592812
to
01a8b42
Compare
Back into 'Code Review' since it has changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. 😎
+ update specs as well
+ update specs as well
The adjustment factory calls everything "Shipping" by default. This was confusing here because we were explicitely looking at a non-shipping fee.
it could lead to issues when key is not updated and we should avoid that kind of issue.
01a8b42
to
8b89c90
Compare
Hi @jibees, Fees setupPlaces checkedObservations (before and after staging)
Findings (before and after staging)
SummaryI think we are good here. Thanks JB for your patience! |
@jibees @drummer83 I'm not able to make this work in FR production. I can't even see "admin & handling" line anymore. I do see the pies on the shopfront and fees in the backend. But nothing in the cart or on the invoice. What am I missing: is there a toggle somewhere? |
@RachL I am not aware of a toggle. You need to set up an enterprise fee which is per order. Fees per item are included in the product price and thus not displayed separately in the cart and invoices. And the fee needs to be added to the order cycle of course (step 2 or 3). After updating the fees you might need to empty your cart and start over again. |
@RachL You mean that on invoices, you don't see any fees? There is no toggle. |
@jibees yes, I only see shipping fees... I need to dig more |
What? Why?
Closes #8904
Two steps:
What should we test?
Release notes
Changelog Category: User facing changes
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates