Fixing JavaScript errors for revising/discontinuing orders