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

Refunding remaining items on partially shipped order does not complete order #23964

Closed
squeegy06 opened this issue Jul 31, 2019 · 21 comments
Closed
Assignees
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update

Comments

@squeegy06
Copy link

We have an issue where occasionally a customer will place an order and one or more items in the order, but not all items, go on backorder and we are unable to ship them immediately. So instead we ship only some of the items and notify the customer of the backorder. And sometimes the customer doesn't want to wait, so they request a refund on the backordered items. When we complete the refund, all items on the order are either shipped or refunded, but the order will be set to a processing status instead of complete.

Preconditions (*)

  1. Magento 2.2.8

Steps to reproduce (*)

  1. Create an order with multiple items ordered.
  2. From the admin, create a shipment for only some of the items in the order.
  3. From the admin, create a credit memo and refund the remaining unshipped items on the order.
  4. Observe the order status.

Expected result (*)

I expected the order to be marked complete since all items have either been shipped or refunded.

Actual result (*)

The order status has been reset to processing.

Unfortunately because of the chain of events it's usually impossible for us to know before shipping that the customer wants a refund of the unshipped items. So we are unable to first refund and then ship which I understand WILL set the order status to complete. I'm just not sure though if this is a bug or if there is another step to our business logic we are missing that will result in the order being set to complete. Thanks in advance!

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jul 31, 2019
@m2-assistant
Copy link

m2-assistant bot commented Jul 31, 2019

Hi @squeegy06. 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.

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

  • yes
  • no

@engcom-Bravo engcom-Bravo self-assigned this Jul 31, 2019
@m2-assistant
Copy link

m2-assistant bot commented Jul 31, 2019

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: 👇

  • 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. Add label Issue: Confirmed once verification is complete.

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

@edenduong
Copy link
Contributor

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

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

@engcom-Bravo
Copy link
Contributor

Hello, @squeegy06, thanks for applying. We haven't noticed any information on invoicing the order in Your Steps To Reproduce. Before You create a Credit Memo for some part of the items, there obviously an invoice for those items has had to be created. That's what we are able to conclude from the description of Your case. But what we can not now is that whether You have the other (shipped) part of items invoiced too or not. In case that part has been invoiced the order status has to be Closed. If it has not yet been invoiced the order status has to remain Processing. That's the correct and expected behavior. We have checked both scenarios and we confirm everything works just like that.

@squeegy06
Copy link
Author

Hello @engcom-Bravo, I'm not sure I quite understand your response but I do see that I may have been a little lax on my steps to reproduce. When completing the purchase we checkout using a credit card method which invoices and captures the payment as part of the order creation. So if I had to update my steps to be more detailed.

  1. Browse to the frontend of your store.
  2. Add 2 or more items to your cart.
  3. Proceed to checkout and complete the order.
  4. From the admin panel, review the order, if an invoice was not created and payment not captured as part of your payment method you chose, create an invoice and capture payment.
  5. Create a shipment, but only ship some of the items on the order.
  6. Create a credit memo and refund the remaining unshipped items.
  7. Observe order status.

Result
The order is set to processing.

Expected Result
The order would be complete.

The end result is that all items on the order should be invoiced first, then only some of the items shipped, and the rest refunded. In that order.

@engcom-Bravo
Copy link
Contributor

engcom-Bravo commented Aug 1, 2019

Yes @squeegy06, You understand me quite right. Please take a look at one of Your orders which has already been completely invoiced and captured whether the Invoice button is still displayed there on the order page in admin, like this
invoice

@squeegy06
Copy link
Author

@engcom-Bravo No, I do not see the invoice button when I view an order that I have placed.

@engcom-Bravo
Copy link
Contributor

Ok, @squeegy06, then let me ask You yet to try to reproduce the issue on a vanilla 2.3-develop instance as we are not able to reproduce it on such. (Yes, I see Your version is 2.2.8 but if we can not reproduce an issue on such an instance we are supposed to close it according to our workflow). Thank You.

@squeegy06
Copy link
Author

@engcom-Bravo I have found what I am missing. The issue is only occurring when we issue a partial refund on a single sku. Let me update my steps.

  1. From the frontend, add multiple quantities (2 or more) of a single item. For example, add 2 of the same tote bag to your order.
  2. Complete the order as usual.
  3. From the admin review the order, be sure it's invoiced.
  4. Create a partial shipment and ship only 1 of the 2 items you ordered.
  5. Create a partial credit memo refunding the unshipped portion of your order.
  6. Observe the order status.

