We can discern three types of action on an order. Split those, and group actions within a type.
First of all, I would give the button for the only option that the orders have in common, which is to view them (I'm assuming here that there's no objection to viewing a new order), its own, more predictable location. Now it's jumping all over the place, depending on the other options available.
When editing an order, the user first needs to see what's in there. So remove the edit button here and make the edit option accessible from the view screen.
Now we're left with sending, resending, recieving, cancelling, and uncancelling. You can use a dropdown, but these are a bit more finicky than regular buttons, so perhaps a grid of five buttons would be best. Don't hide the options that are not available, but disable them, so each button will always be in the same location.
View first, Action later
Or, as per Annemiek's excellent suggestion, make viewing available by clicking on the row. Remove all buttons and relocate them to the view screen, if an extra click per order is not a problem. That depends a bit on your users. It does create an extra check, sort of, because a user has to view an order first before acting on it.