Magento2: Credit Memo - doesn't recalculate tax

Created on 29 Jul 2019  路  27Comments  路  Source: magento/magento2

If an order is placed for $65.00 (incl tax) and we want to refund the customer $5. We set adjustment fee to $60.00 ($5 refunded).

The totals appear correct, but the tax on the credit memo is the tax from original order, not the tax on the refund.

The tax needs to be recalculated for credit memo, as we must be able to refund tax properly.

related issue:
https://github.com/magento/magento2/issues/7937
(closed - even though this issue still exists)

Preconditions (*)

  1. magento 2.3.2, latest version 2.4
  2. ubuntu 19.04
  3. php 7.2

Steps to reproduce (*)

  1. place an order with tax
    Screenshot from 2019-07-29 13-41-14
    ($10 is relevant further down)
  2. go into admin and credit memo the order
  3. set adjustment fee to new total for the order (original total - refund amount)
  4. view credit memo created
    Screenshot from 2019-07-29 13-38-30

How can the tax be $10 on a $5 refund? This needs to be fixed to recalculate tax on the refund.

Expected result (*)

  1. Tax is recalculated upon creating credit memo

Actual result (*)


1.Tax is not recalculated upon creating credit memo

Sales Tax Confirmed ready for confirmation P1 ready for dev Reproduced on 2.4.x S1

Most helpful comment

I cannot understand how a bug of this importance can be on hold for a year.

All 27 comments

Hi @asim-vax. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@asim-vax do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • [ ] 6. Add label Issue: Confirmed once verification is complete.

  • [ ] 7. Make sure that automatic system confirms that report has been added to the backlog.

:white_check_mark: Confirmed by @engcom-Bravo
Thank you for verifying the issue. Based on the provided information internal tickets MC-18737, MC-18738 were created

Issue Available: @engcom-Bravo, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

@magento give me 2.3-develop instance - upcoming 2.3.x release

Hi @MrGangola-Webkul. Thank you for your request. I'm working on Magento 2.3-develop instance for you

Hi @MrGangola-Webkul, here is your Magento instance.
Admin access: https://i-23938-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

Any news? This is a critical bug, We cannot make legal credit invoices with corrections

I totally agree, we works with Magento since it exists and there was never any solution for that problem. We cannot do legal accounting in current situation.

That was an old issue: https://github.com/magento/magento2/issues/3284

I cannot understand how a bug of this importance can be on hold for a year.

Why is this not fixed yet? It's quite important that we/everyone send the legal credit invoices.

Why it's closed? Already fixed ?

@sdzhepa could you please shed some light on this? This is still an important issue!

Hello @webtekindo @sprankhub

The issue was closed by mistake. After closing the internal issue that was related for 2.2x version only.

Sorry for the confusion.

I reopen this issue. It should be reverified on the latest 2.4-develop code.

@engcom-Oscar Could you please recheck this issue on the latest 2.4-develop
if its still actual please do

  • Update description with latest version 2.4
  • Update steps to be more clear(if applicable)
  • set label "repro on: 2.4.x"
  • set label "Issue: Confirmed"

But if this issue is not repro on the latest code(e.g. only on 2.3.x) - the issue should be closed.
We are not able to process and deliver into 2.3.x through this public repository

Hi @engcom-Oscar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Oscar Thank you for verifying the issue.

Unfortunately, not enough information was provided to acknowledge ticket. Please consider adding the following:

  • [ ] Add "Reproduced on " label(s) to this ticket based on verification result

Once all required information is added, please add label "Issue: Confirmed" again.
Thanks!

:white_check_mark: Confirmed by @engcom-Oscar
Thank you for verifying the issue. Based on the provided information internal tickets MC-37422 were created

Issue Available: @engcom-Oscar, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

@engcom-Oscar I see you label this as a feature request. But this is not a feature, it's a big issue and requirement to make any legal accounting with Magento, and that since Magento exists.

This situation put all users (at least European) in a situation where we do not not comply to the law with incorrect refund invoice sent to customer. We have to explain to every customer complain why the refund is incorrect, especially B2B, and some customers and their accountants are not so receptive to that issue.

So maybe a little more attention to that issue will be much appreciated by the community and our accountants.

Also because that issue is not easy to solve correctly by any developer, it always ended up closed at some point. But a developer and business owner point of view on that issue differs a lot.

Agree to @webtekindo. Without being this solved there is no way Magento complies with the EU Law!

@asim-vax @luisgsoft @tropilex @sprankhub did you somehow manage to find a trick, a patch, or an extension that solves that problem?

As it looks like it won't be solved any time soon by Magento.

For M1, we basically use https://magento.stackexchange.com/a/173992/142 / https://gist.github.com/Schrank/896561c841f564efb003c87441e90a4e for some clients. We did not implement it for M2 yet, but it may be pretty similar (not sure).

Unfortunately no, we still use credit memo functionality - but it is wrong. Thanks @sprankhub we will take a look at this.

:white_check_mark: Confirmed by @sivaschenko
Thank you for verifying the issue. Based on the provided information internal tickets MC-37422 were created

Issue Available: @sivaschenko, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

@magento give me 2.4-develop instance

Hi @engcom-Echo. Thank you for your request. I'm working on Magento instance for you.

@asmin-vax @webtekindo
Unfortunately, I can't reproduce this behaviour. I got the next result:

screenshot_5

screenshot_6

screenshot_7

Peek 2020-12-01 10-03

This was expected - User guide
For Adjustment Fee, enter a value to be subtracted from the total amount refunded. This amount is not subtracted from a specific section of the order such as shipping, items, or tax.

Please provide additional information(steps) to reproduce an issue.

@engcom-Echo

Ok let's take an example, of legal accounting in Europe.

Sale Order
1 x Product A (taxable at 20%) = 100 euros (incl.tax)
Tax = 16.67 euros
Total = 100 euros

We want to refund that customer 50%.

Credit memo
1 x Product A = 50 euros
Tax = 8.33 euros (THIS IS CORRECT)
Total = 50 euros

That's what any european accountant expect. Then my question will be how you do that in Magento ?

Let's try:

Credit memo Test 1
0 x Product A = 0 euros
Adjustment Refund = 50 euros
Tax = 0 euros (THIS IS WRONG)
Total = 50 euros

Credit memo Test 2
1 x Product A = 100 euros
Adjustment Fee = 50 euros
Tax = 16.67 euros (THIS IS WRONG)
Total = 50 euros

For business where transactions are without taxes Adjustment Refund/Fee works perfectly, and probably nothing to change here like you mention:

For Adjustment Fee, enter a value to be subtracted from the total amount refunded. This amount is not subtracted from a specific section of the order such as shipping, items, or tax.

The only possible correct solution to make legal accounting in Magento is to add the possibility to set custom price by credit memo line item. As different products can have different taxes, then the taxes can be calulcated correctly.

Please consult with an accountant if it's not clear. This is not a bug, this is a logic problem!

Thank you.

Was this page helpful?
0 / 5 - 0 ratings