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

Can't create more than one credit memo if order's grand total is 0 #33237

Open
1 task
mushketer888 opened this issue Jun 14, 2021 · 15 comments
Open
1 task

Can't create more than one credit memo if order's grand total is 0 #33237

mushketer888 opened this issue Jun 14, 2021 · 15 comments
Labels
Area: Order Component: Admin Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reproduced on 2.4.2

Comments

@mushketer888
Copy link

mushketer888 commented Jun 14, 2021

Preconditions (*)

Magento 2.3.3

Steps to reproduce (*)

  1. Crete order with 100% discount on all items and shipping. (Cart rule promo code can be used for that) Grand total (including shipping) must be 0. Order must contain product's quantity atleast as 2
  2. Create credit memo and refund order with "Qty to Refund" = 1. ("Return to stock" doesn't affect on this issue)
    2021-06-1413:35:50

Expected result (*)

  1. Be able to refund left ordered/invoiced items (to fully refund order/items)

Actual result (*)

  1. Magento 2 doesn't give ability to create additional credit memo

In my opinion the problem lies in Magento\Sales\Model\Order.php canCreditmemo()
and in canCreditmemoForZeroTotal() see HERE

//check if total paid is less than grandtotal
$checkAmtTotalPaid = $totalPaid <= $this->getGrandTotal();

So if totalPaid ==0 and grandTotal ==0 then canCreditmemoForZeroTotal==false

But more precise maybe this code:
$paidAmtIsRefunded = $this->getTotalRefunded() == $totalPaid && $creditmemos;
totalRefunded==0, totalPaid==0 and has credit memos

Is there some patch or workaround for that?

  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
@m2-assistant
Copy link

m2-assistant bot commented Jun 14, 2021

Hi @mushketer888. 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.4-develop instance - upcoming 2.4.x release

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

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

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

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

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

@m2-community-project m2-community-project bot added this to Ready for Confirmation in Issue Confirmation and Triage Board Jun 14, 2021
@mushketer888 mushketer888 changed the title Can't create more than one credit memo if grand total is 0 Can't create more than one credit memo if order's grand total is 0 Jun 14, 2021
@engcom-Echo engcom-Echo self-assigned this Jun 14, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jun 14, 2021

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

  • 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-Echo
Copy link
Contributor

Hi @mushketer888

We are not able to re-produce the issue based on steps provided. Can you please verify the same on latest magento instance that is 2.4-develop and let us know if you get this issue there.

Thanks

@engcom-Echo engcom-Echo added the Issue: needs update Additional information is require, waiting for response label Jun 14, 2021
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Jun 14, 2021
@engcom-Echo engcom-Echo added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Jun 14, 2021
@mushketer888
Copy link
Author

@magento give me 2.4-develop instance

@magento-deployment-service
Copy link

Hi @mushketer888. Thank you for your request. I'm working on Magento instance for you.

@mushketer888
Copy link
Author

mushketer888 commented Jun 15, 2021

@engcom-Echo
I was able to replicate this issue on magento 2.4-develop instance mentioned above:
2021-06-1515:34:37
See Order # 000000004
Only one credit memo can be created if I have used 100% discount (including shipping) promo code!

@engcom-Echo engcom-Echo added Issue: ready for confirmation and removed Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: needs update Additional information is require, waiting for response labels Jun 18, 2021
@m2-community-project m2-community-project bot moved this from Needs Update to Ready for Confirmation in Issue Confirmation and Triage Board Jun 18, 2021
@m2-community-project m2-community-project bot moved this from Needs Update to Ready for Confirmation in Issue Confirmation and Triage Board Jun 18, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jun 29, 2021

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

  • 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-Delta engcom-Delta added the Issue: needs update Additional information is require, waiting for response label Jun 30, 2021
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Jun 30, 2021
@engcom-Delta
Copy link
Contributor

Hi @mushketer888,

Tried to reproduce the issue but step 2 is not clear , Hence Kindly provide steps for Creating credit memo.

Therefore , Added the label 'Needs update'.

Thanks

@mushketer888
Copy link
Author

mushketer888 commented Jul 2, 2021

Hi @engcom-Delta
The step 2 is just to create credit memo for order which has discount on all items and shipping with amount of 100% but with less product's quantity that order/invoice has

For example:
order 2 same products (qty=2) with discount of 100% (with shipping discount of 100% too) grandtotal must be 0.00
create creditmemo, but refund only 1 product qty
then try to create one more (second) creditmemo to refund lasting product item - you won't be able to do it
so basically if order's grand total = 0 then you can create only one credit memo, it doesn't check if there's more refundable product's left

@engcom-Delta
Copy link
Contributor

engcom-Delta commented Jul 12, 2021

Hi @mushketer888,

I tried to reproduce the issue on Magento 2.4.2 as per provided steps & comments.
in fact, i have not able to create credit memo for the order which has 100% discount( cart items + shipping).
Kindly find the attached screenshots for reference. Hence issue marked as 'Issue confirmed'
33237-1
33237-2

order#
33237-3
33237-4
33237-5
33237-6

Note: Create Credit Memo option is missing after refunded 1 item & order status closed

Steps followed:

  1. Create cart rule promo with 100% discount with quantity + shipping method
  2. order 2 same products (qty=2) with discount of 100% (with shipping discount of 100% too) grandtotal must be 0.00
    create credit memo, but refund only 1 product qty
  3. then try to create one more (second) creditmemo to refund lasting product item - you won't be able to do it
    so basically if order's grand total = 0 then you can create only one credit memo, it doesn't check if there's more refundable product's left.
  4. Observe that you are not able to create second credit memo.

@engcom-Delta engcom-Delta removed the Issue: needs update Additional information is require, waiting for response label Jul 12, 2021
@engcom-Delta engcom-Delta added Component: Admin Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.2 labels Jul 12, 2021
@m2-community-project m2-community-project bot removed the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Jul 12, 2021
@m2-community-project m2-community-project bot moved this from Needs Update to Confirmed in Issue Confirmation and Triage Board Jul 12, 2021
@m2-community-project m2-community-project bot moved this from Needs Update to Confirmed in Issue Confirmation and Triage Board Jul 12, 2021
@m2-community-project m2-community-project bot added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jul 12, 2021
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Delta
Thank you for verifying the issue. Based on the provided information internal tickets MC-42822 were created

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

@gabrieldagama gabrieldagama added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Jul 13, 2021
@m2-community-project m2-community-project bot added this to Ready for Development in High Priority Backlog Jul 13, 2021
@simonmaass
Copy link

can confirm this for 2.4.4

@simonmaass
Copy link

any chance this will get resolved?

@nishanthan1989
Copy link

any update on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Order Component: Admin Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reproduced on 2.4.2
Projects
High Priority Backlog
  
Ready for Development
Development

No branches or pull requests

7 participants