Add up the total sales after ordering on the Woocommerce Orderson order page


I would like to add the total order quantity for orders to administrative orders after the orders have been counted for each order status

I tried this code to get the total sales of the order for a specific order status
Here Enter the image description here

Function wh_get_total_sold_order_status ($ order_status) {
global $ wpdb;


$ sql = "
SELECT COUNT (*) AS sale_count
FROM {$ wpdb-> prefix} woocommerce_order_items AS order_items
INNER JOIN {$ wpdb-> prefix} woocommerce_order_itemmeta AS order_meta ON order_items.order_item_id = order_meta.order_item_id
INNER JOIN {$ wpdb-> posts} AS publishes ON order_meta.meta_value = posts.ID
WHERE order_items.order_item_type = & # 39; line_item & # 39;

AND order_items.order_id IN (
SELECT posts.ID AS post_id
FROM {$ wpdb-> posts} AS posts
WHERE posts.post_type = & # 39; shop_order & # 39;
AND posts.post_status =% s

)
GROUP BY order_meta.meta_value ";

return $ wpdb-> get_var ($ wpdb-> prepare ($ sql, $ order_status));
}

I've been trying to figure out how the post status list for the Admin Edit.ph page for the Woocommerce post type & # 39; shop_order & # 39; can be edited, but I did not find out how to do that.
Any help would be noticeable.