I'm sorry, I originally thought this was happening no matter how the order was structured, but this seems to only happen when a single SKU is partially shipped and partially refunded. So the correct example would be when a customer orders 10 XL Example T-shirts (SKU ABC123-XL), but at time of shipping we only have 9 XL Example T-shirts (SKU ABC123-XL). So we ship the 9 shirts, and later the customer asks for a refund on the 10th shirt since they don't want to wait for the backorder to be fulfilled. The key in all this is that the partial shipment and refund is all happening on a single SKU.

@engcom-Bravo
Copy link
Contributor

Please @squeegy06, watch our video and tell us where we go wrong if we do so.
StatusComplete

@squeegy06
Copy link
Author

@engcom-Bravo Looks like me you followed my steps to the letter. I will have to do some more testing then to figure our what I am missing. I appreciate your help and sorry for any wasted time.

@engcom-Bravo
Copy link
Contributor

You are welcome @squeegy06. Waiting for Your updates.

@engcom-Bravo engcom-Bravo removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update labels Aug 2, 2019
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Aug 2, 2019
@squeegy06
Copy link
Author

Hello @engcom-Bravo,

I have returned from vacation and this morning just to be extra I wiped my entire vanilla install of Magento 2.2.8 and reinstalled just Magento 2.2.8 and the demo data. I followed my own steps and I was able to repeat the results I have been getting. The order still remains in "processing". So maybe this is an issue fixed in 2.3? Unfortunately we are not prepared to update to 2.3 at this time. I await your input.

Thanks!

@engcom-Bravo
Copy link
Contributor

Hi, @squeegy06.
Unfortunately, I do not have direct Pull Request number or commits where exactly in was fixed.
I tried to find at least something similar by keywords in the internal Jira and closed GitHub issues but did not find.
It could mean this issue was fixed in the scope of some other task/ticket/issue internally or by community.
Here is a similar issue to Yours #12386 that is said to have already been fixed. But I'm not sure it's about the fix You are looking for.

@engcom-Bravo
Copy link
Contributor

Ok @squeegy06, due to my workflow (please the details to step 4 of #23964 (comment)) I was supposed to close the issue right after it had been not reproduced for the first time. I hope I helped You at least something. Feel free to reopen the issue if You manage to reproduce it on the latest develop version. Thanks for applying.

@squeegy06
Copy link
Author

Just for anyone who stumbles on this, I finally found my fix for this issue here in this commit 54139e3#diff-886404471665983d5e6c6cf05c4788d8

@DJB95
Copy link

DJB95 commented Jan 5, 2021

experiencing the same issue, even on M2.4.1. steps to reproduce are exactly the same as described in squeegy06's comment:

@engcom-Bravo I have found what I am missing. The issue is only occurring when we issue a partial refund on a single sku. Let me update my steps.

  1. From the frontend, add multiple quantities (2 or more) of a single item. For example, add 2 of the same tote bag to your order.
  2. Complete the order as usual.
  3. From the admin review the order, be sure it's invoiced.
  4. Create a partial shipment and ship only 1 of the 2 items you ordered.
  5. Create a partial credit memo refunding the unshipped portion of your order.
  6. Observe the order status.

I'm sorry, I originally thought this was happening no matter how the order was structured, but this seems to only happen when a single SKU is partially shipped and partially refunded. So the correct example would be when a customer orders 10 XL Example T-shirts (SKU ABC123-XL), but at time of shipping we only have 9 XL Example T-shirts (SKU ABC123-XL). So we ship the 9 shirts, and later the customer asks for a refund on the 10th shirt since they don't want to wait for the backorder to be fulfilled. The key in all this is that the partial shipment and refund is all happening on a single SKU.

Is there any timeline on integrating the fix mentioned in the last comment in a new magento release?

Just for anyone who stumbles on this, I finally found my fix for this issue here in this commit 54139e3#diff-886404471665983d5e6c6cf05c4788d8

Thanks!

@timpea
Copy link

timpea commented Apr 12, 2021

@DJB95 We are having the same issue in 2.4.2 - I think it will be fixed in 2.4.3 - #31063

@Arcturus2321
Copy link

Having the same issue in 2.4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Progress: needs update
Projects
None yet
Development

No branches or pull requests

7 participants