Assuming orderstatus is required, the following result was found.
// set the filter for orders by status to return: All, Active, Cancelled, CancelPending, Completed, Inactive, InProcess v_OrderStatus = "All"; // // calculate from and till v_OrdersFrom = v_Year + "-01-01T00:00:00.000Z"; v_OrdersTill = v_Year +...