-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
When process an Order on Magento 2 we have different status like Pending, Invoiced, Shipment, Complete, etc. Working in production mode we found that is too difficult detect the datetime when an Order change to 'complete' status.
There is a table called 'sales_order_status_history' that save the history of every step on one order. But we tested change in different way the order, and allways show the field status = 'processing', inclusively when order is changed to status = 'complete'. In this way can not detect the real dateime when order go changing to different status.
Preconditions
On production mode on Magento 2 using Luma theme, simulate a purchase on frontend with normal user, this create an Order in pending mode (the payment method is not important, we have tested with different methods).
Environment: Tested using Magento 2.1.3 and 2.1.6 (PHP 7, Mysql 5.6, Nginx)
Steps to reproduce
- Go to frontend, make a purchase, using any payment method, and finish the purchase process on checkout.
- Got to admin panel, search the order generated, make a shipment and update order status.
- Again open the order and generate Invoice and update order status.
4.Finally check that order show the order status = 'complete'
Expected result
- If we make a SQL on database checking datetime of every change of status of one order, the result show allways in processing mode. You can try look the process on one order with this SQL command:
SELECT h.status, h.created_at, h.entity_name
FROM sales_order AS o
INNER JOINsales_order_status_history
AS h ON h.parent_id = o.entity_id
WHERE o.increment_id = '3000004389';
We spected a result like:
status | created_at | entity_name
processing 2017-05-08 19:05:08 order
Complete 2017-05-19 19:48:38 invoice
Actual result
- The SQL proposed show nothing, because table sales_order_status_history allways have status in processing value.
Current result:
status | created_at | entity_name
processing 2017-05-08 19:05:08 order
processing 2017-05-19 19:48:38 invoice