magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

Creating a creditmemo without products doesn't work anymore in 2.4 #35333

Closed antonfries closed 2 years ago

antonfries commented 2 years ago

Preconditions (*)

  1. Magento 2.4.3-p2

Steps to reproduce (*)

  1. Create an order
  2. Create an invoice
  3. Try to issue a partial refund without giving the products back

Expected result (*)

2022-04-20_09h34_32 Does work in latest 2.3.7-p3 release, updating qty to 0 results in order total = 0

Actual result (*)

2022-04-20_09h35_45 Updating qty to 0 doesn't affect order total, creating refund with field "adjustment fee" renders products in creditmemo pdf


m2-assistant[bot] commented 2 years ago

Hi @antonfries. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

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

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

engcom-November commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

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

m2-assistant[bot] commented 2 years ago

Hi @engcom-November. 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:

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-November, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

engcom-November commented 2 years ago

@antonfries , Thank you for reporting and collaboration. Verified this issue on both Magento 2.4-develop branch and 2.4.3-p2 instance but cannot able to reproduce the issue. Steps performed:

  1. Create Order
  2. Submit Invoice from admin (Sales - Orders - View Order - Invoice)
  3. Click on Credit Memo - Update Qty to "0" - "Refund Offline" button is disabled
  4. Enter partial refund amount and click on Update Totals - Refund Offline button is enabled
  5. Click on Refund Offline - Working fine
  6. Credit memo issued. image

image Kindly recheck the issue on Magento 2.4-develop branch as it is the upcoming 2.4.x release / have latest code base and provide missing steps if any if the issue is still reproducible. Thank you.

antonfries commented 2 years ago

There is some more configuration necessary to get to the code block, which is not working: 2022-04-20_14h39_07 Method call $rate->getId() in vendor/magento/module-sales/view/adminhtml/templates/order/totals/tax.phtml Line 62 and 77 My sample configuration (a bit overloaded), transported from a customer project: admin/system_config/edit/section/carriers/: 2022-04-20_14h44_18 admin/system_config/edit/section/tax/: 2022-04-20_14h45_07 2022-04-20_14h45_19 2022-04-20_14h45_25 Some tax rules: 2022-04-20_14h46_41 2022-04-20_14h46_59 2022-04-20_14h47_37

antonfries commented 2 years ago

And then take the free shipping method in the order to get no taxes applied to not get into the if-block in vendor/magento/module-tax/Helper/Data.php::763 if ($shippingTaxAmount && $originalShippingTaxAmount && $shippingTaxAmount != 0 && (float)$originalShippingTaxAmount )

engcom-November commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

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

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-November, here is your Magento Instance: https://3b47c4b614222cddf4ba4385be4705e3.instances.magento-community.engineering Admin access: https://3b47c4b614222cddf4ba4385be4705e3.instances.magento-community.engineering/admin_8f7d Login: be199081 Password: 0515340d2b0b

antonfries commented 2 years ago

Did some research, seems to be fixed in 2.4.4: https://github.com/magento/magento2/commit/d648bdc238ba6b59890694251655f725ad1b5d88 Error seems in 2.4.3-p2: https://github.com/magento/magento2/blob/2.4.3-p2/app/code/Magento/Sales/view/adminhtml/templates/order/totals/tax.phtml line 62,77 So we fixing this in all our 2.4.3 customer projects 👍

engcom-November commented 2 years ago

Thanks for the update @antonfries , We are closing this issue as its fixed in 2.4-develop: https://github.com/magento/magento2/commit/d648bdc238ba6b59890694251655f725ad1b5d88. Kindly reopen this / create a new ticket if you are still facing any issues. Thank you.