-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
#11358 Fix full tax summary display breakdown #11446
#11358 Fix full tax summary display breakdown #11446
Conversation
thanks @adrian-martinez-interactiv4 this looks to be an important fix to get right. Unfortunately the proposed changes do make a range of tests fail - https://travis-ci.org/magento/magento2/jobs/287781682. It seems that these changes do have some side effects which either need to be mitigated or we would need to confirm that the original tests are buggy as well. In particular results like https://travis-ci.org/magento/magento2/jobs/287781682#L1115 need to be looked into more closely. Can you please take a look at these test results and let us know what you think. |
@fooman for sure, I just tried to apply the proposed patch and crossed fingers, but a deeper look shows that actually tests are ok, and they are crashing because this fix doesn't allow compound tax rules by priority anymore (splits them and results are as if they were calculated one after another, what is not the same). I'll update you with more info soon. |
03a77f9
to
4a0b6e6
Compare
Hi again @fooman , good news and bad news. The good news are that I have finally achieved the goal of split rate amounts correctly, store them and retrieve them to be displayed in cart and checkout summary, and covered them with tests by adapting the existing tests, adding the expected calculated amount per rate to checks where needed. The bad new is I've had to add set/get amount methods to a couple interfaces marked as @api: And I was forced to edit this one, because tax details are retrieved via REST api, and due to nature of the api that uses \Magento\Framework\Reflection\DataObjectProcessor::buildOutputDataArray to transform the objects to array using its interfaces, this change was needed to make the ws return rate amount values: Codacy is complaining about a single variable, but all travis build is successful: Can you take a quick look and let me know what you think? Thank you. |
Hi @fooman , any news about this? |
@adrian-martinez-interactiv4 thanks for the ping. I am still gathering my thoughts on this one. What I think so far: Well done! that's indeed good news. You've made a couple of changes to frontend template files - would you mind confirming why these were needed? Also looking at the test changes would we need 1 additional scenario that covers a Canadian setup (ie to cover both compound vs cumulative) or was this simply a case of no existing test coverage for this at all? The interface change - I am digging into this a bit deeper if I can think of something to avoid it I'll let you know. If the interface changes stay this will have create a backwards incompatible change and with that will impact if we can easily backport this / in which version this might land. The better approach is probably to make the api impacting changes as outlined here. |
Hi @fooman , I'll try to answer all your questions. I need your advice for the interface part, it's explained at the end of this comment. About the templates, Changes are explained this way: About the tests, I think its covered by the following integration tests: All of them are based in About the interfaces, I already knew this page: http://devdocs.magento.com/guides/v2.0/contributor-guide/backward-compatible-development/#introduction-of-a-method-to-a-class-or-interface. In first place I refused to create a new interface, since new added methods really should belong to the specified @api interfaces. I'm ready to do it in another way, but I need some advice about what approach to take:
If new interface is going to replace old one, and I'm going to replace references to old interfaces in di.xml files and elsewhere it may appear, it should have a representative name, that is already taken by the old interface... Can you bring some light to all of this? Maybe I am missing something and I'd like to learn how am I supposed to do it properly. Thanks in advance. |
35bf33d
to
6f70066
Compare
@adrian-martinez-interactiv4 thanks a lot for the explanations and outlining the changes. This all looks great to me. In regards to the interface changes. For GrandTotalRatesInterface you are proposing to make this an ExtensibleDataInterface but your other code changes don't make use of setExtensionAttributes() or getExtensionAttributes(). I am okay with this change just wanted to check if this is deliberate. If so we can use the following name GrandTotalRatesExtensibleInterface.
This approach seems the best to me for the moment. It allows us to introduce the new one with the least amount of changes (api/deprecation notices) - however it still leaves the other option open (my gut feeling is that there might be further changes coming to the tax module - see for example here). AppliedTaxRateInterface could be AppliedTaxRateWithAmountInterface |
Closing due to inactivity. Feel free to reach me out anytime later if you wish to continue work on this pull request and it will be reopened. |
Full Tax Summary display wrong numbers.
Description
Full tax summary breakdown fails, as explained in #11358, solution taken from proposed gist: https://gist.github.com/heyqule/7c830137715544ff95baba50a5ed3d80
Fixed Issues (if relevant)
Manual testing scenarios
As explained in #11358
Contribution checklist