+
+if (isset($_GET['ModifyOrderNumber']) && is_prepaid_order_open($_GET['ModifyOrderNumber']))
+{
+ display_error(_("This order cannot be edited because there are invoices or payments related to it, and prepayment terms were used."));
+ end_page(); exit;
+}
+if (isset($_GET['ModifyOrderNumber']))
+ check_is_editable(ST_SALESORDER, $_GET['ModifyOrderNumber']);
+elseif (isset($_GET['ModifyQuotationNumber']))
+ check_is_editable(ST_SALESQUOTE, $_GET['ModifyQuotationNumber']);
+