history and save order to database complete